]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: host: Rework nvhost sync API
authorArto Merilainen <amerilainen@nvidia.com>
Tue, 18 Mar 2014 11:35:42 +0000 (13:35 +0200)
committerArto Merilainen <amerilainen@nvidia.com>
Tue, 25 Mar 2014 12:39:46 +0000 (05:39 -0700)
vhost sync API used both nvhost_sync_pt and sync_pt structures when
requesting information about a syncpoint. This is unnecessary as
in practise we always have only the sync_pt structure when calling
the sync API. This patch modifies the sync API so that we use
sync_pt structure by default.

Change-Id: I1e3f23b06d4ebd8894acca7c29d0ba38d475a92b
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/383110
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
drivers/video/tegra/host/gk20a/channel_sync_gk20a.c
drivers/video/tegra/host/host1x/host1x_channel.c
drivers/video/tegra/host/nvhost_sync.c
drivers/video/tegra/host/nvhost_sync.h

index ecd5fc0b6c8529549aef7a757d708e506c69bfee..0474bc3a04edcf58fdb00aebeed927d9bee8de29 100644 (file)
@@ -106,7 +106,7 @@ int gk20a_channel_syncpt_wait_fd(struct gk20a_channel_sync *s, int fd,
 #ifdef CONFIG_SYNC
        int i;
        int num_wait_cmds;
-       struct sync_pt *pos;
+       struct sync_pt *pt;
        struct sync_fence *sync_fence;
        struct priv_cmd_entry *wait_cmd = NULL;
        struct gk20a_channel_syncpt *sp =
@@ -127,8 +127,7 @@ int gk20a_channel_syncpt_wait_fd(struct gk20a_channel_sync *s, int fd,
        }
 
        i = 0;
-       list_for_each_entry(pos, &sync_fence->pt_list_head, pt_list) {
-               struct nvhost_sync_pt *pt = to_nvhost_sync_pt(pos);
+       list_for_each_entry(pt, &sync_fence->pt_list_head, pt_list) {
                u32 wait_id = nvhost_sync_pt_id(pt);
                u32 wait_value = nvhost_sync_pt_thresh(pt);
 
index b563a7ad7779afa3b76d9af5570e8525f7c69c7c..bfce4e1f774642bc0c2cc0ece080e3687af5915c 100644 (file)
@@ -119,8 +119,7 @@ static void add_sync_waits(struct nvhost_channel *ch, int fd)
        struct nvhost_master *host = nvhost_get_host(ch->dev);
        struct nvhost_syncpt *sp = &host->syncpt;
        struct sync_fence *fence;
-       struct sync_pt *_pt;
-       struct nvhost_sync_pt *pt;
+       struct sync_pt *pt;
        struct list_head *pos;
 
        if (fd < 0)
@@ -143,8 +142,7 @@ static void add_sync_waits(struct nvhost_channel *ch, int fd)
                u32 id;
                u32 thresh;
 
-               _pt = container_of(pos, struct sync_pt, pt_list);
-               pt = to_nvhost_sync_pt(_pt);
+               pt = container_of(pos, struct sync_pt, pt_list);
                id = nvhost_sync_pt_id(pt);
                thresh = nvhost_sync_pt_thresh(pt);
 
index 5e9fd926911ee72b9bb3f579fcf9686d867e48ac..70df16be9d61c778361bb058cc2142cfcc49ed80 100644 (file)
@@ -55,7 +55,7 @@ struct nvhost_sync_pt_inst {
        struct nvhost_sync_pt           *shared;
 };
 
-struct nvhost_sync_pt *to_nvhost_sync_pt(struct sync_pt *pt)
+static struct nvhost_sync_pt *to_nvhost_sync_pt(struct sync_pt *pt)
 {
        struct nvhost_sync_pt_inst *pti =
                        container_of(pt, struct nvhost_sync_pt_inst, pt);
@@ -289,13 +289,15 @@ int nvhost_sync_num_pts(struct sync_fence *fence)
        return num;
 }
 
-u32 nvhost_sync_pt_id(struct nvhost_sync_pt *pt)
+u32 nvhost_sync_pt_id(struct sync_pt *__pt)
 {
+       struct nvhost_sync_pt *pt = to_nvhost_sync_pt(__pt);
        return pt->obj->id;
 }
 
-u32 nvhost_sync_pt_thresh(struct nvhost_sync_pt *pt)
+u32 nvhost_sync_pt_thresh(struct sync_pt *__pt)
 {
+       struct nvhost_sync_pt *pt = to_nvhost_sync_pt(__pt);
        return pt->thresh;
 }
 
index 00fe28218562c746856a79573a7bd1e7e6f3cabf..055f6e07ba05ab5f5bbea4c551bf1c6f6872336b 100644 (file)
@@ -50,9 +50,8 @@ struct sync_fence *nvhost_sync_create_fence(
                const char *name);
 struct sync_fence *nvhost_sync_fdget(int fd);
 int nvhost_sync_num_pts(struct sync_fence *fence);
-struct nvhost_sync_pt *to_nvhost_sync_pt(struct sync_pt *pt);
-u32 nvhost_sync_pt_id(struct nvhost_sync_pt *pt);
-u32 nvhost_sync_pt_thresh(struct nvhost_sync_pt *pt);
+u32 nvhost_sync_pt_id(struct sync_pt *pt);
+u32 nvhost_sync_pt_thresh(struct sync_pt *pt);
 
 #else
 static inline struct nvhost_sync_timeline *nvhost_sync_timeline_create(
@@ -96,17 +95,12 @@ static inline int nvhost_sync_num_pts(struct sync_fence *fence)
        return 0;
 }
 
-static inline struct nvhost_sync_pt *to_nvhost_sync_pt(struct sync_pt *pt)
-{
-       return NULL;
-}
-
-static inline u32 nvhost_sync_pt_id(struct nvhost_sync_pt *pt)
+static inline u32 nvhost_sync_pt_id(struct sync_pt *pt)
 {
        return NVSYNCPT_INVALID;
 }
 
-static inline u32 nvhost_sync_pt_thresh(struct nvhost_sync_pt *pt)
+static inline u32 nvhost_sync_pt_thresh(struct sync_pt *pt)
 {
        return 0;
 }