DC Patches October 18, 2023
Subsystems (3)
cover DC Patches October 18, 2023
From: Roman Li <[email protected]>
This DC patchset brings improvements in multiple areas. In summary, we highlight:
* Fixes null-deref regression after
"drm/amd/display: Update OPP counter from new interface"
* Fixes display flashing when VSR and HDR enabled on dcn32
* Fixes dcn3x intermittent hangs due to FPO
* Fixes MST Multi-Stream light up on dcn35
* Fixes green screen on DCN31x when DVI and HDMI monitors attached
* Adds DML2 improvements
* Adds idle power optimization improvements
* Accommodates panels with lower nit backlight
* Updates SDP VSC colorimetry from DP test automation request
* Reverts "drm/amd/display: allow edp updates for virtual signal"
* Removes duplicated edp relink to fastboot
Agustin Gutierrez (1):
drm/amd/display: Remove power sequencing check
Alex Hung (2):
drm/amd/display: Revert "drm/amd/display: allow edp updates for
virtual signal"
drm/amd/display: Set emulated sink type to HDMI accordingly.
Alvin Lee (1):
drm/amd/display: Update FAMS sequence for DCN30 & DCN32
Aric Cyr (1):
drm/amd/display: 3.2.256
Aurabindo Pillai (1):
drm/amd/display: add interface to query SubVP status
Chiawen Huang (1):
drm/amd/display: remove duplicated edp relink to fastboot
Fangzhi Zuo (1):
drm/amd/display: Fix MST Multi-Stream Not Lighting Up on dcn35
George Shen (1):
drm/amd/display: Update SDP VSC colorimetry from DP test automation
request
Hugo Hu (1):
drm/amd/display: reprogram det size while seamless boot
Ilya Bakoulin (1):
drm/amd/display: Fix shaper using bad LUT params
Iswara Nagulendran (1):
drm/amd/display: Read before writing Backlight Mode Set Register
Michael Strauss (1):
drm/amd/display: Disable SYMCLK32_SE RCO on DCN314
Nicholas Kazlauskas (2):
drm/amd/display: Revert "Improve x86 and dmub ips handshake" drm/amd/display: Fix IPS handshake for idle optimizations
Qingqing Zhuo (1):
drm/amd/display: fix compilation warning in dml2
Rodrigo Siqueira (3):
drm/amd/display: Correct enum typo drm/amd/display: Add prefix to amdgpu crtc functions drm/amd/display: Add prefix for plane functions
Samson Tam (2):
drm/amd/display: fix num_ways overflow error drm/amd/display: add null check for invalid opps
Sung Joon Kim (2):
drm/amd/display: Add a check for idle power optimization drm/amd/display: Fix HDMI framepack 3D test issue
Swapnil Patel (1):
drm/amd/display: Reduce default backlight min from 5 nits to 1 nits
Wenjing Liu (2):
drm/amd/display: add pipe resource management callbacks to DML2 drm/amd/display: implement map dc pipe with callback in DML2
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 +- .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 48 +- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 4 + .../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 542 +++++++++--------- .../amd/display/amdgpu_dm/amdgpu_dm_plane.h | 2 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 88 +-- .../gpu/drm/amd/display/dc/core/dc_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dc.h | 4 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 26 +- .../drm/amd/display/dc/dcn31/dcn31_hubbub.c | 23 + .../amd/display/dc/dcn314/dcn314_resource.c | 2 +- .../gpu/drm/amd/display/dc/dcn32/dcn32_init.c | 2 +- .../drm/amd/display/dc/dcn32/dcn32_resource.c | 9 +- .../amd/display/dc/dcn321/dcn321_resource.c | 8 +- .../drm/amd/display/dc/dcn35/dcn35_resource.c | 5 + .../display/dc/dml2/dml2_dc_resource_mgmt.c | 146 +++++ .../display/dc/dml2/dml2_translation_helper.c | 2 + .../drm/amd/display/dc/dml2/dml2_wrapper.h | 16 + .../amd/display/dc/hwss/dce110/dce110_hwseq.c | 8 +- .../amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 6 + .../amd/display/dc/hwss/dcn30/dcn30_hwseq.c | 21 +- .../amd/display/dc/hwss/dcn31/dcn31_hwseq.c | 11 + .../amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 39 +- .../amd/display/dc/hwss/dcn32/dcn32_hwseq.h | 3 + .../amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 8 +- .../gpu/drm/amd/display/dc/inc/hw/dchubbub.h | 1 + drivers/gpu/drm/amd/display/dc/irq_types.h | 6 +- .../display/dc/link/accessories/link_dp_cts.c | 6 + .../gpu/drm/amd/display/dc/link/link_dpms.c | 3 +- .../link/protocols/link_edp_panel_control.c | 11 +- .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 1 + .../drm/amd/display/include/signal_types.h | 1 - 32 files changed, 651 insertions(+), 408 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/26 drm/amd/display: remove duplicated edp relink to fastboot
From: Chiawen Huang <[email protected]>
[Why&How]enable_accelerated_mode function is fully to check whether fastboot support or not.
It is no longer to disable_vbios_mode_if_required. enable_stream_timing is allowed when seamless/fast boot are disabled.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 62 ------------------- .../amd/display/dc/hwss/dce110/dce110_hwseq.c | 8 ++- 2 files changed, 5 insertions(+), 65 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -62
@@ -1215,67 +1215,6 @@ static void disable_dangling_plane(struct dc *dc, struct dc_state *context)dc_release_state (current_ctx); } -static void disable_vbios_mode_if_required ( -struct dc *dc, -struct dc_state *context) -{ -unsigned int i, j; - -/* check if timing_changed, disable stream*/ -for (i =0 ; i < dc->res_pool->pipe_count; i++) { -struct dc_stream_state *stream =NULL ; -struct dc_link *link =NULL ; -struct pipe_ctx *pipe =NULL ; - - pipe = &context->res_ctx.pipe_ctx[i]; - stream = pipe->stream; -if (stream ==NULL ) -continue ; - -if (stream->apply_seamless_boot_optimization) -continue ; - -// only looking for first odm pipe -if (pipe->prev_odm_pipe) -continue ; - -if (stream->link->local_sink && - stream->link->local_sink->sink_signal ==SIGNAL_TYPE_EDP ) { - link = stream->link; - } - -if (link !=NULL && link->link_enc->funcs->is_dig_enabled (link->link_enc)) { -unsigned int enc_inst, tg_inst =0 ; -unsigned int pix_clk_100hz; - - enc_inst = link->link_enc->funcs->get_dig_frontend (link->link_enc); -if (enc_inst !=ENGINE_ID_UNKNOWN ) { -for (j =0 ; j < dc->res_pool->stream_enc_count; j++) { -if (dc->res_pool->stream_enc[j]->id == enc_inst) { - tg_inst = dc->res_pool->stream_enc[j]->funcs->dig_source_otg ( - dc->res_pool->stream_enc[j]); -break ; - } - } - - dc->res_pool->dp_clock_source->funcs->get_pixel_clk_frequency_100hz ( - dc->res_pool->dp_clock_source, - tg_inst, &pix_clk_100hz); - -if (link->link_status.link_active) { -uint32_t requested_pix_clk_100hz = - pipe->stream_res.pix_clk_params.requested_pix_clk_100hz; - -if (pix_clk_100hz != requested_pix_clk_100hz) { - dc->link_srv->set_dpms_off (pipe); - pipe->stream->dpms_off = false; - } - } - } - } - } -} -static void wait_for_no_pipes_pending (struct dc *dc,struct dc_state *context) {int i;
@@ -1845,7 +1784,6 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *c dc_streams[i] = context->streams[i];if (!dcb->funcs->is_accelerated_mode (dcb)) { -disable_vbios_mode_if_required (dc, context); dc->hwss.enable_accelerated_mode (dc, context); }
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +5 -3
@@ -1546,8 +1546,9 @@ static enum dc_status apply_single_controller_ctx_to_hw(*/ if (!(hws->wa.dp_hpo_and_otg_sequence && dc->link_srv->dp_is_128b_132b_signal (pipe_ctx)))/* */ -/* Do not touch stream timing on seamless boot optimization. */ -if (!pipe_ctx->stream->apply_seamless_boot_optimization) +/* Do not touch stream timing on seamless/fast boot optimization. */ +if (!pipe_ctx->stream->apply_seamless_boot_optimization && + !pipe_ctx->stream->apply_edp_fast_boot_optimization) hws->funcs.enable_stream_timing (pipe_ctx, context, dc);if (hws->funcs.setup_vupdate_interrupt)
@@ -1587,7 +1588,8 @@ static enum dc_status apply_single_controller_ctx_to_hw(* function core_link_enable_stream */ if (hws->wa.dp_hpo_and_otg_sequence && dc->link_srv->dp_is_128b_132b_signal (pipe_ctx)) { -if (!pipe_ctx->stream->apply_seamless_boot_optimization) +if (!pipe_ctx->stream->apply_seamless_boot_optimization && + !pipe_ctx->stream->apply_edp_fast_boot_optimization) hws->funcs.enable_stream_timing (pipe_ctx, context, dc); }
Signature · 1 line
2.34.1
PATCH 2/26 drm/amd/display: reprogram det size while seamless boot
In reply to [email protected]From: Hugo Hu <[email protected]>
[Why]
During system boot in second screen only mode on a seamless boot system, there is a chance that the pipe's det size might not be reset.
[How]
Reset the det size while resetting the pipe during seamless boot.
--- .../drm/amd/display/dc/dcn31/dcn31_hubbub.c | 23 +++++++++++++++++++ .../amd/display/dc/hwss/dcn31/dcn31_hwseq.c | 9 ++++++++ .../gpu/drm/amd/display/dc/inc/hw/dchubbub.h | 1 + 3 files changed, 33 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.c +23 -0
@@ -109,6 +109,28 @@ static void dcn31_program_det_size(struct hubbub *hubbub, int hubp_inst, unsigne + hubbub2->det3_size + hubbub2->compbuf_size_segments <= hubbub2->crb_size_segs); } +static void dcn31_wait_for_det_apply (struct hubbub *hubbub,int hubp_inst) +{ +struct dcn20_hubbub *hubbub2 =TO_DCN20_HUBBUB (hubbub); + +switch (hubp_inst) { +case 0 : +REG_WAIT (DCHUBBUB_DET0_CTRL ,DET0_SIZE_CURRENT , hubbub2->det0_size,1000 ,30 ); +break ; +case 1 : +REG_WAIT (DCHUBBUB_DET1_CTRL ,DET1_SIZE_CURRENT , hubbub2->det1_size,1000 ,30 ); +break ; +case 2 : +REG_WAIT (DCHUBBUB_DET2_CTRL ,DET2_SIZE_CURRENT , hubbub2->det2_size,1000 ,30 ); +break ; +case 3 : +REG_WAIT (DCHUBBUB_DET3_CTRL ,DET3_SIZE_CURRENT , hubbub2->det3_size,1000 ,30 ); +break ; +default : +break ; + } +} +static void dcn31_program_compbuf_size (struct hubbub *hubbub,unsigned int compbuf_size_kb,bool safe_to_increase) {struct dcn20_hubbub *hubbub2 =TO_DCN20_HUBBUB (hubbub);
@@ -1041,6 +1063,7 @@ static const struct hubbub_funcs hubbub31_funcs = { .is_allow_self_refresh_enabled = hubbub1_is_allow_self_refresh_enabled, .verify_allow_pstate_change_high = hubbub31_verify_allow_pstate_change_high, .program_det_size = dcn31_program_det_size, + .wait_for_det_apply = dcn31_wait_for_det_apply, .program_compbuf_size = dcn31_program_compbuf_size, .init_crb = dcn31_init_crb, .hubbub_read_state = hubbub2_read_state,
drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.c +9 -0
@@ -585,6 +585,15 @@ void dcn31_reset_hw_ctx_wrap( pipe_need_reprogram(pipe_ctx_old, pipe_ctx)) {struct clock_source *old_clk = pipe_ctx_old->clock_source; +/* Reset pipe which is seamless boot stream. */ +if (!pipe_ctx_old->plane_state) { + dc->res_pool->hubbub->funcs->program_det_size ( + dc->res_pool->hubbub, pipe_ctx_old->plane_res.hubp->inst,0 ); +/* Wait det size changed. */ + dc->res_pool->hubbub->funcs->wait_for_det_apply ( + dc->res_pool->hubbub, pipe_ctx_old->plane_res.hubp->inst); + } +dcn31_reset_back_end_for_pipe (dc, pipe_ctx_old, dc->current_state);if (hws->funcs.enable_stream_gating) hws->funcs.enable_stream_gating (dc, pipe_ctx_old);
drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h +1 -0
@@ -188,6 +188,7 @@ struct hubbub_funcs {* compressed or detiled buffers. */ void (*program_det_size)(struct hubbub *hubbub,int hubp_inst,unsigned det_buffer_size_in_kbyte); +void (*wait_for_det_apply)(struct hubbub *hubbub,int hubp_inst);void (*program_compbuf_size)(struct hubbub *hubbub,unsigned compbuf_size_kb,bool safe_to_increase);void (*init_crb)(struct hubbub *hubbub);void (*force_usr_retraining_allow)(struct hubbub *hubbub,bool allow);
Signature · 1 line
2.34.1
PATCH 3/26 drm/amd/display: Remove power sequencing check
In reply to [email protected]From: Agustin Gutierrez <[email protected]>
[Why]
Some ASICs keep backlight powered on after dpms off command has been issued.
[How]
The check for no edp power sequencing was never going to pass. The value is never changed from what it is set by design.
--- drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/link/link_dpms.c +1 -2
@@ -1932,8 +1932,7 @@ static void disable_link_dp(struct dc_link *link,dp_disable_link_phy (link, link_res, signal);if (link->connector_signal ==SIGNAL_TYPE_EDP ) { -if (!link->dc->config.edp_no_power_sequencing && - !link->skip_implict_edp_power_control) +if (!link->skip_implict_edp_power_control) link->dc->hwss.edp_power_control (link, false); }
Signature · 1 line
2.34.1
Re: [PATCH 03/26] drm/amd/display: Remove power sequencing check
Quoted 10 lines · On 10/18/23 13:41, [email protected] wrote:
From: Agustin Gutierrez <[email protected]>
[Why]
Some ASICs keep backlight powered on after dpms off command has been issued.[How]
The check for no edp power sequencing was never going to pass. The value is never changed from what it is set by design.
Quoted 21 lines
Reviewed-by Swapnil Patel <[email protected]>Acked-by Roman Li <[email protected]>Signed-off-by Agustin Gutierrez <[email protected]>--- drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/gpu/drm/amd/display/dc/link/link_dpms.c +1
-2@@ -1932,8 +1932,7 @@ static void disable_link_dp(struct dc_link *link,dp_disable_link_phy (link, link_res, signal);if (link->connector_signal ==SIGNAL_TYPE_EDP ) { -if (!link->dc->config.edp_no_power_sequencing && - !link->skip_implict_edp_power_control) +if (!link->skip_implict_edp_power_control) link->dc->hwss.edp_power_control (link, false); }
Signature · 1 line
Hamza
PATCH 4/26 drm/amd/display: Fix MST Multi-Stream Not Lighting Up on dcn35
In reply to [email protected]From: Fangzhi Zuo <[email protected]>
dcn35 misses .enable_symclk_se hook that makes MST DSC not functional when having multiple FE clk to be enabled.
--- drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c +6 -0
@@ -2746,6 +2746,8 @@ void dcn20_enable_stream(struct pipe_ctx *pipe_ctx)struct dce_hwseq *hws = dc->hwseq;unsigned int k1_div =PIXEL_RATE_DIV_NA ;unsigned int k2_div =PIXEL_RATE_DIV_NA ; +struct link_encoder *link_enc =link_enc_cfg_get_link_enc (pipe_ctx->stream->link); +struct stream_encoder *stream_enc = pipe_ctx->stream_res.stream_enc;if (dc->link_srv->dp_is_128b_132b_signal (pipe_ctx)) {if (dc->hwseq->funcs.setup_hpo_hw_control)
@@ -2765,6 +2767,10 @@ void dcn20_enable_stream(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_dtbclk_dto (dccg, &dto_params); + }else { +if (dccg->funcs->enable_symclk_se) + dccg->funcs->enable_symclk_se (dccg, stream_enc->stream_enc_inst, + link_enc->transmitter -TRANSMITTER_UNIPHY_A ); }if (hws->funcs.calculate_dccg_k1_k2_values && dc->res_pool->dccg->funcs->set_pixel_rate_div) { hws->funcs.calculate_dccg_k1_k2_values (pipe_ctx, &k1_div, &k2_div);
Signature · 1 line
2.34.1
PATCH 5/26 drm/amd/display: Revert "Improve x86 and dmub ips handshake"
In reply to [email protected]From: Nicholas Kazlauskas <[email protected]>
This reverts commit 8316378d272ed96f60177cc9a8beaadb8640f745.
Causes intermittent hangs during reboot stress testing.
--- .../display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c | 37 ------------ .../amd/display/dc/clk_mgr/dcn35/dcn35_smu.c | 14 +---- .../amd/display/dc/clk_mgr/dcn35/dcn35_smu.h | 4 +- drivers/gpu/drm/amd/display/dc/dc.h | 2 - drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 57 ++++--------------- .../gpu/drm/amd/display/dc/dcn35/dcn35_init.c | 2 - .../drm/amd/display/dc/dcn35/dcn35_resource.c | 2 - .../amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 30 ++++------ .../amd/display/dc/hwss/dcn35/dcn35_hwseq.h | 3 - .../drm/amd/display/dc/hwss/hw_sequencer.h | 3 +- .../gpu/drm/amd/display/dc/inc/hw/clk_mgr.h | 2 - 11 files changed, 27 insertions(+), 129 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c +0 -37
@@ -808,34 +808,6 @@ static void dcn35_set_low_power_state(struct clk_mgr *clk_mgr_base) } } -static void dcn35_set_idle_state (struct clk_mgr *clk_mgr_base,bool allow_idle) -{ -struct clk_mgr_internal *clk_mgr =TO_CLK_MGR_INTERNAL (clk_mgr_base); -struct dc *dc = clk_mgr_base->ctx->dc; -uint32_t val =dcn35_smu_read_ips_scratch (clk_mgr); - -if (dc->config.disable_ips ==0 ) { - val |=DMUB_IPS1_ALLOW_MASK ; - val |=DMUB_IPS2_ALLOW_MASK ; - }else if (dc->config.disable_ips ==DMUB_IPS_DISABLE_IPS1 ) { - val = val & ~DMUB_IPS1_ALLOW_MASK ; - val = val & ~DMUB_IPS2_ALLOW_MASK ; - }else if (dc->config.disable_ips ==DMUB_IPS_DISABLE_IPS2 ) { - val |=DMUB_IPS1_ALLOW_MASK ; - val = val & ~DMUB_IPS2_ALLOW_MASK ; - }else if (dc->config.disable_ips ==DMUB_IPS_DISABLE_IPS2_Z10 ) { - val |=DMUB_IPS1_ALLOW_MASK ; - val |=DMUB_IPS2_ALLOW_MASK ; - } - -if (!allow_idle) { - val = val & ~DMUB_IPS1_ALLOW_MASK ; - val = val & ~DMUB_IPS2_ALLOW_MASK ; - } - -dcn35_smu_write_ips_scratch (clk_mgr, val); -} -static void dcn35_exit_low_power_state (struct clk_mgr *clk_mgr_base) {struct clk_mgr_internal *clk_mgr =TO_CLK_MGR_INTERNAL (clk_mgr_base);
@@ -855,13 +827,6 @@ static bool dcn35_is_ips_supported(struct clk_mgr *clk_mgr_base)return ips_supported; } -static uint32_t dcn35_get_idle_state (struct clk_mgr *clk_mgr_base) -{ -struct clk_mgr_internal *clk_mgr =TO_CLK_MGR_INTERNAL (clk_mgr_base); - -return dcn35_smu_read_ips_scratch (clk_mgr); -} -static void dcn35_init_clocks_fpga (struct clk_mgr *clk_mgr) {dcn35_init_clocks (clk_mgr);
@@ -949,8 +914,6 @@ static struct clk_mgr_funcs dcn35_funcs = { .set_low_power_state = dcn35_set_low_power_state, .exit_low_power_state = dcn35_exit_low_power_state, .is_ips_supported = dcn35_is_ips_supported, - .set_idle_state = dcn35_set_idle_state, - .get_idle_state = dcn35_get_idle_state };struct clk_mgr_funcs dcn35_fpga_funcs = {
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_smu.c +2 -12
@@ -444,9 +444,9 @@ void dcn35_vbios_smu_enable_48mhz_tmdp_refclk_pwrdwn(struct clk_mgr_internal *cl enable); } -int dcn35_smu_exit_low_power_state (struct clk_mgr_internal *clk_mgr) +void dcn35_smu_exit_low_power_state (struct clk_mgr_internal *clk_mgr) { -return dcn35_smu_send_msg_with_param ( +dcn35_smu_send_msg_with_param ( clk_mgr, VBIOSSMC_MSG_DispPsrExit,0 );
@@ -459,13 +459,3 @@ int dcn35_smu_get_ips_supported(struct clk_mgr_internal *clk_mgr) VBIOSSMC_MSG_QueryIPS2Support, 0); } - -void dcn35_smu_write_ips_scratch (struct clk_mgr_internal *clk_mgr,uint32_t param) -{ -REG_WRITE (MP1_SMN_C2PMSG_71 , param); -} - -uint32_t dcn35_smu_read_ips_scratch (struct clk_mgr_internal *clk_mgr) -{ -return REG_READ (MP1_SMN_C2PMSG_71 ); -}
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_smu.h +1 -3
@@ -194,10 +194,8 @@ void dcn35_smu_set_zstate_support(struct clk_mgr_internal *clk_mgr, enum dcn_zstvoid dcn35_smu_set_dtbclk (struct clk_mgr_internal *clk_mgr,bool enable);void dcn35_vbios_smu_enable_48mhz_tmdp_refclk_pwrdwn (struct clk_mgr_internal *clk_mgr,bool enable); -int dcn35_smu_exit_low_power_state (struct clk_mgr_internal *clk_mgr); +void dcn35_smu_exit_low_power_state (struct clk_mgr_internal *clk_mgr);int dcn35_smu_get_ips_supported (struct clk_mgr_internal *clk_mgr);int dcn35_smu_get_dtbclk (struct clk_mgr_internal *clk_mgr);int dcn35_smu_get_dprefclk (struct clk_mgr_internal *clk_mgr); -void dcn35_smu_write_ips_scratch (struct clk_mgr_internal *clk_mgr,uint32_t param); -uint32_t dcn35_smu_read_ips_scratch (struct clk_mgr_internal *clk_mgr);#endif /* DAL_DC_35_SMU_H_ */
drivers/gpu/drm/amd/display/dc/dc.h +0 -2
@@ -975,8 +975,6 @@ struct dc_debug_options {bool replay_skip_crtc_disabled;bool ignore_pg;/*do nothing, let pmfw control it*/ bool psp_disabled_wa; -unsigned int ips2_eval_delay_us; -unsigned int ips2_entry_delay_us; };struct gpu_info_soc_bounding_box_v1_0 ;
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +12 -45
76 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn35/dcn35_init.c +0 -2
@@ -118,8 +118,6 @@ static const struct hw_sequencer_funcs dcn35_funcs = { .calc_blocks_to_ungate = dcn35_calc_blocks_to_ungate, .block_power_control = dcn35_block_power_control, .root_clock_control = dcn35_root_clock_control, - .set_idle_state = dcn35_set_idle_state, - .get_idle_state = dcn35_get_idle_state };static const struct hwseq_private_funcs dcn35_private_funcs = {
drivers/gpu/drm/amd/display/dc/dcn35/dcn35_resource.c +0 -2
@@ -746,8 +746,6 @@ static const struct dc_debug_options debug_defaults_drv = { .disable_z10 = false, .ignore_pg = true, .psp_disabled_wa = true, - .ips2_eval_delay_us = 200, - .ips2_entry_delay_us = 400 };static const struct dc_panel_config panel_config_defaults = {
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +11 -19
@@ -650,10 +650,18 @@ bool dcn35_apply_idle_power_optimizations(struct dc *dc, bool enable)// TODO: review other cases when idle optimization is allowed +if (!enable) { +// Tell PMFW to exit low power state +if (dc->clk_mgr->funcs->exit_low_power_state) + dc->clk_mgr->funcs->exit_low_power_state (dc->clk_mgr); + +dc_dmub_srv_is_hw_pwr_up (dc->ctx->dmub_srv, true); + } + +dc_dmub_srv_notify_idle (dc, enable); +if (!enable) -dc_dmub_srv_exit_low_power_state (dc); -else -dc_dmub_srv_notify_idle (dc, enable); +dc_dmub_srv_is_hw_pwr_up (dc->ctx->dmub_srv, true);return true; }
@@ -1187,19 +1195,3 @@ void dcn35_optimize_bandwidth( dc->hwss.root_clock_control (dc, &pg_update_state, false); } } - -void dcn35_set_idle_state (const struct dc *dc,bool allow_idle) -{ -// TODO: Find a more suitable communcation -if (dc->clk_mgr->funcs->set_idle_state) - dc->clk_mgr->funcs->set_idle_state (dc->clk_mgr, allow_idle); -} - -uint32_t dcn35_get_idle_state (const struct dc *dc) -{ -// TODO: Find a more suitable communcation -if (dc->clk_mgr->funcs->get_idle_state) -return dc->clk_mgr->funcs->get_idle_state (dc->clk_mgr); - -return 0 ; -}
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h +0 -3
@@ -79,7 +79,4 @@ void dcn35_dsc_pg_control(struct dce_hwseq *hws, unsigned int dsc_inst, bool power_on); - -void dcn35_set_idle_state (const struct dc *dc,bool allow_idle); -uint32_t dcn35_get_idle_state (const struct dc *dc);#endif /* __DC_HWSS_DCN35_H__ */
drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h +1 -2
@@ -418,8 +418,7 @@ struct hw_sequencer_funcs { struct pg_block_update *update_state, bool power_on);void (*root_clock_control)(struct dc *dc,struct pg_block_update *update_state,bool power_on); -void (*set_idle_state)(const struct dc *dc,bool allow_idle); -uint32_t (*get_idle_state)(const struct dc *dc); +bool (*is_pipe_topology_transition_seamless)(struct dc *dc,const struct dc_state *cur_ctx,const struct dc_state *new_ctx);
drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr.h +0 -2
@@ -262,8 +262,6 @@ struct clk_mgr_funcs {void (*set_low_power_state)(struct clk_mgr *clk_mgr);void (*exit_low_power_state)(struct clk_mgr *clk_mgr);bool (*is_ips_supported)(struct clk_mgr *clk_mgr); -void (*set_idle_state)(struct clk_mgr *clk_mgr,bool allow_idle); -uint32_t (*get_idle_state)(struct clk_mgr *clk_mgr);void (*init_clocks)(struct clk_mgr *clk_mgr);
Signature · 1 line
2.34.1
PATCH 6/26 drm/amd/display: Add a check for idle power optimization
In reply to [email protected]From: Sung Joon Kim <[email protected]>
[why]
Need a helper function to check idle power is allowed so that dc doesn't access any registers that are power-gated.
[how]
Implement helper function to check idle power optimization. Enable a hook to check if detection is allowed.
V2:
Add function hooks for set and get idle states. Check if function hook was properly initialized.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 23 +++++++++++++++++++ drivers/gpu/drm/amd/display/dc/dc.h | 1 + .../amd/display/dc/hwss/dcn31/dcn31_hwseq.c | 4 +++- .../amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 8 ++----- .../drm/amd/display/dc/hwss/hw_sequencer.h | 2 ++ .../gpu/drm/amd/display/dc/inc/hw/clk_mgr.h | 2 ++ .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 1 + 7 files changed, 34 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +23 -0
@@ -4821,6 +4821,9 @@ void dc_allow_idle_optimizations(struct dc *dc, bool allow)if (dc->debug.disable_idle_power_optimizations)return ; +if (dc->caps.ips_support && dc->config.disable_ips) +return ; +if (dc->clk_mgr !=NULL && dc->clk_mgr->funcs->is_smu_present)if (!dc->clk_mgr->funcs->is_smu_present (dc->clk_mgr))return ;
@@ -4832,6 +4835,26 @@ void dc_allow_idle_optimizations(struct dc *dc, bool allow) dc->idle_optimizations_allowed = allow; } +bool dc_dmub_is_ips_idle_state (struct dc *dc) +{ +uint32_t idle_state =0 ; + +if (dc->debug.disable_idle_power_optimizations) +return false; + +if (!dc->caps.ips_support || dc->config.disable_ips) +return false; + +if (dc->hwss.get_idle_state) + idle_state = dc->hwss.get_idle_state (dc); + +if ((idle_state &DMUB_IPS1_ALLOW_MASK ) || + (idle_state &DMUB_IPS2_ALLOW_MASK )) +return true; + +return false; +} +/* set min and max memory clock to lowest and highest DPM level, respectively */ void dc_unlock_memory_clock_frequency (struct dc *dc) {
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -2362,6 +2362,7 @@ bool dc_is_plane_eligible_for_idle_optimizations(struct dc *dc, struct dc_plane_ struct dc_cursor_attributes *cursor_attr);void dc_allow_idle_optimizations (struct dc *dc,bool allow); +bool dc_dmub_is_ips_idle_state (struct dc *dc);/* set min and max memory clock to lowest and highest DPM level, respectively */ void dc_unlock_memory_clock_frequency (struct dc *dc);
drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.c +3 -1
@@ -586,7 +586,9 @@ void dcn31_reset_hw_ctx_wrap(struct clock_source *old_clk = pipe_ctx_old->clock_source;/* Reset pipe which is seamless boot stream. */ -if (!pipe_ctx_old->plane_state) { +if (!pipe_ctx_old->plane_state && + dc->res_pool->hubbub->funcs->program_det_size && + dc->res_pool->hubbub->funcs->wait_for_det_apply) { dc->res_pool->hubbub->funcs->program_det_size ( dc->res_pool->hubbub, pipe_ctx_old->plane_res.hubp->inst,0 );/* Wait det size changed. */
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +2 -6
@@ -627,12 +627,8 @@ void dcn35_power_down_on_boot(struct dc *dc)if (dc->clk_mgr->funcs->set_low_power_state) dc->clk_mgr->funcs->set_low_power_state (dc->clk_mgr); -if (dc->clk_mgr->clks.pwr_state ==DCN_PWR_STATE_LOW_POWER ) { -if (!dc->idle_optimizations_allowed) { -dc_dmub_srv_notify_idle (dc, true); - dc->idle_optimizations_allowed = true; - } - } +if (dc->clk_mgr->clks.pwr_state ==DCN_PWR_STATE_LOW_POWER ) +dc_allow_idle_optimizations (dc, true); }bool dcn35_apply_idle_power_optimizations (struct dc *dc,bool enable)
drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h +2 -0
@@ -418,6 +418,8 @@ struct hw_sequencer_funcs { struct pg_block_update *update_state, bool power_on);void (*root_clock_control)(struct dc *dc,struct pg_block_update *update_state,bool power_on); +void (*set_idle_state)(const struct dc *dc,bool allow_idle); +uint32_t (*get_idle_state)(const struct dc *dc); bool (*is_pipe_topology_transition_seamless)(struct dc *dc, const struct dc_state *cur_ctx,
drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr.h +2 -0
@@ -262,6 +262,8 @@ struct clk_mgr_funcs {void (*set_low_power_state)(struct clk_mgr *clk_mgr);void (*exit_low_power_state)(struct clk_mgr *clk_mgr);bool (*is_ips_supported)(struct clk_mgr *clk_mgr); +void (*set_idle_state)(struct clk_mgr *clk_mgr,bool allow_idle); +uint32_t (*get_idle_state)(struct clk_mgr *clk_mgr);void (*init_clocks)(struct clk_mgr *clk_mgr);
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +1 -0
@@ -352,6 +352,7 @@ static bool dmub_srv_hw_setup(struct dmub_srv *dmub, enum dmub_asic asic) funcs->init_reg_offsets = dmub_srv_dcn35_regs_init; funcs->is_hw_powered_up = dmub_dcn35_is_hw_powered_up; + funcs->should_detect = dmub_dcn35_should_detect;break ;default :
Signature · 1 line
2.34.1
PATCH 7/26 drm/amd/display: Update SDP VSC colorimetry from DP test automation request
In reply to [email protected]From: George Shen <[email protected]>
[Why]
Certain test equipment vendors check the SDP VSC for colorimetry against the value from the test request during certain DP link layer tests for YCbCr test cases.
[How]
Update SDP VSC with colorimetry from test automation request.
--- .../gpu/drm/amd/display/dc/link/accessories/link_dp_cts.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_cts.c +6 -0
@@ -839,6 +839,12 @@ bool dp_set_test_pattern( pipe_ctx->stream->vsc_infopacket.sb[17 ] |= (1 <<7 );// sb17 bit 7 Dynamic Range: 0 = VESA range, 1 = CTA range else pipe_ctx->stream->vsc_infopacket.sb[17] &= ~(1 << 7); + +if (color_space ==COLOR_SPACE_YCBCR601_LIMITED ) + pipe_ctx->stream->vsc_infopacket.sb[16 ] &=0xf0 ; +else if (color_space ==COLOR_SPACE_YCBCR709_LIMITED ) + pipe_ctx->stream->vsc_infopacket.sb[16 ] |=1 ; +resource_build_info_frame (pipe_ctx); link->dc->hwss.update_info_frame (pipe_ctx); }
Signature · 1 line
2.34.1
PATCH 8/26 drm/amd/display: Reduce default backlight min from 5 nits to 1 nits
In reply to [email protected]From: Swapnil Patel <[email protected]>
[Why & How]
Currently set_default_brightness_aux function uses 5 nits as lower limit to check for valid default_backlight setting. However some newer panels can support even lower default settings
--- .../amd/display/dc/link/protocols/link_edp_panel_control.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c +2 -2
@@ -283,8 +283,8 @@ bool set_default_brightness_aux(struct dc_link *link)if (link && link->dpcd_sink_ext_caps.bits.oled ==1 ) {if (!read_default_bl_aux (link, &default_backlight)) default_backlight =150000 ; -// if < 5 nits or > 5000, it might be wrong readback -if (default_backlight <5000 || default_backlight >5000000 ) +// if < 1 nits or > 5000, it might be wrong readback +if (default_backlight <1000 || default_backlight >5000000 ) default_backlight =150000 ;// return edp_set_backlight_level_nits(link, true,
Signature · 1 line
2.34.1
PATCH 9/26 drm/amd/display: add pipe resource management callbacks to DML2
In reply to [email protected]From: Wenjing Liu <[email protected]>
[why]
Need DML2 to support new pipe resource management APIs.
--- .../gpu/drm/amd/display/dc/dcn32/dcn32_resource.c | 5 +++++ .../drm/amd/display/dc/dcn321/dcn321_resource.c | 5 +++++ .../gpu/drm/amd/display/dc/dcn35/dcn35_resource.c | 5 +++++ .../gpu/drm/amd/display/dc/dml2/dml2_wrapper.h | 15 +++++++++++++++ 4 files changed, 30 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +5 -0
@@ -2445,6 +2445,11 @@ static bool dcn32_resource_construct( dc->dml2_options.callbacks.build_scaling_params = &resource_build_scaling_params; dc->dml2_options.callbacks.can_support_mclk_switch_using_fw_based_vblank_stretch = &dcn30_can_support_mclk_switch_using_fw_based_vblank_stretch; dc->dml2_options.callbacks.acquire_secondary_pipe_for_mpc_odm = &dc_resource_acquire_secondary_pipe_for_mpc_odm_legacy; + dc->dml2_options.callbacks.update_pipes_for_stream_with_slice_count = &resource_update_pipes_for_stream_with_slice_count; + dc->dml2_options.callbacks.update_pipes_for_plane_with_slice_count = &resource_update_pipes_for_plane_with_slice_count; + dc->dml2_options.callbacks.get_mpc_slice_index = &resource_get_mpc_slice_index; + dc->dml2_options.callbacks.get_odm_slice_index = &resource_get_odm_slice_index; + dc->dml2_options.callbacks.get_opp_head = &resource_get_opp_head; dc->dml2_options.svp_pstate.callbacks.dc = dc; dc->dml2_options.svp_pstate.callbacks.add_plane_to_context = &dc_add_plane_to_context;
drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c +5 -0
@@ -1998,6 +1998,11 @@ static bool dcn321_resource_construct( dc->dml2_options.callbacks.build_scaling_params = &resource_build_scaling_params; dc->dml2_options.callbacks.can_support_mclk_switch_using_fw_based_vblank_stretch = &dcn30_can_support_mclk_switch_using_fw_based_vblank_stretch; dc->dml2_options.callbacks.acquire_secondary_pipe_for_mpc_odm = &dc_resource_acquire_secondary_pipe_for_mpc_odm_legacy; + dc->dml2_options.callbacks.update_pipes_for_stream_with_slice_count = &resource_update_pipes_for_stream_with_slice_count; + dc->dml2_options.callbacks.update_pipes_for_plane_with_slice_count = &resource_update_pipes_for_plane_with_slice_count; + dc->dml2_options.callbacks.get_mpc_slice_index = &resource_get_mpc_slice_index; + dc->dml2_options.callbacks.get_odm_slice_index = &resource_get_odm_slice_index; + dc->dml2_options.callbacks.get_opp_head = &resource_get_opp_head; dc->dml2_options.svp_pstate.callbacks.dc = dc; dc->dml2_options.svp_pstate.callbacks.add_plane_to_context = &dc_add_plane_to_context;
drivers/gpu/drm/amd/display/dc/dcn35/dcn35_resource.c +5 -0
@@ -2082,6 +2082,11 @@ static bool dcn35_resource_construct( dc->dml2_options.callbacks.build_scaling_params = &resource_build_scaling_params; dc->dml2_options.callbacks.can_support_mclk_switch_using_fw_based_vblank_stretch = &dcn30_can_support_mclk_switch_using_fw_based_vblank_stretch; dc->dml2_options.callbacks.acquire_secondary_pipe_for_mpc_odm = &dc_resource_acquire_secondary_pipe_for_mpc_odm_legacy; + dc->dml2_options.callbacks.update_pipes_for_stream_with_slice_count = &resource_update_pipes_for_stream_with_slice_count; + dc->dml2_options.callbacks.update_pipes_for_plane_with_slice_count = &resource_update_pipes_for_plane_with_slice_count; + dc->dml2_options.callbacks.get_mpc_slice_index = &resource_get_mpc_slice_index; + dc->dml2_options.callbacks.get_odm_slice_index = &resource_get_odm_slice_index; + dc->dml2_options.callbacks.get_opp_head = &resource_get_opp_head; dc->dml2_options.max_segments_per_hubp =24 ; dc->dml2_options.det_segment_size =DCN3_2_DET_SEG_SIZE ;/*todo*/
drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h +15 -0
@@ -71,6 +71,21 @@ struct dml2_dc_callbacks {bool (*build_scaling_params)(struct pipe_ctx *pipe_ctx);bool (*can_support_mclk_switch_using_fw_based_vblank_stretch)(struct dc *dc,struct dc_state *context);bool (*acquire_secondary_pipe_for_mpc_odm)(const struct dc *dc,struct dc_state *state,struct pipe_ctx *pri_pipe,struct pipe_ctx *sec_pipe,bool odm); +bool (*update_pipes_for_stream_with_slice_count)( +struct dc_state *new_ctx, +const struct dc_state *cur_ctx, +const struct resource_pool *pool, +const struct dc_stream_state *stream, +int new_slice_count); +bool (*update_pipes_for_plane_with_slice_count)( +struct dc_state *new_ctx, +const struct dc_state *cur_ctx, +const struct resource_pool *pool, +const struct dc_plane_state *plane, +int slice_count); +int (*get_odm_slice_index)(const struct pipe_ctx *opp_head); +int (*get_mpc_slice_index)(const struct pipe_ctx *dpp_pipe); +struct pipe_ctx *(*get_opp_head)(const struct pipe_ctx *pipe_ctx); };struct dml2_dc_svp_callbacks {
Signature · 1 line
2.34.1
PATCH 10/26 drm/amd/display: implement map dc pipe with callback in DML2
In reply to [email protected]From: Wenjing Liu <[email protected]>
[why]
Unify pipe resource management logic in dc resource layer.
--- .../drm/amd/display/dc/dcn32/dcn32_resource.c | 1 + .../display/dc/dml2/dml2_dc_resource_mgmt.c | 144 ++++++++++++++++++ .../drm/amd/display/dc/dml2/dml2_wrapper.h | 1 + 3 files changed, 146 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +1 -0
@@ -2481,6 +2481,7 @@ static bool dcn32_resource_construct( dc->dml2_options.max_segments_per_hubp =18 ; dc->dml2_options.det_segment_size =DCN3_2_DET_SEG_SIZE ; + dc->dml2_options.map_dc_pipes_with_callbacks = true;if (ASICREV_IS_GC_11_0_3 (dc->ctx->asic_id.hw_internal_rev) && (dc->config.sdpif_request_limit_words_per_umc ==0 )) dc->config.sdpif_request_limit_words_per_umc =16 ;
drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c +144 -0
156 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h +1 -0
@@ -167,6 +167,7 @@ struct dml2_configuration_options {struct dml2_soc_bbox_overrides bbox_overrides;unsigned int max_segments_per_hubp;unsigned int det_segment_size; +bool map_dc_pipes_with_callbacks; };/*
Signature · 1 line
2.34.1
PATCH 11/26 drm/amd/display: Fix IPS handshake for idle optimizations
In reply to [email protected]From: Nicholas Kazlauskas <[email protected]>
[Why]
Intermittent reboot hangs are observed introduced by "Improve x86 and dmub ips handshake".
[How]
Bring back the commit but fix the polling.
Avoid hanging in place forever by bounding the delay and ensure that we still message DMCUB on IPS2 exit to notify driver idle has been cleared.
--- .../display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c | 37 ++++++++++ .../amd/display/dc/clk_mgr/dcn35/dcn35_smu.c | 14 +++- .../amd/display/dc/clk_mgr/dcn35/dcn35_smu.h | 4 +- drivers/gpu/drm/amd/display/dc/dc.h | 2 + drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 73 ++++++++++++++++--- .../gpu/drm/amd/display/dc/dcn35/dcn35_init.c | 2 + .../drm/amd/display/dc/dcn35/dcn35_resource.c | 2 + .../amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 30 +++++--- .../amd/display/dc/hwss/dcn35/dcn35_hwseq.h | 3 + .../drm/amd/display/dc/hwss/hw_sequencer.h | 1 - 10 files changed, 141 insertions(+), 27 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c +37 -0
@@ -808,6 +808,34 @@ static void dcn35_set_low_power_state(struct clk_mgr *clk_mgr_base) } } +static void dcn35_set_idle_state (struct clk_mgr *clk_mgr_base,bool allow_idle) +{ +struct clk_mgr_internal *clk_mgr =TO_CLK_MGR_INTERNAL (clk_mgr_base); +struct dc *dc = clk_mgr_base->ctx->dc; +uint32_t val =dcn35_smu_read_ips_scratch (clk_mgr); + +if (dc->config.disable_ips ==0 ) { + val |=DMUB_IPS1_ALLOW_MASK ; + val |=DMUB_IPS2_ALLOW_MASK ; + }else if (dc->config.disable_ips ==DMUB_IPS_DISABLE_IPS1 ) { + val = val & ~DMUB_IPS1_ALLOW_MASK ; + val = val & ~DMUB_IPS2_ALLOW_MASK ; + }else if (dc->config.disable_ips ==DMUB_IPS_DISABLE_IPS2 ) { + val |=DMUB_IPS1_ALLOW_MASK ; + val = val & ~DMUB_IPS2_ALLOW_MASK ; + }else if (dc->config.disable_ips ==DMUB_IPS_DISABLE_IPS2_Z10 ) { + val |=DMUB_IPS1_ALLOW_MASK ; + val |=DMUB_IPS2_ALLOW_MASK ; + } + +if (!allow_idle) { + val = val & ~DMUB_IPS1_ALLOW_MASK ; + val = val & ~DMUB_IPS2_ALLOW_MASK ; + } + +dcn35_smu_write_ips_scratch (clk_mgr, val); +} +static void dcn35_exit_low_power_state (struct clk_mgr *clk_mgr_base) {struct clk_mgr_internal *clk_mgr =TO_CLK_MGR_INTERNAL (clk_mgr_base);
@@ -827,6 +855,13 @@ static bool dcn35_is_ips_supported(struct clk_mgr *clk_mgr_base)return ips_supported; } +static uint32_t dcn35_get_idle_state (struct clk_mgr *clk_mgr_base) +{ +struct clk_mgr_internal *clk_mgr =TO_CLK_MGR_INTERNAL (clk_mgr_base); + +return dcn35_smu_read_ips_scratch (clk_mgr); +} +static void dcn35_init_clocks_fpga (struct clk_mgr *clk_mgr) {dcn35_init_clocks (clk_mgr);
@@ -914,6 +949,8 @@ static struct clk_mgr_funcs dcn35_funcs = { .set_low_power_state = dcn35_set_low_power_state, .exit_low_power_state = dcn35_exit_low_power_state, .is_ips_supported = dcn35_is_ips_supported, + .set_idle_state = dcn35_set_idle_state, + .get_idle_state = dcn35_get_idle_state };struct clk_mgr_funcs dcn35_fpga_funcs = {
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_smu.c +12 -2
@@ -444,9 +444,9 @@ void dcn35_vbios_smu_enable_48mhz_tmdp_refclk_pwrdwn(struct clk_mgr_internal *cl enable); } -void dcn35_smu_exit_low_power_state (struct clk_mgr_internal *clk_mgr) +int dcn35_smu_exit_low_power_state (struct clk_mgr_internal *clk_mgr) { -dcn35_smu_send_msg_with_param ( +return dcn35_smu_send_msg_with_param ( clk_mgr, VBIOSSMC_MSG_DispPsrExit,0 );
@@ -459,3 +459,13 @@ int dcn35_smu_get_ips_supported(struct clk_mgr_internal *clk_mgr) VBIOSSMC_MSG_QueryIPS2Support, 0); } + +void dcn35_smu_write_ips_scratch (struct clk_mgr_internal *clk_mgr,uint32_t param) +{ +REG_WRITE (MP1_SMN_C2PMSG_71 , param); +} + +uint32_t dcn35_smu_read_ips_scratch (struct clk_mgr_internal *clk_mgr) +{ +return REG_READ (MP1_SMN_C2PMSG_71 ); +}
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_smu.h +3 -1
@@ -194,8 +194,10 @@ void dcn35_smu_set_zstate_support(struct clk_mgr_internal *clk_mgr, enum dcn_zstvoid dcn35_smu_set_dtbclk (struct clk_mgr_internal *clk_mgr,bool enable);void dcn35_vbios_smu_enable_48mhz_tmdp_refclk_pwrdwn (struct clk_mgr_internal *clk_mgr,bool enable); -void dcn35_smu_exit_low_power_state (struct clk_mgr_internal *clk_mgr); +int dcn35_smu_exit_low_power_state (struct clk_mgr_internal *clk_mgr);int dcn35_smu_get_ips_supported (struct clk_mgr_internal *clk_mgr);int dcn35_smu_get_dtbclk (struct clk_mgr_internal *clk_mgr);int dcn35_smu_get_dprefclk (struct clk_mgr_internal *clk_mgr); +void dcn35_smu_write_ips_scratch (struct clk_mgr_internal *clk_mgr,uint32_t param); +uint32_t dcn35_smu_read_ips_scratch (struct clk_mgr_internal *clk_mgr);#endif /* DAL_DC_35_SMU_H_ */
drivers/gpu/drm/amd/display/dc/dc.h +2 -0
@@ -975,6 +975,8 @@ struct dc_debug_options {bool replay_skip_crtc_disabled;bool ignore_pg;/*do nothing, let pmfw control it*/ bool psp_disabled_wa; +unsigned int ips2_eval_delay_us; +unsigned int ips2_entry_delay_us; };struct gpu_info_soc_bounding_box_v1_0 ;
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +61 -12
92 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn35/dcn35_init.c +2 -0
@@ -118,6 +118,8 @@ static const struct hw_sequencer_funcs dcn35_funcs = { .calc_blocks_to_ungate = dcn35_calc_blocks_to_ungate, .block_power_control = dcn35_block_power_control, .root_clock_control = dcn35_root_clock_control, + .set_idle_state = dcn35_set_idle_state, + .get_idle_state = dcn35_get_idle_state };static const struct hwseq_private_funcs dcn35_private_funcs = {
drivers/gpu/drm/amd/display/dc/dcn35/dcn35_resource.c +2 -0
@@ -746,6 +746,8 @@ static const struct dc_debug_options debug_defaults_drv = { .disable_z10 = false, .ignore_pg = true, .psp_disabled_wa = true, + .ips2_eval_delay_us = 200, + .ips2_entry_delay_us = 400 };static const struct dc_panel_config panel_config_defaults = {
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +19 -11
@@ -646,18 +646,10 @@ bool dcn35_apply_idle_power_optimizations(struct dc *dc, bool enable)// TODO: review other cases when idle optimization is allowed -if (!enable) { -// Tell PMFW to exit low power state -if (dc->clk_mgr->funcs->exit_low_power_state) - dc->clk_mgr->funcs->exit_low_power_state (dc->clk_mgr); - -dc_dmub_srv_is_hw_pwr_up (dc->ctx->dmub_srv, true); - } - -dc_dmub_srv_notify_idle (dc, enable); -if (!enable) -dc_dmub_srv_is_hw_pwr_up (dc->ctx->dmub_srv, true); +dc_dmub_srv_exit_low_power_state (dc); +else +dc_dmub_srv_notify_idle (dc, enable);return true; }
@@ -1191,3 +1183,19 @@ void dcn35_optimize_bandwidth( dc->hwss.root_clock_control (dc, &pg_update_state, false); } } + +void dcn35_set_idle_state (const struct dc *dc,bool allow_idle) +{ +// TODO: Find a more suitable communcation +if (dc->clk_mgr->funcs->set_idle_state) + dc->clk_mgr->funcs->set_idle_state (dc->clk_mgr, allow_idle); +} + +uint32_t dcn35_get_idle_state (const struct dc *dc) +{ +// TODO: Find a more suitable communcation +if (dc->clk_mgr->funcs->get_idle_state) +return dc->clk_mgr->funcs->get_idle_state (dc->clk_mgr); + +return 0 ; +}
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h +3 -0
@@ -79,4 +79,7 @@ void dcn35_dsc_pg_control(struct dce_hwseq *hws, unsigned int dsc_inst, bool power_on); + +void dcn35_set_idle_state (const struct dc *dc,bool allow_idle); +uint32_t dcn35_get_idle_state (const struct dc *dc);#endif /* __DC_HWSS_DCN35_H__ */
drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h +0 -1
@@ -420,7 +420,6 @@ struct hw_sequencer_funcs { struct pg_block_update *update_state, bool power_on);void (*set_idle_state)(const struct dc *dc,bool allow_idle);uint32_t (*get_idle_state)(const struct dc *dc); -bool (*is_pipe_topology_transition_seamless)(struct dc *dc,const struct dc_state *cur_ctx,const struct dc_state *new_ctx);
Signature · 1 line
2.34.1
PATCH 12/26 drm/amd/display: Fix HDMI framepack 3D test issue
In reply to [email protected]From: Sung Joon Kim <[email protected]>
[why]
Bandwidth validation failure on framepack tests. Need to double pixel clock when 3D format is framepack. Also for HDMI displays, we need to keep the ITC flag to 1 by default.
[how]
Double the pixel clock when using framepack 3D format. Set hdmi ITC bit to 1.
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1 -1
@@ -4228,7 +4228,7 @@ static void set_avi_info_frame(switch (stream->content_type) {case DISPLAY_CONTENT_TYPE_NO_DATA : hdmi_info.bits.CN0_CN1 =0 ; - hdmi_info.bits.ITC =0 ; + hdmi_info.bits.ITC =1 ;break ;case DISPLAY_CONTENT_TYPE_GRAPHICS : hdmi_info.bits.CN0_CN1 =0 ;
drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c +2 -0
@@ -569,6 +569,8 @@ static void populate_dml_timing_cfg_from_stream_state(struct dml_timing_cfg_st * out->RefreshRate[location] = ((in->timing.pix_clk_100hz *100 ) / in->timing.h_total) / in->timing.v_total; out->VFrontPorch[location] = in->timing.v_front_porch; out->PixelClock[location] = in->timing.pix_clk_100hz /10000.00 ; +if (in->timing.timing_3d_format ==TIMING_3D_FORMAT_HW_FRAME_PACKING ) + out->PixelClock[location] *=2 ; out->HTotal[location] = in->timing.h_total; out->VTotal[location] = in->timing.v_total; out->Interlace[location] = in->timing.flags.INTERLACE;
Signature · 1 line
2.34.1
PATCH 13/26 drm/amd/display: Revert "drm/amd/display: allow edp updates for virtual signal"
In reply to [email protected]From: Alex Hung <[email protected]>
This reverts commit 4ad3ee5ccc77aa3f9d702f7b9ad4d9cfeca6c443.
[WHY & HOW]
Virtual signal is not supported as audio capable by DC.
--- drivers/gpu/drm/amd/display/include/signal_types.h | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/display/include/signal_types.h +0 -1
@@ -132,7 +132,6 @@ static inline bool dc_is_audio_capable_signal(enum signal_type signal) {return (signal ==SIGNAL_TYPE_DISPLAY_PORT || signal ==SIGNAL_TYPE_DISPLAY_PORT_MST || - signal ==SIGNAL_TYPE_VIRTUAL ||dc_is_hdmi_signal (signal)); }
Signature · 1 line
2.34.1
PATCH 14/26 drm/amd/display: Set emulated sink type to HDMI accordingly.
In reply to [email protected]From: Alex Hung <[email protected]>
[WHY & HOW]
Virtual sink is not audio-capable and this causes kms_hdmi_inject's inject-audio to fail. Set it to HDMI according to EDID.
--- 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
@@ -6593,6 +6593,9 @@ static void create_eml_sink(struct amdgpu_dm_connector *aconnector)return ; } +if (drm_detect_hdmi_monitor (edid)) + init_params.sink_signal =SIGNAL_TYPE_HDMI_TYPE_A ; + aconnector->edid = edid; aconnector->dc_em_sink = dc_link_add_remote_sink(
Signature · 1 line
2.34.1
PATCH 15/26 drm/amd/display: Correct enum typo
In reply to [email protected]From: Rodrigo Siqueira <[email protected]>
This commit just replaces dc_interrupt_po*r*larity with its correct name, which is dc_interrupt_polarity.
--- drivers/gpu/drm/amd/display/dc/irq_types.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/irq_types.h +3 -3
@@ -178,7 +178,7 @@ enum dc_interrupt_context {INTERRUPT_CONTEXT_NUMBER }; -enum dc_interrupt_porlarity { +enum dc_interrupt_polarity {INTERRUPT_POLARITY_DEFAULT =0 ,INTERRUPT_POLARITY_LOW =INTERRUPT_POLARITY_DEFAULT ,INTERRUPT_POLARITY_HIGH ,
@@ -199,12 +199,12 @@ struct dc_interrupt_params {/* The polarity *change* which will trigger an interrupt. * If 'requested_polarity == INTERRUPT_POLARITY_BOTH', then * 'current_polarity' must be initialised. */ -enum dc_interrupt_porlarity requested_polarity; +enum dc_interrupt_polarity requested_polarity;/* If 'requested_polarity == INTERRUPT_POLARITY_BOTH', * 'current_polarity' should contain the current state, which means * the interrupt will be triggered when state changes from what is, * in 'current_polarity'. */ -enum dc_interrupt_porlarity current_polarity; +enum dc_interrupt_polarity current_polarity;enum dc_irq_source irq_source;enum dc_interrupt_context int_context; };
Signature · 1 line
2.34.1
PATCH 16/26 drm/amd/display: Add prefix to amdgpu crtc functions
In reply to [email protected]From: Rodrigo Siqueira <[email protected]>
The ftrace debug feature allows filtering functions based on a prefix, which can be helpful in some complex debug scenarios. The driver can benefit more from this feature if the function name follows some patterns; for this reason, this commit adds the prefix amdgpu_dm_crtc_ to all the functions that do not have it in the amdgpu_dm_crtc.c file.
--- .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +24 -24
@@ -95,7 +95,7 @@ bool amdgpu_dm_crtc_vrr_active(struct dm_crtc_state *dm_state) dm_state->freesync_config.state ==VRR_STATE_ACTIVE_FIXED ; } -static void vblank_control_worker (struct work_struct *work) +static void amdgpu_dm_crtc_vblank_control_worker (struct work_struct *work) {struct vblank_control_work *vblank_work = container_of(work, struct vblank_control_work, work);
@@ -144,7 +144,7 @@ static void vblank_control_worker(struct work_struct *work)kfree (vblank_work); } -static inline int dm_set_vblank (struct drm_crtc *crtc,bool enable) +static inline int amdgpu_dm_crtc_set_vblank (struct drm_crtc *crtc,bool enable) {struct amdgpu_crtc *acrtc =to_amdgpu_crtc (crtc);struct amdgpu_device *adev =drm_to_adev (crtc->dev);
@@ -184,7 +184,7 @@ static inline int dm_set_vblank(struct drm_crtc *crtc, bool enable)if (!work)return -ENOMEM ; -INIT_WORK (&work->work, vblank_control_worker); +INIT_WORK (&work->work, amdgpu_dm_crtc_vblank_control_worker); work->dm = dm; work->acrtc = acrtc; work->enable = enable;
@@ -202,15 +202,15 @@ static inline int dm_set_vblank(struct drm_crtc *crtc, bool enable)int amdgpu_dm_crtc_enable_vblank (struct drm_crtc *crtc) { -return dm_set_vblank (crtc, true); +return amdgpu_dm_crtc_set_vblank (crtc, true); }void amdgpu_dm_crtc_disable_vblank (struct drm_crtc *crtc) { -dm_set_vblank (crtc, false); +amdgpu_dm_crtc_set_vblank (crtc, false); } -static void dm_crtc_destroy_state (struct drm_crtc *crtc, +static void amdgpu_dm_crtc_destroy_state (struct drm_crtc *crtc,struct drm_crtc_state *state) {struct dm_crtc_state *cur =to_dm_crtc_state (state);
@@ -226,7 +226,7 @@ static void dm_crtc_destroy_state(struct drm_crtc *crtc,kfree (state); } -static struct drm_crtc_state *dm_crtc_duplicate_state (struct drm_crtc *crtc) +static struct drm_crtc_state *amdgpu_dm_crtc_duplicate_state (struct drm_crtc *crtc) {struct dm_crtc_state *state, *cur;
@@ -266,12 +266,12 @@ static void amdgpu_dm_crtc_destroy(struct drm_crtc *crtc)kfree (crtc); } -static void dm_crtc_reset_state (struct drm_crtc *crtc) +static void amdgpu_dm_crtc_reset_state (struct drm_crtc *crtc) {struct dm_crtc_state *state;if (crtc->state) -dm_crtc_destroy_state (crtc, crtc->state); +amdgpu_dm_crtc_destroy_state (crtc, crtc->state); state =kzalloc (sizeof (*state),GFP_KERNEL );if (WARN_ON (!state))
@@ -291,12 +291,12 @@ static int amdgpu_dm_crtc_late_register(struct drm_crtc *crtc)/* Implemented only the options currently available for the driver */ static const struct drm_crtc_funcs amdgpu_dm_crtc_funcs = { - .reset = dm_crtc_reset_state, + .reset = amdgpu_dm_crtc_reset_state, .destroy = amdgpu_dm_crtc_destroy, .set_config = drm_atomic_helper_set_config, .page_flip = drm_atomic_helper_page_flip, - .atomic_duplicate_state = dm_crtc_duplicate_state, - .atomic_destroy_state = dm_crtc_destroy_state, + .atomic_duplicate_state = amdgpu_dm_crtc_duplicate_state, + .atomic_destroy_state = amdgpu_dm_crtc_destroy_state, .set_crc_source = amdgpu_dm_crtc_set_crc_source, .verify_crc_source = amdgpu_dm_crtc_verify_crc_source, .get_crc_sources = amdgpu_dm_crtc_get_crc_sources,
@@ -309,11 +309,11 @@ static const struct drm_crtc_funcs amdgpu_dm_crtc_funcs = {#endif }; -static void dm_crtc_helper_disable (struct drm_crtc *crtc) +static void amdgpu_dm_crtc_helper_disable (struct drm_crtc *crtc) { } -static int count_crtc_active_planes (struct drm_crtc_state *new_crtc_state) +static int amdgpu_dm_crtc_count_crtc_active_planes (struct drm_crtc_state *new_crtc_state) {struct drm_atomic_state *state = new_crtc_state->state;struct drm_plane *plane;
@@ -345,8 +345,8 @@ static int count_crtc_active_planes(struct drm_crtc_state *new_crtc_state)return num_active; } -static void dm_update_crtc_active_planes (struct drm_crtc *crtc, -struct drm_crtc_state *new_crtc_state) +static void amdgpu_dm_crtc_update_crtc_active_planes (struct drm_crtc *crtc, +struct drm_crtc_state *new_crtc_state) {struct dm_crtc_state *dm_new_crtc_state =to_dm_crtc_state (new_crtc_state);
@@ -357,18 +357,18 @@ static void dm_update_crtc_active_planes(struct drm_crtc *crtc,return ; dm_new_crtc_state->active_planes = -count_crtc_active_planes (new_crtc_state); +amdgpu_dm_crtc_count_crtc_active_planes (new_crtc_state); } -static bool dm_crtc_helper_mode_fixup (struct drm_crtc *crtc, +static bool amdgpu_dm_crtc_helper_mode_fixup (struct drm_crtc *crtc,const struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode) {return true; } -static int dm_crtc_helper_atomic_check (struct drm_crtc *crtc, -struct drm_atomic_state *state) +static int amdgpu_dm_crtc_helper_atomic_check (struct drm_crtc *crtc, +struct drm_atomic_state *state) {struct drm_crtc_state *crtc_state =drm_atomic_get_new_crtc_state (state, crtc);
@@ -379,7 +379,7 @@ static int dm_crtc_helper_atomic_check(struct drm_crtc *crtc,trace_amdgpu_dm_crtc_atomic_check (crtc_state); -dm_update_crtc_active_planes (crtc, crtc_state); +amdgpu_dm_crtc_update_crtc_active_planes (crtc, crtc_state);if (WARN_ON (unlikely (!dm_crtc_state->stream &&amdgpu_dm_crtc_modeset_required (crtc_state,NULL , dm_crtc_state->stream)))) {
@@ -410,9 +410,9 @@ static int dm_crtc_helper_atomic_check(struct drm_crtc *crtc, }static const struct drm_crtc_helper_funcs amdgpu_dm_crtc_helper_funcs = { - .disable = dm_crtc_helper_disable, - .atomic_check = dm_crtc_helper_atomic_check, - .mode_fixup = dm_crtc_helper_mode_fixup, + .disable = amdgpu_dm_crtc_helper_disable, + .atomic_check = amdgpu_dm_crtc_helper_atomic_check, + .mode_fixup = amdgpu_dm_crtc_helper_mode_fixup, .get_scanout_position = amdgpu_crtc_get_scanout_position, };
Signature · 1 line
2.34.1
PATCH 17/26 drm/amd/display: Add prefix for plane functions
In reply to [email protected]From: Rodrigo Siqueira <[email protected]>
This commit adds the amdgpu_dm_plane_ prefix for all functions in the amdgpu_dm_plane.c. This change enables an easy way to filter code paths via ftrace.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- .../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 542 +++++++++--------- .../amd/display/amdgpu_dm/amdgpu_dm_plane.h | 2 +- 3 files changed, 275 insertions(+), 271 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
@@ -10144,7 +10144,7 @@ static int dm_update_plane_state(struct dc *dc,/* Block top most plane from being a video plane */ if (plane->type ==DRM_PLANE_TYPE_OVERLAY ) { -if (is_video_format (new_plane_state->fb->format->format) && *is_top_most_overlay) +if (amdgpu_dm_plane_is_video_format (new_plane_state->fb->format->format) && *is_top_most_overlay)return -EINVAL ; *is_top_most_overlay = false;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +273 -269
820 lines not on this page · raw message
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.h +1 -1
@@ -62,5 +62,5 @@ void amdgpu_dm_plane_fill_blending_from_plane_state(const struct drm_plane_state bool *per_pixel_alpha, bool *pre_multiplied_alpha, bool *global_alpha, int *global_alpha_value); -bool is_video_format (uint32_t format); +bool amdgpu_dm_plane_is_video_format (uint32_t format);#endif
Signature · 1 line
2.34.1
PATCH 18/26 drm/amd/display: fix num_ways overflow error
In reply to [email protected]From: Samson Tam <[email protected]>
[Why]
Helper function calculates num_ways using 32-bit. But is
returned as 8-bit. If num_ways exceeds 8-bit, then it reports back the incorrect num_ways and erroneously uses MALL when it should not
[How]
Make returned value 32-bit and convert after it checks
against caps.cache_num_ways, which is under 8-bit
--- drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c +4 -3
@@ -217,7 +217,7 @@ static bool dcn32_check_no_memory_request_for_cab(struct dc *dc)static uint32_t dcn32_calculate_cab_allocation (struct dc *dc,struct dc_state *ctx) {int i; -uint8_t num_ways =0 ; +uint32_t num_ways =0 ;uint32_t mall_ss_size_bytes =0 ; mall_ss_size_bytes = ctx->bw_ctx.bw.dcn.mall_ss_size_bytes;
@@ -247,7 +247,8 @@ static uint32_t dcn32_calculate_cab_allocation(struct dc *dc, struct dc_state *cbool dcn32_apply_idle_power_optimizations (struct dc *dc,bool enable) {union dmub_rb_cmd cmd; -uint8_t ways, i; +uint8_t i; +uint32_t ways;int j;bool mall_ss_unsupported = false;struct dc_plane_state *plane =NULL ;
@@ -307,7 +308,7 @@ bool dcn32_apply_idle_power_optimizations(struct dc *dc, bool enable) cmd.cab.header.type =DMUB_CMD__CAB_FOR_SS ; cmd.cab.header.sub_type =DMUB_CMD__CAB_DCN_SS_FIT_IN_CAB ; cmd.cab.header.payload_bytes =sizeof (cmd.cab) -sizeof (cmd.cab.header); - cmd.cab.cab_alloc_ways = ways; + cmd.cab.cab_alloc_ways = (uint8_t )ways;dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_NO_WAIT );
Signature · 1 line
2.34.1
PATCH 19/26 drm/amd/display: Update FAMS sequence for DCN30 & DCN32
In reply to [email protected]From: Alvin Lee <[email protected]>
Provide DCN32 specific sequence and update DCN30 sequence
--- .../gpu/drm/amd/display/dc/dcn32/dcn32_init.c | 2 +- .../amd/display/dc/hwss/dcn30/dcn30_hwseq.c | 21 ++----------- .../amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 31 +++++++++++++++++++ .../amd/display/dc/hwss/dcn32/dcn32_hwseq.h | 3 ++ 4 files changed, 38 insertions(+), 19 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c +1 -1
@@ -60,7 +60,7 @@ static const struct hw_sequencer_funcs dcn32_funcs = { .pipe_control_lock = dcn20_pipe_control_lock, .interdependent_update_lock = dcn10_lock_all_pipes, .cursor_lock = dcn10_cursor_lock, - .prepare_bandwidth = dcn30_prepare_bandwidth, + .prepare_bandwidth = dcn32_prepare_bandwidth, .optimize_bandwidth = dcn20_optimize_bandwidth, .update_bandwidth = dcn20_update_bandwidth, .set_drr = dcn10_set_drr,
drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c +3 -18
@@ -997,11 +997,7 @@ void dcn30_set_disp_pattern_generator(const struct dc *dc,void dcn30_prepare_bandwidth (struct dc *dc,struct dc_state *context) { -bool p_state_change_support = context->bw_ctx.bw.dcn.clk.p_state_change_support; -/* Any transition into an FPO config should disable MCLK switching first to avoid -* driver and FW P-State synchronization issues. -*/ -if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching || dc->clk_mgr->clks.fw_based_mclk_switching) { +if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching && !dc->clk_mgr->clks.fw_based_mclk_switching) { dc->optimized_required = true; context->bw_ctx.bw.dcn.clk.p_state_change_support = false; }
@@ -1012,20 +1008,9 @@ void dcn30_prepare_bandwidth(struct dc *dc, dc->clk_mgr->funcs->set_max_memclk (dc->clk_mgr, dc->clk_mgr->bw_params->clk_table.entries[dc->clk_mgr->bw_params->clk_table.num_entries -1 ].memclk_mhz);dcn20_prepare_bandwidth (dc, context); -/* -* enabled -> enabled: do not disable -* enabled -> disabled: disable -* disabled -> enabled: don't care -* disabled -> disabled: don't care -*/ -if (!context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching) -dc_dmub_srv_p_state_delegate (dc, false, context); -if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching || dc->clk_mgr->clks.fw_based_mclk_switching) { -/* After disabling P-State, restore the original value to ensure we get the correct P-State -* on the next optimize. */ - context->bw_ctx.bw.dcn.clk.p_state_change_support = p_state_change_support; - } +if (!dc->clk_mgr->clks.fw_based_mclk_switching) +dc_dmub_srv_p_state_delegate (dc, false, context); } void dcn30_set_static_screen_control(struct pipe_ctx **pipe_ctx,
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c +31 -0
@@ -50,6 +50,7 @@#include "dce/dmub_hw_lock_mgr.h" #include "dcn32/dcn32_resource.h" #include "link.h" +#include "../dcn20/dcn20_hwseq.h" #define DC_LOGGER_INIT (logger)
@@ -1677,3 +1678,33 @@ bool dcn32_is_pipe_topology_transition_seamless(struct dc *dc,return is_seamless; } + +void dcn32_prepare_bandwidth (struct dc *dc, +struct dc_state *context) +{ +bool p_state_change_support = context->bw_ctx.bw.dcn.clk.p_state_change_support; +/* Any transition into an FPO config should disable MCLK switching first to avoid +* driver and FW P-State synchronization issues. +*/ +if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching || dc->clk_mgr->clks.fw_based_mclk_switching) { + dc->optimized_required = true; + context->bw_ctx.bw.dcn.clk.p_state_change_support = false; + } + +if (dc->clk_mgr->dc_mode_softmax_enabled) +if (dc->clk_mgr->clks.dramclk_khz <= dc->clk_mgr->bw_params->dc_mode_softmax_memclk *1000 && + context->bw_ctx.bw.dcn.clk.dramclk_khz > dc->clk_mgr->bw_params->dc_mode_softmax_memclk *1000 ) + dc->clk_mgr->funcs->set_max_memclk (dc->clk_mgr, dc->clk_mgr->bw_params->clk_table.entries[dc->clk_mgr->bw_params->clk_table.num_entries -1 ].memclk_mhz); + +dcn20_prepare_bandwidth (dc, context); + +if (!context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching) +dc_dmub_srv_p_state_delegate (dc, false, context); + +if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching || dc->clk_mgr->clks.fw_based_mclk_switching) { +/* After disabling P-State, restore the original value to ensure we get the correct P-State +* on the next optimize. +*/ + context->bw_ctx.bw.dcn.clk.p_state_change_support = p_state_change_support; + } +}
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.h +3 -0
@@ -124,4 +124,7 @@ bool dcn32_is_pipe_topology_transition_seamless(struct dc *dc,const struct dc_state *cur_ctx, const struct dc_state *new_ctx); +void dcn32_prepare_bandwidth (struct dc *dc, +struct dc_state *context); +#endif /* __DC_HWSS_DCN32_H__ */
Signature · 1 line
2.34.1
PATCH 20/26 drm/amd/display: add null check for invalid opps
In reply to [email protected]From: Samson Tam <[email protected]>
[Why]
In cases where number of pipes available is less
than num_opp, there will opp instances that are
null
[How]
Add null check to skip over these opp instances
--- 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
@@ -3512,7 +3512,8 @@ static void wait_for_outstanding_hw_updates(struct dc *dc, const struct dc_state mpcc_inst = hubp->inst;// MPCC inst is equal to pipe index in practice for (opp_inst =0 ; opp_inst < opp_count; opp_inst++) { -if (dc->res_pool->opps[opp_inst]->mpcc_disconnect_pending[mpcc_inst]) { +if ((dc->res_pool->opps[opp_inst] !=NULL ) && + (dc->res_pool->opps[opp_inst]->mpcc_disconnect_pending[mpcc_inst])) { dc->res_pool->mpc->funcs->wait_for_idle (dc->res_pool->mpc, mpcc_inst); dc->res_pool->opps[opp_inst]->mpcc_disconnect_pending[mpcc_inst] = false;break ;
Signature · 1 line
2.34.1
PATCH 21/26 drm/amd/display: Fix shaper using bad LUT params
In reply to [email protected]From: Ilya Bakoulin <[email protected]>
[Why]
LUT params are not cleared after setting blend TF, which can lead to same params being used for the shaper, if the shaper func is bypassed.
[How]
Set lut_params to NULL after program_1dlut.
--- drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c +1 -0
@@ -494,6 +494,7 @@ bool dcn32_set_mcm_luts( } } result = mpc->funcs->program_1dlut (mpc, lut_params, mpcc_id); + lut_params =NULL ;// Shaper if (plane_state->in_shaper_func) {
Signature · 1 line
2.34.1
PATCH 22/26 drm/amd/display: 3.2.256
In reply to [email protected]From: Aric Cyr <[email protected]>
DC v3.2.256
Summary:
* Fixes null-deref regression after
"drm/amd/display: Update OPP counter from new interface"
* Fixes display flashing when VSR and HDR enabled on dcn32
* Fixes dcn3x intermittent hangs due to FPO
* Fixes MST Multi-Stream light up on dcn35
* Fixes green screen on DCN31x when DVI and HDMI monitors attached
* Adds DML2 improvements
* Adds idle power optimization improvements
* Accommodates panels with lower nit backlight
* Updates SDP VSC colorimetry from DP test automation request
* Reverts "drm/amd/display: allow edp updates for virtual signal"
* Removes duplicated edp relink to fastboot
--- 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
@@ -49,7 +49,7 @@ struct aux_payload;struct set_config_cmd_payload ;struct dmub_notification ; -#define DC_VER "3.2.255" +#define DC_VER "3.2.256"#define MAX_SURFACES 3#define MAX_PLANES 6
Signature · 1 line
2.34.1
PATCH 23/26 drm/amd/display: Disable SYMCLK32_SE RCO on DCN314
In reply to [email protected]From: Michael Strauss <[email protected]>
[WHY]
Currently causes some DP link layer failures, backing out until the failures are root caused.
--- drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +1 -1
@@ -916,7 +916,7 @@ static const struct dc_debug_options debug_defaults_drv = { .hdmistream = true, .hdmichar = true, .dpstream = true, - .symclk32_se = true, + .symclk32_se = false, .symclk32_le = true, .symclk_fe = true, .physymclk = true,
Signature · 1 line
2.34.1
PATCH 24/26 drm/amd/display: Read before writing Backlight Mode Set Register
In reply to [email protected]From: Iswara Nagulendran <[email protected]>
[HOW&WHY]
Reading the value fromDP_EDP_BACKLIGHT_MODE_SET_REGISTER, DPCD 0x721
before setting theBP_EDP_PANEL_LUMINANC_CONTROL_ENABLE bit
to ensure there are no accidental overwrites.
--- .../amd/display/dc/link/protocols/link_edp_panel_control.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c +6 -1
@@ -182,7 +182,7 @@ bool edp_set_backlight_level_nits(struct dc_link *link, &backlight_control, 1) != DC_OK)return false; }else { -const uint8_t backlight_enable =DP_EDP_PANEL_LUMINANCE_CONTROL_ENABLE ; +uint8_t backlight_enable =0 ;struct target_luminance_value *target_luminance =NULL ;//if target luminance value is greater than 24 bits, clip the value to 24 bits
@@ -191,6 +191,11 @@ bool edp_set_backlight_level_nits(struct dc_link *link, target_luminance = (struct target_luminance_value *)&backlight_millinits; +core_link_read_dpcd (link,DP_EDP_BACKLIGHT_MODE_SET_REGISTER , + &backlight_enable,sizeof (uint8_t )); + + backlight_enable |=DP_EDP_PANEL_LUMINANCE_CONTROL_ENABLE ; +if (core_link_write_dpcd (link,DP_EDP_BACKLIGHT_MODE_SET_REGISTER , &backlight_enable,sizeof (backlight_enable)) !=DC_OK )
Signature · 1 line
2.34.1
PATCH 25/26 drm/amd/display: fix compilation warning in dml2
In reply to [email protected]From: Qingqing Zhuo <[email protected]>
[Why]
dml2_dc_resource_mgmt.c:792:3: error:
enumeration value ‘dml_odm_mode_split_1to2’ not
handled in switch [-Werror=switch]
792 | switch (disp_cfg->hw.ODMMode[cfg_idx]) {
| ^~~~~~[How]
Add default case for switch.
--- drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c +2 -0
@@ -791,6 +791,8 @@ static unsigned int get_odm_factor(return 2 ;case dml_odm_mode_combine_4to1:return 4 ; +default : +break ; }ASSERT (false);return 1 ;
Signature · 1 line
2.34.1
Re: [PATCH 25/26] drm/amd/display: fix compilation warning in dml2
Quoted 9 lines · On 10/18/23 13:41, [email protected] wrote:
From: Qingqing Zhuo <[email protected]>
[Why]
dml2_dc_resource_mgmt.c:792:3: error:
enumeration value ‘dml_odm_mode_split_1to2’ not
handled in switch [-Werror=switch]792 | switch (disp_cfg->hw.ODMMode[cfg_idx]) { | ^~~~~~
Quoted 7 lines
[How]
Add default case for switch.Reviewed-by Rodrigo Siqueira <[email protected]>Reviewed-by Jun Lei <[email protected]>Acked-by Roman Li <[email protected]>Signed-off-by Qingqing Zhuo <[email protected]>
If this was introduced by this series, you should squash this patch into the problematic patch.
Quoted 17 lines
--- drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c +2
-0@@ -791,6 +791,8 @@ static unsigned int get_odm_factor(return 2 ;case dml_odm_mode_combine_4to1:return 4 ; +default : +break ; }ASSERT (false);return 1 ;
Signature · 1 line
Hamza
PATCH 26/26 drm/amd/display: add interface to query SubVP status
In reply to [email protected]From: Aurabindo Pillai <[email protected]>
[Why&How]
To enable automated testing through IGT, expose an API that is accessible through debugfs to query current status of SubVP feature.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 4 ++++ drivers/gpu/drm/amd/display/dc/dc.h | 1 + drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c | 3 ++- drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c | 3 ++- 4 files changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +4 -0
@@ -3645,7 +3645,9 @@ static int capabilities_show(struct seq_file *m, void *unused)struct amdgpu_device *adev = (struct amdgpu_device *)m->private;struct dc *dc = adev->dm.dc;bool mall_supported = dc->caps.mall_size_total; +bool subvp_supported = dc->caps.subvp_fw_processing_delay_us;unsigned int mall_in_use = false; +unsigned int subvp_in_use = dc->cap_funcs.get_subvp_en (dc, dc->current_state);struct hubbub *hubbub = dc->res_pool->hubbub;if (hubbub->funcs->get_mall_en)
@@ -3653,6 +3655,8 @@ static int capabilities_show(struct seq_file *m, void *unused)seq_printf (m,"mall supported: %s, enabled: %s\n" , mall_supported ?"yes" :"no" , mall_in_use ?"yes" :"no" ); +seq_printf (m,"sub-viewport supported: %s, enabled: %s\n" , + subvp_supported ?"yes" :"no" , subvp_in_use ?"yes" :"no" );return 0 ; }
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -382,6 +382,7 @@ struct dc_cap_funcs {bool (*get_dcc_compression_cap)(const struct dc *dc,const struct dc_dcc_surface_param *input,struct dc_surface_dcc_cap *output); +bool (*get_subvp_en)(struct dc *dc,struct dc_state *context); };struct link_training_settings ;
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +2 -1
@@ -1993,7 +1993,8 @@ int dcn32_populate_dml_pipes_from_context( }static struct dc_cap_funcs cap_funcs = { - .get_dcc_compression_cap = dcn20_get_dcc_compression_cap + .get_dcc_compression_cap = dcn20_get_dcc_compression_cap, + .get_subvp_en = dcn32_subvp_in_use, }; void dcn32_calculate_wm_and_dlg(struct dc *dc, struct dc_state *context,
drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c +2 -1
@@ -1570,7 +1570,8 @@ static void dcn321_destroy_resource_pool(struct resource_pool **pool) }static struct dc_cap_funcs cap_funcs = { - .get_dcc_compression_cap = dcn20_get_dcc_compression_cap + .get_dcc_compression_cap = dcn20_get_dcc_compression_cap, + .get_subvp_en = dcn32_subvp_in_use, };static void dcn321_update_bw_bounding_box (struct dc *dc,struct clk_bw_params *bw_params)
Signature · 1 line
2.34.1