mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
frontends/va: Map VAEncCodedBufferType buffer as PIPE_MAP_READ
VAEncCodedBufferType is used for reading back encoded data. Mapping it for read instead of write speeds up reading the data on CPU. On radeonsi this will result in VRAM copy to staging buffer in cached GTT, making the CPU read much faster. Signed-off-by: David Rosca <nowrep@gmail.com> Reviewed-by: Ruijing Dong <ruijing.dong@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20376>
This commit is contained in:
parent
e832d6a1bb
commit
9873ccb071
1 changed files with 3 additions and 1 deletions
|
|
@ -149,7 +149,9 @@ vlVaMapBuffer(VADriverContextP ctx, VABufferID buf_id, void **pbuff)
|
|||
else
|
||||
map_func = drv->pipe->texture_map;
|
||||
|
||||
*pbuff = map_func(drv->pipe, resource, 0, PIPE_MAP_WRITE,
|
||||
*pbuff = map_func(drv->pipe, resource, 0,
|
||||
buf->type == VAEncCodedBufferType ?
|
||||
PIPE_MAP_READ : PIPE_MAP_WRITE,
|
||||
&box, &buf->derived_surface.transfer);
|
||||
mtx_unlock(&drv->mutex);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue