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 <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25102>
(cherry picked from commit d6299ec258)
This commit is contained in:
David Rosca 2023-09-07 21:11:47 +02:00 committed by Dylan Baker
parent 864a206398
commit e1469b8aea
2 changed files with 4 additions and 1 deletions

View file

@ -5694,7 +5694,7 @@
"description": "frontends/va: Flush after unmapping VAImageBufferType",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -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);