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

Commit 6cae47e2 authored by Harshdeep Dhatt's avatar Harshdeep Dhatt
Browse files

msm: kgsl: Omit secure mode packets for context switching



Currently, the secure mode packets will be inserted around the
pagetable switch packets if the last active context was secure.
Fix this to never insert secure mode packets for pagetable switch
or internal commands.

Change-Id: I39283b18d758cbacf7012aea63375543b6c73b4c
Signed-off-by: default avatarHarshdeep Dhatt <hdhatt@codeaurora.org>
parent 6e9f8d30
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -396,6 +396,12 @@ static inline int cp_mem_write(struct adreno_device *adreno_dev,
	return dwords;
}

static bool _check_secured(struct adreno_context *drawctxt, unsigned int flags)
{
	return ((drawctxt->base.flags & KGSL_CONTEXT_SECURE) &&
		!is_internal_cmds(flags));
}

static int
adreno_ringbuffer_addcmds(struct adreno_ringbuffer *rb,
				unsigned int flags, unsigned int *cmds,
@@ -441,8 +447,7 @@ adreno_ringbuffer_addcmds(struct adreno_ringbuffer *rb,
	 */
	if (drawctxt) {
		drawctxt->internal_timestamp = rb->timestamp;
		if (drawctxt->base.flags & KGSL_CONTEXT_SECURE)
			secured_ctxt = true;
		secured_ctxt = _check_secured(drawctxt, flags);
	}

	/*