radeonsi: add support for Vega20
authorMarek Olšák <marek.olsak@amd.com>
Tue, 7 Nov 2017 01:02:21 +0000 (02:02 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 12 Jul 2018 20:48:12 +0000 (16:48 -0400)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
12 files changed:
include/pci_ids/radeonsi_pci_ids.h
src/amd/addrlib/amdgpu_asic_addr.h
src/amd/addrlib/gfx9/gfx9addrlib.cpp
src/amd/addrlib/gfx9/gfx9addrlib.h
src/amd/common/ac_llvm_util.c
src/amd/common/ac_surface.c
src/amd/common/amd_family.h
src/amd/common/gfx9d.h
src/gallium/drivers/radeonsi/si_get.c
src/gallium/drivers/radeonsi/si_pipe.c
src/gallium/drivers/radeonsi/si_state.c
src/gallium/drivers/radeonsi/si_state_binning.c

index 6386d21a19f213c9b59ca7f50f3c41789dcc7779..c8d3059723093960920fd420e477f1b3bb1818cf 100644 (file)
@@ -235,4 +235,11 @@ CHIPSET(0x69A2, VEGA12)
 CHIPSET(0x69A3, VEGA12)
 CHIPSET(0x69AF, VEGA12)
 
+CHIPSET(0x66A0, VEGA20)
+CHIPSET(0x66A1, VEGA20)
+CHIPSET(0x66A2, VEGA20)
+CHIPSET(0x66A3, VEGA20)
+CHIPSET(0x66A7, VEGA20)
+CHIPSET(0x66AF, VEGA20)
+
 CHIPSET(0x15DD, RAVEN)
index b4b8aecd42ddd5abcaf5b33df59b39430b2c31b7..e5838d42a3cf8296ee749ffdba19f9240a9d3592 100644 (file)
@@ -87,6 +87,7 @@
 
 #define AMDGPU_VEGA10_RANGE     0x01, 0x14
 #define AMDGPU_VEGA12_RANGE     0x14, 0x28
+#define AMDGPU_VEGA20_RANGE     0x28, 0xFF
 
 #define AMDGPU_RAVEN_RANGE      0x01, 0x81
 
 #define ASICREV_IS_VEGA10_P(r)         ASICREV_IS(r, VEGA10)
 #define ASICREV_IS_VEGA12_P(r)         ASICREV_IS(r, VEGA12)
 #define ASICREV_IS_VEGA12_p(r)         ASICREV_IS(r, VEGA12)
+#define ASICREV_IS_VEGA20_P(r)         ASICREV_IS(r, VEGA20)
 
 #define ASICREV_IS_RAVEN(r)            ASICREV_IS(r, RAVEN)
 
index b88d32432281b253c0227bee16fd40230336c9a7..ef86c3bc7b56d8fbe0eaf00e1386be5f5473f978 100644 (file)
@@ -1230,6 +1230,7 @@ BOOL_32 Gfx9Lib::HwlInitGlobalParams(
         {
             ADDR_ASSERT(m_settings.isVega10 == FALSE);
             ADDR_ASSERT(m_settings.isRaven == FALSE);
+            ADDR_ASSERT(m_settings.isVega20 == FALSE);
 
             if (m_settings.isVega12)
             {
@@ -1273,7 +1274,7 @@ ChipFamily Gfx9Lib::HwlConvertChipFamily(
             m_settings.isArcticIsland = 1;
             m_settings.isVega10    = ASICREV_IS_VEGA10_P(uChipRevision);
             m_settings.isVega12    = ASICREV_IS_VEGA12_P(uChipRevision);
-
+            m_settings.isVega20    = ASICREV_IS_VEGA20_P(uChipRevision);
             m_settings.isDce12 = 1;
 
             if (m_settings.isVega10 == 0)
index 7c61a40880e780c9c135f418deb2dd5576e4fac5..cf56507964c03f220c12f14022d01b7c25242160 100644 (file)
@@ -56,6 +56,7 @@ struct Gfx9ChipSettings
         UINT_32 isVega10            : 1;
         UINT_32 isRaven             : 1;
         UINT_32 isVega12            : 1;
+        UINT_32 isVega20            : 1;
 
         // Display engine IP version name
         UINT_32 isDce12             : 1;
index 5e04452d5a89a3752b5abd22750e2ba86d4c4f6a..8d73df4e31198b8de534f66d58e3ec22b428b5fd 100644 (file)
@@ -128,6 +128,8 @@ const char *ac_get_llvm_processor_name(enum radeon_family family)
                return "gfx902";
        case CHIP_VEGA12:
                return HAVE_LLVM >= 0x0700 ? "gfx904" : "gfx902";
+       case CHIP_VEGA20:
+               return HAVE_LLVM >= 0x0700 ? "gfx906" : "gfx902";
        default:
                return "";
        }
@@ -141,7 +143,7 @@ static LLVMTargetMachineRef ac_create_target_machine(enum radeon_family family,
        char features[256];
        const char *triple = (tm_options & AC_TM_SUPPORTS_SPILL) ? "amdgcn-mesa-mesa3d" : "amdgcn--";
        LLVMTargetRef target = ac_get_llvm_target(triple);
-       bool barrier_does_waitcnt = true; /* TODO: not for Vega20 */
+       bool barrier_does_waitcnt = family != CHIP_VEGA20;
 
        snprintf(features, sizeof(features),
                 "+DumpCode,+vgpr-spilling,-fp32-denormals,+fp64-denormals%s%s%s%s%s",
index 9eb63bab038fd5e8333a161e5344e19e1d0b843d..959e7b3d7358c2189b5895d6cec89fa9fc628409 100644 (file)
@@ -143,6 +143,10 @@ static void addrlib_family_rev_id(enum radeon_family family,
                *addrlib_family = FAMILY_AI;
                *addrlib_revid = get_first(AMDGPU_VEGA12_RANGE);
                break;
+       case CHIP_VEGA20:
+               *addrlib_family = FAMILY_AI;
+               *addrlib_revid = get_first(AMDGPU_VEGA20_RANGE);
+               break;
        case CHIP_RAVEN:
                *addrlib_family = FAMILY_RV;
                *addrlib_revid = get_first(AMDGPU_RAVEN_RANGE);
index 6410368f2f80951200a696074014e40a98e34df9..a282898be06eb8a6ec077448c1788f76eb5f1fbf 100644 (file)
@@ -95,6 +95,7 @@ enum radeon_family {
     CHIP_VEGAM,
     CHIP_VEGA10,
     CHIP_VEGA12,
+    CHIP_VEGA20,
     CHIP_RAVEN,
     CHIP_LAST,
 };
index 485fd7d0fedeeb0bf6d9f4c3e3229ec11bef7880..d18e6655d33505833034768fb08e1709b16dd5fa 100644 (file)
 #define   S_02883C_USE_PROVOKING_ZW(x)                                (((unsigned)(x) & 0x1) << 4)
 #define   G_02883C_USE_PROVOKING_ZW(x)                                (((x) >> 4) & 0x1)
 #define   C_02883C_USE_PROVOKING_ZW                                   0xFFFFFFEF
+#define R_028840_PA_STEREO_CNTL                                         0x028840
 #define R_028A00_PA_SU_POINT_SIZE                                       0x028A00
 #define   S_028A00_HEIGHT(x)                                          (((unsigned)(x) & 0xFFFF) << 0)
 #define   G_028A00_HEIGHT(x)                                          (((x) >> 0) & 0xFFFF)
index 96ff2a9e46bb7d7937237974d9274f173f4fccb4..b8ee8734379d726381dd07c3013adc4e0e9b6aed 100644 (file)
@@ -78,6 +78,7 @@ const char *si_get_family_name(const struct si_screen *sscreen)
        case CHIP_VEGAM: return "AMD VEGAM";
        case CHIP_VEGA10: return "AMD VEGA10";
        case CHIP_VEGA12: return "AMD VEGA12";
+       case CHIP_VEGA20: return "AMD VEGA20";
        case CHIP_RAVEN: return "AMD RAVEN";
        default: return "AMD unknown";
        }
index ac4f77a89641847c10bfdfda979daee0f7f2205e..d3d0c0ef0756cca149785c2f4843058631adbb36 100644 (file)
@@ -892,7 +892,8 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws,
        unsigned max_offchip_buffers_per_se;
 
        /* Only certain chips can use the maximum value. */
-       if (sscreen->info.family == CHIP_VEGA12)
+       if (sscreen->info.family == CHIP_VEGA12 ||
+           sscreen->info.family == CHIP_VEGA20)
                max_offchip_buffers_per_se = double_offchip_buffers ? 128 : 64;
        else
                max_offchip_buffers_per_se = double_offchip_buffers ? 127 : 63;
index 1214f446fc146b5caccf4709b1ecc88748cb0f91..a51b3739f03acdb56f1e2cd32c8ceace7d182108 100644 (file)
@@ -4992,6 +4992,7 @@ static void si_init_config(struct si_context *sctx)
                switch (sctx->family) {
                case CHIP_VEGA10:
                case CHIP_VEGA12:
+               case CHIP_VEGA20:
                        pc_lines = 4096;
                        break;
                case CHIP_RAVEN:
index b68c637e1e2209f77782f436dd063f3e3d8f211d..4aad94d95f99e67598ed0b51e32b455b0811b347 100644 (file)
@@ -401,6 +401,7 @@ void si_emit_dpbb_state(struct si_context *sctx)
        switch (sctx->family) {
        case CHIP_VEGA10:
        case CHIP_VEGA12:
+       case CHIP_VEGA20:
        case CHIP_RAVEN:
                /* Tuned for Raven. Vega might need different values. */
                context_states_per_bin = 5;