Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd/display: add dc interface for query QoS information

[why]
Add support for retrieving Quality of Service (QoS) metrics from dc
to enable performance analysis and bottleneck identification. This provides
benchmark tools with real-time bandwidth and latency measurements from hardware
performance counters, helping diagnose display system performance issues.

[how]
- Add dc_get_qos_info() function to DC layer for unified QoS data retrieval
- Implement hardware sequencer interface with function pointers for QoS
measurements
- Integrate QoS metrics: peak/average bandwidth (Mbps) and max/average
latency (ns)

Reviewed-by: Aric Cyr <aric.cyr@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Roman Li <roman.li@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Wenjing Liu and committed by
Alex Deucher
e4a3133c c0228872

+97
+24
drivers/gpu/drm/amd/display/dc/core/dc.c
··· 7091 7091 { 7092 7092 dc_dmub_srv_log_preos_dmcub_info(dc->ctx->dmub_srv); 7093 7093 } 7094 + 7095 + bool dc_get_qos_info(struct dc *dc, struct dc_qos_info *info) 7096 + { 7097 + const struct dc_clocks *clk = &dc->current_state->bw_ctx.bw.dcn.clk; 7098 + 7099 + memset(info, 0, sizeof(*info)); 7100 + 7101 + // Check if all measurement functions are available 7102 + if (!dc->hwss.measure_peak_bw_mbps || 7103 + !dc->hwss.measure_avg_bw_mbps || 7104 + !dc->hwss.measure_max_latency_ns || 7105 + !dc->hwss.measure_avg_latency_ns) { 7106 + return false; 7107 + } 7108 + 7109 + // Call measurement functions to get actual values 7110 + info->actual_peak_bw_in_mbps = dc->hwss.measure_peak_bw_mbps(dc); 7111 + info->actual_avg_bw_in_mbps = dc->hwss.measure_avg_bw_mbps(dc); 7112 + info->actual_max_latency_in_ns = dc->hwss.measure_max_latency_ns(dc); 7113 + info->actual_avg_latency_in_ns = dc->hwss.measure_avg_latency_ns(dc); 7114 + info->dcn_bandwidth_ub_in_mbps = (uint32_t)(clk->fclk_khz / 1000 * 64); 7115 + 7116 + return true; 7117 + }
+36
drivers/gpu/drm/amd/display/dc/dc.h
··· 951 951 int min_dcfclk_mhz; 952 952 }; 953 953 954 + struct dc_qos_info { 955 + uint32_t actual_peak_bw_in_mbps; 956 + uint32_t qos_bandwidth_lb_in_mbps; 957 + uint32_t actual_avg_bw_in_mbps; 958 + uint32_t calculated_avg_bw_in_mbps; 959 + uint32_t actual_max_latency_in_ns; 960 + uint32_t qos_max_latency_ub_in_ns; 961 + uint32_t actual_avg_latency_in_ns; 962 + uint32_t qos_avg_latency_ub_in_ns; 963 + uint32_t dcn_bandwidth_ub_in_mbps; 964 + }; 965 + 954 966 struct dc_state; 955 967 struct resource_pool; 956 968 struct dce_hwseq; ··· 3333 3321 * Return: true if state was successfully captured, false on error 3334 3322 */ 3335 3323 bool dc_capture_register_software_state(struct dc *dc, struct dc_register_software_state *state); 3324 + 3325 + /** 3326 + * dc_get_qos_info() - Retrieve Quality of Service (QoS) information from display core 3327 + * @dc: DC context containing current display configuration 3328 + * @info: Pointer to dc_qos_info structure to populate with QoS metrics 3329 + * 3330 + * This function retrieves QoS metrics from the display core that can be used by 3331 + * benchmark tools to analyze display system performance. The function may take 3332 + * several milliseconds to execute due to hardware measurement requirements. 3333 + * 3334 + * QoS information includes: 3335 + * - Bandwidth bounds (lower limits in Mbps) 3336 + * - Latency bounds (upper limits in nanoseconds) 3337 + * - Hardware-measured bandwidth metrics (peak/average in Mbps) 3338 + * - Hardware-measured latency metrics (maximum/average in nanoseconds) 3339 + * 3340 + * The function will populate the provided dc_qos_info structure with current 3341 + * QoS measurements. If hardware measurement functions are not available for 3342 + * the current DCN version, the function returns false with zero'd info structure. 3343 + * 3344 + * Return: true if QoS information was successfully retrieved, false if measurement 3345 + * functions are unavailable or hardware measurements cannot be performed 3346 + */ 3347 + bool dc_get_qos_info(struct dc *dc, struct dc_qos_info *info); 3336 3348 3337 3349 #endif /* DC_INTERFACE_H_ */
+37
drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h
··· 1287 1287 void (*get_underflow_debug_data)(const struct dc *dc, 1288 1288 struct timing_generator *tg, 1289 1289 struct dc_underflow_debug_data *out_data); 1290 + 1291 + /** 1292 + * measure_peak_bw_mbps - Measure actual peak bandwidth in Mbps 1293 + * @dc: DC structure 1294 + * 1295 + * Returns the measured peak bandwidth value in Mbps from hardware 1296 + * performance counters or registers. 1297 + */ 1298 + uint32_t (*measure_peak_bw_mbps)(struct dc *dc); 1299 + 1300 + /** 1301 + * measure_avg_bw_mbps - Measure actual average bandwidth in Mbps 1302 + * @dc: DC structure 1303 + * 1304 + * Returns the measured average bandwidth value in Mbps from hardware 1305 + * performance counters or registers. 1306 + */ 1307 + uint32_t (*measure_avg_bw_mbps)(struct dc *dc); 1308 + 1309 + /** 1310 + * measure_max_latency_ns - Measure actual maximum latency in nanoseconds 1311 + * @dc: DC structure 1312 + * 1313 + * Returns the measured maximum latency value in nanoseconds from hardware 1314 + * performance counters or registers. 1315 + */ 1316 + uint32_t (*measure_max_latency_ns)(struct dc *dc); 1317 + 1318 + /** 1319 + * measure_avg_latency_ns - Measure actual average latency in nanoseconds 1320 + * @dc: DC structure 1321 + * 1322 + * Returns the measured average latency value in nanoseconds from hardware 1323 + * performance counters or registers. 1324 + */ 1325 + uint32_t (*measure_avg_latency_ns)(struct dc *dc); 1326 + 1290 1327 }; 1291 1328 1292 1329 void color_space_to_black_color(