drm/amd/dal: Add POLARIS12 support (v2)
authorJordan Lazare <Jordan.Lazare@amd.com>
Wed, 14 Dec 2016 20:35:13 +0000 (15:35 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 21:05:16 +0000 (17:05 -0400)
v2: agd: squash in dm fix, rebase

Signed-off-by: Jordan Lazare <Jordan.Lazare@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/display/dc/core/dc_resource.c
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c
drivers/gpu/drm/amd/display/include/dal_asic_id.h

index e5ba23253814ea649336b3be2f653652ba2d263c..2a7802c67eaee4e042614406d1da92b24df1a426 100644 (file)
@@ -1235,6 +1235,7 @@ int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
        case CHIP_STONEY:
        case CHIP_POLARIS11:
        case CHIP_POLARIS10:
+       case CHIP_POLARIS12:
                if (dce110_register_irq_handlers(dm->adev)) {
                        DRM_ERROR("DM: Failed to initialize IRQ\n");
                        return -1;
@@ -1472,6 +1473,7 @@ static int dm_early_init(void *handle)
                adev->mode_info.num_dig = 9;
                break;
        case CHIP_POLARIS11:
+       case CHIP_POLARIS12:
                adev->mode_info.num_crtc = 5;
                adev->mode_info.num_hpd = 5;
                adev->mode_info.num_dig = 5;
index f552b0468186807a864242fec31cfdd9af78a6dc..343114b2680f33458dd6f87381efec8c43694db7 100644 (file)
@@ -60,7 +60,8 @@ enum dce_version resource_parse_asic_id(struct hw_asic_id asic_id)
                        break;
                }
                if (ASIC_REV_IS_POLARIS10_P(asic_id.hw_internal_rev) ||
-                               ASIC_REV_IS_POLARIS11_M(asic_id.hw_internal_rev)) {
+                               ASIC_REV_IS_POLARIS11_M(asic_id.hw_internal_rev) ||
+                               ASIC_REV_IS_POLARIS12_V(asic_id.hw_internal_rev)) {
                        dc_version = DCE_VERSION_11_2;
                }
                break;
index 3a478300b848f6632a736d19d3bd9c8f094a97a8..85d8b31acd02b73e4213aa62ae42164b088adb8f 100644 (file)
@@ -1233,7 +1233,8 @@ static void bw_calcs_data_update_from_pplib(struct core_dc *dc)
 const struct resource_caps *dce112_resource_cap(
        struct hw_asic_id *asic_id)
 {
-       if (ASIC_REV_IS_POLARIS11_M(asic_id->hw_internal_rev))
+       if (ASIC_REV_IS_POLARIS11_M(asic_id->hw_internal_rev) ||
+           ASIC_REV_IS_POLARIS12_V(asic_id->hw_internal_rev))
                return &polaris_11_resource_cap;
        else
                return &polaris_10_resource_cap;
index 119297e3bdc0201cdf8a2e8c3b5874904ba5ecad..46f1e88f5e27c6a023377734b3627c04407cc996 100644 (file)
@@ -85,6 +85,7 @@
 /* DCE112 */
 #define VI_POLARIS10_P_A0 80
 #define VI_POLARIS11_M_A0 90
+#define VI_POLARIS12_V_A0 100
 
 #define VI_UNKNOWN 0xFF
 
@@ -95,7 +96,9 @@
 
 #define ASIC_REV_IS_POLARIS10_P(eChipRev) ((eChipRev >= VI_POLARIS10_P_A0) && \
                (eChipRev < VI_POLARIS11_M_A0))
-#define ASIC_REV_IS_POLARIS11_M(eChipRev) (eChipRev >= VI_POLARIS11_M_A0)
+#define ASIC_REV_IS_POLARIS11_M(eChipRev) ((eChipRev >= VI_POLARIS11_M_A0) &&  \
+               (eChipRev < VI_POLARIS12_V_A0))
+#define ASIC_REV_IS_POLARIS12_V(eChipRev) (eChipRev >= VI_POLARIS12_V_A0)
 
 /* DCE11 */
 #define CZ_CARRIZO_A0 0x01