DC Patches August 27 ,2022
cover DC Patches August 27 ,2022
This DC patchset brings improvements in multiple areas. In summary, we have:
* Correct cursor position on horizontal mirror;
* Fix black flash when switching from ODM2to1 to ODMBypass;
* Fix plane and stream check;
* Fix viewport after pipe merge;
* Correct plane for CAB cursor;
* Fix comment to correct visual confirm option;
* Fix SubVP related regression;
* Fix primary EDP link detection;
* Fix wrong register access;
* Fix cursor size allocation for DCN32/321;
* Fix display fresh edge case from MALL for DCN321;
* Add HPO instance;
* Refactor EDP codes;
* Add SubVP scaling case;
* Add support for visual confirm color;
* Fix PHY state update;
* Cleanup PSR flag;
* Fix cursor lag with PSR1 eDP;
* Add DC debug optioon for LTTPR mode;
* Add override flag for some dongle;
* Fix SubVP state after pipe programming;
* Remove assert from PHY state update;
* Fix dig fifo read level before reset;
* Add dcn35 basic suppoet;
* Fix OTG H timming for dcn314;
* Fix aux transaction;
* Fix DCN32 DPSTREAMCLK_CNTL programming;
* Fix SubVP scheduling issues;
* Set ODM policy.
Alvin Lee (3):
drm/amd/display: Don't choose SubVP display if ActiveMargin > 0 drm/amd/display: Only commit SubVP state after pipe programming drm/amd/display: SubVP missing scaling case
Anthony Koo (1):
drm/amd/display: [FW Promotion] Release 0.0.132.0
Aric Cyr (1):
drm/amd/display: 3.2.201
Aurabindo Pillai (5):
drm/amd/display: Fix CAB cursor size allocation for DCN32/321 drm/amd/display: disable display fresh from MALL on an edge case for
DCN321
drm/amd/display: use actual cursor size instead of max for CAB
allocation
drm/amd/display: Revert "program k1/k2 divider for virtual signal for
DCN32"drm/amd/display: Use correct plane for CAB cursor size allocation
Charlene Liu (2):
drm/amd/display: add dcn35 basic support
drm/amd/display: fix wrong register access
Chen, Leo (1):
drm/amd/display: add a override flag as wa for some specific dongle
Duncan Ma (1):
drm/amd/display: Fix OTG H timing reset for dcn314
Ethan Wellenreiter (2):
drm/amd/display: Re-initialize viewport after pipe merge drm/amd/display: Fix check for stream and plane
Gabe Teeger (2):
drm/amd/display: Cursor lag with PSR1 eDP
drm/amd/display: Cleanup PSR flag
George Shen (1):
drm/amd/display: Fix DCN32 DPSTREAMCLK_CNTL programming
Ian Chen (2):
drm/amd/display: Refactor edp dsc codes.
drm/amd/display: Add comments.
Iswara Nagulendran (1):
drm/amd/display: Fix primary EDP link detection
Leo (Hanghong) Ma (2):
drm/amd/display: Add visual confirm color support for SubVP drm/amd/display: Add support for visual confirm color
Leo Chen (1):
drm/amd/display: Missing HPO instance added
Lewis Huang (1):
drm/amd/display: Refine aux transaction before retrieve caps
Martin Tsai (1):
drm/amd/display: Correct cursor position on horizontal mirror
Michael Strauss (1):
drm/amd/display: Add DC debug option to force LTTPR mode
Taimur Hassan (3):
drm/amd/display: Set ODM policy based on number of DSC slices drm/amd/display: Remove assert from PHY state update drm/amd/display: Allow PHY state update between same states
Vladimir Stempen (1):
drm/amd/display: Fix black flash when switching from ODM2to1 to
ODMBypass
Wang Fudong (1):
drm/amd/display: set dig fifo read start level to 7 before dig fifo
reset
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 19 +++++ .../drm/amd/display/dc/clk_mgr/Makefile.rej | 17 ++++ drivers/gpu/drm/amd/display/dc/core/dc.c | 26 +++--- .../drm/amd/display/dc/core/dc_hw_sequencer.c | 38 +++++++++ drivers/gpu/drm/amd/display/dc/core/dc_link.c | 22 ++--- .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 53 +++++++++--- drivers/gpu/drm/amd/display/dc/dc.h | 8 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 41 ++++++++- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 1 + drivers/gpu/drm/amd/display/dc/dc_link.h | 12 +++ drivers/gpu/drm/amd/display/dc/dce/dce_abm.h | 9 +- .../display/dc/dce110/dce110_hw_sequencer.c | 13 +++ .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c | 5 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 9 +- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 83 +++++++++++++------ .../display/dc/dcn10/dcn10_stream_encoder.h | 1 + .../gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c | 9 +- .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 6 +- .../gpu/drm/amd/display/dc/dcn30/dcn30_dpp.h | 3 +- .../display/dc/dcn31/dcn31_dio_link_encoder.c | 3 + .../dc/dcn31/dcn31_hpo_dp_link_encoder.h | 10 ++- .../drm/amd/display/dc/dcn31/dcn31_resource.c | 1 - .../dc/dcn314/dcn314_dio_stream_encoder.c | 1 + .../drm/amd/display/dc/dcn314/dcn314_optc.c | 3 +- .../amd/display/dc/dcn314/dcn314_resource.c | 2 +- .../amd/display/dc/dcn315/dcn315_resource.c | 1 - .../amd/display/dc/dcn316/dcn316_resource.c | 1 - .../gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c | 8 +- .../dc/dcn32/dcn32_dio_stream_encoder.c | 5 ++ .../drm/amd/display/dc/dcn32/dcn32_hwseq.c | 75 ++++++++++++----- .../display/dc/dcn32/dcn32_resource_helpers.c | 2 +- drivers/gpu/drm/amd/display/dc/dm_helpers.h | 7 +- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 36 +++++++- .../dc/dml/dcn32/display_mode_vba_32.c | 4 +- .../dc/dml/dcn32/display_mode_vba_util_32.c | 7 +- .../dc/dml/dcn32/display_mode_vba_util_32.h | 1 + .../drm/amd/display/dc/dml/display_mode_vba.h | 1 + .../gpu/drm/amd/display/dc/inc/hw_sequencer.h | 5 ++ .../amd/display/dc/link/link_hwss_hpo_dp.c | 4 +- drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 4 +- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 47 ++++++++++- .../gpu/drm/amd/display/include/dal_types.h | 1 + 43 files changed, 469 insertions(+), 139 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile.rej
Signature · 1 line
2.25.1
PATCH 1/33 drm/amd/display: Set ODM policy based on number of DSC slices
From: Taimur Hassan <[email protected]>
[Why & How]
Add addtional check in CalculateODMMode for cases where the ODM combine is needed due to number of DSC slices.
--- .../gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c | 2 ++ .../amd/display/dc/dml/dcn32/display_mode_vba_util_32.c | 7 +++++-- .../amd/display/dc/dml/dcn32/display_mode_vba_util_32.h | 1 + 3 files changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c +2 -0
@@ -2045,6 +2045,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l mode_lib->vba.DISPCLKDPPCLKDSCCLKDownSpreading, mode_lib->vba.DISPCLKRampingMargin, mode_lib->vba.DISPCLKDPPCLKVCOSpeed, + mode_lib->vba.NumberOfDSCSlices[k],/* Output */ &v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.TotalAvailablePipesSupportNoDSC,
@@ -2066,6 +2067,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l mode_lib->vba.DISPCLKDPPCLKDSCCLKDownSpreading, mode_lib->vba.DISPCLKRampingMargin, mode_lib->vba.DISPCLKDPPCLKVCOSpeed, + mode_lib->vba.NumberOfDSCSlices[k],/* Output */ &v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.TotalAvailablePipesSupportDSC,
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c +5 -2
@@ -1193,6 +1193,7 @@ void dml32_CalculateODMMode(double DISPCLKDPPCLKDSCCLKDownSpreading, double DISPCLKRampingMargin, double DISPCLKDPPCLKVCOSpeed, + unsigned int NumberOfDSCSlices,/* Output */ bool *TotalAvailablePipesSupport,
@@ -1228,7 +1229,8 @@ void dml32_CalculateODMMode(if (!(Output == dm_hdmi || Output == dm_dp || Output == dm_edp) && (ODMUse == dm_odm_combine_policy_4to1 || ((SurfaceRequiredDISPCLKWithODMCombineTwoToOne > StateDispclk || - (DSCEnable && (HActive >2 * MaximumPixelsPerLinePerDSCUnit)))))) { + (DSCEnable && (HActive >2 * MaximumPixelsPerLinePerDSCUnit)) + || NumberOfDSCSlices >8 )))) {if (TotalNumberOfActiveDPP +4 <= MaxNumDPP) { *ODMMode = dm_odm_combine_mode_4to1; *RequiredDISPCLKPerSurface = SurfaceRequiredDISPCLKWithODMCombineFourToOne;
@@ -1239,7 +1241,8 @@ void dml32_CalculateODMMode( }else if (Output != dm_hdmi && (ODMUse == dm_odm_combine_policy_2to1 || (((SurfaceRequiredDISPCLKWithoutODMCombine > StateDispclk && SurfaceRequiredDISPCLKWithODMCombineTwoToOne <= StateDispclk) || - (DSCEnable && (HActive > MaximumPixelsPerLinePerDSCUnit)))))) { + (DSCEnable && (HActive > MaximumPixelsPerLinePerDSCUnit)) + || (NumberOfDSCSlices <=8 && NumberOfDSCSlices >4 ))))) {if (TotalNumberOfActiveDPP +2 <= MaxNumDPP) { *ODMMode = dm_odm_combine_mode_2to1; *RequiredDISPCLKPerSurface = SurfaceRequiredDISPCLKWithODMCombineTwoToOne;
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.h +1 -0
@@ -226,6 +226,7 @@ void dml32_CalculateODMMode(double DISPCLKDPPCLKDSCCLKDownSpreading, double DISPCLKRampingMargin, double DISPCLKDPPCLKVCOSpeed, + unsigned int NumberOfDSCSlices,/* Output */ bool *TotalAvailablePipesSupport,
Signature · 1 line
2.25.1
PATCH 2/33 drm/amd/display: Don't choose SubVP display if ActiveMargin > 0
In reply to brichangFrom: Alvin Lee <[email protected]>
[Description]
There can be SubVP scheduling issues if a SubVP display is chosen has ActiveDramClockChangeLatency > 0. Block this case for now, and enable Vactive case (later) to handle this.
--- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 21 ++++++++++++++++--- .../dc/dml/dcn32/display_mode_vba_32.c | 2 +- .../drm/amd/display/dc/dml/display_mode_vba.h | 1 + 3 files changed, 20 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +18 -3
@@ -560,6 +560,7 @@ static bool dcn32_assign_subvp_pipe(struct dc *dc,bool valid_assignment_found = false;unsigned int free_pipes =dcn32_get_num_free_pipes (dc, context);bool current_assignment_freesync = false; +struct vba_vars_st *vba = &context->bw_ctx.dml.vba;for (i =0 , pipe_idx =0 ; i < dc->res_pool->pipe_count; i++) {struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
@@ -573,8 +574,15 @@ static bool dcn32_assign_subvp_pipe(struct dc *dc, refresh_rate = (pipe->stream->timing.pix_clk_100hz *100 + pipe->stream->timing.v_total * pipe->stream->timing.h_total -1 ) / (double )(pipe->stream->timing.v_total * pipe->stream->timing.h_total); +/* SubVP pipe candidate requirements: +* - Refresh rate < 120hz +* - Not able to switch in vactive naturally (switching in active means the +* DET provides enough buffer to hide the P-State switch latency -- trying +* to combine this with SubVP can cause issues with the scheduling). +*/ if (pipe->plane_state && !pipe->top_pipe && - pipe->stream->mall_stream_config.type ==SUBVP_NONE && refresh_rate <120 ) { + pipe->stream->mall_stream_config.type ==SUBVP_NONE && refresh_rate <120 && + vba->ActiveDRAMClockChangeLatencyMarginPerState[vba->VoltageLevel][vba->maxMpcComb][vba->pipe_plane[pipe_idx]] <=0 ) {while (pipe) { num_pipes++; pipe = pipe->bottom_pipe;
@@ -998,8 +1006,10 @@ static void dcn32_full_validate_bw_helper(struct dc *dc, *vlevel =dml_get_voltage_level (&context->bw_ctx.dml, pipes, *pipe_cnt);/* This may adjust vlevel and maxMpcComb */ -if (*vlevel < context->bw_ctx.dml.soc.num_states) +if (*vlevel < context->bw_ctx.dml.soc.num_states) { *vlevel =dcn20_validate_apply_pipe_split_flags (dc, context, *vlevel, split, merge); + vba->VoltageLevel = *vlevel; + }/* Conditions for setting up phantom pipes for SubVP: * 1. Not force disable SubVP
@@ -1085,13 +1095,16 @@ static void dcn32_full_validate_bw_helper(struct dc *dc, *vlevel =dml_get_voltage_level (&context->bw_ctx.dml, pipes, *pipe_cnt);/* This may adjust vlevel and maxMpcComb */ -if (*vlevel < context->bw_ctx.dml.soc.num_states) +if (*vlevel < context->bw_ctx.dml.soc.num_states) { *vlevel =dcn20_validate_apply_pipe_split_flags (dc, context, *vlevel, split, merge); + vba->VoltageLevel = *vlevel; + } }else {// only call dcn20_validate_apply_pipe_split_flags if we found a supported config memset (split,0 ,MAX_PIPES *sizeof (int ));memset (merge,0 ,MAX_PIPES *sizeof (bool )); *vlevel =dcn20_validate_apply_pipe_split_flags (dc, context, *vlevel, split, merge); + vba->VoltageLevel = *vlevel;// Most populate phantom DLG params before programming hardware / timing for phantom pipe DC_FP_START ();
@@ -1421,6 +1434,8 @@ bool dcn32_internal_validate_bw(struct dc *dc,memset (split,0 ,sizeof (split));memset (merge,0 ,sizeof (merge)); vlevel =dcn20_validate_apply_pipe_split_flags (dc, context, vlevel, split, merge); +// dcn20_validate_apply_pipe_split_flags can modify voltage level outside of DML + vba->VoltageLevel = vlevel; } }
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c +1 -1
@@ -3617,7 +3617,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l &mode_lib->vba.FCLKChangeSupport[i][j], &v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.dummy_single2[1 ],// double *MinActiveFCLKChangeLatencySupported &mode_lib->vba.USRRetrainingSupport[i][j], - mode_lib->vba.ActiveDRAMClockChangeLatencyMargin); + mode_lib->vba.ActiveDRAMClockChangeLatencyMarginPerState[i][j]); } } }// End of Prefetch Check
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h +1 -0
@@ -312,6 +312,7 @@ struct vba_vars_st {unsigned int ActiveDPPs;unsigned int LBLatencyHidingSourceLinesY;unsigned int LBLatencyHidingSourceLinesC; +double ActiveDRAMClockChangeLatencyMarginPerState[DC__VOLTAGE_STATES ][2 ][DC__NUM_DPP__MAX ];// DML doesn't save active margin per state double ActiveDRAMClockChangeLatencyMargin[DC__NUM_DPP__MAX ];double CachedActiveDRAMClockChangeLatencyMargin[DC__NUM_DPP__MAX ];// Cache in dml_get_voltage_level for debug purposes only double MinActiveDRAMClockChangeMargin;
Signature · 1 line
2.25.1
PATCH 3/33 drm/amd/display: Fix DCN32 DPSTREAMCLK_CNTL programming
In reply to brichangFrom: George Shen <[email protected]>
[Why]
Each index in the DPSTREAMCLK_CNTL register phyiscally maps 1-to-1 with HPO stream encoder instance. On the other hand, each index in DTBCLK_P_CNTL physically maps 1-to-1 with OTG instance.
Current DCN32 DPSTREAMCLK_CLK programing assumes that OTG instance always maps 1-to-1 with
HPO stream encoder instance. This is not always guaranteed and can result in blackscreen.
[How]
Program the correct dpstreamclk instance with the correct dtbclk_p source.
--- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c | 8 ++++---- drivers/gpu/drm/amd/display/dc/link/link_hwss_hpo_dp.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c +4 -4
@@ -225,19 +225,19 @@ void dccg32_set_dpstreamclk(case 0 :REG_UPDATE_2 (DPSTREAMCLK_CNTL ,DPSTREAMCLK0_EN , - (src ==REFCLK ) ?0 :1 ,DPSTREAMCLK0_SRC_SEL ,0 ); + (src ==REFCLK ) ?0 :1 ,DPSTREAMCLK0_SRC_SEL , otg_inst);break ;case 1 :REG_UPDATE_2 (DPSTREAMCLK_CNTL ,DPSTREAMCLK1_EN , - (src ==REFCLK ) ?0 :1 ,DPSTREAMCLK1_SRC_SEL ,1 ); + (src ==REFCLK ) ?0 :1 ,DPSTREAMCLK1_SRC_SEL , otg_inst);break ;case 2 :REG_UPDATE_2 (DPSTREAMCLK_CNTL ,DPSTREAMCLK2_EN , - (src ==REFCLK ) ?0 :1 ,DPSTREAMCLK2_SRC_SEL ,2 ); + (src ==REFCLK ) ?0 :1 ,DPSTREAMCLK2_SRC_SEL , otg_inst);break ;case 3 :REG_UPDATE_2 (DPSTREAMCLK_CNTL ,DPSTREAMCLK3_EN , - (src ==REFCLK ) ?0 :1 ,DPSTREAMCLK3_SRC_SEL ,3 ); + (src ==REFCLK ) ?0 :1 ,DPSTREAMCLK3_SRC_SEL , otg_inst);break ;default :BREAK_TO_DEBUGGER ();
drivers/gpu/drm/amd/display/dc/link/link_hwss_hpo_dp.c +2 -2
@@ -116,7 +116,7 @@ static void setup_hpo_dp_stream_encoder(struct pipe_ctx *pipe_ctx) dto_params.timing = &pipe_ctx->stream->timing; dto_params.ref_dtbclk_khz = dc->clk_mgr->funcs->get_dtb_ref_clk_frequency (dc->clk_mgr); - dccg->funcs->set_dpstreamclk (dccg,DTBCLK0 , tg->inst, link_enc->inst); + dccg->funcs->set_dpstreamclk (dccg,DTBCLK0 , tg->inst, stream_enc->inst); dccg->funcs->enable_symclk32_se (dccg, stream_enc->inst, phyd32clk); dccg->funcs->set_dtbclk_dto (dccg, &dto_params); stream_enc->funcs->enable_stream (stream_enc);
@@ -137,7 +137,7 @@ static void reset_hpo_dp_stream_encoder(struct pipe_ctx *pipe_ctx) stream_enc->funcs->disable (stream_enc); dccg->funcs->set_dtbclk_dto (dccg, &dto_params); dccg->funcs->disable_symclk32_se (dccg, stream_enc->inst); - dccg->funcs->set_dpstreamclk (dccg,REFCLK , tg->inst, pipe_ctx->link_res.hpo_dp_link_enc->inst); + dccg->funcs->set_dpstreamclk (dccg,REFCLK , tg->inst, stream_enc->inst); }static void setup_hpo_dp_stream_attribute (struct pipe_ctx *pipe_ctx)
Signature · 1 line
2.25.1
PATCH 4/33 drm/amd/display: Refine aux transaction before retrieve caps
In reply to brichangFrom: Lewis Huang <[email protected]>
[Why]
LTTPR caps will read fail if aux channel is not active.
[How]
1.Perform 600 read upto 10 retry with 1ms delay in between. 2.If fail, return false and trigger another retry detection. 3.If pass, read LTTPR caps in retrieve link caps.
--- .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 45 ++++++++++++++----- 1 file changed, 34 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +34 -11
@@ -5275,6 +5275,7 @@ static bool retrieve_link_cap(struct dc_link *link)union dp_downstream_port_present ds_port = {0 };enum dc_status status =DC_ERROR_UNEXPECTED ;uint32_t read_dpcd_retry_cnt =3 ; +uint32_t aux_channel_retry_cnt =0 ;int i;struct dp_sink_hw_fw_revision dp_hw_fw_revision;const uint32_t post_oui_delay =30 ;// 30ms
@@ -5302,21 +5303,43 @@ static bool retrieve_link_cap(struct dc_link *link) status =wa_try_to_wake_dprx (link, timeout_ms); } +while (status !=DC_OK && aux_channel_retry_cnt <10 ) { + status =core_link_read_dpcd (link,DP_SET_POWER , + &dpcd_power_state,sizeof (dpcd_power_state)); + +/* Delay 1 ms if AUX CH is in power down state. Based on spec +* section 2.3.1.2, if AUX CH may be powered down due to +* write to DPCD 600h = 2. Sink AUX CH is monitoring differential +* signal and may need up to 1 ms before being able to reply. +*/ +if (status !=DC_OK || dpcd_power_state ==DP_SET_POWER_D3 ) { +udelay (1000 ); + aux_channel_retry_cnt++; + } + } + +/* If aux channel is not active, return false and trigger another detect*/ +if (status !=DC_OK ) { + dpcd_power_state =DP_SET_POWER_D0 ; + status =core_link_write_dpcd ( + link, +DP_SET_POWER , + &dpcd_power_state, +sizeof (dpcd_power_state)); + + dpcd_power_state =DP_SET_POWER_D3 ; + status =core_link_write_dpcd ( + link, +DP_SET_POWER , + &dpcd_power_state, +sizeof (dpcd_power_state)); +return false; + } + is_lttpr_present =dp_retrieve_lttpr_cap (link);/* Read DP tunneling information. */ status =dpcd_get_tunneling_device_data (link); - status =core_link_read_dpcd (link,DP_SET_POWER , - &dpcd_power_state,sizeof (dpcd_power_state)); - -/* Delay 1 ms if AUX CH is in power down state. Based on spec -* section 2.3.1.2, if AUX CH may be powered down due to -* write to DPCD 600h = 2. Sink AUX CH is monitoring differential -* signal and may need up to 1 ms before being able to reply. -*/ -if (status !=DC_OK || dpcd_power_state ==DP_SET_POWER_D3 ) -udelay (1000 ); -dpcd_set_source_specific_data (link);/* Sink may need to configure internals based on vendor, so allow some * time before proceeding with possibly vendor specific transactions
Signature · 1 line
2.25.1
PATCH 5/33 drm/amd/display: Fix OTG H timing reset for dcn314
In reply to brichangFrom: Duncan Ma <[email protected]>
[Why]
When ODM is enabled, H timing control register reset to 0. Div mode manual field get overwritten causing no display on certain modes for dcn314.
[How]
Use REG_UPDATE instead of REG_SET to set div_mode
field.
--- drivers/gpu/drm/amd/display/dc/dcn314/dcn314_optc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_optc.c +2 -1
@@ -98,7 +98,8 @@ static void optc314_set_odm_combine(struct timing_generator *optc, int *opp_id,REG_UPDATE (OPTC_WIDTH_CONTROL ,OPTC_SEGMENT_WIDTH , mpcc_hactive); -REG_SET (OTG_H_TIMING_CNTL ,0 ,OTG_H_TIMING_DIV_MODE , opp_cnt -1 ); +REG_UPDATE (OTG_H_TIMING_CNTL , +OTG_H_TIMING_DIV_MODE , opp_cnt -1 ); optc1->opp_count = opp_cnt; }
Signature · 1 line
2.25.1
PATCH 6/33 drm/amd/display: add dcn35 basic support
In reply to brichangFrom: Charlene Liu <[email protected]>
[why]
this is to add new dcn frame work
--- .../gpu/drm/amd/display/dc/clk_mgr/Makefile.rej | 17 +++++++++++++++++ drivers/gpu/drm/amd/display/dc/dce/dce_abm.h | 9 ++++++--- .../amd/display/dc/dcn10/dcn10_stream_encoder.h | 1 + .../gpu/drm/amd/display/dc/dcn30/dcn30_dpp.h | 3 ++- .../dc/dcn31/dcn31_hpo_dp_link_encoder.h | 10 ++++++++-- drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 3 ++- drivers/gpu/drm/amd/display/include/dal_types.h | 1 + 7 files changed, 37 insertions(+), 7 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile.rej
drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile.rej new file +17 -0
@@ -0,0 +1,17 @@ +diff a/drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile b/drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile (rejected hunks) +@@ -160,6 +160,15 @@ AMD_DAL_CLK_MGR_DCN32 = $(addprefix $(AMDDALPATH)/dc/clk_mgr/dcn32/,$(CLK_MGR_DC + + AMD_DISPLAY_FILES += $(AMD_DAL_CLK_MGR_DCN32) + ++ ++############################################################################### ++# DCN35 ++############################################################################### ++CLK_MGR_DCN35 = dcn35_smu.o dcn35_clk_mgr.o ++ ++AMD_DAL_CLK_MGR_DCN35 = $(addprefix $(AMDDALPATH)/dc/clk_mgr/dcn35/,$(CLK_MGR_DCN35)) ++ ++AMD_DISPLAY_FILES += $(AMD_DAL_CLK_MGR_DCN35) + ############################################################################### + # DCN3AG + ###############################################################################
drivers/gpu/drm/amd/display/dc/dce/dce_abm.h +6 -3
@@ -183,8 +183,7 @@ABM_SF (DC_ABM1_HGLS_REG_READ_PROGRESS , \ ABM1_BL_REG_READ_MISSED_FRAME_CLEAR, mask_sh) -#define ABM_MASK_SH_LIST_DCN10 (mask_sh) \ - ABM_COMMON_MASK_SH_LIST_DCE_COMMON_BASE(mask_sh), \ +#define ABM_MASK_SH_LIST_DCN10_COMMON (mask_sh) \ ABM_SF(ABM0_DC_ABM1_HG_MISC_CTRL, \ ABM1_HG_NUM_OF_BINS_SEL, mask_sh), \ ABM_SF(ABM0_DC_ABM1_HG_MISC_CTRL, \
@@ -214,9 +213,13 @@ABM_SF (ABM0_DC_ABM1_HGLS_REG_READ_PROGRESS , \ ABM1_BL_REG_READ_MISSED_FRAME_CLEAR, mask_sh) -#define ABM_MASK_SH_LIST_DCN20 (mask_sh) ABM_MASK_SH_LIST_DCE110(mask_sh) +#define ABM_MASK_SH_LIST_DCN10 (mask_sh) \ + ABM_COMMON_MASK_SH_LIST_DCE_COMMON_BASE(mask_sh), \ + ABM_MASK_SH_LIST_DCN10_COMMON(mask_sh) +#define ABM_MASK_SH_LIST_DCN20 (mask_sh) ABM_MASK_SH_LIST_DCE110(mask_sh)#define ABM_MASK_SH_LIST_DCN30 (mask_sh) ABM_MASK_SH_LIST_DCN10(mask_sh) +#define ABM_MASK_SH_LIST_DCN35 (mask_sh) ABM_MASK_SH_LIST_DCN10_COMMON(mask_sh)#define ABM_MASK_SH_LIST_DCN32 (mask_sh) \ ABM_SF(ABM0_DC_ABM1_HG_MISC_CTRL, \
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.h +1 -0
@@ -188,6 +188,7 @@ struct dcn10_stream_enc_registers {uint32_t HDMI_GENERIC_PACKET_CONTROL10 ;uint32_t DIG_CLOCK_PATTERN ;uint32_t DIG_FIFO_CTRL0 ; +uint32_t DIG_FE_CLK_CNTL ; };
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dpp.h +2 -1
@@ -172,7 +172,8 @@SRI (CM_BLNDGAM_RAMB_START_SLOPE_CNTL_R ,CM , id),\ SRI(CM_BLNDGAM_LUT_CONTROL, CM, id) - +#define DPP_REG_LIST_DCN35 (id)\ + DPP_REG_LIST_DCN30_COMMON(id)#define DPP_REG_LIST_SH_MASK_DCN30_COMMON (mask_sh)\ TF_SF(CM0_CM_MEM_PWR_STATUS, GAMCOR_MEM_PWR_STATE, mask_sh),\
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hpo_dp_link_encoder.h +8 -2
@@ -104,7 +104,10 @@ struct dcn31_hpo_dp_link_encoder_registers {uint32_t RDPCSTX_PHY_CNTL6 [5 ]; }; -#define DCN3_1_HPO_DP_LINK_ENC_MASK_SH_LIST (mask_sh)\ +#define DCN3_1_HPO_DP_LINK_ENC_RDPCSTX_MASK_SH_LIST (mask_sh)\ + SE_SF(RDPCSTX0_RDPCSTX_PHY_CNTL6, RDPCS_PHY_DPALT_DISABLE, mask_sh) + +#define DCN3_1_HPO_DP_LINK_ENC_COMMON_MASK_SH_LIST (mask_sh)\ SE_SF(DP_LINK_ENC0_DP_LINK_ENC_CLOCK_CONTROL, DP_LINK_ENC_CLOCK_EN, mask_sh),\ SE_SF(DP_DPHY_SYM320_DP_DPHY_SYM32_CONTROL, DPHY_RESET, mask_sh),\ SE_SF(DP_DPHY_SYM320_DP_DPHY_SYM32_CONTROL, DPHY_ENABLE, mask_sh),\
@@ -126,11 +129,14 @@ struct dcn31_hpo_dp_link_encoder_registers { SE_SF(DP_DPHY_SYM320_DP_DPHY_SYM32_TP_SQ_PULSE, TP_SQ_PULSE_WIDTH, mask_sh),\ SE_SF(DP_DPHY_SYM320_DP_DPHY_SYM32_SAT_VC0, SAT_STREAM_SOURCE, mask_sh),\ SE_SF(DP_DPHY_SYM320_DP_DPHY_SYM32_SAT_VC0, SAT_SLOT_COUNT, mask_sh),\ -SE_SF (RDPCSTX0_RDPCSTX_PHY_CNTL6 ,RDPCS_PHY_DPALT_DISABLE , mask_sh),\ SE_SF(DP_DPHY_SYM320_DP_DPHY_SYM32_VC_RATE_CNTL0, STREAM_VC_RATE_X, mask_sh),\ SE_SF(DP_DPHY_SYM320_DP_DPHY_SYM32_VC_RATE_CNTL0, STREAM_VC_RATE_Y, mask_sh),\ SE_SF(DP_DPHY_SYM320_DP_DPHY_SYM32_SAT_UPDATE, SAT_UPDATE, mask_sh) +#define DCN3_1_HPO_DP_LINK_ENC_MASK_SH_LIST (mask_sh)\ + DCN3_1_HPO_DP_LINK_ENC_COMMON_MASK_SH_LIST(mask_sh),\ + DCN3_1_HPO_DP_LINK_ENC_RDPCSTX_MASK_SH_LIST(mask_sh)\ +#define DCN3_1_HPO_DP_LINK_ENC_REG_FIELD_LIST (type) \ type DP_LINK_ENC_CLOCK_EN;\ type DPHY_RESET;\
drivers/gpu/drm/amd/display/dmub/dmub_srv.h +2 -1
@@ -103,6 +103,7 @@ enum dmub_asic {DMUB_ASIC_DCN316 ,DMUB_ASIC_DCN32 ,DMUB_ASIC_DCN321 , + DMUB_ASIC_MAX, };
@@ -419,7 +420,7 @@ struct dmub_srv {const struct dmub_srv_common_regs *regs;const struct dmub_srv_dcn31_regs *regs_dcn31;const struct dmub_srv_dcn32_regs *regs_dcn32; - +const struct dmub_srv_dcn35_regs *regs_dcn35;struct dmub_srv_base_funcs funcs;struct dmub_srv_hw_funcs hw_funcs;struct dmub_rb inbox1_rb;
drivers/gpu/drm/amd/display/include/dal_types.h +1 -0
@@ -62,6 +62,7 @@ enum dce_version {DCN_VERSION_3_16 ,DCN_VERSION_3_2 ,DCN_VERSION_3_21 , + DCN_VERSION_MAX };
Signature · 1 line
2.25.1
PATCH 7/33 drm/amd/display: set dig fifo read start level to 7 before dig fifo reset
In reply to brichangFrom: Wang Fudong <[email protected]>
[Why]DIG_FIFO_ERROR = 1 caused mst daisy chain 2nd monitor black.
[How]
We need to set dig fifo read start level = 7 before dig fifo reset during dig fifo enable according to hardware designer's suggestion. If it is zero, it will cause underflow or overflow and DIG_FIFO_ERROR = 1.
--- .../gpu/drm/amd/display/dc/dcn32/dcn32_dio_stream_encoder.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dio_stream_encoder.c +5 -0
@@ -310,6 +310,11 @@ static void enc32_stream_encoder_dp_unblank(// TODO: Confirm if we need to wait for DIG_SYMCLK_FE_ON REG_WAIT (DIG_FE_CNTL ,DIG_SYMCLK_FE_ON ,1 ,10 ,5000 ); +/* read start level = 0 will bring underflow / overflow and DIG_FIFO_ERROR = 1 +* so set it to 1/2 full = 7 before reset as suggested by hardware team. +*/ +REG_UPDATE (DIG_FIFO_CTRL0 ,DIG_FIFO_READ_START_LEVEL ,0x7 ); +REG_UPDATE (DIG_FIFO_CTRL0 ,DIG_FIFO_RESET ,1 );REG_WAIT (DIG_FIFO_CTRL0 ,DIG_FIFO_RESET_DONE ,1 ,10 ,5000 );
Signature · 1 line
2.25.1
PATCH 8/33 drm/amd/display: Remove assert from PHY state update
In reply to brichangFrom: Taimur Hassan <[email protected]>
[Why & How]
In some cases, there are calls to transition from TX_ON to TX_ON. This is expected, so do not assert. However, these are redundant, so return prematurely.
--- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +1 -3
@@ -1224,10 +1224,8 @@ void dcn32_update_phy_state(struct dc_state *state, struct pipe_ctx *pipe_ctx, {enum phy_state current_state = pipe_ctx->stream->link->phy_state; -if (current_state == target_state) { -BREAK_TO_DEBUGGER (); +if (current_state == target_state)return ; - }if (target_state ==TX_OFF_SYMCLK_OFF ) {core_link_disable_stream (pipe_ctx);
Signature · 1 line
2.25.1
PATCH 9/33 drm/amd/display: Only commit SubVP state after pipe programming
In reply to brichangFrom: Alvin Lee <[email protected]>
[Description]
We only want to commit the SubVP config to DMCUB after the main and phantom pipe programming has completed. Commiting the state early can cause issues such as P-State being allowed by the HW early which causes the SubVP state machine to go into a bad state
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +7 -8
@@ -3333,10 +3333,6 @@ static void commit_planes_for_stream(struct dc *dc,if (dc->hwss.program_front_end_for_ctx) dc->hwss.program_front_end_for_ctx (dc, context); -if (update_type !=UPDATE_TYPE_FAST ) -if (dc->hwss.commit_subvp_config) - dc->hwss.commit_subvp_config (dc, context); -if (should_lock_all_pipes && dc->hwss.interdependent_update_lock) { dc->hwss.interdependent_update_lock (dc, context, false); }else {
@@ -3344,6 +3340,10 @@ static void commit_planes_for_stream(struct dc *dc, } dc->hwss.post_unlock_program_front_end (dc, context); +if (update_type !=UPDATE_TYPE_FAST ) +if (dc->hwss.commit_subvp_config) + dc->hwss.commit_subvp_config (dc, context); +/* Since phantom pipe programming is moved to post_unlock_program_front_end, * move the SubVP lock to after the phantom pipes have been setup */
@@ -3477,10 +3477,6 @@ static void commit_planes_for_stream(struct dc *dc, } -if (update_type !=UPDATE_TYPE_FAST ) -if (dc->hwss.commit_subvp_config) - dc->hwss.commit_subvp_config (dc, context); -if (should_lock_all_pipes && dc->hwss.interdependent_update_lock) { dc->hwss.interdependent_update_lock (dc, context, false); }else {
@@ -3517,6 +3513,9 @@ static void commit_planes_for_stream(struct dc *dc,if (update_type !=UPDATE_TYPE_FAST ) dc->hwss.post_unlock_program_front_end (dc, context); +if (update_type !=UPDATE_TYPE_FAST ) +if (dc->hwss.commit_subvp_config) + dc->hwss.commit_subvp_config (dc, context);/* Since phantom pipe programming is moved to post_unlock_program_front_end, * move the SubVP lock to after the phantom pipes have been setup
Signature · 1 line
2.25.1
PATCH 10/33 drm/amd/display: add a override flag as wa for some specific dongle
In reply to brichangFrom: "Chen, Leo" <[email protected]>
[Why & How]
Add a override flag as wa for some specific dongle
--- drivers/gpu/drm/amd/display/dc/dc_link.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dc_link.h +1 -0
@@ -224,6 +224,7 @@ struct dc_link {bool dpia_mst_dsc_always_on;/* Forced DPIA into TBT3 compatibility mode. */ bool dpia_forced_tbt3_mode; +bool dongle_mode_timing_override; } wa_flags;struct link_mst_stream_allocation_table mst_stream_alloc_table;
Signature · 1 line
2.25.1
PATCH 11/33 drm/amd/display: Add DC debug option to force LTTPR mode
In reply to brichangFrom: Michael Strauss <[email protected]>
[WHY]
Useful for external teams debugging LTTPR issues
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 4 ++++ drivers/gpu/drm/amd/display/dc/dc.h | 1 + 2 files changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +4 -0
@@ -5032,6 +5032,10 @@ static void determine_lttpr_mode(struct dc_link *link)bool vbios_lttpr_enable = link->dc->caps.vbios_lttpr_enable;bool vbios_lttpr_interop = link->dc->caps.vbios_lttpr_aware; +if (link->ctx->dc->debug.lttpr_mode_override !=0 ) { + link->lttpr_mode = link->ctx->dc->debug.lttpr_mode_override; +return ; + }if ((link->dc->config.allow_lttpr_non_transparent_mode.bits.DP2_0 && link->dpcd_caps.channel_coding_cap.bits.DP_128b_132b_SUPPORTED)) {
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -846,6 +846,7 @@ struct dc_debug_options {bool exit_idle_opt_for_cursor_updates;bool enable_single_display_2to1_odm_policy;bool enable_dp_dig_pixel_rate_div_policy; +enum lttpr_mode lttpr_mode_override; };struct gpu_info_soc_bounding_box_v1_0 ;
Signature · 1 line
2.25.1
PATCH 12/33 drm/amd/display: Cursor lag with PSR1 eDP
In reply to brichangFrom: Gabe Teeger <[email protected]>
[Why]
On edp with psr1, we do not provide updates of the cursor position regularly to firmware like with PSR2. To send updates regularly, the flag enable_sw_cntl_psr has to equal 1, but cursor update should be provided regularly to FW regardless of that flag.
[How]
Ensure that we always send cursor updates to firmware when PSR version equals 1.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +1 -5
@@ -3343,11 +3343,7 @@ static bool dcn10_dmub_should_update_cursor_data(if (dcn10_can_pipe_disable_cursor (pipe_ctx))return false; -if (pipe_ctx->stream->link->psr_settings.psr_version ==DC_PSR_VERSION_SU_1 ) -return true; - -if (pipe_ctx->stream->link->psr_settings.psr_version ==DC_PSR_VERSION_1 && - debug->enable_sw_cntl_psr) +if (pipe_ctx->stream->link->psr_settings.psr_version ==DC_PSR_VERSION_SU_1 || pipe_ctx->stream->link->psr_settings.psr_version ==DC_PSR_VERSION_1 )return true;return false;
Signature · 1 line
2.25.1
PATCH 13/33 drm/amd/display: Cleanup PSR flag
In reply to brichangFrom: Gabe Teeger <[email protected]>
[Why]enable_sw_cntl_psr flag is not needed. For PSR1 and PSR2, we should be passing dirty rectangle and cursor updates to FW regardless of enable_sw_cntl_psr flag.
[How]
Remove enable_sw_cntl_psr flag from driver. Send cursor info and dirty rectagle status to dmub only in the case of dcn31 and above.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 8 +++----- drivers/gpu/drm/amd/display/dc/dc.h | 1 - drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 3 ++- drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c | 1 - drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c | 1 - drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.c | 1 - drivers/gpu/drm/amd/display/dc/dcn316/dcn316_resource.c | 1 - 7 files changed, 5 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -5
@@ -3113,11 +3113,9 @@ static void commit_planes_do_stream_update(struct dc *dc,static bool dc_dmub_should_send_dirty_rect_cmd (struct dc *dc,struct dc_stream_state *stream) { -if (stream->link->psr_settings.psr_version ==DC_PSR_VERSION_SU_1 ) -return true; - -if (stream->link->psr_settings.psr_version ==DC_PSR_VERSION_1 && - dc->debug.enable_sw_cntl_psr) +if ((stream->link->psr_settings.psr_version ==DC_PSR_VERSION_SU_1 + || stream->link->psr_settings.psr_version ==DC_PSR_VERSION_1 ) + && stream->ctx->dce_version >=DCN_VERSION_3_1 )return true;return false;
drivers/gpu/drm/amd/display/dc/dc.h +0 -1
@@ -827,7 +827,6 @@ struct dc_debug_options {int crb_alloc_policy_min_disp_count;bool disable_z10;bool enable_z9_disable_interface; -bool enable_sw_cntl_psr;union dpia_debug_options dpia_debug;bool disable_fixed_vs_aux_timeout_wa;bool force_disable_subvp;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +2 -1
@@ -3343,7 +3343,8 @@ static bool dcn10_dmub_should_update_cursor_data(if (dcn10_can_pipe_disable_cursor (pipe_ctx))return false; -if (pipe_ctx->stream->link->psr_settings.psr_version ==DC_PSR_VERSION_SU_1 || pipe_ctx->stream->link->psr_settings.psr_version ==DC_PSR_VERSION_1 ) +if ((pipe_ctx->stream->link->psr_settings.psr_version ==DC_PSR_VERSION_SU_1 || pipe_ctx->stream->link->psr_settings.psr_version ==DC_PSR_VERSION_1 ) + && pipe_ctx->stream->ctx->dce_version >=DCN_VERSION_3_1 )return true;return false;
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c +0 -1
@@ -889,7 +889,6 @@ static const struct dc_debug_options debug_defaults_drv = { }, .disable_z10 = true, .optimize_edp_link_rate = true, - .enable_sw_cntl_psr = true, .enable_z9_disable_interface = true, /* Allow support for the PMFW interface for disable Z9*/ .dml_hostvm_override = DML_HOSTVM_OVERRIDE_FALSE, };
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +0 -1
@@ -911,7 +911,6 @@ static const struct dc_debug_options debug_defaults_drv = { } }, .optimize_edp_link_rate = true, - .enable_sw_cntl_psr = true, .seamless_boot_odm_combine = true };
drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.c +0 -1
@@ -886,7 +886,6 @@ static const struct dc_debug_options debug_defaults_drv = { } }, .optimize_edp_link_rate = true, - .enable_sw_cntl_psr = true, .psr_power_use_phy_fsm = 0, };
drivers/gpu/drm/amd/display/dc/dcn316/dcn316_resource.c +0 -1
@@ -886,7 +886,6 @@ static const struct dc_debug_options debug_defaults_drv = { } }, .optimize_edp_link_rate = true, - .enable_sw_cntl_psr = true, };static const struct dc_debug_options debug_defaults_diags = {
Signature · 1 line
2.25.1
PATCH 14/33 drm/amd/display: Allow PHY state update between same states
In reply to brichangFrom: Taimur Hassan <[email protected]>
[Why & How]
In some cases, there are calls to transition from TX_ON to TX_ON, such as when using MST or during resolution change. This is expected, so allow HW programming to continue.
--- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +0 -3
@@ -1224,9 +1224,6 @@ void dcn32_update_phy_state(struct dc_state *state, struct pipe_ctx *pipe_ctx, {enum phy_state current_state = pipe_ctx->stream->link->phy_state; -if (current_state == target_state) -return ; -if (target_state ==TX_OFF_SYMCLK_OFF ) {core_link_disable_stream (pipe_ctx); pipe_ctx->stream->link->phy_state =TX_OFF_SYMCLK_OFF ;
Signature · 1 line
2.25.1
PATCH 15/33 drm/amd/display: Add visual confirm color support for SubVP
In reply to brichangFrom: "Leo (Hanghong) Ma" <[email protected]>
[Why && How]
We would like to have visual confirm color support for SubVP.
1. Set visual confirm color to red: SubVP is enable on this display; 2. Set visual confirm color to green: SubVP is enable on other display and DRR is on this display; 3. Set visual confirm color to blue: SubVP is enable on other display and DRR is off on this display;
--- .../drm/amd/display/dc/core/dc_hw_sequencer.c | 38 +++++++++++++++++++ drivers/gpu/drm/amd/display/dc/dc.h | 1 + .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 2 + .../gpu/drm/amd/display/dc/inc/hw_sequencer.h | 5 +++ 4 files changed, 46 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +38 -0
@@ -402,6 +402,44 @@ void get_hdr_visual_confirm_color( } } +void get_subvp_visual_confirm_color ( +struct dc *dc, +struct pipe_ctx *pipe_ctx, +struct tg_color *color) +{ +uint32_t color_value =MAX_TG_COLOR_VALUE ; +bool enable_subvp = false; +int i; + +if (!dc->ctx || !dc->ctx->dmub_srv || !pipe_ctx) +return ; + +for (i =0 ; i < dc->res_pool->pipe_count; i++) { +struct pipe_ctx *pipe = &dc->current_state->res_ctx.pipe_ctx[i]; + +if (pipe->stream && pipe->stream->mall_stream_config.paired_stream && + pipe->stream->mall_stream_config.type ==SUBVP_MAIN ) { +/* SubVP enable - red */ + color->color_r_cr = color_value; + enable_subvp = true; + +if (pipe_ctx->stream == pipe->stream) +return ; +break ; + } + } + +if (enable_subvp && pipe_ctx->stream->mall_stream_config.type ==SUBVP_NONE ) { + color->color_r_cr =0 ; +if (pipe_ctx->stream->ignore_msa_timing_param ==1 ) +/* SubVP enable and DRR on - green */ + color->color_g_y = color_value; +else +/* SubVP enable and No DRR - blue */ + color->color_b_cb = color_value; + } +} +void get_surface_tile_visual_confirm_color (struct pipe_ctx *pipe_ctx,struct tg_color *color)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -417,6 +417,7 @@ enum visual_confirm {VISUAL_CONFIRM_SWAPCHAIN =6 ,VISUAL_CONFIRM_FAMS =7 ,VISUAL_CONFIRM_SWIZZLE =9 , + VISUAL_CONFIRM_SUBVP = 14, }; enum dc_psr_power_opts {
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +2 -0
@@ -2465,6 +2465,8 @@ void dcn20_update_visual_confirm_color(struct dc *dc, struct pipe_ctx *pipe_ctx,get_mpctree_visual_confirm_color (pipe_ctx, color); else if (dc->debug.visual_confirm == VISUAL_CONFIRM_SWIZZLE) get_surface_tile_visual_confirm_color(pipe_ctx, color); + else if (dc->debug.visual_confirm == VISUAL_CONFIRM_SUBVP) + get_subvp_visual_confirm_color(dc, pipe_ctx, color);if (mpc->funcs->set_bg_color) mpc->funcs->set_bg_color (mpc, color, mpcc_id);
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +5 -0
@@ -272,6 +272,11 @@ const uint16_t *find_color_matrix(void get_surface_visual_confirm_color (const struct pipe_ctx *pipe_ctx,struct tg_color *color); + +void get_subvp_visual_confirm_color ( +struct dc *dc, +struct pipe_ctx *pipe_ctx, +struct tg_color *color); void get_hdr_visual_confirm_color( struct pipe_ctx *pipe_ctx,
Signature · 1 line
2.25.1
PATCH 16/33 drm/amd/display: Add support for visual confirm color
In reply to brichangFrom: "Leo (Hanghong) Ma" <[email protected]>
[Why]
We want to get the visual confirm color of the bottom-most pipe for test automation.
[How]
Save the visual confirm color to plane_state before program to MPC;
--- drivers/gpu/drm/amd/display/dc/dc.h | 1 + drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 31 +++++++++++++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 1 + .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 4 +- .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 4 +- drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 1 + .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 44 +++++++++++++++++++ 7 files changed, 84 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -1184,6 +1184,7 @@ struct dc_plane_state {/* private to dc_surface.c */ enum dc_irq_source irq_source;struct kref refcount; +struct tg_color visual_confirm_color; };struct dc_plane_info {
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +31 -0
@@ -387,6 +387,37 @@ void dc_dmub_srv_query_caps_cmd(struct dmub_srv *dmub) } } +void dc_dmub_srv_get_visual_confirm_color_cmd (struct dc *dc,struct pipe_ctx *pipe_ctx) +{ +union dmub_rb_cmd cmd = {0 }; +enum dmub_status status; +unsigned int panel_inst =0 ; + +dc_get_edp_link_panel_inst (dc, pipe_ctx->stream->link, &panel_inst); + +memset (&cmd,0 ,sizeof (cmd)); + +// Prepare fw command + cmd.visual_confirm_color.header.type =DMUB_CMD__GET_VISUAL_CONFIRM_COLOR ; + cmd.visual_confirm_color.header.sub_type =0 ; + cmd.visual_confirm_color.header.ret_status =1 ; + cmd.visual_confirm_color.header.payload_bytes =sizeof (struct dmub_cmd_visual_confirm_color_data ); + cmd.visual_confirm_color.visual_confirm_color_data.visual_confirm_color.panel_inst = panel_inst; + +// Send command to fw + status =dmub_srv_cmd_with_reply_data (dc->ctx->dmub_srv->dmub, &cmd); + +ASSERT (status ==DMUB_STATUS_OK ); + +// If command was processed, copy feature caps to dmub srv +if (status ==DMUB_STATUS_OK && + cmd.visual_confirm_color.header.ret_status ==0 ) { +memcpy (&dc->ctx->dmub_srv->dmub->visual_confirm_color, + &cmd.visual_confirm_color.visual_confirm_color_data, +sizeof (struct dmub_visual_confirm_color )); + } +} +#ifdef CONFIG_DRM_AMD_DC_DCN /** * ***********************************************************************************************
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h +1 -0
@@ -78,6 +78,7 @@ void dc_dmub_srv_set_drr_manual_trigger_cmd(struct dc *dc, uint32_t tg_inst);bool dc_dmub_srv_p_state_delegate (struct dc *dc,bool enable_pstate,struct dc_state *context);void dc_dmub_srv_query_caps_cmd (struct dmub_srv *dmub); +void dc_dmub_srv_get_visual_confirm_color_cmd (struct dc *dc,struct pipe_ctx *pipe_ctx);void dc_dmub_srv_clear_inbox0_ack (struct dc_dmub_srv *dmub_srv);void dc_dmub_srv_wait_for_inbox0_ack (struct dc_dmub_srv *dmub_srv);void dc_dmub_srv_send_inbox0_cmd (struct dc_dmub_srv *dmub_srv,union dmub_inbox0_data_register data);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +3 -1
@@ -2539,8 +2539,10 @@ void dcn10_update_visual_confirm_color(struct dc *dc, struct pipe_ctx *pipe_ctx,color_space_to_black_color ( dc, pipe_ctx->stream->output_color_space, color); -if (mpc->funcs->set_bg_color) +if (mpc->funcs->set_bg_color) { +memcpy (&pipe_ctx->plane_state->visual_confirm_color, color,sizeof (struct tg_color )); mpc->funcs->set_bg_color (mpc, color, mpcc_id); + } }void dcn10_update_mpcc (struct dc *dc,struct pipe_ctx *pipe_ctx)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +3 -1
@@ -2468,8 +2468,10 @@ void dcn20_update_visual_confirm_color(struct dc *dc, struct pipe_ctx *pipe_ctx,else if (dc->debug.visual_confirm ==VISUAL_CONFIRM_SUBVP )get_subvp_visual_confirm_color (dc, pipe_ctx, color); -if (mpc->funcs->set_bg_color) +if (mpc->funcs->set_bg_color) { +memcpy (&pipe_ctx->plane_state->visual_confirm_color, color,sizeof (struct tg_color )); mpc->funcs->set_bg_color (mpc, color, mpcc_id); + } }void dcn20_update_mpcc (struct dc *dc,struct pipe_ctx *pipe_ctx)
drivers/gpu/drm/amd/display/dmub/dmub_srv.h +1 -0
@@ -442,6 +442,7 @@ struct dmub_srv {/* Feature capabilities reported by fw */ struct dmub_feature_caps feature_caps; +struct dmub_visual_confirm_color visual_confirm_color; };/**
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +44 -0
68 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH 17/33 drm/amd/display: SubVP missing scaling case
In reply to brichangFrom: Alvin Lee <[email protected]>
[Description]
For SubVP scaling case we have to combine
the plane scaling and stream scaling.
Use UCLK dummy p-state WM for FCLK WM set C
[Description]
For DCN32/321 program dummy UCLK P-state watermark into FCLK watermark set C register.
--- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 10 ++++++++-- drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 6 +++++- 2 files changed, 13 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +8 -2
@@ -632,7 +632,7 @@ static void populate_subvp_cmd_pipe_info(struct dc *dc, &cmd->fw_assisted_mclk_switch_v2.config_data.pipe_data[cmd_pipe_index];struct dc_crtc_timing *main_timing = &subvp_pipe->stream->timing;struct dc_crtc_timing *phantom_timing = &subvp_pipe->stream->mall_stream_config.paired_stream->timing; -uint32_t out_num, out_den; +uint32_t out_num_stream, out_den_stream, out_num_plane, out_den_plane, out_num, out_den; pipe_data->mode =SUBVP ; pipe_data->pipe_config.subvp_data.pix_clk_100hz = subvp_pipe->stream->timing.pix_clk_100hz;
@@ -649,8 +649,14 @@ static void populate_subvp_cmd_pipe_info(struct dc *dc,/* Calculate the scaling factor from the src and dst height. * e.g. If 3840x2160 being downscaled to 1920x1080, the scaling factor is 1/2. * Reduce the fraction 1080/2160 = 1/2 for the "scaling factor" +* +* Make sure to combine stream and plane scaling together. */ -reduce_fraction (subvp_pipe->stream->src.height, subvp_pipe->stream->dst.height, &out_num, &out_den); +reduce_fraction (subvp_pipe->stream->src.height, subvp_pipe->stream->dst.height, + &out_num_stream, &out_den_stream); +reduce_fraction (subvp_pipe->plane_state->src_rect.height, subvp_pipe->plane_state->dst_rect.height, + &out_num_plane, &out_den_plane); +reduce_fraction (out_num_stream * out_num_plane, out_den_stream * out_den_plane, &out_num, &out_den); pipe_data->pipe_config.subvp_data.scale_factor_numerator = out_num; pipe_data->pipe_config.subvp_data.scale_factor_denominator = out_den;
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +5 -1
@@ -1796,7 +1796,11 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context, context->bw_ctx.bw.dcn.watermarks.c.frac_urg_bw_nom =get_fraction_of_urgent_bandwidth (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; context->bw_ctx.bw.dcn.watermarks.c.frac_urg_bw_flip =get_fraction_of_urgent_bandwidth_imm_flip (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; context->bw_ctx.bw.dcn.watermarks.c.urgent_latency_ns =get_urgent_latency (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; - context->bw_ctx.bw.dcn.watermarks.c.cstate_pstate.fclk_pstate_change_ns =get_fclk_watermark (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; +/* On DCN32/321, PMFW will set PSTATE_CHANGE_TYPE = 1 (FCLK) for UCLK dummy p-state. +* In this case we must program FCLK WM Set C to use the UCLK dummy p-state WM +* value. +*/ + context->bw_ctx.bw.dcn.watermarks.c.cstate_pstate.fclk_pstate_change_ns =get_wm_dram_clock_change (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; context->bw_ctx.bw.dcn.watermarks.c.usr_retraining_ns =get_usr_retraining_watermark (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ;if ((!pstate_en) && (dc->clk_mgr->bw_params->wm_table.nv_entries[WM_C ].valid)) {
Signature · 1 line
2.25.1
PATCH 18/33 drm/amd/display: Refactor edp dsc codes.
In reply to brichangFrom: Ian Chen <[email protected]>
Refactor edp dsc codes.
We split out edp dsc config from "global" to "per-panel" config settings.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++-- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 19 +++++++++++++++++++ drivers/gpu/drm/amd/display/dc/core/dc_link.c | 10 +++++++++- .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 4 ++-- drivers/gpu/drm/amd/display/dc/dc.h | 2 -- drivers/gpu/drm/amd/display/dc/dc_link.h | 10 ++++++++++ drivers/gpu/drm/amd/display/dc/dm_helpers.h | 7 ++++++- 7 files changed, 48 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -2
@@ -1527,7 +1527,6 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)if (amdgpu_dc_debug_mask &DC_DISABLE_DSC ) { adev->dm.dc->debug.disable_dsc = true; - adev->dm.dc->debug.disable_dsc_edp = true; }if (amdgpu_dc_debug_mask &DC_DISABLE_CLOCK_GATING )
@@ -5627,7 +5626,8 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,dc_dsc_policy_set_enable_dsc_when_not_needed ( aconnector->dsc_settings.dsc_force_enable ==DSC_CLK_FORCE_ENABLE ); -if (aconnector->dc_link && sink->sink_signal ==SIGNAL_TYPE_EDP && !dc->debug.disable_dsc_edp && +if (aconnector->dc_link && sink->sink_signal ==SIGNAL_TYPE_EDP && + !aconnector->dc_link->panel_config.dsc.disable_dsc_edp && dc->caps.edp_dsc_support && aconnector->dsc_settings.dsc_force_enable !=DSC_CLK_FORCE_DISABLE ) {apply_dsc_policy_for_edp (aconnector, sink, stream, dsc_caps, max_dsc_target_bpp_limit_override);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +19 -0
@@ -916,6 +916,25 @@ void dm_helpers_smu_timeout(struct dc_context *ctx, unsigned int msg_id, unsigne//amdgpu_device_gpu_recover(dc_context->driver-context, NULL); } +void dm_helpers_init_panel_settings ( +struct dc_context *ctx, +struct dc_panel_config *panel_config) +{ +// Feature DSC + panel_config->dsc.disable_dsc_edp = false; + panel_config->dsc.force_dsc_edp_policy =0 ; +} + +void dm_helpers_override_panel_settings ( +struct dc_context *ctx, +struct dc_panel_config *panel_config) +{ +// Feature DSC +if (amdgpu_dc_debug_mask &DC_DISABLE_DSC ) { + panel_config->dsc.disable_dsc_edp = true; + } +} + void *dm_helpers_allocate_gpu_mem( struct dc_context *ctx, enum dc_gpu_mem_alloc_type type,
drivers/gpu/drm/amd/display/dc/core/dc_link.c +9 -1
@@ -1311,6 +1311,14 @@ static bool detect_link_and_local_sink(struct dc_link *link, sink->edid_caps.audio_modes[i].sample_rate, sink->edid_caps.audio_modes[i].sample_size); } + +if (link->connector_signal ==SIGNAL_TYPE_EDP ) { +// Init dc_panel_config +dm_helpers_init_panel_settings (dc_ctx, &link->panel_config); +// Override dc_panel_config if system has specific settings +dm_helpers_override_panel_settings (dc_ctx, &link->panel_config); + } + }else {/* From Connected-to-Disconnected. */ link->type = dc_connection_none;
@@ -4736,7 +4744,7 @@ bool dc_link_should_enable_fec(const struct dc_link *link)else if (link->connector_signal ==SIGNAL_TYPE_EDP && (link->dpcd_caps.dsc_caps.dsc_basic_caps.fields. dsc_support.DSC_SUPPORT == false - || link->dc->debug.disable_dsc_edp + || link->panel_config.dsc.disable_dsc_edp || !link->dc->caps.edp_dsc_support)) force_disable = true;
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +2 -2
@@ -3743,7 +3743,7 @@ static bool decide_edp_link_settings_with_dsc(struct dc_link *link,unsigned int policy =0 ; - policy = link->ctx->dc->debug.force_dsc_edp_policy; + policy = link->panel_config.dsc.force_dsc_edp_policy;if (max_link_rate ==LINK_RATE_UNKNOWN ) max_link_rate = link->verified_link_cap.link_rate;/*
@@ -3909,7 +3909,7 @@ bool decide_link_settings(struct dc_stream_state *stream,if (stream->timing.flags.DSC) {enum dc_link_rate max_link_rate =LINK_RATE_UNKNOWN ; -if (link->ctx->dc->debug.force_dsc_edp_policy) { +if (link->panel_config.dsc.force_dsc_edp_policy) {/* calculate link max link rate cap*/ struct dc_link_settings tmp_link_setting;struct dc_crtc_timing tmp_timing = stream->timing;
drivers/gpu/drm/amd/display/dc/dc.h +0 -2
@@ -803,8 +803,6 @@ struct dc_debug_options {bool validate_dml_output;bool enable_dmcub_surface_flip;bool usbc_combo_phy_reset_wa; -bool disable_dsc_edp; -unsigned int force_dsc_edp_policy;bool enable_dram_clock_change_one_display_vactive;/* TODO - remove once tested */ bool legacy_dp2_lt;
drivers/gpu/drm/amd/display/dc/dc_link.h +10 -0
@@ -113,6 +113,15 @@ struct psr_settings {unsigned int psr_power_opt; }; +/* To split out "global" and "per-panel" config settings. +* Add a struct dc_panel_config under dc_link +*/ +struct dc_panel_config { +struct dsc { +bool disable_dsc_edp; +unsigned int force_dsc_edp_policy; + } dsc; +};/* * A link contains one or more sinks and their connected status. * The currently active signal type (HDMI, DP-SST, DP-MST) is also reported.
@@ -233,6 +242,7 @@ struct dc_link {struct gpio *hpd_gpio;enum dc_link_fec_state fec_state; +struct dc_panel_config panel_config;enum phy_state phy_state; };
drivers/gpu/drm/amd/display/dc/dm_helpers.h +6 -1
@@ -171,7 +171,12 @@ void dm_helpers_smu_timeout(struct dc_context *ctx, unsigned int msg_id, unsigne// 0x1 = Result_OK, 0xFE = Result_UnkmownCmd, 0x0 = Status_Busy #define IS_SMU_TIMEOUT (result) \ (result == 0x0) - +void dm_helpers_init_panel_settings ( +struct dc_context *ctx, +struct dc_panel_config *config); +void dm_helpers_override_panel_settings ( +struct dc_context *ctx, +struct dc_panel_config *config); int dm_helper_dmub_aux_transfer_sync( struct dc_context *ctx, const struct dc_link *link,
Signature · 1 line
2.25.1
PATCH 19/33 drm/amd/display: Missing HPO instance added
In reply to brichangFrom: Leo Chen <[email protected]>
[Why & How]
Number of encoder is set to 4 but only 3 instances are created.
--- drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +1 -0
@@ -454,6 +454,7 @@ static const struct dcn31_hpo_dp_stream_encoder_registers hpo_dp_stream_enc_regshpo_dp_stream_encoder_reg_list (0 ),hpo_dp_stream_encoder_reg_list (1 ),hpo_dp_stream_encoder_reg_list (2 ), +hpo_dp_stream_encoder_reg_list (3 ) }; static const struct dcn31_hpo_dp_stream_encoder_shift hpo_dp_se_shift = {
Signature · 1 line
2.25.1
PATCH 20/33 drm/amd/display: Fix CAB cursor size allocation for DCN32/321
In reply to brichangFrom: Aurabindo Pillai <[email protected]>
For calculating cursor size allocation, surface size was used, resulting in over allocation
--- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +1 -1
@@ -312,7 +312,7 @@ static uint32_t dcn32_calculate_cab_allocation(struct dc *dc, struct dc_state *c cursor_size *=8 ;break ; } - cache_lines_used +=dcn32_cache_lines_for_surface (dc, surface_size, + cache_lines_used +=dcn32_cache_lines_for_surface (dc, cursor_size, plane->address.grph.cursor_cache_addr.quad_part); } }
Signature · 1 line
2.25.1
PATCH 21/33 drm/amd/display: disable display fresh from MALL on an edge case for DCN321
In reply to brichangFrom: Aurabindo Pillai <[email protected]>
[Why&How]
When using a 4k monitor when cursor caching is not supported due to framebuffer being on an uncacheable address, enabling display refresh from MALL would trigger corruption if SS is enabled.
Prevent entering SS if we are on the edge case and cursor caching is not possible. Do this only if cursor size larger than a 64x64@4bpp. Pull the cursor size calculation out of if condition since cursor address may not be set on all platforms
--- .../drm/amd/display/dc/dcn32/dcn32_hwseq.c | 43 ++++++++++++------- 1 file changed, 27 insertions(+), 16 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +27 -16
@@ -295,23 +295,24 @@ static uint32_t dcn32_calculate_cab_allocation(struct dc *dc, struct dc_state *c }// Include cursor size for CAB allocation + cursor_size = dc->caps.max_cursor_size * dc->caps.max_cursor_size; +switch (stream->cursor_attributes.color_format) { +case CURSOR_MODE_MONO : + cursor_size /=2 ; +break ; +case CURSOR_MODE_COLOR_1BIT_AND : +case CURSOR_MODE_COLOR_PRE_MULTIPLIED_ALPHA : +case CURSOR_MODE_COLOR_UN_PRE_MULTIPLIED_ALPHA : + cursor_size *=4 ; +break ; + +case CURSOR_MODE_COLOR_64BIT_FP_PRE_MULTIPLIED : +case CURSOR_MODE_COLOR_64BIT_FP_UN_PRE_MULTIPLIED : + cursor_size *=8 ; +break ; + } +if (stream->cursor_position.enable && plane->address.grph.cursor_cache_addr.quad_part) { - cursor_size = dc->caps.max_cursor_size * dc->caps.max_cursor_size; -switch (stream->cursor_attributes.color_format) { -case CURSOR_MODE_MONO : - cursor_size /=2 ; -break ; -case CURSOR_MODE_COLOR_1BIT_AND : -case CURSOR_MODE_COLOR_PRE_MULTIPLIED_ALPHA : -case CURSOR_MODE_COLOR_UN_PRE_MULTIPLIED_ALPHA : - cursor_size *=4 ; -break ; - -case CURSOR_MODE_COLOR_64BIT_FP_PRE_MULTIPLIED : -case CURSOR_MODE_COLOR_64BIT_FP_UN_PRE_MULTIPLIED : - cursor_size *=8 ; -break ; - } cache_lines_used +=dcn32_cache_lines_for_surface (dc, cursor_size, plane->address.grph.cursor_cache_addr.quad_part); }
@@ -325,6 +326,16 @@ static uint32_t dcn32_calculate_cab_allocation(struct dc *dc, struct dc_state *cif (cache_lines_used % lines_per_way >0 ) num_ways++; +if (stream->cursor_position.enable && + !plane->address.grph.cursor_cache_addr.quad_part && + cursor_size >16384 ) +/* Cursor caching is not supported since it won't be on the same line. +* So we need an extra line to accommodate it. With large cursors and a single 4k monitor +* this case triggers corruption. If we're at the edge, then dont trigger display refresh +* from MALL. We only need to cache cursor if its greater that 64x64 at 4 bpp. +*/ + num_ways++; +return num_ways; }
Signature · 1 line
2.25.1
PATCH 22/33 drm/amd/display: use actual cursor size instead of max for CAB allocation
In reply to brichangFrom: Aurabindo Pillai <[email protected]>
[Why&How]
When calculating allocation for cursor size, get the real cursor through the HUBP instead of using the maximum cursor size for more optimal allocation
--- .../gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +14 -1
@@ -295,7 +295,20 @@ static uint32_t dcn32_calculate_cab_allocation(struct dc *dc, struct dc_state *c }// Include cursor size for CAB allocation - cursor_size = dc->caps.max_cursor_size * dc->caps.max_cursor_size; +for (i =0 ; i < dc->res_pool->pipe_count; i++) { +struct pipe_ctx *pipe = &ctx->res_ctx.pipe_ctx[i]; +struct hubp *hubp = pipe->plane_res.hubp; + +if (pipe->stream && pipe->plane_state && hubp) +/* Find the cursor plane and use the exact size instead of +* using the max for calculation +*/ +if (hubp->curs_attr.width >0 ) { + cursor_size = hubp->curs_attr.width * hubp->curs_attr.height; +break ; + } + } +switch (stream->cursor_attributes.color_format) {case CURSOR_MODE_MONO : cursor_size /=2 ;
Signature · 1 line
2.25.1
PATCH 23/33 drm/amd/display: fix wrong register access
In reply to brichangFrom: Charlene Liu <[email protected]>
[why]
fw version check was for release branch.
for staging, it has a chance to enter wrong code path.
--- drivers/gpu/drm/amd/display/dc/dcn31/dcn31_dio_link_encoder.c | 3 +++ .../gpu/drm/amd/display/dc/dcn314/dcn314_dio_stream_encoder.c | 1 + 2 files changed, 4 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_dio_link_encoder.c +3 -0
@@ -104,6 +104,9 @@ static bool has_query_dp_alt(struct link_encoder *enc) {struct dc_dmub_srv *dc_dmub_srv = enc->ctx->dmub_srv; +if (enc->ctx->dce_version >=DCN_VERSION_3_15 ) +return true; +/* Supports development firmware and firmware >= 4.0.11 */ return dc_dmub_srv && !(dc_dmub_srv->dmub->fw_version >= DMUB_FW_VERSION(4, 0, 0) &&
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dio_stream_encoder.c +1 -0
@@ -317,6 +317,7 @@ static void enc314_stream_encoder_dp_unblank(/* switch DP encoder to CRTC data, but reset it the fifo first. It may happen * that it overflows during mode transition, and sometimes doesn't recover. */ +REG_UPDATE (DIG_FIFO_CTRL0 ,DIG_FIFO_READ_START_LEVEL ,0x7 );REG_UPDATE (DP_STEER_FIFO ,DP_STEER_FIFO_RESET ,1 );udelay (10 );
Signature · 1 line
2.25.1
PATCH 24/33 drm/amd/display: Fix primary EDP link detection
In reply to brichangFrom: Iswara Nagulendran <[email protected]>
[HOW&WHY]
EDP link detection must
be updated to support a primary EDP with a
link index of greater than 0.
* SWDEV-342936 - dc: DSC bringup for SAG 1.5
[WHY]
SmartAccess Graphics 1.5 (a.k.a SmartMux 1.5)
requires seamless switching between GPUs
with DSC enabled.
[HOW]
Moved DSC programming to apply_single_control_ctx_to_hw before the stream enablement logic to ensure the CRC checker provides valid values for non-black frames
allowing the system to come out of forced PSR on d2i.
Added additional logic to both generate a black
frame through setVisibility calls and keep track
of the CRCs values for this black frame when
coming out of forced PSR.
Updating logic for DalRegKey_DisableDSC to disable DSC on EDP and all ports for systems.
[CLEANED]
dc: Moved DSC programming to before stream enablement
[HOW&WHY]
Moved DSC programming toapply_single_control_ctx_to_hw before the stream
enablement logic.
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 12 ------------ .../drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 13 +++++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -12
@@ -4303,18 +4303,6 @@ void core_link_enable_stream(if (pipe_ctx->stream->dpms_off)return ; -/* Have to setup DSC before DIG FE and BE are connected (which happens before the -* link training). This is to make sure the bandwidth sent to DIG BE won't be -* bigger than what the link and/or DIG BE can handle. VBID[6]/CompressedStream_flag -* will be automatically set at a later time when the video is enabled -* (DP_VID_STREAM_EN = 1). -*/ -if (pipe_ctx->stream->timing.flags.DSC) { -if (dc_is_dp_signal (pipe_ctx->stream->signal) || -dc_is_virtual_signal (pipe_ctx->stream->signal)) -dp_set_dsc_enable (pipe_ctx, true); - } - status =enable_link (state, pipe_ctx);if (status !=DC_OK ) {
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +13 -0
@@ -1577,6 +1577,19 @@ static enum dc_status apply_single_controller_ctx_to_hw(if (dc_is_dp_signal (pipe_ctx->stream->signal))dp_source_sequence_trace (link,DPCD_SOURCE_SEQ_AFTER_CONNECT_DIG_FE_OTG ); +/* Have to setup DSC before DIG FE and BE are connected (which happens before the +* link training). This is to make sure the bandwidth sent to DIG BE won't be +* bigger than what the link and/or DIG BE can handle. VBID[6]/CompressedStream_flag +* will be automatically set at a later time when the video is enabled +* (DP_VID_STREAM_EN = 1). +*/ +if (pipe_ctx->stream->timing.flags.DSC) { +if (dc_is_dp_signal (pipe_ctx->stream->signal) || +dc_is_virtual_signal (pipe_ctx->stream->signal)) +dp_set_dsc_enable (pipe_ctx, true); + + } +if (!stream->dpms_off) {if (dc->hwss.update_phy_state) dc->hwss.update_phy_state (context, pipe_ctx,TX_ON_SYMCLK_ON );
Signature · 1 line
2.25.1
PATCH 25/33 drm/amd/display: Revert "program k1/k2 divider for virtual signal for DCN32"
In reply to brichangFrom: Aurabindo Pillai <[email protected]>
[Why & How]
This reverts commit 9dd9c085ae3b since it
causes a SubVP related regression: "Switching between windowed video and fullscreen can intermittently cause black screen"
--- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +1 -1
@@ -1157,7 +1157,7 @@ unsigned int dcn32_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsign *k2_div =PIXEL_RATE_DIV_BY_2 ; else *k2_div =PIXEL_RATE_DIV_BY_4 ; - }else if (dc_is_dp_signal (pipe_ctx->stream->signal) ||dc_is_virtual_signal (pipe_ctx->stream->signal)) { + }else if (dc_is_dp_signal (pipe_ctx->stream->signal)) {if (two_pix_per_container) { *k1_div =PIXEL_RATE_DIV_BY_1 ; *k2_div =PIXEL_RATE_DIV_BY_2 ;
Signature · 1 line
2.25.1
PATCH 26/33 drm/amd/display: Add comments.
In reply to brichangFrom: Ian Chen <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dc_link.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dc_link.h +1 -0
@@ -117,6 +117,7 @@ struct psr_settings {* Add a struct dc_panel_config under dc_link */ struct dc_panel_config { +// edp DSC struct dsc {bool disable_dsc_edp;unsigned int force_dsc_edp_policy;
Signature · 1 line
2.25.1
PATCH 27/33 drm/amd/display: [FW Promotion] Release 0.0.132.0
In reply to brichangFrom: Anthony Koo <[email protected]>
- Fix comment to indicate correct visual confirm option
--- drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +1 -2
@@ -234,8 +234,7 @@ union dmub_psr_debug_flags { };/** -* DMUB feature capabilities. -* After DMUB init, driver will query FW capabilities prior to enabling certain features. +* DMUB visual confirm color */ struct dmub_feature_caps {/**
Signature · 1 line
2.25.1
PATCH 28/33 drm/amd/display: 3.2.201
In reply to brichangFrom: Aric Cyr <[email protected]>
--- 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
@@ -47,7 +47,7 @@ struct aux_payload;struct set_config_cmd_payload ;struct dmub_notification ; -#define DC_VER "3.2.200" +#define DC_VER "3.2.201"#define MAX_SURFACES 3#define MAX_PLANES 6
Signature · 1 line
2.25.1
PATCH 29/33 drm/amd/display: Use correct plane for CAB cursor size allocation
In reply to brichangFrom: Aurabindo Pillai <[email protected]>
[Why&How]
plane and stream variables used for cursor size allocation calculation were stale from previous iteration. Redo the iteration to find the correct cursor plane for the calculation.
--- .../drm/amd/display/dc/dcn32/dcn32_hwseq.c | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +21 -11
@@ -295,8 +295,8 @@ static uint32_t dcn32_calculate_cab_allocation(struct dc *dc, struct dc_state *c }// Include cursor size for CAB allocation -for (i =0 ; i < dc->res_pool->pipe_count; i++) { -struct pipe_ctx *pipe = &ctx->res_ctx.pipe_ctx[i]; +for (j =0 ; j < dc->res_pool->pipe_count; j++) { +struct pipe_ctx *pipe = &ctx->res_ctx.pipe_ctx[j];struct hubp *hubp = pipe->plane_res.hubp;if (pipe->stream && pipe->plane_state && hubp)
@@ -339,15 +339,25 @@ static uint32_t dcn32_calculate_cab_allocation(struct dc *dc, struct dc_state *cif (cache_lines_used % lines_per_way >0 ) num_ways++; -if (stream->cursor_position.enable && - !plane->address.grph.cursor_cache_addr.quad_part && - cursor_size >16384 ) -/* Cursor caching is not supported since it won't be on the same line. -* So we need an extra line to accommodate it. With large cursors and a single 4k monitor -* this case triggers corruption. If we're at the edge, then dont trigger display refresh -* from MALL. We only need to cache cursor if its greater that 64x64 at 4 bpp. -*/ - num_ways++; +for (i =0 ; i < ctx->stream_count; i++) { + stream = ctx->streams[i]; +for (j =0 ; j < ctx->stream_status[i].plane_count; j++) { + plane = ctx->stream_status[i].plane_states[j]; + +if (stream->cursor_position.enable && plane && + !plane->address.grph.cursor_cache_addr.quad_part && + cursor_size >16384 ) { +/* Cursor caching is not supported since it won't be on the same line. +* So we need an extra line to accommodate it. With large cursors and a single 4k monitor +* this case triggers corruption. If we're at the edge, then dont trigger display refresh +* from MALL. We only need to cache cursor if its greater that 64x64 at 4 bpp. +*/ + num_ways++; +/* We only expect one cursor plane */ +break ; + } + } + }return num_ways; }
Signature · 1 line
2.25.1
PATCH 30/33 drm/amd/display: Re-initialize viewport after pipe merge
In reply to brichangFrom: Ethan Wellenreiter <[email protected]>
[Why]
Pipes get merged in preparation for SubVP but if they don't get used, and are in ODM or some other multi pipe config, it would calculate the voltage level with a viewport of just one pipe from when they were split resulting in too low of a voltage level.
[How]
Made it so that the viewport and other timing settings get rebuilt and re- initialized after the pipe merge, before calculating the voltage level so it would calculate it correctly.
--- drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +9 -0
@@ -1024,6 +1024,15 @@ static void dcn32_full_validate_bw_helper(struct dc *dc, dc->debug.force_subvp_mclk_switch)) {dcn32_merge_pipes_for_subvp (dc, context); +// to re-initialize viewport after the pipe merge +for (int i =0 ; i < dc->res_pool->pipe_count; i++) { +struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i]; + +if (!pipe_ctx->plane_state || !pipe_ctx->stream) +continue ; + +resource_build_scaling_params (pipe_ctx); + }while (!found_supported_config &&dcn32_enough_pipes_for_subvp (dc, context) &&dcn32_assign_subvp_pipe (dc, context, &dc_pipe_idx)) {
Signature · 1 line
2.25.1
PATCH 31/33 drm/amd/display: Fix check for stream and plane
In reply to brichangFrom: Ethan Wellenreiter <[email protected]>
[WHY]
Function wasn't returning false when it had a no stream
[HOW]
Made it return false when it had no stream.
--- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c +1 -1
@@ -144,7 +144,7 @@ bool dcn32_all_pipes_have_stream_and_plane(struct dc *dc,struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];if (!pipe->stream) -continue ; +return false;if (!pipe->plane_state)return false;
Signature · 1 line
2.25.1
PATCH 32/33 drm/amd/display: Fix black flash when switching from ODM2to1 to ODMBypass
In reply to brichangFrom: Vladimir Stempen <[email protected]>
[Why]
On secondary display hotplug we switch primary stream from ODM2to1 to ODMBypass mode. Current logic will trigger disabling front end for this stream.
[How]
We need to check if prev_odm_pipe is equal to NULL in order to disable dangling planes in this scenario.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -1
@@ -1097,7 +1097,8 @@ static void disable_dangling_plane(struct dc *dc, struct dc_state *context) dc->current_state->stream_count != context->stream_count) should_disable = true; -if (old_stream && !dc->current_state->res_ctx.pipe_ctx[i].top_pipe) { +if (old_stream && !dc->current_state->res_ctx.pipe_ctx[i].top_pipe && + !dc->current_state->res_ctx.pipe_ctx[i].prev_odm_pipe) {struct pipe_ctx *old_pipe, *new_pipe; old_pipe = &dc->current_state->res_ctx.pipe_ctx[i];
Signature · 1 line
2.25.1
PATCH 33/33 drm/amd/display: Correct cursor position on horizontal mirror
In reply to brichangFrom: Martin Tsai <[email protected]>
[Why]
Incorrect cursor position will induce system hang on pipe split.
[How]
1.Handle horizontal mirror on rotation,
2.Correct cursor set on piep split.
--- .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c | 5 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 9 +-- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 72 ++++++++++++++----- .../gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c | 9 +-- 4 files changed, 63 insertions(+), 32 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c +3 -2
@@ -448,11 +448,12 @@ void dpp1_set_cursor_position( src_y_offset = pos->y - pos->x_hotspot - param->viewport.y; } }else if (param->rotation ==ROTATION_ANGLE_180 ) { - src_x_offset = pos->x - param->viewport.x; +if (!param->mirror) + src_x_offset = pos->x - param->viewport.x; + src_y_offset = pos->y - param->viewport.y; } -if (src_x_offset >= (int )param->viewport.width) cur_en =0 ;/* not visible beyond right edge*/
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c +3 -6
@@ -1208,13 +1208,10 @@ void hubp1_cursor_set_position( src_y_offset = pos->y - pos->x_hotspot - param->viewport.y; } }else if (param->rotation ==ROTATION_ANGLE_180 ) { - src_x_offset = pos->x - param->viewport.x; - src_y_offset = pos->y - param->viewport.y; - } +if (!param->mirror) + src_x_offset = pos->x - param->viewport.x; -if (param->mirror) { - x_hotspot = param->viewport.width - x_hotspot; - src_x_offset = param->viewport.x + param->viewport.width - src_x_offset; + src_y_offset = pos->y - param->viewport.y; } dst_x_offset = (src_x_offset >=0 ) ? src_x_offset :0 ;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +54 -18
99 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +3 -6
@@ -987,13 +987,10 @@ void hubp2_cursor_set_position( src_y_offset = pos->y - pos->x_hotspot - param->viewport.y; } }else if (param->rotation ==ROTATION_ANGLE_180 ) { - src_x_offset = pos->x - param->viewport.x; - src_y_offset = pos->y - param->viewport.y; - } +if (!param->mirror) + src_x_offset = pos->x - param->viewport.x; -if (param->mirror) { - x_hotspot = param->viewport.width - x_hotspot; - src_x_offset = param->viewport.x + param->viewport.width - src_x_offset; + src_y_offset = pos->y - param->viewport.y; } dst_x_offset = (src_x_offset >=0 ) ? src_x_offset :0 ;
Signature · 1 line
2.25.1