DC Patches September 25, 2020
Subsystems (3)
cover DC Patches September 25, 2020
This DC patchset brings improvements in multiple areas. In summary, we highlight:
* P-state refinements;
* Improvements on DSC
* Updates on NV1x
Best Regards
Alvin Lee (1):
drm/amd/display: Update NV1x SR latency values
Anthony Koo (1):
drm/amd/display: [FW Promotion] Release 0.0.35
Aric Cyr (1):
drm/amd/display: Revert check for flip pending before locking pipes
Chiawen Huang (2):
drm/amd/display: disable stream if pixel clock changed with link
active
drm/amd/display: disable stream if pixel clock changed with link
active
Eric Bernstein (1):
drm/amd/display: Add dp_set_dsc_pps_info_packet to virtual stream
encoder
Joshua Aberback (1):
drm/amd/display: Calc DLG from dummy p-state if full p-state
unsupported
Wesley Chalmers (1):
drm/amd/display: Add debug param to force dio disable
Wyatt Wood (1):
drm/amd/display: Ensure all debug bits are passed to fw
drivers/gpu/drm/amd/display/dc/core/dc.c | 74 +++++++++- .../drm/amd/display/dc/core/dc_link_hwss.c | 21 +-- drivers/gpu/drm/amd/display/dc/dc.h | 2 + drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 5 +- .../display/dc/dce110/dce110_hw_sequencer.c | 2 +- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 12 +- .../amd/display/dc/dcn10/dcn10_hw_sequencer.h | 2 +- .../drm/amd/display/dc/dcn20/dcn20_resource.c | 4 +- .../drm/amd/display/dc/dcn30/dcn30_resource.c | 114 +++++++++------ .../drm/amd/display/dc/dcn30/dcn30_resource.h | 5 + .../gpu/drm/amd/display/dc/inc/core_types.h | 2 +- .../gpu/drm/amd/display/dc/inc/hw_sequencer.h | 2 +- .../dc/virtual/virtual_stream_encoder.c | 7 + .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 132 +++++++++++++++++- 14 files changed, 305 insertions(+), 79 deletions(-)
Signature · 6 lines
2.28.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 1/9 drm/amd/display: Update NV1x SR latency values
From: Alvin Lee <[email protected]>
[Why]
HW team measurement requires updating values
[How]
Update bounding box values
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +2 -2
@@ -298,8 +298,8 @@ static struct _vcs_dpi_soc_bounding_box_st dcn2_0_soc = { }, }, .num_states = 5, - .sr_exit_time_us = 8.6, - .sr_enter_plus_exit_time_us = 10.9, + .sr_exit_time_us = 11.6, + .sr_enter_plus_exit_time_us = 13.9, .urgent_latency_us = 4.0, .urgent_latency_pixel_data_only_us = 4.0, .urgent_latency_pixel_mixed_with_vm_data_us = 4.0,
Signature · 6 lines
2.28.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/9 drm/amd/display: Add dp_set_dsc_pps_info_packet to virtual stream encoder
In reply to Rodrigo SiqueiraFrom: Eric Bernstein <[email protected]>
--- .../drm/amd/display/dc/core/dc_link_hwss.c | 21 ++++++++++--------- .../dc/virtual/virtual_stream_encoder.c | 7 +++++++ 2 files changed, 18 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c +11 -10
@@ -493,13 +493,15 @@ void dp_set_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable) OPTC_DSC_DISABLED, 0, 0);/* disable DSC in stream encoder */ -if (dc_is_dp_signal (stream->signal) && !IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { - pipe_ctx->stream_res.stream_enc->funcs->dp_set_dsc_config ( - pipe_ctx->stream_res.stream_enc, -OPTC_DSC_DISABLED ,0 ,0 ); - - pipe_ctx->stream_res.stream_enc->funcs->dp_set_dsc_pps_info_packet ( - pipe_ctx->stream_res.stream_enc, false,NULL ); +if (dc_is_dp_signal (stream->signal)) { + +if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { + pipe_ctx->stream_res.stream_enc->funcs->dp_set_dsc_config ( + pipe_ctx->stream_res.stream_enc, +OPTC_DSC_DISABLED ,0 ,0 ); + pipe_ctx->stream_res.stream_enc->funcs->dp_set_dsc_pps_info_packet ( + pipe_ctx->stream_res.stream_enc, false,NULL ); + } }/* disable DSC block */
@@ -536,7 +538,6 @@ bool dp_set_dsc_enable(struct pipe_ctx *pipe_ctx, bool enable)bool dp_set_dsc_pps_sdp (struct pipe_ctx *pipe_ctx,bool enable) {struct display_stream_compressor *dsc = pipe_ctx->stream_res.dsc; -struct dc *dc = pipe_ctx->stream->ctx->dc;struct dc_stream_state *stream = pipe_ctx->stream;if (!pipe_ctx->stream->timing.flags.DSC || !dsc)
@@ -559,7 +560,7 @@ bool dp_set_dsc_pps_sdp(struct pipe_ctx *pipe_ctx, bool enable)DC_LOG_DSC (" " ); dsc->funcs->dsc_get_packed_pps (dsc, &dsc_cfg, &dsc_packed_pps[0 ]); -if (dc_is_dp_signal (stream->signal) && !IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { +if (dc_is_dp_signal (stream->signal)) {DC_LOG_DSC ("Setting stream encoder DSC PPS SDP for engine %d\n" , (int )pipe_ctx->stream_res.stream_enc->id); pipe_ctx->stream_res.stream_enc->funcs->dp_set_dsc_pps_info_packet( pipe_ctx->stream_res.stream_enc,
@@ -568,7 +569,7 @@ bool dp_set_dsc_pps_sdp(struct pipe_ctx *pipe_ctx, bool enable) } }else {/* disable DSC PPS in stream encoder */ -if (dc_is_dp_signal (stream->signal) && !IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { +if (dc_is_dp_signal (stream->signal)) { pipe_ctx->stream_res.stream_enc->funcs->dp_set_dsc_pps_info_packet ( pipe_ctx->stream_res.stream_enc, false,NULL ); }
drivers/gpu/drm/amd/display/dc/virtual/virtual_stream_encoder.c +7 -0
@@ -99,6 +99,12 @@ static void virtual_setup_stereo_sync( bool enable) {} +static void virtual_stream_encoder_set_dsc_pps_info_packet ( +struct stream_encoder *enc, +bool enable, +uint8_t *dsc_packed_pps) +{} +static const struct stream_encoder_funcs virtual_str_enc_funcs = { .dp_set_odm_combine = virtual_enc_dp_set_odm_combine,
@@ -128,6 +134,7 @@ static const struct stream_encoder_funcs virtual_str_enc_funcs = { .hdmi_reset_stream_attribute = virtual_stream_encoder_reset_hdmi_stream_attribute, .dig_connect_to_otg = virtual_dig_connect_to_otg, .setup_stereo_sync = virtual_setup_stereo_sync, + .dp_set_dsc_pps_info_packet = virtual_stream_encoder_set_dsc_pps_info_packet, }; bool virtual_stream_encoder_construct(
Signature · 6 lines
2.28.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/9 drm/amd/display: Ensure all debug bits are passed to fw
In reply to Rodrigo SiqueiraFrom: Wyatt Wood <[email protected]>
[Why]
Some debug bits are not being copied from driver to fw.
[How]
Copy debug bits properly.
--- drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c +3 -2
@@ -256,10 +256,11 @@ static bool dmub_psr_copy_settings(struct dmub_psr *dmub, copy_settings_data->smu_optimizations_en = psr_context->allow_smu_optimizations; copy_settings_data->frame_delay = psr_context->frame_delay; copy_settings_data->frame_cap_ind = psr_context->psrFrameCaptureIndicationReq; + copy_settings_data->init_sdp_deadline = psr_context->sdpTransmitLineNumDeadline; + copy_settings_data->debug.u32All =0 ; copy_settings_data->debug.bitfields.visual_confirm = dc->dc->debug.visual_confirm ==VISUAL_CONFIRM_PSR ? true : false; - copy_settings_data->debug.bitfields.use_hw_lock_mgr =1 ; - copy_settings_data->init_sdp_deadline = psr_context->sdpTransmitLineNumDeadline; + copy_settings_data->debug.bitfields.use_hw_lock_mgr =1 ;dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd);dc_dmub_srv_cmd_execute (dc->dmub_srv);
Signature · 6 lines
2.28.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/9 drm/amd/display: disable stream if pixel clock changed with link active
In reply to Rodrigo SiqueiraFrom: Chiawen Huang <[email protected]>
[Why]
Vbios uses preferred timing to turn on edp but OS could use other timing. If change pixel clock when link active, there is unexpected garbage on monitor.
[How]
Once pixel clock changed, the driver needs to disable stream.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 62 ++++++++++++++++++- .../display/dc/dce110/dce110_hw_sequencer.c | 2 +- 2 files changed, 60 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +59 -3
@@ -842,6 +842,61 @@ 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; + +/* 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->link->local_sink && + stream->link->local_sink->sink_signal ==SIGNAL_TYPE_EDP ) { + link = stream->link; +break ; + } + +if (link !=NULL ) { +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 (i =0 ; i < dc->res_pool->stream_enc_count; i++) { +if (dc->res_pool->stream_enc[i]->id == enc_inst) { + tg_inst = dc->res_pool->stream_enc[i]->funcs->dig_source_otg ( + dc->res_pool->stream_enc[i]); +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) { +core_link_disable_stream (pipe); + pipe->stream->dpms_off = false; + } + } + } + } + } +} +static void wait_for_no_pipes_pending (struct dc *dc,struct dc_state *context) {int i;
@@ -1278,13 +1333,14 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *cfor (i =0 ; i < context->stream_count; i++) dc_streams[i] = context->streams[i]; -if (!dcb->funcs->is_accelerated_mode (dcb)) +if (!dcb->funcs->is_accelerated_mode (dcb)) { +disable_vbios_mode_if_required (dc, context); dc->hwss.enable_accelerated_mode (dc, context); + } -for (i =0 ; i < context->stream_count; i++) { +for (i =0 ; i < context->stream_count; i++)if (context->streams[i]->apply_seamless_boot_optimization) dc->optimize_seamless_boot_streams++; - }if (context->stream_count > dc->optimize_seamless_boot_streams || context->stream_count ==0 )
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +1 -1
@@ -1654,7 +1654,7 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context)// enable fastboot if backend is enabled on eDP if (edp_link->link_enc->funcs->is_dig_enabled (edp_link->link_enc)) {/* Set optimization flag on eDP stream*/ -if (edp_stream) { +if (edp_stream && edp_link->link_status.link_active) { edp_stream->apply_edp_fast_boot_optimization = true; can_apply_edp_fast_boot = true; }
Signature · 6 lines
2.28.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/9 drm/amd/display: Calc DLG from dummy p-state if full p-state unsupported
In reply to Rodrigo SiqueiraFrom: Joshua Aberback <[email protected]>
[Why]
Currently, when full p-state changes are not supported, DLG parameters are calculated for no p-state support at all. However, we are required to always support dummy p-state changes, so we should instead calculate DLG based on dummy p-state latency when full p-state is unsupported. This behaviour already exists for DCN2.
[How]
- move DLG calculation inside WM calculation
- if p-state unsupported, do not recalculate for set A, instead copy from
set C, and perform DLG calculation with dummy p-state latency
--- .../drm/amd/display/dc/dcn30/dcn30_resource.c | 114 ++++++++++++------ .../drm/amd/display/dc/dcn30/dcn30_resource.h | 5 + .../gpu/drm/amd/display/dc/inc/core_types.h | 2 +- 3 files changed, 80 insertions(+), 41 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c +74 -40
@@ -2127,7 +2127,7 @@ static bool dcn30_internal_validate_bw(return out; } -static void dcn30_calculate_wm( +void dcn30_calculate_wm_and_dlg( struct dc *dc, struct dc_state *context, display_e2e_pipe_params_st *pipes, int pipe_cnt,
@@ -2135,6 +2135,8 @@ static void dcn30_calculate_wm( {int i, pipe_idx;double dcfclk = context->bw_ctx.dml.vba.DCFCLKState[vlevel][context->bw_ctx.dml.vba.maxMpcComb]; +bool pstate_en = context->bw_ctx.dml.vba.DRAMClockChangeSupport[vlevel][context->bw_ctx.dml.vba.maxMpcComb] != + dm_dram_clock_change_unsupported;if (context->bw_ctx.dml.soc.min_dcfclk > dcfclk) dcfclk = context->bw_ctx.dml.soc.min_dcfclk;
@@ -2168,30 +2170,12 @@ static void dcn30_calculate_wm( pipes[0 ].clks_cfg.voltage = vlevel; pipes[0 ].clks_cfg.dcfclk_mhz = dcfclk; -/* Set C: -* DCFCLK: Min Required -* FCLK(proportional to UCLK): 1GHz or Max -* pstate latency overriden to 5us -*/ -if (dc->clk_mgr->bw_params->wm_table.nv_entries[WM_C ].valid) { - context->bw_ctx.dml.soc.dram_clock_change_latency_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_C ].dml_input.pstate_latency_us; - context->bw_ctx.dml.soc.sr_enter_plus_exit_time_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_C ].dml_input.sr_enter_plus_exit_time_us; - context->bw_ctx.dml.soc.sr_exit_time_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_C ].dml_input.sr_exit_time_us; - } - context->bw_ctx.bw.dcn.watermarks.c.urgent_ns =get_wm_urgent (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; - context->bw_ctx.bw.dcn.watermarks.c.cstate_pstate.cstate_enter_plus_exit_ns =get_wm_stutter_enter_exit (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; - context->bw_ctx.bw.dcn.watermarks.c.cstate_pstate.cstate_exit_ns =get_wm_stutter_exit (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; - context->bw_ctx.bw.dcn.watermarks.c.cstate_pstate.pstate_change_ns =get_wm_dram_clock_change (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; - context->bw_ctx.bw.dcn.watermarks.c.pte_meta_urgent_ns =get_wm_memory_trip (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; - 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 ; -/* Set D: * DCFCLK: Min Required * FCLK(proportional to UCLK): 1GHz or Max * sr_enter_exit = 4, sr_exit = 2us */ +/* if (dc->clk_mgr->bw_params->wm_table.nv_entries[WM_D].valid) { context->bw_ctx.dml.soc.dram_clock_change_latency_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_D].dml_input.pstate_latency_us; context->bw_ctx.dml.soc.sr_enter_plus_exit_time_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_D].dml_input.sr_enter_plus_exit_time_us;
@@ -2205,29 +2189,72 @@ static void dcn30_calculate_wm(context->bw_ctx.bw.dcn.watermarks.d.frac_urg_bw_nom = get_fraction_of_urgent_bandwidth(&context->bw_ctx.dml, pipes, pipe_cnt) * 1000; context->bw_ctx.bw.dcn.watermarks.d.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.d.urgent_latency_ns = get_urgent_latency(&context->bw_ctx.dml, pipes, pipe_cnt) * 1000; +*/ -/* Set A: +/* Set C: * DCFCLK: Min Required * FCLK(proportional to UCLK): 1GHz or Max -* -* Set A calculated last so that following calculations are based on Set A +* pstate latency overridden to 5us */ -if (dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A ].valid) { - context->bw_ctx.dml.soc.dram_clock_change_latency_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A ].dml_input.pstate_latency_us; - context->bw_ctx.dml.soc.sr_enter_plus_exit_time_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A ].dml_input.sr_enter_plus_exit_time_us; - context->bw_ctx.dml.soc.sr_exit_time_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A ].dml_input.sr_exit_time_us; +if (dc->clk_mgr->bw_params->wm_table.nv_entries[WM_C ].valid) { +unsigned int min_dram_speed_mts = context->bw_ctx.dml.vba.DRAMSpeed; +unsigned int min_dram_speed_mts_margin =160 ; + + context->bw_ctx.dml.soc.dram_clock_change_latency_us = dc->clk_mgr->bw_params->dummy_pstate_table[0 ].dummy_pstate_latency_us; + +if (context->bw_ctx.dml.vba.DRAMClockChangeSupport[vlevel][context->bw_ctx.dml.vba.maxMpcComb] == dm_dram_clock_change_unsupported) + min_dram_speed_mts = dc->clk_mgr->bw_params->clk_table.entries[dc->clk_mgr->bw_params->clk_table.num_entries -1 ].memclk_mhz *16 ; + +for (i =3 ; i >0 ; i--) { +if ((min_dram_speed_mts + min_dram_speed_mts_margin > dc->clk_mgr->bw_params->dummy_pstate_table[i].dram_speed_mts) && + (min_dram_speed_mts - min_dram_speed_mts_margin < dc->clk_mgr->bw_params->dummy_pstate_table[i].dram_speed_mts)) + context->bw_ctx.dml.soc.dram_clock_change_latency_us = dc->clk_mgr->bw_params->dummy_pstate_table[i].dummy_pstate_latency_us; + } + + context->bw_ctx.dml.soc.sr_enter_plus_exit_time_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_C ].dml_input.sr_enter_plus_exit_time_us; + context->bw_ctx.dml.soc.sr_exit_time_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_C ].dml_input.sr_exit_time_us; } - context->bw_ctx.bw.dcn.watermarks.a.urgent_ns =get_wm_urgent (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; - context->bw_ctx.bw.dcn.watermarks.a.cstate_pstate.cstate_enter_plus_exit_ns =get_wm_stutter_enter_exit (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; - context->bw_ctx.bw.dcn.watermarks.a.cstate_pstate.cstate_exit_ns =get_wm_stutter_exit (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; - context->bw_ctx.bw.dcn.watermarks.a.cstate_pstate.pstate_change_ns =get_wm_dram_clock_change (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; - context->bw_ctx.bw.dcn.watermarks.a.pte_meta_urgent_ns =get_wm_memory_trip (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; - context->bw_ctx.bw.dcn.watermarks.a.frac_urg_bw_nom =get_fraction_of_urgent_bandwidth (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; - context->bw_ctx.bw.dcn.watermarks.a.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.a.urgent_latency_ns =get_urgent_latency (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; - - context->perf_params.stutter_period_us = - context->bw_ctx.dml.vba.StutterPeriod; + context->bw_ctx.bw.dcn.watermarks.c.urgent_ns =get_wm_urgent (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; + context->bw_ctx.bw.dcn.watermarks.c.cstate_pstate.cstate_enter_plus_exit_ns =get_wm_stutter_enter_exit (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; + context->bw_ctx.bw.dcn.watermarks.c.cstate_pstate.cstate_exit_ns =get_wm_stutter_exit (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; + context->bw_ctx.bw.dcn.watermarks.c.cstate_pstate.pstate_change_ns =get_wm_dram_clock_change (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; + context->bw_ctx.bw.dcn.watermarks.c.pte_meta_urgent_ns =get_wm_memory_trip (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; + 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 ; + +if (!pstate_en) { +/* The only difference between A and C is p-state latency, if p-state is not supported we want to +* calculate DLG based on dummy p-state latency, and max out the set A p-state watermark +*/ + context->bw_ctx.bw.dcn.watermarks.a = context->bw_ctx.bw.dcn.watermarks.c; + context->bw_ctx.bw.dcn.watermarks.a.cstate_pstate.pstate_change_ns =0x13FFFF ; + }else { +/* Set A: +* DCFCLK: Min Required +* FCLK(proportional to UCLK): 1GHz or Max +* +* Set A calculated last so that following calculations are based on Set A +*/ +if (dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A ].valid) { + context->bw_ctx.dml.soc.dram_clock_change_latency_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A ].dml_input.pstate_latency_us; + context->bw_ctx.dml.soc.sr_enter_plus_exit_time_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A ].dml_input.sr_enter_plus_exit_time_us; + context->bw_ctx.dml.soc.sr_exit_time_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A ].dml_input.sr_exit_time_us; + } + context->bw_ctx.bw.dcn.watermarks.a.urgent_ns =get_wm_urgent (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; + context->bw_ctx.bw.dcn.watermarks.a.cstate_pstate.cstate_enter_plus_exit_ns =get_wm_stutter_enter_exit (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; + context->bw_ctx.bw.dcn.watermarks.a.cstate_pstate.cstate_exit_ns =get_wm_stutter_exit (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; + context->bw_ctx.bw.dcn.watermarks.a.cstate_pstate.pstate_change_ns =get_wm_dram_clock_change (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; + context->bw_ctx.bw.dcn.watermarks.a.pte_meta_urgent_ns =get_wm_memory_trip (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; + context->bw_ctx.bw.dcn.watermarks.a.frac_urg_bw_nom =get_fraction_of_urgent_bandwidth (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; + context->bw_ctx.bw.dcn.watermarks.a.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.a.urgent_latency_ns =get_urgent_latency (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; + } + + context->perf_params.stutter_period_us = context->bw_ctx.dml.vba.StutterPeriod; + +/* Make set D = set A until set D is enabled */ + context->bw_ctx.bw.dcn.watermarks.d = context->bw_ctx.bw.dcn.watermarks.a;for (i =0 , pipe_idx =0 ; i < dc->res_pool->pipe_count; i++) {if (!context->res_ctx.pipe_ctx[i].stream)
@@ -2247,6 +2274,13 @@ static void dcn30_calculate_wm( pipe_idx++; } + +dcn20_calculate_dlg_params (dc, context, pipes, pipe_cnt, vlevel); + +if (!pstate_en) +/* Restore full p-state latency */ + context->bw_ctx.dml.soc.dram_clock_change_latency_us = + dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A ].dml_input.pstate_latency_us; } bool dcn30_validate_bandwidth(struct dc *dc,
@@ -2279,8 +2313,7 @@ bool dcn30_validate_bandwidth(struct dc *dc, goto validate_out; } -dcn30_calculate_wm (dc, context, pipes, pipe_cnt, vlevel); -dcn20_calculate_dlg_params (dc, context, pipes, pipe_cnt, vlevel); + dc->res_pool->funcs->calculate_wm_and_dlg (dc, context, pipes, pipe_cnt, vlevel);BW_VAL_TRACE_END_WATERMARKS ();
@@ -2448,6 +2481,7 @@ static const struct resource_funcs dcn30_res_pool_funcs = { .link_enc_create = dcn30_link_encoder_create, .panel_cntl_create = dcn30_panel_cntl_create, .validate_bandwidth = dcn30_validate_bandwidth, + .calculate_wm_and_dlg = dcn30_calculate_wm_and_dlg, .populate_dml_pipes = dcn30_populate_dml_pipes_from_context, .acquire_idle_pipe_for_layer = dcn20_acquire_idle_pipe_for_layer, .add_stream_to_ctx = dcn30_add_stream_to_ctx,
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.h +5 -0
@@ -55,6 +55,11 @@ unsigned int dcn30_calc_max_scaled_time(bool dcn30_validate_bandwidth (struct dc *dc,struct dc_state *context,bool fast_validate); +void dcn30_calculate_wm_and_dlg ( +struct dc *dc,struct dc_state *context, +display_e2e_pipe_params_st *pipes, +int pipe_cnt, +int vlevel);void dcn30_populate_dml_writeback_from_context (struct dc *dc,struct resource_context *res_ctx,display_e2e_pipe_params_st *pipes);
drivers/gpu/drm/amd/display/dc/inc/core_types.h +1 -1
@@ -101,7 +101,7 @@ struct resource_funcs {struct dc *dc, struct dc_state *context, bool fast_validate); - void (*calculate_wm)( + void (*calculate_wm_and_dlg)( struct dc *dc, struct dc_state *context, display_e2e_pipe_params_st *pipes, int pipe_cnt,
Signature · 6 lines
2.28.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/9 drm/amd/display: Add debug param to force dio disable
In reply to Rodrigo SiqueiraFrom: Wesley Chalmers <[email protected]>
[WHY]
At the moment, some tests are failing because cur_link_settings is invalid. As a workaround, add an option to force dio disable.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 2 ++ drivers/gpu/drm/amd/display/dc/dc.h | 2 ++ 2 files changed, 4 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -0
@@ -735,6 +735,8 @@ static bool dc_construct(struct dc *dc, dc->clk_mgr->force_smu_not_present = init_params->force_smu_not_present;#endif + dc->debug.force_ignore_link_settings = init_params->force_ignore_link_settings; +if (dc->res_pool->funcs->update_bw_bounding_box) dc->res_pool->funcs->update_bw_bounding_box (dc, dc->clk_mgr->bw_params);
drivers/gpu/drm/amd/display/dc/dc.h +2 -0
@@ -503,6 +503,7 @@ struct dc_debug_options {bool usbc_combo_phy_reset_wa;bool disable_dsc;bool enable_dram_clock_change_one_display_vactive; +bool force_ignore_link_settings; };struct dc_debug_data {
@@ -660,6 +661,7 @@ struct dc_init_data {#if defined(CONFIG_DRM_AMD_DC_DCN3_0 )bool force_smu_not_present;#endif +bool force_ignore_link_settings; };struct dc_callback_init {
Signature · 6 lines
2.28.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/9 drm/amd/display: Revert check for flip pending before locking pipes
In reply to Rodrigo SiqueiraFrom: Aric Cyr <[email protected]>
This reverts commit e82d8eae9e81af243256f70bec593baed50b0bdb.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 11 +++++++++-- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 12 ++---------- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h | 2 +- drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h | 2 +- 4 files changed, 13 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +9 -2
@@ -2384,6 +2384,7 @@ static void commit_planes_for_stream(struct dc *dc,enum surface_update_type update_type, struct dc_state *context) { + bool mpcc_disconnected = false;int i, j;struct pipe_ctx *top_pipe_to_program =NULL ;
@@ -2414,8 +2415,14 @@ static void commit_planes_for_stream(struct dc *dc,context_clock_trace (dc, context); } -if (update_type !=UPDATE_TYPE_FAST && dc->hwss.interdependent_update_lock && dc->hwss.wait_for_pending_cleared) - dc->hwss.disconnect_pipes (dc, context); +if (update_type !=UPDATE_TYPE_FAST && dc->hwss.interdependent_update_lock && + dc->hwss.disconnect_pipes && dc->hwss.wait_for_pending_cleared){ + dc->hwss.interdependent_update_lock (dc, context, true); + mpcc_disconnected = dc->hwss.disconnect_pipes (dc, context); + dc->hwss.interdependent_update_lock (dc, context, false); +if (mpcc_disconnected) + dc->hwss.wait_for_pending_cleared (dc, context); + }for (j =0 ; j < dc->res_pool->pipe_count; j++) {struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[j];
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +2 -10
@@ -2761,7 +2761,7 @@ static struct pipe_ctx *dcn10_find_top_pipe_for_stream(return NULL ; } -void dcn10_disconnect_pipes ( +bool dcn10_disconnect_pipes (struct dc *dc,struct dc_state *context) {
@@ -2772,10 +2772,6 @@ void dcn10_disconnect_pipes(bool mpcc_disconnected = false;struct pipe_ctx *old_pipe;struct pipe_ctx *new_pipe; - - dc->hwss.wait_for_pending_cleared (dc, context); - dc->hwss.interdependent_update_lock (dc, context, true); -DC_LOGGER_INIT (dc->ctx->logger);/* Set pipe update flags and lock pipes */
@@ -2878,11 +2874,7 @@ void dcn10_disconnect_pipes( } } } - - dc->hwss.interdependent_update_lock (dc, context, false); - -if (mpcc_disconnected) - dc->hwss.wait_for_pending_cleared (dc, context); +return mpcc_disconnected; } void dcn10_wait_for_pending_cleared(struct dc *dc,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h +1 -1
@@ -194,7 +194,7 @@ void dcn10_get_surface_visual_confirm_color(void dcn10_get_hdr_visual_confirm_color (struct pipe_ctx *pipe_ctx,struct tg_color *color); -void dcn10_disconnect_pipes ( +bool dcn10_disconnect_pipes (struct dc *dc,struct dc_state *context);
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +1 -1
@@ -67,7 +67,7 @@ struct hw_sequencer_funcs { int num_planes, struct dc_state *context);void (*program_front_end_for_ctx)(struct dc *dc,struct dc_state *context); -void (*disconnect_pipes)(struct dc *dc, +bool (*disconnect_pipes)(struct dc *dc,struct dc_state *context);void (*wait_for_pending_cleared)(struct dc *dc,struct dc_state *context);
Signature · 6 lines
2.28.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 7/9] drm/amd/display: Revert check for flip pending before locking pipes
Quoted 3 lines · Rodrigo Siqueira
From: Aric Cyr <[email protected]>
This reverts commit
e82d8eae9e81af243256f70bec593baed50b0bdb.
Every revert should explain in the commit log why the change is being reverted. (Your future selves might thank you for that someday :)
Signature · 6 lines
Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH 7/9] drm/amd/display: Revert check for flip pending before locking pipes
[AMD Official Use Only - Internal Distribution Only]
It's already un-reverted in latest. They could be squashed IMO.
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, September 25, 2020 11:53
To: Siqueira, Rodrigo <[email protected]>; [email protected]
Cc: Cyr, Aric <[email protected]>; Brol, Eryk <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Zhuo, Qingqing <[email protected]>; Pillai, Aurabindo <[email protected]>; Lakha, Bhawanpreet <[email protected]>
Subject: Re: [PATCH 7/9] drm/amd/display: Revert check for flip pending before locking pipes
Quoted 3 lines · Rodrigo Siqueira
From: Aric Cyr <[email protected]>
This reverts commit
e82d8eae9e81af243256f70bec593baed50b0bdb.
Every revert should explain in the commit log why the change is being reverted. (Your future selves might thank you for that someday :)
Signature · 6 lines
Earthling Michel Dänzer | https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fredhat.com%2F&data=02%7C01%7CAric.Cyr%40amd.com%7Cff8318f7505f48ac4e6008d8616b1050%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637366459764467283&sdata=eeKdB8NNb3tanvw5GToG7YbETY%2FYKnEJQXRsfuE6u5k%3D&reserved=0 Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/9 drm/amd/display: [FW Promotion] Release 0.0.35
In reply to Rodrigo SiqueiraFrom: Anthony Koo <[email protected]>
[Header Changes]
- Definition for retaining ABM settings during disable
- Addition of some new AUX interface definitions
- Addition of some outbox definitions
--- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 132 +++++++++++++++++- 1 file changed, 126 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +126 -6
@@ -36,10 +36,10 @@/* Firmware versioning. */ #ifdef DMUB_EXPOSE_VERSION -#define DMUB_FW_VERSION_GIT_HASH 0xf547f0b9d +#define DMUB_FW_VERSION_GIT_HASH 0x9cf8f05fe#define DMUB_FW_VERSION_MAJOR 0#define DMUB_FW_VERSION_MINOR 0 -#define DMUB_FW_VERSION_REVISION 34 +#define DMUB_FW_VERSION_REVISION 35#define DMUB_FW_VERSION_TEST 0#define DMUB_FW_VERSION_VBIOS 0#define DMUB_FW_VERSION_HOTFIX 0
@@ -57,6 +57,7 @@#define SET_ABM_PIPE_GRADUALLY_DISABLE 0#define SET_ABM_PIPE_IMMEDIATELY_DISABLE 255 +#define SET_ABM_PIPE_IMMEDIATE_KEEP_GAIN_DISABLE 254#define SET_ABM_PIPE_NORMAL 1/* Maximum number of streams on any ASIC. */
@@ -69,10 +70,6 @@#define PHYSICAL_ADDRESS_LOC union large_integer#endif -#if defined(__cplusplus) -extern "C" { -#endif -#ifndef dmub_memcpy#define dmub_memcpy (dest, source, bytes) memcpy((dest), (source), (bytes))#endif
@@ -81,6 +78,10 @@ extern "C" {#define dmub_memset (dest, val, bytes) memset((dest), (val), (bytes))#endif +#if defined(__cplusplus) +extern "C" { +#endif +#ifndef dmub_udelay#define dmub_udelay (microseconds) udelay(microseconds)#endif
@@ -299,11 +300,15 @@ enum dmub_cmd_type {DMUB_CMD__PSR =64 ,DMUB_CMD__ABM =66 ,DMUB_CMD__HW_LOCK =69 , +DMUB_CMD__DP_AUX_ACCESS =70 , +DMUB_CMD__OUTBOX1_ENABLE =71 , DMUB_CMD__VBIOS = 128, };enum dmub_out_cmd_type {DMUB_OUT_CMD__NULL =0 , +DMUB_OUT_CMD__DP_AUX_REPLY =1 , +DMUB_OUT_CMD__DP_HPD_NOTIFY =2 , };#pragma pack(push, 1)
@@ -461,6 +466,78 @@ struct dmub_rb_cmd_dpphy_init {uint8_t reserved[60 ]; }; +enum dp_aux_request_action { +DP_AUX_REQ_ACTION_I2C_WRITE =0x00 , +DP_AUX_REQ_ACTION_I2C_READ =0x10 , +DP_AUX_REQ_ACTION_I2C_STATUS_REQ =0x20 , +DP_AUX_REQ_ACTION_I2C_WRITE_MOT =0x40 , +DP_AUX_REQ_ACTION_I2C_READ_MOT =0x50 , +DP_AUX_REQ_ACTION_I2C_STATUS_REQ_MOT =0x60 , +DP_AUX_REQ_ACTION_DPCD_WRITE =0x80 , +DP_AUX_REQ_ACTION_DPCD_READ =0x90 +}; + +/* DP AUX command */ +struct aux_transaction_parameters { +uint8_t is_i2c_over_aux; +uint8_t action; +uint8_t length; +uint8_t pad; +uint32_t address; +uint8_t data[16 ]; +}; + +struct dmub_cmd_dp_aux_control_data { +uint32_t handle; +uint8_t port_index; +uint8_t sw_crc_enabled; +uint16_t timeout; +struct aux_transaction_parameters dpaux; +}; + +struct dmub_rb_cmd_dp_aux_access { +struct dmub_cmd_header header; +struct dmub_cmd_dp_aux_control_data aux_control; +}; + +struct dmub_rb_cmd_outbox1_enable { +struct dmub_cmd_header header; +uint32_t enable; +}; + +/* DP AUX Reply command - OutBox Cmd */ +struct aux_reply_data { +uint8_t command; +uint8_t length; +uint8_t pad[2 ]; +uint8_t data[16 ]; +}; + +struct aux_reply_control_data { +uint32_t handle; +uint8_t phy_port_index; +uint8_t result; +uint16_t pad; +}; + +struct dmub_rb_cmd_dp_aux_reply { +struct dmub_cmd_header header; +struct aux_reply_control_data control; +struct aux_reply_data reply_data; +}; + +struct dp_hpd_data { +uint8_t phy_port_index; +uint8_t hpd_type; +uint8_t hpd_status; +uint8_t pad; +}; + +struct dmub_rb_cmd_dp_hpd_notify { +struct dmub_cmd_header header; +struct dp_hpd_data hpd_data; +}; +/* * Command IDs should be treated as stable ABI. * Do not reuse or modify IDs.
@@ -690,8 +767,15 @@ union dmub_rb_cmd {struct dmub_rb_cmd_abm_set_ambient_level abm_set_ambient_level;struct dmub_rb_cmd_abm_set_pwm_frac abm_set_pwm_frac;struct dmub_rb_cmd_abm_init_config abm_init_config; +struct dmub_rb_cmd_dp_aux_access dp_aux_access; +struct dmub_rb_cmd_outbox1_enable outbox1_enable; }; +union dmub_rb_out_cmd { +struct dmub_rb_cmd_common cmd_common; +struct dmub_rb_cmd_dp_aux_reply dp_aux_reply; +struct dmub_rb_cmd_dp_hpd_notify dp_hpd_notify; +};#pragma pack(pop)
@@ -764,6 +848,25 @@ static inline bool dmub_rb_push_front(struct dmub_rb *rb,return true; } +static inline bool dmub_rb_out_push_front (struct dmub_rb *rb, +const union dmub_rb_out_cmd *cmd) +{ +uint8_t *dst = (uint8_t *)(rb->base_address) + rb->wrpt; +const uint8_t *src = (uint8_t *)cmd; + +if (dmub_rb_full (rb)) +return false; + +dmub_memcpy (dst, src,DMUB_RB_CMD_SIZE ); + + rb->wrpt +=DMUB_RB_CMD_SIZE ; + +if (rb->wrpt >= rb->capacity) + rb->wrpt %= rb->capacity; + +return true; +} +static inline bool dmub_rb_front (struct dmub_rb *rb,union dmub_rb_cmd *cmd) {
@@ -777,6 +880,23 @@ static inline bool dmub_rb_front(struct dmub_rb *rb,return true; } +static inline bool dmub_rb_out_front (struct dmub_rb *rb, +union dmub_rb_out_cmd *cmd) +{ +const uint64_t volatile *src = (const uint64_t volatile *)(rb->base_address) + rb->rptr /sizeof (uint64_t ); +uint64_t *dst = (uint64_t *)cmd; +int i; + +if (dmub_rb_empty (rb)) +return false; + +// copying data +for (i =0 ; i <DMUB_RB_CMD_SIZE /sizeof (uint64_t ); i++) + *dst++ = *src++; + +return true; +} +static inline bool dmub_rb_pop_front (struct dmub_rb *rb) {if (dmub_rb_empty (rb))
Signature · 6 lines
2.28.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 9/9 drm/amd/display: disable stream if pixel clock changed with link active
In reply to Rodrigo SiqueiraFrom: Chiawen Huang <[email protected]>
[Why]
Vbios uses preferred timing to turn on edp but OS could use other timing. If change pixel clock when link active, there is unexpected garbage on monitor.
[How]
Once pixel clock changed, the driver needs to disable stream.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -1
@@ -864,7 +864,6 @@ static void disable_vbios_mode_if_required(if (stream->link->local_sink && stream->link->local_sink->sink_signal ==SIGNAL_TYPE_EDP ) { link = stream->link; -break ; }if (link !=NULL ) {
Signature · 6 lines
2.28.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx