drm/amd/display: add memory bandwidth override debug interface

[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>
This commit is contained in:
Wenjing Liu 2026-04-17 15:46:02 -04:00 committed by Alex Deucher
parent 74ef54e656
commit d05a1c347c
4 changed files with 54 additions and 1 deletions

View 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,

View 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_ */

View 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 {

View 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 {