From 94ec412b268967ead688a281d6f270dac8841e5d Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Tue, 6 Oct 2020 16:30:44 +0200 Subject: [PATCH] etnaviv: do proper cpu prep/fini when clearing allocated buffer The debug memset 0 of all allocated buffers did not sync the buffer for CPU access as required by the UAPI. Signed-off-by: Lucas Stach Reviewed-by: Christian Gmeiner Part-of: --- src/gallium/drivers/etnaviv/etnaviv_resource.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_resource.c b/src/gallium/drivers/etnaviv/etnaviv_resource.c index bfb470c4bfb..7ed0f137ddc 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_resource.c +++ b/src/gallium/drivers/etnaviv/etnaviv_resource.c @@ -315,8 +315,10 @@ etna_resource_alloc(struct pipe_screen *pscreen, unsigned layout, } if (DBG_ENABLED(ETNA_DBG_ZERO)) { - void *map = etna_bo_map(bo); + void *map = etna_bo_map(rsc->bo); + etna_bo_cpu_prep(rsc->bo, DRM_ETNA_PREP_WRITE); memset(map, 0, size); + etna_bo_cpu_fini(rsc->bo); } mtx_init(&rsc->lock, mtx_recursive);