v3d: never replace a mapped bo

The application might have a pointer into the mapped bo.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25362>
This commit is contained in:
Karol Herbst
2024-06-12 21:59:19 +02:00
committed by Marge Bot
parent e5c4ea9323
commit 0b85476d86
+4
View File
@@ -101,6 +101,10 @@ v3d_resource_bo_alloc(struct v3d_resource *rsc)
struct pipe_screen *pscreen = prsc->screen;
struct v3d_bo *bo;
/* never replace a mapped bo */
if (rsc->bo && rsc->bo->map)
return false;
/* Buffers may be read using ldunifa, which prefetches the next
* 4 bytes after a read. If the buffer's size is exactly a multiple
* of a page size and the shader reads the last 4 bytes with ldunifa