DC Patches September 15, 2020
cover DC Patches September 15, 2020
This DC patchset brings improvements in multiple areas. In summary, we highlight:
* Add DSC padding for OVT support
* Setup pixel encoding for YCBCR422
* Fix dml ms order
* Rename header file link.h to link_service.h
* Fix DMUB loading sequence
* Modify link training policy
Ausef Yousof (1):
drm/amd/display: fix dml ms order of operations
Charlene Liu (1):
drm/amd/display: limit one non-related log to dGPU
Dillon Varone (3):
drm/amd/display: Disable stutter when programming watermarks on dcn32 drm/amd/display: Add missing post flip calls drm/amd/display: re-enable disable_stutter_for_wm_program w/a
Dmytro Laktyushkin (1):
drm/amd/display: prepare dml 2.1 for new asic
Ivan Lipski (1):
drm/amd/display: Allow RX6xxx & RX7700 to invoke amdgpu_irq_get/put
Mario Limonciello (2):
drm/amd/display: Set up pixel encoding for YCBCR422 drm/amd/display: Add fallback path for YCBCR422
Martin Leung (1):
Revert "drm/amd/display: Reduce Stack Usage by moving 'audio_output'
into 'stream_res' v4"
Nicholas Kazlauskas (1):
drm/amd/display: Fix DMCUB loading sequence for DCN3.2
Relja Vojvodic (1):
drm/amd/display: Add DSC padding for OVT Support
Taimur Hassan (1):
drm/amd/display: Promote DC to 3.2.350
Wesley Chalmers (1):
drm/amd/display: Rename header file link.h to link_service.h
Zhikai Zhai (1):
drm/amd/display: Modify the link training policy
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 88 ++++++++++++++++---
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 1 +
.../amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 8 +-
.../amd/display/amdgpu_dm/amdgpu_dm_replay.c | 2 +-
.../gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c | 2 +-
.../display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c | 2 +-
.../dc/clk_mgr/dcn314/dcn314_clk_mgr.c | 2 +-
.../dc/clk_mgr/dcn315/dcn315_clk_mgr.c | 2 +-
.../dc/clk_mgr/dcn316/dcn316_clk_mgr.c | 2 +-
.../display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 2 +-
.../display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c | 2 +-
.../dc/clk_mgr/dcn401/dcn401_clk_mgr.c | 2 +-
drivers/gpu/drm/amd/display/dc/core/dc.c | 6 +-
.../drm/amd/display/dc/core/dc_link_enc_cfg.c | 2 +-
.../drm/amd/display/dc/core/dc_link_exports.c | 3 +-
.../gpu/drm/amd/display/dc/core/dc_resource.c | 37 ++++----
.../gpu/drm/amd/display/dc/core/dc_state.c | 2 +-
drivers/gpu/drm/amd/display/dc/dc.h | 3 +-
.../gpu/drm/amd/display/dc/dc_spl_translate.c | 2 +-
.../gpu/drm/amd/display/dc/dce/dmub_replay.c | 2 +-
.../dc/dio/dcn10/dcn10_stream_encoder.c | 2 +-
.../dc/dio/dcn20/dcn20_stream_encoder.c | 2 +-
.../dc/dio/dcn31/dcn31_dio_link_encoder.c | 2 +-
.../dc/dio/dcn314/dcn314_dio_stream_encoder.c | 2 +-
.../dc/dio/dcn32/dcn32_dio_stream_encoder.c | 2 +-
.../dc/dio/dcn35/dcn35_dio_stream_encoder.c | 2 +-
.../dc/dio/dcn401/dcn401_dio_stream_encoder.c | 2 +-
.../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 3 +-
.../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 2 +-
.../drm/amd/display/dc/dml/dcn35/dcn35_fpu.c | 2 +-
.../amd/display/dc/dml/dcn351/dcn351_fpu.c | 2 +-
.../amd/display/dc/dml2/display_mode_core.c | 2 +-
.../dc/dml2/dml21/dml21_translation_helper.c | 41 ++++-----
.../display/dc/dml2/dml21/inc/dml_top_types.h | 6 +-
.../drm/amd/display/dc/dsc/dcn20/dcn20_dsc.c | 3 +-
.../gpu/drm/amd/display/dc/hdcp/hdcp_msg.c | 2 +-
.../display/dc/hubbub/dcn32/dcn32_hubbub.c | 37 ++++++--
.../amd/display/dc/hwss/dce110/dce110_hwseq.c | 34 +++----
.../amd/display/dc/hwss/dcn10/dcn10_hwseq.c | 2 +-
.../amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 2 +-
.../amd/display/dc/hwss/dcn21/dcn21_hwseq.c | 2 +-
.../amd/display/dc/hwss/dcn30/dcn30_hwseq.c | 2 +-
.../amd/display/dc/hwss/dcn31/dcn31_hwseq.c | 2 +-
.../amd/display/dc/hwss/dcn314/dcn314_hwseq.c | 2 +-
.../amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 4 +-
.../amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 2 +-
.../amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 11 ++-
.../gpu/drm/amd/display/dc/inc/core_types.h | 15 ++--
.../display/dc/inc/{link.h => link_service.h} | 6 +-
drivers/gpu/drm/amd/display/dc/inc/resource.h | 1 +
.../display/dc/link/accessories/link_dp_cts.c | 13 ++-
.../display/dc/link/accessories/link_dp_cts.h | 2 +-
.../dc/link/accessories/link_dp_trace.h | 2 +-
.../amd/display/dc/link/hwss/link_hwss_dio.h | 2 +-
.../hwss/link_hwss_dio_fixed_vs_pe_retimer.h | 2 +-
.../display/dc/link/hwss/link_hwss_hpo_dp.h | 2 +-
.../link_hwss_hpo_fixed_vs_pe_retimer_dp.h | 2 +-
.../drm/amd/display/dc/link/link_detection.h | 2 +-
.../gpu/drm/amd/display/dc/link/link_dpms.c | 2 +-
.../gpu/drm/amd/display/dc/link/link_dpms.h | 2 +-
.../drm/amd/display/dc/link/link_factory.h | 2 +-
.../drm/amd/display/dc/link/link_resource.h | 2 +-
.../drm/amd/display/dc/link/link_validation.h | 2 +-
.../amd/display/dc/link/protocols/link_ddc.h | 2 +-
.../dc/link/protocols/link_dp_capability.h | 2 +-
.../display/dc/link/protocols/link_dp_dpia.h | 2 +-
.../dc/link/protocols/link_dp_dpia_bw.h | 2 +-
.../dc/link/protocols/link_dp_irq_handler.h | 2 +-
.../display/dc/link/protocols/link_dp_phy.h | 2 +-
.../dc/link/protocols/link_dp_training.c | 9 ++
.../dc/link/protocols/link_dp_training.h | 2 +-
.../amd/display/dc/link/protocols/link_dpcd.h | 2 +-
.../link/protocols/link_edp_panel_control.h | 2 +-
.../amd/display/dc/link/protocols/link_hpd.h | 2 +-
.../dc/resource/dce120/dce120_resource.c | 2 +-
.../dc/resource/dcn20/dcn20_resource.c | 2 +-
.../dc/resource/dcn30/dcn30_resource.c | 2 +-
.../dc/resource/dcn302/dcn302_resource.c | 3 +-
.../dc/resource/dcn303/dcn303_resource.c | 2 +-
.../dc/resource/dcn31/dcn31_resource.c | 5 +-
.../dc/resource/dcn31/dcn31_resource.h | 3 +-
.../dc/resource/dcn32/dcn32_resource.c | 5 +-
.../dc/resource/dcn32/dcn32_resource.h | 3 +-
.../dc/resource/dcn321/dcn321_resource.c | 2 +-
.../dc/resource/dcn35/dcn35_resource.c | 2 +-
.../dc/resource/dcn351/dcn351_resource.c | 2 +-
.../dc/resource/dcn36/dcn36_resource.c | 2 +-
.../dc/resource/dcn401/dcn401_resource.c | 5 +-
.../gpu/drm/amd/display/dmub/src/dmub_dcn32.c | 53 +++++------
.../gpu/drm/amd/display/dmub/src/dmub_dcn32.h | 8 +-
90 files changed, 332 insertions(+), 206 deletions(-)
rename drivers/gpu/drm/amd/display/dc/inc/{link.h => link_service.h} (98%)Signature · 1 line
2.43.0
PATCH 1/15 drm/amd/display: Modify the link training policy
From: Zhikai Zhai <[email protected]>
[Why&How]
Currently fallback to low link rate if the link training fails once on USB4. It may cause the bandwidth couldn't satisfy the requirement of streams. Modify the policy to do training retry in the previous few times, only do fallback at the last time.
--- .../drm/amd/display/dc/link/protocols/link_dp_training.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c +9 -0
@@ -1729,6 +1729,15 @@ bool perform_link_training_with_retries(break ; } +if (link->ep_type ==DISPLAY_ENDPOINT_USB4_DPIA && + stream->signal ==SIGNAL_TYPE_DISPLAY_PORT_MST && + !link->dc->config.enable_dpia_pre_training) { +if (j == (attempts -1 )) + do_fallback = true; +else + do_fallback = false; + } +if (j == (attempts -1 )) { DC_LOG_WARNING( "%s: Link(%d) training attempt %u of %d failed @ rate(%d) x lane(%d) @ spread = %x : fail reason:(%d)\n",
Signature · 1 line
2.43.0
PATCH 2/15 drm/amd/display: prepare dml 2.1 for new asic
In reply to Ray WuFrom: Dmytro Laktyushkin <[email protected]>
[Why&How]
prepare dml 2.1 for new asic
--- drivers/gpu/drm/amd/display/dc/core/dc_state.c | 2 +- .../gpu/drm/amd/display/dc/dml2/dml21/inc/dml_top_types.h | 6 +++--- drivers/gpu/drm/amd/display/dc/inc/resource.h | 1 + 3 files changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_state.c +1 -1
@@ -211,7 +211,7 @@ struct dc_state *dc_state_create(struct dc *dc, struct dc_state_create_params *preturn NULL ; } -if (!dml2_create (dc, &dc->dml2_dc_power_options, &state->bw_ctx.dml2_dc_power_source)) { +if (dc->caps.dcmode_power_limits_present && !dml2_create (dc, &dc->dml2_dc_power_options, &state->bw_ctx.dml2_dc_power_source)) {dc_state_release (state);return NULL ; }
drivers/gpu/drm/amd/display/dc/dml2/dml21/inc/dml_top_types.h +3 -3
@@ -16,9 +16,9 @@ struct dml2_instance;enum dml2_project_id { dml2_project_invalid =0 , - dml2_project_dcn4x_stage1 =1 , - dml2_project_dcn4x_stage2 =2 , - dml2_project_dcn4x_stage2_auto_drr_svp =3 , + dml2_project_dcn4x_stage1, + dml2_project_dcn4x_stage2, + dml2_project_dcn4x_stage2_auto_drr_svp, };enum dml2_pstate_change_support {
drivers/gpu/drm/amd/display/dc/inc/resource.h +1 -0
@@ -45,6 +45,7 @@ enum dce_version resource_parse_asic_id(struct resource_caps {int num_timing_generator;int num_opp; +int num_dpp;int num_video_plane;int num_audio;int num_stream_encoder;
Signature · 1 line
2.43.0
PATCH 3/15 drm/amd/display: Fix DMCUB loading sequence for DCN3.2
In reply to Ray WuFrom: Nicholas Kazlauskas <[email protected]>
[Why]
New sequence from HW for reset and firmware reloading has been provided that aims to stabilize the reload sequence in the case the firmware is hung or has outstanding requests.
[How]
Update the sequence to remove the DMUIF reset and the redundant writes in the release.
--- .../gpu/drm/amd/display/dmub/src/dmub_dcn32.c | 53 ++++++++++--------- .../gpu/drm/amd/display/dmub/src/dmub_dcn32.h | 8 ++- 2 files changed, 35 insertions(+), 26 deletions(-)
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn32.c +28 -25
@@ -89,44 +89,50 @@ static inline void dmub_dcn32_translate_addr(const union dmub_addr *addr_in,void dmub_dcn32_reset (struct dmub_srv *dmub) {union dmub_gpint_data_register cmd; -const uint32_t timeout =30 ; -uint32_t in_reset, scratch, i; +const uint32_t timeout =100000 ; +uint32_t in_reset, is_enabled, scratch, i, pwait_mode;REG_GET (DMCUB_CNTL2 ,DMCUB_SOFT_RESET , &in_reset); +REG_GET (DMCUB_CNTL ,DMCUB_ENABLE , &is_enabled); -if (in_reset ==0 ) { +if (in_reset ==0 && is_enabled !=0 ) { cmd.bits.status =1 ; cmd.bits.command_code =DMUB_GPINT__STOP_FW ; cmd.bits.param =0 ; dmub->hw_funcs.set_gpint (dmub, cmd); -/** -* Timeout covers both the ACK and the wait -* for remaining work to finish. -* -* This is mostly bound by the PHY disable sequence. -* Each register check will be greater than 1us, so -* don't bother using udelay. -*/ -for (i =0 ; i < timeout; ++i) {if (dmub->hw_funcs.is_gpint_acked (dmub, cmd))break ; + +udelay (1 ); }for (i =0 ; i < timeout; ++i) { - scratch = dmub->hw_funcs.get_gpint_response (dmub); + scratch =REG_READ (DMCUB_SCRATCH7 );if (scratch ==DMUB_GPINT__STOP_FW_RESPONSE )break ; + +udelay (1 ); } +for (i =0 ; i < timeout; ++i) { +REG_GET (DMCUB_CNTL ,DMCUB_PWAIT_MODE_STATUS , &pwait_mode); +if (pwait_mode & (1 <<0 )) +break ; + +udelay (1 ); + }/* Force reset in case we timed out, DMCUB is likely hung. */ } -REG_UPDATE (DMCUB_CNTL2 ,DMCUB_SOFT_RESET ,1 ); -REG_UPDATE (DMCUB_CNTL ,DMCUB_ENABLE ,0 ); -REG_UPDATE (MMHUBBUB_SOFT_RESET ,DMUIF_SOFT_RESET ,1 ); +if (is_enabled) { +REG_UPDATE (DMCUB_CNTL2 ,DMCUB_SOFT_RESET ,1 ); +udelay (1 ); +REG_UPDATE (DMCUB_CNTL ,DMCUB_ENABLE ,0 ); + } +REG_WRITE (DMCUB_INBOX1_RPTR ,0 );REG_WRITE (DMCUB_INBOX1_WPTR ,0 );REG_WRITE (DMCUB_OUTBOX1_RPTR ,0 );
@@ -135,7 +141,7 @@ void dmub_dcn32_reset(struct dmub_srv *dmub)REG_WRITE (DMCUB_OUTBOX0_WPTR ,0 );REG_WRITE (DMCUB_SCRATCH0 ,0 ); -/* Clear the GPINT command manually so we don't reset again. */ +/* Clear the GPINT command manually so we don't send anything during boot. */ cmd.all =0 ; dmub->hw_funcs.set_gpint (dmub, cmd); }
@@ -419,8 +425,8 @@ uint32_t dmub_dcn32_get_current_time(struct dmub_srv *dmub)void dmub_dcn32_get_diagnostic_data (struct dmub_srv *dmub) { -uint32_t is_dmub_enabled, is_soft_reset, is_sec_reset; -uint32_t is_traceport_enabled, is_cw0_enabled, is_cw6_enabled; +uint32_t is_dmub_enabled, is_soft_reset, is_pwait; +uint32_t is_traceport_enabled, is_cw6_enabled;struct dmub_timeout_info timeout = {0 };if (!dmub)
@@ -470,18 +476,15 @@ void dmub_dcn32_get_diagnostic_data(struct dmub_srv *dmub)REG_GET (DMCUB_CNTL ,DMCUB_ENABLE , &is_dmub_enabled); dmub->debug.is_dmcub_enabled = is_dmub_enabled; +REG_GET (DMCUB_CNTL ,DMCUB_PWAIT_MODE_STATUS , &is_pwait); + dmub->debug.is_pwait = is_pwait; +REG_GET (DMCUB_CNTL2 ,DMCUB_SOFT_RESET , &is_soft_reset); dmub->debug.is_dmcub_soft_reset = is_soft_reset; -REG_GET (DMCUB_SEC_CNTL ,DMCUB_SEC_RESET_STATUS , &is_sec_reset); - dmub->debug.is_dmcub_secure_reset = is_sec_reset; -REG_GET (DMCUB_CNTL ,DMCUB_TRACEPORT_EN , &is_traceport_enabled); dmub->debug.is_traceport_en = is_traceport_enabled; -REG_GET (DMCUB_REGION3_CW0_TOP_ADDRESS ,DMCUB_REGION3_CW0_ENABLE , &is_cw0_enabled); - dmub->debug.is_cw0_enabled = is_cw0_enabled; -REG_GET (DMCUB_REGION3_CW6_TOP_ADDRESS ,DMCUB_REGION3_CW6_ENABLE , &is_cw6_enabled); dmub->debug.is_cw6_enabled = is_cw6_enabled;
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn32.h +7 -1
@@ -89,6 +89,9 @@ struct dmub_srv; DMUB_SR(DMCUB_REGION5_OFFSET) \ DMUB_SR(DMCUB_REGION5_OFFSET_HIGH) \ DMUB_SR(DMCUB_REGION5_TOP_ADDRESS) \ + DMUB_SR(DMCUB_REGION6_OFFSET) \ + DMUB_SR(DMCUB_REGION6_OFFSET_HIGH) \ + DMUB_SR(DMCUB_REGION6_TOP_ADDRESS) \ DMUB_SR(DMCUB_SCRATCH0) \ DMUB_SR(DMCUB_SCRATCH1) \ DMUB_SR(DMCUB_SCRATCH2) \
@@ -155,6 +158,8 @@ struct dmub_srv; DMUB_SF(DMCUB_REGION4_TOP_ADDRESS, DMCUB_REGION4_ENABLE) \ DMUB_SF(DMCUB_REGION5_TOP_ADDRESS, DMCUB_REGION5_TOP_ADDRESS) \ DMUB_SF(DMCUB_REGION5_TOP_ADDRESS, DMCUB_REGION5_ENABLE) \ + DMUB_SF(DMCUB_REGION6_TOP_ADDRESS, DMCUB_REGION6_TOP_ADDRESS) \ + DMUB_SF(DMCUB_REGION6_TOP_ADDRESS, DMCUB_REGION6_ENABLE) \ DMUB_SF(CC_DC_PIPE_DIS, DC_DMCUB_ENABLE) \ DMUB_SF(MMHUBBUB_SOFT_RESET, DMUIF_SOFT_RESET) \DMUB_SF (DCN_VM_FB_LOCATION_BASE ,FB_BASE ) \
@@ -162,7 +167,8 @@ struct dmub_srv; DMUB_SF(DMCUB_INBOX0_WPTR, DMCUB_INBOX0_WPTR) \ DMUB_SF(DMCUB_REGION3_TMR_AXI_SPACE, DMCUB_REGION3_TMR_AXI_SPACE) \ DMUB_SF(DMCUB_INTERRUPT_ENABLE, DMCUB_GPINT_IH_INT_EN) \ - DMUB_SF(DMCUB_INTERRUPT_ACK, DMCUB_GPINT_IH_INT_ACK) + DMUB_SF(DMCUB_INTERRUPT_ACK, DMCUB_GPINT_IH_INT_ACK) \ + DMUB_SF(DMCUB_CNTL, DMCUB_PWAIT_MODE_STATUS)struct dmub_srv_dcn32_reg_offset {#define DMUB_SR (reg) uint32_t reg;
Signature · 1 line
2.43.0
PATCH 4/15 drm/amd/display: Rename header file link.h to link_service.h
In reply to Ray WuFrom: Wesley Chalmers <[email protected]>
[WHY]
Header file name "link.h" collides with system header when dc is compiled as a user-mode library
[WHAT]
Rename link.h to link_service.h to avoid name collision
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_replay.c | 2 +-
drivers/gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c | 2 +-
.../gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c | 2 +-
.../gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c | 2 +-
.../gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c | 2 +-
.../gpu/drm/amd/display/dc/clk_mgr/dcn316/dcn316_clk_mgr.c | 2 +-
.../gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 2 +-
.../gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c | 2 +-
.../gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c | 2 +-
drivers/gpu/drm/amd/display/dc/core/dc.c | 2 +-
drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c | 2 +-
drivers/gpu/drm/amd/display/dc/core/dc_link_exports.c | 3 ++-
drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 2 +-
drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c | 2 +-
.../gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c | 2 +-
.../gpu/drm/amd/display/dc/dio/dcn20/dcn20_stream_encoder.c | 2 +-
.../drm/amd/display/dc/dio/dcn31/dcn31_dio_link_encoder.c | 2 +-
.../amd/display/dc/dio/dcn314/dcn314_dio_stream_encoder.c | 2 +-
.../drm/amd/display/dc/dio/dcn32/dcn32_dio_stream_encoder.c | 2 +-
.../drm/amd/display/dc/dio/dcn35/dcn35_dio_stream_encoder.c | 2 +-
.../amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder.c | 2 +-
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 3 +--
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 2 +-
drivers/gpu/drm/amd/display/dc/dml/dcn35/dcn35_fpu.c | 2 +-
drivers/gpu/drm/amd/display/dc/dml/dcn351/dcn351_fpu.c | 2 +-
drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c | 2 +-
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c | 2 +-
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c | 2 +-
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 2 +-
drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.c | 2 +-
drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c | 2 +-
drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.c | 2 +-
drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.c | 2 +-
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 2 +-
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 2 +-
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 2 +-
.../gpu/drm/amd/display/dc/inc/{link.h => link_service.h} | 6 +++---
.../gpu/drm/amd/display/dc/link/accessories/link_dp_cts.h | 2 +-
.../gpu/drm/amd/display/dc/link/accessories/link_dp_trace.h | 2 +-
drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dio.h | 2 +-
.../dc/link/hwss/link_hwss_dio_fixed_vs_pe_retimer.h | 2 +-
drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_hpo_dp.h | 2 +-
.../dc/link/hwss/link_hwss_hpo_fixed_vs_pe_retimer_dp.h | 2 +-
drivers/gpu/drm/amd/display/dc/link/link_detection.h | 2 +-
drivers/gpu/drm/amd/display/dc/link/link_dpms.h | 2 +-
drivers/gpu/drm/amd/display/dc/link/link_factory.h | 2 +-
drivers/gpu/drm/amd/display/dc/link/link_resource.h | 2 +-
drivers/gpu/drm/amd/display/dc/link/link_validation.h | 2 +-
drivers/gpu/drm/amd/display/dc/link/protocols/link_ddc.h | 2 +-
.../drm/amd/display/dc/link/protocols/link_dp_capability.h | 2 +-
.../gpu/drm/amd/display/dc/link/protocols/link_dp_dpia.h | 2 +-
.../gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.h | 2 +-
.../drm/amd/display/dc/link/protocols/link_dp_irq_handler.h | 2 +-
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_phy.h | 2 +-
.../drm/amd/display/dc/link/protocols/link_dp_training.h | 2 +-
drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.h | 2 +-
.../amd/display/dc/link/protocols/link_edp_panel_control.h | 2 +-
drivers/gpu/drm/amd/display/dc/link/protocols/link_hpd.h | 2 +-
.../drm/amd/display/dc/resource/dce120/dce120_resource.c | 2 +-
.../gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c | 2 +-
.../gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c | 2 +-
.../drm/amd/display/dc/resource/dcn302/dcn302_resource.c | 3 ++-
.../drm/amd/display/dc/resource/dcn303/dcn303_resource.c | 2 +-
.../gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c | 2 +-
.../drm/amd/display/dc/resource/dcn321/dcn321_resource.c | 2 +-
.../gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c | 2 +-
.../drm/amd/display/dc/resource/dcn351/dcn351_resource.c | 2 +-
.../gpu/drm/amd/display/dc/resource/dcn36/dcn36_resource.c | 2 +-
.../drm/amd/display/dc/resource/dcn401/dcn401_resource.c | 2 +-
69 files changed, 73 insertions(+), 72 deletions(-)
rename drivers/gpu/drm/amd/display/dc/inc/{link.h => link_service.h} (98%)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_replay.c +1 -1
@@ -31,7 +31,7 @@#include "amdgpu_dm.h" #include "modules/power/power_helpers.h" #include "dmub/inc/dmub_cmd.h" -#include "dc/inc/link.h" +#include "dc/inc/link_service.h" /* * amdgpu_dm_link_supports_replay() - check if the link supports replay
drivers/gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c +1 -1
@@ -28,7 +28,7 @@#include "dccg.h" #include "clk_mgr_internal.h" #include "dc_state_priv.h" -#include "link.h" +#include "link_service.h" #include "dce100/dce_clk_mgr.h" #include "dce110/dce110_clk_mgr.h"
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c +1 -1
@@ -47,7 +47,7 @@#include "dcn30/dcn30_clk_mgr.h" #include "dc_dmub_srv.h" -#include "link.h" +#include "link_service.h" #include "logger_types.h"
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c +1 -1
@@ -48,7 +48,7 @@#include "dcn31/dcn31_clk_mgr.h" #include "dc_dmub_srv.h" -#include "link.h" +#include "link_service.h" #include "dcn314_smu.h"
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c +1 -1
@@ -46,7 +46,7 @@#define DC_LOGGER \ clk_mgr->base.base.ctx->logger -#include "link.h" +#include "link_service.h" #define TO_CLK_MGR_DCN315 (clk_mgr)\ container_of(clk_mgr, struct clk_mgr_dcn315, base)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn316/dcn316_clk_mgr.c +1 -1
@@ -39,7 +39,7 @@#include "dcn316_smu.h" #include "dm_helpers.h" #include "dc_dmub_srv.h" -#include "link.h" +#include "link_service.h" // DCN316 this is CLK1 instance #define MAX_INSTANCE 7
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c +1 -1
@@ -33,7 +33,7 @@#include "reg_helper.h" #include "core_types.h" #include "dm_helpers.h" -#include "link.h" +#include "link_service.h" #include "dc_state_priv.h" #include "atomfirmware.h" #include "dcn32_smu13_driver_if.h"
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c +1 -1
@@ -44,7 +44,7 @@#include "dcn31/dcn31_clk_mgr.h" #include "dc_dmub_srv.h" -#include "link.h" +#include "link_service.h" #include "logger_types.h" #undef DC_LOGGER
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c +1 -1
@@ -13,7 +13,7 @@#include "reg_helper.h" #include "core_types.h" #include "dm_helpers.h" -#include "link.h" +#include "link_service.h" #include "dc_state_priv.h" #include "atomfirmware.h"
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -1
@@ -60,7 +60,7 @@#include "link_encoder.h" #include "link_enc_cfg.h" -#include "link.h" +#include "link_service.h" #include "dm_helpers.h" #include "mem_input.h"
drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c +1 -1
@@ -24,7 +24,7 @@#include "link_enc_cfg.h" #include "resource.h" -#include "link.h" +#include "link_service.h" #define DC_LOGGER dc->ctx->logger
drivers/gpu/drm/amd/display/dc/core/dc_link_exports.c +2 -1
@@ -33,8 +33,9 @@* dc.h with detail interface documentation, then add function implementation * in this file which calls link functions. */ -#include "link.h" +#include "link_service.h" #include "dce/dce_i2c.h" +struct dc_link *dc_get_link_at_index (struct dc *dc,uint32_t link_index) {if (link_index >=MAX_LINKS )
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1 -1
@@ -40,7 +40,7 @@#include "virtual/virtual_stream_encoder.h" #include "dpcd_defs.h" #include "link_enc_cfg.h" -#include "link.h" +#include "link_service.h" #include "clk_mgr.h" #include "dc_state_priv.h" #include "dc_stream_priv.h"
drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c +1 -1
@@ -3,7 +3,7 @@// Copyright 2024 Advanced Micro Devices, Inc. #include "dc.h" -#include "link.h" +#include "link_service.h" #include "dc_dmub_srv.h" #include "dmub/dmub_srv.h" #include "core_types.h"
drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c +1 -1
@@ -28,7 +28,7 @@#include "dcn10_stream_encoder.h" #include "reg_helper.h" #include "hw_shared.h" -#include "link.h" +#include "link_service.h" #include "dpcd_defs.h" #include "dcn30/dcn30_afmt.h"
drivers/gpu/drm/amd/display/dc/dio/dcn20/dcn20_stream_encoder.c +1 -1
@@ -29,7 +29,7 @@#include "dcn20_stream_encoder.h" #include "reg_helper.h" #include "hw_shared.h" -#include "link.h" +#include "link_service.h" #include "dpcd_defs.h" #define DC_LOGGER \
drivers/gpu/drm/amd/display/dc/dio/dcn31/dcn31_dio_link_encoder.c +1 -1
@@ -37,7 +37,7 @@#include "link_enc_cfg.h" #include "dc_dmub_srv.h" #include "dal_asic_id.h" -#include "link.h" +#include "link_service.h" #define CTX \ enc10->base.ctx
drivers/gpu/drm/amd/display/dc/dio/dcn314/dcn314_dio_stream_encoder.c +1 -1
@@ -30,7 +30,7 @@#include "dcn314_dio_stream_encoder.h" #include "reg_helper.h" #include "hw_shared.h" -#include "link.h" +#include "link_service.h" #include "dpcd_defs.h" #define DC_LOGGER \
drivers/gpu/drm/amd/display/dc/dio/dcn32/dcn32_dio_stream_encoder.c +1 -1
@@ -29,7 +29,7 @@#include "dcn32_dio_stream_encoder.h" #include "reg_helper.h" #include "hw_shared.h" -#include "link.h" +#include "link_service.h" #include "dpcd_defs.h" #define DC_LOGGER \
drivers/gpu/drm/amd/display/dc/dio/dcn35/dcn35_dio_stream_encoder.c +1 -1
@@ -29,7 +29,7 @@#include "dcn35_dio_stream_encoder.h" #include "reg_helper.h" #include "hw_shared.h" -#include "link.h" +#include "link_service.h" #include "dpcd_defs.h" #define DC_LOGGER \
drivers/gpu/drm/amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder.c +1 -1
@@ -32,7 +32,7 @@#include "dcn401_dio_stream_encoder.h" #include "reg_helper.h" #include "hw_shared.h" -#include "link.h" +#include "link_service.h" #include "dpcd_defs.h" #define DC_LOGGER \
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c +1 -2
@@ -30,8 +30,7 @@#include "dcn20/dcn20_resource.h" #include "dcn21/dcn21_resource.h" #include "clk_mgr/dcn21/rn_clk_mgr.h" - -#include "link.h" +#include "link_service.h" #include "dcn20_fpu.h" #include "dc_state_priv.h"
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +1 -1
@@ -31,7 +31,7 @@// We need this includes for WATERMARKS_* defines #include "clk_mgr/dcn32/dcn32_smu13_driver_if.h" #include "dcn30/dcn30_resource.h" -#include "link.h" +#include "link_service.h" #include "dc_state_priv.h" #define DC_LOGGER_INIT (logger)
drivers/gpu/drm/amd/display/dc/dml/dcn35/dcn35_fpu.c +1 -1
@@ -31,7 +31,7 @@#include "dml/dcn31/dcn31_fpu.h" #include "dml/dml_inline_defs.h" -#include "link.h" +#include "link_service.h" #define DC_LOGGER_INIT (logger)
drivers/gpu/drm/amd/display/dc/dml/dcn351/dcn351_fpu.c +1 -1
@@ -10,7 +10,7 @@#include "dml/dcn35/dcn35_fpu.h" #include "dml/dml_inline_defs.h" -#include "link.h" +#include "link_service.h" #define DC_LOGGER_INIT (logger)
drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c +1 -1
@@ -28,7 +28,7 @@#include "include/hdcp_msg_types.h" #include "include/signal_types.h" #include "core_types.h" -#include "link.h" +#include "link_service.h" #include "link_hwss.h" #include "link/protocols/link_dpcd.h"
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +1 -1
@@ -48,7 +48,7 @@#include "link_encoder.h" #include "link_enc_cfg.h" #include "link_hwss.h" -#include "link.h" +#include "link_service.h" #include "dccg.h" #include "clock_source.h" #include "clk_mgr.h"
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +1 -1
@@ -55,7 +55,7 @@#include "dce/dmub_hw_lock_mgr.h" #include "dc_trace.h" #include "dce/dmub_outbox.h" -#include "link.h" +#include "link_service.h" #include "dc_state_priv.h" #define DC_LOGGER \
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c +1 -1
@@ -54,7 +54,7 @@#include "dpcd_defs.h" #include "inc/link_enc_cfg.h" #include "link_hwss.h" -#include "link.h" +#include "link_service.h" #include "dc_state_priv.h" #define DC_LOGGER \
drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.c +1 -1
@@ -35,7 +35,7 @@#include "hw/clk_mgr.h" #include "dc_dmub_srv.h" #include "abm.h" -#include "link.h" +#include "link_service.h" #define DC_LOGGER_INIT (logger)
drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c +1 -1
@@ -50,7 +50,7 @@#include "dpcd_defs.h" #include "dcn20/dcn20_hwseq.h" #include "dcn30/dcn30_resource.h" -#include "link.h" +#include "link_service.h" #include "dc_state_priv.h"
drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.c +1 -1
@@ -45,7 +45,7 @@#include "link_hwss.h" #include "dpcd_defs.h" #include "dce/dmub_outbox.h" -#include "link.h" +#include "link_service.h" #include "dcn10/dcn10_hwseq.h" #include "dcn21/dcn21_hwseq.h" #include "inc/link_enc_cfg.h"
drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.c +1 -1
@@ -46,7 +46,7 @@#include "link_hwss.h" #include "dpcd_defs.h" #include "dce/dmub_outbox.h" -#include "link.h" +#include "link_service.h" #include "dcn10/dcn10_hwseq.h" #include "inc/link_enc_cfg.h" #include "dcn30/dcn30_vpg.h"
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c +1 -1
@@ -49,7 +49,7 @@#include "dcn20/dcn20_optc.h" #include "dce/dmub_hw_lock_mgr.h" #include "dcn32/dcn32_resource.h" -#include "link.h" +#include "link_service.h" #include "../dcn20/dcn20_hwseq.h" #include "dc_state_priv.h"
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +1 -1
@@ -46,7 +46,7 @@#include "link_hwss.h" #include "dpcd_defs.h" #include "dce/dmub_outbox.h" -#include "link.h" +#include "link_service.h" #include "dcn10/dcn10_hwseq.h" #include "inc/link_enc_cfg.h" #include "dcn30/dcn30_vpg.h"
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c +1 -1
@@ -25,7 +25,7 @@#include "dpcd_defs.h" #include "clk_mgr.h" #include "dsc.h" -#include "link.h" +#include "link_service.h" #include "dce/dmub_hw_lock_mgr.h" #include "dcn10/dcn10_cm_common.h"
drivers/gpu/drm/amd/display/dc/inc/link_service.h renamed from drivers/gpu/drm/amd/display/dc/inc/link.h +3 -3
@@ -42,8 +42,8 @@* dc_link_exports.c or other dc files implement dc.h * * DC to Link: -* dc_link_exports.c or other dc files include link.h -* link_factory.c implements link.h +* dc_link_exports.c or other dc files include link_service.h +* link_factory.c implements link_service.h * * Link sub-component to Link sub-component: * link_factory.c includes --> link_xxx.h
@@ -73,7 +73,7 @@* 2. Implement your function in the suitable link_xxx.c file. * 3. Assign the function to link_service in link_factory.c * 4. NEVER include link_xxx.h headers outside link component. -* 5. NEVER include link.h on DM side. +* 5. NEVER include link_service.h on DM side. */ #include "core_types.h"
drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_cts.h +1 -1
@@ -24,7 +24,7 @@*/ #ifndef __LINK_DP_CTS_H__#define __LINK_DP_CTS_H__ -#include "link.h" +#include "link_service.h" void dp_handle_automated_test (struct dc_link *link); bool dp_set_test_pattern( struct dc_link *link,
drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_trace.h +1 -1
@@ -24,7 +24,7 @@*/ #ifndef __LINK_DP_TRACE_H__#define __LINK_DP_TRACE_H__ -#include "link.h" +#include "link_service.h" void dp_trace_init (struct dc_link *link);void dp_trace_reset (struct dc_link *link);
drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dio.h +1 -1
@@ -27,7 +27,7 @@#define __LINK_HWSS_DIO_H__#include "link_hwss.h" -#include "link.h" +#include "link_service.h" const struct link_hwss *get_dio_link_hwss (void ); bool can_use_dio_link_hwss(const struct dc_link *link,
drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dio_fixed_vs_pe_retimer.h +1 -1
@@ -25,7 +25,7 @@#ifndef __LINK_HWSS_DIO_FIXED_VS_PE_RETIMER_H__#define __LINK_HWSS_DIO_FIXED_VS_PE_RETIMER_H__ -#include "link.h" +#include "link_service.h" uint32_t dp_dio_fixed_vs_pe_retimer_get_lttpr_write_address (struct dc_link *link);uint8_t dp_dio_fixed_vs_pe_retimer_lane_cfg_to_hw_cfg (struct dc_link *link);
drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_hpo_dp.h +1 -1
@@ -26,7 +26,7 @@#define __LINK_HWSS_HPO_DP_H__#include "link_hwss.h" -#include "link.h" +#include "link_service.h" void set_hpo_dp_throttled_vcp_size (struct pipe_ctx *pipe_ctx,struct fixed31_32 throttled_vcp_size);
drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_hpo_fixed_vs_pe_retimer_dp.h +1 -1
@@ -25,7 +25,7 @@#ifndef __LINK_HWSS_HPO_FIXED_VS_PE_RETIMER_DP_H__#define __LINK_HWSS_HPO_FIXED_VS_PE_RETIMER_DP_H__ -#include "link.h" +#include "link_service.h" bool requires_fixed_vs_pe_retimer_hpo_link_hwss (const struct dc_link *link);const struct link_hwss *get_hpo_fixed_vs_pe_retimer_dp_link_hwss (void );
drivers/gpu/drm/amd/display/dc/link/link_detection.h +1 -1
@@ -25,7 +25,7 @@#ifndef __DC_LINK_DETECTION_H__#define __DC_LINK_DETECTION_H__ -#include "link.h" +#include "link_service.h" bool link_detect (struct dc_link *link,enum dc_detect_reason reason);bool link_detect_connection_type (struct dc_link *link,enum dc_connection_type *type);
drivers/gpu/drm/amd/display/dc/link/link_dpms.h +1 -1
@@ -26,7 +26,7 @@#ifndef __DC_LINK_DPMS_H__#define __DC_LINK_DPMS_H__ -#include "link.h" +#include "link_service.h" void link_set_dpms_on (struct dc_state *state,struct pipe_ctx *pipe_ctx);
drivers/gpu/drm/amd/display/dc/link/link_factory.h +1 -1
@@ -24,7 +24,7 @@*/ #ifndef __LINK_FACTORY_H__#define __LINK_FACTORY_H__ -#include "link.h" +#include "link_service.h" struct dc_link *link_create (const struct link_init_data *init_params);void link_destroy (struct dc_link **link);
drivers/gpu/drm/amd/display/dc/link/link_resource.h +1 -1
@@ -24,7 +24,7 @@*/ #ifndef __LINK_RESOURCE_H__#define __LINK_RESOURCE_H__ -#include "link.h" +#include "link_service.h" void link_get_cur_res_map (const struct dc *dc,uint32_t *map);void link_restore_res_map (const struct dc *dc,uint32_t *map); void link_get_cur_link_res(const struct dc_link *link,
drivers/gpu/drm/amd/display/dc/link/link_validation.h +1 -1
@@ -24,7 +24,7 @@*/ #ifndef __LINK_VALIDATION_H__#define __LINK_VALIDATION_H__ -#include "link.h" +#include "link_service.h" enum dc_status link_validate_mode_timing( const struct dc_stream_state *stream,
drivers/gpu/drm/amd/display/dc/link/protocols/link_ddc.h +1 -1
@@ -26,7 +26,7 @@#ifndef __DAL_DDC_SERVICE_H__#define __DAL_DDC_SERVICE_H__ -#include "link.h" +#include "link_service.h" #define AUX_POWER_UP_WA_DELAY 500#define I2C_OVER_AUX_DEFER_WA_DELAY 70
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.h +1 -1
@@ -26,7 +26,7 @@#ifndef __DC_LINK_DP_CAPABILITY_H__#define __DC_LINK_DP_CAPABILITY_H__ -#include "link.h" +#include "link_service.h" bool detect_dp_sink_caps (struct dc_link *link);
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia.h +1 -1
@@ -27,7 +27,7 @@#ifndef __DC_LINK_DPIA_H__#define __DC_LINK_DPIA_H__ -#include "link.h" +#include "link_service.h" /* Read tunneling device capability from DPCD and update link capability * accordingly.
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.h +1 -1
@@ -26,7 +26,7 @@#ifndef DC_INC_LINK_DP_DPIA_BW_H_ #define DC_INC_LINK_DP_DPIA_BW_H_ -#include "link.h" +#include "link_service.h" /*
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_irq_handler.h +1 -1
@@ -26,7 +26,7 @@#ifndef __DC_LINK_DP_IRQ_HANDLER_H__#define __DC_LINK_DP_IRQ_HANDLER_H__ -#include "link.h" +#include "link_service.h" bool dp_parse_link_loss_status (struct dc_link *link,union hpd_irq_data *hpd_irq_dpcd_data);
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_phy.h +1 -1
@@ -26,7 +26,7 @@#ifndef __DC_LINK_DP_PHY_H__#define __DC_LINK_DP_PHY_H__ -#include "link.h" +#include "link_service.h" void dp_enable_link_phy( struct dc_link *link, const struct link_resource *link_res,
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.h +1 -1
@@ -26,7 +26,7 @@#ifndef __DC_LINK_DP_TRAINING_H__#define __DC_LINK_DP_TRAINING_H__ -#include "link.h" +#include "link_service.h" bool perform_link_training_with_retries( const struct dc_link_settings *link_setting,
drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.h +1 -1
@@ -25,7 +25,7 @@#ifndef __LINK_DPCD_H__#define __LINK_DPCD_H__ -#include "link.h" +#include "link_service.h" #include "dpcd_defs.h" enum dc_status core_link_read_dpcd(
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.h +1 -1
@@ -25,7 +25,7 @@#ifndef __DC_LINK_EDP_PANEL_CONTROL_H__#define __DC_LINK_EDP_PANEL_CONTROL_H__ -#include "link.h" +#include "link_service.h" enum dp_panel_mode dp_get_panel_mode (struct dc_link *link);void dp_set_panel_mode (struct dc_link *link,enum dp_panel_mode panel_mode);
drivers/gpu/drm/amd/display/dc/link/protocols/link_hpd.h +1 -1
@@ -26,7 +26,7 @@#ifndef __DC_LINK_HPD_H__#define __DC_LINK_HPD_H__ -#include "link.h" +#include "link_service.h" enum hpd_source_id get_hpd_line (struct dc_link *link);/*
drivers/gpu/drm/amd/display/dc/resource/dce120/dce120_resource.c +1 -1
@@ -67,7 +67,7 @@#include "reg_helper.h" #include "dce100/dce100_resource.h" -#include "link.h" +#include "link_service.h" #ifndef mmDP0_DP_DPHY_INTERNAL_CTRL#define mmDP0_DP_DPHY_INTERNAL_CTRL 0x210f
drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c +1 -1
@@ -85,7 +85,7 @@#include "vm_helper.h" #include "link_enc_cfg.h" -#include "link.h" +#include "link_service.h" #define DC_LOGGER_INIT (logger)
drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c +1 -1
@@ -60,7 +60,7 @@#include "dml/display_mode_vba.h" #include "dcn30/dcn30_dccg.h" #include "dcn10/dcn10_resource.h" -#include "link.h" +#include "link_service.h" #include "dce/dce_panel_cntl.h" #include "dcn30/dcn30_dwb.h"
drivers/gpu/drm/amd/display/dc/resource/dcn302/dcn302_resource.c +2 -1
@@ -47,7 +47,8 @@#include "dcn10/dcn10_resource.h" -#include "link.h" +#include "link_service.h" +#include "dce/dce_abm.h" #include "dce/dce_audio.h" #include "dce/dce_aux.h"
drivers/gpu/drm/amd/display/dc/resource/dcn303/dcn303_resource.c +1 -1
@@ -47,7 +47,7 @@#include "dcn10/dcn10_resource.h" -#include "link.h" +#include "link_service.h" #include "dce/dce_abm.h" #include "dce/dce_audio.h"
drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c +1 -1
@@ -69,7 +69,7 @@#include "dml/display_mode_vba.h" #include "dcn32/dcn32_dccg.h" #include "dcn10/dcn10_resource.h" -#include "link.h" +#include "link_service.h" #include "dcn31/dcn31_panel_cntl.h" #include "dcn30/dcn30_dwb.h"
drivers/gpu/drm/amd/display/dc/resource/dcn321/dcn321_resource.c +1 -1
@@ -72,7 +72,7 @@#include "dml/display_mode_vba.h" #include "dcn32/dcn32_dccg.h" #include "dcn10/dcn10_resource.h" -#include "link.h" +#include "link_service.h" #include "dcn31/dcn31_panel_cntl.h" #include "dcn30/dcn30_dwb.h"
drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c +1 -1
@@ -61,7 +61,7 @@#include "dcn31/dcn31_hpo_dp_stream_encoder.h" #include "dcn31/dcn31_hpo_dp_link_encoder.h" #include "dcn32/dcn32_hpo_dp_link_encoder.h" -#include "link.h" +#include "link_service.h" #include "dcn31/dcn31_apg.h" #include "dcn32/dcn32_dio_link_encoder.h" #include "dcn31/dcn31_vpg.h"
drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c +1 -1
@@ -40,7 +40,7 @@#include "dcn31/dcn31_hpo_dp_stream_encoder.h" #include "dcn31/dcn31_hpo_dp_link_encoder.h" #include "dcn32/dcn32_hpo_dp_link_encoder.h" -#include "link.h" +#include "link_service.h" #include "dcn31/dcn31_apg.h" #include "dcn32/dcn32_dio_link_encoder.h" #include "dcn31/dcn31_vpg.h"
drivers/gpu/drm/amd/display/dc/resource/dcn36/dcn36_resource.c +1 -1
@@ -40,7 +40,7 @@#include "dcn31/dcn31_hpo_dp_stream_encoder.h" #include "dcn31/dcn31_hpo_dp_link_encoder.h" #include "dcn32/dcn32_hpo_dp_link_encoder.h" -#include "link.h" +#include "link_service.h" #include "dcn31/dcn31_apg.h" #include "dcn32/dcn32_dio_link_encoder.h" #include "dcn31/dcn31_vpg.h"
drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c +1 -1
@@ -50,7 +50,7 @@#include "dml/display_mode_vba.h" #include "dcn401/dcn401_dccg.h" #include "dcn10/dcn10_resource.h" -#include "link.h" +#include "link_service.h" #include "link_enc_cfg.h" #include "dcn31/dcn31_panel_cntl.h"
Signature · 1 line
2.43.0
PATCH 5/15 drm/amd/display: Allow RX6xxx & RX7700 to invoke amdgpu_irq_get/put
In reply to Ray WuFrom: Ivan Lipski <[email protected]>
[Why&How]
As reported on https://gitlab.freedesktop.org/drm/amd/-/issues/3936,
SMU hang can occur if the interrupts are not enabled appropriately, causing a vblank timeout.
This patch reverts "5009628d8509 drm/amd/display: Remove unnecessary amdgpu_irq_get/put", but only for RX6xxx & RX7700 GPUs, on which the issue was observed.
This will re-enable interrupts regardless of whether the user space needed it or not.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 39 ++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +38 -1
@@ -8796,7 +8796,16 @@ static int amdgpu_dm_encoder_init(struct drm_device *dev,static void manage_dm_interrupts (struct amdgpu_device *adev,struct amdgpu_crtc *acrtc,struct dm_crtc_state *acrtc_state) -{ +{/* +* We cannot be sure that the frontend index maps to the same +* backend index - some even map to more than one. +* So we have to go through the CRTC to find the right IRQ. +*/ +int irq_type =amdgpu_display_crtc_idx_to_irq_type ( + adev, + acrtc->crtc_id); +struct drm_device *dev =adev_to_drm (adev); +struct drm_vblank_crtc_config config = {0 };struct dc_crtc_timing *timing;int offdelay;
@@ -8849,7 +8858,35 @@ static void manage_dm_interrupts(struct amdgpu_device *adev,drm_crtc_vblank_on_config (&acrtc->base, &config); +/* Allow RX6xxx, RX7700, RX7800 GPUs to call amdgpu_irq_get.*/ +switch (amdgpu_ip_version (adev,DCE_HWIP ,0 )) { +case IP_VERSION (3 ,0 ,0 ): +case IP_VERSION (3 ,0 ,2 ): +case IP_VERSION (3 ,0 ,3 ): +case IP_VERSION (3 ,2 ,0 ): +if (amdgpu_irq_get (adev, &adev->pageflip_irq, irq_type)) +drm_err (dev,"DM_IRQ: Cannot get pageflip irq!\n" ); +#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY ) +if (amdgpu_irq_get (adev, &adev->vline0_irq, irq_type)) +drm_err (dev,"DM_IRQ: Cannot get vline0 irq!\n" ); +#endif + } + }else { +/* Allow RX6xxx, RX7700, RX7800 GPUs to call amdgpu_irq_put.*/ +switch (amdgpu_ip_version (adev,DCE_HWIP ,0 )) { +case IP_VERSION (3 ,0 ,0 ): +case IP_VERSION (3 ,0 ,2 ): +case IP_VERSION (3 ,0 ,3 ): +case IP_VERSION (3 ,2 ,0 ): +#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY ) +if (amdgpu_irq_put (adev, &adev->vline0_irq, irq_type)) +drm_err (dev,"DM_IRQ: Cannot put vline0 irq!\n" ); +#endif +if (amdgpu_irq_put (adev, &adev->pageflip_irq, irq_type)) +drm_err (dev,"DM_IRQ: Cannot put pageflip irq!\n" ); + } +drm_crtc_vblank_off (&acrtc->base); } }
Signature · 1 line
2.43.0
PATCH 6/15 drm/amd/display: Disable stutter when programming watermarks on dcn32
In reply to Ray WuFrom: Dillon Varone <[email protected]>
[WHY&HOW]
Reprogramming watermarks with stutter allowed can cause instability on some ASICs. Disable it prior to raising watermarks (prepare bandwidth), then re-enable after lowering (optimize bandwidth).
Disable by default for now to resolve an issue with amdgpu_dm missing calls to dc_post_update_surfaces_to_stream to optimize watermarks and re-enable stutter.
--- drivers/gpu/drm/amd/display/dc/dc.h | 1 + .../display/dc/hubbub/dcn32/dcn32_hubbub.c | 37 ++++++++++++++++--- .../dc/resource/dcn32/dcn32_resource.c | 1 + .../dc/resource/dcn32/dcn32_resource.h | 3 +- 4 files changed, 36 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -1163,6 +1163,7 @@ struct dc_debug_options {unsigned int auxless_alpm_lfps_t1t2_us;short auxless_alpm_lfps_t1t2_offset_us;bool enable_pg_cntl_debug_logs; +bool disable_stutter_for_wm_program; };
drivers/gpu/drm/amd/display/dc/hubbub/dcn32/dcn32_hubbub.c +32 -5
@@ -28,6 +28,7 @@#include "dcn32_hubbub.h" #include "dm_services.h" #include "reg_helper.h" +#include "dal_asic_id.h" #define CTX \
@@ -72,6 +73,14 @@ static void dcn32_init_crb(struct hubbub *hubbub)REG_UPDATE (DCHUBBUB_DEBUG_CTRL_0 ,DET_DEPTH ,0x47F ); } +static void hubbub32_set_sdp_control (struct hubbub *hubbub,bool dc_control) +{ +struct dcn20_hubbub *hubbub2 =TO_DCN20_HUBBUB (hubbub); + +REG_UPDATE (DCHUBBUB_SDPIF_CFG0 , +SDPIF_PORT_CONTROL , dc_control); +} +void hubbub32_set_request_limit (struct hubbub *hubbub,int memory_channel_count,int words_per_channel) {struct dcn20_hubbub *hubbub2 =TO_DCN20_HUBBUB (hubbub);
@@ -754,8 +763,17 @@ static bool hubbub32_program_watermarks( unsigned int refclk_mhz, bool safe_to_lower) { +struct dc *dc = hubbub->ctx->dc;bool wm_pending = false; +if (!safe_to_lower && dc->debug.disable_stutter_for_wm_program && + (ASICREV_IS_GC_11_0_0 (dc->ctx->asic_id.hw_internal_rev) || +ASICREV_IS_GC_11_0_3 (dc->ctx->asic_id.hw_internal_rev))) { +/* before raising watermarks, SDP control give to DF, stutter must be disabled */ +hubbub32_set_sdp_control (hubbub, false); +hubbub1_allow_self_refresh_control (hubbub, false); + } +if (hubbub32_program_urgent_watermarks (hubbub, watermarks, refclk_mhz, safe_to_lower)) wm_pending = true;
@@ -786,10 +804,20 @@ static bool hubbub32_program_watermarks(REG_UPDATE(DCHUBBUB_ARB_DF_REQ_OUTSTAND, DCHUBBUB_ARB_MIN_REQ_OUTSTAND, 0x1FF);*/ -if (safe_to_lower || hubbub->ctx->dc->debug.disable_stutter) -hubbub1_allow_self_refresh_control (hubbub, !hubbub->ctx->dc->debug.disable_stutter); +if (safe_to_lower) { +/* after lowering watermarks, stutter setting is restored, SDP control given to DC */ +hubbub1_allow_self_refresh_control (hubbub, !dc->debug.disable_stutter); + +if (dc->debug.disable_stutter_for_wm_program && + (ASICREV_IS_GC_11_0_0 (dc->ctx->asic_id.hw_internal_rev) || +ASICREV_IS_GC_11_0_3 (dc->ctx->asic_id.hw_internal_rev))) { +hubbub32_set_sdp_control (hubbub, true); + } + }else if (dc->debug.disable_stutter) { +hubbub1_allow_self_refresh_control (hubbub, !dc->debug.disable_stutter); + } -hubbub32_force_usr_retraining_allow (hubbub, hubbub->ctx->dc->debug.force_usr_allow); +hubbub32_force_usr_retraining_allow (hubbub, dc->debug.force_usr_allow);return wm_pending; }
@@ -974,8 +1002,7 @@ void hubbub32_init(struct hubbub *hubbub)ignore the "df_pre_cstate_req" from the SDP port control. only the DCN will determine when to connect the SDP port */ -REG_UPDATE (DCHUBBUB_SDPIF_CFG0 , -SDPIF_PORT_CONTROL ,1 ); +hubbub32_set_sdp_control (hubbub, true);/*Set SDP's max outstanding request to 512 must set the register back to 0 (max outstanding = 256) in zero frame buffer mode*/ REG_UPDATE(DCHUBBUB_SDPIF_CFG1,
drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c +1 -0
@@ -739,6 +739,7 @@ static const struct dc_debug_options debug_defaults_drv = { .fpo_vactive_min_active_margin_us = 200, .fpo_vactive_max_blank_us = 1000, .enable_legacy_fast_update = false, + .disable_stutter_for_wm_program = false }; static struct dce_aux *dcn32_aux_engine_create(
drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.h +2 -1
@@ -1230,7 +1230,8 @@ unsigned int dcn32_get_max_hw_cursor_size(const struct dc *dc,SR (DCHUBBUB_ARB_MALL_CNTL ), \SR (DCN_VM_FAULT_ADDR_MSB ),SR (DCN_VM_FAULT_ADDR_LSB ), \SR (DCN_VM_FAULT_CNTL ),SR (DCN_VM_FAULT_STATUS ), \ -SR (SDPIF_REQUEST_RATE_LIMIT ) +SR (SDPIF_REQUEST_RATE_LIMIT ), \ +SR (DCHUBBUB_SDPIF_CFG0 )/* DCCG */
Signature · 1 line
2.43.0
PATCH 7/15 drm/amd/display: limit one non-related log to dGPU
In reply to Ray WuFrom: Charlene Liu <[email protected]>
[Why&How]
some log are for dGPU only.
Added check to limit log.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -2
@@ -5622,8 +5622,8 @@ void dc_allow_idle_optimizations_internal(struct dc *dc, bool allow, char const subvp_pipe_type[i] =dc_state_get_pipe_subvp_type (context, pipe); } } - -DC_LOG_DC ("%s: allow_idle=%d\n HardMinUClk_Khz=%d HardMinDramclk_Khz=%d\n Pipe_0=%d Pipe_1=%d Pipe_2=%d Pipe_3=%d Pipe_4=%d Pipe_5=%d (caller=%s)\n" , +if (!dc->caps.is_apu) +DC_LOG_DC ("%s: allow_idle=%d\n HardMinUClk_Khz=%d HardMinDramclk_Khz=%d\n Pipe_0=%d Pipe_1=%d Pipe_2=%d Pipe_3=%d Pipe_4=%d Pipe_5=%d (caller=%s)\n" , __func__, allow, idle_fclk_khz, idle_dramclk_khz, subvp_pipe_type[0 ], subvp_pipe_type[1 ], subvp_pipe_type[2 ], subvp_pipe_type[3 ], subvp_pipe_type[4 ], subvp_pipe_type[5 ], caller_name);
Signature · 1 line
2.43.0
PATCH 8/15 drm/amd/display: fix dml ms order of operations
In reply to Ray WuFrom: Ausef Yousof <[email protected]>
[why&how]
small error in order of operations in immediateflipbytes calculation on dml ms side that can result in dml ms and mp mismatch immediateflip support for a given pipe and thus an invalid hw state, correct the order to align with mp.
--- drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c +1 -1
@@ -6529,7 +6529,7 @@ static noinline_for_stack void dml_prefetch_check(struct display_mode_lib_st *mo mode_lib->ms.TotImmediateFlipBytes =0 ;for (k =0 ; k <= mode_lib->ms.num_active_planes -1 ; k++) {if (!(mode_lib->ms.policy.ImmediateFlipRequirement[k] == dml_immediate_flip_not_required)) { - mode_lib->ms.TotImmediateFlipBytes = mode_lib->ms.TotImmediateFlipBytes + mode_lib->ms.NoOfDPP[j][k] * mode_lib->ms.PDEAndMetaPTEBytesPerFrame[j][k] + mode_lib->ms.MetaRowBytes[j][k]; + mode_lib->ms.TotImmediateFlipBytes = mode_lib->ms.TotImmediateFlipBytes + mode_lib->ms.NoOfDPP[j][k] * (mode_lib->ms.PDEAndMetaPTEBytesPerFrame[j][k] + mode_lib->ms.MetaRowBytes[j][k]);if (mode_lib->ms.use_one_row_for_frame_flip[j][k]) { mode_lib->ms.TotImmediateFlipBytes = mode_lib->ms.TotImmediateFlipBytes + mode_lib->ms.NoOfDPP[j][k] * (2 * mode_lib->ms.DPTEBytesPerRow[j][k]); }else {
Signature · 1 line
2.43.0
PATCH 9/15 drm/amd/display: Add missing post flip calls
In reply to Ray WuFrom: Dillon Varone <[email protected]>
[WHY&HOW]dc_post_update_surfaces_to_stream needs to be called after a full update completes in order to optimize clocks and watermarks for power. Add missing calls before idle entry is requested to ensure optimal power.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +-- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 8 ++++++-- 2 files changed, 7 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -2
@@ -417,8 +417,7 @@ static inline bool update_planes_and_stream_adapter(struct dc *dc,/* * Previous frame finished and HW is ready for optimization. */ -if (update_type ==UPDATE_TYPE_FAST ) -dc_post_update_surfaces_to_stream (dc); +dc_post_update_surfaces_to_stream (dc); return dc_update_planes_and_stream(dc, array_of_surface_update,
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +6 -2
@@ -218,8 +218,10 @@ static void amdgpu_dm_idle_worker(struct work_struct *work)break ; } -if (idle_work->enable) +if (idle_work->enable) { +dc_post_update_surfaces_to_stream (idle_work->dm->dc);dc_allow_idle_optimizations (idle_work->dm->dc, true); + }mutex_unlock (&idle_work->dm->dc_lock); } idle_work->dm->idle_workqueue->running = false;
@@ -273,8 +275,10 @@ static void amdgpu_dm_crtc_vblank_control_worker(struct work_struct *work) vblank_work->acrtc->dm_irq_params.allow_sr_entry); } -if (dm->active_vblank_irq_count ==0 ) +if (dm->active_vblank_irq_count ==0 ) { +dc_post_update_surfaces_to_stream (dm->dc);dc_allow_idle_optimizations (dm->dc, true); + }mutex_unlock (&dm->dc_lock);
Signature · 1 line
2.43.0
PATCH 10/15 drm/amd/display: re-enable disable_stutter_for_wm_program w/a
In reply to Ray WuFrom: Dillon Varone <[email protected]>
[WHY&HOW]
Re-enable the w/a to disable stutter when reprogramming watermarks.
--- drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c +1 -1
@@ -739,7 +739,7 @@ static const struct dc_debug_options debug_defaults_drv = { .fpo_vactive_min_active_margin_us = 200, .fpo_vactive_max_blank_us = 1000, .enable_legacy_fast_update = false, - .disable_stutter_for_wm_program = false + .disable_stutter_for_wm_program = true }; static struct dce_aux *dcn32_aux_engine_create(
Signature · 1 line
2.43.0
PATCH 11/15 drm/amd/display: Set up pixel encoding for YCBCR422
In reply to Ray WuFrom: Mario Limonciello <[email protected]>
[Why]fill_stream_properties_from_drm_display_mode() will not configure pixel encoding to YCBCR422 when the DRM color format supports YCBCR422 but not YCBCR420 or YCBCR4444. Instead it will fallback to RGB.
[How]
Add support for YCBCR422 in pixel encoding mapping.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
@@ -6405,6 +6405,9 @@ static void fill_stream_properties_from_drm_display_mode( && aconnector && aconnector->force_yuv420_output) timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR420; + else if ((connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR422) + && stream->signal == SIGNAL_TYPE_HDMI_TYPE_A) + timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR422; else if ((connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR444) && stream->signal == SIGNAL_TYPE_HDMI_TYPE_A) timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR444;
Signature · 1 line
2.43.0
PATCH 12/15 drm/amd/display: Add fallback path for YCBCR422
In reply to Ray WuFrom: Mario Limonciello <[email protected]>
[Why]
DP validation may fail with multiple displays and higher color depths. The sink may support others though.
[How]
When DP bandwidth validation fails, progressively fallback through:
- YUV422 8bpc (bandwidth efficient)
- YUV422 6bpc (reduced color depth)
- YUV420 (last resort)
This resolves cases where displays would show no image due to insufficient DP link bandwidth for the requested RGB mode.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 45 +++++++++++++++---- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 1 + 2 files changed, 37 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +36 -9
@@ -6406,7 +6406,8 @@ static void fill_stream_properties_from_drm_display_mode( && aconnector->force_yuv420_output) timing_out->pixel_encoding =PIXEL_ENCODING_YCBCR420 ; else if ((connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR422) - && stream->signal == SIGNAL_TYPE_HDMI_TYPE_A) + && aconnector + && aconnector->force_yuv422_output) timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR422; else if ((connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR444) && stream->signal == SIGNAL_TYPE_HDMI_TYPE_A)
@@ -7668,6 +7669,7 @@ create_validate_stream_for_sink(struct drm_connector *connector, bpc_limit =8 ; do { + drm_dbg_kms(connector->dev, "Trying with %d bpc\n", requested_bpc); stream = create_stream_for_sink(connector, drm_mode, dm_state, old_stream, requested_bpc);
@@ -7703,16 +7705,41 @@ create_validate_stream_for_sink(struct drm_connector *connector, }while (stream ==NULL && requested_bpc >= bpc_limit); -if ((dc_result ==DC_FAIL_ENC_VALIDATE || - dc_result ==DC_EXCEED_DONGLE_CAP ) && - !aconnector->force_yuv420_output) { -DRM_DEBUG_KMS ("%s:%d Retry forcing yuv420 encoding\n" , - __func__, __LINE__); - - aconnector->force_yuv420_output = true; +switch (dc_result) { +/* +* If we failed to validate DP bandwidth stream with the requested RGB color depth, +* we try to fallback and configure in order: +* YUV422 (8bpc, 6bpc) +* YUV420 (8bpc, 6bpc) +*/ +case DC_FAIL_ENC_VALIDATE : +case DC_EXCEED_DONGLE_CAP : +case DC_NO_DP_LINK_BANDWIDTH : +/* recursively entered twice and already tried both YUV422 and YUV420 */ +if (aconnector->force_yuv422_output && aconnector->force_yuv420_output) +break ; +/* first failure; try YUV422 */ +if (!aconnector->force_yuv422_output) { +drm_dbg_kms (connector->dev,"%s:%d Validation failed with %d, retrying w/ YUV422\n" , + __func__, __LINE__, dc_result); + aconnector->force_yuv422_output = true; +/* recursively entered and YUV422 failed, try YUV420 */ + }else if (!aconnector->force_yuv420_output) { +drm_dbg_kms (connector->dev,"%s:%d Validation failed with %d, retrying w/ YUV420\n" , + __func__, __LINE__, dc_result); + aconnector->force_yuv420_output = true; + } stream =create_validate_stream_for_sink (connector, drm_mode, - dm_state, old_stream); + dm_state, old_stream); + aconnector->force_yuv422_output = false; aconnector->force_yuv420_output = false; +break ; +case DC_OK : +break ; +default : +drm_dbg_kms (connector->dev,"%s:%d Unhandled validation failure %d\n" , + __func__, __LINE__, dc_result); +break ; }return stream;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +1 -0
@@ -794,6 +794,7 @@ struct amdgpu_dm_connector {bool fake_enable;bool force_yuv420_output; +bool force_yuv422_output;struct dsc_preferred_settings dsc_settings;union dp_downstream_port_present mst_downstream_port_present;/* Cached display modes */
Signature · 1 line
2.43.0
PATCH 13/15 drm/amd/display: Add DSC padding for OVT Support
In reply to Ray WuFrom: Relja Vojvodic <[email protected]>
[Why]
-Certain OVT timings require DSC configurations which divide the horizontal active unevenly across DSC slices
-DSC slices must be even, so padding needs to be added to the active to make this possible
-The pixel clock of the HW now needs to be increased to accommodate the extra padded pixels
-To keep the line time the same, the blank of the HW timing needs to be increased as well
[How]
-Calculate h_active padding, h_total padding, and pixel clock based off of the original OVT timing and DSC calculations
-Store these values in the pipe and program HW with these modifications -Added general support for cases where DSC slice config does not evenly split the horizontal active by fixing some slice width calculations -Updated PPS calculations for these cases
--- .../gpu/drm/amd/display/dc/core/dc_resource.c | 35 +++++++--------- .../gpu/drm/amd/display/dc/dc_spl_translate.c | 2 +- .../dc/dml2/dml21/dml21_translation_helper.c | 41 ++++++++----------- .../drm/amd/display/dc/dsc/dcn20/dcn20_dsc.c | 3 +- .../amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 2 +- .../amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 9 ++-- .../gpu/drm/amd/display/dc/inc/core_types.h | 10 ++++- .../gpu/drm/amd/display/dc/link/link_dpms.c | 2 +- .../dc/resource/dcn32/dcn32_resource.c | 2 +- .../dc/resource/dcn401/dcn401_resource.c | 3 ++ 10 files changed, 55 insertions(+), 54 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +14 -21
@@ -95,7 +95,6 @@#define DC_LOGGER \ dc->ctx->logger#define DC_LOGGER_INIT (logger) -#include "dml2/dml2_wrapper.h" #define UNABLE_TO_SPLIT -1
@@ -2149,7 +2148,7 @@ int resource_get_odm_slice_dst_width(struct pipe_ctx *otg_master, h_active = timing->h_addressable + timing->h_border_left + timing->h_border_right + - otg_master->hblank_borrow; + otg_master->dsc_padding_params.dsc_hactive_padding; width = h_active / count;if (otg_master->stream_res.tg)
@@ -4267,39 +4266,33 @@ enum dc_status dc_validate_with_context(struct dc *dc,return res; } +#if defined(CONFIG_DRM_AMD_DC_FP ) +#endif /* CONFIG_DRM_AMD_DC_FP */ +/** -* decide_hblank_borrow - Decides the horizontal blanking borrow value for a given pipe context. +* calculate_timing_params_for_dsc_with_padding - Calculates timing parameters for DSC with padding. * @pipe_ctx: Pointer to the pipe context structure. * -* This function calculates the horizontal blanking borrow value for a given pipe context based on the +* This function calculates the timing parameters for a given pipe context based on the * display stream compression (DSC) configuration. If the horizontal active pixels (hactive) are less -* than the total width of the DSC slices, it sets the hblank_borrow value to the difference. If the -* total horizontal timing minus the hblank_borrow value is less than 32, it resets the hblank_borrow +* than the total width of the DSC slices, it sets the dsc_hactive_padding value to the difference. If the +* total horizontal timing minus the dsc_hactive_padding value is less than 32, it resets the dsc_hactive_padding * value to 0. */ -static void decide_hblank_borrow (struct pipe_ctx *pipe_ctx) +static void calculate_timing_params_for_dsc_with_padding (struct pipe_ctx *pipe_ctx) { -uint32_t hactive; -uint32_t ceil_slice_width;struct dc_stream_state *stream =NULL ;if (!pipe_ctx)return ; stream = pipe_ctx->stream; + pipe_ctx->dsc_padding_params.dsc_hactive_padding =0 ; + pipe_ctx->dsc_padding_params.dsc_htotal_padding =0 ; -if (stream->timing.flags.DSC) { - hactive = stream->timing.h_addressable + stream->timing.h_border_left + stream->timing.h_border_right; +if (stream) + pipe_ctx->dsc_padding_params.dsc_pix_clk_100hz = stream->timing.pix_clk_100hz; -/* Assume if determined slices does not divide Hactive evenly, Hborrow is needed for padding*/ -if (hactive % stream->timing.dsc_cfg.num_slices_h !=0 ) { - ceil_slice_width = (hactive / stream->timing.dsc_cfg.num_slices_h) +1 ; - pipe_ctx->hblank_borrow = ceil_slice_width * stream->timing.dsc_cfg.num_slices_h - hactive; - -if (stream->timing.h_total - hactive - pipe_ctx->hblank_borrow <32 ) - pipe_ctx->hblank_borrow =0 ; - } - } }/**
@@ -4342,7 +4335,7 @@ enum dc_status dc_validate_global_state(/* Decide whether hblank borrow is needed and save it in pipe_ctx */ if (dc->debug.enable_hblank_borrow) -decide_hblank_borrow (pipe_ctx); +calculate_timing_params_for_dsc_with_padding (pipe_ctx); if (dc->res_pool->funcs->patch_unknown_plane_state && pipe_ctx->plane_state &&
drivers/gpu/drm/amd/display/dc/dc_spl_translate.c +1 -1
@@ -128,7 +128,7 @@ void translate_SPL_in_params_from_pipe_ctx(struct pipe_ctx *pipe_ctx, struct spl spl_in->odm_slice_index =resource_get_odm_slice_index (pipe_ctx);// Make spl input basic out info output_size width point to stream h active spl_in->basic_out.output_size.width = - stream->timing.h_addressable + stream->timing.h_border_left + stream->timing.h_border_right + pipe_ctx->hblank_borrow; + stream->timing.h_addressable + stream->timing.h_border_left + stream->timing.h_border_right + pipe_ctx->dsc_padding_params.dsc_hactive_padding;// Make spl input basic out info output_size height point to v active spl_in->basic_out.output_size.height = stream->timing.v_addressable + stream->timing.v_border_bottom + stream->timing.v_border_top;
drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c +18 -23
87 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dsc/dcn20/dcn20_dsc.c +2 -1
@@ -406,9 +406,10 @@ bool dsc_prepare_config(const struct dsc_config *dsc_cfg, struct dsc_reg_values dsc_reg_vals->alternate_ich_encoding_en = dsc_reg_vals->pps.dsc_version_minor ==1 ?0 :1 ; dsc_reg_vals->ich_reset_at_eol = (dsc_cfg->is_odm || dsc_reg_vals->num_slices_h >1 ) ?0xF :0 ; +// Need to find the ceiling value for the slice width + dsc_reg_vals->pps.slice_width = (dsc_cfg->pic_width + dsc_cfg->dc_dsc_cfg.num_slices_h -1 ) / dsc_cfg->dc_dsc_cfg.num_slices_h;// TODO: in addition to validating slice height (pic height must be divisible by slice height), // see what happens when the same condition doesn't apply for slice_width/pic_width. - dsc_reg_vals->pps.slice_width = dsc_cfg->pic_width / dsc_cfg->dc_dsc_cfg.num_slices_h; dsc_reg_vals->pps.slice_height = dsc_cfg->pic_height / dsc_cfg->dc_dsc_cfg.num_slices_v;ASSERT (dsc_reg_vals->pps.slice_height * dsc_cfg->dc_dsc_cfg.num_slices_v == dsc_cfg->pic_height);
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c +1 -1
@@ -1052,7 +1052,7 @@ void dcn32_update_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable) }/* Enable DSC hw block */ - dsc_cfg.pic_width = (stream->timing.h_addressable + pipe_ctx->hblank_borrow + + dsc_cfg.pic_width = (stream->timing.h_addressable + pipe_ctx->dsc_padding_params.dsc_hactive_padding + stream->timing.h_border_left + stream->timing.h_border_right) / opp_cnt; dsc_cfg.pic_height = stream->timing.v_addressable + stream->timing.v_border_top + stream->timing.v_border_bottom; dsc_cfg.pixel_encoding = stream->timing.pixel_encoding;
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c +6 -3
@@ -810,9 +810,12 @@ enum dc_status dcn401_enable_stream_timing(if (dc->hwseq->funcs.PLAT_58856_wa && (!dc_is_dp_signal (stream->signal))) dc->hwseq->funcs.PLAT_58856_wa (context, pipe_ctx); -/* if we are borrowing from hblank, h_addressable needs to be adjusted */ -if (dc->debug.enable_hblank_borrow) - patched_crtc_timing.h_addressable = patched_crtc_timing.h_addressable + pipe_ctx->hblank_borrow; +/* if we are padding, h_addressable needs to be adjusted */ +if (dc->debug.enable_hblank_borrow) { + patched_crtc_timing.h_addressable = patched_crtc_timing.h_addressable + pipe_ctx->dsc_padding_params.dsc_hactive_padding; + patched_crtc_timing.h_total = patched_crtc_timing.h_total + pipe_ctx->dsc_padding_params.dsc_htotal_padding; + patched_crtc_timing.pix_clk_100hz = pipe_ctx->dsc_padding_params.dsc_pix_clk_100hz; + } pipe_ctx->stream_res.tg->funcs->program_timing( pipe_ctx->stream_res.tg,
drivers/gpu/drm/amd/display/dc/inc/core_types.h +8 -2
@@ -437,6 +437,13 @@ enum p_state_switch_method { P_STATE_V_BLANK_SUB_VP, }; +struct dsc_padding_params { +/* pixels borrowed from hblank to hactive */ +uint8_t dsc_hactive_padding; +uint32_t dsc_htotal_padding; +uint32_t dsc_pix_clk_100hz; +}; +struct pipe_ctx {struct dc_plane_state *plane_state;struct dc_stream_state *stream;
@@ -494,8 +501,7 @@ struct pipe_ctx {/* subvp_index: only valid if the pipe is a SUBVP_MAIN*/ uint8_t subvp_index;struct pixel_rate_divider pixel_rate_divider; -/* pixels borrowed from hblank to hactive */ -uint8_t hblank_borrow; +struct dsc_padding_params dsc_padding_params;/* next vupdate */ uint32_t next_vupdate;uint32_t wait_frame_count;
drivers/gpu/drm/amd/display/dc/link/link_dpms.c +1 -1
@@ -832,7 +832,7 @@ void link_set_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable)enum optc_dsc_mode optc_dsc_mode;/* Enable DSC hw block */ - dsc_cfg.pic_width = (stream->timing.h_addressable + pipe_ctx->hblank_borrow + + dsc_cfg.pic_width = (stream->timing.h_addressable + pipe_ctx->dsc_padding_params.dsc_hactive_padding + stream->timing.h_border_left + stream->timing.h_border_right) / opp_cnt; dsc_cfg.pic_height = stream->timing.v_addressable + stream->timing.v_border_top + stream->timing.v_border_bottom; dsc_cfg.pixel_encoding = stream->timing.pixel_encoding;
drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c +1 -1
@@ -2853,7 +2853,7 @@ struct pipe_ctx *dcn32_acquire_free_pipe_as_secondary_opp_head( free_pipe->plane_res.xfm = pool->transforms[free_pipe_idx]; free_pipe->plane_res.dpp = pool->dpps[free_pipe_idx]; free_pipe->plane_res.mpcc_inst = pool->dpps[free_pipe_idx]->inst; - free_pipe->hblank_borrow = otg_master->hblank_borrow; + free_pipe->dsc_padding_params = otg_master->dsc_padding_params;if (free_pipe->stream->timing.flags.DSC ==1 ) { dcn20_acquire_dsc(free_pipe->stream->ctx->dc, &new_ctx->res_ctx,
drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c +3 -0
@@ -1699,6 +1699,9 @@ static void dcn401_build_pipe_pix_clk_params(struct pipe_ctx *pipe_ctx) pixel_clk_params->requested_pix_clk_100hz = stream->timing.pix_clk_100hz; +if (pipe_ctx->dsc_padding_params.dsc_hactive_padding !=0 ) + pixel_clk_params->requested_pix_clk_100hz = pipe_ctx->dsc_padding_params.dsc_pix_clk_100hz; +if (!pipe_ctx->stream->ctx->dc->config.unify_link_enc_assignment) link_enc =link_enc_cfg_get_link_enc (link);if (link_enc)
Signature · 1 line
2.43.0
PATCH 14/15 Revert "drm/amd/display: Reduce Stack Usage by moving 'audio_output' into 'stream_res' v4"
In reply to Ray WuFrom: Martin Leung <[email protected]>
This reverts commit 571662266db3 ("drm/amd/display: Reduce Stack Usage by moving 'audio_output' into 'stream_res' v4")
Reason for revert: Causes DP compliance errors
--- .../amd/display/dc/hwss/dce110/dce110_hwseq.c | 32 +++++++++++-------- .../gpu/drm/amd/display/dc/inc/core_types.h | 5 ++- .../display/dc/link/accessories/link_dp_cts.c | 13 ++++---- .../dc/resource/dcn31/dcn31_resource.c | 5 +-- .../dc/resource/dcn31/dcn31_resource.h | 3 +- 5 files changed, 31 insertions(+), 27 deletions(-)
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +18 -14
@@ -1601,17 +1601,19 @@ enum dc_status dce110_apply_single_controller_ctx_to_hw( }if (pipe_ctx->stream_res.audio !=NULL ) { -build_audio_output (context, pipe_ctx, &pipe_ctx->stream_res.audio_output); +struct audio_output audio_output = {0 }; - link_hwss->setup_audio_output (pipe_ctx, &pipe_ctx->stream_res.audio_output, +build_audio_output (context, pipe_ctx, &audio_output); + + link_hwss->setup_audio_output (pipe_ctx, &audio_output, pipe_ctx->stream_res.audio->inst); pipe_ctx->stream_res.audio->funcs->az_configure ( pipe_ctx->stream_res.audio, pipe_ctx->stream->signal, - &pipe_ctx->stream_res.audio_output.crtc_info, + &audio_output.crtc_info, &pipe_ctx->stream->audio_info, - &pipe_ctx->stream_res.audio_output.dp_link_info); + &audio_output.dp_link_info);if (dc->config.disable_hbr_audio_dp2) if (pipe_ctx->stream_res.audio->funcs->az_disable_hbr_audio &&
@@ -2385,7 +2387,9 @@ static void dce110_setup_audio_dto(if (pipe_ctx->stream->signal !=SIGNAL_TYPE_HDMI_TYPE_A )continue ;if (pipe_ctx->stream_res.audio !=NULL ) { -build_audio_output (context, pipe_ctx, &pipe_ctx->stream_res.audio_output); +struct audio_output audio_output; + +build_audio_output (context, pipe_ctx, &audio_output);if (dc->res_pool->dccg && dc->res_pool->dccg->funcs->set_audio_dtbclk_dto) {struct dtbclk_dto_params dto_params = {0 };
@@ -2396,14 +2400,14 @@ static void dce110_setup_audio_dto( pipe_ctx->stream_res.audio->funcs->wall_dto_setup ( pipe_ctx->stream_res.audio, pipe_ctx->stream->signal, - &pipe_ctx->stream_res.audio_output.crtc_info, - &pipe_ctx->stream_res.audio_output.pll_info); + &audio_output.crtc_info, + &audio_output.pll_info); }else pipe_ctx->stream_res.audio->funcs->wall_dto_setup ( pipe_ctx->stream_res.audio, pipe_ctx->stream->signal, - &pipe_ctx->stream_res.audio_output.crtc_info, - &pipe_ctx->stream_res.audio_output.pll_info); + &audio_output.crtc_info, + &audio_output.pll_info);break ; } }
@@ -2423,15 +2427,15 @@ static void dce110_setup_audio_dto(continue ;if (pipe_ctx->stream_res.audio !=NULL ) { -build_audio_output (context, - pipe_ctx, - &pipe_ctx->stream_res.audio_output); +struct audio_output audio_output = {0 }; + +build_audio_output (context, pipe_ctx, &audio_output); pipe_ctx->stream_res.audio->funcs->wall_dto_setup ( pipe_ctx->stream_res.audio, pipe_ctx->stream->signal, - &pipe_ctx->stream_res.audio_output.crtc_info, - &pipe_ctx->stream_res.audio_output.pll_info); + &audio_output.crtc_info, + &audio_output.pll_info);break ; } }
drivers/gpu/drm/amd/display/dc/inc/core_types.h +2 -3
@@ -228,7 +228,8 @@ struct resource_funcs {enum dc_status (*update_dc_state_for_encoder_switch)(struct dc_link *link,struct dc_link_settings *link_setting,uint8_t pipe_count, -struct pipe_ctx *pipes); +struct pipe_ctx *pipes, +struct audio_output *audio_output); };struct audio_support {
@@ -360,8 +361,6 @@ struct stream_resource {uint8_t gsl_group;struct test_pattern_params test_pattern_params; - -struct audio_output audio_output; };struct plane_resource {
drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_cts.c +6 -7
@@ -75,7 +75,7 @@ static void dp_retrain_link_dp_test(struct dc_link *link,bool is_hpo_acquired;uint8_t count;int i; - +struct audio_output audio_output[MAX_PIPES ];struct dc_stream_state *streams_on_link[MAX_PIPES ];int num_streams_on_link =0 ;
@@ -101,7 +101,7 @@ static void dp_retrain_link_dp_test(struct dc_link *link,if (needs_divider_update && link->dc->res_pool->funcs->update_dc_state_for_encoder_switch) { link->dc->res_pool->funcs->update_dc_state_for_encoder_switch (link, link_setting, count, - *pipes); + *pipes, &audio_output[0 ]);for (i =0 ; i < count; i++) { pipes[i]->clock_source->funcs->program_pix_clk( pipes[i]->clock_source,
@@ -113,16 +113,15 @@ static void dp_retrain_link_dp_test(struct dc_link *link,const struct link_hwss *link_hwss =get_link_hwss ( link, &pipes[i]->link_res); - link_hwss->setup_audio_output (pipes[i], - &pipes[i]->stream_res.audio_output, - pipes[i]->stream_res.audio->inst); + link_hwss->setup_audio_output (pipes[i], &audio_output[i], + pipes[i]->stream_res.audio->inst); pipes[i]->stream_res.audio->funcs->az_configure ( pipes[i]->stream_res.audio, pipes[i]->stream->signal, - &pipes[i]->stream_res.audio_output.crtc_info, + &audio_output[i].crtc_info, &pipes[i]->stream->audio_info, - &pipes[i]->stream_res.audio_output.dp_link_info); + &audio_output[i].dp_link_info); if (link->dc->config.disable_hbr_audio_dp2 && pipes[i]->stream_res.audio->funcs->az_disable_hbr_audio &&
drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c +3 -2
@@ -2239,7 +2239,8 @@ struct resource_pool *dcn31_create_resource_pool(enum dc_status dcn31_update_dc_state_for_encoder_switch (struct dc_link *link,struct dc_link_settings *link_setting,uint8_t pipe_count, -struct pipe_ctx *pipes) +struct pipe_ctx *pipes, +struct audio_output *audio_output) {struct dc_state *state = link->dc->current_state;int i;
@@ -2254,7 +2255,7 @@ enum dc_status dcn31_update_dc_state_for_encoder_switch(struct dc_link *link,// Setup audio if (pipes[i].stream_res.audio !=NULL ) - build_audio_output(state, &pipes[i], &pipes[i].stream_res.audio_output); + build_audio_output(state, &pipes[i], &audio_output[i]); }#else /* This DCN requires rate divider updates and audio reprogramming to allow DP1<-->DP2 link rate switching,
drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.h +2 -1
@@ -69,7 +69,8 @@ unsigned int dcn31_get_det_buffer_size(enum dc_status dcn31_update_dc_state_for_encoder_switch (struct dc_link *link,struct dc_link_settings *link_setting,uint8_t pipe_count, -struct pipe_ctx *pipes); +struct pipe_ctx *pipes, +struct audio_output *audio_output);/*temp: B0 specific before switch to dcn313 headers*/ #ifndef regPHYPLLF_PIXCLK_RESYNC_CNTL
Signature · 1 line
2.43.0
PATCH 15/15 drm/amd/display: Promote DC to 3.2.350
In reply to Ray WuFrom: Taimur Hassan <[email protected]>
This version brings along following updates:
- Add DSC padding for OVT support
- Setup pixel encoding for YCBCR422
- Fix dml ms order
- Rename header file link.h to link_service.h
- Fix DMUB loading sequence
- Modify link training policy
--- 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.349" +#define DC_VER "3.2.350"/** * MAX_SURFACES - representative of the upper bound of surfaces that can be piped to a single CRTC
Signature · 1 line
2.43.0