Mesa (master): etnaviv: force vertex buffers through the MMU

Lucas Stach lynxeye at kemper.freedesktop.org
Mon Jan 30 11:41:39 UTC 2017


Module: Mesa
Branch: master
Commit: e158b7497103f145a9236a70183e07c37a9e13f7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e158b7497103f145a9236a70183e07c37a9e13f7

Author: Lucas Stach <l.stach at pengutronix.de>
Date:   Mon Nov 21 11:54:25 2016 +0100

etnaviv: force vertex buffers through the MMU

This fixes a vertex data corruption issue if some of the vertex streams
go through the MMU and some don't.

Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
Tested-by: Philipp Zabel <p.zabel at pengutronix.de>
Acked-by: Christian Gmeiner <christian.gmeiner at gmail.com>

---

 src/gallium/drivers/etnaviv/etnaviv_resource.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/etnaviv/etnaviv_resource.c b/src/gallium/drivers/etnaviv/etnaviv_resource.c
index 20ec8f8..1f0582c 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_resource.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_resource.c
@@ -201,7 +201,10 @@ etna_resource_alloc(struct pipe_screen *pscreen, unsigned layout,
 
    size = setup_miptree(rsc, paddingX, paddingY, msaa_xscale, msaa_yscale);
 
-   struct etna_bo *bo = etna_bo_new(screen->dev, size, DRM_ETNA_GEM_CACHE_WC);
+   uint32_t flags = DRM_ETNA_GEM_CACHE_WC;
+   if (templat->bind & PIPE_BIND_VERTEX_BUFFER)
+      flags |= DRM_ETNA_GEM_FORCE_MMU;
+   struct etna_bo *bo = etna_bo_new(screen->dev, size, flags);
    if (unlikely(bo == NULL)) {
       BUG("Problem allocating video memory for resource");
       return NULL;




More information about the mesa-commit mailing list