Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 738e1770 authored by Harshdeep Dhatt's avatar Harshdeep Dhatt
Browse files

msm: kgsl: Make sure dispatch jobs are not lost due to faults



Say a context has only one submission i.e. it has only one dispatch
job. And say gpu encounters a fault and sets dispatcher fault. The
dispatch job will be free'd and post recovery, the context will never
get to the ringbuffer until it queues another submission. This behaviour
holds true in cases where dispatcher is halted for example during
suspend. So in either case, add back the job the the dispatcher jobs
list to make sure the job is not lost.

Change-Id: Iec0a0abfbdcf2535d7f82ec1e286581e1c93a3ea
Signed-off-by: default avatarHarshdeep Dhatt <hdhatt@codeaurora.org>
parent 5168327a
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -858,8 +858,7 @@ static void dispatcher_handle_jobs_list(struct adreno_device *adreno_dev,
	llist_for_each_entry_safe(job, next, list, node) {
		int ret;

		if (adreno_gpu_stopped(adreno_dev) ||
			adreno_drawctxt_bad(job->drawctxt)) {
		if (adreno_drawctxt_bad(job->drawctxt)) {
			kgsl_context_put(&job->drawctxt->base);
			kmem_cache_free(jobs_cache, job);
			continue;
@@ -879,6 +878,16 @@ static void dispatcher_handle_jobs_list(struct adreno_device *adreno_dev,
			continue;
		}

		/*
		 * If gpu is in fault or dispatcher is halted, add back the jobs
		 * so that they are processed after recovery or when dispatcher
		 * is resumed.
		 */
		if (adreno_gpu_stopped(adreno_dev)) {
			llist_add(&job->node, &dispatcher->jobs[id]);
			continue;
		}

		ret = dispatcher_context_sendcmds(adreno_dev, job->drawctxt);

		/*