radeonsi: Support PIPE_BIND_VIDEO_DECODE/ENCODE_DPB

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32303>
This commit is contained in:
David Rosca 2024-11-22 12:45:16 +01:00 committed by Marge Bot
parent 308bae950f
commit 1d206ca94c
2 changed files with 6 additions and 0 deletions

View file

@ -386,6 +386,9 @@ static int si_init_surface(struct si_screen *sscreen, struct radeon_surf *surfac
if (ptex->flags & PIPE_RESOURCE_FLAG_SPARSE)
flags |= RADEON_SURF_PRT;
if (ptex->bind & (PIPE_BIND_VIDEO_DECODE_DPB | PIPE_BIND_VIDEO_ENCODE_DPB))
flags |= RADEON_SURF_VIDEO_REFERENCE;
surface->modifier = modifier;
r = sscreen->ws->surface_init(sscreen->ws, &sscreen->info, ptex, flags, bpe, array_mode,

View file

@ -28,6 +28,9 @@ struct pipe_video_buffer *si_video_buffer_create(struct pipe_context *pipe,
int modifiers_count = 0;
uint64_t mod = DRM_FORMAT_MOD_LINEAR;
if (tmpl->bind & (PIPE_BIND_VIDEO_DECODE_DPB | PIPE_BIND_VIDEO_ENCODE_DPB))
return vl_video_buffer_create_as_resource(pipe, &vidbuf, NULL, 0);
/* To get tiled buffers, users need to explicitly provide a list of
* modifiers. */
vidbuf.bind |= PIPE_BIND_LINEAR;