rockchip:midgard:1,katom->fence NULL workaround 2,version to 4
authorxxm <xxm@rock-chips.com>
Tue, 24 Jun 2014 08:42:20 +0000 (16:42 +0800)
committerxxm <xxm@rock-chips.com>
Tue, 24 Jun 2014 08:42:20 +0000 (16:42 +0800)
drivers/gpu/arm/midgard/mali_kbase_core_linux.c
drivers/gpu/arm/midgard/mali_kbase_softjobs.c

index 89f1d0c4aa013430d62ff55cf09d2d0e20021e52..77c5c3cb4f4ef619a41a46ef542c78270e6a8c65 100755 (executable)
@@ -85,7 +85,7 @@ EXPORT_SYMBOL(shared_kernel_test_data);
 #endif /* MALI_UNIT_TEST */
 
 #define KBASE_DRV_NAME "mali"
-#define ROCKCHIP_VERSION 3
+#define ROCKCHIP_VERSION 4
 static const char kbase_drv_name[] = KBASE_DRV_NAME;
 
 static int kbase_dev_nr;
index 785ed205a5ba68dba9558d9d21c5f5289cdf1e2e..b52d23bc912a036b093d7edd48275b42038dfed8 100755 (executable)
@@ -256,6 +256,11 @@ static int kbase_fence_wait(kbase_jd_atom *katom)
 
 static void kbase_fence_cancel_wait(kbase_jd_atom *katom)
 {
+       if(!katom || !katom->fence)
+       {
+               pr_info("%s,katom or katom->fence NULL\n",__func__);
+               return;
+       }
        if (sync_fence_cancel_async(katom->fence, &katom->sync_waiter) != 0)
        {
                /* The wait wasn't cancelled - leave the cleanup for kbase_fence_wait_callback */
@@ -389,8 +394,10 @@ void kbase_finish_soft_job(kbase_jd_atom *katom)
                break;
        case BASE_JD_REQ_SOFT_FENCE_WAIT:
                /* Release the reference to the fence object */
-               sync_fence_put(katom->fence);
-               katom->fence = NULL;
+               if(katom->fence){
+                       sync_fence_put(katom->fence);
+                       katom->fence = NULL;
+               }
                break;
 #endif                         /* CONFIG_SYNC */
        }