diff mbox

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

Message ID 1427988653-754-99-git-send-email-l.stach@pengutronix.de (mailing list archive)
State New, archived
Headers show

Commit Message

Lucas Stach April 2, 2015, 3:30 p.m. UTC
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@pengutronix.de>
---
 drivers/staging/etnaviv/etnaviv_gpu.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

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;