ac/info: move gs table depth to common code.
authorDave Airlie <airlied@redhat.com>
Sun, 22 Apr 2018 23:56:43 +0000 (09:56 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 23 Apr 2018 23:05:38 +0000 (09:05 +1000)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_gpu_info.c
src/amd/common/ac_gpu_info.h

index ef0364b05343fb312d10febdc27abb0e3973e7de..12b03c4ea2913578975b9df0b26918beb4acad85 100644 (file)
@@ -521,3 +521,36 @@ void ac_print_gpu_info(struct radeon_info *info)
                       G_0098F8_NUM_LOWER_PIPES(info->gb_addr_config));
        }
 }
+
+int
+ac_get_gs_table_depth(enum chip_class chip_class, enum radeon_family family)
+{
+       if (chip_class >= GFX9)
+               return -1;
+
+       switch (family) {
+       case CHIP_OLAND:
+       case CHIP_HAINAN:
+       case CHIP_KAVERI:
+       case CHIP_KABINI:
+       case CHIP_MULLINS:
+       case CHIP_ICELAND:
+       case CHIP_CARRIZO:
+       case CHIP_STONEY:
+               return 16;
+       case CHIP_TAHITI:
+       case CHIP_PITCAIRN:
+       case CHIP_VERDE:
+       case CHIP_BONAIRE:
+       case CHIP_HAWAII:
+       case CHIP_TONGA:
+       case CHIP_FIJI:
+       case CHIP_POLARIS10:
+       case CHIP_POLARIS11:
+       case CHIP_POLARIS12:
+       case CHIP_VEGAM:
+               return 32;
+       default:
+               unreachable("Unknown GPU");
+       }
+}
index 75cb98020d2f43c54876fb9ae00f80df2f1098a1..003d340e0c1ef25e00fd79b5b1a51c0f3099e25c 100644 (file)
@@ -130,6 +130,7 @@ void ac_compute_driver_uuid(char *uuid, size_t size);
 
 void ac_compute_device_uuid(struct radeon_info *info, char *uuid, size_t size);
 void ac_print_gpu_info(struct radeon_info *info);
+int ac_get_gs_table_depth(enum chip_class chip_class, enum radeon_family family);
 
 #ifdef __cplusplus
 }