mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 17:10:11 +01:00
radv/video: Use correct array index for decode target and DPB images
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12057
Cc: mesa-stable
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit ca0cb78869)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33113>
This commit is contained in:
parent
e90c776fa0
commit
0a00c8471f
2 changed files with 18 additions and 14 deletions
|
|
@ -424,7 +424,7 @@
|
|||
"description": "radv/video: Use correct array index for decode target and DPB images",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -1957,8 +1957,12 @@ rvcn_dec_message_decode(struct radv_cmd_buffer *cmd_buffer, struct radv_video_se
|
|||
decode->dt_surf_tile_config = 0;
|
||||
decode->dt_uv_surf_tile_config = 0;
|
||||
|
||||
decode->dt_luma_top_offset = luma->surface.u.gfx9.surf_offset;
|
||||
decode->dt_chroma_top_offset = chroma->surface.u.gfx9.surf_offset;
|
||||
int dt_array_idx = frame_info->dstPictureResource.baseArrayLayer + dst_iv->vk.base_array_layer;
|
||||
|
||||
decode->dt_luma_top_offset = luma->surface.u.gfx9.surf_offset +
|
||||
dt_array_idx * luma->surface.u.gfx9.surf_slice_size;
|
||||
decode->dt_chroma_top_offset = chroma->surface.u.gfx9.surf_offset +
|
||||
dt_array_idx * chroma->surface.u.gfx9.surf_slice_size;
|
||||
|
||||
if (decode->dt_field_mode) {
|
||||
decode->dt_luma_bottom_offset = luma->surface.u.gfx9.surf_offset + luma->surface.u.gfx9.surf_slice_size;
|
||||
|
|
@ -2021,10 +2025,8 @@ rvcn_dec_message_decode(struct radv_cmd_buffer *cmd_buffer, struct radv_video_se
|
|||
struct radv_image *dpb = dpb_iv ? dpb_iv->image : img;
|
||||
|
||||
int dpb_array_idx = 0;
|
||||
if (dpb_update_required) {
|
||||
if (dpb_iv->vk.view_type == VK_IMAGE_VIEW_TYPE_2D_ARRAY)
|
||||
dpb_array_idx = frame_info->pSetupReferenceSlot->pPictureResource->baseArrayLayer;
|
||||
}
|
||||
if (dpb_update_required)
|
||||
dpb_array_idx = frame_info->pSetupReferenceSlot->pPictureResource->baseArrayLayer + dpb_iv->vk.base_array_layer;
|
||||
|
||||
decode->dpb_size = (vid->dpb_type != DPB_DYNAMIC_TIER_2) ? dpb->size : 0;
|
||||
decode->db_pitch = dpb->planes[0].surface.u.gfx9.surf_pitch;
|
||||
|
|
@ -2064,9 +2066,7 @@ rvcn_dec_message_decode(struct radv_cmd_buffer *cmd_buffer, struct radv_video_se
|
|||
radv_image_view_from_handle(frame_info->pReferenceSlots[i].pPictureResource->imageViewBinding);
|
||||
assert(f_dpb_iv != NULL);
|
||||
struct radv_image *dpb_img = f_dpb_iv->image;
|
||||
int f_dpb_array_idx = 0;
|
||||
if (f_dpb_iv->vk.view_type == VK_IMAGE_VIEW_TYPE_2D_ARRAY)
|
||||
f_dpb_array_idx = frame_info->pReferenceSlots[i].pPictureResource->baseArrayLayer;
|
||||
int f_dpb_array_idx = frame_info->pReferenceSlots[i].pPictureResource->baseArrayLayer + f_dpb_iv->vk.base_array_layer;
|
||||
|
||||
radv_cs_add_buffer(device->ws, cmd_buffer->cs, dpb_img->bindings[0].bo);
|
||||
addr = radv_buffer_get_va(dpb_img->bindings[0].bo) + dpb_img->bindings[0].offset;
|
||||
|
|
@ -2428,12 +2428,16 @@ ruvd_dec_message_decode(struct radv_device *device, struct radv_video_session *v
|
|||
|
||||
msg->body.decode.dt_field_mode = false;
|
||||
|
||||
int dt_array_idx = frame_info->dstPictureResource.baseArrayLayer + dst_iv->vk.base_array_layer;
|
||||
|
||||
if (pdev->info.gfx_level >= GFX9) {
|
||||
msg->body.decode.dt_pitch = luma->surface.u.gfx9.surf_pitch * luma->surface.blk_w;
|
||||
msg->body.decode.dt_tiling_mode = RUVD_TILE_LINEAR;
|
||||
msg->body.decode.dt_array_mode = RUVD_ARRAY_MODE_LINEAR;
|
||||
msg->body.decode.dt_luma_top_offset = luma->surface.u.gfx9.surf_offset;
|
||||
msg->body.decode.dt_chroma_top_offset = chroma->surface.u.gfx9.surf_offset;
|
||||
msg->body.decode.dt_luma_top_offset = luma->surface.u.gfx9.surf_offset +
|
||||
dt_array_idx * luma->surface.u.gfx9.surf_slice_size;
|
||||
msg->body.decode.dt_chroma_top_offset = chroma->surface.u.gfx9.surf_offset +
|
||||
dt_array_idx * chroma->surface.u.gfx9.surf_slice_size;
|
||||
if (msg->body.decode.dt_field_mode) {
|
||||
msg->body.decode.dt_luma_bottom_offset =
|
||||
luma->surface.u.gfx9.surf_offset + luma->surface.u.gfx9.surf_slice_size;
|
||||
|
|
@ -2464,9 +2468,9 @@ ruvd_dec_message_decode(struct radv_device *device, struct radv_video_session *v
|
|||
break;
|
||||
}
|
||||
|
||||
msg->body.decode.dt_luma_top_offset = texture_offset_legacy(&luma->surface, 0);
|
||||
msg->body.decode.dt_luma_top_offset = texture_offset_legacy(&luma->surface, dt_array_idx);
|
||||
if (chroma)
|
||||
msg->body.decode.dt_chroma_top_offset = texture_offset_legacy(&chroma->surface, 0);
|
||||
msg->body.decode.dt_chroma_top_offset = texture_offset_legacy(&chroma->surface, dt_array_idx);
|
||||
if (msg->body.decode.dt_field_mode) {
|
||||
msg->body.decode.dt_luma_bottom_offset = texture_offset_legacy(&luma->surface, 1);
|
||||
if (chroma)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue