From 1fb0c702c46e5b28accbeac70aa6a1dde16aa7a3 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: (cherry picked from commit d6299ec258d4e991855f8c7bd0ee71f3c286234a) --- .pick_status.json | 2 +- src/gallium/frontends/va/buffer.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index d7a5f79bc8a..a795b4a063d 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -634,7 +634,7 @@ "description": "frontends/va: Flush after unmapping VAImageBufferType", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/frontends/va/buffer.c b/src/gallium/frontends/va/buffer.c index 908b6bd21e2..be1c230219b 100644 --- a/src/gallium/frontends/va/buffer.c +++ b/src/gallium/frontends/va/buffer.c @@ -213,6 +213,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);