mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
radv: move video decode enable test into a flag
This makes it easier to start conditionalising this on fw releases. Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30837>
This commit is contained in:
parent
95a980b61f
commit
4255bbd958
5 changed files with 23 additions and 11 deletions
|
|
@ -269,7 +269,6 @@ static void
|
|||
radv_physical_device_get_format_properties(struct radv_physical_device *pdev, VkFormat format,
|
||||
VkFormatProperties3 *out_properties)
|
||||
{
|
||||
const struct radv_instance *instance = radv_physical_device_instance(pdev);
|
||||
VkFormatFeatureFlags2 linear = 0, tiled = 0, buffer = 0;
|
||||
const struct util_format_description *desc = vk_format_description(format);
|
||||
bool scaled = false;
|
||||
|
|
@ -315,7 +314,7 @@ radv_physical_device_get_format_properties(struct radv_physical_device *pdev, Vk
|
|||
tiling |= VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT;
|
||||
}
|
||||
|
||||
if (instance->perftest_flags & RADV_PERFTEST_VIDEO_DECODE) {
|
||||
if (pdev->video_decode_enabled) {
|
||||
if (format == VK_FORMAT_G8_B8R8_2PLANE_420_UNORM ||
|
||||
format == VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16 ||
|
||||
format == VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16)
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ radv_physical_device_init_queue_table(struct radv_physical_device *pdev)
|
|||
idx++;
|
||||
}
|
||||
|
||||
if (instance->perftest_flags & RADV_PERFTEST_VIDEO_DECODE) {
|
||||
if (pdev->video_decode_enabled) {
|
||||
if (pdev->info.ip[pdev->vid_decode_ip].num_queues > 0) {
|
||||
pdev->vk_queue_to_radv[idx] = RADV_QUEUE_VIDEO_DEC;
|
||||
idx++;
|
||||
|
|
@ -574,12 +574,12 @@ radv_physical_device_get_supported_extensions(const struct radv_physical_device
|
|||
.KHR_variable_pointers = true,
|
||||
.KHR_vertex_attribute_divisor = true,
|
||||
.KHR_video_maintenance1 = true,
|
||||
.KHR_video_queue = !!(instance->perftest_flags & RADV_PERFTEST_VIDEO_DECODE) || pdev->video_encode_enabled,
|
||||
.KHR_video_queue = pdev->video_decode_enabled || pdev->video_encode_enabled,
|
||||
.KHR_video_decode_av1 = (pdev->info.vcn_ip_version >= VCN_3_0_0 && pdev->info.vcn_ip_version != VCN_3_0_33 &&
|
||||
VIDEO_CODEC_AV1DEC && !!(instance->perftest_flags & RADV_PERFTEST_VIDEO_DECODE)),
|
||||
.KHR_video_decode_queue = !!(instance->perftest_flags & RADV_PERFTEST_VIDEO_DECODE),
|
||||
.KHR_video_decode_h264 = VIDEO_CODEC_H264DEC && !!(instance->perftest_flags & RADV_PERFTEST_VIDEO_DECODE),
|
||||
.KHR_video_decode_h265 = VIDEO_CODEC_H265DEC && !!(instance->perftest_flags & RADV_PERFTEST_VIDEO_DECODE),
|
||||
VIDEO_CODEC_AV1DEC && pdev->video_decode_enabled),
|
||||
.KHR_video_decode_queue = pdev->video_decode_enabled,
|
||||
.KHR_video_decode_h264 = VIDEO_CODEC_H264DEC && pdev->video_decode_enabled,
|
||||
.KHR_video_decode_h265 = VIDEO_CODEC_H265DEC && pdev->video_decode_enabled,
|
||||
.KHR_video_encode_h264 = VIDEO_CODEC_H264ENC && pdev->video_encode_enabled,
|
||||
.KHR_video_encode_h265 = VIDEO_CODEC_H265ENC && pdev->video_encode_enabled,
|
||||
.KHR_video_encode_queue = pdev->video_encode_enabled,
|
||||
|
|
@ -2133,6 +2133,7 @@ radv_physical_device_try_create(struct radv_instance *instance, drmDevicePtr drm
|
|||
pdev->rt_wave_size = 64;
|
||||
}
|
||||
|
||||
radv_probe_video_decode(pdev);
|
||||
radv_probe_video_encode(pdev);
|
||||
|
||||
pdev->max_shared_size = pdev->info.gfx_level >= GFX7 ? 65536 : 32768;
|
||||
|
|
@ -2299,7 +2300,7 @@ radv_get_physical_device_queue_family_properties(struct radv_physical_device *pd
|
|||
if (pdev->info.ip[AMD_IP_COMPUTE].num_queues > 0 && !(instance->debug_flags & RADV_DEBUG_NO_COMPUTE_QUEUE))
|
||||
num_queue_families++;
|
||||
|
||||
if (instance->perftest_flags & RADV_PERFTEST_VIDEO_DECODE) {
|
||||
if (pdev->video_decode_enabled) {
|
||||
if (pdev->info.ip[pdev->vid_decode_ip].num_queues > 0)
|
||||
num_queue_families++;
|
||||
}
|
||||
|
|
@ -2354,7 +2355,7 @@ radv_get_physical_device_queue_family_properties(struct radv_physical_device *pd
|
|||
}
|
||||
}
|
||||
|
||||
if (instance->perftest_flags & RADV_PERFTEST_VIDEO_DECODE) {
|
||||
if (pdev->video_decode_enabled) {
|
||||
if (pdev->info.ip[pdev->vid_decode_ip].num_queues > 0) {
|
||||
if (*pCount > idx) {
|
||||
*pQueueFamilyProperties[idx] = (VkQueueFamilyProperties){
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ struct radv_physical_device {
|
|||
enum radv_video_enc_hw_ver enc_hw_ver;
|
||||
uint32_t encoder_interface_version;
|
||||
bool video_encode_enabled;
|
||||
|
||||
bool video_decode_enabled;
|
||||
struct radv_physical_device_cache_key cache_key;
|
||||
|
||||
uint32_t tess_distribution_mode;
|
||||
|
|
|
|||
|
|
@ -247,6 +247,17 @@ radv_init_physical_device_decoder(struct radv_physical_device *pdev)
|
|||
init_vcn_decoder(pdev);
|
||||
}
|
||||
|
||||
void
|
||||
radv_probe_video_decode(struct radv_physical_device *pdev)
|
||||
{
|
||||
const struct radv_instance *instance = radv_physical_device_instance(pdev);
|
||||
|
||||
pdev->video_decode_enabled = false;
|
||||
if (instance->perftest_flags & RADV_PERFTEST_VIDEO_DECODE) {
|
||||
pdev->video_decode_enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
have_it(struct radv_video_session *vid)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ void radv_vcn_sq_tail(struct radeon_cmdbuf *cs, struct rvcn_sq_var *sq);
|
|||
void radv_vcn_write_event(struct radv_cmd_buffer *cmd_buffer, struct radv_event *event, unsigned value);
|
||||
|
||||
void radv_init_physical_device_encoder(struct radv_physical_device *pdevice);
|
||||
void radv_probe_video_decode(struct radv_physical_device *pdev);
|
||||
void radv_probe_video_encode(struct radv_physical_device *pdev);
|
||||
void radv_video_enc_begin_coding(struct radv_cmd_buffer *cmd_buffer);
|
||||
void radv_video_enc_end_coding(struct radv_cmd_buffer *cmd_buffer);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue