video: tegra: host: Add syncpt management control
Arto Merilainen [Wed, 20 Feb 2013 14:13:40 +0000 (16:13 +0200)]
This patch adds support for enabling and disabling syncpoint
management.

Change-Id: I59b5c86f51f26c90a474b283a440112eac31d86c
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/202572
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>

drivers/video/tegra/host/nvhost_syncpt.c
drivers/video/tegra/host/nvhost_syncpt.h

index d10e56a..4a5501a 100644 (file)
@@ -560,6 +560,13 @@ int nvhost_syncpt_nb_mlocks(struct nvhost_syncpt *sp)
        return syncpt_to_dev(sp)->info.nb_mlocks;
 }
 
+void nvhost_syncpt_set_manager(struct nvhost_syncpt *sp, int id, bool client)
+{
+       u64 mask = 1ULL << id;
+       syncpt_to_dev(sp)->info.client_managed &= ~mask;
+       syncpt_to_dev(sp)->info.client_managed |= client ? mask : 0;
+}
+
 /* public sync point API */
 u32 nvhost_syncpt_incr_max_ext(struct platform_device *dev, u32 id, u32 incrs)
 {
index 53b3e6c..d9cd48d 100644 (file)
@@ -97,6 +97,7 @@ int nvhost_syncpt_client_managed(struct nvhost_syncpt *sp, u32 id);
 int nvhost_syncpt_nb_pts(struct nvhost_syncpt *sp);
 int nvhost_syncpt_nb_bases(struct nvhost_syncpt *sp);
 int nvhost_syncpt_nb_mlocks(struct nvhost_syncpt *sp);
+void nvhost_syncpt_set_manager(struct nvhost_syncpt *sp, int id, bool client);
 
 static inline bool nvhost_syncpt_check_max(struct nvhost_syncpt *sp,
                u32 id, u32 real)