DC Patches June 16, 2025
Subsystems (3)
cover DC Patches June 16, 2025
This DC patchset brings improvements in multiple areas. In summary, we highlight:
* Improve USB4 bandwidth validation
* dml clock calcuation with EQU Prefetch included
* Tweaking udelay time to fix "failed to blank crtc!" error
* Add LSDMA support to DMUB
* Fix Coverity issue
Alex Hung (1):
drm/amd/display: Initialize mode_select to 0
Alvin Lee (1):
drm/amd/display: Removed unnecessary comment
Austin Zheng (2):
drm/amd/display: Include EQU Prefetch Bandwidth For Bandwidth
Calculations
drm/amd/display: DML21 Reintegration
Cruise Hung (1):
drm/amd/display: Add new DP tunnel bandwidth validation
Fangzhi Zuo (1):
drm/amd/display: Rewording Mode Validation Result
Ilya Bakoulin (1):
drm/amd/display: Add num_slices_h to set_dto_dscclk signature
Ostrowski, Rafal (1):
drm/amd/display: LSDMA support
Ovidiu Bunea (1):
drm/amd/display: Add DMUB IPS command support for IPS residency tools
Taimur Hassan (2):
drm/amd/display: [FW Promotion] Release 0.1.16.0 drm/amd/display: Promote DAL to 3.2.339
Wen Chen (1):
drm/amd/display: Fix 'failed to blank crtc!'
Weiguang Li (1):
drm/amd/display: Remove redundant macro of refresh rate
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- .../gpu/drm/amd/display/dc/core/dc_debug.c | 2 + .../drm/amd/display/dc/core/dc_link_exports.c | 6 + drivers/gpu/drm/amd/display/dc/dc.h | 16 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 297 ++++++++++++++---- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 77 ++++- drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 15 + drivers/gpu/drm/amd/display/dc/dc_types.h | 7 + .../amd/display/dc/dccg/dcn401/dcn401_dccg.c | 2 +- .../amd/display/dc/dccg/dcn401/dcn401_dccg.h | 3 +- .../dc/dml2/dml21/dml21_translation_helper.c | 1 - .../dml2/dml21/inc/dml_top_dchub_registers.h | 1 + .../dml21/inc/dml_top_display_cfg_types.h | 2 + .../dml21/inc/dml_top_soc_parameter_types.h | 1 + .../display/dc/dml2/dml21/inc/dml_top_types.h | 4 +- .../src/dml2_core/dml2_core_dcn4_calcs.c | 46 +-- .../src/dml2_core/dml2_core_shared_types.h | 99 +++++- .../dc/dml2/dml21/src/inc/dml2_debug.h | 149 ++++++++- .../amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 2 +- .../amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 6 +- .../gpu/drm/amd/display/dc/inc/core_status.h | 1 + drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h | 2 +- drivers/gpu/drm/amd/display/dc/inc/link.h | 3 + .../gpu/drm/amd/display/dc/link/link_dpms.c | 10 +- .../drm/amd/display/dc/link/link_factory.c | 1 + .../drm/amd/display/dc/link/link_validation.c | 85 ++++- .../drm/amd/display/dc/link/link_validation.h | 3 + .../display/dc/link/protocols/link_dp_dpia.c | 15 +- .../dc/link/protocols/link_dp_dpia_bw.c | 169 +++++++--- .../dc/link/protocols/link_dp_dpia_bw.h | 27 +- .../amd/display/dc/mpc/dcn401/dcn401_mpc.c | 2 +- drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 10 +- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 101 +++++- .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 4 + .../amd/display/modules/freesync/freesync.c | 2 +- 35 files changed, 970 insertions(+), 203 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/13 drm/amd/display: Include EQU Prefetch Bandwidth For Bandwidth Calculations
From: Austin Zheng <[email protected]>
[Why]
Pixel data bandwidth required in mode programming (MP) ends up being higher than what was calculated in mode support (MS) even though the prefetch bandwidths calculated in MP are lower than the MS ones.
MP used a different equ prefetch schedule than MS which lead a slight difference in parameters. This resulted in the pixel data bandwidth in MP to be higher than MS.
[How]
Rename the RequiredPrefetchBWOTO term so it can be applied generically. Update the value with the EQU bandwidth if the EQU schedule is used. Get the max prefetch bandwidth that MS calculated and use it as part of the calculations for required bandwidth.
--- .../src/dml2_core/dml2_core_dcn4_calcs.c | 42 +++++++++++-------- .../src/dml2_core/dml2_core_shared_types.h | 16 ++++--- 2 files changed, 35 insertions(+), 23 deletions(-)
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.c +24 -18
@@ -4861,7 +4861,7 @@ static double get_urgent_bandwidth_required(double ReadBandwidthChroma[], double PrefetchBandwidthLuma[], double PrefetchBandwidthChroma[], - double PrefetchBandwidthOto[], + double PrefetchBandwidthMax[], double excess_vactive_fill_bw_l[], double excess_vactive_fill_bw_c[], double cursor_bw[],
@@ -4925,9 +4925,9 @@ static double get_urgent_bandwidth_required( l->vm_row_bw = NumberOfDPP[k] * prefetch_vmrow_bw[k]; l->flip_and_active_bw = l->per_plane_flip_bw[k] + ReadBandwidthLuma[k] * l->adj_factor_p0 + ReadBandwidthChroma[k] * l->adj_factor_p1 + cursor_bw[k] * l->adj_factor_cur; l->flip_and_prefetch_bw = l->per_plane_flip_bw[k] + NumberOfDPP[k] * (PrefetchBandwidthLuma[k] * l->adj_factor_p0_pre + PrefetchBandwidthChroma[k] * l->adj_factor_p1_pre) + prefetch_cursor_bw[k] * l->adj_factor_cur_pre; - l->flip_and_prefetch_bw_oto = l->per_plane_flip_bw[k] + NumberOfDPP[k] * (PrefetchBandwidthOto[k] * l->adj_factor_p0_pre + PrefetchBandwidthChroma[k] * l->adj_factor_p1_pre) + prefetch_cursor_bw[k] * l->adj_factor_cur_pre; + l->flip_and_prefetch_bw_max = l->per_plane_flip_bw[k] + NumberOfDPP[k] * (PrefetchBandwidthMax[k] * l->adj_factor_p0_pre + PrefetchBandwidthChroma[k] * l->adj_factor_p1_pre) + prefetch_cursor_bw[k] * l->adj_factor_cur_pre; l->active_and_excess_bw = (ReadBandwidthLuma[k] + excess_vactive_fill_bw_l[k]) * l->tmp_nom_adj_factor_p0 + (ReadBandwidthChroma[k] + excess_vactive_fill_bw_c[k]) * l->tmp_nom_adj_factor_p1 + dpte_row_bw[k] + meta_row_bw[k]; - surface_required_bw[k] =math_max5 (l->vm_row_bw, l->flip_and_active_bw, l->flip_and_prefetch_bw, l->active_and_excess_bw, l->flip_and_prefetch_bw_oto); + surface_required_bw[k] =math_max5 (l->vm_row_bw, l->flip_and_active_bw, l->flip_and_prefetch_bw, l->active_and_excess_bw, l->flip_and_prefetch_bw_max);/* export peak required bandwidth for the surface */ surface_peak_required_bw[k] =math_max2 (surface_required_bw[k], surface_peak_required_bw[k]);
@@ -5125,7 +5125,7 @@ static bool CalculatePrefetchSchedule(struct dml2_core_internal_scratch *scratch s->Tsw_est3 =0.0 ; s->cursor_prefetch_bytes =0 ; *p->prefetch_cursor_bw =0 ; - *p->RequiredPrefetchBWOTO =0.0 ; + *p->RequiredPrefetchBWMax =0.0 ; dcc_mrq_enable = (p->dcc_enable && p->mrq_present);
@@ -5356,7 +5356,7 @@ static bool CalculatePrefetchSchedule(struct dml2_core_internal_scratch *scratch* mp will fail if ms decides to use equ schedule and mp decides to use oto schedule * and the required bandwidth increases when going from ms to mp */ - *p->RequiredPrefetchBWOTO = s->prefetch_bw_oto; + *p->RequiredPrefetchBWMax = s->prefetch_bw_oto;#ifdef __DML_VBA_DEBUG__DML_LOG_VERBOSE ("DML::%s: vactive_sw_bw_l = %f\n" , __func__, p->vactive_sw_bw_l);
@@ -5718,8 +5718,14 @@ static bool CalculatePrefetchSchedule(struct dml2_core_internal_scratch *scratch s->TimeForFetchingVM = s->Tvm_equ; s->TimeForFetchingRowInVBlank = s->Tr0_equ; - *p->dst_y_per_vm_vblank =math_ceil2 (4.0 * s->TimeForFetchingVM / s->LineTime,1.0 ) /4.0 ; - *p->dst_y_per_row_vblank =math_ceil2 (4.0 * s->TimeForFetchingRowInVBlank / s->LineTime,1.0 ) /4.0 ; + *p->dst_y_per_vm_vblank =math_ceil2 (4.0 * s->TimeForFetchingVM / s->LineTime,1.0 ) /4.0 ; + *p->dst_y_per_row_vblank =math_ceil2 (4.0 * s->TimeForFetchingRowInVBlank / s->LineTime,1.0 ) /4.0 ; + +/* equ bw should be propagated so a ceiling of the equ bw is accounted for prior to mode programming. +* Overall bandwidth may be lower when going from mode support to mode programming but final pixel data +* bandwidth may end up higher than what was calculated in mode support. +*/ + *p->RequiredPrefetchBWMax =math_max2 (s->prefetch_bw_equ, *p->RequiredPrefetchBWMax);#ifdef __DML_VBA_DEBUG__DML_LOG_VERBOSE ("DML::%s: Using equ bw scheduling for prefetch\n" , __func__);
@@ -6115,7 +6121,7 @@ static void calculate_peak_bandwidth_required( p->surface_read_bandwidth_c, l->zero_array,//PrefetchBandwidthLuma, l->zero_array,//PrefetchBandwidthChroma, - l->zero_array,//PrefetchBWOTO + l->zero_array,//PrefetchBWMax l->zero_array, l->zero_array, l->zero_array,
@@ -6152,7 +6158,7 @@ static void calculate_peak_bandwidth_required( p->surface_read_bandwidth_c, l->zero_array,//PrefetchBandwidthLuma, l->zero_array,//PrefetchBandwidthChroma, - l->zero_array,//PrefetchBWOTO + l->zero_array,//PrefetchBWMax p->excess_vactive_fill_bw_l, p->excess_vactive_fill_bw_c, p->cursor_bw,
@@ -6189,7 +6195,7 @@ static void calculate_peak_bandwidth_required( p->surface_read_bandwidth_c, p->prefetch_bandwidth_l, p->prefetch_bandwidth_c, - p->prefetch_bandwidth_oto,// to prevent ms/mp mismatch when oto bw > total vactive bw + p->prefetch_bandwidth_max,// to prevent ms/mp mismatches where mp prefetch bw > ms prefetch bw p->excess_vactive_fill_bw_l, p->excess_vactive_fill_bw_c, p->cursor_bw,
@@ -6226,7 +6232,7 @@ static void calculate_peak_bandwidth_required( p->surface_read_bandwidth_c, p->prefetch_bandwidth_l, p->prefetch_bandwidth_c, - p->prefetch_bandwidth_oto,// to prevent ms/mp mismatch when oto bw > total vactive bw + p->prefetch_bandwidth_max,// to prevent ms/mp mismatch where mp prefetch bw > ms prefetch bw p->excess_vactive_fill_bw_l, p->excess_vactive_fill_bw_c, p->cursor_bw,
@@ -6263,7 +6269,7 @@ static void calculate_peak_bandwidth_required( p->surface_read_bandwidth_c, p->prefetch_bandwidth_l, p->prefetch_bandwidth_c, - p->prefetch_bandwidth_oto,// to prevent ms/mp mismatch when oto bw > total vactive bw + p->prefetch_bandwidth_max,// to prevent ms/mp mismatches where mp prefetch bw > ms prefetch bw p->excess_vactive_fill_bw_l, p->excess_vactive_fill_bw_c, p->cursor_bw,
@@ -7490,7 +7496,7 @@ static noinline_for_stack void dml_core_ms_prefetch_check(struct dml2_core_inter CalculatePrefetchSchedule_params->VRatioPrefetchC = &mode_lib->ms.VRatioPreC[k]; CalculatePrefetchSchedule_params->RequiredPrefetchPixelDataBWLuma = &mode_lib->ms.RequiredPrefetchPixelDataBWLuma[k];// prefetch_sw_bw_l CalculatePrefetchSchedule_params->RequiredPrefetchPixelDataBWChroma = &mode_lib->ms.RequiredPrefetchPixelDataBWChroma[k];// prefetch_sw_bw_c - CalculatePrefetchSchedule_params->RequiredPrefetchBWOTO = &mode_lib->ms.RequiredPrefetchBWOTO[k]; + CalculatePrefetchSchedule_params->RequiredPrefetchBWMax = &mode_lib->ms.RequiredPrefetchBWMax[k]; CalculatePrefetchSchedule_params->NotEnoughTimeForDynamicMetadata = &mode_lib->ms.NoTimeForDynamicMetadata[k]; CalculatePrefetchSchedule_params->Tno_bw = &mode_lib->ms.Tno_bw[k]; CalculatePrefetchSchedule_params->Tno_bw_flip = &mode_lib->ms.Tno_bw_flip[k];
@@ -7635,7 +7641,7 @@ static noinline_for_stack void dml_core_ms_prefetch_check(struct dml2_core_inter calculate_peak_bandwidth_params->surface_read_bandwidth_c = mode_lib->ms.vactive_sw_bw_c; calculate_peak_bandwidth_params->prefetch_bandwidth_l = mode_lib->ms.RequiredPrefetchPixelDataBWLuma; calculate_peak_bandwidth_params->prefetch_bandwidth_c = mode_lib->ms.RequiredPrefetchPixelDataBWChroma; - calculate_peak_bandwidth_params->prefetch_bandwidth_oto = mode_lib->ms.RequiredPrefetchBWOTO; + calculate_peak_bandwidth_params->prefetch_bandwidth_max = mode_lib->ms.RequiredPrefetchBWMax; calculate_peak_bandwidth_params->excess_vactive_fill_bw_l = mode_lib->ms.excess_vactive_fill_bw_l; calculate_peak_bandwidth_params->excess_vactive_fill_bw_c = mode_lib->ms.excess_vactive_fill_bw_c; calculate_peak_bandwidth_params->cursor_bw = mode_lib->ms.cursor_bw;
@@ -7802,7 +7808,7 @@ static noinline_for_stack void dml_core_ms_prefetch_check(struct dml2_core_inter calculate_peak_bandwidth_params->surface_read_bandwidth_c = mode_lib->ms.vactive_sw_bw_c; calculate_peak_bandwidth_params->prefetch_bandwidth_l = mode_lib->ms.RequiredPrefetchPixelDataBWLuma; calculate_peak_bandwidth_params->prefetch_bandwidth_c = mode_lib->ms.RequiredPrefetchPixelDataBWChroma; - calculate_peak_bandwidth_params->prefetch_bandwidth_oto = mode_lib->ms.RequiredPrefetchBWOTO; + calculate_peak_bandwidth_params->prefetch_bandwidth_max = mode_lib->ms.RequiredPrefetchBWMax; calculate_peak_bandwidth_params->excess_vactive_fill_bw_l = mode_lib->ms.excess_vactive_fill_bw_l; calculate_peak_bandwidth_params->excess_vactive_fill_bw_c = mode_lib->ms.excess_vactive_fill_bw_c; calculate_peak_bandwidth_params->cursor_bw = mode_lib->ms.cursor_bw;
@@ -11257,7 +11263,7 @@ static bool dml_core_mode_programming(struct dml2_core_calcs_mode_programming_ex CalculatePrefetchSchedule_params->VRatioPrefetchC = &mode_lib->mp.VRatioPrefetchC[k]; CalculatePrefetchSchedule_params->RequiredPrefetchPixelDataBWLuma = &mode_lib->mp.RequiredPrefetchPixelDataBWLuma[k]; CalculatePrefetchSchedule_params->RequiredPrefetchPixelDataBWChroma = &mode_lib->mp.RequiredPrefetchPixelDataBWChroma[k]; - CalculatePrefetchSchedule_params->RequiredPrefetchBWOTO = &s->dummy_single_array[0 ][k]; + CalculatePrefetchSchedule_params->RequiredPrefetchBWMax = &s->dummy_single_array[0 ][k]; CalculatePrefetchSchedule_params->NotEnoughTimeForDynamicMetadata = &mode_lib->mp.NotEnoughTimeForDynamicMetadata[k]; CalculatePrefetchSchedule_params->Tno_bw = &mode_lib->mp.Tno_bw[k]; CalculatePrefetchSchedule_params->Tno_bw_flip = &mode_lib->mp.Tno_bw_flip[k];
@@ -11400,7 +11406,7 @@ static bool dml_core_mode_programming(struct dml2_core_calcs_mode_programming_ex calculate_peak_bandwidth_params->surface_read_bandwidth_c = mode_lib->mp.vactive_sw_bw_c; calculate_peak_bandwidth_params->prefetch_bandwidth_l = mode_lib->mp.RequiredPrefetchPixelDataBWLuma; calculate_peak_bandwidth_params->prefetch_bandwidth_c = mode_lib->mp.RequiredPrefetchPixelDataBWChroma; - calculate_peak_bandwidth_params->prefetch_bandwidth_oto = s->dummy_single_array[0 ]; + calculate_peak_bandwidth_params->prefetch_bandwidth_max = s->dummy_single_array[0 ]; calculate_peak_bandwidth_params->excess_vactive_fill_bw_l = mode_lib->mp.excess_vactive_fill_bw_l; calculate_peak_bandwidth_params->excess_vactive_fill_bw_c = mode_lib->mp.excess_vactive_fill_bw_c; calculate_peak_bandwidth_params->cursor_bw = mode_lib->mp.cursor_bw;
@@ -11540,7 +11546,7 @@ static bool dml_core_mode_programming(struct dml2_core_calcs_mode_programming_ex calculate_peak_bandwidth_params->meta_row_bw = mode_lib->mp.meta_row_bw; calculate_peak_bandwidth_params->prefetch_cursor_bw = mode_lib->mp.prefetch_cursor_bw; calculate_peak_bandwidth_params->prefetch_vmrow_bw = mode_lib->mp.prefetch_vmrow_bw; - calculate_peak_bandwidth_params->prefetch_bandwidth_oto = s->dummy_single_array[0 ]; + calculate_peak_bandwidth_params->prefetch_bandwidth_max = s->dummy_single_array[0 ]; calculate_peak_bandwidth_params->flip_bw = mode_lib->mp.final_flip_bw; calculate_peak_bandwidth_params->urgent_burst_factor_l = mode_lib->mp.UrgentBurstFactorLuma; calculate_peak_bandwidth_params->urgent_burst_factor_c = mode_lib->mp.UrgentBurstFactorChroma;
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_shared_types.h +11 -5
@@ -497,8 +497,14 @@ struct dml2_core_internal_mode_support {double WriteBandwidth[DML2_MAX_PLANES ][DML2_MAX_WRITEBACK ];double RequiredPrefetchPixelDataBWLuma[DML2_MAX_PLANES ];double RequiredPrefetchPixelDataBWChroma[DML2_MAX_PLANES ]; -/* oto bw should also be considered when calculating peak urgent bw to avoid situations oto/equ mismatches between ms and mp */ -double RequiredPrefetchBWOTO[DML2_MAX_PLANES ]; +/* Max bandwidth calculated from prefetch schedule should be considered in addition to the pixel data bw to avoid ms/mp mismatches. +* 1. oto bw should also be considered when calculating peak urgent bw to avoid situations oto/equ mismatches between ms and mp +* +* 2. equ bandwidth needs to be considered for calculating peak urgent bw when equ schedule is used in mode support. +* Some slight difference in variables may cause the pixel data bandwidth to be higher +* even though overall equ prefetch bandwidths can be lower going from ms to mp +*/ +double RequiredPrefetchBWMax[DML2_MAX_PLANES ];double cursor_bw[DML2_MAX_PLANES ];double prefetch_cursor_bw[DML2_MAX_PLANES ];double prefetch_vmrow_bw[DML2_MAX_PLANES ];
@@ -1469,7 +1475,7 @@ struct dml2_core_shared_get_urgent_bandwidth_required_locals {double vm_row_bw;double flip_and_active_bw;double flip_and_prefetch_bw; -double flip_and_prefetch_bw_oto; +double flip_and_prefetch_bw_max;double active_and_excess_bw; };
@@ -1881,7 +1887,7 @@ struct dml2_core_calcs_CalculatePrefetchSchedule_params {double *VRatioPrefetchC;double *RequiredPrefetchPixelDataBWLuma;double *RequiredPrefetchPixelDataBWChroma; -double *RequiredPrefetchBWOTO; +double *RequiredPrefetchBWMax;bool *NotEnoughTimeForDynamicMetadata;double *Tno_bw;double *Tno_bw_flip;
@@ -2118,7 +2124,7 @@ struct dml2_core_calcs_calculate_peak_bandwidth_required_params {double *surface_read_bandwidth_c;double *prefetch_bandwidth_l;double *prefetch_bandwidth_c; -double *prefetch_bandwidth_oto; +double *prefetch_bandwidth_max;double *excess_vactive_fill_bw_l;double *excess_vactive_fill_bw_c;double *cursor_bw;
Signature · 1 line
2.43.0
PATCH 2/13 drm/amd/display: Removed unnecessary comment
In reply to Fangzhi ZuoFrom: Alvin Lee <[email protected]>
--- .../gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c +0 -1
@@ -735,7 +735,6 @@ static void populate_dml21_surface_config_from_plane_state(switch (plane_state->tiling_info.gfxversion) {case DcGfxVersion7:case DcGfxVersion8: -// Placeholder for programming the array_mode break ;case DcGfxVersion9:case DcGfxVersion10:
Signature · 1 line
2.43.0
PATCH 3/13 drm/amd/display: Add new DP tunnel bandwidth validation
In reply to Fangzhi ZuoFrom: Cruise Hung <[email protected]>
[Why & How]
Add new function for DP tunnel bandwidth validation.
It uses the estimated BW and allocated BW to validate the timings.
--- .../gpu/drm/amd/display/dc/core/dc_debug.c | 2 + .../drm/amd/display/dc/core/dc_link_exports.c | 6 + drivers/gpu/drm/amd/display/dc/dc.h | 14 +- drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 15 ++ drivers/gpu/drm/amd/display/dc/dc_types.h | 7 + .../gpu/drm/amd/display/dc/inc/core_status.h | 1 + drivers/gpu/drm/amd/display/dc/inc/link.h | 3 + .../gpu/drm/amd/display/dc/link/link_dpms.c | 6 +- .../drm/amd/display/dc/link/link_factory.c | 1 + .../drm/amd/display/dc/link/link_validation.c | 85 ++++++++- .../drm/amd/display/dc/link/link_validation.h | 3 + .../display/dc/link/protocols/link_dp_dpia.c | 15 +- .../dc/link/protocols/link_dp_dpia_bw.c | 169 ++++++++++++++---- .../dc/link/protocols/link_dp_dpia_bw.h | 27 ++- 14 files changed, 302 insertions(+), 52 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_debug.c +2 -0
@@ -268,6 +268,8 @@ char *dc_status_to_str(enum dc_status status)return "Insufficient DP link bandwidth" ;case DC_FAIL_HW_CURSOR_SUPPORT :return "HW Cursor not supported" ; +case DC_FAIL_DP_TUNNEL_BW_VALIDATE : +return "Fail DP Tunnel BW validation" ;case DC_ERROR_UNEXPECTED :return "Unexpected error" ; }
drivers/gpu/drm/amd/display/dc/core/dc_link_exports.c +6 -0
@@ -519,3 +519,9 @@ bool dc_link_dp_dpia_validate(struct dc *dc, const struct dc_stream_state *strea {return dc->link_srv->validate_dpia_bandwidth (streams, count); } + +enum dc_status dc_link_validate_dp_tunneling_bandwidth (const struct dc *dc,const struct dc_state *new_ctx) +{ +return dc->link_srv->validate_dp_tunnel_bandwidth (dc, new_ctx); +} +
drivers/gpu/drm/amd/display/dc/dc.h +12 -2
@@ -68,10 +68,12 @@ struct dmub_notification;#define MAX_STREAMS 6#define MIN_VIEWPORT_SIZE 12#define MAX_NUM_EDP 2 -#define MAX_HOST_ROUTERS_NUM 3 -#define MAX_DPIA_PER_HOST_ROUTER 2#define MAX_SUPPORTED_FORMATS 7 +#define MAX_HOST_ROUTERS_NUM 3 +#define MAX_DPIA_PER_HOST_ROUTER 3 +#define MAX_DPIA_NUM (MAX_HOST_ROUTERS_NUM * MAX_DPIA_PER_HOST_ROUTER) +/* Display Core Interfaces */ struct dc_versions {const char *dc_ver;
@@ -2427,6 +2429,14 @@ void dc_link_dp_dpia_handle_usb4_bandwidth_allocation_for_link(bool dc_link_dp_dpia_validate (struct dc *dc,const struct dc_stream_state *streams,const unsigned int count); +/* +* Calculates the DP tunneling bandwidth required for the stream timing +* and aggregates the stream bandwidth for the respective DP tunneling link +* +* return: dc_status +*/ +enum dc_status dc_link_validate_dp_tunneling_bandwidth (const struct dc *dc,const struct dc_state *new_ctx); +/* Sink Interfaces - A sink corresponds to a display output device */ struct dc_container_id {
drivers/gpu/drm/amd/display/dc/dc_dp_types.h +15 -0
@@ -162,6 +162,11 @@ struct dc_link_settings {struct dc_tunnel_settings {bool should_enable_dp_tunneling;bool should_use_dp_bw_allocation; +uint8_t cm_id; +uint8_t group_id; +uint32_t bw_granularity; +uint32_t estimated_bw; +uint32_t allocated_bw; };union dc_dp_ffe_preset {
@@ -957,11 +962,21 @@ union usb4_driver_bw_cap {uint8_t raw; }; +/* DPCD[0xE0021] DP_IN_ADAPTER_TUNNEL_INFORMATION register. */ +union dpia_tunnel_info { +struct { +uint8_t group_id :3 ; +uint8_t rsvd :5 ; + } bits; +uint8_t raw; +}; +/* DP Tunneling over USB4 */ struct dpcd_usb4_dp_tunneling_info {union dp_tun_cap_support dp_tun_cap;union dpia_info dpia_info;union usb4_driver_bw_cap driver_bw_cap; +union dpia_tunnel_info dpia_tunnel_info;uint8_t usb4_driver_id;uint8_t usb4_topology_id[DPCD_USB4_TOPOLOGY_ID_LEN ]; };
drivers/gpu/drm/amd/display/dc/dc_types.h +7 -0
@@ -1378,4 +1378,11 @@ enum dc_validate_mode {/* validate the mode and get the max state (voltage level) */ DC_VALIDATE_MODE_AND_STATE_INDEX = 2, }; + +struct dc_validation_dpia_set { +const struct dc_link *link; +const struct dc_tunnel_settings *tunnel_settings; +uint32_t required_bw; +}; +#endif /* DC_TYPES_H_ */
drivers/gpu/drm/amd/display/dc/inc/core_status.h +1 -0
@@ -59,6 +59,7 @@ enum dc_status {DC_FAIL_DP_PAYLOAD_ALLOCATION =27 ,DC_FAIL_DP_LINK_BANDWIDTH =28 ,DC_FAIL_HW_CURSOR_SUPPORT =29 , +DC_FAIL_DP_TUNNEL_BW_VALIDATE =30 , DC_ERROR_UNEXPECTED = -1 };
drivers/gpu/drm/amd/display/dc/inc/link.h +3 -0
@@ -147,6 +147,9 @@ struct link_service {bool (*validate_dpia_bandwidth)(const struct dc_stream_state *stream,const unsigned int num_streams); +enum dc_status (*validate_dp_tunnel_bandwidth)( +const struct dc *dc, +const struct dc_state *new_ctx); uint32_t (*dp_required_hblank_size_bytes)( const struct dc_link *link,
drivers/gpu/drm/amd/display/dc/link/link_dpms.c +2 -4
@@ -2295,12 +2295,10 @@ static bool allocate_usb4_bandwidth_for_stream(struct dc_stream_state *stream, i } link->dpia_bw_alloc_config.remote_sink_req_bw[sink_index] = bw; + link->dpia_bw_alloc_config.dp_overhead =link_dpia_get_dp_mst_overhead (link); + req_bw += link->dpia_bw_alloc_config.dp_overhead; } -/* get dp overhead for dp tunneling */ - link->dpia_bw_alloc_config.dp_overhead =link_dp_dpia_get_dp_overhead_in_dp_tunneling (link); - req_bw += link->dpia_bw_alloc_config.dp_overhead; -link_dp_dpia_allocate_usb4_bandwidth_for_stream (link, req_bw);if (stream->signal ==SIGNAL_TYPE_DISPLAY_PORT_MST ) {
drivers/gpu/drm/amd/display/dc/link/link_factory.c +1 -0
@@ -101,6 +101,7 @@ static void construct_link_service_validation(struct link_service *link_srv) link_srv->validate_mode_timing = link_validate_mode_timing; link_srv->dp_link_bandwidth_kbps = dp_link_bandwidth_kbps; link_srv->validate_dpia_bandwidth = link_validate_dpia_bandwidth; + link_srv->validate_dp_tunnel_bandwidth = link_validate_dp_tunnel_bandwidth; link_srv->dp_required_hblank_size_bytes = dp_required_hblank_size_bytes; }
drivers/gpu/drm/amd/display/dc/link/link_validation.c +84 -1
103 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/link/link_validation.h +3 -0
@@ -33,6 +33,9 @@ enum dc_status link_validate_mode_timing(bool link_validate_dpia_bandwidth (const struct dc_stream_state *stream,const unsigned int num_streams); +enum dc_status link_validate_dp_tunnel_bandwidth ( +const struct dc *dc, +const struct dc_state *new_ctx);uint32_t dp_link_bandwidth_kbps (const struct dc_link *link,const struct dc_link_settings *link_settings);
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia.c +12 -3
@@ -75,12 +75,15 @@ enum dc_status dpcd_get_tunneling_device_data(struct dc_link *link)if (link->dpcd_caps.usb4_dp_tun_info.dp_tun_cap.bits.dpia_bw_alloc) { status =core_link_read_dpcd (link,USB4_DRIVER_BW_CAPABILITY , - dpcd_dp_tun_data,1 ); + dpcd_dp_tun_data,2 );if (status !=DC_OK ) goto err; - link->dpcd_caps.usb4_dp_tun_info.driver_bw_cap.raw = dpcd_dp_tun_data[0 ]; + link->dpcd_caps.usb4_dp_tun_info.driver_bw_cap.raw = + dpcd_dp_tun_data[USB4_DRIVER_BW_CAPABILITY -USB4_DRIVER_BW_CAPABILITY ]; + link->dpcd_caps.usb4_dp_tun_info.dpia_tunnel_info.raw = + dpcd_dp_tun_data[DP_IN_ADAPTER_TUNNEL_INFO -USB4_DRIVER_BW_CAPABILITY ]; } DC_LOG_DEBUG("%s: Link[%d] DP tunneling support (RouterId=%d AdapterId=%d) "
@@ -155,8 +158,14 @@ void link_decide_dp_tunnel_settings(struct dc_stream_state *stream, link->dpcd_caps.usb4_dp_tun_info.dp_tun_cap.bits.dp_tunneling;if (link->dpcd_caps.usb4_dp_tun_info.dp_tun_cap.bits.dpia_bw_alloc - && link->dpcd_caps.usb4_dp_tun_info.driver_bw_cap.bits.driver_bw_alloc_support) + && link->dpcd_caps.usb4_dp_tun_info.driver_bw_cap.bits.driver_bw_alloc_support) { dp_tunnel_setting->should_use_dp_bw_allocation = true; + dp_tunnel_setting->cm_id = link->dpcd_caps.usb4_dp_tun_info.usb4_driver_id &0x0F ; + dp_tunnel_setting->group_id = link->dpcd_caps.usb4_dp_tun_info.dpia_tunnel_info.bits.group_id; + dp_tunnel_setting->estimated_bw = link->dpia_bw_alloc_config.estimated_bw; + dp_tunnel_setting->allocated_bw = link->dpia_bw_alloc_config.allocated_bw; + dp_tunnel_setting->bw_granularity = link->dpia_bw_alloc_config.bw_granularity; + } } }
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c +132 -37
241 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.h +22 -5
@@ -28,10 +28,6 @@#include "link.h" -/* Number of Host Routers per motherboard is 2 */ -#define MAX_HR_NUM 2 -/* Number of DPIA per host router is 2 */ -#define MAX_DPIA_NUM (MAX_HR_NUM * 2)/* * Host Router BW type
@@ -42,6 +38,16 @@ enum bw_type { HOST_ROUTER_BW_INVALID, }; +struct usb4_router_validation_set { +bool is_valid; +uint8_t cm_id; +uint8_t dpia_count; +uint32_t required_bw; +uint32_t allocated_bw; +uint32_t estimated_bw; +uint32_t remaining_bw; +}; +/* * Enable USB4 DP BW allocation mode *
@@ -92,7 +98,7 @@ bool dpia_validate_usb4_bw(struct dc_link **link, int *bw_needed, const unsigned* * return: DP overheads in DP tunneling */ -int link_dp_dpia_get_dp_overhead_in_dp_tunneling (struct dc_link *link); +uint32_t link_dpia_get_dp_mst_overhead (const struct dc_link *link);/* * Handle DP BW allocation status register
@@ -104,4 +110,15 @@ int link_dp_dpia_get_dp_overhead_in_dp_tunneling(struct dc_link *link);*/ void link_dp_dpia_handle_bw_alloc_status (struct dc_link *link,uint8_t status); +/* +* Aggregates the DPIA bandwidth usage for the respective USB4 Router. +* +* @dc_validation_dpia_set: pointer to the dc_validation_dpia_set +* @count: number of DPIA validation sets +* +* return: true if validation is succeeded +*/ +bool link_dpia_validate_dp_tunnel_bandwidth (const struct dc_validation_dpia_set *dpia_link_sets,uint8_t count); +#endif /* DC_INC_LINK_DP_DPIA_BW_H_ */ +
Signature · 1 line
2.43.0
PATCH 4/13 drm/amd/display: Initialize mode_select to 0
In reply to Fangzhi ZuoFrom: Alex Hung <[email protected]>
[WHAT]mode_select was supposed to be initialized in mpc_read_gamut_remap but is not set in default case. This can cause indeterminate behaviors.
This is reported as an UNINIT error by Coverity.
--- drivers/gpu/drm/amd/display/dc/mpc/dcn401/dcn401_mpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/mpc/dcn401/dcn401_mpc.c +1 -1
@@ -561,7 +561,7 @@ void mpc401_get_gamut_remap(struct mpc *mpc, struct mpc_grph_gamut_adjustment *adjust) {uint16_t arr_reg_val[12 ] = {0 }; -uint32_t mode_select; +uint32_t mode_select =MPCC_GAMUT_REMAP_MODE_SELECT_0 ;mpc_read_gamut_remap (mpc, mpcc_id, arr_reg_val, adjust->mpcc_gamut_remap_block_id, &mode_select);
Signature · 1 line
2.43.0
PATCH 5/13 drm/amd/display: Fix 'failed to blank crtc!'
In reply to Fangzhi ZuoFrom: Wen Chen <[email protected]>
[why]
DCN35 is having “DC: failed to blank crtc!” when running HPO test cases. It's caused by not having sufficient udelay time.
[how]
Replace the old wait_for_blank_complete function with fsleep function to sleep just until the next frame should come up. This way it doesn't poll in case the pixel clock or other clock was bugged or until vactive and the vblank are hit again.
--- drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c +1 -1
@@ -956,7 +956,7 @@ enum dc_status dcn20_enable_stream_timing(return DC_ERROR_UNEXPECTED ; } - hws->funcs.wait_for_blank_complete (pipe_ctx->stream_res.opp); +fsleep (stream->timing.v_total * (stream->timing.h_total *10000u / stream->timing.pix_clk_100hz)); params.vertical_total_min = stream->adjust.v_total_min; params.vertical_total_max = stream->adjust.v_total_max;
Signature · 1 line
2.43.0
PATCH 6/13 drm/amd/display: Remove redundant macro of refresh rate
In reply to Fangzhi ZuoFrom: weiguali <[email protected]>
[Why&How]
Found that we add redundant macro on refresh rate when calculating vtotal, so we remove it.
--- drivers/gpu/drm/amd/display/modules/freesync/freesync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/modules/freesync/freesync.c +1 -1
@@ -147,7 +147,7 @@ unsigned int mod_freesync_calc_v_total_from_refresh( ((unsigned int )(div64_u64 ((1000000000ULL *1000000 ), refresh_in_uhz))); -if (MICRO_HZ_TO_HZ (refresh_in_uhz) <= stream->timing.min_refresh_in_uhz) { +if (refresh_in_uhz <= stream->timing.min_refresh_in_uhz) {/* When the target refresh rate is the minimum panel refresh rate, * round down the vtotal value to avoid stretching vblank over * panel's vtotal boundary.
Signature · 1 line
2.43.0
Re: [PATCH 06/13] drm/amd/display: Remove redundant macro of refresh rate
[AMD Official Use Only - AMD Internal Distribution Only]
Hi Jerry,
Please fix the Author/committer name.
--
Regards,
Jay
________________________________
From: Fangzhi Zuo <[email protected]>
Sent: Wednesday, June 18, 2025 11:33 AM
To: [email protected] <[email protected]>
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Pillai, Aurabindo <[email protected]>; Li, Roman <[email protected]>; Lin, Wayne <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; Zuo, Jerry <[email protected]>; Wheeler, Daniel <[email protected]>; Wu, Ray <[email protected]>; Hung, Alex <[email protected]>; Li, Allen <[email protected]>; Chen, Robin <[email protected]>
Subject: [PATCH 06/13] drm/amd/display: Remove redundant macro of refresh rate
From: weiguali <[email protected]>
[Why&How]
Found that we add redundant macro on refresh rate when calculating vtotal, so we remove it.
--- drivers/gpu/drm/amd/display/modules/freesync/freesync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/modules/freesync/freesync.c +1 -1
@@ -147,7 +147,7 @@ unsigned int mod_freesync_calc_v_total_from_refresh( ((unsigned int )(div64_u64 ((1000000000ULL *1000000 ), refresh_in_uhz))); -if (MICRO_HZ_TO_HZ (refresh_in_uhz) <= stream->timing.min_refresh_in_uhz) { +if (refresh_in_uhz <= stream->timing.min_refresh_in_uhz) {/* When the target refresh rate is the minimum panel refresh rate, * round down the vtotal value to avoid stretching vblank over * panel's vtotal boundary.
--
2.43.0
PATCH 7/13 drm/amd/display: LSDMA support
In reply to Fangzhi ZuoFrom: "Ostrowski, Rafal" <[email protected]>
[Why]
Driver should be able to send LSDMA commands to DMCUB
[How]
Driver can now send LSDMA commands to DMCUB. DMCUB should process them and send to LSDMA controller.
--- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 199 ++++++++++++++++++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 55 +++++ drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 2 + .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 4 + 4 files changed, 260 insertions(+)
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +199 -0
@@ -1984,3 +1984,202 @@ void dc_dmub_srv_ips_query_residency_info(struct dc_dmub_srv *dc_dmub_srv, struc DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY)) output->histogram[i] = 0; } + +bool dmub_lsdma_init (struct dc_dmub_srv *dc_dmub_srv) +{ +struct dc_context *dc_ctx = dc_dmub_srv->ctx; +union dmub_rb_cmd cmd; +enum dm_dmub_wait_type wait_type; +struct dmub_cmd_lsdma_data *lsdma_data = &cmd.lsdma.lsdma_data; +bool result; + +memset (&cmd,0 ,sizeof (cmd)); + + cmd.cmd_common.header.type =DMUB_CMD__LSDMA ; + cmd.cmd_common.header.sub_type =DMUB_CMD__LSDMA_INIT_CONFIG ; + wait_type =DM_DMUB_WAIT_TYPE_NO_WAIT ; + + lsdma_data->u.init_data.gpu_addr_base.quad_part = dc_ctx->dmub_srv->dmub->lsdma_rb_fb.gpu_addr; + lsdma_data->u.init_data.ring_size = dc_ctx->dmub_srv->dmub->lsdma_rb_fb.size; + + result =dc_wake_and_execute_dmub_cmd (dc_ctx, &cmd, wait_type); + +if (!result) +DC_ERROR ("LSDMA Init failed in DMUB" ); + +return result; +} + +bool dmub_lsdma_send_linear_copy_packet ( +struct dc_dmub_srv *dc_dmub_srv, +uint64_t src_addr, +uint64_t dst_addr, +uint32_t count) +{ +struct dc_context *dc_ctx = dc_dmub_srv->ctx; +union dmub_rb_cmd cmd; +enum dm_dmub_wait_type wait_type; +struct dmub_cmd_lsdma_data *lsdma_data = &cmd.lsdma.lsdma_data; +bool result; + +memset (&cmd,0 ,sizeof (cmd)); + + cmd.cmd_common.header.type =DMUB_CMD__LSDMA ; + cmd.cmd_common.header.sub_type =DMUB_CMD__LSDMA_LINEAR_COPY ; + wait_type =DM_DMUB_WAIT_TYPE_NO_WAIT ; + + lsdma_data->u.linear_copy_data.count = count -1 ;// LSDMA controller expects bytes to copy -1 + lsdma_data->u.linear_copy_data.src_lo = src_addr &0xFFFFFFFF ; + lsdma_data->u.linear_copy_data.src_hi = (src_addr >>32 ) &0xFFFFFFFF ; + lsdma_data->u.linear_copy_data.dst_lo = dst_addr &0xFFFFFFFF ; + lsdma_data->u.linear_copy_data.dst_hi = (dst_addr >>32 ) &0xFFFFFFFF ; + + result =dc_wake_and_execute_dmub_cmd (dc_ctx, &cmd, wait_type); + +if (!result) +DC_ERROR ("LSDMA Linear Copy failed in DMUB" ); + +return result; +} + +bool dmub_lsdma_send_tiled_to_tiled_copy_command ( +struct dc_dmub_srv *dc_dmub_srv, +struct lsdma_send_tiled_to_tiled_copy_command_params params) +{ +struct dc_context *dc_ctx = dc_dmub_srv->ctx; +union dmub_rb_cmd cmd; +enum dm_dmub_wait_type wait_type; +struct dmub_cmd_lsdma_data *lsdma_data = &cmd.lsdma.lsdma_data; +bool result; + +memset (&cmd,0 ,sizeof (cmd)); + + cmd.cmd_common.header.type =DMUB_CMD__LSDMA ; + cmd.cmd_common.header.sub_type =DMUB_CMD__LSDMA_TILED_TO_TILED_COPY ; + wait_type =DM_DMUB_WAIT_TYPE_NO_WAIT ; + + lsdma_data->u.tiled_copy_data.src_addr_lo = params.src_addr &0xFFFFFFFF ; + lsdma_data->u.tiled_copy_data.src_addr_hi = (params.src_addr >>32 ) &0xFFFFFFFF ; + lsdma_data->u.tiled_copy_data.dst_addr_lo = params.dst_addr &0xFFFFFFFF ; + lsdma_data->u.tiled_copy_data.dst_addr_hi = (params.dst_addr >>32 ) &0xFFFFFFFF ; + lsdma_data->u.tiled_copy_data.src_x = params.src_x; + lsdma_data->u.tiled_copy_data.src_y = params.src_y; + lsdma_data->u.tiled_copy_data.dst_x = params.dst_x; + lsdma_data->u.tiled_copy_data.dst_y = params.dst_y; + lsdma_data->u.tiled_copy_data.src_width = params.src_width -1 ;// LSDMA controller expects width -1 + lsdma_data->u.tiled_copy_data.dst_width = params.dst_width -1 ;// LSDMA controller expects width -1 + lsdma_data->u.tiled_copy_data.src_swizzle_mode = params.swizzle_mode; + lsdma_data->u.tiled_copy_data.dst_swizzle_mode = params.swizzle_mode; + lsdma_data->u.tiled_copy_data.src_element_size = params.element_size; + lsdma_data->u.tiled_copy_data.dst_element_size = params.element_size; + lsdma_data->u.tiled_copy_data.rect_x = params.rect_x; + lsdma_data->u.tiled_copy_data.rect_y = params.rect_y; + lsdma_data->u.tiled_copy_data.dcc = params.dcc; + lsdma_data->u.tiled_copy_data.tmz = params.tmz; + lsdma_data->u.tiled_copy_data.read_compress = params.read_compress; + lsdma_data->u.tiled_copy_data.write_compress = params.write_compress; + lsdma_data->u.tiled_copy_data.src_height = params.src_height -1 ;// LSDMA controller expects height -1 + lsdma_data->u.tiled_copy_data.dst_height = params.dst_height -1 ;// LSDMA controller expects height -1 + lsdma_data->u.tiled_copy_data.data_format = params.data_format; + lsdma_data->u.tiled_copy_data.max_com = params.max_com; + lsdma_data->u.tiled_copy_data.max_uncom = params.max_uncom; + + result =dc_wake_and_execute_dmub_cmd (dc_ctx, &cmd, wait_type); + +if (!result) +DC_ERROR ("LSDMA Tiled to Tiled Copy failed in DMUB" ); + +return result; +} + +bool dmub_lsdma_send_pio_copy_command ( +struct dc_dmub_srv *dc_dmub_srv, +uint64_t src_addr, +uint64_t dst_addr, +uint32_t byte_count, +uint32_t overlap_disable) +{ +struct dc_context *dc_ctx = dc_dmub_srv->ctx; +union dmub_rb_cmd cmd; +enum dm_dmub_wait_type wait_type; +struct dmub_cmd_lsdma_data *lsdma_data = &cmd.lsdma.lsdma_data; +bool result; + +memset (&cmd,0 ,sizeof (cmd)); + + cmd.cmd_common.header.type =DMUB_CMD__LSDMA ; + cmd.cmd_common.header.sub_type =DMUB_CMD__LSDMA_PIO_COPY ; + wait_type =DM_DMUB_WAIT_TYPE_NO_WAIT ; + + lsdma_data->u.pio_copy_data.packet.fields.byte_count = byte_count; + lsdma_data->u.pio_copy_data.packet.fields.overlap_disable = overlap_disable; + lsdma_data->u.pio_copy_data.src_lo = src_addr &0xFFFFFFFF ; + lsdma_data->u.pio_copy_data.src_hi = (src_addr >>32 ) &0xFFFFFFFF ; + lsdma_data->u.pio_copy_data.dst_lo = dst_addr &0xFFFFFFFF ; + lsdma_data->u.pio_copy_data.dst_hi = (dst_addr >>32 ) &0xFFFFFFFF ; + + result =dc_wake_and_execute_dmub_cmd (dc_ctx, &cmd, wait_type); + +if (!result) +DC_ERROR ("LSDMA PIO Copy failed in DMUB" ); + +return result; +} + +bool dmub_lsdma_send_pio_constfill_command ( +struct dc_dmub_srv *dc_dmub_srv, +uint64_t dst_addr, +uint32_t byte_count, +uint32_t data) +{ +struct dc_context *dc_ctx = dc_dmub_srv->ctx; +union dmub_rb_cmd cmd; +enum dm_dmub_wait_type wait_type; +struct dmub_cmd_lsdma_data *lsdma_data = &cmd.lsdma.lsdma_data; +bool result; + +memset (&cmd,0 ,sizeof (cmd)); + + cmd.cmd_common.header.type =DMUB_CMD__LSDMA ; + cmd.cmd_common.header.sub_type =DMUB_CMD__LSDMA_PIO_CONSTFILL ; + wait_type =DM_DMUB_WAIT_TYPE_NO_WAIT ; + + lsdma_data->u.pio_constfill_data.packet.fields.constant_fill =1 ; + lsdma_data->u.pio_constfill_data.packet.fields.byte_count = byte_count; + lsdma_data->u.pio_constfill_data.dst_lo = dst_addr &0xFFFFFFFF ; + lsdma_data->u.pio_constfill_data.dst_hi = (dst_addr >>32 ) &0xFFFFFFFF ; + lsdma_data->u.pio_constfill_data.data = data; + + result =dc_wake_and_execute_dmub_cmd (dc_ctx, &cmd, wait_type); + +if (!result) +DC_ERROR ("LSDMA PIO Constfill failed in DMUB" ); + +return result; +} + +bool dmub_lsdma_send_poll_reg_write_command (struct dc_dmub_srv *dc_dmub_srv,uint32_t reg_addr,uint32_t reg_data) +{ +struct dc_context *dc_ctx = dc_dmub_srv->ctx; +union dmub_rb_cmd cmd; +enum dm_dmub_wait_type wait_type; +struct dmub_cmd_lsdma_data *lsdma_data = &cmd.lsdma.lsdma_data; +bool result; + +memset (&cmd,0 ,sizeof (cmd)); + + cmd.cmd_common.header.type =DMUB_CMD__LSDMA ; + cmd.cmd_common.header.sub_type =DMUB_CMD__LSDMA_POLL_REG_WRITE ; + wait_type =DM_DMUB_WAIT_TYPE_NO_WAIT ; + + lsdma_data->u.reg_write_data.reg_addr = reg_addr; + lsdma_data->u.reg_write_data.reg_data = reg_data; + + result =dc_wake_and_execute_dmub_cmd (dc_ctx, &cmd, wait_type); + +if (!result) +DC_ERROR ("LSDMA Poll Reg failed in DMUB" ); + +return result; +} +
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h +55 -0
59 lines not on this page · raw message
drivers/gpu/drm/amd/display/dmub/dmub_srv.h +2 -0
@@ -131,6 +131,7 @@ enum dmub_window_id {DMUB_WINDOW_7_SCRATCH_MEM ,DMUB_WINDOW_IB_MEM ,DMUB_WINDOW_SHARED_STATE , +DMUB_WINDOW_LSDMA_BUFFER , DMUB_WINDOW_TOTAL, };
@@ -579,6 +580,7 @@ struct dmub_srv {enum dmub_srv_power_state_type power_state;struct dmub_diagnostic_data debug; +struct dmub_fb lsdma_rb_fb; };/**
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +4 -0
@@ -68,6 +68,9 @@/* Default indirect buffer size. */ #define DMUB_IB_MEM_SIZE (1280) +/* Default LSDMA ring buffer size. */ +#define DMUB_LSDMA_RB_SIZE (64 * 1024) +/* Number of windows in use. */ #define DMUB_NUM_WINDOWS (DMUB_WINDOW_TOTAL)/* Base addresses. */
@@ -564,6 +567,7 @@ enum dmub_status window_sizes[DMUB_WINDOW_7_SCRATCH_MEM ] =DMUB_SCRATCH_MEM_SIZE ; window_sizes[DMUB_WINDOW_IB_MEM ] =DMUB_IB_MEM_SIZE ; window_sizes[DMUB_WINDOW_SHARED_STATE ] =max (DMUB_FW_HEADER_SHARED_STATE_SIZE , shared_state_size); + window_sizes[DMUB_WINDOW_LSDMA_BUFFER ] =DMUB_LSDMA_RB_SIZE ; out->fb_size =dmub_srv_calc_regions_for_memory_type (params, out, window_sizes,DMUB_WINDOW_MEMORY_TYPE_FB );
Signature · 1 line
2.43.0
PATCH 8/13 drm/amd/display: Rewording Mode Validation Result
In reply to Fangzhi ZuoIt is normal to prune resolutions that exceed hw or bw limitation. Use error oriented wordings could cause misunderstanding.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
@@ -7624,7 +7624,7 @@ create_validate_stream_for_sink(struct drm_connector *connector, dc_result =dm_validate_stream_and_context (adev->dm.dc, stream);if (dc_result !=DC_OK ) { - DRM_DEBUG_KMS("Mode %dx%d (clk %d) pixel_encoding:%s color_depth:%s failed validation -- %s\n", + DRM_DEBUG_KMS("Pruned mode %d x %d (clk %d) %s %s -- %s\n", drm_mode->hdisplay, drm_mode->vdisplay, drm_mode->clock,
Signature · 1 line
2.43.0
PATCH 9/13 drm/amd/display: DML21 Reintegration
In reply to Fangzhi ZuoFrom: Austin Zheng <[email protected]>
Update logging macros for detailed debugging Update structs to contain more detailed information Add HDMI 16 and 20 Gbps rates
--- .../dml2/dml21/inc/dml_top_dchub_registers.h | 1 + .../dml21/inc/dml_top_display_cfg_types.h | 2 + .../dml21/inc/dml_top_soc_parameter_types.h | 1 + .../display/dc/dml2/dml21/inc/dml_top_types.h | 4 +- .../src/dml2_core/dml2_core_dcn4_calcs.c | 4 + .../src/dml2_core/dml2_core_shared_types.h | 83 +++++++++- .../dc/dml2/dml21/src/inc/dml2_debug.h | 149 ++++++++++++++++-- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 28 +++- 8 files changed, 248 insertions(+), 24 deletions(-)
drivers/gpu/drm/amd/display/dc/dml2/dml21/inc/dml_top_dchub_registers.h +1 -0
@@ -46,6 +46,7 @@ struct dml2_display_dlg_regs {uint32_t dst_y_delta_drq_limit;uint32_t refcyc_per_vm_dmdata;uint32_t dmdata_dl_delta; +uint32_t dst_y_svp_drq_limit;// MRQ uint32_t refcyc_per_meta_chunk_vblank_l;
drivers/gpu/drm/amd/display/dc/dml2/dml21/inc/dml_top_display_cfg_types.h +2 -0
@@ -222,6 +222,7 @@ struct dml2_composition_cfg {struct {bool enabled; +bool upsp_enabled;struct {double h_ratio;double v_ratio;
@@ -426,6 +427,7 @@ struct dml2_stream_parameters {struct dml2_display_cfg {bool gpuvm_enable; +bool ffbm_enable;bool hostvm_enable;// Allocate DET proportionally between streams based on pixel rate
drivers/gpu/drm/amd/display/dc/dml2/dml21/inc/dml_top_soc_parameter_types.h +1 -0
@@ -93,6 +93,7 @@ struct dml2_soc_power_management_parameters {double dram_clk_change_write_only_us;double fclk_change_blackout_us;double g7_ppt_blackout_us; +double g7_temperature_read_blackout_us;double stutter_enter_plus_exit_latency_us;double stutter_exit_latency_us;double z8_stutter_enter_plus_exit_latency_us;
drivers/gpu/drm/amd/display/dc/dml2/dml21/inc/dml_top_types.h +3 -1
@@ -53,7 +53,9 @@ enum dml2_output_type_and_rate__rate { dml2_output_rate_hdmi_rate_6x4 =9 , dml2_output_rate_hdmi_rate_8x4 =10 , dml2_output_rate_hdmi_rate_10x4 =11 , - dml2_output_rate_hdmi_rate_12x4 =12 + dml2_output_rate_hdmi_rate_12x4 =12 , + dml2_output_rate_hdmi_rate_16x4 =13 , + dml2_output_rate_hdmi_rate_20x4 =14 }; struct dml2_pmo_options {
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.c +4 -0
@@ -13069,6 +13069,10 @@ void dml2_core_calcs_get_informative(const struct dml2_core_internal_display_mod out->informative.mode_support_info.OutputRate[k] = dml2_output_rate_hdmi_rate_10x4; else if (mode_lib->ms.support.OutputRate[k] == dml2_core_internal_output_rate_hdmi_rate_12x4) out->informative.mode_support_info.OutputRate[k] = dml2_output_rate_hdmi_rate_12x4; + else if (mode_lib->ms.support.OutputRate[k] == dml2_core_internal_output_rate_hdmi_rate_16x4) + out->informative.mode_support_info.OutputRate[k] = dml2_output_rate_hdmi_rate_16x4; + else if (mode_lib->ms.support.OutputRate[k] == dml2_core_internal_output_rate_hdmi_rate_20x4) + out->informative.mode_support_info.OutputRate[k] = dml2_output_rate_hdmi_rate_20x4; out->informative.mode_support_info.AlignedYPitch[k] = mode_lib->ms.support.AlignedYPitch[k]; out->informative.mode_support_info.AlignedCPitch[k] = mode_lib->ms.support.AlignedCPitch[k];
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_shared_types.h +75 -8
222 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/inc/dml2_debug.h +136 -13
188 lines not on this page · raw message
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +26 -2
@@ -303,9 +303,11 @@ union dmub_addr {/* Flattened structure containing SOC BB parameters stored in the VBIOS * It is not practical to store the entire bounding box in VBIOS since the bounding box struct can gain new parameters. * This also prevents alighment issues when new parameters are added to the SoC BB. +* The following parameters should be added since these values can't be obtained elsewhere: +* -dml2_soc_power_management_parameters +* -dml2_soc_vmin_clock_limits */ struct dmub_soc_bb_params { -/* dml2_soc_power_management_parameters */ uint32_t dram_clk_change_blackout_ns;uint32_t dram_clk_change_read_only_ns;uint32_t dram_clk_change_write_only_ns;
@@ -318,9 +320,9 @@ struct dmub_soc_bb_params {uint32_t z8_min_idle_time_ns;uint32_t type_b_dram_clk_change_blackout_ns;uint32_t type_b_ppt_blackout_ns; -/* dml2_soc_vmin_clock_limits */ uint32_t vmin_limit_dispclk_khz;uint32_t vmin_limit_dcfclk_khz; +uint32_t g7_temperature_read_blackout_ns; };#pragma pack(pop)
@@ -2100,6 +2102,28 @@ enum fams2_stream_type { FAMS2_STREAM_TYPE_SUBVP = 4, }; +struct dmub_rect16 { +/** +* Dirty rect x offset. +*/ +uint16_t x; + +/** +* Dirty rect y offset. +*/ +uint16_t y; + +/** +* Dirty rect width. +*/ +uint16_t width; + +/** +* Dirty rect height. +*/ +uint16_t height; +}; +/* static stream state */ struct dmub_fams2_legacy_stream_static_state {uint8_t vactive_det_fill_delay_otg_vlines;
Signature · 1 line
2.43.0
PATCH 10/13 drm/amd/display: Add num_slices_h to set_dto_dscclk signature
In reply to Fangzhi ZuoFrom: Ilya Bakoulin <[email protected]>
Add the number of horizontal slices argument to allow configuring clock based on slice number.
--- drivers/gpu/drm/amd/display/dc/dccg/dcn401/dcn401_dccg.c | 2 +- drivers/gpu/drm/amd/display/dc/dccg/dcn401/dcn401_dccg.h | 3 +-- drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 6 ++++-- drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h | 2 +- drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 4 ++-- 5 files changed, 9 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/dccg/dcn401/dcn401_dccg.c +1 -1
@@ -727,7 +727,7 @@ void dccg401_init(struct dccg *dccg) } } -void dccg401_set_dto_dscclk (struct dccg *dccg,uint32_t inst) +void dccg401_set_dto_dscclk (struct dccg *dccg,uint32_t inst,uint32_t num_slices_h) {struct dcn_dccg *dccg_dcn =TO_DCN_DCCG (dccg);
drivers/gpu/drm/amd/display/dc/dccg/dcn401/dcn401_dccg.h +1 -2
@@ -209,7 +209,7 @@ void dccg401_disable_symclk32_le(struct dccg *dccg, int hpo_le_inst);void dccg401_disable_dpstreamclk (struct dccg *dccg,int dp_hpo_inst); -void dccg401_set_dto_dscclk (struct dccg *dccg,uint32_t inst); +void dccg401_set_dto_dscclk (struct dccg *dccg,uint32_t inst,uint32_t num_slices_h);void dccg401_set_ref_dscclk (struct dccg *dccg,uint32_t dsc_inst); void dccg401_set_src_sel(
@@ -230,7 +230,6 @@ void dccg401_set_dp_dto( const struct dp_dto_params *params);void dccg401_enable_symclk_se (struct dccg *dccg,uint32_t stream_enc_inst,uint32_t link_enc_inst);void dccg401_disable_symclk_se (struct dccg *dccg,uint32_t stream_enc_inst,uint32_t link_enc_inst); -void dccg401_set_dto_dscclk (struct dccg *dccg,uint32_t inst); void dccg401_set_dtbclk_p_src( struct dccg *dccg, enum streamclk_source src,
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c +4 -2
@@ -1063,15 +1063,17 @@ void dcn32_update_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable) dsc_cfg.dc_dsc_cfg.num_slices_h /= opp_cnt;if (should_use_dto_dscclk) - dccg->funcs->set_dto_dscclk (dccg, dsc->inst); + dccg->funcs->set_dto_dscclk (dccg, dsc->inst, dsc_cfg.dc_dsc_cfg.num_slices_h); dsc->funcs->dsc_set_config (dsc, &dsc_cfg, &dsc_optc_cfg); dsc->funcs->dsc_enable (dsc, pipe_ctx->stream_res.opp->inst);for (odm_pipe = pipe_ctx->next_odm_pipe; odm_pipe; odm_pipe = odm_pipe->next_odm_pipe) {struct display_stream_compressor *odm_dsc = odm_pipe->stream_res.dsc;ASSERT (odm_dsc); +if (!odm_dsc) +continue ;if (should_use_dto_dscclk) - dccg->funcs->set_dto_dscclk (dccg, odm_dsc->inst); + dccg->funcs->set_dto_dscclk (dccg, odm_dsc->inst, dsc_cfg.dc_dsc_cfg.num_slices_h); odm_dsc->funcs->dsc_set_config (odm_dsc, &dsc_cfg, &dsc_optc_cfg); odm_dsc->funcs->dsc_enable (odm_dsc, odm_pipe->stream_res.opp->inst); }
drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h +1 -1
@@ -211,7 +211,7 @@ struct dccg_funcs {struct dccg *dccg, enum streamclk_source src, uint32_t otg_inst); -void (*set_dto_dscclk)(struct dccg *dccg,uint32_t dsc_inst); +void (*set_dto_dscclk)(struct dccg *dccg,uint32_t dsc_inst,uint32_t num_slices_h);void (*set_ref_dscclk)(struct dccg *dccg,uint32_t dsc_inst);void (*dccg_root_gate_disable_control)(struct dccg *dccg,uint32_t pipe_idx,uint32_t disable_clock_gating); };
drivers/gpu/drm/amd/display/dc/link/link_dpms.c +2 -2
@@ -843,14 +843,14 @@ void link_set_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable) dsc_cfg.dc_dsc_cfg.num_slices_h /= opp_cnt;if (should_use_dto_dscclk) - dccg->funcs->set_dto_dscclk (dccg, dsc->inst); + dccg->funcs->set_dto_dscclk (dccg, dsc->inst, dsc_cfg.dc_dsc_cfg.num_slices_h); dsc->funcs->dsc_set_config (dsc, &dsc_cfg, &dsc_optc_cfg); dsc->funcs->dsc_enable (dsc, pipe_ctx->stream_res.opp->inst);for (odm_pipe = pipe_ctx->next_odm_pipe; odm_pipe; odm_pipe = odm_pipe->next_odm_pipe) {struct display_stream_compressor *odm_dsc = odm_pipe->stream_res.dsc;if (should_use_dto_dscclk) - dccg->funcs->set_dto_dscclk (dccg, odm_dsc->inst); + dccg->funcs->set_dto_dscclk (dccg, odm_dsc->inst, dsc_cfg.dc_dsc_cfg.num_slices_h); odm_dsc->funcs->dsc_set_config (odm_dsc, &dsc_cfg, &dsc_optc_cfg); odm_dsc->funcs->dsc_enable (odm_dsc, odm_pipe->stream_res.opp->inst); }
Signature · 1 line
2.43.0
PATCH 11/13 drm/amd/display: Add DMUB IPS command support for IPS residency tools
In reply to Fangzhi ZuoFrom: Ovidiu Bunea <[email protected]>
[why & how]
Add DMUB IPS CMD interface for driver and
DMU to communicate for IPS residency tools.
--- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 102 ++++++------------ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 66 +++++------- drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 8 -- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 70 ++++++++++++ 4 files changed, 132 insertions(+), 114 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +35 -67
@@ -1904,85 +1904,53 @@ void dc_dmub_srv_fams2_passthrough_flip( } } -bool dc_dmub_srv_ips_residency_cntl (struct dc_dmub_srv *dc_dmub_srv,bool start_measurement) + +bool dc_dmub_srv_ips_residency_cntl (const struct dc_context *ctx,uint8_t panel_inst,bool start_measurement) { -bool result; +union dmub_rb_cmd cmd; -if (!dc_dmub_srv || !dc_dmub_srv->dmub) -return false; +memset (&cmd,0 ,sizeof (cmd)); - result =dc_wake_and_execute_gpint (dc_dmub_srv->ctx,DMUB_GPINT__IPS_RESIDENCY , - start_measurement,NULL ,DM_DMUB_WAIT_TYPE_WAIT ); + cmd.ips_residency_cntl.header.type =DMUB_CMD__IPS ; + cmd.ips_residency_cntl.header.sub_type =DMUB_CMD__IPS_RESIDENCY_CNTL ; + cmd.ips_residency_cntl.header.payload_bytes =sizeof (struct dmub_cmd_ips_residency_cntl_data ); -return result; +// only panel_inst=0 is supported at the moment + cmd.ips_residency_cntl.cntl_data.panel_inst = panel_inst; + cmd.ips_residency_cntl.cntl_data.start_measurement = start_measurement; + +if (!dc_wake_and_execute_dmub_cmd (ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY )) +return false; + +return true; } -void dc_dmub_srv_ips_query_residency_info (struct dc_dmub_srv *dc_dmub_srv,struct ips_residency_info *output) +bool dc_dmub_srv_ips_query_residency_info (const struct dc_context *ctx,uint8_t panel_inst,struct dmub_ips_residency_info *driver_info, +enum ips_residency_mode ips_mode) { -uint32_t i; -enum dmub_gpint_command command_code; +union dmub_rb_cmd cmd; +uint32_t bytes =sizeof (struct dmub_ips_residency_info ); -if (!dc_dmub_srv || !dc_dmub_srv->dmub) -return ; +dmub_flush_buffer_mem (&ctx->dmub_srv->dmub->scratch_mem_fb); +memset (&cmd,0 ,sizeof (cmd)); -switch (output->ips_mode) { -case DMUB_IPS_MODE_IPS1_MAX : - command_code =DMUB_GPINT__GET_IPS1_HISTOGRAM_COUNTER ; -break ; -case DMUB_IPS_MODE_IPS2 : - command_code =DMUB_GPINT__GET_IPS2_HISTOGRAM_COUNTER ; -break ; -case DMUB_IPS_MODE_IPS1_RCG : - command_code =DMUB_GPINT__GET_IPS1_RCG_HISTOGRAM_COUNTER ; -break ; -case DMUB_IPS_MODE_IPS1_ONO2_ON : - command_code =DMUB_GPINT__GET_IPS1_ONO2_ON_HISTOGRAM_COUNTER ; -break ; -default : - command_code =DMUB_GPINT__INVALID_COMMAND ; -break ; - } + cmd.ips_query_residency_info.header.type =DMUB_CMD__IPS ; + cmd.ips_query_residency_info.header.sub_type =DMUB_CMD__IPS_QUERY_RESIDENCY_INFO ; + cmd.ips_query_residency_info.header.payload_bytes =sizeof (struct dmub_cmd_ips_query_residency_info_data ); -if (command_code ==DMUB_GPINT__INVALID_COMMAND ) -return ; + cmd.ips_query_residency_info.info_data.dest.quad_part = ctx->dmub_srv->dmub->scratch_mem_fb.gpu_addr; + cmd.ips_query_residency_info.info_data.size = bytes; + cmd.ips_query_residency_info.info_data.panel_inst = panel_inst; + cmd.ips_query_residency_info.info_data.ips_mode = (uint32_t )ips_mode; -for (i =0 ; i <GPINT_RETRY_NUM ; i++) { -// false could mean GPINT timeout, in which case we should retry -if (dc_wake_and_execute_gpint (dc_dmub_srv->ctx,DMUB_GPINT__GET_IPS_RESIDENCY_PERCENT , - (uint16_t )(output->ips_mode), &output->residency_percent, -DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY )) -break ; -udelay (100 ); - } +if (!dc_wake_and_execute_dmub_cmd (ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY ) || + cmd.ips_query_residency_info.header.ret_status ==0 ) +return false; -if (!dc_wake_and_execute_gpint (dc_dmub_srv->ctx,DMUB_GPINT__GET_IPS_RESIDENCY_ENTRY_COUNTER , - (uint16_t )(output->ips_mode), - &output->entry_counter,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY )) - output->entry_counter =0 ; - -if (!dc_wake_and_execute_gpint (dc_dmub_srv->ctx,DMUB_GPINT__GET_IPS_RESIDENCY_DURATION_US_LO , - (uint16_t )(output->ips_mode), - &output->total_active_time_us[0 ],DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY )) - output->total_active_time_us[0 ] =0 ; -if (!dc_wake_and_execute_gpint (dc_dmub_srv->ctx,DMUB_GPINT__GET_IPS_RESIDENCY_DURATION_US_HI , - (uint16_t )(output->ips_mode), - &output->total_active_time_us[1 ],DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY )) - output->total_active_time_us[1 ] =0 ; - -if (!dc_wake_and_execute_gpint (dc_dmub_srv->ctx,DMUB_GPINT__GET_IPS_INACTIVE_RESIDENCY_DURATION_US_LO , - (uint16_t )(output->ips_mode), - &output->total_inactive_time_us[0 ],DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY )) - output->total_inactive_time_us[0 ] =0 ; -if (!dc_wake_and_execute_gpint (dc_dmub_srv->ctx,DMUB_GPINT__GET_IPS_INACTIVE_RESIDENCY_DURATION_US_HI , - (uint16_t )(output->ips_mode), - &output->total_inactive_time_us[1 ],DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY )) - output->total_inactive_time_us[1 ] =0 ; - -// NUM_IPS_HISTOGRAM_BUCKETS = 16 -for (i =0 ; i <16 ; i++) -if (!dc_wake_and_execute_gpint (dc_dmub_srv->ctx, command_code, i, &output->histogram[i], -DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY )) - output->histogram[i] =0 ; +// copy the result to the output since ret_status != 0 means the command returned data +memcpy (driver_info, ctx->dmub_srv->dmub->scratch_mem_fb.cpu_addr, bytes); + +return true; }bool dmub_lsdma_init (struct dc_dmub_srv *dc_dmub_srv)
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h +27 -39
76 lines not on this page · raw message
drivers/gpu/drm/amd/display/dmub/dmub_srv.h +0 -8
@@ -607,14 +607,6 @@ struct dmub_notification { }; }; -/* enum dmub_ips_mode - IPS mode identifier */ -enum dmub_ips_mode { -DMUB_IPS_MODE_IPS1_MAX =0 , -DMUB_IPS_MODE_IPS2 , -DMUB_IPS_MODE_IPS1_RCG , -DMUB_IPS_MODE_IPS1_ONO2_ON -}; -/** * DMUB firmware version helper macro - useful for checking if the version * of a firmware to know if feature or functionality is supported or present.
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +70 -0
94 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 12/13 drm/amd/display: [FW Promotion] Release 0.1.16.0
In reply to Fangzhi ZuoFrom: Taimur Hassan <[email protected]>
Summary for changes in firmware:
* Add DMCUB IPS commands and command parser support
* use OTG count to disable interrupts
* Fix dmub_cmd header data boundary issue
* remove the HW register override
--- drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +3 -0
@@ -5909,6 +5909,9 @@ struct dmub_rb_cmd_ips_residency_cntl {struct dmub_cmd_ips_residency_cntl_data cntl_data; }; +/** +* Data passed from FW to driver in a DMUB_CMD__IPS_QUERY_RESIDENCY_INFO command. +*/ struct dmub_cmd_ips_query_residency_info_data {union dmub_addr dest;uint32_t size;
Signature · 1 line
2.43.0
PATCH 13/13 drm/amd/display: Promote DAL to 3.2.339
In reply to Fangzhi ZuoFrom: Taimur Hassan <[email protected]>
Summary:
* Improve USB4 bandwidth validation
* dml clock calcuation with EQU Prefetch included
* Tweaking udelay time to fix "failed to blank crtc!" error
* Add LSDMA support to DMUB
* Fix Coverity issue
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -55,7 +55,7 @@ struct aux_payload;struct set_config_cmd_payload ;struct dmub_notification ; -#define DC_VER "3.2.338" +#define DC_VER "3.2.339"/** * MAX_SURFACES - representative of the upper bound of surfaces that can be piped to a single CRTC
Signature · 1 line
2.43.0
[Public]
Hi all,
This week this patchset was tested on 4 systems, two dGPU and two APU based, and tested across multiple display and connection types.
APU
* Single Display eDP -> 1080p 60hz, 1920x1200 165hz
* Single Display DP (SST DSC) -> 4k144hz, 4k240hz
* Multi display -> eDP + DP/HDMI/USB-C -> 1080p 60hz eDP + 4k 144hz, 4k 240hz (Includes USB-C to DP/HDMI adapters)
* Thunderbolt -> LG Ultrafine 5k
* MST DSC -> Cable Matters 101075 (DP to 3x DP) with 3x 4k60hz displays, HP Hook G2 with 2x 4k60hz displays
* USB 4 -> HP Hook G4, Lenovo Thunderbolt Dock, both with 2x 4k60hz DP and 1x 4k60hz HDMI displays
* SST PCON -> Club3D CAC-1085 + 1x 4k 144hz, FRL3, at a max resolution supported by the dongle of 4k 120hz YUV420 12bpc.
* MST PCON -> 1x 4k 144hz, FRL3, at a max resolution supported by the adapter of 4k 120hz RGB 8bpc.
DGPU
* Single Display DP (SST DSC) -> 4k144hz, 4k240hz
* Multiple Display DP -> 4k240hz + 4k144hz
* MST (Startech MST14DP123DP [DP to 3x DP] and 2x 4k 60hz displays)
* MST DSC (with Cable Matters 101075 [DP to 3x DP] with 3x 4k60hz displays)
The testing is a mix of automated and manual tests. Manual testing includes (but is not limited to)
* Changing display configurations and settings
* Video/Audio playback
* Benchmark testing
* Suspend/Resume testing
* Feature testing (Freesync, HDCP, etc.)
Automated testing includes (but is not limited to)
* Script testing (scripts to automate some of the manual checks)
* IGT testing
The testing is mainly tested on the following displays, but occasionally there are tests with other displays
* Samsung G8 Neo 4k240hz
* Samsung QN55QN95B 4k 120hz
* Acer XV322QKKV 4k144hz
* HP U27 4k Wireless 4k60hz
* LG 27UD58B 4k60hz
* LG 32UN650WA 4k60hz
* LG Ultrafine 5k 5k60hz
* AU Optronics B140HAN01.1 1080p 60hz eDP
* AU Optronics B160UAN01.J 1920x1200 165hz eDP
The patchset consists of the amd-staging-drm-next branch (Head commit - 77fce53066ba8b9e4c5d3b93349068a4ab109ca9 -> drm/amd/display: Promote DC to 3.2.338) with new patches added on top of it.
Tested on Ubuntu 24.04.3, on Wayland and X11, using KDE Plasma and Gnome.
Thank you,
Dan Wheeler
Sr. Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
Facebook | Twitter | amd.com
-----Original Message-----
From: Fangzhi Zuo <[email protected]>
Sent: Wednesday, June 18, 2025 11:34 AM
To: [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Pillai, Aurabindo <[email protected]>; Li, Roman <[email protected]>; Lin, Wayne <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; Zuo, Jerry <[email protected]>; Wheeler, Daniel <[email protected]>; Wu, Ray <[email protected]>; Hung, Alex <[email protected]>; Zuo, Jerry <[email protected]>
Subject: [PATCH 00/13] DC Patches June 16, 2025
This DC patchset brings improvements in multiple areas. In summary, we highlight:
* Improve USB4 bandwidth validation
* dml clock calcuation with EQU Prefetch included
* Tweaking udelay time to fix "failed to blank crtc!" error
* Add LSDMA support to DMUB
* Fix Coverity issue
Alex Hung (1):
drm/amd/display: Initialize mode_select to 0
Alvin Lee (1):
drm/amd/display: Removed unnecessary comment
Austin Zheng (2):
drm/amd/display: Include EQU Prefetch Bandwidth For Bandwidth
Calculations
drm/amd/display: DML21 Reintegration
Cruise Hung (1):
drm/amd/display: Add new DP tunnel bandwidth validation
Fangzhi Zuo (1):
drm/amd/display: Rewording Mode Validation Result
Ilya Bakoulin (1):
drm/amd/display: Add num_slices_h to set_dto_dscclk signature
Ostrowski, Rafal (1):
drm/amd/display: LSDMA support
Ovidiu Bunea (1):
drm/amd/display: Add DMUB IPS command support for IPS residency tools
Taimur Hassan (2):
drm/amd/display: [FW Promotion] Release 0.1.16.0 drm/amd/display: Promote DAL to 3.2.339
Wen Chen (1):
drm/amd/display: Fix 'failed to blank crtc!'
Weiguang Li (1):
drm/amd/display: Remove redundant macro of refresh rate
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- .../gpu/drm/amd/display/dc/core/dc_debug.c | 2 + .../drm/amd/display/dc/core/dc_link_exports.c | 6 + drivers/gpu/drm/amd/display/dc/dc.h | 16 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 297 ++++++++++++++---- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 77 ++++- drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 15 + drivers/gpu/drm/amd/display/dc/dc_types.h | 7 + .../amd/display/dc/dccg/dcn401/dcn401_dccg.c | 2 +- .../amd/display/dc/dccg/dcn401/dcn401_dccg.h | 3 +- .../dc/dml2/dml21/dml21_translation_helper.c | 1 - .../dml2/dml21/inc/dml_top_dchub_registers.h | 1 + .../dml21/inc/dml_top_display_cfg_types.h | 2 + .../dml21/inc/dml_top_soc_parameter_types.h | 1 + .../display/dc/dml2/dml21/inc/dml_top_types.h | 4 +- .../src/dml2_core/dml2_core_dcn4_calcs.c | 46 +-- .../src/dml2_core/dml2_core_shared_types.h | 99 +++++- .../dc/dml2/dml21/src/inc/dml2_debug.h | 149 ++++++++- .../amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 2 +- .../amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 6 +- .../gpu/drm/amd/display/dc/inc/core_status.h | 1 + drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h | 2 +- drivers/gpu/drm/amd/display/dc/inc/link.h | 3 + .../gpu/drm/amd/display/dc/link/link_dpms.c | 10 +- .../drm/amd/display/dc/link/link_factory.c | 1 + .../drm/amd/display/dc/link/link_validation.c | 85 ++++- .../drm/amd/display/dc/link/link_validation.h | 3 + .../display/dc/link/protocols/link_dp_dpia.c | 15 +- .../dc/link/protocols/link_dp_dpia_bw.c | 169 +++++++--- .../dc/link/protocols/link_dp_dpia_bw.h | 27 +- .../amd/display/dc/mpc/dcn401/dcn401_mpc.c | 2 +- drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 10 +- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 101 +++++- .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 4 + .../amd/display/modules/freesync/freesync.c | 2 +- 35 files changed, 970 insertions(+), 203 deletions(-)
--
2.43.0