ac/gpu_info: remove redundant vcn_encode
authorMarek Olšák <marek.olsak@amd.com>
Thu, 7 Jul 2022 23:46:33 +0000 (19:46 -0400)
committerMarge Bot <emma+marge@anholt.net>
Wed, 27 Jul 2022 05:01:38 +0000 (05:01 +0000)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>

src/amd/common/ac_gpu_info.c
src/amd/common/ac_gpu_info.h
src/gallium/drivers/radeonsi/si_get.c
src/gallium/drivers/radeonsi/si_pipe.c

index bc54469..410649b 100644 (file)
@@ -876,7 +876,6 @@ bool ac_query_gpu_info(int fd, void *dev_p, struct radeon_info *info,
                   = info->family >= CHIP_GFX1100
                     ? info->ip[AMD_IP_VCN_UNIFIED].num_queues != 0
                     : info->ip[AMD_IP_VCN_DEC].num_queues != 0;
-   info->has_video_hw.vcn_encode = info->ip[AMD_IP_VCN_ENC].num_queues != 0;
    info->has_userptr = true;
    info->has_syncobj = has_syncobj(fd);
    info->has_timeline_syncobj = has_timeline_syncobj(fd);
@@ -1480,7 +1479,7 @@ void ac_print_gpu_info(struct radeon_info *info, FILE *f)
       fprintf(f, "    vcn_unified = %u\n", info->has_video_hw.vcn_decode);
    else {
       fprintf(f, "    vcn_decode = %u\n", info->has_video_hw.vcn_decode);
-      fprintf(f, "    vcn_encode = %u\n", info->has_video_hw.vcn_encode);
+      fprintf(f, "    vcn_encode = %u\n", info->ip[AMD_IP_VCN_ENC].num_queues);
    }
 
    fprintf(f, "    uvd_fw_version = %u\n", info->uvd_fw_version);
index 68744d1..c096b16 100644 (file)
@@ -156,8 +156,7 @@ struct radeon_info {
 
    /* Multimedia info. */
    struct {
-      bool vcn_decode;
-      bool vcn_encode;
+      bool vcn_decode; /* TODO: remove */
    } has_video_hw;
 
    uint32_t uvd_fw_version;
index 149bfdb..3b144dd 100644 (file)
@@ -580,7 +580,7 @@ static int si_get_video_param(struct pipe_screen *screen, enum pipe_video_profil
    if (entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) {
       if (!(sscreen->info.ip[AMD_IP_VCE].num_queues ||
             sscreen->info.ip[AMD_IP_UVD_ENC].num_queues ||
-            sscreen->info.has_video_hw.vcn_encode))
+            sscreen->info.ip[AMD_IP_VCN_ENC].num_queues))
          return 0;
 
       switch (param) {
@@ -1053,7 +1053,7 @@ void si_init_screen_get_functions(struct si_screen *sscreen)
 
    if (sscreen->info.ip[AMD_IP_UVD].num_queues || sscreen->info.has_video_hw.vcn_decode ||
        sscreen->info.ip[AMD_IP_VCN_JPEG].num_queues || sscreen->info.ip[AMD_IP_VCE].num_queues ||
-       sscreen->info.ip[AMD_IP_UVD_ENC].num_queues || sscreen->info.has_video_hw.vcn_encode) {
+       sscreen->info.ip[AMD_IP_UVD_ENC].num_queues || sscreen->info.ip[AMD_IP_VCN_ENC].num_queues) {
       sscreen->b.get_video_param = si_get_video_param;
       sscreen->b.is_video_format_supported = si_vid_is_format_supported;
    } else {
index 8019190..f82f8d9 100644 (file)
@@ -686,7 +686,7 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, unsign
    /* Initialize multimedia functions. */
    if (sscreen->info.ip[AMD_IP_UVD].num_queues || sscreen->info.has_video_hw.vcn_decode ||
        sscreen->info.ip[AMD_IP_VCN_JPEG].num_queues || sscreen->info.ip[AMD_IP_VCE].num_queues ||
-       sscreen->info.ip[AMD_IP_UVD_ENC].num_queues || sscreen->info.has_video_hw.vcn_encode) {
+       sscreen->info.ip[AMD_IP_UVD_ENC].num_queues || sscreen->info.ip[AMD_IP_VCN_ENC].num_queues) {
       sctx->b.create_video_codec = si_uvd_create_decoder;
       sctx->b.create_video_buffer = si_video_buffer_create;
       if (screen->resource_create_with_modifiers)