Module: Mesa
Branch: main
Commit: 6b75c365a8208e8af0d011c4322aacc4628f5db7
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6b75c365a8208e8af0d011c4322aacc4628f5db7

Author: Dave Airlie <[email protected]>
Date:   Wed Apr 26 16:53:26 2023 +1000

radv/video: add a video addr gfx mode

This will be different on gfx11+ so add a settable field for it

Reviewed-by: Samuel Pitoiset <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21980>

---

 src/amd/vulkan/radv_private.h | 1 +
 src/amd/vulkan/radv_video.c   | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index f1706403f00..dd0d0f39365 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -373,6 +373,7 @@ struct radv_physical_device {
       unsigned cntl;
    } vid_dec_reg;
    enum amd_ip_type vid_decode_ip;
+   uint32_t vid_addr_gfx_mode;
 };
 
 uint32_t radv_find_memory_index(struct radv_physical_device *pdevice, 
VkMemoryPropertyFlags flags);
diff --git a/src/amd/vulkan/radv_video.c b/src/amd/vulkan/radv_video.c
index 2d2913ded17..a9397df6f07 100644
--- a/src/amd/vulkan/radv_video.c
+++ b/src/amd/vulkan/radv_video.c
@@ -73,6 +73,8 @@ radv_init_physical_device_decoder(struct radv_physical_device 
*pdevice)
    else
       pdevice->vid_decode_ip = AMD_IP_VCN_DEC;
 
+   pdevice->vid_addr_gfx_mode = RDECODE_ARRAY_MODE_LINEAR;
+
    switch (pdevice->rad_info.family) {
    case CHIP_VEGA10:
    case CHIP_VEGA12:
@@ -979,6 +981,8 @@ static bool rvcn_dec_message_decode(struct radv_cmd_buffer 
*cmd_buffer,
         vid->vk.h265.profile_idc == STD_VIDEO_H265_PROFILE_IDC_MAIN_10))
       decode->db_aligned_height = 
align(frame_info->dstPictureResource.codedExtent.height, 64);
 
+   decode->db_array_mode = device->physical_device->vid_addr_gfx_mode;
+
    decode->dt_pitch = luma->surface.u.gfx9.surf_pitch * luma->surface.blk_w;
    decode->dt_uv_pitch = chroma->surface.u.gfx9.surf_pitch * 
chroma->surface.blk_w;
 
@@ -989,7 +993,7 @@ static bool rvcn_dec_message_decode(struct radv_cmd_buffer 
*cmd_buffer,
 
    decode->dt_tiling_mode = 0;
    decode->dt_swizzle_mode = luma->surface.u.gfx9.swizzle_mode;
-   decode->dt_array_mode = RDECODE_ARRAY_MODE_LINEAR;
+   decode->dt_array_mode = device->physical_device->vid_addr_gfx_mode;
    decode->dt_field_mode = vid->interlaced ? 1 : 0;
    decode->dt_surf_tile_config = 0;
    decode->dt_uv_surf_tile_config = 0;

Reply via email to