ac/gpu_info: remove redundant uvd_decode
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
This commit is contained in:
@@ -853,7 +853,6 @@ bool ac_query_gpu_info(int fd, void *dev_p, struct radeon_info *info,
|
||||
info->max_sa_per_se = amdinfo->num_shader_arrays_per_engine;
|
||||
info->uvd_fw_version = info->ip[AMD_IP_UVD].num_queues ? uvd_version : 0;
|
||||
info->vce_fw_version = info->ip[AMD_IP_VCE].num_queues ? vce_version : 0;
|
||||
info->has_video_hw.uvd_decode = info->ip[AMD_IP_UVD].num_queues != 0;
|
||||
|
||||
/* Based on MemoryOpsPerClockTable from PAL. */
|
||||
switch (info->vram_type) {
|
||||
@@ -1478,7 +1477,6 @@ void ac_print_gpu_info(struct radeon_info *info, FILE *f)
|
||||
fprintf(f, " pfp_fw_feature = %i\n", info->pfp_fw_feature);
|
||||
|
||||
fprintf(f, "Multimedia info:\n");
|
||||
fprintf(f, " uvd_decode = %u\n", info->has_video_hw.uvd_decode);
|
||||
fprintf(f, " jpeg_decode = %u\n", info->has_video_hw.jpeg_decode);
|
||||
fprintf(f, " vce_encode = %u\n", info->has_video_hw.vce_encode);
|
||||
fprintf(f, " uvd_encode = %u\n", info->has_video_hw.uvd_encode);
|
||||
|
||||
@@ -156,7 +156,6 @@ struct radeon_info {
|
||||
|
||||
/* Multimedia info. */
|
||||
struct {
|
||||
bool uvd_decode;
|
||||
bool vcn_decode;
|
||||
bool jpeg_decode;
|
||||
bool vce_encode;
|
||||
|
||||
@@ -157,7 +157,7 @@ static struct pipe_context *r600_create_context(struct pipe_screen *screen,
|
||||
|
||||
r600_init_blit_functions(rctx);
|
||||
|
||||
if (rscreen->b.info.has_video_hw.uvd_decode) {
|
||||
if (rscreen->b.info.ip[AMD_IP_UVD].num_queues) {
|
||||
rctx->b.b.create_video_codec = r600_uvd_create_decoder;
|
||||
rctx->b.b.create_video_buffer = r600_video_buffer_create;
|
||||
} else {
|
||||
|
||||
@@ -1247,7 +1247,7 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
|
||||
rscreen->b.resource_from_user_memory = r600_buffer_from_user_memory;
|
||||
rscreen->b.query_memory_info = r600_query_memory_info;
|
||||
|
||||
if (rscreen->info.has_video_hw.uvd_decode) {
|
||||
if (rscreen->info.ip[AMD_IP_UVD].num_queues) {
|
||||
rscreen->b.get_video_param = rvid_get_video_param;
|
||||
rscreen->b.is_video_format_supported = rvid_is_format_supported;
|
||||
} else {
|
||||
@@ -1295,7 +1295,7 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
|
||||
printf("has_dedicated_vram = %u\n", rscreen->info.has_dedicated_vram);
|
||||
printf("r600_has_virtual_memory = %i\n", rscreen->info.r600_has_virtual_memory);
|
||||
printf("gfx_ib_pad_with_type2 = %i\n", rscreen->info.gfx_ib_pad_with_type2);
|
||||
printf("uvd_decode = %u\n", rscreen->info.has_video_hw.uvd_decode);
|
||||
printf("ip[AMD_IP_UVD] = %u\n", rscreen->info.ip[AMD_IP_UVD].num_queues);
|
||||
printf("ip[AMD_IP_SDMA] = %i\n", rscreen->info.ip[AMD_IP_SDMA].num_queues);
|
||||
printf("ip[AMD_IP_COMPUTE] = %u\n", rscreen->info.ip[AMD_IP_COMPUTE].num_queues);
|
||||
printf("uvd_fw_version = %u\n", rscreen->info.uvd_fw_version);
|
||||
|
||||
@@ -639,7 +639,7 @@ static int si_get_video_param(struct pipe_screen *screen, enum pipe_video_profil
|
||||
sscreen->info.family >= CHIP_NAVI24)
|
||||
return false;
|
||||
if (codec != PIPE_VIDEO_FORMAT_JPEG &&
|
||||
!(sscreen->info.has_video_hw.uvd_decode ||
|
||||
!(sscreen->info.ip[AMD_IP_UVD].num_queues ||
|
||||
sscreen->info.has_video_hw.vcn_decode))
|
||||
return false;
|
||||
|
||||
@@ -1051,7 +1051,7 @@ void si_init_screen_get_functions(struct si_screen *sscreen)
|
||||
sscreen->b.query_memory_info = si_query_memory_info;
|
||||
sscreen->b.get_disk_shader_cache = si_get_disk_shader_cache;
|
||||
|
||||
if (sscreen->info.has_video_hw.uvd_decode || sscreen->info.has_video_hw.vcn_decode ||
|
||||
if (sscreen->info.ip[AMD_IP_UVD].num_queues || sscreen->info.has_video_hw.vcn_decode ||
|
||||
sscreen->info.has_video_hw.jpeg_decode || sscreen->info.has_video_hw.vce_encode ||
|
||||
sscreen->info.has_video_hw.uvd_encode || sscreen->info.has_video_hw.vcn_encode) {
|
||||
sscreen->b.get_video_param = si_get_video_param;
|
||||
|
||||
@@ -684,7 +684,7 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, unsign
|
||||
sctx->sample_mask = 0xffff;
|
||||
|
||||
/* Initialize multimedia functions. */
|
||||
if (sscreen->info.has_video_hw.uvd_decode || sscreen->info.has_video_hw.vcn_decode ||
|
||||
if (sscreen->info.ip[AMD_IP_UVD].num_queues || sscreen->info.has_video_hw.vcn_decode ||
|
||||
sscreen->info.has_video_hw.jpeg_decode || sscreen->info.has_video_hw.vce_encode ||
|
||||
sscreen->info.has_video_hw.uvd_encode || sscreen->info.has_video_hw.vcn_encode) {
|
||||
sctx->b.create_video_codec = si_uvd_create_decoder;
|
||||
|
||||
@@ -313,14 +313,12 @@ static bool do_winsys_init(struct radeon_drm_winsys *ws)
|
||||
}
|
||||
|
||||
/* Check for UVD and VCE */
|
||||
ws->info.has_video_hw.uvd_decode = false;
|
||||
ws->info.has_video_hw.vce_encode = false;
|
||||
ws->info.vce_fw_version = 0x00000000;
|
||||
if (ws->info.drm_minor >= 32) {
|
||||
uint32_t value = RADEON_CS_RING_UVD;
|
||||
if (radeon_get_drm_value(ws->fd, RADEON_INFO_RING_WORKING,
|
||||
"UVD Ring working", &value)) {
|
||||
ws->info.has_video_hw.uvd_decode = value;
|
||||
ws->info.ip[AMD_IP_UVD].num_queues = 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user