]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: add memory bandwidth override debug interface
authorWenjing Liu <wenjing.liu@amd.com>
Fri, 17 Apr 2026 19:46:02 +0000 (15:46 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 5 May 2026 13:56:53 +0000 (09:56 -0400)
[Why & How]
Add override_memory_bandwidth_request to clk_mgr_funcs and get_utm_qos_model callback
 to soc_and_ip_translator_funcs for future test use.

Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: James Lin <pinglei.lin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc.c
drivers/gpu/drm/amd/display/dc/dc.h
drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr.h
drivers/gpu/drm/amd/display/dc/inc/soc_and_ip_translator.h

index bed7cefe871c09630f675e1f7fa31df6c91daffb..2cb1d1bf03762411c92109faccef9401f30321bb 100644 (file)
@@ -7624,6 +7624,17 @@ bool dc_get_qos_info(struct dc *dc, struct dc_qos_info *info)
        return true;
 }
 
+unsigned int dc_override_memory_bandwidth_request(
+               struct dc *dc,
+               unsigned int bw_mbps)
+{
+       if (!dc->clk_mgr || !dc->clk_mgr->funcs)
+               return 0;
+
+       return dc->clk_mgr->funcs->override_memory_bandwidth_request(
+                       dc->clk_mgr, bw_mbps * 1000) / 1000;
+}
+
 enum update_v3_flow {
        UPDATE_V3_FLOW_INVALID,
        UPDATE_V3_FLOW_NO_NEW_CONTEXT_CONTEXT_FAST,
index ddaf4fee3b638d1131b544cb47d66820a3a836ac..73901ac94b7d632b45e52ef2ddaf2dc84e9e7e56 100644 (file)
@@ -3383,4 +3383,17 @@ bool dc_capture_register_software_state(struct dc *dc, struct dc_register_softwa
  */
 bool dc_get_qos_info(struct dc *dc, struct dc_qos_info *info);
 
+/**
+ * dc_override_memory_bandwidth_request - Override the DCN nominal memory
+ *     bandwidth request sent to PMFW, independent of the current display mode.
+ *     For debug use only.
+ * @dc: DC instance
+ * @bw_mbps: requested bandwidth in MB/s; 0 clears the override
+ *
+ * Return: capped bandwidth value actually applied (MB/s)
+ */
+unsigned int dc_override_memory_bandwidth_request(
+               struct dc *dc,
+               unsigned int bw_mbps);
+
 #endif /* DC_INTERFACE_H_ */
index 21224fd6b36d658d52d44cd2ff4f68dd75220371..eab25efea76bf6811f81bfaca6d641e461258511 100644 (file)
@@ -362,6 +362,18 @@ struct clk_mgr_funcs {
        uint32_t (*set_smartmux_switch)(struct clk_mgr *clk_mgr, uint32_t pins_to_set);
 
        unsigned int (*get_max_clock_khz)(struct clk_mgr *clk_mgr_base, enum clk_type clk_type);
+       /**
+        * override_memory_bandwidth_request - Override the DCN nominal memory
+        *     bandwidth request sent to PMFW, independent of the current display
+        *     mode. For debug use only.
+        * @clk_mgr: clock manager instance
+        * @bw_kbps: requested bandwidth in kbps; 0 clears the override
+        *
+        * Return: capped bandwidth value actually applied (kbps)
+        */
+       unsigned int (*override_memory_bandwidth_request)(
+                       struct clk_mgr *clk_mgr,
+                       unsigned int bw_kbps);
 };
 
 struct clk_mgr {
index 23daf98b8aa88fc85d6d12cc8c69790bb41db024..6a97a3e28bd2ce2acc52ab406f87bd970390229f 100644 (file)
@@ -8,9 +8,26 @@
 #include "dc.h"
 #include "dml_top_soc_parameter_types.h"
 
+/* Forward declarations — callers that dereference these structs must include
+ * the full UTM model headers themselves. */
+struct utm_qos_model;
+struct utm_qos_model_dchub_v2;
+
 struct soc_and_ip_translator_funcs {
-       void (*get_soc_bb)(struct dml2_soc_bb *soc_bb, const struct dc *dc, const struct dml2_configuration_options *config);
+       void (*get_soc_bb)(
+                       struct dml2_soc_bb *soc_bb,
+                       const struct dc *dc,
+                       const struct dml2_configuration_options *config);
        void (*get_ip_caps)(struct dml2_ip_capabilities *dml_ip_caps);
+       /**
+        * get_utm_qos_model - Return the static UTM QoS model for this DCN
+        *     generation. Caller provides storage for @qos_model and @dchub.
+        * @qos_model: output — populated with SoC bounding box and SOP table
+        * @dchub: output — populated with DCHUB client extension data
+        */
+       void (*get_utm_qos_model)(
+                       struct utm_qos_model *qos_model,
+                       struct utm_qos_model_dchub_v2 *dchub);
 };
 
 struct soc_and_ip_translator {