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

Commit c8a15da5 authored by Tarun Karra's avatar Tarun Karra
Browse files

msm: kgsl: Restrict secure contexts to ringbuffer level preemption



Preemption from secure to unsecure needs zap shader to be run
to clear all secure content. CP does not know during preemption
if it is switching between secure and unsecure contexts so
restrict secure contexts to be preempted at ringbuffer level.
At the end of each secure submission we switch back to unsecure
mode and run the zap shader to clear secure contents. Ringbuffer
level preemption ensures Zap shader is run before switching
back to unsecure mode.

CRs-Fixed: 974102
Change-Id: Iff11c1d5732d46fe5a1fbdbc7d162aaa1736741b
Signed-off-by: default avatarTarun Karra <tkarra@codeaurora.org>
parent 30b0c37a
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -292,8 +292,19 @@ static int a5xx_preemption_pre_ibsubmit(
	uint64_t gpuaddr = rb->preemption_desc.gpuaddr;
	unsigned int preempt_style = 0;

	if (context)
	if (context) {
		/*
		 * Preemption from secure to unsecure needs Zap shader to be
		 * run to clear all secure content. CP does not know during
		 * preemption if it is switching between secure and unsecure
		 * contexts so restrict Secure contexts to be preempted at
		 * ringbuffer level.
		 */
		if (context->flags & KGSL_CONTEXT_SECURE)
			preempt_style = KGSL_CONTEXT_PREEMPT_STYLE_RINGBUFFER;
		else
			preempt_style = ADRENO_PREEMPT_STYLE(context->flags);
	}

	/*
	 * CP_PREEMPT_ENABLE_GLOBAL(global preemption) can only be set by KMD