radv: set a video decode ip block in physical device.
This makes it easier to add navi 3x Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21980>
This commit is contained in:
@@ -273,7 +273,7 @@ radv_queue_family_to_ring(struct radv_physical_device *physical_device,
|
||||
case RADV_QUEUE_TRANSFER:
|
||||
return AMD_IP_SDMA;
|
||||
case RADV_QUEUE_VIDEO_DEC:
|
||||
return radv_has_uvd(physical_device) ? AMD_IP_UVD : AMD_IP_VCN_DEC;
|
||||
return physical_device->vid_decode_ip;
|
||||
case RADV_QUEUE_VIDEO_ENC:
|
||||
return AMD_IP_VCN_ENC;
|
||||
default:
|
||||
|
||||
@@ -176,12 +176,7 @@ radv_physical_device_init_queue_table(struct radv_physical_device *pdevice)
|
||||
}
|
||||
|
||||
if (pdevice->instance->perftest_flags & RADV_PERFTEST_VIDEO_DECODE) {
|
||||
if (pdevice->rad_info.ip[AMD_IP_VCN_DEC].num_queues > 0) {
|
||||
pdevice->vk_queue_to_radv[idx] = RADV_QUEUE_VIDEO_DEC;
|
||||
idx++;
|
||||
}
|
||||
|
||||
if (radv_has_uvd(pdevice)) {
|
||||
if (pdevice->rad_info.ip[pdevice->vid_decode_ip].num_queues > 0) {
|
||||
pdevice->vk_queue_to_radv[idx] = RADV_QUEUE_VIDEO_DEC;
|
||||
idx++;
|
||||
}
|
||||
@@ -2466,10 +2461,7 @@ radv_get_physical_device_queue_family_properties(struct radv_physical_device *pd
|
||||
num_queue_families++;
|
||||
|
||||
if (pdevice->instance->perftest_flags & RADV_PERFTEST_VIDEO_DECODE) {
|
||||
if (pdevice->rad_info.ip[AMD_IP_VCN_DEC].num_queues > 0)
|
||||
num_queue_families++;
|
||||
|
||||
if (radv_has_uvd(pdevice))
|
||||
if (pdevice->rad_info.ip[pdevice->vid_decode_ip].num_queues > 0)
|
||||
num_queue_families++;
|
||||
}
|
||||
|
||||
@@ -2508,23 +2500,11 @@ radv_get_physical_device_queue_family_properties(struct radv_physical_device *pd
|
||||
}
|
||||
|
||||
if (pdevice->instance->perftest_flags & RADV_PERFTEST_VIDEO_DECODE) {
|
||||
if (pdevice->rad_info.ip[AMD_IP_VCN_DEC].num_queues > 0) {
|
||||
if (pdevice->rad_info.ip[pdevice->vid_decode_ip].num_queues > 0) {
|
||||
if (*pCount > idx) {
|
||||
*pQueueFamilyProperties[idx] = (VkQueueFamilyProperties){
|
||||
.queueFlags = VK_QUEUE_VIDEO_DECODE_BIT_KHR,
|
||||
.queueCount = pdevice->rad_info.ip[AMD_IP_VCN_DEC].num_queues,
|
||||
.timestampValidBits = 64,
|
||||
.minImageTransferGranularity = (VkExtent3D){1, 1, 1},
|
||||
};
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
|
||||
if (radv_has_uvd(pdevice)) {
|
||||
if (*pCount > idx) {
|
||||
*pQueueFamilyProperties[idx] = (VkQueueFamilyProperties){
|
||||
.queueFlags = VK_QUEUE_VIDEO_DECODE_BIT_KHR,
|
||||
.queueCount = pdevice->rad_info.ip[AMD_IP_UVD].num_queues,
|
||||
.queueCount = pdevice->rad_info.ip[pdevice->vid_decode_ip].num_queues,
|
||||
.timestampValidBits = 64,
|
||||
.minImageTransferGranularity = (VkExtent3D){1, 1, 1},
|
||||
};
|
||||
|
||||
@@ -372,6 +372,7 @@ struct radv_physical_device {
|
||||
unsigned cmd;
|
||||
unsigned cntl;
|
||||
} vid_dec_reg;
|
||||
enum amd_ip_type vid_decode_ip;
|
||||
};
|
||||
|
||||
uint32_t radv_find_memory_index(struct radv_physical_device *pdevice, VkMemoryPropertyFlags flags);
|
||||
|
||||
@@ -68,6 +68,11 @@ static unsigned si_vid_alloc_stream_handle()
|
||||
void
|
||||
radv_init_physical_device_decoder(struct radv_physical_device *pdevice)
|
||||
{
|
||||
if (radv_has_uvd(pdevice))
|
||||
pdevice->vid_decode_ip = AMD_IP_UVD;
|
||||
else
|
||||
pdevice->vid_decode_ip = AMD_IP_VCN_DEC;
|
||||
|
||||
switch (pdevice->rad_info.family) {
|
||||
case CHIP_VEGA10:
|
||||
case CHIP_VEGA12:
|
||||
|
||||
Reference in New Issue
Block a user