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

Commit ad6db200 authored by Harshdeep Dhatt's avatar Harshdeep Dhatt
Browse files

msm: kgsl: Do not switch pagetable if context is detached



This is done to avoid a race condition between a context getting
detached and destroyed before the GPU has executed the pt switch
commands.

CRs-Fixed: 987587
Change-Id: I5c485e41a23b288f27e607b3e3ed5bf66cbad98a
Signed-off-by: default avatarHarshdeep Dhatt <hdhatt@codeaurora.org>
parent a8371783
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -570,6 +570,15 @@ int adreno_drawctxt_switch(struct adreno_device *adreno_dev,
	if (rb->drawctxt_active == drawctxt)
	if (rb->drawctxt_active == drawctxt)
		return ret;
		return ret;


	/*
	 * Submitting pt switch commands from a detached context can
	 * lead to a race condition where the pt is destroyed before
	 * the pt switch commands get executed by the GPU, leading to
	 * pagefaults.
	 */
	if (drawctxt != NULL && kgsl_context_detached(&drawctxt->base))
		return -ENOENT;

	trace_adreno_drawctxt_switch(rb,
	trace_adreno_drawctxt_switch(rb,
		drawctxt, flags);
		drawctxt, flags);