[PATCH RFC 098/111] staging: etnaviv: flush MMU when switching context

Lucas Stach l.stach at pengutronix.de
Thu Apr 2 08:30:40 PDT 2015


The MMU needs to be flushed when changing the render context to get
rid of stale TLB entries left behind by the last context.

While we do not support context switching between different processes yet
this commit fixes memory corruptions seen when executing different 3D
applications one after another.

Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
---
 drivers/staging/etnaviv/etnaviv_gpu.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/staging/etnaviv/etnaviv_gpu.c b/drivers/staging/etnaviv/etnaviv_gpu.c
index 8221df820824..d7025101e929 100644
--- a/drivers/staging/etnaviv/etnaviv_gpu.c
+++ b/drivers/staging/etnaviv/etnaviv_gpu.c
@@ -878,6 +878,9 @@ int etnaviv_gpu_submit(struct etnaviv_gpu *gpu,
 
 	gpu->submitted_fence = submit->fence;
 
+	if (priv->lastctx != ctx)
+		gpu->mmu->need_flush = true;
+
 	etnaviv_buffer_queue(gpu, event, submit);
 
 	priv->lastctx = ctx;
-- 
2.1.4



More information about the dri-devel mailing list