DC patchset for October 15
Subsystems (3)
cover DC patchset for October 15
This DC patchset brings improvements in multiple areas. In summary, we highlight:
* Fix some issues such as DP2 problem, prefetch bandwidth calculation for DCN3.1 and others.
* Increased Z9 latency and removed z10 save after dsc disable.
* Revert a couple of bad changes.
* Added missing PSR state patch.
Agustin Gutierrez (2):
Revert "drm/amd/display: Fix error in dmesg at boot" Revert "drm/amd/display: Add helper for blanking all dp displays"
Anthony Koo (2):
drm/amd/display: Change initializer to single brace drm/amd/display: [FW Promotion] Release 0.0.88
Aric Cyr (2):
drm/amd/display: Validate plane rects before use drm/amd/display: 3.2.157
Eric Yang (1):
drm/amd/display: increase Z9 latency to workaround underflow in Z9
Hansen (1):
drm/amd/display: Fix DP2 SE and LE SYMCLK selection for B0 PHY
Jake Wang (6):
drm/amd/display: Disable dpp root clock when not being used drm/amd/display: Disable dsc root clock when not being used drm/amd/display: Disable dpstreamclk, symclk32_se, and symclk32_le drm/amd/display: Removed z10 save after dsc disable drm/amd/display: Moved dccg init to after bios golden init drm/amd/display: Disable hdmistream and hdmichar clocks
Jimmy Kizito (2):
drm/amd/display: Clear encoder assignment for copied streams drm/amd/display: Do not skip link training on DP quick hot plug
Josip Pavic (1):
drm/amd/display: do not compare integers of different widths
Lai, Derek (1):
drm/amd/display: Removed power down on boot from DCN31
Michael Strauss (1):
drm/amd/display: Clean Up VPG Low Mem Power
Mikita Lipski (1):
drm/amd/display: Add missing PSR state
Nevenko Stupar (1):
drm/amd/display: Add bios parser support for latest firmware_info
Nicholas Kazlauskas (2):
drm/amd/display: Fix prefetch bandwidth calculation for DCN3.1 drm/amd/display: Require immediate flip support for DCN3.1 planes
Nikola Cornij (2):
drm/amd/display: Limit display scaling to up to true 4k for DCN 3.1 drm/amd/display: Increase watermark latencies for DCN3.1
Wenjing Liu (2):
drm/amd/display: add DP2.0 debug option to set MST_EN for SST stream drm/amd/display: correct apg audio channel enable golden value
.../drm/amd/display/dc/bios/bios_parser2.c | 90 ++++++- .../display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c | 21 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 10 - drivers/gpu/drm/amd/display/dc/core/dc_link.c | 63 +---- .../gpu/drm/amd/display/dc/core/dc_link_ddc.c | 2 +- .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 32 +-- .../drm/amd/display/dc/core/dc_link_enc_cfg.c | 9 +- .../gpu/drm/amd/display/dc/core/dc_resource.c | 5 + .../gpu/drm/amd/display/dc/core/dc_stream.c | 4 + drivers/gpu/drm/amd/display/dc/dc.h | 3 +- drivers/gpu/drm/amd/display/dc/dc_link.h | 1 - drivers/gpu/drm/amd/display/dc/dc_types.h | 1 + drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 2 + .../display/dc/dce110/dce110_hw_sequencer.c | 24 +- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 49 +++- .../gpu/drm/amd/display/dc/dcn20/dcn20_dccg.h | 34 ++- .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 4 +- .../drm/amd/display/dc/dcn30/dcn30_hwseq.c | 39 ++- .../gpu/drm/amd/display/dc/dcn31/dcn31_apg.c | 2 +- .../gpu/drm/amd/display/dc/dcn31/dcn31_dccg.c | 237 +++++++++++++++++- .../gpu/drm/amd/display/dc/dcn31/dcn31_dccg.h | 34 ++- .../drm/amd/display/dc/dcn31/dcn31_hwseq.c | 114 +++++---- .../drm/amd/display/dc/dcn31/dcn31_resource.c | 17 +- .../dc/dml/dcn31/display_mode_vba_31.c | 6 +- drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h | 9 + .../gpu/drm/amd/display/dc/inc/link_enc_cfg.h | 2 +- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 4 +- .../include/asic_reg/dcn/dcn_3_1_2_offset.h | 2 + .../include/asic_reg/dcn/dcn_3_1_2_sh_mask.h | 8 + 29 files changed, 643 insertions(+), 185 deletions(-)
Signature · 1 line
2.25.1
PATCH 1/27 drm/amd/display: Disable dpp root clock when not being used
From: Jake Wang <[email protected]>
[Why & How]
Disable root clock for dpp when not being used.
--- .../display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c | 5 ++- .../gpu/drm/amd/display/dc/dcn31/dcn31_dccg.c | 41 ++++++++++++++++++- 2 files changed, 44 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c +4 -1
@@ -219,14 +219,17 @@ static void dcn31_update_clocks(struct clk_mgr *clk_mgr_base, update_dispclk = true; } -/* TODO: add back DTO programming when DPPCLK restore is fixed in FSDL*/ if (dpp_clock_lowered) {// increase per DPP DTO before lowering global dppclk +dcn20_update_clocks_update_dpp_dto (clk_mgr, context, safe_to_lower);dcn31_smu_set_dppclk (clk_mgr, clk_mgr_base->clks.dppclk_khz); }else {// increase global DPPCLK before lowering per DPP DTO if (update_dppclk || update_dispclk)dcn31_smu_set_dppclk (clk_mgr, clk_mgr_base->clks.dppclk_khz); +// always update dtos unless clock is lowered and not safe to lower +if (new_clocks->dppclk_khz >= dc->current_state->bw_ctx.bw.dcn.clk.dppclk_khz) +dcn20_update_clocks_update_dpp_dto (clk_mgr, context, safe_to_lower); }// notify DMCUB of latest clocks
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_dccg.c +40 -1
53 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH 2/27 drm/amd/display: Clear encoder assignment for copied streams
In reply to Agustin GutierrezFrom: Jimmy Kizito <[email protected]>
[Why]
When copying a stream, the encoder assigned to it is copied too. Encoder assignment should only happen when executing the encoder assignment function link_encs_assign().
[How]
Clear the link encoder pointer for copied stream.
--- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +4 -0
@@ -202,6 +202,10 @@ struct dc_stream_state *dc_copy_stream(const struct dc_stream_state *stream) new_stream->stream_id = new_stream->ctx->dc_stream_id_count; new_stream->ctx->dc_stream_id_count++; +/* If using dynamic encoder assignment, wait till stream committed to assign encoder. */ +if (new_stream->ctx->dc->res_pool->funcs->link_encs_assign) + new_stream->link_enc =NULL ; +kref_init (&new_stream->refcount);return new_stream;
Signature · 1 line
2.25.1
PATCH 3/27 drm/amd/display: Do not skip link training on DP quick hot plug
In reply to Agustin GutierrezFrom: Jimmy Kizito <[email protected]>
[Why]
When rapidly plugging and unplugging a DP sink, detection link training can be mistakenly skipped.
This is due to the hotplug processing occurring before the encoder assignment logic has had a chance to process the removal of a stream. The encoder that would be used for detection link training is then erroneously reported as already in use and detection link training is skipped.
[How]
During hot plug processing, only determine a link encoder to be unavailable for a particular link if it has been assigned to a different link.
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 2 +- drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c | 9 ++++++--- drivers/gpu/drm/amd/display/dc/inc/link_enc_cfg.h | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +1 -1
@@ -2863,7 +2863,7 @@ bool dp_verify_link_cap( link->verified_link_cap = *known_limit_link_setting;return true; }else if (link->link_enc && link->dc->res_pool->funcs->link_encs_assign && - !link_enc_cfg_is_link_enc_avail (link->ctx->dc, link->link_enc->preferred_engine)) { + !link_enc_cfg_is_link_enc_avail (link->ctx->dc, link->link_enc->preferred_engine, link)) { link->verified_link_cap = initial_link_settings;return true; }
drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c +6 -3
@@ -488,16 +488,19 @@ struct link_encoder *link_enc_cfg_get_link_enc_used_by_stream(return link_enc; } -bool link_enc_cfg_is_link_enc_avail (struct dc *dc,enum engine_id eng_id) +bool link_enc_cfg_is_link_enc_avail (struct dc *dc,enum engine_id eng_id,struct dc_link *link) {bool is_avail = true;int i; -/* Add assigned encoders to list. */ +/* An encoder is not available if it has already been assigned to a different endpoint. */ for (i =0 ; i <MAX_PIPES ; i++) {struct link_enc_assignment assignment =get_assignment (dc, i); +struct display_endpoint_id ep_id = (struct display_endpoint_id ) { + .link_id = link->link_id, + .ep_type = link->ep_type}; -if (assignment.valid && assignment.eng_id == eng_id) { +if (assignment.valid && assignment.eng_id == eng_id && !are_ep_ids_equal (&ep_id, &assignment.ep_id)) { is_avail = false;break ; }
drivers/gpu/drm/amd/display/dc/inc/link_enc_cfg.h +1 -1
@@ -97,7 +97,7 @@ struct link_encoder *link_enc_cfg_get_link_enc_used_by_stream( const struct dc_stream_state *stream);/* Return true if encoder available to use. */ -bool link_enc_cfg_is_link_enc_avail (struct dc *dc,enum engine_id eng_id); +bool link_enc_cfg_is_link_enc_avail (struct dc *dc,enum engine_id eng_id,struct dc_link *link);/* Returns true if encoder assignments in supplied state pass validity checks. */ bool link_enc_cfg_validate (struct dc *dc,struct dc_state *state);
Signature · 1 line
2.25.1
PATCH 4/27 drm/amd/display: add DP2.0 debug option to set MST_EN for SST stream
In reply to Agustin GutierrezFrom: Wenjing Liu <[email protected]>
[why]
Some DP2.0 RX requires us to set MST_EN even for SST configuration. We added this debug option so we can configure this temporary workaround for the RX.
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 7 ++++++- drivers/gpu/drm/amd/display/dc/dc.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +6 -1
@@ -1869,8 +1869,13 @@ static enum dc_status enable_link_dp(struct dc_state *state, do_fallback = true;#if defined(CONFIG_DRM_AMD_DC_DCN ) +/* +* Temporary w/a to get DP2.0 link rates to work with SST. +* TODO DP2.0 - Workaround: Remove w/a if and when the issue is resolved. +*/ if (dp_get_link_encoding_format (&link_settings) == DP_128b_132b_ENCODING && - pipe_ctx->stream->signal ==SIGNAL_TYPE_DISPLAY_PORT ) { + pipe_ctx->stream->signal ==SIGNAL_TYPE_DISPLAY_PORT && + link->dc->debug.set_mst_en_for_sst) {dp_enable_mst_on_sink (link, true); }#endif
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -664,6 +664,7 @@ struct dc_debug_options {#if defined(CONFIG_DRM_AMD_DC_DCN )/* TODO - remove once tested */ bool legacy_dp2_lt; +bool set_mst_en_for_sst;#endif union mem_low_power_enable_options enable_mem_low_power;union root_clock_optimization_options root_clock_optimization;
Signature · 1 line
2.25.1
PATCH 5/27 drm/amd/display: Clean Up VPG Low Mem Power
In reply to Agustin GutierrezFrom: Michael Strauss <[email protected]>
[WHAT]
One of the current VPG power on calls is unnecessary
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 10 ---------- drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c | 13 +++++++++++++ .../gpu/drm/amd/display/dc/dcn31/dcn31_resource.c | 4 ---- 3 files changed, 13 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -10
@@ -71,8 +71,6 @@#include "dmub/dmub_srv.h" -#include "dcn30/dcn30_vpg.h" -#include "i2caux_interface.h" #include "dce/dmub_hw_lock_mgr.h"
@@ -2674,9 +2672,6 @@ static void commit_planes_do_stream_update(struct dc *dc,enum surface_update_type update_type, struct dc_state *context) { -#if defined(CONFIG_DRM_AMD_DC_DCN ) -struct vpg *vpg; -#endif int j;// Stream updates
@@ -2697,11 +2692,6 @@ static void commit_planes_do_stream_update(struct dc *dc, stream_update->vrr_infopacket || stream_update->vsc_infopacket || stream_update->vsp_infopacket) { -#if defined(CONFIG_DRM_AMD_DC_DCN ) - vpg = pipe_ctx->stream_res.stream_enc->vpg; -if (vpg && vpg->funcs->vpg_poweron) - vpg->funcs->vpg_poweron (vpg); -#endif resource_build_info_frame (pipe_ctx); dc->hwss.update_info_frame (pipe_ctx); }
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c +13 -0
@@ -49,6 +49,7 @@#include "inc/link_dpcd.h" #include "dcn10/dcn10_hw_sequencer.h" #include "inc/link_enc_cfg.h" +#include "dcn30/dcn30_vpg.h" #define DC_LOGGER_INIT (logger)
@@ -126,6 +127,18 @@ void dcn31_init_hw(struct dc *dc)REG_UPDATE (MMHUBBUB_MEM_PWR_CNTL ,VGA_MEM_PWR_FORCE ,1 ); } +#if defined(CONFIG_DRM_AMD_DC_DCN ) +if (dc->debug.enable_mem_low_power.bits.vpg && dc->res_pool->stream_enc[0 ]->vpg->funcs->vpg_powerdown) { +// Power down VPGs +for (i =0 ; i < dc->res_pool->stream_enc_count; i++) + dc->res_pool->stream_enc[i]->vpg->funcs->vpg_powerdown (dc->res_pool->stream_enc[i]->vpg); +#if defined(CONFIG_DRM_AMD_DC_DP2_0 ) +for (i =0 ; i < dc->res_pool->hpo_dp_stream_enc_count; i++) + dc->res_pool->hpo_dp_stream_enc[i]->vpg->funcs->vpg_powerdown (dc->res_pool->hpo_dp_stream_enc[i]->vpg); +#endif + } +#endif +if (dc->ctx->dc_bios->fw_info_valid) { res_pool->ref_clocks.xtalin_clock_inKhz = dc->ctx->dc_bios->fw_info.pll_info.crystal_frequency;
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c +0 -4
@@ -1312,10 +1312,6 @@ static struct vpg *dcn31_vpg_create( &vpg_shift, &vpg_mask); -// Will re-enable hw block when we enable stream -// Check for enabled stream before powering down? -vpg31_powerdown (&vpg31->base); -return &vpg31->base; }
Signature · 1 line
2.25.1
PATCH 6/27 drm/amd/display: do not compare integers of different widths
In reply to Agustin GutierrezFrom: Josip Pavic <[email protected]>
[Why & How]
Increase width of some variables to avoid comparing integers of different widths
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +2 -2
@@ -3439,7 +3439,7 @@ enum dc_status dc_link_allocate_mst_payload(struct pipe_ctx *pipe_ctx)struct fixed31_32 avg_time_slots_per_mtp;struct fixed31_32 pbn;struct fixed31_32 pbn_per_slot; -uint8_t i; +int i;enum act_return_status ret;DC_LOGGER_INIT (link->ctx->logger);
@@ -3531,7 +3531,7 @@ static enum dc_status deallocate_mst_payload(struct pipe_ctx *pipe_ctx)struct stream_encoder *stream_encoder = pipe_ctx->stream_res.stream_enc;struct dp_mst_stream_allocation_table proposed_table = {0 };struct fixed31_32 avg_time_slots_per_mtp =dc_fixpt_from_int (0 ); -uint8_t i; +int i;bool mst_mode = (link->type == dc_connection_mst_branch);DC_LOGGER_INIT (link->ctx->logger);
Signature · 1 line
2.25.1
PATCH 7/27 drm/amd/display: correct apg audio channel enable golden value
In reply to Agustin GutierrezFrom: Wenjing Liu <[email protected]>
Hardware team has recommended to generically hard code this register to 0xFF as part of the effort to eventually remove this control. However we set it to 0xF instead.
This causes 4 of audio 8ch to be muted.
--- drivers/gpu/drm/amd/display/dc/dcn31/dcn31_apg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_apg.c +1 -1
@@ -129,7 +129,7 @@ static void apg31_se_audio_setup(/* When running in "pair mode", pairs of audio channels have their own enable * this is for really old audio drivers */ -REG_UPDATE (APG_DBG_GEN_CONTROL ,APG_DBG_AUDIO_CHANNEL_ENABLE ,0xF ); +REG_UPDATE (APG_DBG_GEN_CONTROL ,APG_DBG_AUDIO_CHANNEL_ENABLE ,0xFF );// REG_UPDATE(APG_DBG_GEN_CONTROL, APG_DBG_AUDIO_CHANNEL_ENABLE, channels); /* Disable forced mem power off */
Signature · 1 line
2.25.1
PATCH 8/27 drm/amd/display: Validate plane rects before use
In reply to Agustin GutierrezFrom: Aric Cyr <[email protected]>
[Why]
Calculation of scaling ratio can result in a crash due to zero'd src or dst plane rects.
[How]
Validate that src and dst rects are valid before using for scaling calculations.
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +5 -0
@@ -3009,6 +3009,11 @@ enum dc_status dc_validate_plane(struct dc *dc, const struct dc_plane_state *pla {enum dc_status res =DC_OK ; +/* check if surface has invalid dimensions */ +if (plane_state->src_rect.width ==0 || plane_state->src_rect.height ==0 || + plane_state->dst_rect.width ==0 || plane_state->dst_rect.height ==0 ) +return DC_FAIL_SURFACE_VALIDATE ; +/* TODO For now validates pixel format only */ if (dc->res_pool->funcs->validate_plane)return dc->res_pool->funcs->validate_plane (plane_state, &dc->caps);
Signature · 1 line
2.25.1