From d6299ec258d4e991855f8c7bd0ee71f3c286234a Mon Sep 17 00:00:00 2001 From: David Rosca Date: Thu, 7 Sep 2023 21:11:47 +0200 Subject: [PATCH] frontends/va: Flush after unmapping VAImageBufferType If application changed image data we need to flush on unmap to make the changes visible. This will also flush if the mapping was used only for reading, but we can't know that as vaMapBuffer doesn't have a parameter to specify if read or write is requested. Cc: mesa-stable Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9774 Reviewed-by: Ruijing Dong Part-of: --- src/gallium/frontends/va/buffer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/frontends/va/buffer.c b/src/gallium/frontends/va/buffer.c index ffe1658..bff3bf4 100644 --- a/src/gallium/frontends/va/buffer.c +++ b/src/gallium/frontends/va/buffer.c @@ -224,6 +224,9 @@ vlVaUnmapBuffer(VADriverContextP ctx, VABufferID buf_id) unmap_func(drv->pipe, buf->derived_surface.transfer); buf->derived_surface.transfer = NULL; + + if (buf->type == VAImageBufferType) + drv->pipe->flush(drv->pipe, NULL, 0); } mtx_unlock(&drv->mutex); -- 2.7.4