gpu: arm: midgard: fix build error in r5p0_06rel0 with CONFIG_SYNC 62/150262/2
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Fri, 15 Sep 2017 02:34:26 +0000 (11:34 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Fri, 15 Sep 2017 04:52:23 +0000 (13:52 +0900)
The fence code in midgard r5p0_06rel0 has build error with
CONFIG_SYNC because it uses old sync framework. Fix the build error
with CONFIG_SYNC as fixed in r12p0.

Change-Id: I9233a9d64a802e92b5c973c172eda01c083c2fa7
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
drivers/gpu/arm/midgard/r5p0_06rel0/mali_kbase_softjobs.c
drivers/gpu/arm/midgard/r5p0_06rel0/mali_kbase_sync.c

index f762996..940a963 100644 (file)
@@ -167,13 +167,21 @@ static enum base_jd_event_code kbase_fence_trigger(struct kbase_jd_atom *katom,
        struct sync_pt *pt;
        struct sync_timeline *timeline;
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
        if (!list_is_singular(&katom->fence->pt_list_head)) {
+#else
+       if (katom->fence->num_fences != 1) {
+#endif
                /* Not exactly one item in the list - so it didn't (directly) come from us */
                return BASE_JD_EVENT_JOB_CANCELLED;
        }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
        pt = list_first_entry(&katom->fence->pt_list_head, struct sync_pt, pt_list);
-       timeline = pt->parent;
+#else
+       pt = container_of(katom->fence->cbs[0].sync_pt, struct sync_pt, base);
+#endif
+       timeline = sync_pt_parent(pt);
 
        if (!kbase_sync_timeline_is_ours(timeline)) {
                /* Fence has a sync_pt which isn't ours! */
@@ -212,7 +220,11 @@ static void kbase_fence_wait_callback(struct sync_fence *fence, struct sync_fenc
        /* Propagate the fence status to the atom.
         * If negative then cancel this atom and its dependencies.
         */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
        if (fence->status < 0)
+#else
+       if (atomic_read(&fence->status) < 0)
+#endif
                katom->event_code = BASE_JD_EVENT_JOB_CANCELLED;
 
        /* To prevent a potential deadlock we schedule the work onto the job_done_wq workqueue
index 506b397..6181dcc 100644 (file)
@@ -53,7 +53,7 @@ static struct sync_pt *timeline_dup(struct sync_pt *pt)
 {
        struct mali_sync_pt *mpt = to_mali_sync_pt(pt);
        struct mali_sync_pt *new_mpt;
-       struct sync_pt *new_pt = sync_pt_create(pt->parent, sizeof(struct mali_sync_pt));
+       struct sync_pt *new_pt = sync_pt_create(sync_pt_parent(pt), sizeof(struct mali_sync_pt));
 
        if (!new_pt)
                return NULL;
@@ -68,7 +68,7 @@ static struct sync_pt *timeline_dup(struct sync_pt *pt)
 static int timeline_has_signaled(struct sync_pt *pt)
 {
        struct mali_sync_pt *mpt = to_mali_sync_pt(pt);
-       struct mali_sync_timeline *mtl = to_mali_sync_timeline(pt->parent);
+       struct mali_sync_timeline *mtl = to_mali_sync_timeline(sync_pt_parent(pt));
        int result = mpt->result;
 
        int diff = atomic_read(&mtl->signalled) - mpt->order;
@@ -159,7 +159,7 @@ struct sync_pt *kbase_sync_pt_alloc(struct sync_timeline *parent)
 void kbase_sync_signal_pt(struct sync_pt *pt, int result)
 {
        struct mali_sync_pt *mpt = to_mali_sync_pt(pt);
-       struct mali_sync_timeline *mtl = to_mali_sync_timeline(pt->parent);
+       struct mali_sync_timeline *mtl = to_mali_sync_timeline(sync_pt_parent(pt));
        int signalled;
        int diff;