[Mesa-dev] [PATCH 067/140] radeonsi/gfx9: add GFX9 and VEGA10 enums

Marek Olšák maraeo at gmail.com
Mon Mar 20 22:43:17 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

---
 src/amd/common/amd_family.h                   | 8 +++++---
 src/gallium/drivers/radeon/r600_pipe_common.c | 1 +
 src/gallium/drivers/radeonsi/si_pipe.c        | 4 +++-
 src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c | 7 ++++++-
 4 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/amd/common/amd_family.h b/src/amd/common/amd_family.h
index b09bbb8..8a6dad6 100644
--- a/src/amd/common/amd_family.h
+++ b/src/amd/common/amd_family.h
@@ -85,28 +85,30 @@ enum radeon_family {
     CHIP_HAWAII,
     CHIP_MULLINS,
     CHIP_TONGA,
     CHIP_ICELAND,
     CHIP_CARRIZO,
     CHIP_FIJI,
     CHIP_STONEY,
     CHIP_POLARIS10,
     CHIP_POLARIS11,
     CHIP_POLARIS12,
+    CHIP_VEGA10,
     CHIP_LAST,
 };
 
 enum chip_class {
     CLASS_UNKNOWN = 0,
     R300,
     R400,
     R500,
     R600,
     R700,
     EVERGREEN,
     CAYMAN,
-    SI,
-    CIK,
-    VI,
+    SI,  /* GFX6 */
+    CIK, /* GFX7 */
+    VI,  /* GFX8 */
+    GFX9,
 };
 
 #endif
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
index b3b925e..7ec5703 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -772,20 +772,21 @@ static const char* r600_get_chip_name(struct r600_common_screen *rscreen)
 	case CHIP_HAWAII: return "AMD HAWAII";
 	case CHIP_MULLINS: return "AMD MULLINS";
 	case CHIP_TONGA: return "AMD TONGA";
 	case CHIP_ICELAND: return "AMD ICELAND";
 	case CHIP_CARRIZO: return "AMD CARRIZO";
 	case CHIP_FIJI: return "AMD FIJI";
 	case CHIP_POLARIS10: return "AMD POLARIS10";
 	case CHIP_POLARIS11: return "AMD POLARIS11";
 	case CHIP_POLARIS12: return "AMD POLARIS12";
 	case CHIP_STONEY: return "AMD STONEY";
+	case CHIP_VEGA10: return "AMD VEGA10";
 	default: return "AMD unknown";
 	}
 }
 
 static void r600_disk_cache_create(struct r600_common_screen *rscreen)
 {
 	/* Don't use the cache if shader dumping is enabled. */
 	if (rscreen->debug_flags &
 	    (DBG_FS | DBG_VS | DBG_TCS | DBG_TES | DBG_GS | DBG_PS | DBG_CS))
 		return;
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index 277fa28..c66203e 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -744,21 +744,23 @@ static void si_handle_env_var_force_family(struct si_screen *sscreen)
 	unsigned i;
 
 	if (!family)
 		return;
 
 	for (i = CHIP_TAHITI; i < CHIP_LAST; i++) {
 		if (!strcmp(family, r600_get_llvm_processor_name(i))) {
 			/* Override family and chip_class. */
 			sscreen->b.family = sscreen->b.info.family = i;
 
-			if (i >= CHIP_TONGA)
+			if (i >= CHIP_VEGA10)
+				sscreen->b.chip_class = sscreen->b.info.chip_class = GFX9;
+			else if (i >= CHIP_TONGA)
 				sscreen->b.chip_class = sscreen->b.info.chip_class = VI;
 			else if (i >= CHIP_BONAIRE)
 				sscreen->b.chip_class = sscreen->b.info.chip_class = CIK;
 			else
 				sscreen->b.chip_class = sscreen->b.info.chip_class = SI;
 
 			/* Don't submit any IBs. */
 			setenv("RADEON_NOOP", "1", 1);
 			return;
 		}
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
index 37e0140..25f08ef 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
@@ -212,21 +212,23 @@ static bool do_winsys_init(struct amdgpu_winsys *ws, int fd)
    switch (ws->info.pci_id) {
 #define CHIPSET(pci_id, name, cfamily) case pci_id: ws->info.family = CHIP_##cfamily; break;
 #include "pci_ids/radeonsi_pci_ids.h"
 #undef CHIPSET
 
    default:
       fprintf(stderr, "amdgpu: Invalid PCI ID.\n");
       goto fail;
    }
 
-   if (ws->info.family >= CHIP_TONGA)
+   if (ws->info.family >= CHIP_VEGA10)
+      ws->info.chip_class = GFX9;
+   else if (ws->info.family >= CHIP_TONGA)
       ws->info.chip_class = VI;
    else if (ws->info.family >= CHIP_BONAIRE)
       ws->info.chip_class = CIK;
    else if (ws->info.family >= CHIP_TAHITI)
       ws->info.chip_class = SI;
    else {
       fprintf(stderr, "amdgpu: Unknown family.\n");
       goto fail;
    }
 
@@ -296,20 +298,23 @@ static bool do_winsys_init(struct amdgpu_winsys *ws, int fd)
       ws->family = FAMILY_VI;
       ws->rev_id = VI_POLARIS10_P_A0;
       break;
    case CHIP_POLARIS11:
       ws->family = FAMILY_VI;
       ws->rev_id = VI_POLARIS11_M_A0;
       break;
    case CHIP_POLARIS12:
       ws->family = FAMILY_VI;
       ws->rev_id = VI_POLARIS12_V_A0;
+   case CHIP_VEGA10:
+      ws->family = FAMILY_AI;
+      ws->rev_id = AI_VEGA10_P_A0;
       break;
    default:
       fprintf(stderr, "amdgpu: Unknown family.\n");
       goto fail;
    }
 
    ws->addrlib = amdgpu_addr_create(ws);
    if (!ws->addrlib) {
       fprintf(stderr, "amdgpu: Cannot create addrlib.\n");
       goto fail;
-- 
2.7.4



More information about the mesa-dev mailing list