Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: add Pollock IDs, fix Pollock & Dali clk mgr construct

[WHY]
Only a single voltage level should be available to Pollock (min level)
Pollock & Dali get misidentified as Renoir, use wrong clk mgr constructor

[HOW]
Add provided Pollock IDs to ASIC Rev. ID list.
Create new Pollock ASIC RID check, fix RV2 & Dali ASIC checks.
Check RID and set max voltage level to 0 if Pollock is detected.
Work around broken ASICREV_IS_RENOIR, IS_RAVEN2, etc. checks by
performing Dali/Pollock checks before they can be misidentified as RN.

Signed-off-by: Michael Strauss <michael.strauss@amd.com>
Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Michael Strauss and committed by
Alex Deucher
61e50646 eee2eaba

+15 -5
+2 -2
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c
··· 705 705 706 706 unsigned int get_highest_allowed_voltage_level(uint32_t hw_internal_rev) 707 707 { 708 - /* for dali, the highest voltage level we want is 0 */ 709 - if (ASICREV_IS_DALI(hw_internal_rev)) 708 + /* for dali & pollock, the highest voltage level we want is 0 */ 709 + if (ASICREV_IS_POLLOCK(hw_internal_rev) || ASICREV_IS_DALI(hw_internal_rev)) 710 710 return 0; 711 711 712 712 /* we are ok with all levels */
+3 -3
drivers/gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c
··· 134 134 135 135 #if defined(CONFIG_DRM_AMD_DC_DCN) 136 136 case FAMILY_RV: 137 - if (ASICREV_IS_DALI(asic_id.hw_internal_rev)) { 137 + if (ASICREV_IS_DALI(asic_id.hw_internal_rev) || 138 + ASICREV_IS_POLLOCK(asic_id.hw_internal_rev)) { 138 139 /* TEMP: this check has to come before ASICREV_IS_RENOIR */ 139 - /* which also incorrectly returns true for Dali */ 140 + /* which also incorrectly returns true for Dali/Pollock*/ 140 141 rv2_clk_mgr_construct(ctx, clk_mgr, pp_smu); 141 142 break; 142 143 } 143 - 144 144 if (ASICREV_IS_RENOIR(asic_id.hw_internal_rev)) { 145 145 rn_clk_mgr_construct(ctx, clk_mgr, pp_smu, dccg); 146 146 break;
+10
drivers/gpu/drm/amd/display/include/dal_asic_id.h
··· 134 134 #define PICASSO_A0 0x41 135 135 /* DCN1_01 */ 136 136 #define RAVEN2_A0 0x81 137 + #define RAVEN2_15D8_REV_94 0x94 138 + #define RAVEN2_15D8_REV_95 0x95 137 139 #define RAVEN2_15D8_REV_E3 0xE3 138 140 #define RAVEN2_15D8_REV_E4 0xE4 141 + #define RAVEN2_15D8_REV_E9 0xE9 142 + #define RAVEN2_15D8_REV_EA 0xEA 143 + #define RAVEN2_15D8_REV_EB 0xEB 139 144 #define RAVEN1_F0 0xF0 140 145 #define RAVEN_UNKNOWN 0xFF 141 146 #ifndef ASICREV_IS_RAVEN ··· 154 149 #define ASICREV_IS_RV1_F0(eChipRev) ((eChipRev >= RAVEN1_F0) && (eChipRev < RAVEN_UNKNOWN)) 155 150 #define ASICREV_IS_DALI(eChipRev) ((eChipRev == RAVEN2_15D8_REV_E3) \ 156 151 || (eChipRev == RAVEN2_15D8_REV_E4)) 152 + #define ASICREV_IS_POLLOCK(eChipRev) (eChipRev == RAVEN2_15D8_REV_94 \ 153 + || eChipRev == RAVEN2_15D8_REV_95 \ 154 + || eChipRev == RAVEN2_15D8_REV_E9 \ 155 + || eChipRev == RAVEN2_15D8_REV_EA \ 156 + || eChipRev == RAVEN2_15D8_REV_EB) 157 157 158 158 #define FAMILY_RV 142 /* DCN 1*/ 159 159