summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr.h
diff options
context:
space:
mode:
authorEric Yang <Eric.Yang2@amd.com>2019-04-22 19:39:35 -0400
committerAlex Deucher <alexander.deucher@amd.com>2019-05-31 10:39:29 -0500
commitdc88b4a684d284a200c0ecfd8d87179d6f6c89a3 (patch)
tree9703a3044486320eecac4ee174d54458d00bcf09 /drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr.h
parent789142eb8bae10ad17872f08b2bd08b8d24743ae (diff)
downloadlinux-stable-dc88b4a684d284a200c0ecfd8d87179d6f6c89a3.tar.gz
linux-stable-dc88b4a684d284a200c0ecfd8d87179d6f6c89a3.tar.bz2
linux-stable-dc88b4a684d284a200c0ecfd8d87179d6f6c89a3.zip
drm/amd/display: make clk mgr soc specific
[Why] First step of refactoring clk mgr to better handle different ways of handling clock operations. Clock operation policies are soc specific and not just DCN vesion specific. It is not a hw resource, should not be in the resource pool. [How] Change clock manager creation to be based on HW internal ID, rename clock manager members to be more clear. Move clock manager out of resource. Signed-off-by: Eric Yang <Eric.Yang2@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr.h')
-rw-r--r--drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr.h32
1 files changed, 22 insertions, 10 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr.h b/drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr.h
index f3fd3f8cac26..0a2346a009ad 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr.h
@@ -26,17 +26,18 @@
#ifndef __DAL_CLK_MGR_H__
#define __DAL_CLK_MGR_H__
-#include "dm_services_types.h"
#include "dc.h"
-struct clk_mgr {
- struct dc_context *ctx;
- struct clk_mgr_funcs *funcs;
-
- struct dc_clocks clks;
-};
+/* Public interfaces */
struct clk_mgr_funcs {
+ /*
+ * This function should set new clocks based on the input "safe_to_lower".
+ * If safe_to_lower == false, then only clocks which are to be increased
+ * should changed.
+ * If safe_to_lower == true, then only clocks which are to be decreased
+ * should be changed.
+ */
void (*update_clocks)(struct clk_mgr *clk_mgr,
struct dc_state *context,
bool safe_to_lower);
@@ -45,11 +46,22 @@ struct clk_mgr_funcs {
void (*init_clocks)(struct clk_mgr *clk_mgr);
- /* Returns actual clk that's set */
- int (*set_dispclk)(struct clk_mgr *clk_mgr, int requested_dispclk_khz);
- int (*set_dprefclk)(struct clk_mgr *clk_mgr);
};
+void dce121_clock_patch_xgmi_ss_info(struct clk_mgr *clk_mgr_base);
+
+struct clk_mgr {
+ struct dc_context *ctx;
+ struct clk_mgr_funcs *funcs;
+ struct dc_clocks clks;
+ int dprefclk_khz; // Used by program pixel clock in clock source funcs, need to figureout where this goes
+};
+
+/* forward declarations */
+struct dccg;
+
+struct clk_mgr *dc_clk_mgr_create(struct dc_context *ctx, struct pp_smu_funcs *pp_smu, struct dccg *dccg);
+void dc_destroy_clk_mgr(struct clk_mgr *clk_mgr);
#endif /* __DAL_CLK_MGR_H__ */