drm/amd/display: Add wm ranges to clk_mgr
authorSung Lee <sung.lee@amd.com>
Thu, 23 Jan 2020 20:31:43 +0000 (15:31 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 6 Feb 2020 20:04:37 +0000 (15:04 -0500)
[WHY & HOW]
Having watermark ranges saved inside clk_mgr to be
available for debug at all times would be useful.
Add it to the clk_mgr_internal struct for reference.
Only populated for Renoir, unused for other asics.

Signed-off-by: Sung Lee <sung.lee@amd.com>
Reviewed-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c
drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr.h

index 034a5852a4168c8a5abeb2fa430ab134e84bb4ba..8ecb98c29eb93ddb24b739592b94f26708fe3efa 100644 (file)
@@ -459,16 +459,15 @@ void build_watermark_ranges(struct clk_bw_params *bw_params, struct pp_smu_wm_ra
 static void rn_notify_wm_ranges(struct clk_mgr *clk_mgr_base)
 {
        struct dc_debug_options *debug = &clk_mgr_base->ctx->dc->debug;
-       struct pp_smu_wm_range_sets ranges = {0};
        struct clk_mgr_internal *clk_mgr = TO_CLK_MGR_INTERNAL(clk_mgr_base);
        struct pp_smu_funcs *pp_smu = clk_mgr->pp_smu;
 
        if (!debug->disable_pplib_wm_range) {
-               build_watermark_ranges(clk_mgr_base->bw_params, &ranges);
+               build_watermark_ranges(clk_mgr_base->bw_params, &clk_mgr_base->ranges);
 
                /* Notify PP Lib/SMU which Watermarks to use for which clock ranges */
                if (pp_smu && pp_smu->rn_funcs.set_wm_ranges)
-                       pp_smu->rn_funcs.set_wm_ranges(&pp_smu->rn_funcs.pp_smu, &ranges);
+                       pp_smu->rn_funcs.set_wm_ranges(&pp_smu->rn_funcs.pp_smu, &clk_mgr_base->ranges);
        }
 
 }
index ac530c057ddda6584c5dce8e899e137fbadc5e1e..ce65678c03b2f1900a33ce87a8a50c45b9a02f6b 100644 (file)
@@ -27,6 +27,7 @@
 #define __DAL_CLK_MGR_H__
 
 #include "dc.h"
+#include "dm_pp_smu.h"
 
 #define DCN_MINIMUM_DISPCLK_Khz 100000
 #define DCN_MINIMUM_DPPCLK_Khz 100000
@@ -193,6 +194,7 @@ struct clk_mgr {
        int dentist_vco_freq_khz;
        struct clk_state_registers_and_bypass boot_snapshot;
        struct clk_bw_params *bw_params;
+       struct pp_smu_wm_range_sets ranges;
 };
 
 /* forward declarations */