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

drm/amd/display: Driver support for MCLK query tool

Implement handling for escape call to query the MCLK switch support for
the current display config.

Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alvin Lee <Alvin.Lee2@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Alvin Lee and committed by
Alex Deucher
2eee829e 9506b8d9

+25
+24
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c
··· 47 47 unsigned int num_pipes); 48 48 49 49 static unsigned int CursorBppEnumToBits(enum cursor_bpp ebpp); 50 + static void cache_debug_params(struct display_mode_lib *mode_lib); 50 51 51 52 unsigned int dml_get_voltage_level( 52 53 struct display_mode_lib *mode_lib, ··· 74 73 PixelClockAdjustmentForProgressiveToInterlaceUnit(mode_lib); 75 74 } 76 75 mode_lib->funcs.validate(mode_lib); 76 + cache_debug_params(mode_lib); 77 77 78 78 return mode_lib->vba.VoltageLevel; 79 79 } ··· 745 743 746 744 mode_lib->vba.GPUVMEnable = mode_lib->vba.GPUVMEnable && !!ip->gpuvm_enable; 747 745 mode_lib->vba.HostVMEnable = mode_lib->vba.HostVMEnable && !!ip->hostvm_enable; 746 + } 747 + 748 + /** 749 + * ******************************************************************************************** 750 + * cache_debug_params: Cache any params that needed to be maintained from the initial validation 751 + * for debug purposes. 752 + * 753 + * The DML getters can modify some of the VBA params that we are interested in (for example when 754 + * calculating with dummy p-state latency), so cache any params here that we want for debugging 755 + * 756 + * @param [in] mode_lib: mode_lib input/output of validate call 757 + * 758 + * @return: void 759 + * 760 + * ******************************************************************************************** 761 + */ 762 + static void cache_debug_params(struct display_mode_lib *mode_lib) 763 + { 764 + int k = 0; 765 + 766 + for (k = 0; k < mode_lib->vba.NumberOfActivePlanes; k++) 767 + mode_lib->vba.CachedActiveDRAMClockChangeLatencyMargin[k] = mode_lib->vba.ActiveDRAMClockChangeLatencyMargin[k]; 748 768 } 749 769 750 770 // in wm mode we pull the parameters needed from the display_e2e_pipe_params_st structs
+1
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h
··· 195 195 unsigned int LBLatencyHidingSourceLinesY; 196 196 unsigned int LBLatencyHidingSourceLinesC; 197 197 double ActiveDRAMClockChangeLatencyMargin[DC__NUM_DPP__MAX]; 198 + double CachedActiveDRAMClockChangeLatencyMargin[DC__NUM_DPP__MAX]; // Cache in dml_get_voltage_level for debug purposes only 198 199 double MinActiveDRAMClockChangeMargin; 199 200 double InitFillLevel; 200 201 double FinalFillMargin;