radeonsi: Remove redundant vcn_decode from info
authorLeo Liu <leo.liu@amd.com>
Tue, 25 Apr 2023 16:20:10 +0000 (12:20 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 11 May 2023 18:01:10 +0000 (18:01 +0000)
Use the number of queue instead.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22904>

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 cb17ba1..728d0d9 100644 (file)
@@ -940,11 +940,6 @@ bool ac_query_gpu_info(int fd, void *dev_p, struct radeon_info *info)
 
    info->memory_freq_mhz_effective *= ac_memory_ops_per_clock(info->vram_type);
 
-   /* unified ring */
-   info->has_video_hw.vcn_decode
-                  = (info->family >= CHIP_GFX1100 || info->family == CHIP_GFX940)
-                    ? info->ip[AMD_IP_VCN_UNIFIED].num_queues != 0
-                    : info->ip[AMD_IP_VCN_DEC].num_queues != 0;
    info->has_userptr = true;
    info->has_syncobj = has_syncobj(fd);
    info->has_timeline_syncobj = has_timeline_syncobj(fd);
@@ -1709,9 +1704,9 @@ void ac_print_gpu_info(struct radeon_info *info, FILE *f)
    fprintf(f, "    vce_encode = %u\n", info->ip[AMD_IP_VCE].num_queues);
 
    if (info->family >= CHIP_GFX1100 || info->family == CHIP_GFX940)
-      fprintf(f, "    vcn_unified = %u\n", info->has_video_hw.vcn_decode);
+      fprintf(f, "    vcn_unified = %u\n", info->ip[AMD_IP_VCN_UNIFIED].num_queues);
    else {
-      fprintf(f, "    vcn_decode = %u\n", info->has_video_hw.vcn_decode);
+      fprintf(f, "    vcn_decode = %u\n", info->ip[AMD_IP_VCN_DEC].num_queues);
       fprintf(f, "    vcn_encode = %u\n", info->ip[AMD_IP_VCN_ENC].num_queues);
    }
 
index c7c3dc1..6a0db6e 100644 (file)
@@ -189,10 +189,6 @@ struct radeon_info {
    bool has_set_sh_reg_pairs_n;
 
    /* Multimedia info. */
-   struct {
-      bool vcn_decode; /* TODO: remove */
-   } has_video_hw;
-
    uint32_t uvd_fw_version;
    uint32_t vce_fw_version;
    uint32_t vce_harvest_config;
index eab7ae2..f245e7f 100644 (file)
@@ -774,7 +774,9 @@ static int si_get_video_param(struct pipe_screen *screen, enum pipe_video_profil
    case PIPE_VIDEO_CAP_SUPPORTED:
       if (codec != PIPE_VIDEO_FORMAT_JPEG &&
           !(sscreen->info.ip[AMD_IP_UVD].num_queues ||
-            sscreen->info.has_video_hw.vcn_decode))
+            ((sscreen->info.family >= CHIP_GFX1100 || sscreen->info.family == CHIP_GFX940) ?
+             sscreen->info.ip[AMD_IP_VCN_UNIFIED].num_queues :
+             sscreen->info.ip[AMD_IP_VCN_DEC].num_queues)))
          return false;
       if (QUERYABLE_KERNEL &&
           codec != PIPE_VIDEO_FORMAT_JPEG &&
@@ -1248,7 +1250,9 @@ 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.ip[AMD_IP_UVD].num_queues || sscreen->info.has_video_hw.vcn_decode ||
+   if (sscreen->info.ip[AMD_IP_UVD].num_queues ||
+       ((sscreen->info.family >= CHIP_GFX1100 || sscreen->info.family == CHIP_GFX940) ?
+        sscreen->info.ip[AMD_IP_VCN_UNIFIED].num_queues : sscreen->info.ip[AMD_IP_VCN_DEC].num_queues) ||
        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.ip[AMD_IP_VCN_ENC].num_queues) {
       sscreen->b.get_video_param = si_get_video_param;
index 8847a44..d474f42 100644 (file)
@@ -709,7 +709,9 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, unsign
    sctx->sample_mask = 0xffff;
 
    /* Initialize multimedia functions. */
-   if (sscreen->info.ip[AMD_IP_UVD].num_queues || sscreen->info.has_video_hw.vcn_decode ||
+   if (sscreen->info.ip[AMD_IP_UVD].num_queues ||
+       ((sscreen->info.family >= CHIP_GFX1100 || sscreen->info.family == CHIP_GFX940) ?
+        sscreen->info.ip[AMD_IP_VCN_UNIFIED].num_queues : sscreen->info.ip[AMD_IP_VCN_DEC].num_queues) ||
        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.ip[AMD_IP_VCN_ENC].num_queues) {
       sctx->b.create_video_codec = si_uvd_create_decoder;