rockchip:midgard:1,keep processing if fence NULL 2,version to 0x05
authorxxm <xxm@rock-chips.com>
Tue, 8 Jul 2014 02:54:48 +0000 (10:54 +0800)
committerxxm <xxm@rock-chips.com>
Tue, 8 Jul 2014 02:54:48 +0000 (10:54 +0800)
drivers/gpu/arm/midgard/mali_kbase_core_linux.c
drivers/gpu/arm/midgard/mali_kbase_softjobs.c

index 77c5c3cb4f4ef619a41a46ef542c78270e6a8c65..399ac942339b6e9dbd0e9bb9f213706b93e19e8f 100755 (executable)
@@ -85,7 +85,7 @@ EXPORT_SYMBOL(shared_kernel_test_data);
 #endif /* MALI_UNIT_TEST */
 
 #define KBASE_DRV_NAME "mali"
-#define ROCKCHIP_VERSION 4
+#define ROCKCHIP_VERSION 5
 static const char kbase_drv_name[] = KBASE_DRV_NAME;
 
 static int kbase_dev_nr;
index b52d23bc912a036b093d7edd48275b42038dfed8..82ee7c4139ee91ed2fda1f907edd80f77953b641 100755 (executable)
@@ -256,24 +256,37 @@ static int kbase_fence_wait(kbase_jd_atom *katom)
 
 static void kbase_fence_cancel_wait(kbase_jd_atom *katom)
 {
-       if(!katom || !katom->fence)
+       if(!katom)
        {
-               pr_info("%s,katom or katom->fence NULL\n",__func__);
+               pr_err("katom null.forbiden return\n");
                return;
        }
+       if(!katom->fence)
+       {
+               pr_info("katom->fence null.may release out of order.so continue unfinished step\n");
+               /*
+               if return here,may result in  infinite loop?
+               we need to delete dep_item[0] from kctx->waiting_soft_jobs?
+               jd_done_nolock function move the dep_item[0] to complete job list and then delete?
+               */
+               goto finish_softjob;
+       }
        if (sync_fence_cancel_async(katom->fence, &katom->sync_waiter) != 0)
        {
                /* The wait wasn't cancelled - leave the cleanup for kbase_fence_wait_callback */
                return;
        }
-
+       
        /* Wait was cancelled - zap the atoms */
+finish_softjob:
        katom->event_code = BASE_JD_EVENT_JOB_CANCELLED;
 
        kbase_finish_soft_job(katom);
 
        if (jd_done_nolock(katom))
                kbasep_js_try_schedule_head_ctx(katom->kctx->kbdev);
+       return;
+
 }
 #endif /* CONFIG_SYNC */