drm/amd/display: cleaning up smu_if to add future flexibility
Subsystems (3)
PATCH 2/21 drm/amd/display: cleaning up smu_if to add future flexibility
From: Martin Leung <[email protected]>
why and how:
need to hook in new smu interfaces
cleaning up code that used old variables
Reviewed-by Nevenko Stupar <[email protected]>
Acked-by Alan Liu <[email protected]>
Signed-off-by Martin Leung <[email protected]>
--- .../display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c | 13 +--- .../dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.c | 9 ++- .../dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.h | 67 +---------------- .../dc/clk_mgr/dcn30/dcn30_smu11_driver_if.h | 74 +++++++++++++++++++ .../display/include/grph_object_ctrl_defs.h | 22 ------ 5 files changed, 86 insertions(+), 99 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_smu11_driver_if.h
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c +3 -10
@@ -25,30 +25,23 @@#include "dccg.h" #include "clk_mgr_internal.h" -#include "dcn30_clk_mgr_smu_msg.h" #include "dcn20/dcn20_clk_mgr.h" #include "dce100/dce_clk_mgr.h" +#include "dcn30/dcn30_clk_mgr.h" #include "reg_helper.h" #include "core_types.h" #include "dm_helpers.h" -#include "atomfirmware.h" - -#include "sienna_cichlid_ip_offset.h" #include "dcn/dcn_3_0_0_offset.h" #include "dcn/dcn_3_0_0_sh_mask.h" -#include "nbio/nbio_7_4_offset.h" -#include "dpcs/dpcs_3_0_0_offset.h" #include "dpcs/dpcs_3_0_0_sh_mask.h" -#include "mmhub/mmhub_2_0_0_offset.h" #include "mmhub/mmhub_2_0_0_sh_mask.h" -/*we don't have clk folder yet*/ -#include "dcn30/dcn30_clk_mgr.h" +#include "dcn30_smu11_driver_if.h" #undef FN#define FN (reg_name, field_name) \
@@ -83,7 +76,7 @@ static const struct clk_mgr_mask clk_mgr_mask = {/* Query SMU for all clock states for a particular clock */ -static void dcn3_init_single_clock (struct clk_mgr_internal *clk_mgr,PPCLK_e clk,unsigned int *entry_0,unsigned int *num_levels) +static void dcn3_init_single_clock (struct clk_mgr_internal *clk_mgr,uint32_t clk,unsigned int *entry_0,unsigned int *num_levels) {unsigned int i;char *entry_i = (char *)entry_0;
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.c +5 -4
@@ -29,6 +29,7 @@#include "clk_mgr_internal.h" #include "reg_helper.h" #include "dalsmc.h" +#include "dcn30_smu11_driver_if.h" #define mmDAL_MSG_REG 0x1628A#define mmDAL_ARG_REG 0x16273
@@ -197,7 +198,7 @@ void dcn30_smu_transfer_wm_table_dram_2_smu(struct clk_mgr_internal *clk_mgr) }/* Returns the actual frequency that was set in MHz, 0 on failure */ -unsigned int dcn30_smu_set_hard_min_by_freq (struct clk_mgr_internal *clk_mgr,PPCLK_e clk,uint16_t freq_mhz) +unsigned int dcn30_smu_set_hard_min_by_freq (struct clk_mgr_internal *clk_mgr,uint32_t clk,uint16_t freq_mhz) {uint32_t response =0 ;
@@ -215,7 +216,7 @@ unsigned int dcn30_smu_set_hard_min_by_freq(struct clk_mgr_internal *clk_mgr, PP }/* Returns the actual frequency that was set in MHz, 0 on failure */ -unsigned int dcn30_smu_set_hard_max_by_freq (struct clk_mgr_internal *clk_mgr,PPCLK_e clk,uint16_t freq_mhz) +unsigned int dcn30_smu_set_hard_max_by_freq (struct clk_mgr_internal *clk_mgr,uint32_t clk,uint16_t freq_mhz) {uint32_t response =0 ;
@@ -246,7 +247,7 @@ unsigned int dcn30_smu_set_hard_max_by_freq(struct clk_mgr_internal *clk_mgr, PP* * Returns 0 on failure */ -unsigned int dcn30_smu_get_dpm_freq_by_index (struct clk_mgr_internal *clk_mgr,PPCLK_e clk,uint8_t dpm_level) +unsigned int dcn30_smu_get_dpm_freq_by_index (struct clk_mgr_internal *clk_mgr,uint32_t clk,uint8_t dpm_level) {uint32_t response =0 ;
@@ -264,7 +265,7 @@ unsigned int dcn30_smu_get_dpm_freq_by_index(struct clk_mgr_internal *clk_mgr, P }/* Returns the max DPM frequency in DC mode in MHz, 0 on failure */ -unsigned int dcn30_smu_get_dc_mode_max_dpm_freq (struct clk_mgr_internal *clk_mgr,PPCLK_e clk) +unsigned int dcn30_smu_get_dc_mode_max_dpm_freq (struct clk_mgr_internal *clk_mgr,uint32_t clk) {uint32_t response =0 ;
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.h +4 -63
79 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_smu11_driver_if.h new file +74 -0
74 lines not on this page · raw message
drivers/gpu/drm/amd/display/include/grph_object_ctrl_defs.h +0 -22
@@ -419,28 +419,6 @@ struct integrated_info {struct edp_info edp2_info; }; -/** -* Power source ids. -*/ -enum power_source { -POWER_SOURCE_AC =0 , -POWER_SOURCE_DC , -POWER_SOURCE_LIMITED_POWER , -POWER_SOURCE_LIMITED_POWER_2 , -POWER_SOURCE_MAX -}; - -struct bios_event_info { -uint32_t thermal_state; -uint32_t backlight_level; -enum power_source powerSource; -bool has_thermal_state_changed; -bool has_power_source_changed; -bool has_forced_mode_changed; -bool forced_mode; -bool backlight_changed; -}; -/* * DFS-bypass flag */
Signature · 1 line
2.25.1