From a972d04f65cd066133d0596de71dd0b766fcc68b Mon Sep 17 00:00:00 2001 From: xxm Date: Tue, 8 Jul 2014 10:54:48 +0800 Subject: [PATCH] rockchip:midgard:1,keep processing if fence NULL 2,version to 0x05 --- .../gpu/arm/midgard/mali_kbase_core_linux.c | 2 +- drivers/gpu/arm/midgard/mali_kbase_softjobs.c | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/arm/midgard/mali_kbase_core_linux.c b/drivers/gpu/arm/midgard/mali_kbase_core_linux.c index 77c5c3cb4f4e..399ac942339b 100755 --- a/drivers/gpu/arm/midgard/mali_kbase_core_linux.c +++ b/drivers/gpu/arm/midgard/mali_kbase_core_linux.c @@ -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; diff --git a/drivers/gpu/arm/midgard/mali_kbase_softjobs.c b/drivers/gpu/arm/midgard/mali_kbase_softjobs.c index b52d23bc912a..82ee7c4139ee 100755 --- a/drivers/gpu/arm/midgard/mali_kbase_softjobs.c +++ b/drivers/gpu/arm/midgard/mali_kbase_softjobs.c @@ -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 */ -- 2.34.1