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

drm/amd/display: Add pp_smu functions for Renoir

This defines the interface for communicating requirements
between DC and powerplay.

Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Bhawanpreet Lakha and committed by
Alex Deucher
82f91468 ab618312

+47
+47
drivers/gpu/drm/amd/display/dc/dm_pp_smu.h
··· 44 44 #ifndef CONFIG_TRIM_DRM_AMD_DC_DCN2_0 45 45 PP_SMU_VER_NV, 46 46 #endif 47 + #if defined(CONFIG_DRM_AMD_DC_DCN2_1) 48 + PP_SMU_VER_RN, 49 + #endif 47 50 48 51 PP_SMU_VER_MAX 49 52 }; ··· 249 246 }; 250 247 #endif 251 248 249 + #if defined(CONFIG_DRM_AMD_DC_DCN2_1) 250 + 251 + #define PP_SMU_NUM_SOCCLK_DPM_LEVELS 8 252 + #define PP_SMU_NUM_DCFCLK_DPM_LEVELS 4 253 + #define PP_SMU_NUM_FCLK_DPM_LEVELS 4 254 + #define PP_SMU_NUM_MEMCLK_DPM_LEVELS 4 255 + 256 + struct dpm_clock { 257 + uint32_t Freq; // In MHz 258 + uint32_t Vol; // Millivolts with 2 fractional bits 259 + }; 260 + 261 + 262 + /* this is a copy of the structure defined in smuxx_driver_if.h*/ 263 + struct dpm_clocks { 264 + struct dpm_clock DcfClocks[PP_SMU_NUM_DCFCLK_DPM_LEVELS]; 265 + struct dpm_clock SocClocks[PP_SMU_NUM_SOCCLK_DPM_LEVELS]; 266 + struct dpm_clock FClocks[PP_SMU_NUM_FCLK_DPM_LEVELS]; 267 + struct dpm_clock MemClocks[PP_SMU_NUM_MEMCLK_DPM_LEVELS]; 268 + }; 269 + 270 + 271 + struct pp_smu_funcs_rn { 272 + struct pp_smu pp_smu; 273 + 274 + /* 275 + * reader and writer WM's are sent together as part of one table 276 + * 277 + * PPSMC_MSG_SetDriverDramAddrHigh 278 + * PPSMC_MSG_SetDriverDramAddrLow 279 + * PPSMC_MSG_TransferTableDram2Smu 280 + * 281 + */ 282 + enum pp_smu_status (*set_wm_ranges)(struct pp_smu *pp, 283 + struct pp_smu_wm_range_sets *ranges); 284 + 285 + enum pp_smu_status (*get_dpm_clock_table) (struct pp_smu *pp, 286 + struct dpm_clocks *clock_table); 287 + }; 288 + #endif 289 + 252 290 struct pp_smu_funcs { 253 291 struct pp_smu ctx; 254 292 union { 255 293 struct pp_smu_funcs_rv rv_funcs; 256 294 #ifndef CONFIG_TRIM_DRM_AMD_DC_DCN2_0 257 295 struct pp_smu_funcs_nv nv_funcs; 296 + #endif 297 + #if defined(CONFIG_DRM_AMD_DC_DCN2_1) 298 + struct pp_smu_funcs_rn rn_funcs; 258 299 #endif 259 300 260 301 };