DC Patches Apr 17th, 2023
cover DC Patches Apr 17th, 2023
This DC patchset brings improvements in multiple areas. In summary, we highlight:
- FW Release 0.0.162.0
- Enable FPO+Vactivate
- Support for VESA SCR on OLED
- Refactor DMUB commands
- Fixes in secure display, modeset, memleak and more
- Picked up missed patches in history
Alan Liu (1):
drm/amd/display: Fix in disabling secure display
Alex Hung (2):
drm/amd/display: allow edp updates for virtual signal drm/amd/display: fix a divided-by-zero error
Alvin Lee (5):
drm/amd/display: Only consider DISPCLK when using optimized boot path drm/amd/display: Reduce SubVP + DRR stretch margin drm/amd/display: Set watermarks set D equal to A drm/amd/display: Enable FPO + Vactive
drm/amd/display: Update DTBCLK for DCN32
Anthony Koo (1):
drm/amd/display: [FW Promotion] Release 0.0.162.0
Aric Cyr (1):
drm/amd/display: 3.2.231
Aurabindo Pillai (13):
drm/amd/display: Fix hang when skipping modeset drm/amd/display: remove incorrect early return drm/amd/display: Fixes for dcn32_clk_mgr implementation drm/amd/display: Do not clear GPINT register when releasing DMUB from
reset
drm/amd/display: Update bounding box values for DCN321 drm/amd/display: add support for low bpc
drm/amd/display: Set DRAM clock if retraining is required drm/amd/display: Add check for PState change in DCN32 drm/amd/display: Remove DET check from DCN32 drm/amd/display: Add extra check for 444 16 format drm/amd/display: Add FAMS capability to DCN31 drm/amd/display: Add FAMS related definitions and documenation for
enum fields
drm/amd/display: remove some unused variables
Cruise Hung (1):
drm/amd/display: Reset OUTBOX0 r/w pointer on DMUB reset
Daniel Miess (1):
drm/amd/display: limit timing for single dimm memory
Dmytro Laktyushkin (4):
drm/amd/display: update max streams per surface
drm/amd/display: add extra dc odm debug options
drm/amd/display: set dcn315 lb bpp to 48
drm/amd/display: Limit nv21 dst_y
Eric Yang (1):
drm/amd/display: add mechanism to skip DCN init
Hersen Wu (2):
drm/amd/display: fix memleak in aconnector->timing_requested drm/amd/display: fix access hdcp_workqueue assert
Igor Kravchenko (1):
drm/amd/display: Set min_width and min_height capability for DCN30
Iswara Nagulendran (1):
drm/amd/display: Adding support for VESA SCR
Jasdeep Dhillon (1):
drm/amd/display: Isolate remaining FPU code in DCN32
Jingwen Zhu (1):
drm/amd/display: Improvement for handling edp link training fails
Josip Pavic (3):
drm/amd/display: copy dmub caps to dc on dcn31 drm/amd/display: refactor dmub commands into single function drm/amd/display: drain dmub inbox if queue is full
Krunoslav Kovac (1):
drm/amd/display: 3-plane MPO enablement for DCN321
Leon Huang (2):
drm/amd/display: Refactor ABM feature
drm/amd/display: Fix ABM pipe/backlight issues when change backlight
Meenakshikumar Somasundaram (1):
drm/amd/display: Adjust dmub outbox notification enable
Michael Mityushkin (2):
drm/amd/display: Correct output color space during HW reinitialize drm/amd/display: Apply correct panel mode when reinitializing hardware
Mikita Lipski (1):
drm/amd/display: Write TEST_EDID_CHECKSUM_WRITE for EDID tests
Nasir Osman (1):
drm/amd/display: DSC policy override when ODM combine is forced
Nicholas Kazlauskas (1):
drm/amd/display: Explicitly specify update type per plane info change
Po-Ting Chen (1):
drm/amd/display: update GSP1 generic info packet for PSRSU
Rodrigo Siqueira (9):
drm/amd/display: Update bouding box values for DCN32 drm/amd/display: Add missing mclk update drm/amd/display: Adjust code identation and other minor details drm/amd/display: Set maximum VStartup if is DCN201 drm/amd/display: Set dp_rate to dm_dp_rate_na by default drm/amd/display: Remove wrong assignment of DP link rate drm/amd/display: Use pointer in the memcpy drm/amd/display: Add missing WA and MCLK validation drm/amd/display: Add FAMS validation before trying to use it
Samson Tam (1):
drm/amd/display: Clear GPINT1 before taking DMCUB out of reset
Sherry Wang (1):
drm/amd/display: correct DML calc error
Tianci Yin (1):
drm/amd/display: Disable migration to ensure consistency of per-CPU
variable
Wesley Chalmers (3):
drm/amd/display: Do not set drr on pipe commit drm/amd/display: Block optimize on consecutive FAMS enables drm/amd/display: Add logging for display MALL refresh setting
Zhongwei (1):
drm/amd/display: fix dpms_off issue when disabling bios mode
hersen wu (1):
drm/amd/display: Return error code on DSC atomic check failure
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 33 ++- .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 31 +- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 31 +- .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 17 +- .../gpu/drm/amd/display/amdgpu_dm/dc_fpu.c | 2 + .../drm/amd/display/dc/bios/command_table2.c | 25 +- .../dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.c | 3 + .../display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c | 4 +- .../dc/clk_mgr/dcn314/dcn314_clk_mgr.c | 4 +- .../dc/clk_mgr/dcn315/dcn315_clk_mgr.c | 4 +- .../dc/clk_mgr/dcn316/dcn316_clk_mgr.c | 4 +- .../display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 32 +++ drivers/gpu/drm/amd/display/dc/core/dc.c | 37 +-- .../gpu/drm/amd/display/dc/core/dc_resource.c | 3 + drivers/gpu/drm/amd/display/dc/dc.h | 5 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 201 +++++-------- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 15 +- drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 7 + drivers/gpu/drm/amd/display/dc/dc_dsc.h | 1 + drivers/gpu/drm/amd/display/dc/dc_helper.c | 28 +- drivers/gpu/drm/amd/display/dc/dc_stream.h | 8 +- drivers/gpu/drm/amd/display/dc/dc_types.h | 2 +- drivers/gpu/drm/amd/display/dc/dce/Makefile | 2 +- drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c | 264 +++++++---------- .../gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c | 272 ++++++++++++++++++ .../gpu/drm/amd/display/dc/dce/dmub_abm_lcd.h | 46 +++ .../drm/amd/display/dc/dce/dmub_hw_lock_mgr.c | 4 +- .../gpu/drm/amd/display/dc/dce/dmub_outbox.c | 4 +- drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 28 +- .../display/dc/dce110/dce110_hw_sequencer.c | 19 +- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 4 +- .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 13 + .../gpu/drm/amd/display/dc/dcn21/dcn21_hubp.c | 7 +- .../drm/amd/display/dc/dcn21/dcn21_hwseq.c | 68 +++-- .../dc/dcn30/dcn30_dio_stream_encoder.c | 15 + .../drm/amd/display/dc/dcn30/dcn30_hwseq.c | 41 ++- .../gpu/drm/amd/display/dc/dcn30/dcn30_optc.c | 7 +- .../drm/amd/display/dc/dcn30/dcn30_resource.c | 4 +- .../display/dc/dcn31/dcn31_dio_link_encoder.c | 8 +- .../drm/amd/display/dc/dcn31/dcn31_hwseq.c | 17 +- .../gpu/drm/amd/display/dc/dcn31/dcn31_init.c | 1 + .../amd/display/dc/dcn31/dcn31_panel_cntl.c | 4 +- .../drm/amd/display/dc/dcn314/dcn314_hwseq.c | 4 +- .../drm/amd/display/dc/dcn314/dcn314_init.c | 1 + .../amd/display/dc/dcn314/dcn314_resource.c | 20 ++ .../drm/amd/display/dc/dcn32/dcn32_hwseq.c | 19 +- .../drm/amd/display/dc/dcn32/dcn32_resource.c | 48 ++-- .../amd/display/dc/dcn321/dcn321_resource.c | 8 +- drivers/gpu/drm/amd/display/dc/dm_services.h | 7 + .../drm/amd/display/dc/dm_services_types.h | 6 + .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 178 ++++++------ .../drm/amd/display/dc/dml/dcn30/dcn30_fpu.c | 18 +- .../dc/dml/dcn30/display_mode_vba_30.c | 6 +- .../dc/dml/dcn30/display_rq_dlg_calc_30.c | 4 +- .../drm/amd/display/dc/dml/dcn31/dcn31_fpu.c | 2 +- .../dc/dml/dcn31/display_mode_vba_31.c | 4 +- .../dc/dml/dcn314/display_mode_vba_314.c | 4 +- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 22 +- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.h | 2 + .../dc/dml/dcn32/display_mode_vba_32.c | 1 - .../dc/dml/dcn32/display_mode_vba_util_32.c | 20 +- .../amd/display/dc/dml/dcn321/dcn321_fpu.c | 24 +- drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 10 +- drivers/gpu/drm/amd/display/dc/inc/hw/abm.h | 6 + .../gpu/drm/amd/display/dc/link/link_dpms.c | 5 + .../dc/link/protocols/link_dp_capability.c | 11 +- .../display/dc/link/protocols/link_dp_dpia.c | 2 +- .../dc/link/protocols/link_dp_training.c | 5 +- .../link/protocols/link_edp_panel_control.c | 30 +- drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 1 - .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 28 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn21.c | 6 - .../gpu/drm/amd/display/dmub/src/dmub_dcn21.h | 4 - .../gpu/drm/amd/display/dmub/src/dmub_dcn32.c | 11 +- .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 25 +- .../drm/amd/display/include/signal_types.h | 1 + .../amd/display/modules/power/power_helpers.c | 4 + include/drm/display/drm_dp.h | 3 + 78 files changed, 1149 insertions(+), 726 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c create mode 100644 drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.h
Signature · 1 line
2.34.1
PATCH 1/66 drm/amd/display: Update bouding box values for DCN32
From: Rodrigo Siqueira <[email protected]>
All clock values came from firmware, but bounding box values can be helpful in some debug situations. This commit updates some of the values associated with clock speed and memory channels.
--- drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +3 -3
@@ -109,7 +109,7 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_2_soc = { { .state = 0, .dcfclk_mhz = 1564.0, - .fabricclk_mhz = 400.0, + .fabricclk_mhz = 2500.0, .dispclk_mhz = 2150.0, .dppclk_mhz = 2150.0, .phyclk_mhz = 810.0,
@@ -117,7 +117,7 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_2_soc = { .phyclk_d32_mhz = 625.0, .socclk_mhz = 1200.0, .dscclk_mhz = 716.667, - .dram_speed_mts = 16000.0, + .dram_speed_mts = 18000.0, .dtbclk_mhz = 1564.0, }, },
@@ -148,7 +148,7 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_2_soc = { .max_avg_fabric_bw_use_normal_percent = 60.0, .max_avg_dram_bw_use_normal_strobe_percent = 50.0, .max_avg_dram_bw_use_normal_percent = 15.0, - .num_chans = 8, + .num_chans = 24, .dram_channel_width_bytes = 2, .fabric_datapath_to_dcn_data_return_bytes = 64, .return_bus_width_bytes = 64,
Signature · 1 line
2.34.1
PATCH 2/66 drm/amd/display: Add missing mclk update
In reply to Qingqing ZhuoFrom: Rodrigo Siqueira <[email protected]>
When using FPO, there is some misconfiguration that happens for the lack of configuration of the MCLK switch in some circumstances. This commit adds the required field update when using the MCLK switch.
--- drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +5 -0
@@ -1331,6 +1331,11 @@ static void dcn32_calculate_dlg_params(struct dc *dc, struct dc_state *context, context->bw_ctx.dml.vba.DRAMClockChangeSupport[vlevel][context->bw_ctx.dml.vba.maxMpcComb] != dm_dram_clock_change_unsupported; +/* Pstate change might not be supported by hardware, but it might be +* possible with firmware driven vertical blank stretching. +*/ + context->bw_ctx.bw.dcn.clk.p_state_change_support |= context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching; + context->bw_ctx.bw.dcn.clk.dppclk_khz =0 ; context->bw_ctx.bw.dcn.clk.dtbclk_en =is_dtbclk_required (dc, context); context->bw_ctx.bw.dcn.clk.ref_dtbclk_khz = context->bw_ctx.dml.vba.DTBCLKPerState[vlevel] *1000 ;
Signature · 1 line
2.34.1
PATCH 3/66 drm/amd/display: Adjust code identation and other minor details
In reply to Qingqing ZhuoFrom: Rodrigo Siqueira <[email protected]>
This commit replaces spaces with tabs in multiple functions and adjusts the indentation in some other parts of the code to improve readability.
--- .../drm/amd/display/dc/dcn32/dcn32_resource.c | 44 ++--- .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 170 +++++++++--------- 2 files changed, 109 insertions(+), 105 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +22 -22
@@ -324,7 +324,6 @@ static const struct dcn10_link_enc_shift le_shift = {static const struct dcn10_link_enc_mask le_mask = {LINK_ENCODER_MASK_SH_LIST_DCN31 (_MASK), \ -//DPCS_DCN31_MASK_SH_LIST(_MASK) };
@@ -2093,27 +2092,28 @@ static bool dcn32_resource_construct(uint32_t pipe_fuses =0 ;uint32_t num_pipes =4 ; -#undef REG_STRUCT -#define REG_STRUCT bios_regs -bios_regs_init (); - -#undef REG_STRUCT -#define REG_STRUCT clk_src_regs -clk_src_regs_init (0 ,A ), -clk_src_regs_init (1 ,B ), -clk_src_regs_init (2 ,C ), -clk_src_regs_init (3 ,D ), -clk_src_regs_init (4 ,E ); -#undef REG_STRUCT -#define REG_STRUCT abm_regs -abm_regs_init (0 ), -abm_regs_init (1 ), -abm_regs_init (2 ), -abm_regs_init (3 ); - -#undef REG_STRUCT -#define REG_STRUCT dccg_regs -dccg_regs_init (); +#undef REG_STRUCT +#define REG_STRUCT bios_regs +bios_regs_init (); + +#undef REG_STRUCT +#define REG_STRUCT clk_src_regs +clk_src_regs_init (0 ,A ), +clk_src_regs_init (1 ,B ), +clk_src_regs_init (2 ,C ), +clk_src_regs_init (3 ,D ), +clk_src_regs_init (4 ,E ); + +#undef REG_STRUCT +#define REG_STRUCT abm_regs +abm_regs_init (0 ), +abm_regs_init (1 ), +abm_regs_init (2 ), +abm_regs_init (3 ); + +#undef REG_STRUCT +#define REG_STRUCT dccg_regs +dccg_regs_init ();DC_FP_START ();
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c +87 -83
262 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH 4/66 drm/amd/display: Set maximum VStartup if is DCN201
In reply to Qingqing ZhuoFrom: Rodrigo Siqueira <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c +2 -0
@@ -1259,6 +1259,8 @@ int dcn20_populate_dml_pipes_from_context(struct dc *dc, pipes[pipe_cnt].clks_cfg.refclk_mhz = dc->res_pool->ref_clocks.dchub_ref_clock_inKhz /1000.0 ; + pipes[pipe_cnt].pipe.dest.use_maximum_vstartup = dc->ctx->dce_version ==DCN_VERSION_2_01 ; + pipes[pipe_cnt].dout.dsc_enable = res_ctx->pipe_ctx[i].stream->timing.flags.DSC;/* todo: rotation?*/ pipes[pipe_cnt].dout.dsc_slices = res_ctx->pipe_ctx[i].stream->timing.dsc_cfg.num_slices_h;
Signature · 1 line
2.34.1
PATCH 5/66 drm/amd/display: Set dp_rate to dm_dp_rate_na by default
In reply to Qingqing ZhuoFrom: Rodrigo Siqueira <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c +1 -2
@@ -1300,8 +1300,7 @@ int dcn20_populate_dml_pipes_from_context(struct dc *dc, pipes[pipe_cnt].pipe.dest.pixel_rate_mhz *=2 ; pipes[pipe_cnt].pipe.dest.otg_inst = res_ctx->pipe_ctx[i].stream_res.tg->inst; pipes[pipe_cnt].dout.dp_lanes =4 ; -if (res_ctx->pipe_ctx[i].stream->link) - pipes[pipe_cnt].dout.dp_rate = dm_dp_rate_na; + pipes[pipe_cnt].dout.dp_rate = dm_dp_rate_na; pipes[pipe_cnt].dout.is_virtual =0 ; pipes[pipe_cnt].pipe.dest.vtotal_min = res_ctx->pipe_ctx[i].stream->adjust.v_total_min; pipes[pipe_cnt].pipe.dest.vtotal_max = res_ctx->pipe_ctx[i].stream->adjust.v_total_max;
Signature · 1 line
2.34.1
PATCH 6/66 drm/amd/display: Remove wrong assignment of DP link rate
In reply to Qingqing ZhuoFrom: Rodrigo Siqueira <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c +0 -1
@@ -1360,7 +1360,6 @@ int dcn20_populate_dml_pipes_from_context(struct dc *dc, pipes[pipe_cnt].dout.is_virtual =1 ; pipes[pipe_cnt].dout.output_type = dm_dp; pipes[pipe_cnt].dout.dp_lanes =4 ; - pipes[pipe_cnt].dout.dp_rate = dm_dp_rate_hbr2; }switch (res_ctx->pipe_ctx[i].stream->timing.display_color_depth) {
Signature · 1 line
2.34.1
PATCH 7/66 drm/amd/display: Use pointer in the memcpy
In reply to Qingqing ZhuoFrom: Rodrigo Siqueira <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c +1 -1
@@ -2333,7 +2333,7 @@ void dcn21_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_params k++; } -memcpy (dcn2_1_soc.clock_limits, s,sizeof (dcn2_1_soc.clock_limits)); +memcpy (&dcn2_1_soc.clock_limits, s,sizeof (dcn2_1_soc.clock_limits));if (clk_table->num_entries) { dcn2_1_soc.num_states = clk_table->num_entries +1 ;
Signature · 1 line
2.34.1
PATCH 8/66 drm/amd/display: Refactor ABM feature
In reply to Qingqing ZhuoFrom: Leon Huang <[email protected]>
[Why]
Refactor ABM feature and implement inbox command for DMUB.
[How]
Implement the ioctl to send inbox command to DMUB.
--- drivers/gpu/drm/amd/display/dc/dce/Makefile | 2 +- drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c | 264 +++++++--------- .../gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c | 286 ++++++++++++++++++ .../gpu/drm/amd/display/dc/dce/dmub_abm_lcd.h | 46 +++ drivers/gpu/drm/amd/display/dc/inc/hw/abm.h | 6 + 5 files changed, 442 insertions(+), 162 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c create mode 100644 drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.h
drivers/gpu/drm/amd/display/dc/dce/Makefile +1 -1
@@ -29,7 +29,7 @@ DCE = dce_audio.o dce_stream_encoder.o dce_link_encoder.o dce_hwseq.o \ dce_mem_input.o dce_clock_source.o dce_scl_filters.o dce_transform.o \ dce_opp.o dce_dmcu.o dce_abm.o dce_ipp.o dce_aux.o \ -dce_i2c.o dce_i2c_hw.o dce_i2c_sw.o dmub_psr.o dmub_abm.o dce_panel_cntl.o \ +dce_i2c.o dce_i2c_hw.o dce_i2c_sw.o dmub_psr.o dmub_abm.o dmub_abm_lcd.o dce_panel_cntl.o \ dmub_hw_lock_mgr.o dmub_outbox.o AMD_DAL_DCE = $(addprefix $(AMDDALPATH)/dc/dce/,$(DCE))
drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c +103 -161
331 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c new file +286 -0
286 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.h new file +46 -0
46 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/inc/hw/abm.h +6 -0
@@ -55,6 +55,12 @@ struct abm_funcs {unsigned int bytes, unsigned int inst);bool (*set_abm_pause)(struct abm *abm,bool pause,unsigned int panel_inst,unsigned int otg_inst); +bool (*set_pipe_ex)(struct abm *abm, +unsigned int otg_inst, +unsigned int option, +unsigned int panel_inst); +bool (*set_abm_event)(struct abm *abm,unsigned int full_screen,unsigned int video_mode, + unsigned int hdr_mode, unsigned int panel_inst); };#endif
Signature · 1 line
2.34.1
PATCH 9/66 drm/amd/display: Fix ABM pipe/backlight issues when change backlight
In reply to Qingqing ZhuoFrom: Leon Huang <[email protected]>
[Why]
set ABM pipe/backlight gets some issues when abm callback func pointers are NULL. For some usecase, driver would like to control PWM level before ABM resource is ready. However, recent flow refactor of ABM didn't consider that use case.
[How]
Rollback flow that sending inbox command to dmub directly when ABM function pointers aren't ready.
--- .../drm/amd/display/dc/dcn21/dcn21_hwseq.c | 64 ++++++++++++++----- 1 file changed, 47 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c +47 -17
@@ -159,6 +159,25 @@ static bool dmub_abm_set_pipe(struct abm *abm, uint32_t otg_inst, uint32_t optioreturn true; } +static void dmub_abm_set_backlight (struct dc_context *dc,uint32_t backlight_pwm_u16_16, +uint32_t frame_ramp,uint32_t panel_inst) +{ +union dmub_rb_cmd cmd; + +memset (&cmd,0 ,sizeof (cmd)); + cmd.abm_set_backlight.header.type =DMUB_CMD__ABM ; + cmd.abm_set_backlight.header.sub_type =DMUB_CMD__ABM_SET_BACKLIGHT ; + cmd.abm_set_backlight.abm_set_backlight_data.frame_ramp = frame_ramp; + cmd.abm_set_backlight.abm_set_backlight_data.backlight_user_level = backlight_pwm_u16_16; + cmd.abm_set_backlight.abm_set_backlight_data.version =DMUB_CMD_ABM_CONTROL_VERSION_1 ; + cmd.abm_set_backlight.abm_set_backlight_data.panel_mask = (0x01 << panel_inst); + cmd.abm_set_backlight.header.payload_bytes =sizeof (struct dmub_cmd_abm_set_backlight_data ); + +dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd); +dc_dmub_srv_cmd_execute (dc->dmub_srv); +dc_dmub_srv_wait_idle (dc->dmub_srv); +} +void dcn21_set_abm_immediate_disable (struct pipe_ctx *pipe_ctx) {struct abm *abm = pipe_ctx->stream_res.abm;
@@ -173,8 +192,12 @@ void dcn21_set_abm_immediate_disable(struct pipe_ctx *pipe_ctx) }if (abm && panel_cntl) { -dmub_abm_set_pipe (abm, otg_inst,SET_ABM_PIPE_IMMEDIATELY_DISABLE , - panel_cntl->inst); +if (abm->funcs && abm->funcs->set_pipe_ex) { + abm->funcs->set_pipe_ex (abm, otg_inst,SET_ABM_PIPE_IMMEDIATELY_DISABLE , + panel_cntl->inst); + }else { +dmub_abm_set_pipe (abm, otg_inst,SET_ABM_PIPE_IMMEDIATELY_DISABLE , panel_cntl->inst); + } panel_cntl->funcs->store_backlight_level (panel_cntl); } }
@@ -191,8 +214,13 @@ void dcn21_set_pipe(struct pipe_ctx *pipe_ctx)return ; } -if (abm && panel_cntl) -dmub_abm_set_pipe (abm, otg_inst,SET_ABM_PIPE_NORMAL , panel_cntl->inst); +if (abm && panel_cntl) { +if (abm->funcs && abm->funcs->set_pipe_ex) { + abm->funcs->set_pipe_ex (abm, otg_inst,SET_ABM_PIPE_NORMAL , panel_cntl->inst); + }else { +dmub_abm_set_pipe (abm, otg_inst,SET_ABM_PIPE_NORMAL , panel_cntl->inst); + } + } } bool dcn21_set_backlight_level(struct pipe_ctx *pipe_ctx,
@@ -210,21 +238,23 @@ bool dcn21_set_backlight_level(struct pipe_ctx *pipe_ctx,return true; } -if (abm && panel_cntl) -dmub_abm_set_pipe (abm, otg_inst,SET_ABM_PIPE_NORMAL , panel_cntl->inst); +if (abm !=NULL ) { +uint32_t otg_inst = pipe_ctx->stream_res.tg->inst; -memset (&cmd,0 ,sizeof (cmd)); - cmd.abm_set_backlight.header.type =DMUB_CMD__ABM ; - cmd.abm_set_backlight.header.sub_type =DMUB_CMD__ABM_SET_BACKLIGHT ; - cmd.abm_set_backlight.abm_set_backlight_data.frame_ramp = frame_ramp; - cmd.abm_set_backlight.abm_set_backlight_data.backlight_user_level = backlight_pwm_u16_16; - cmd.abm_set_backlight.abm_set_backlight_data.version =DMUB_CMD_ABM_CONTROL_VERSION_1 ; - cmd.abm_set_backlight.abm_set_backlight_data.panel_mask = (0x01 << panel_cntl->inst); - cmd.abm_set_backlight.header.payload_bytes =sizeof (struct dmub_cmd_abm_set_backlight_data ); +if (abm && panel_cntl) { +if (abm->funcs && abm->funcs->set_pipe_ex) { + abm->funcs->set_pipe_ex (abm, otg_inst,SET_ABM_PIPE_NORMAL , panel_cntl->inst); + }else { +dmub_abm_set_pipe (abm, otg_inst,SET_ABM_PIPE_NORMAL , panel_cntl->inst); + } + } + } -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->dmub_srv); -dc_dmub_srv_wait_idle (dc->dmub_srv); +if (abm && abm->funcs && abm->funcs->set_backlight_level_pwm) + abm->funcs->set_backlight_level_pwm (abm, backlight_pwm_u16_16, + frame_ramp,0 , panel_cntl->inst); +else +dmub_abm_set_backlight (dc, backlight_pwm_u16_16, frame_ramp, panel_cntl->inst);return true; }
Signature · 1 line
2.34.1
PATCH 10/66 drm/amd/display: Do not set drr on pipe commit
In reply to Qingqing ZhuoFrom: Wesley Chalmers <[email protected]>
[WHY]
Writing to DRR registers such as OTG_V_TOTAL_MIN on the same frame as a pipe commit can cause underflow.
[HOW]
Move DMUB p-state delegate into optimze_bandwidth; enabling FAMS sets optimized_required.
This change expects that Freesync requests are blocked when optimized_required is true.
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 6 ++++++ drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c | 7 +++++++ 2 files changed, 13 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +6 -0
@@ -2113,6 +2113,12 @@ void dcn20_optimize_bandwidth(if (hubbub->funcs->program_compbuf_size) hubbub->funcs->program_compbuf_size (hubbub, context->bw_ctx.bw.dcn.compbuf_size_kb, true); +if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching) { +dc_dmub_srv_p_state_delegate (dc, + true, context); + context->bw_ctx.bw.dcn.clk.p_state_change_support = true; + } + dc->clk_mgr->funcs->update_clocks( dc->clk_mgr, context,
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c +7 -0
@@ -985,11 +985,18 @@ void dcn30_set_disp_pattern_generator(const struct dc *dc,void dcn30_prepare_bandwidth (struct dc *dc,struct dc_state *context) { +if (context->bw_ctx.bw.dcn.clk.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); + +dc_dmub_srv_p_state_delegate (dc, false, context); }
Signature · 1 line
2.34.1
Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
Quoted 10 lines · Qingqing Zhuo
From: Wesley Chalmers <[email protected]>
[WHY]
Writing to DRR registers such asOTG_V_TOTAL_MINon the same frame as a pipe commit can cause underflow.[HOW]
Move DMUB p-state delegate intooptimze_bandwidth; enabling FAMS setsoptimized_required.
Quoted 5 lines
This change expects that Freesync requests are blocked when
optimized_requiredis true.Reviewed-by Rodrigo Siqueira <[email protected]>Signed-off-by Wesley Chalmers <[email protected]>
I bisected a regression to this change, see below for the symptoms. Reverting this patch (and the following patch "drm/amd/display: Block optimize on consecutive FAMS enables", which depends on it) on top of the DRM changes merged for 6.4-rc1 avoids the regression.
Maybe "Freesync requests are blocked when optimized_required is true" isn't ensured as needed?
The symptoms are that the monitor (Samsung Odyssey Neo G9, 5120x1440@240/VRR, connected to Navi 21 via DisplayPort) blanks and the GPU hangs while starting the Steam game Assetto Corsa Competizione (via Proton 7.0).
Example dmesg excerpt:
amdgpu 0000:0c:00.0: [drm] *ERROR* [CRTC:82:crtc-0] flip_done timed out NMI watchdog: Watchdog detected hard LOCKUP on cpu 6
[...]
RIP: 0010:amdgpu_device_rreg.part.0+0x2f/0xf0 [amdgpu] Code: 41 54 44 8d 24 b5 00 00 00 00 55 89 f5 53 48 89 fb 4c 3b a7 60 0b 00 00 73 6a 83 e2 02 74 29 4c 03 a3 68 0b 00 00 45 8b 24 24 <48> 8b 43 08 0f b7 70 3e 66 90 44 89 e0 5b 5d 41 5c 31 d2 31 c9 31 RSP: 0000:ffffb39a119dfb88 EFLAGS: 00000086 RAX: ffffffffc0eb96a0 RBX: ffff9e7963dc0000 RCX: 0000000000007fff RDX: 0000000000000000 RSI: 0000000000004ff6 RDI: ffff9e7963dc0000 RBP: 0000000000004ff6 R08: ffffb39a119dfc40 R09: 0000000000000010 R10: ffffb39a119dfc40 R11: ffffb39a119dfc44 R12: 00000000000e05ae R13: 0000000000000000 R14: ffff9e7963dc0010 R15: 0000000000000000 FS: 000000001012f6c0(0000) GS:ffff9e805eb80000(0000) knlGS:000000007fd40000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000461ca000 CR3: 00000002a8a20000 CR4: 0000000000350ee0 Call Trace: <TASK> dm_read_reg_func+0x37/0xc0 [amdgpu] generic_reg_get2+0x22/0x60 [amdgpu] optc1_get_crtc_scanoutpos+0x6a/0xc0 [amdgpu] dc_stream_get_scanoutpos+0x74/0x90 [amdgpu] dm_crtc_get_scanoutpos+0x82/0xf0 [amdgpu] amdgpu_display_get_crtc_scanoutpos+0x91/0x190 [amdgpu] ? dm_read_reg_func+0x37/0xc0 [amdgpu] amdgpu_get_vblank_counter_kms+0xb4/0x1a0 [amdgpu] dm_pflip_high_irq+0x213/0x2f0 [amdgpu] amdgpu_dm_irq_handler+0x8a/0x200 [amdgpu] amdgpu_irq_dispatch+0xd4/0x220 [amdgpu] amdgpu_ih_process+0x7f/0x110 [amdgpu] amdgpu_irq_handler+0x1f/0x70 [amdgpu] __handle_irq_event_percpu+0x46/0x1b0 handle_irq_event+0x34/0x80 handle_edge_irq+0x9f/0x240 __common_interrupt+0x66/0x110 common_interrupt+0x5c/0xd0 asm_common_interrupt+0x22/0x40
Signature · 2 lines
Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and Xwayland developer
Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
[AMD Official Use Only - General]
Hi Michel,
Could you please try with the attached firmware package if you see the hang without any reverts? If you do see hangs, please send dmesg with "drm.debug=0x156 log_buf_len=30M" in the kernel cmdline.
The attached fw is not released to the public yet, but we will be updating them in linux-firmware tree next week. Please do backup your existing firmware, and put the attached files into /usr/lib/firmware/updates/amgpu and regenerate your ramdisk. On ubuntu the following should do:
sudo update-initramfs -u -k uname -r
--
Regards,
Jay
________________________________
From: Michel Dänzer <[email protected]>
Sent: Tuesday, May 9, 2023 6:59 AM
To: Zhuo, Qingqing (Lillian) <[email protected]>; [email protected] <[email protected]>; Chalmers, Wesley <[email protected]>
Cc: Wang, Chao-kai (Stylon) <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Chiu, Solomon <[email protected]>; Pillai, Aurabindo <[email protected]>; Lin, Wayne <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]>
Subject: Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
Quoted 10 lines · Qingqing Zhuo
From: Wesley Chalmers <[email protected]>
[WHY]
Writing to DRR registers such asOTG_V_TOTAL_MINon the same frame as a pipe commit can cause underflow.[HOW]
Move DMUB p-state delegate intooptimze_bandwidth; enabling FAMS setsoptimized_required.
Quoted 5 lines
This change expects that Freesync requests are blocked when
optimized_requiredis true.Reviewed-by Rodrigo Siqueira <[email protected]>Signed-off-by Wesley Chalmers <[email protected]>
I bisected a regression to this change, see below for the symptoms. Reverting this patch (and the following patch "drm/amd/display: Block optimize on consecutive FAMS enables", which depends on it) on top of the DRM changes merged for 6.4-rc1 avoids the regression.
Maybe "Freesync requests are blocked when optimized_required is true" isn't ensured as needed?
The symptoms are that the monitor (Samsung Odyssey Neo G9, 5120x1440@240/VRR, connected to Navi 21 via DisplayPort) blanks and the GPU hangs while starting the Steam game Assetto Corsa Competizione (via Proton 7.0).
Example dmesg excerpt:
amdgpu 0000:0c:00.0: [drm] *ERROR* [CRTC:82:crtc-0] flip_done timed out NMI watchdog: Watchdog detected hard LOCKUP on cpu 6
[...]
RIP: 0010:amdgpu_device_rreg.part.0+0x2f/0xf0 [amdgpu] Code: 41 54 44 8d 24 b5 00 00 00 00 55 89 f5 53 48 89 fb 4c 3b a7 60 0b 00 00 73 6a 83 e2 02 74 29 4c 03 a3 68 0b 00 00 45 8b 24 24 <48> 8b 43 08 0f b7 70 3e 66 90 44 89 e0 5b 5d 41 5c 31 d2 31 c9 31 RSP: 0000:ffffb39a119dfb88 EFLAGS: 00000086 RAX: ffffffffc0eb96a0 RBX: ffff9e7963dc0000 RCX: 0000000000007fff RDX: 0000000000000000 RSI: 0000000000004ff6 RDI: ffff9e7963dc0000 RBP: 0000000000004ff6 R08: ffffb39a119dfc40 R09: 0000000000000010 R10: ffffb39a119dfc40 R11: ffffb39a119dfc44 R12: 00000000000e05ae R13: 0000000000000000 R14: ffff9e7963dc0010 R15: 0000000000000000 FS: 000000001012f6c0(0000) GS:ffff9e805eb80000(0000) knlGS:000000007fd40000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000461ca000 CR3: 00000002a8a20000 CR4: 0000000000350ee0 Call Trace: <TASK> dm_read_reg_func+0x37/0xc0 [amdgpu] generic_reg_get2+0x22/0x60 [amdgpu] optc1_get_crtc_scanoutpos+0x6a/0xc0 [amdgpu] dc_stream_get_scanoutpos+0x74/0x90 [amdgpu] dm_crtc_get_scanoutpos+0x82/0xf0 [amdgpu] amdgpu_display_get_crtc_scanoutpos+0x91/0x190 [amdgpu] ? dm_read_reg_func+0x37/0xc0 [amdgpu] amdgpu_get_vblank_counter_kms+0xb4/0x1a0 [amdgpu] dm_pflip_high_irq+0x213/0x2f0 [amdgpu] amdgpu_dm_irq_handler+0x8a/0x200 [amdgpu] amdgpu_irq_dispatch+0xd4/0x220 [amdgpu] amdgpu_ih_process+0x7f/0x110 [amdgpu] amdgpu_irq_handler+0x1f/0x70 [amdgpu] __handle_irq_event_percpu+0x46/0x1b0 handle_irq_event+0x34/0x80 handle_edge_irq+0x9f/0x240 __common_interrupt+0x66/0x110 common_interrupt+0x5c/0xd0 asm_common_interrupt+0x22/0x40
--
Earthling Michel Dänzer | https://redhat.com
Libre software enthusiast | Mesa and Xwayland developer
Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
[AMD Official Use Only - General]
Sorry - the firmware in the previous message is for DCN32. For Navi2x, please use the firmware attached here.
--
Regards,
Jay
________________________________
From: Pillai, Aurabindo <[email protected]>
Sent: Tuesday, May 9, 2023 4:44 PM
To: Michel Dänzer <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; [email protected] <[email protected]>; Chalmers, Wesley <[email protected]>
Cc: Wang, Chao-kai (Stylon) <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Chiu, Solomon <[email protected]>; Lin, Wayne <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]>
Subject: Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
Hi Michel,
Could you please try with the attached firmware package if you see the hang without any reverts? If you do see hangs, please send dmesg with "drm.debug=0x156 log_buf_len=30M" in the kernel cmdline.
The attached fw is not released to the public yet, but we will be updating them in linux-firmware tree next week. Please do backup your existing firmware, and put the attached files into /usr/lib/firmware/updates/amgpu and regenerate your ramdisk. On ubuntu the following should do:
sudo update-initramfs -u -k uname -r
--
Regards,
Jay
________________________________
From: Michel Dänzer <[email protected]>
Sent: Tuesday, May 9, 2023 6:59 AM
To: Zhuo, Qingqing (Lillian) <[email protected]>; [email protected] <[email protected]>; Chalmers, Wesley <[email protected]>
Cc: Wang, Chao-kai (Stylon) <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Chiu, Solomon <[email protected]>; Pillai, Aurabindo <[email protected]>; Lin, Wayne <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]>
Subject: Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
Quoted 10 lines · Qingqing Zhuo
From: Wesley Chalmers <[email protected]>
[WHY]
Writing to DRR registers such asOTG_V_TOTAL_MINon the same frame as a pipe commit can cause underflow.[HOW]
Move DMUB p-state delegate intooptimze_bandwidth; enabling FAMS setsoptimized_required.
Quoted 5 lines
This change expects that Freesync requests are blocked when
optimized_requiredis true.Reviewed-by Rodrigo Siqueira <[email protected]>Signed-off-by Wesley Chalmers <[email protected]>
I bisected a regression to this change, see below for the symptoms. Reverting this patch (and the following patch "drm/amd/display: Block optimize on consecutive FAMS enables", which depends on it) on top of the DRM changes merged for 6.4-rc1 avoids the regression.
Maybe "Freesync requests are blocked when optimized_required is true" isn't ensured as needed?
The symptoms are that the monitor (Samsung Odyssey Neo G9, 5120x1440@240/VRR, connected to Navi 21 via DisplayPort) blanks and the GPU hangs while starting the Steam game Assetto Corsa Competizione (via Proton 7.0).
Example dmesg excerpt:
amdgpu 0000:0c:00.0: [drm] *ERROR* [CRTC:82:crtc-0] flip_done timed out NMI watchdog: Watchdog detected hard LOCKUP on cpu 6
[...]
RIP: 0010:amdgpu_device_rreg.part.0+0x2f/0xf0 [amdgpu] Code: 41 54 44 8d 24 b5 00 00 00 00 55 89 f5 53 48 89 fb 4c 3b a7 60 0b 00 00 73 6a 83 e2 02 74 29 4c 03 a3 68 0b 00 00 45 8b 24 24 <48> 8b 43 08 0f b7 70 3e 66 90 44 89 e0 5b 5d 41 5c 31 d2 31 c9 31 RSP: 0000:ffffb39a119dfb88 EFLAGS: 00000086 RAX: ffffffffc0eb96a0 RBX: ffff9e7963dc0000 RCX: 0000000000007fff RDX: 0000000000000000 RSI: 0000000000004ff6 RDI: ffff9e7963dc0000 RBP: 0000000000004ff6 R08: ffffb39a119dfc40 R09: 0000000000000010 R10: ffffb39a119dfc40 R11: ffffb39a119dfc44 R12: 00000000000e05ae R13: 0000000000000000 R14: ffff9e7963dc0010 R15: 0000000000000000 FS: 000000001012f6c0(0000) GS:ffff9e805eb80000(0000) knlGS:000000007fd40000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000461ca000 CR3: 00000002a8a20000 CR4: 0000000000350ee0 Call Trace: <TASK> dm_read_reg_func+0x37/0xc0 [amdgpu] generic_reg_get2+0x22/0x60 [amdgpu] optc1_get_crtc_scanoutpos+0x6a/0xc0 [amdgpu] dc_stream_get_scanoutpos+0x74/0x90 [amdgpu] dm_crtc_get_scanoutpos+0x82/0xf0 [amdgpu] amdgpu_display_get_crtc_scanoutpos+0x91/0x190 [amdgpu] ? dm_read_reg_func+0x37/0xc0 [amdgpu] amdgpu_get_vblank_counter_kms+0xb4/0x1a0 [amdgpu] dm_pflip_high_irq+0x213/0x2f0 [amdgpu] amdgpu_dm_irq_handler+0x8a/0x200 [amdgpu] amdgpu_irq_dispatch+0xd4/0x220 [amdgpu] amdgpu_ih_process+0x7f/0x110 [amdgpu] amdgpu_irq_handler+0x1f/0x70 [amdgpu] __handle_irq_event_percpu+0x46/0x1b0 handle_irq_event+0x34/0x80 handle_edge_irq+0x9f/0x240 __common_interrupt+0x66/0x110 common_interrupt+0x5c/0xd0 asm_common_interrupt+0x22/0x40
--
Earthling Michel Dänzer | https://redhat.com
Libre software enthusiast | Mesa and Xwayland developer
Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
Quoted 2 lines · Aurabindo
Sorry - the firmware in the previous message is for DCN32. For Navi2x, please use the firmware attached here.
Same problem (contents of /sys/kernel/debug/dri/0/amdgpu_firmware_info below).
Even if it did work with newer FW, the kernel must keep working with older FW, so in that case the new behaviour would need to be guarded by the FW version.
VCE feature version: 0, firmware version: 0x00000000
UVD feature version: 0, firmware version: 0x00000000
MC feature version: 0, firmware version: 0x00000000
ME feature version: 44, firmware version: 0x00000040
PFP feature version: 44, firmware version: 0x00000061
CE feature version: 44, firmware version: 0x00000025
RLC feature version: 1, firmware version: 0x00000060
RLC SRLC feature version: 0, firmware version: 0x00000000
RLC SRLG feature version: 0, firmware version: 0x00000000
RLC SRLS feature version: 0, firmware version: 0x00000000
RLCP feature version: 0, firmware version: 0x00000000
RLCV feature version: 0, firmware version: 0x00000000
MEC feature version: 44, firmware version: 0x00000071
MEC2 feature version: 44, firmware version: 0x00000071
IMU feature version: 0, firmware version: 0x00000000
SOS feature version: 0, firmware version: 0x00210c64
ASD feature version: 553648297, firmware version: 0x210000a9 TA XGMI feature version: 0x00000000, firmware version: 0x2000000f TA RAS feature version: 0x00000000, firmware version: 0x1b00013e TA HDCP feature version: 0x00000000, firmware version: 0x17000038 TA DTM feature version: 0x00000000, firmware version: 0x12000015 TA RAP feature version: 0x00000000, firmware version: 0x07000213 TA SECUREDISPLAY feature version: 0x00000000, firmware version: 0x00000000 SMC feature version: 0, program: 0, firmware version: 0x003a5800 (58.88.0) SDMA0 feature version: 52, firmware version: 0x00000053
SDMA1 feature version: 52, firmware version: 0x00000053
SDMA2 feature version: 52, firmware version: 0x00000053
SDMA3 feature version: 52, firmware version: 0x00000053
VCN feature version: 0, firmware version: 0x0211b000
DMCU feature version: 0, firmware version: 0x00000000
DMCUB feature version: 0, firmware version: 0x0202001c
TOC feature version: 0, firmware version: 0x00000000MES_KIQ feature version: 0, firmware version: 0x00000000
MES feature version: 0, firmware version: 0x00000000
VBIOS version: 113-D4300100-051
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Quoted 91 lines
*From:* Pillai, Aurabindo <[email protected]>
*Sent:* Tuesday, May 9, 2023 4:44 PM
*To:* Michel Dänzer <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; [email protected] <[email protected]>; Chalmers, Wesley <[email protected]>
*Cc:* Wang, Chao-kai (Stylon) <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Chiu, Solomon <[email protected]>; Lin, Wayne <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]> *Subject:* Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
Hi Michel,Could you please try with the attached firmware package if you see the hang without any reverts? If you do see hangs, please send dmesg with "drm.debug=0x156 log_buf_len=30M" in the kernel cmdline.
The attached fw is not released to the public yet, but we will be updating them in linux-firmware tree next week. Please do backup your existing firmware, and put the attached files into
/usr/lib/firmware/updates/amgpuand regenerate your ramdisk. On ubuntu the following should do:sudo update-initramfs -u -k
uname -r--
Regards,
Jay
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*From:* Michel Dänzer <[email protected]>
*Sent:* Tuesday, May 9, 2023 6:59 AM
*To:* Zhuo, Qingqing (Lillian) <[email protected]>; [email protected] <[email protected]>; Chalmers, Wesley <[email protected]>
*Cc:* Wang, Chao-kai (Stylon) <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Chiu, Solomon <[email protected]>; Pillai, Aurabindo <[email protected]>; Lin, Wayne <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]> *Subject:* Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commitQuoted 10 lines · Qingqing Zhuo
From: Wesley Chalmers <[email protected]>
[WHY]
Writing to DRR registers such asOTG_V_TOTAL_MINon the same frame as a pipe commit can cause underflow.[HOW]
Move DMUB p-state delegate intooptimze_bandwidth; enabling FAMS setsoptimized_required.Quoted 5 lines
This change expects that Freesync requests are blocked when
optimized_requiredis true.Reviewed-by Rodrigo Siqueira <[email protected]>Signed-off-by Wesley Chalmers <[email protected]>I bisected a regression to this change, see below for the symptoms. Reverting this patch (and the following patch "drm/amd/display: Block optimize on consecutive FAMS enables", which depends on it) on top of the DRM changes merged for 6.4-rc1 avoids the regression.
Maybe "Freesync requests are blocked when
optimized_requiredis true" isn't ensured as needed?The symptoms are that the monitor (Samsung Odyssey Neo G9, 5120x1440@240/VRR, connected to Navi 21 via DisplayPort) blanks and the GPU hangs while starting the Steam game Assetto Corsa Competizione (via Proton 7.0).
Example dmesg excerpt:
amdgpu 0000:0c:00.0: [drm] *ERROR* [CRTC:82:crtc-0]
flip_donetimed out NMI watchdog: Watchdog detected hard LOCKUP on cpu 6
[...]RIP: 0010:amdgpu_device_rreg.part.0+0x2f/0xf0 [amdgpu] Code: 41 54 44 8d 24 b5 00 00 00 00 55 89 f5 53 48 89 fb 4c 3b a7 60 0b 00 00 73 6a 83 e2 02 74 29 4c 03 a3 68 0b 00 00 45 8b 24 24 <48> 8b 43 08 0f b7 70 3e 66 90 44 89 e0 5b 5d 41 5c 31 d2 31 c9 31 RSP: 0000:ffffb39a119dfb88 EFLAGS: 00000086 RAX: ffffffffc0eb96a0 RBX: ffff9e7963dc0000 RCX: 0000000000007fff RDX: 0000000000000000 RSI: 0000000000004ff6 RDI: ffff9e7963dc0000 RBP: 0000000000004ff6 R08: ffffb39a119dfc40 R09: 0000000000000010 R10: ffffb39a119dfc40 R11: ffffb39a119dfc44 R12: 00000000000e05ae R13: 0000000000000000 R14: ffff9e7963dc0010 R15: 0000000000000000 FS: 000000001012f6c0(0000) GS:ffff9e805eb80000(0000) knlGS:000000007fd40000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000461ca000 CR3: 00000002a8a20000 CR4: 0000000000350ee0 Call Trace: <TASK> dm_read_reg_func+0x37/0xc0 [amdgpu] generic_reg_get2+0x22/0x60 [amdgpu] optc1_get_crtc_scanoutpos+0x6a/0xc0 [amdgpu] dc_stream_get_scanoutpos+0x74/0x90 [amdgpu] dm_crtc_get_scanoutpos+0x82/0xf0 [amdgpu] amdgpu_display_get_crtc_scanoutpos+0x91/0x190 [amdgpu] ? dm_read_reg_func+0x37/0xc0 [amdgpu] amdgpu_get_vblank_counter_kms+0xb4/0x1a0 [amdgpu] dm_pflip_high_irq+0x213/0x2f0 [amdgpu] amdgpu_dm_irq_handler+0x8a/0x200 [amdgpu] amdgpu_irq_dispatch+0xd4/0x220 [amdgpu] amdgpu_ih_process+0x7f/0x110 [amdgpu] amdgpu_irq_handler+0x1f/0x70 [amdgpu] __handle_irq_event_percpu+0x46/0x1b0 handle_irq_event+0x34/0x80 handle_edge_irq+0x9f/0x240 __common_interrupt+0x66/0x110 common_interrupt+0x5c/0xd0 asm_common_interrupt+0x22/0x40Signature · 2 lines
Earthling Michel Dänzer | https://redhat.com <https://redhat.com> Libre software enthusiast | Mesa and Xwayland developer
Signature · 2 lines
Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and Xwayland developer
Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
Quoted 8 lines · Michel Dänzer
Quoted 2 lines · Aurabindo
Sorry - the firmware in the previous message is for DCN32. For Navi2x, please use the firmware attached here.
Same problem (contents of
/sys/kernel/debug/dri/0/amdgpu_firmware_infobelow).Even if it did work with newer FW, the kernel must keep working with older FW, so in that case the new behaviour would need to be guarded by the FW version.
Agreed. Were you able to repro the hang on any other modes/monitors?
Quoted 131 lines
VCE feature version: 0, firmware version:
0x00000000
UVD feature version: 0, firmware version:0x00000000
MC feature version: 0, firmware version:0x00000000
ME feature version: 44, firmware version:0x00000040
PFP feature version: 44, firmware version:0x00000061
CE feature version: 44, firmware version:0x00000025
RLC feature version: 1, firmware version:0x00000060
RLC SRLC feature version: 0, firmware version:0x00000000
RLC SRLG feature version: 0, firmware version:0x00000000
RLC SRLS feature version: 0, firmware version:0x00000000
RLCP feature version: 0, firmware version:0x00000000
RLCV feature version: 0, firmware version:0x00000000
MEC feature version: 44, firmware version:0x00000071
MEC2 feature version: 44, firmware version:0x00000071
IMU feature version: 0, firmware version:0x00000000
SOS feature version: 0, firmware version:0x00210c64
ASD feature version: 553648297, firmware version:0x210000a9TA XGMI feature version:0x00000000, firmware version:0x2000000fTA RAS feature version:0x00000000, firmware version:0x1b00013eTA HDCP feature version:0x00000000, firmware version:0x17000038TA DTM feature version:0x00000000, firmware version:0x12000015TA RAP feature version:0x00000000, firmware version:0x07000213TA SECUREDISPLAY feature version:0x00000000, firmware version:0x00000000SMC feature version: 0, program: 0, firmware version:0x003a5800(58.88.0) SDMA0 feature version: 52, firmware version:0x00000053
SDMA1 feature version: 52, firmware version:0x00000053
SDMA2 feature version: 52, firmware version:0x00000053
SDMA3 feature version: 52, firmware version:0x00000053
VCN feature version: 0, firmware version:0x0211b000
DMCU feature version: 0, firmware version:0x00000000
DMCUB feature version: 0, firmware version:0x0202001c
TOC feature version: 0, firmware version:0x00000000MES_KIQfeature version: 0, firmware version:0x00000000
MES feature version: 0, firmware version:0x00000000
VBIOS version: 113-D4300100-051------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Quoted 91 lines
*From:* Pillai, Aurabindo <[email protected]>
*Sent:* Tuesday, May 9, 2023 4:44 PM
*To:* Michel Dänzer <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; [email protected] <[email protected]>; Chalmers, Wesley <[email protected]>
*Cc:* Wang, Chao-kai (Stylon) <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Chiu, Solomon <[email protected]>; Lin, Wayne <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]> *Subject:* Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
Hi Michel,Could you please try with the attached firmware package if you see the hang without any reverts? If you do see hangs, please send dmesg with "drm.debug=0x156 log_buf_len=30M" in the kernel cmdline.
The attached fw is not released to the public yet, but we will be updating them in linux-firmware tree next week. Please do backup your existing firmware, and put the attached files into
/usr/lib/firmware/updates/amgpuand regenerate your ramdisk. On ubuntu the following should do:sudo update-initramfs -u -k
uname -r--
Regards,
Jay
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*From:* Michel Dänzer <[email protected]>
*Sent:* Tuesday, May 9, 2023 6:59 AM
*To:* Zhuo, Qingqing (Lillian) <[email protected]>; [email protected] <[email protected]>; Chalmers, Wesley <[email protected]>
*Cc:* Wang, Chao-kai (Stylon) <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Chiu, Solomon <[email protected]>; Pillai, Aurabindo <[email protected]>; Lin, Wayne <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]> *Subject:* Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commitQuoted 10 lines · Qingqing Zhuo
From: Wesley Chalmers <[email protected]>
[WHY]
Writing to DRR registers such asOTG_V_TOTAL_MINon the same frame as a pipe commit can cause underflow.[HOW]
Move DMUB p-state delegate intooptimze_bandwidth; enabling FAMS setsoptimized_required.Quoted 5 lines
This change expects that Freesync requests are blocked when
optimized_requiredis true.Reviewed-by Rodrigo Siqueira <[email protected]>Signed-off-by Wesley Chalmers <[email protected]>I bisected a regression to this change, see below for the symptoms. Reverting this patch (and the following patch "drm/amd/display: Block optimize on consecutive FAMS enables", which depends on it) on top of the DRM changes merged for 6.4-rc1 avoids the regression.
Maybe "Freesync requests are blocked when
optimized_requiredis true" isn't ensured as needed?The symptoms are that the monitor (Samsung Odyssey Neo G9, 5120x1440@240/VRR, connected to Navi 21 via DisplayPort) blanks and the GPU hangs while starting the Steam game Assetto Corsa Competizione (via Proton 7.0).
Example dmesg excerpt:
amdgpu 0000:0c:00.0: [drm] *ERROR* [CRTC:82:crtc-0]
flip_donetimed out NMI watchdog: Watchdog detected hard LOCKUP on cpu 6
[...]RIP: 0010:amdgpu_device_rreg.part.0+0x2f/0xf0 [amdgpu] Code: 41 54 44 8d 24 b5 00 00 00 00 55 89 f5 53 48 89 fb 4c 3b a7 60 0b 00 00 73 6a 83 e2 02 74 29 4c 03 a3 68 0b 00 00 45 8b 24 24 <48> 8b 43 08 0f b7 70 3e 66 90 44 89 e0 5b 5d 41 5c 31 d2 31 c9 31 RSP: 0000:ffffb39a119dfb88 EFLAGS: 00000086 RAX: ffffffffc0eb96a0 RBX: ffff9e7963dc0000 RCX: 0000000000007fff RDX: 0000000000000000 RSI: 0000000000004ff6 RDI: ffff9e7963dc0000 RBP: 0000000000004ff6 R08: ffffb39a119dfc40 R09: 0000000000000010 R10: ffffb39a119dfc40 R11: ffffb39a119dfc44 R12: 00000000000e05ae R13: 0000000000000000 R14: ffff9e7963dc0010 R15: 0000000000000000 FS: 000000001012f6c0(0000) GS:ffff9e805eb80000(0000) knlGS:000000007fd40000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000461ca000 CR3: 00000002a8a20000 CR4: 0000000000350ee0 Call Trace: <TASK> dm_read_reg_func+0x37/0xc0 [amdgpu] generic_reg_get2+0x22/0x60 [amdgpu] optc1_get_crtc_scanoutpos+0x6a/0xc0 [amdgpu] dc_stream_get_scanoutpos+0x74/0x90 [amdgpu] dm_crtc_get_scanoutpos+0x82/0xf0 [amdgpu] amdgpu_display_get_crtc_scanoutpos+0x91/0x190 [amdgpu] ? dm_read_reg_func+0x37/0xc0 [amdgpu] amdgpu_get_vblank_counter_kms+0xb4/0x1a0 [amdgpu] dm_pflip_high_irq+0x213/0x2f0 [amdgpu] amdgpu_dm_irq_handler+0x8a/0x200 [amdgpu] amdgpu_irq_dispatch+0xd4/0x220 [amdgpu] amdgpu_ih_process+0x7f/0x110 [amdgpu] amdgpu_irq_handler+0x1f/0x70 [amdgpu] __handle_irq_event_percpu+0x46/0x1b0 handle_irq_event+0x34/0x80 handle_edge_irq+0x9f/0x240 __common_interrupt+0x66/0x110 common_interrupt+0x5c/0xd0 asm_common_interrupt+0x22/0x40Signature · 2 lines
Earthling Michel Dänzer | https://redhat.com <https://redhat.com> Libre software enthusiast | Mesa and Xwayland developer
Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
Quoted 11 lines · Aurabindo Pillai
Quoted 8 lines · Michel Dänzer
Quoted 2 lines · Aurabindo
Sorry - the firmware in the previous message is for DCN32. For Navi2x, please use the firmware attached here.
Same problem (contents of
/sys/kernel/debug/dri/0/amdgpu_firmware_infobelow).Even if it did work with newer FW, the kernel must keep working with older FW, so in that case the new behaviour would need to be guarded by the FW version.
Agreed. Were you able to repro the hang on any other modes/monitors?
Haven't tried specifically, and this is the only system I have with VRR.
Signature · 2 lines
Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and Xwayland developer
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
Quoted 12 lines · Aurabindo Pillai
Quoted 11 lines · Michel Dänzer
Quoted 10 lines · Aurabindo Pillai
Quoted 8 lines · Michel Dänzer
Quoted 2 lines · Aurabindo
Sorry - the firmware in the previous message is for DCN32. For Navi2x, please use the firmware attached here.
Same problem (contents of
/sys/kernel/debug/dri/0/amdgpu_firmware_infobelow).Even if it did work with newer FW, the kernel must keep working with older FW, so in that case the new behaviour would need to be guarded by the FW version.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Agreed. Were you able to repro the hang on any other modes/monitors?
Haven't tried specifically, and this is the only system I have with VRR.
Hi Michel,
I've fixed a related issue on Navi21. Could you please try the attached DMCUB along with the patches to be applied on top of amd-staging-drm-next and check if the hang/corruption is gone?
Thanks, though I'm afraid that made it kind of worse: Now it already hangs when Steam starts up in Big Picture mode. Same with the new DMCUB firmware or older one.
This time, only
amdgpu 0000:0c:00.0: [drm] *ERROR* [CRTC:82:crtc-0] flip_done timed out
appears in dmesg.
Signature · 2 lines
Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and Xwayland developer
Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
[Public]
I see, thanks for the info. I'll try repro'ing it locally. But do you have the open userspace stack from AMD's packaged driver installed ? If not, could you please try downloading from https://www.amd.com/en/support/linux-drivers and install just the open components? You can run:
sudo amdgpu-install --use-case=graphics --no-dkms
--
Regards,
Jay
________________________________
From: amd-gfx <[email protected]> on behalf of Michel Dänzer <[email protected]>
Sent: Thursday, June 1, 2023 10:59 AM
To: Pillai, Aurabindo <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; [email protected] <[email protected]>; Chalmers, Wesley <[email protected]>
Cc: Wang, Chao-kai (Stylon) <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Chiu, Solomon <[email protected]>; Lin, Wayne <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]>
Subject: Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
Quoted 12 lines · Aurabindo Pillai
Quoted 11 lines · Michel Dänzer
Quoted 10 lines · Aurabindo Pillai
Quoted 8 lines · Michel Dänzer
Quoted 2 lines · Aurabindo
Sorry - the firmware in the previous message is for DCN32. For Navi2x, please use the firmware attached here.
Same problem (contents of
/sys/kernel/debug/dri/0/amdgpu_firmware_infobelow).Even if it did work with newer FW, the kernel must keep working with older FW, so in that case the new behaviour would need to be guarded by the FW version.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Agreed. Were you able to repro the hang on any other modes/monitors?
Haven't tried specifically, and this is the only system I have with VRR.
Hi Michel,
I've fixed a related issue on Navi21. Could you please try the attached DMCUB along with the patches to be applied on top of amd-staging-drm-next and check if the hang/corruption is gone?
Thanks, though I'm afraid that made it kind of worse: Now it already hangs when Steam starts up in Big Picture mode. Same with the new DMCUB firmware or older one.
This time, only
amdgpu 0000:0c:00.0: [drm] *ERROR* [CRTC:82:crtc-0] flip_done timed out
appears in dmesg.
--
Earthling Michel Dänzer | https://redhat.com
Libre software enthusiast | Mesa and Xwayland developer
Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
Quoted 2 lines · Aurabindo
I see, thanks for the info. I'll try repro'ing it locally.
Thanks. Note that I'm using a GNOME Wayland session, which doesn't support VRR upstream yet (I'm building mutter with https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1154 for that). I don't know if it's reproducible with Xorg.
Quoted 1 line
But do you have the open userspace stack from AMD's packaged driver installed ? If not, could you please try downloading from https://www.amd.com/en/support/linux-drivers <https://www.amd.com/en/support/linux-drivers> and install just the open components?
I don't, and I'd rather not unless it's absolutely necessary. I'm not sure how the user-space drivers could affect this.
I'll happily test further patches though.
Signature · 2 lines
Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and Xwayland developer
Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
[Public]
Hi Michel,
AMD driver package also contains various firmware that could make a difference. Even though I do not expect any major deltas for Navi21 at this point, its an extra variable in the equation that could potentially create a different behaviour.
We tried upstream stack (without any AMD packaged driver) on Ubuntu 22.04 on the same display that you reported the issue on, but couldn't reproduce the hang you're seeing (using a different steam game that uses the same framework). Maybe your custom gnome build could have affected the results too. Could you provide instructions for setting up your userspace environment ?
Other than the game, is there any other workload that could trigger the hang? We have a set of IGT tests you could try:
Repo: https://gitlab.freedesktop.org/drm/igt-gpu-tools
Build & install:
meson build
# Compile IGT
ninja -C build
# Download Piglit./scripts/run-tests.sh -d
Run tests./scripts/run-tests.sh -s -T /path/to/navi21_postsubmission.testlist
--
Regards,
Jay
________________________________
From: Michel Dänzer <[email protected]>
Sent: Thursday, June 1, 2023 11:53 AM
To: Pillai, Aurabindo <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; [email protected] <[email protected]>; Chalmers, Wesley <[email protected]>
Cc: Wang, Chao-kai (Stylon) <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Chiu, Solomon <[email protected]>; Lin, Wayne <[email protected]>; Wentland, Harry <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]>
Subject: Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
Quoted 2 lines · Aurabindo
I see, thanks for the info. I'll try repro'ing it locally.
Thanks. Note that I'm using a GNOME Wayland session, which doesn't support VRR upstream yet (I'm building mutter with https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1154 for that). I don't know if it's reproducible with Xorg.
Quoted 1 line
But do you have the open userspace stack from AMD's packaged driver installed ? If not, could you please try downloading from https://www.amd.com/en/support/linux-drivers <https://www.amd.com/en/support/linux-drivers> and install just the open components?
I don't, and I'd rather not unless it's absolutely necessary. I'm not sure how the user-space drivers could affect this.
I'll happily test further patches though.
--
Earthling Michel Dänzer | https://redhat.com
Libre software enthusiast | Mesa and Xwayland developer
Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
Quoted 2 lines · Aurabindo
AMD driver package also contains various firmware that could make a difference.
I tried the firmware from amdgpu-dkms-firmware_1%3a5.18.13.50405-1577590.20.04_all.deb, it didn't help for either hang.
I also tried the firmware from current linux-firmware Git, didn't help either.
Quoted 1 line
We tried upstream stack (without any AMD packaged driver) on Ubuntu 22.04 on the same display that you reported the issue on, but couldn't reproduce the hang you're seeing (using a different steam game that uses the same framework). Maybe your custom gnome build could have affected the results too.
I've been able to reproduce both hangs with a stock KDE Plasma 5.27 Wayland session as well. The older hang when starting the game can be avoided by disabling VRR in the KDE Plasma display settings, the newer hang with the program OTG patch cannot.
I've been able to reproduce both hangs with a GNOME X11 session as well. So my custom mutter build doesn't affect the results.
Quoted 1 line
Other than the game, is there any other workload that could trigger the hang?
With the program OTG patch, just logging into a GNOME or KDE Plasma session does it (I previously thought it happened only when Steam Big Picture starts up, but then I noticed I couldn't see my GNOME session at all). Disabling FreeSync in the monitor's OSD menu avoids this hang.
FWIW, I've verified that neither hang occurs with only the program OTG patch applied and the other two patches reverted.
Quoted 1 line
We have a set of IGT tests you could try:
Results attached. This is with all 3 problematic patches applied and FreeSync enabled in the monitor's OSD settings.
Signature · 2 lines
Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and Xwayland developer
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): CH0PR12MB528496B026471110065187488B52A@CH0PR12MB5284.namprd12.prod.outlook.com
Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
Quoted 2 lines · Aurabindo
I'm attaching another DMCUB firmware which has the bug fix for the hang we saw at our end and some added tracing enabled.
Still runs into the newer hang when starting a KDE Plasma Wayland session.
Should I try this for starting the game without the program OTG patch as well?
Quoted 3 lines
Could you please grab the dmesg with the following added to the kernel cmdline: "drm.debug=0x156 log_buf_len=20M" using stock gnome/kde when you have all 3 patches merged ?
Also attach the contents of
/sys/kernel/debug/dri/0/amdgpu_dm_dmub_tracebuffer
Both files attached.
Signature · 2 lines
Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and Xwayland developer
trace_code=14 tick_count=803999866 param0=278 param1=385593 trace_code=1 tick_count=3671977301 param0=10 param1=0 trace_code=1 tick_count=3671977329 param0=10 param1=1 trace_code=1 tick_count=3671977641 param0=10 param1=3 trace_code=1 tick_count=3671977821 param0=10 param1=4 trace_code=252 tick_count=3671978129 param0=1844 param1=2 trace_code=1 tick_count=3671978793 param0=10 param1=1 trace_code=1 tick_count=3671978825 param0=10 param1=1 trace_code=1 tick_count=3671978857 param0=10 param1=1 trace_code=1 tick_count=3671978885 param0=10 param1=1 trace_code=1 tick_count=3671978917 param0=10 param1=1 trace_code=248 tick_count=3671979201 param0=39399 param1=1454 trace_code=1 tick_count=3671979237 param0=15 param1=1 trace_code=1 tick_count=3671979265 param0=9 param1=0 trace_code=1 tick_count=3671979293 param0=11 param1=1 trace_code=1 tick_count=3671979325 param0=11 param1=2 trace_code=1 tick_count=3672322941 param0=14 param1=0 trace_code=1 tick_count=3672322973 param0=14 param1=4 trace_code=1 tick_count=3672323705 param0=13 param1=4 trace_code=1 tick_count=3672324361 param0=14 param1=0 trace_code=1 tick_count=3672324397 param0=14 param1=1 trace_code=1 tick_count=3672324437 param0=14 param1=2 trace_code=250 tick_count=3672324497 param0=39399 param1=1454 trace_code=1 tick_count=3672355113 param0=14 param1=4 trace_code=1 tick_count=3672355353 param0=13 param1=1 trace_code=249 tick_count=3672362293 param0=39399 param1=1454 trace_code=1 tick_count=3672362325 param0=15 param1=1 trace_code=251 tick_count=3672362389 param0=39399 param1=1454 trace_code=1 tick_count=3672362541 param0=12 param1=2 trace_code=1 tick_count=3672362809 param0=12 param1=3 trace_code=1 tick_count=3672362845 param0=12 param1=3 trace_code=1 tick_count=3672362877 param0=12 param1=3 trace_code=1 tick_count=3672362909 param0=12 param1=3 trace_code=1 tick_count=3672362941 param0=12 param1=3 trace_code=249 tick_count=3672363241 param0=39399 param1=1454 trace_code=1 tick_count=3672363273 param0=15 param1=1 trace_code=1 tick_count=3672363305 param0=12 param1=1 trace_code=1 tick_count=3672434629 param0=14 param1=0 trace_code=1 tick_count=3672434657 param0=14 param1=4 trace_code=1 tick_count=3672434897 param0=13 param1=3 trace_code=252 tick_count=3672435049 param0=0 param1=3 trace_code=248 tick_count=3672958573 param0=39817 param1=1454 trace_code=1 tick_count=3672958605 param0=15 param1=1 trace_code=1 tick_count=3672958637 param0=9 param1=0 trace_code=1 tick_count=3672958665 param0=11 param1=1 trace_code=1 tick_count=3672958981 param0=11 param1=4 trace_code=1 tick_count=3672959013 param0=10 param1=0 trace_code=1 tick_count=3672959041 param0=10 param1=1 trace_code=1 tick_count=3672959141 param0=10 param1=3 trace_code=1 tick_count=3672959229 param0=10 param1=4 trace_code=252 tick_count=3672959273 param0=1844 param1=2 trace_code=1 tick_count=3672959461 param0=10 param1=1 trace_code=1 tick_count=3672959493 param0=10 param1=1 trace_code=1 tick_count=3672959529 param0=10 param1=1 trace_code=1 tick_count=3672959557 param0=10 param1=1 trace_code=1 tick_count=3672959589 param0=10 param1=1 trace_code=248 tick_count=3672959973 param0=39822 param1=1454 trace_code=1 tick_count=3672960005 param0=15 param1=1 trace_code=1 tick_count=3672960033 param0=9 param1=0 trace_code=1 tick_count=3672960061 param0=11 param1=1 trace_code=1 tick_count=3672960089 param0=11 param1=2 trace_code=0 tick_count=0 param0=0 param1=0 trace_code=0 tick_count=0 param0=0 param1=0 trace_code=0 tick_count=0 param0=0 param1=0 trace_code=0 tick_count=0 param0=0 param1=0 trace_code=0 tick_count=0 param0=0 param1=0 trace_code=0 tick_count=0 param0=0 param1=0
Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
[Public]
Thanks Michel.
Do you see the issue if you force disable FAMS? The following diff should do:
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c +2 -1
@@ -725,7 +725,8 @@ static const struct dc_debug_options debug_defaults_drv = { .dwb_fi_phase = -1, // -1 = disable, .dmub_command_table = true, .use_max_lb = true, - .exit_idle_opt_for_cursor_updates = true + .exit_idle_opt_for_cursor_updates = true, + .disable_fams=true };static const struct dc_panel_config panel_config_defaults = {
--
Regards,
Jay
________________________________
From: Michel Dänzer <[email protected]>
Sent: Wednesday, June 7, 2023 1:00 PM
To: Pillai, Aurabindo <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; Chalmers, Wesley <[email protected]>
Cc: Wang, Chao-kai (Stylon) <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Chiu, Solomon <[email protected]>; Lin, Wayne <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]>; [email protected] <[email protected]>
Subject: Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
Quoted 2 lines · Aurabindo
I'm attaching another DMCUB firmware which has the bug fix for the hang we saw at our end and some added tracing enabled.
Still runs into the newer hang when starting a KDE Plasma Wayland session.
Should I try this for starting the game without the program OTG patch as well?
Quoted 3 lines
Could you please grab the dmesg with the following added to the kernel cmdline: "drm.debug=0x156 log_buf_len=20M" using stock gnome/kde when you have all 3 patches merged ?
Also attach the contents of
/sys/kernel/debug/dri/0/amdgpu_dm_dmub_tracebuffer
Both files attached.
--
Earthling Michel Dänzer | https://redhat.com
Libre software enthusiast | Mesa and Xwayland developer
Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
Quoted 2 lines · Aurabindo
Do you see the issue if you force disable FAMS?
Neither hang occurs with FAMS disabled.
Signature · 2 lines
Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and Xwayland developer
Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
[Public]
Thanks Michel,
I reached out to windows driver team, and they have a monitor specific quirk to disable FAMS on this model. I suspect the issue is only present on certain fw revisions on the monitor which is why we cant see your issue.
Unfortunately, having the patches in question reverted causes hangs with 3 monitor setups. So I will push that monitor specific quirk and bring back the reverted patches.
--
Regards,
Jay
________________________________
From: Michel Dänzer <[email protected]>
Sent: Thursday, June 8, 2023 10:20 AM
To: Pillai, Aurabindo <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; Chalmers, Wesley <[email protected]>
Cc: Wang, Chao-kai (Stylon) <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; [email protected] <[email protected]>; Chiu, Solomon <[email protected]>; Lin, Wayne <[email protected]>; Wentland, Harry <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]>
Subject: Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
Quoted 2 lines · Aurabindo
Do you see the issue if you force disable FAMS?
Neither hang occurs with FAMS disabled.
--
Earthling Michel Dänzer | https://redhat.com
Libre software enthusiast | Mesa and Xwayland developer
Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
Quoted 6 lines · Aurabindo
Thanks Michel,
I reached out to windows driver team, and they have a monitor specific quirk to disable FAMS on this model. I suspect the issue is only present on certain fw revisions on the monitor which is why we cant see your issue.
Unfortunately, having the patches in question reverted causes hangs with 3 monitor setups. So I will push that monitor specific quirk and bring back the reverted patches.
Sounds good, thanks.
Signature · 2 lines
Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and Xwayland developer
Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
[Public]
Hi Michel,
I want to double check if we're identifying the correct monitor for applying the workaround. Could you please try the attached patch and let me know the panel id ?
--
Regards,
Jay
________________________________
From: Michel Dänzer <[email protected]>
Sent: Thursday, June 8, 2023 11:18 AM
To: Pillai, Aurabindo <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; Chalmers, Wesley <[email protected]>
Cc: Wang, Chao-kai (Stylon) <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; [email protected] <[email protected]>; Chiu, Solomon <[email protected]>; Lin, Wayne <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]>
Subject: Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
Quoted 6 lines · Aurabindo
Thanks Michel,
I reached out to windows driver team, and they have a monitor specific quirk to disable FAMS on this model. I suspect the issue is only present on certain fw revisions on the monitor which is why we cant see your issue.
Unfortunately, having the patches in question reverted causes hangs with 3 monitor setups. So I will push that monitor specific quirk and bring back the reverted patches.
Sounds good, thanks.
--
Earthling Michel Dänzer | https://redhat.com
Libre software enthusiast | Mesa and Xwayland developer
From 3dfcb5e60ec9fc9ec6c573231e5b6aa4edca2ed6 Mon Sep 17 00:00:00 2001
From: Aurabindo Pillai <[email protected]>
Date: Mon, 12 Jun 2023 12:44:00 -0400
Subject: [PATCH] drm/amd/display: Add monitor specific edid quirk
Disable FAMS on a Samsung Odyssey G9 monitor. Experiments show that this monitor does not work well under some use cases, and is likely implementation specific bug on some revisions of the device.
--- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +24 -0
@@ -44,6 +44,28 @@#include "dm_helpers.h" #include "ddc_service_types.h" +static u32 edid_extract_panel_id (struct edid *edid) +{ +return (u32 )edid->mfg_id[0 ] <<24 | + (u32 )edid->mfg_id[1 ] <<16 | + (u32 )EDID_PRODUCT_ID (edid); +} + +static void apply_edid_quirks (struct edid *edid,struct dc_edid_caps *edid_caps) { +uint32_t panel_id =edid_extract_panel_id (edid); + +switch (panel_id) { +case drm_edid_encode_panel_id ('S' ,'A' ,'M' ,0x0E5E ): +case drm_edid_encode_panel_id ('S' ,'A' ,'M' ,0x7053 ): +pr_err ("### Applying any edid quirk for panel %x\n" , panel_id); + edid_caps->panel_patch.disable_fams = true; +break ; +default : +pr_err ("### Not applying any edid quirk for panel %x\n" , panel_id); +return ; + } +} +/* dm_helpers_parse_edid_caps * * Parse edid caps
@@ -115,6 +137,8 @@ enum dc_edid_status dm_helpers_parse_edid_caps(else edid_caps->speaker_flags =DEFAULT_SPEAKER_LOCATION ; +apply_edid_quirks (edid_buf, edid_caps); +kfree (sads);kfree (sadb);
Signature · 1 line
2.40.1
Re: [PATCH 10/66] drm/amd/display: Do not set drr on pipe commit
Quoted 2 lines · Aurabindo
I want to double check if we're identifying the correct monitor for applying the workaround. Could you please try the attached patch and let me know the panel id ?
amdgpu: ### Not applying any edid quirk for panel 4c2d71ac
I'm attaching the EDID.
BTW, I'm using the monitor firmware version 1011.0, which AFAICT is the latest.
Signature · 2 lines
Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and Xwayland developer
PATCH 11/66 drm/amd/display: Block optimize on consecutive FAMS enables
In reply to Qingqing ZhuoFrom: Wesley Chalmers <[email protected]>
[WHY]
It is possible to commit state multiple times in rapid succession with FAMS enabled; if each of these commits were to set optimized_required, then the user may see latency.
[HOW]fw_based_mclk_switching is currently not used in dc->clk_mgr; use it to track whether the current state has FAMS enabled;
if it has, then do not disable FAMS in prepare_bandwidth, and do not set optimized_required.
--- .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 3 +++ .../drm/amd/display/dc/dcn30/dcn30_hwseq.c | 22 ++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +3 -0
@@ -2117,6 +2117,9 @@ void dcn20_optimize_bandwidth(dc_dmub_srv_p_state_delegate (dc, true, context); context->bw_ctx.bw.dcn.clk.p_state_change_support = true; + dc->clk_mgr->clks.fw_based_mclk_switching = true; + }else { + dc->clk_mgr->clks.fw_based_mclk_switching = false; } dc->clk_mgr->funcs->update_clocks(
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c +19 -3
@@ -983,9 +983,13 @@ void dcn30_set_disp_pattern_generator(const struct dc *dc, }void dcn30_prepare_bandwidth (struct dc *dc, -struct dc_state *context) +struct dc_state *context) { -if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching) { +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; }
@@ -996,7 +1000,19 @@ 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); -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; + } }
Signature · 1 line
2.34.1
PATCH 12/66 drm/amd/display: Add missing WA and MCLK validation
In reply to Qingqing ZhuoFrom: Rodrigo Siqueira <[email protected]>
When the commit a983d2631869 (drm/amd/display: Don't set dram clock change requirement for SubVP) was merged, we missed some parts associated with the MCLK switch. This commit adds all the missing parts.
--- .../gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 1 + .../drm/amd/display/dc/dcn32/dcn32_resource.c | 2 +- .../drm/amd/display/dc/dml/dcn30/dcn30_fpu.c | 18 +++++++++++++++++- 3 files changed, 19 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +1 -0
@@ -948,6 +948,7 @@ void dcn32_init_hw(struct dc *dc)if (dc->ctx->dmub_srv) {dc_dmub_srv_query_caps_cmd (dc->ctx->dmub_srv->dmub); dc->caps.dmub_caps.psr = dc->ctx->dmub_srv->dmub->feature_caps.psr; + dc->caps.dmub_caps.mclk_sw = dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch; } }
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +1 -1
@@ -2023,7 +2023,7 @@ int dcn32_populate_dml_pipes_from_context(// In general cases we want to keep the dram clock change requirement // (prefer configs that support MCLK switch). Only override to false // for SubVP -if (subvp_in_use) +if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching || subvp_in_use) context->bw_ctx.dml.soc.dram_clock_change_requirement_final = false;else context->bw_ctx.dml.soc.dram_clock_change_requirement_final = true;
drivers/gpu/drm/amd/display/dc/dml/dcn30/dcn30_fpu.c +17 -1
@@ -368,7 +368,9 @@ void dcn30_fpu_update_soc_for_wm_a(struct dc *dc, struct dc_state *context)dc_assert_fp_enabled ();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; +if (!context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching || + context->bw_ctx.dml.soc.dram_clock_change_latency_us ==0 ) + 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; }
@@ -563,6 +565,20 @@ void dcn30_fpu_calculate_wm_and_dlg( pipe_idx++; } +// WA: restrict FPO to use first non-strobe mode (NV24 BW issue) +if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching && + dc->dml.soc.num_chans <=4 && + context->bw_ctx.dml.vba.DRAMSpeed <=1700 && + context->bw_ctx.dml.vba.DRAMSpeed >=1500 ) { + +for (i =0 ; i < dc->dml.soc.num_states; i++) { +if (dc->dml.soc.clock_limits[i].dram_speed_mts >1700 ) { + context->bw_ctx.dml.vba.DRAMSpeed = dc->dml.soc.clock_limits[i].dram_speed_mts; +break ; + } + } + } +dcn20_calculate_dlg_params (dc, context, pipes, pipe_cnt, vlevel);if (!pstate_en)
Signature · 1 line
2.34.1
PATCH 13/66 drm/amd/display: copy dmub caps to dc on dcn31
In reply to Qingqing ZhuoFrom: Josip Pavic <[email protected]>
[Why & How]
Add code path to copy dmub caps to dc, which is missing on dcn31
--- drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c +4 -0
@@ -295,6 +295,10 @@ void dcn31_init_hw(struct dc *dc)if (dc->res_pool->hubbub->funcs->init_crb) dc->res_pool->hubbub->funcs->init_crb (dc->res_pool->hubbub);#endif + +// Get DMCUB capabilities +dc_dmub_srv_query_caps_cmd (dc->ctx->dmub_srv->dmub); + dc->caps.dmub_caps.psr = dc->ctx->dmub_srv->dmub->feature_caps.psr; } void dcn31_dsc_pg_control(
Signature · 1 line
2.34.1
PATCH 14/66 drm/amd/display: allow edp updates for virtual signal
In reply to Qingqing ZhuoFrom: Alex Hung <[email protected]>
[Why]
When IGT's kms_hdmi_inject forces EDID for HDMI audio, dc rejects the request because virtual signal is not in dc_is_audio_capable_signal function.
[How]
Includes SIGNAL_TYPE_VIRTUAL as audio capable.
--- drivers/gpu/drm/amd/display/include/signal_types.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/include/signal_types.h +1 -0
@@ -104,6 +104,7 @@ 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 15/66 drm/amd/display: Fix in disabling secure display
In reply to Qingqing ZhuoFrom: Alan Liu <[email protected]>
[Why]
Currently we don't check if secure display is enabled before we send command to disable secure display in dmub. It will accidentally cause some other igt tests to fail, eg, crtc-linear-degamma.
[How]
Refactor the code we reset the secure display state to check secure display was enabled or not before stopping it in dmub.
--- .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c +13 -18
@@ -83,12 +83,15 @@ const char *const *amdgpu_dm_crtc_get_crc_sources(struct drm_crtc *crtc, }#ifdef CONFIG_DRM_AMD_SECURE_DISPLAY -static void amdgpu_dm_set_crc_window_default (struct drm_crtc *crtc) +static void amdgpu_dm_set_crc_window_default (struct drm_crtc *crtc,struct dc_stream_state *stream) {struct drm_device *drm_dev = crtc->dev; +struct amdgpu_display_manager *dm = &drm_to_adev (drm_dev)->dm;struct amdgpu_crtc *acrtc =to_amdgpu_crtc (crtc); +bool was_activated;spin_lock_irq (&drm_dev->event_lock); + was_activated = acrtc->dm_irq_params.window_param.activated; acrtc->dm_irq_params.window_param.x_start =0 ; acrtc->dm_irq_params.window_param.y_start =0 ; acrtc->dm_irq_params.window_param.x_end =0 ;
@@ -97,6 +100,14 @@ static void amdgpu_dm_set_crc_window_default(struct drm_crtc *crtc) acrtc->dm_irq_params.window_param.update_win = false; acrtc->dm_irq_params.window_param.skip_frame_cnt =0 ;spin_unlock_irq (&drm_dev->event_lock); + +/* Disable secure_display if it was enabled */ +if (was_activated) { +/* stop ROI update on this crtc */ +flush_work (&dm->secure_display_ctxs[crtc->index].notify_ta_work); +flush_work (&dm->secure_display_ctxs[crtc->index].forward_roi_work); +dc_stream_forward_crc_window (stream,NULL , true); + } }static void amdgpu_dm_crtc_notify_ta_to_read (struct work_struct *work)
@@ -204,9 +215,6 @@ int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc *crtc,struct dm_crtc_state *dm_crtc_state, enum amdgpu_dm_pipe_crc_source source) { -#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY ) -int i; -#endif struct amdgpu_device *adev = drm_to_adev(crtc->dev);struct dc_stream_state *stream_state = dm_crtc_state->stream;bool enable =amdgpu_dm_is_valid_crc_source (source);
@@ -220,19 +228,6 @@ int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc *crtc,/* Enable or disable CRTC CRC generation */ if (dm_is_crc_source_crtc (source) || source ==AMDGPU_DM_PIPE_CRC_SOURCE_NONE ) { -#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY ) -/* Disable secure_display if it was enabled */ -if (!enable) { -for (i =0 ; i < adev->mode_info.num_crtc; i++) { -if (adev->dm.secure_display_ctxs[i].crtc == crtc) { -/* stop ROI update on this crtc */ -flush_work (&adev->dm.secure_display_ctxs[i].notify_ta_work); -flush_work (&adev->dm.secure_display_ctxs[i].forward_roi_work); -dc_stream_forward_crc_window (stream_state,NULL , true); - } - } - } -#endif if (!dc_stream_configure_crc (stream_state->ctx->dc, stream_state,NULL , enable, enable)) { ret = -EINVAL ;
@@ -363,7 +358,7 @@ int amdgpu_dm_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name)#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY )/* Reset secure_display when we change crc source from debugfs */ -amdgpu_dm_set_crc_window_default (crtc); +amdgpu_dm_set_crc_window_default (crtc, crtc_state->stream);#endif if (amdgpu_dm_crtc_configure_crc_source (crtc, crtc_state, source)) {
Signature · 1 line
2.34.1
PATCH 16/66 drm/amd/display: Fix hang when skipping modeset
In reply to Qingqing ZhuoFrom: Aurabindo Pillai <[email protected]>
[Why&How]
When skipping full modeset since the only state change was a front porch change, the DC commit sequence requires extra checks to handle non existant plane states being asked to be removed from context.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 ++++- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -1
@@ -7971,6 +7971,8 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,continue ; dc_plane = dm_new_plane_state->dc_state; +if (!dc_plane) +continue ; bundle->surface_updates[planes_count].surface = dc_plane;if (new_pcrtc_state->color_mgmt_changed) {
@@ -9619,8 +9621,9 @@ static int dm_update_plane_state(struct dc *dc,return -EINVAL ; } +if (dm_old_plane_state->dc_state) +dc_plane_state_release (dm_old_plane_state->dc_state); -dc_plane_state_release (dm_old_plane_state->dc_state); dm_new_plane_state->dc_state =NULL ; *lock_and_validation_needed = true;
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +3 -0
@@ -1707,6 +1707,9 @@ bool dc_remove_plane_from_context(struct dc_stream_status *stream_status =NULL ;struct resource_pool *pool = dc->res_pool; +if (!plane_state) +return true; +for (i =0 ; i < context->stream_count; i++)if (context->streams[i] == stream) { stream_status = &context->stream_status[i];
Signature · 1 line
2.34.1
PATCH 17/66 drm/amd/display: fix memleak in aconnector->timing_requested
In reply to Qingqing ZhuoFrom: Hersen Wu <[email protected]>
[Why]
when amdgpu_dm_update_connector_after_detect is called two times successively with valid sink, memory allocated of aconnector->timing_requested for the first call is not free. this causes memeleak.
[How]
allocate memory only when aconnector->timing_requested is null.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +6 -3
@@ -3127,9 +3127,12 @@ void amdgpu_dm_update_connector_after_detect( aconnector->edid); } - aconnector->timing_requested =kzalloc (sizeof (struct dc_crtc_timing ),GFP_KERNEL ); -if (!aconnector->timing_requested) -dm_error ("%s: failed to create aconnector->requested_timing\n" , __func__); +if (!aconnector->timing_requested) { + aconnector->timing_requested = +kzalloc (sizeof (struct dc_crtc_timing ),GFP_KERNEL ); +if (!aconnector->timing_requested) +dm_error ("failed to create aconnector->requested_timing\n" ); + }drm_connector_update_edid_property (connector, aconnector->edid);amdgpu_dm_update_freesync_caps (connector, aconnector->edid);
Signature · 1 line
2.34.1
PATCH 18/66 drm/amd/display: update max streams per surface
In reply to Qingqing ZhuoFrom: Dmytro Laktyushkin <[email protected]>
Increse to 6 as that is the max surfaces supported asics can have. The is no practical use case yet, but this is valuable for pre-si validation.
--- drivers/gpu/drm/amd/display/dc/dc_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc_types.h +1 -1
@@ -83,7 +83,7 @@ struct dc_perf_trace {unsigned long last_entry_write; }; -#define MAX_SURFACE_NUM 4 +#define MAX_SURFACE_NUM 6#define NUM_PIXEL_FORMATS 10enum tiling_mode {
Signature · 1 line
2.34.1
PATCH 19/66 drm/amd/display: Only consider DISPCLK when using optimized boot path
In reply to Qingqing ZhuoFrom: Alvin Lee <[email protected]>
[Description]
- Previous bug fix for audio issue included dtbclk and p-state on the optimized boot path which is incorarect
- We only care about DISPCLK in the optimized vs. non-optimized boot path to avoid audio issues
--- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +3 -3
@@ -721,6 +721,9 @@ static void dcn32_initialize_min_clocks(struct dc *dc) clocks->socclk_khz = dc->clk_mgr->bw_params->clk_table.entries[0 ].socclk_mhz *1000 ; clocks->dramclk_khz = dc->clk_mgr->bw_params->clk_table.entries[0 ].memclk_mhz *1000 ; clocks->dppclk_khz = dc->clk_mgr->bw_params->clk_table.entries[0 ].dppclk_mhz *1000 ; + clocks->ref_dtbclk_khz = dc->clk_mgr->bw_params->clk_table.entries[0 ].dtbclk_mhz *1000 ; + clocks->fclk_p_state_change_support = true; + clocks->p_state_change_support = true;if (dc->debug.disable_boot_optimizations) { clocks->dispclk_khz = dc->clk_mgr->bw_params->clk_table.entries[0 ].dispclk_mhz *1000 ; }else {
@@ -730,9 +733,6 @@ static void dcn32_initialize_min_clocks(struct dc *dc)* freq to ensure that the timing is valid and unchanged. */ clocks->dispclk_khz = dc->clk_mgr->funcs->get_dispclk_from_dentist (dc->clk_mgr); - clocks->ref_dtbclk_khz = dc->clk_mgr->bw_params->clk_table.entries[0 ].dtbclk_mhz *1000 ; - clocks->fclk_p_state_change_support = true; - clocks->p_state_change_support = true; } dc->clk_mgr->funcs->update_clocks(
Signature · 1 line
2.34.1
PATCH 20/66 drm/amd/display: Reduce SubVP + DRR stretch margin
In reply to Qingqing ZhuoFrom: Alvin Lee <[email protected]>
[Description]
- Having excessively large margin causes failure in the static schedulability check in some cases for SubVP + DRR
- 100us of DRR margin is sufficient based on a weeks worth of stress testing on different display configs
--- drivers/gpu/drm/amd/display/dc/dc_stream.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc_stream.h +1 -1
@@ -144,7 +144,7 @@ struct test_pattern {unsigned int cust_pattern_size; }; -#define SUBVP_DRR_MARGIN_US 600 // 600us for DRR margin (SubVP + DRR) +#define SUBVP_DRR_MARGIN_US 100 // 100us for DRR margin (SubVP + DRR)enum mall_stream_type {SUBVP_NONE ,// subvp not in use
Signature · 1 line
2.34.1
PATCH 21/66 drm/amd/display: refactor dmub commands into single function
In reply to Qingqing ZhuoFrom: Josip Pavic <[email protected]>
[Why & How]
Consolidate dmub access to a single interface. This makes it easier to add code in the future that needs to run every time a dmub command is requested (e.g. instrumentation, locking etc).
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 +- .../drm/amd/display/dc/bios/command_table2.c | 25 +-- .../display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c | 4 +- .../dc/clk_mgr/dcn314/dcn314_clk_mgr.c | 4 +- .../dc/clk_mgr/dcn315/dcn315_clk_mgr.c | 4 +- .../dc/clk_mgr/dcn316/dcn316_clk_mgr.c | 4 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 23 +-- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 164 +++++++----------- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 13 +- drivers/gpu/drm/amd/display/dc/dc_helper.c | 28 +-- .../gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c | 28 +-- .../drm/amd/display/dc/dce/dmub_hw_lock_mgr.c | 4 +- .../gpu/drm/amd/display/dc/dce/dmub_outbox.c | 4 +- drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 28 +-- .../gpu/drm/amd/display/dc/dcn21/dcn21_hubp.c | 7 +- .../drm/amd/display/dc/dcn21/dcn21_hwseq.c | 8 +- .../drm/amd/display/dc/dcn30/dcn30_hwseq.c | 16 +- .../display/dc/dcn31/dcn31_dio_link_encoder.c | 8 +- .../drm/amd/display/dc/dcn31/dcn31_hwseq.c | 10 +- .../amd/display/dc/dcn31/dcn31_panel_cntl.c | 4 +- .../drm/amd/display/dc/dcn314/dcn314_hwseq.c | 4 +- .../drm/amd/display/dc/dcn32/dcn32_hwseq.c | 12 +- drivers/gpu/drm/amd/display/dc/dm_services.h | 7 + .../drm/amd/display/dc/dm_services_types.h | 6 + .../dc/link/protocols/link_dp_capability.c | 2 +- .../display/dc/link/protocols/link_dp_dpia.c | 2 +- 26 files changed, 148 insertions(+), 283 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +11 -1
@@ -10310,7 +10310,7 @@ static bool dm_edid_parser_send_cea(struct amdgpu_display_manager *dm, input->cea_total_length = total_length;memcpy (input->payload, data, length); - res =dc_dmub_srv_cmd_with_reply_data (dm->dc->ctx->dmub_srv, &cmd); + res =dm_execute_dmub_cmd (dm->dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY );if (!res) {DRM_ERROR ("EDID CEA parser failed\n" );return false;
@@ -10760,3 +10760,13 @@ bool check_seamless_boot_capability(struct amdgpu_device *adev)return false; } + +bool dm_execute_dmub_cmd (const struct dc_context *ctx,union dmub_rb_cmd *cmd,enum dm_dmub_wait_type wait_type) +{ +return dc_dmub_srv_cmd_run (ctx->dmub_srv, cmd, wait_type); +} + +bool dm_execute_dmub_cmd_list (const struct dc_context *ctx,unsigned int count,union dmub_rb_cmd *cmd,enum dm_dmub_wait_type wait_type) +{ +return dc_dmub_srv_cmd_run_list (ctx->dmub_srv, count, cmd, wait_type); +}
drivers/gpu/drm/amd/display/dc/bios/command_table2.c +6 -19
@@ -123,9 +123,7 @@ static void encoder_control_dmcub(sizeof (cmd.digx_encoder_control.header); cmd.digx_encoder_control.encoder_control.dig.stream_param = *dig; -dc_dmub_srv_cmd_queue (dmcub, &cmd); -dc_dmub_srv_cmd_execute (dmcub); -dc_dmub_srv_wait_idle (dmcub); +dm_execute_dmub_cmd (dmcub->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); } static enum bp_result encoder_control_digx_v1_5(
@@ -261,9 +259,7 @@ static void transmitter_control_dmcub(sizeof (cmd.dig1_transmitter_control.header); cmd.dig1_transmitter_control.transmitter_control.dig = *dig; -dc_dmub_srv_cmd_queue (dmcub, &cmd); -dc_dmub_srv_cmd_execute (dmcub); -dc_dmub_srv_wait_idle (dmcub); +dm_execute_dmub_cmd (dmcub->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); } static enum bp_result transmitter_control_v1_6(
@@ -325,9 +321,7 @@ static void transmitter_control_dmcub_v1_7(sizeof (cmd.dig1_transmitter_control.header); cmd.dig1_transmitter_control.transmitter_control.dig_v1_7 = *dig; -dc_dmub_srv_cmd_queue (dmcub, &cmd); -dc_dmub_srv_cmd_execute (dmcub); -dc_dmub_srv_wait_idle (dmcub); +dm_execute_dmub_cmd (dmcub->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); } static enum bp_result transmitter_control_v1_7(
@@ -435,9 +429,7 @@ static void set_pixel_clock_dmcub(sizeof (cmd.set_pixel_clock.header); cmd.set_pixel_clock.pixel_clock.clk = *clk; -dc_dmub_srv_cmd_queue (dmcub, &cmd); -dc_dmub_srv_cmd_execute (dmcub); -dc_dmub_srv_wait_idle (dmcub); +dm_execute_dmub_cmd (dmcub->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); } static enum bp_result set_pixel_clock_v7(
@@ -804,9 +796,7 @@ static void enable_disp_power_gating_dmcub(sizeof (cmd.enable_disp_power_gating.header); cmd.enable_disp_power_gating.power_gating.pwr = *pwr; -dc_dmub_srv_cmd_queue (dmcub, &cmd); -dc_dmub_srv_cmd_execute (dmcub); -dc_dmub_srv_wait_idle (dmcub); +dm_execute_dmub_cmd (dmcub->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); } static enum bp_result enable_disp_power_gating_v2_1(
@@ -1016,10 +1006,7 @@ static void enable_lvtma_control_dmcub( panel_instance; cmd.lvtma_control.data.bypass_panel_control_wait = bypass_panel_control_wait; -dc_dmub_srv_cmd_queue (dmcub, &cmd); -dc_dmub_srv_cmd_execute (dmcub); -dc_dmub_srv_wait_idle (dmcub); - +dm_execute_dmub_cmd (dmcub->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); } static enum bp_result enable_lvtma_control(
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c +1 -3
@@ -250,9 +250,7 @@ void dcn31_update_clocks(struct clk_mgr *clk_mgr_base, cmd.notify_clocks.clocks.dispclk_khz = clk_mgr_base->clks.dispclk_khz; cmd.notify_clocks.clocks.dppclk_khz = clk_mgr_base->clks.dppclk_khz; -dc_dmub_srv_cmd_queue (dc->ctx->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->ctx->dmub_srv); -dc_dmub_srv_wait_idle (dc->ctx->dmub_srv); +dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); }static int get_vco_frequency_from_reg (struct clk_mgr_internal *clk_mgr)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c +1 -3
@@ -286,9 +286,7 @@ void dcn314_update_clocks(struct clk_mgr *clk_mgr_base, cmd.notify_clocks.clocks.dispclk_khz = clk_mgr_base->clks.dispclk_khz; cmd.notify_clocks.clocks.dppclk_khz = clk_mgr_base->clks.dppclk_khz; -dc_dmub_srv_cmd_queue (dc->ctx->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->ctx->dmub_srv); -dc_dmub_srv_wait_idle (dc->ctx->dmub_srv); +dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); }static int get_vco_frequency_from_reg (struct clk_mgr_internal *clk_mgr)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c +1 -3
@@ -234,9 +234,7 @@ static void dcn315_update_clocks(struct clk_mgr *clk_mgr_base, cmd.notify_clocks.clocks.dispclk_khz = clk_mgr_base->clks.dispclk_khz; cmd.notify_clocks.clocks.dppclk_khz = clk_mgr_base->clks.dppclk_khz; -dc_dmub_srv_cmd_queue (dc->ctx->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->ctx->dmub_srv); -dc_dmub_srv_wait_idle (dc->ctx->dmub_srv); +dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); } static void dcn315_dump_clk_registers(struct clk_state_registers_and_bypass *regs_and_bypass,
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn316/dcn316_clk_mgr.c +1 -3
@@ -254,9 +254,7 @@ static void dcn316_update_clocks(struct clk_mgr *clk_mgr_base, cmd.notify_clocks.clocks.dispclk_khz = clk_mgr_base->clks.dispclk_khz; cmd.notify_clocks.clocks.dppclk_khz = clk_mgr_base->clks.dppclk_khz; -dc_dmub_srv_cmd_queue (dc->ctx->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->ctx->dmub_srv); -dc_dmub_srv_wait_idle (dc->ctx->dmub_srv); +dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); } static void dcn316_dump_clk_registers(struct clk_state_registers_and_bypass *regs_and_bypass,
drivers/gpu/drm/amd/display/dc/core/dc.c +6 -17
@@ -515,8 +515,7 @@ dc_stream_forward_dmub_crc_window(struct dc_dmub_srv *dmub_srv, cmd.secure_display.roi_info.y_end = rect->y + rect->height; } -dc_dmub_srv_cmd_queue (dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dmub_srv); +dm_execute_dmub_cmd (dmub_srv->ctx, &cmd,DM_DMUB_WAIT_TYPE_NO_WAIT ); } static inline void
@@ -3309,7 +3308,6 @@ void dc_dmub_update_dirty_rect(struct dc *dc, struct dc_state *context) {union dmub_rb_cmd cmd; -struct dc_context *dc_ctx = dc->ctx;struct dmub_cmd_update_dirty_rect_data *update_dirty_rect;unsigned int i, j;unsigned int panel_inst =0 ;
@@ -3350,8 +3348,7 @@ void dc_dmub_update_dirty_rect(struct dc *dc, update_dirty_rect->panel_inst = panel_inst; update_dirty_rect->pipe_idx = j; -dc_dmub_srv_cmd_queue (dc_ctx->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc_ctx->dmub_srv); +dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_NO_WAIT ); } } }
@@ -4627,7 +4624,6 @@ bool dc_process_dmub_aux_transfer_async(struct dc *dc, {uint8_t action;union dmub_rb_cmd cmd = {0 }; -struct dc_dmub_srv *dmub_srv = dc->ctx->dmub_srv;ASSERT (payload->length <=16 );
@@ -4675,9 +4671,7 @@ bool dc_process_dmub_aux_transfer_async(struct dc *dc, ); } -dc_dmub_srv_cmd_queue (dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dmub_srv); -dc_dmub_srv_wait_idle (dmub_srv); +dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT );return true; }
@@ -4721,7 +4715,6 @@ bool dc_process_dmub_set_config_async(struct dc *dc, struct dmub_notification *notify) {union dmub_rb_cmd cmd = {0 }; -struct dc_dmub_srv *dmub_srv = dc->ctx->dmub_srv;bool is_cmd_complete = true;/* prepare SET_CONFIG command */
@@ -4732,7 +4725,7 @@ bool dc_process_dmub_set_config_async(struct dc *dc, cmd.set_config_access.set_config_control.cmd_pkt.msg_type = payload->msg_type; cmd.set_config_access.set_config_control.cmd_pkt.msg_data = payload->msg_data; -if (!dc_dmub_srv_cmd_with_reply_data (dmub_srv, &cmd)) { +if (!dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY )) {/* command is not processed by dmub */ notify->sc_status =SET_CONFIG_UNKNOWN_ERROR ;return is_cmd_complete;
@@ -4767,7 +4760,6 @@ enum dc_status dc_process_dmub_set_mst_slots(const struct dc *dc, uint8_t *mst_slots_in_use) {union dmub_rb_cmd cmd = {0 }; -struct dc_dmub_srv *dmub_srv = dc->ctx->dmub_srv;/* prepare MST_ALLOC_SLOTS command */ cmd.set_mst_alloc_slots.header.type =DMUB_CMD__DPIA ;
@@ -4776,7 +4768,7 @@ enum dc_status dc_process_dmub_set_mst_slots(const struct dc *dc, cmd.set_mst_alloc_slots.mst_slots_control.instance = dc->links[link_index]->ddc_hw_inst; cmd.set_mst_alloc_slots.mst_slots_control.mst_alloc_slots = mst_alloc_slots; -if (!dc_dmub_srv_cmd_with_reply_data (dmub_srv, &cmd)) +if (!dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY ))/* command is not processed by dmub */ return DC_ERROR_UNEXPECTED ;
@@ -4810,14 +4802,11 @@ void dc_process_dmub_dpia_hpd_int_enable(const struct dc *dc, uint32_t hpd_int_enable) {union dmub_rb_cmd cmd = {0 }; -struct dc_dmub_srv *dmub_srv = dc->ctx->dmub_srv; cmd.dpia_hpd_int_enable.header.type =DMUB_CMD__DPIA_HPD_INT_ENABLE ; cmd.dpia_hpd_int_enable.enable = hpd_int_enable; -dc_dmub_srv_cmd_queue (dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dmub_srv); -dc_dmub_srv_wait_idle (dmub_srv); +dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT );DC_LOG_DEBUG ("%s: hpd_int_enable(%d)\n" , __func__, hpd_int_enable); }
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +62 -102
268 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h +5 -8
@@ -26,7 +26,7 @@#ifndef _DMUB_DC_SRV_H_#define _DMUB_DC_SRV_H_ -#include "os_types.h" +#include "dm_services_types.h" #include "dmub/dmub_srv.h" struct dmub_srv ;
@@ -52,16 +52,13 @@ struct dc_dmub_srv {void *dm; }; -void dc_dmub_srv_cmd_queue (struct dc_dmub_srv *dc_dmub_srv, -union dmub_rb_cmd *cmd); - -void dc_dmub_srv_cmd_execute (struct dc_dmub_srv *dc_dmub_srv); -void dc_dmub_srv_wait_idle (struct dc_dmub_srv *dc_dmub_srv);void dc_dmub_srv_wait_phy_init (struct dc_dmub_srv *dc_dmub_srv); -bool dc_dmub_srv_cmd_with_reply_data (struct dc_dmub_srv *dc_dmub_srv,union dmub_rb_cmd *cmd); +bool dc_dmub_srv_cmd_run (struct dc_dmub_srv *dc_dmub_srv,union dmub_rb_cmd *cmd,enum dm_dmub_wait_type wait_type); + +bool dc_dmub_srv_cmd_run_list (struct dc_dmub_srv *dc_dmub_srv,unsigned int count,union dmub_rb_cmd *cmd_list,enum dm_dmub_wait_type wait_type);bool dc_dmub_srv_notify_stream_mask (struct dc_dmub_srv *dc_dmub_srv,unsigned int stream_mask);
@@ -77,7 +74,7 @@ void dc_dmub_srv_drr_update_cmd(struct dc *dc, uint32_t tg_inst, uint32_t vtotalvoid dc_dmub_srv_set_drr_manual_trigger_cmd (struct dc *dc,uint32_t tg_inst);bool dc_dmub_srv_p_state_delegate (struct dc *dc,bool enable_pstate,struct dc_state *context); -void dc_dmub_srv_query_caps_cmd (struct dmub_srv *dmub); +void dc_dmub_srv_query_caps_cmd (struct dc_dmub_srv *dc_dmub_srv);void dc_dmub_srv_get_visual_confirm_color_cmd (struct dc *dc,struct pipe_ctx *pipe_ctx);void dc_dmub_srv_clear_inbox0_ack (struct dc_dmub_srv *dmub_srv);void dc_dmub_srv_wait_for_inbox0_ack (struct dc_dmub_srv *dmub_srv);
drivers/gpu/drm/amd/display/dc/dc_helper.c +3 -25
@@ -41,19 +41,13 @@ static inline void submit_dmub_read_modify_write( const struct dc_context *ctx) {struct dmub_rb_cmd_read_modify_write *cmd_buf = &offload->cmd_data.read_modify_write; -bool gather = false; offload->should_burst_write = (offload->same_addr_count == (DMUB_READ_MODIFY_WRITE_SEQ__MAX -1 )); cmd_buf->header.payload_bytes =sizeof (struct dmub_cmd_read_modify_write_sequence ) * offload->reg_seq_count; - gather = ctx->dmub_srv->reg_helper_offload.gather_in_progress; - ctx->dmub_srv->reg_helper_offload.gather_in_progress = false; - -dc_dmub_srv_cmd_queue (ctx->dmub_srv, &offload->cmd_data); - - ctx->dmub_srv->reg_helper_offload.gather_in_progress = gather; +dm_execute_dmub_cmd (ctx, &offload->cmd_data,DM_DMUB_WAIT_TYPE_NO_WAIT );memset (cmd_buf,0 ,sizeof (*cmd_buf));
@@ -66,17 +60,11 @@ static inline void submit_dmub_burst_write( const struct dc_context *ctx) {struct dmub_rb_cmd_burst_write *cmd_buf = &offload->cmd_data.burst_write; -bool gather = false; cmd_buf->header.payload_bytes =sizeof (uint32_t ) * offload->reg_seq_count; - gather = ctx->dmub_srv->reg_helper_offload.gather_in_progress; - ctx->dmub_srv->reg_helper_offload.gather_in_progress = false; - -dc_dmub_srv_cmd_queue (ctx->dmub_srv, &offload->cmd_data); - - ctx->dmub_srv->reg_helper_offload.gather_in_progress = gather; +dm_execute_dmub_cmd (ctx, &offload->cmd_data,DM_DMUB_WAIT_TYPE_NO_WAIT );memset (cmd_buf,0 ,sizeof (*cmd_buf));
@@ -88,17 +76,11 @@ static inline void submit_dmub_reg_wait( const struct dc_context *ctx) {struct dmub_rb_cmd_reg_wait *cmd_buf = &offload->cmd_data.reg_wait; -bool gather = false; - gather = ctx->dmub_srv->reg_helper_offload.gather_in_progress; - ctx->dmub_srv->reg_helper_offload.gather_in_progress = false; - -dc_dmub_srv_cmd_queue (ctx->dmub_srv, &offload->cmd_data); +dm_execute_dmub_cmd (ctx, &offload->cmd_data,DM_DMUB_WAIT_TYPE_NO_WAIT );memset (cmd_buf,0 ,sizeof (*cmd_buf)); offload->reg_seq_count =0 ; - - ctx->dmub_srv->reg_helper_offload.gather_in_progress = gather; }struct dc_reg_value_masks {
@@ -151,7 +133,6 @@ static void dmub_flush_buffer_execute( const struct dc_context *ctx) {submit_dmub_read_modify_write (offload, ctx); -dc_dmub_srv_cmd_execute (ctx->dmub_srv); } static void dmub_flush_burst_write_buffer_execute(
@@ -159,7 +140,6 @@ static void dmub_flush_burst_write_buffer_execute( const struct dc_context *ctx) {submit_dmub_burst_write (offload, ctx); -dc_dmub_srv_cmd_execute (ctx->dmub_srv); } static bool dmub_reg_value_burst_set_pack(const struct dc_context *ctx, uint32_t addr,
@@ -691,8 +671,6 @@ void reg_sequence_start_execute(const struct dc_context *ctx)default :return ; } - -dc_dmub_srv_cmd_execute (ctx->dmub_srv); } }
drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c +7 -21
@@ -75,9 +75,7 @@ static void dmub_abm_enable_fractional_pwm(struct dc_context *dc) cmd.abm_set_pwm_frac.abm_set_pwm_frac_data.panel_mask = panel_mask; cmd.abm_set_pwm_frac.header.payload_bytes =sizeof (struct dmub_cmd_abm_set_pwm_frac_data ); -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->dmub_srv); -dc_dmub_srv_wait_idle (dc->dmub_srv); +dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); }void dmub_abm_init (struct abm *abm,uint32_t backlight)
@@ -156,9 +154,7 @@ bool dmub_abm_set_level(struct abm *abm, uint32_t level, uint8_t panel_mask) cmd.abm_set_level.abm_set_level_data.panel_mask = panel_mask; cmd.abm_set_level.header.payload_bytes =sizeof (struct dmub_cmd_abm_set_level_data ); -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->dmub_srv); -dc_dmub_srv_wait_idle (dc->dmub_srv); +dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT );return true; }
@@ -180,9 +176,7 @@ void dmub_abm_set_ambient_level(struct abm *abm, unsigned int ambient_lux, uint8 cmd.abm_set_ambient_level.abm_set_ambient_level_data.panel_mask = panel_mask; cmd.abm_set_ambient_level.header.payload_bytes =sizeof (struct dmub_cmd_abm_set_ambient_level_data ); -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->dmub_srv); - dc_dmub_srv_wait_idle(dc->dmub_srv); + dm_execute_dmub_cmd(dc, &cmd, DM_DMUB_WAIT_TYPE_WAIT); }#endif
@@ -212,9 +206,7 @@ void dmub_abm_init_config(struct abm *abm, cmd.abm_init_config.header.payload_bytes =sizeof (struct dmub_cmd_abm_init_config_data ); -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->dmub_srv); -dc_dmub_srv_wait_idle (dc->dmub_srv); +dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); }
@@ -231,9 +223,7 @@ bool dmub_abm_set_pause(struct abm *abm, bool pause, unsigned int panel_inst, un cmd.abm_pause.abm_pause_data.panel_mask = panel_mask; cmd.abm_set_level.header.payload_bytes =sizeof (struct dmub_cmd_abm_pause_data ); -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->dmub_srv); -dc_dmub_srv_wait_idle (dc->dmub_srv); +dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT );return true; }
@@ -253,9 +243,7 @@ bool dmub_abm_set_pipe(struct abm *abm, uint32_t otg_inst, uint32_t option, uint cmd.abm_set_pipe.abm_set_pipe_data.ramping_boundary = ramping_boundary; cmd.abm_set_pipe.header.payload_bytes =sizeof (struct dmub_cmd_abm_set_pipe_data ); -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->dmub_srv); -dc_dmub_srv_wait_idle (dc->dmub_srv); +dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT );return true; }
@@ -277,9 +265,7 @@ bool dmub_abm_set_backlight_level(struct abm *abm, cmd.abm_set_backlight.abm_set_backlight_data.panel_mask = (0x01 << panel_inst); cmd.abm_set_backlight.header.payload_bytes =sizeof (struct dmub_cmd_abm_set_backlight_data ); -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->dmub_srv); -dc_dmub_srv_wait_idle (dc->dmub_srv); +dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT );return true; }
drivers/gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c +1 -3
@@ -47,9 +47,7 @@ void dmub_hw_lock_mgr_cmd(struct dc_dmub_srv *dmub_srv,if (!lock) cmd.lock_hw.lock_hw_data.should_release =1 ; -dc_dmub_srv_cmd_queue (dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dmub_srv); -dc_dmub_srv_wait_idle (dmub_srv); +dm_execute_dmub_cmd (dmub_srv->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); } void dmub_hw_lock_mgr_inbox0_cmd(struct dc_dmub_srv *dmub_srv,
drivers/gpu/drm/amd/display/dc/dce/dmub_outbox.c +1 -3
@@ -48,7 +48,5 @@ void dmub_enable_outbox_notification(struct dc_dmub_srv *dmub_srv)sizeof (cmd.outbox1_enable.header); cmd.outbox1_enable.enable = true; -dc_dmub_srv_cmd_queue (dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dmub_srv); -dc_dmub_srv_wait_idle (dmub_srv); +dm_execute_dmub_cmd (dmub_srv->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); }
drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c +7 -21
@@ -168,9 +168,7 @@ static bool dmub_psr_set_version(struct dmub_psr *dmub, struct dc_stream_state * cmd.psr_set_version.psr_set_version_data.panel_inst = panel_inst; cmd.psr_set_version.header.payload_bytes =sizeof (struct dmub_cmd_psr_set_version_data ); -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->dmub_srv); -dc_dmub_srv_wait_idle (dc->dmub_srv); +dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT );return true; }
@@ -198,9 +196,7 @@ static void dmub_psr_enable(struct dmub_psr *dmub, bool enable, bool wait, uint8 cmd.psr_enable.header.payload_bytes =0 ;// Send header only -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->dmub_srv); -dc_dmub_srv_wait_idle (dc->dmub_srv); +dm_execute_dmub_cmd (dc->dmub_srv->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT );/* Below loops 1000 x 500us = 500 ms. * Exit PSR may need to wait 1-2 frames to power up. Timeout after at
@@ -248,9 +244,7 @@ static void dmub_psr_set_level(struct dmub_psr *dmub, uint16_t psr_level, uint8_ cmd.psr_set_level.psr_set_level_data.psr_level = psr_level; cmd.psr_set_level.psr_set_level_data.cmd_version =DMUB_CMD_PSR_CONTROL_VERSION_1 ; cmd.psr_set_level.psr_set_level_data.panel_inst = panel_inst; -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->dmub_srv); -dc_dmub_srv_wait_idle (dc->dmub_srv); +dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); }/*
@@ -269,9 +263,7 @@ static void dmub_psr_set_sink_vtotal_in_psr_active(struct dmub_psr *dmub, cmd.psr_set_vtotal.psr_set_vtotal_data.psr_vtotal_idle = psr_vtotal_idle; cmd.psr_set_vtotal.psr_set_vtotal_data.psr_vtotal_su = psr_vtotal_su; -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->dmub_srv); -dc_dmub_srv_wait_idle (dc->dmub_srv); +dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); }/*
@@ -290,9 +282,7 @@ static void dmub_psr_set_power_opt(struct dmub_psr *dmub, unsigned int power_opt cmd.psr_set_power_opt.psr_set_power_opt_data.power_opt = power_opt; cmd.psr_set_power_opt.psr_set_power_opt_data.panel_inst = panel_inst; -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->dmub_srv); -dc_dmub_srv_wait_idle (dc->dmub_srv); +dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); }/*
@@ -422,9 +412,7 @@ static bool dmub_psr_copy_settings(struct dmub_psr *dmub, copy_settings_data->relock_delay_frame_cnt =2 ; copy_settings_data->dsc_slice_height = psr_context->dsc_slice_height; -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->dmub_srv); -dc_dmub_srv_wait_idle (dc->dmub_srv); +dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT );return true; }
@@ -445,9 +433,7 @@ static void dmub_psr_force_static(struct dmub_psr *dmub, uint8_t panel_inst) cmd.psr_force_static.header.sub_type =DMUB_CMD__PSR_FORCE_STATIC ; cmd.psr_enable.header.payload_bytes =0 ; -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->dmub_srv); -dc_dmub_srv_wait_idle (dc->dmub_srv); +dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); }/*
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubp.c +1 -6
@@ -667,7 +667,6 @@ static void program_surface_flip_and_addr(struct hubp *hubp, struct surface_flipstatic void dmcub_PLAT_54186_wa (struct hubp *hubp,struct surface_flip_registers *flip_regs) { -struct dc_dmub_srv *dmcub = hubp->ctx->dmub_srv;struct dcn21_hubp *hubp21 =TO_DCN21_HUBP (hubp);union dmub_rb_cmd cmd;
@@ -690,11 +689,7 @@ static void dmcub_PLAT_54186_wa(struct hubp *hubp, cmd.PLAT_54186_wa.flip.flip_params.vmid = flip_regs->vmid;PERF_TRACE ();// TODO: remove after performance is stable. -dc_dmub_srv_cmd_queue (dmcub, &cmd); -PERF_TRACE ();// TODO: remove after performance is stable. -dc_dmub_srv_cmd_execute (dmcub); -PERF_TRACE ();// TODO: remove after performance is stable. -dc_dmub_srv_wait_idle (dmcub); +dm_execute_dmub_cmd (hubp->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT );PERF_TRACE ();// TODO: remove after performance is stable. }
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c +2 -6
@@ -152,9 +152,7 @@ static bool dmub_abm_set_pipe(struct abm *abm, uint32_t otg_inst, uint32_t optio cmd.abm_set_pipe.abm_set_pipe_data.ramping_boundary = ramping_boundary; cmd.abm_set_pipe.header.payload_bytes =sizeof (struct dmub_cmd_abm_set_pipe_data ); -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->dmub_srv); -dc_dmub_srv_wait_idle (dc->dmub_srv); +dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT );return true; }
@@ -173,9 +171,7 @@ static void dmub_abm_set_backlight(struct dc_context *dc, uint32_t backlight_pwm cmd.abm_set_backlight.abm_set_backlight_data.panel_mask = (0x01 << panel_inst); cmd.abm_set_backlight.header.payload_bytes =sizeof (struct dmub_cmd_abm_set_backlight_data ); -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->dmub_srv); -dc_dmub_srv_wait_idle (dc->dmub_srv); +dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); }void dcn21_set_abm_immediate_disable (struct pipe_ctx *pipe_ctx)
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c +5 -11
@@ -632,7 +632,7 @@ void dcn30_init_hw(struct dc *dc) dc->res_pool->hubbub->funcs->init_crb (dc->res_pool->hubbub);// Get DMCUB capabilities -dc_dmub_srv_query_caps_cmd (dc->ctx->dmub_srv->dmub); +dc_dmub_srv_query_caps_cmd (dc->ctx->dmub_srv); dc->caps.dmub_caps.psr = dc->ctx->dmub_srv->dmub->feature_caps.psr; dc->caps.dmub_caps.mclk_sw = dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch; }
@@ -736,8 +736,7 @@ bool dcn30_apply_idle_power_optimizations(struct dc *dc, bool enable) cmd.mall.header.sub_type =DMUB_CMD__MALL_ACTION_NO_DF_REQ ; cmd.mall.header.payload_bytes =sizeof (cmd.mall) -sizeof (cmd.mall.header); -dc_dmub_srv_cmd_queue (dc->ctx->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->ctx->dmub_srv); +dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_NO_WAIT );return true; }
@@ -859,9 +858,7 @@ bool dcn30_apply_idle_power_optimizations(struct dc *dc, bool enable) cmd.mall.cursor_height = cursor_attr.height; cmd.mall.cursor_pitch = cursor_attr.pitch; -dc_dmub_srv_cmd_queue (dc->ctx->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->ctx->dmub_srv); -dc_dmub_srv_wait_idle (dc->ctx->dmub_srv); +dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT );/* Use copied cursor, and it's okay to not switch back */ cursor_attr.address.quad_part = cmd.mall.cursor_copy_dst.quad_part;
@@ -877,8 +874,7 @@ bool dcn30_apply_idle_power_optimizations(struct dc *dc, bool enable) cmd.mall.tmr_scale = tmr_scale; cmd.mall.debug_bits = dc->debug.mall_error_as_fatal; -dc_dmub_srv_cmd_queue (dc->ctx->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->ctx->dmub_srv); +dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_NO_WAIT );return true; }
@@ -895,9 +891,7 @@ bool dcn30_apply_idle_power_optimizations(struct dc *dc, bool enable) cmd.mall.header.payload_bytes =sizeof (cmd.mall) -sizeof (cmd.mall.header); -dc_dmub_srv_cmd_queue (dc->ctx->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->ctx->dmub_srv); -dc_dmub_srv_wait_idle (dc->ctx->dmub_srv); +dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT );return true; }
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_dio_link_encoder.c +2 -6
@@ -117,7 +117,6 @@ static bool query_dp_alt_from_dmub(struct link_encoder *enc, union dmub_rb_cmd *cmd) {struct dcn10_link_encoder *enc10 =TO_DCN10_LINK_ENC (enc); -struct dc_dmub_srv *dc_dmub_srv = enc->ctx->dmub_srv;memset (cmd,0 ,sizeof (*cmd)); cmd->query_dp_alt.header.type =DMUB_CMD__VBIOS ;
@@ -126,7 +125,7 @@ static bool query_dp_alt_from_dmub(struct link_encoder *enc, cmd->query_dp_alt.header.payload_bytes =sizeof (cmd->query_dp_alt.data); cmd->query_dp_alt.data.phy_id =phy_id_from_transmitter (enc10->base.transmitter); -if (!dc_dmub_srv_cmd_with_reply_data (dc_dmub_srv, cmd)) +if (!dm_execute_dmub_cmd (enc->ctx, cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY ))return false;return true;
@@ -425,7 +424,6 @@ static bool link_dpia_control(struct dc_context *dc_ctx, struct dmub_cmd_dig_dpia_control_data *dpia_control) {union dmub_rb_cmd cmd; -struct dc_dmub_srv *dmub = dc_ctx->dmub_srv;memset (&cmd,0 ,sizeof (cmd));
@@ -438,9 +436,7 @@ static bool link_dpia_control(struct dc_context *dc_ctx, cmd.dig1_dpia_control.dpia_control = *dpia_control; -dc_dmub_srv_cmd_queue (dmub, &cmd); -dc_dmub_srv_cmd_execute (dmub); -dc_dmub_srv_wait_idle (dmub); +dm_execute_dmub_cmd (dc_ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT );return true; }
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c +3 -7
@@ -297,7 +297,7 @@ void dcn31_init_hw(struct dc *dc)#endif // Get DMCUB capabilities -dc_dmub_srv_query_caps_cmd (dc->ctx->dmub_srv->dmub); +dc_dmub_srv_query_caps_cmd (dc->ctx->dmub_srv); dc->caps.dmub_caps.psr = dc->ctx->dmub_srv->dmub->feature_caps.psr; }
@@ -442,9 +442,7 @@ void dcn31_z10_save_init(struct dc *dc) cmd.dcn_restore.header.type =DMUB_CMD__IDLE_OPT ; cmd.dcn_restore.header.sub_type =DMUB_CMD__IDLE_OPT_DCN_SAVE_INIT ; -dc_dmub_srv_cmd_queue (dc->ctx->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->ctx->dmub_srv); -dc_dmub_srv_wait_idle (dc->ctx->dmub_srv); +dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); }void dcn31_z10_restore (const struct dc *dc)
@@ -462,9 +460,7 @@ void dcn31_z10_restore(const struct dc *dc) cmd.dcn_restore.header.type =DMUB_CMD__IDLE_OPT ; cmd.dcn_restore.header.sub_type =DMUB_CMD__IDLE_OPT_DCN_RESTORE ; -dc_dmub_srv_cmd_queue (dc->ctx->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->ctx->dmub_srv); -dc_dmub_srv_wait_idle (dc->ctx->dmub_srv); +dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); }void dcn31_hubp_pg_control (struct dce_hwseq *hws,unsigned int hubp_inst,bool power_on)
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c +2 -2
@@ -52,7 +52,7 @@ static bool dcn31_query_backlight_info(struct panel_cntl *panel_cntl, union dmub cmd->panel_cntl.header.payload_bytes =sizeof (cmd->panel_cntl.data); cmd->panel_cntl.data.inst = dcn31_panel_cntl->base.inst; -return dc_dmub_srv_cmd_with_reply_data (dc_dmub_srv, cmd); +return dm_execute_dmub_cmd (dc_dmub_srv->ctx, cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY ); }static uint32_t dcn31_get_16_bit_backlight_from_pwm (struct panel_cntl *panel_cntl)
@@ -85,7 +85,7 @@ static uint32_t dcn31_panel_cntl_hw_init(struct panel_cntl *panel_cntl) panel_cntl->stored_backlight_registers.LVTMA_PWRSEQ_REF_DIV_BL_PWM_REF_DIV; cmd.panel_cntl.data.bl_pwm_ref_div2 = panel_cntl->stored_backlight_registers.PANEL_PWRSEQ_REF_DIV2; -if (!dc_dmub_srv_cmd_with_reply_data (dc_dmub_srv, &cmd)) +if (!dm_execute_dmub_cmd (dc_dmub_srv->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY ))return 0 ; panel_cntl->stored_backlight_registers.BL_PWM_CNTL = cmd.panel_cntl.data.bl_pwm_cntl;
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_hwseq.c +1 -3
@@ -417,9 +417,7 @@ void dcn314_hubp_pg_control(struct dce_hwseq *hws, unsigned int hubp_inst, bool cmd.domain_control.data.inst = hubp_inst; cmd.domain_control.data.power_gate = !power_on; -dc_dmub_srv_cmd_queue (ctx->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (ctx->dmub_srv); -dc_dmub_srv_wait_idle (ctx->dmub_srv); +dm_execute_dmub_cmd (ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT );PERF_TRACE (); }
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +4 -8
@@ -274,8 +274,7 @@ bool dcn32_apply_idle_power_optimizations(struct dc *dc, bool enable) cmd.cab.header.sub_type =DMUB_CMD__CAB_NO_DCN_REQ ; cmd.cab.header.payload_bytes =sizeof (cmd.cab) -sizeof (cmd.cab.header); -dc_dmub_srv_cmd_queue (dc->ctx->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->ctx->dmub_srv); +dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_NO_WAIT );return true; }
@@ -309,8 +308,7 @@ bool dcn32_apply_idle_power_optimizations(struct dc *dc, bool enable) cmd.cab.header.payload_bytes =sizeof (cmd.cab) -sizeof (cmd.cab.header); cmd.cab.cab_alloc_ways = ways; -dc_dmub_srv_cmd_queue (dc->ctx->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->ctx->dmub_srv); +dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_NO_WAIT );return true; }
@@ -326,9 +324,7 @@ bool dcn32_apply_idle_power_optimizations(struct dc *dc, bool enable) cmd.cab.header.payload_bytes =sizeof (cmd.cab) -sizeof (cmd.cab.header); -dc_dmub_srv_cmd_queue (dc->ctx->dmub_srv, &cmd); -dc_dmub_srv_cmd_execute (dc->ctx->dmub_srv); -dc_dmub_srv_wait_idle (dc->ctx->dmub_srv); +dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT );return true; }
@@ -946,7 +942,7 @@ void dcn32_init_hw(struct dc *dc)// Get DMCUB capabilities if (dc->ctx->dmub_srv) { -dc_dmub_srv_query_caps_cmd (dc->ctx->dmub_srv->dmub); +dc_dmub_srv_query_caps_cmd (dc->ctx->dmub_srv); dc->caps.dmub_caps.psr = dc->ctx->dmub_srv->dmub->feature_caps.psr; dc->caps.dmub_caps.mclk_sw = dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch; }
drivers/gpu/drm/amd/display/dc/dm_services.h +7 -0
@@ -40,6 +40,7 @@struct dmub_srv ;struct dc_dmub_srv ; +union dmub_rb_cmd ; irq_handler_idx dm_register_interrupt( struct dc_context *ctx,
@@ -273,6 +274,12 @@ void dm_perf_trace_timestamp(const char *func_name, unsigned int line, struct dc#define PERF_TRACE () dm_perf_trace_timestamp(__func__, __LINE__, CTX)#define PERF_TRACE_CTX (__CTX) dm_perf_trace_timestamp(__func__, __LINE__, __CTX) +/* +* DMUB Interfaces +*/ +bool dm_execute_dmub_cmd (const struct dc_context *ctx,union dmub_rb_cmd *cmd,enum dm_dmub_wait_type wait_type); +bool dm_execute_dmub_cmd_list (const struct dc_context *ctx,unsigned int count,union dmub_rb_cmd *cmd,enum dm_dmub_wait_type wait_type); +/* * Debug and verification hooks */
drivers/gpu/drm/amd/display/dc/dm_services_types.h +6 -0
@@ -269,4 +269,10 @@ struct dtn_min_clk_info { uint32_t min_memory_clock_khz; }; +enum dm_dmub_wait_type { +DM_DMUB_WAIT_TYPE_NO_WAIT , +DM_DMUB_WAIT_TYPE_WAIT , +DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY , +}; +#endif
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c +1 -1
@@ -1393,7 +1393,7 @@ static bool get_usbc_cable_id(struct dc_link *link, union dp_cable_id *cable_id) cmd.cable_id.header.payload_bytes =sizeof (cmd.cable_id.data); cmd.cable_id.data.input.phy_inst =resource_transmitter_to_phy_idx ( link->dc, link->link_enc->transmitter); -if (dc_dmub_srv_cmd_with_reply_data (link->ctx->dmub_srv, &cmd) && +if (dm_execute_dmub_cmd (link->dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY ) && cmd.cable_id.header.ret_status ==1 ) { cable_id->raw = cmd.cable_id.data.output_raw;DC_LOG_DC ("usbc_cable_id = %d.\n" , cable_id->raw);
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia.c +1 -1
@@ -90,7 +90,7 @@ bool dpia_query_hpd_status(struct dc_link *link) cmd.query_hpd.data.ch_type =AUX_CHANNEL_DPIA ;/* Return HPD status reported by DMUB if query successfully executed. */ -if (dc_dmub_srv_cmd_with_reply_data (dmub_srv, &cmd) && cmd.query_hpd.data.status ==AUX_RET_SUCCESS ) +if (dm_execute_dmub_cmd (dmub_srv->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY ) && cmd.query_hpd.data.status ==AUX_RET_SUCCESS ) is_hpd_high = cmd.query_hpd.data.result; DC_LOG_DEBUG("%s: link(%d) dpia(%d) cmd_status(%d) result(%d)\n",
Signature · 1 line
2.34.1
PATCH 22/66 drm/amd/display: drain dmub inbox if queue is full
In reply to Qingqing ZhuoFrom: Josip Pavic <[email protected]>
[Why & How]
If dmub command queuing fails due to the inbox being full, flush the inbox and resubmit the comamnd. This was previously the default behavior but was lost in a refactor.
--- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +9 -0
@@ -139,6 +139,15 @@ bool dc_dmub_srv_cmd_run_list(struct dc_dmub_srv *dc_dmub_srv, unsigned int coun// Queue command status =dmub_srv_cmd_queue (dmub, &cmd_list[i]); +if (status ==DMUB_STATUS_QUEUE_FULL ) { +/* Execute and wait for queue to become empty again. */ +dmub_srv_cmd_execute (dmub); +dmub_srv_wait_for_idle (dmub,100000 ); + +/* Requeue the command. */ + status =dmub_srv_cmd_queue (dmub, &cmd_list[i]); + } +if (status !=DMUB_STATUS_OK ) {DC_ERROR ("Error queueing DMUB command: status=%d\n" , status);dc_dmub_srv_log_diagnostic_data (dc_dmub_srv);
Signature · 1 line
2.34.1
PATCH 23/66 drm/amd/display: fix access hdcp_workqueue assert
In reply to Qingqing ZhuoFrom: Hersen Wu <[email protected]>
[Why] hdcp are enabled for asics from raven. for old asics which hdcp are not enabled, hdcp_workqueue are null. some access to hdcp work queue are not guarded with pointer check.
[How] add hdcp_workqueue pointer check before access workqueue.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++++ .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 16 ++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +6 -0
@@ -8558,6 +8558,9 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)struct amdgpu_crtc *acrtc =to_amdgpu_crtc (dm_new_con_state->base.crtc);struct amdgpu_dm_connector *aconnector =to_amdgpu_dm_connector (connector); +if (!adev->dm.hdcp_workqueue) +continue ; +pr_debug ("[HDCP_DM] -------------- i : %x ----------\n" , i);if (!connector)
@@ -8606,6 +8609,9 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)struct amdgpu_crtc *acrtc =to_amdgpu_crtc (dm_new_con_state->base.crtc);struct amdgpu_dm_connector *aconnector =to_amdgpu_dm_connector (connector); +if (!adev->dm.hdcp_workqueue) +continue ; + new_crtc_state =NULL ; old_crtc_state =NULL ;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +10 -6
@@ -379,13 +379,17 @@ static int dm_dp_mst_get_modes(struct drm_connector *connector)if (aconnector->dc_sink && connector->state) {struct drm_device *dev = connector->dev;struct amdgpu_device *adev =drm_to_adev (dev); -struct hdcp_workqueue *hdcp_work = adev->dm.hdcp_workqueue; -struct hdcp_workqueue *hdcp_w = &hdcp_work[aconnector->dc_link->link_index]; - connector->state->hdcp_content_type = - hdcp_w->hdcp_content_type[connector->index]; - connector->state->content_protection = - hdcp_w->content_protection[connector->index]; +if (adev->dm.hdcp_workqueue) { +struct hdcp_workqueue *hdcp_work = adev->dm.hdcp_workqueue; +struct hdcp_workqueue *hdcp_w = + &hdcp_work[aconnector->dc_link->link_index]; + + connector->state->hdcp_content_type = + hdcp_w->hdcp_content_type[connector->index]; + connector->state->content_protection = + hdcp_w->content_protection[connector->index]; + } }if (aconnector->dc_sink) {
Signature · 1 line
2.34.1
PATCH 24/66 drm/amd/display: Add FAMS validation before trying to use it
In reply to Qingqing ZhuoFrom: Rodrigo Siqueira <[email protected]>
To ensure that FAMS can be used, DC must check if there is VRR support.
This commit adds the required configuration to ensure FAMS can be executed in the target system.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 6 ++++++ drivers/gpu/drm/amd/display/dc/dc_stream.h | 1 + drivers/gpu/drm/amd/display/dc/dcn30/dcn30_optc.c | 7 ++++++- drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +6 -0
@@ -2604,6 +2604,12 @@ static enum surface_update_type check_update_surfaces_for_stream(if (stream_update->mst_bw_update) su_flags->bits.mst_bw =1 ; + +if (stream_update->stream && stream_update->stream->freesync_on_desktop && + (stream_update->vrr_infopacket || stream_update->allow_freesync || + stream_update->vrr_active_variable)) + su_flags->bits.fams_changed =1 ; +if (stream_update->crtc_timing_adjust &&dc_extended_blank_supported (dc)) su_flags->bits.crtc_timing_adjust =1 ;
drivers/gpu/drm/amd/display/dc/dc_stream.h +1 -0
@@ -131,6 +131,7 @@ union stream_update_flags { uint32_t dsc_changed : 1; uint32_t mst_bw : 1; uint32_t crtc_timing_adjust : 1; + uint32_t fams_changed : 1; } bits;uint32_t raw;
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_optc.c +6 -1
@@ -301,7 +301,12 @@ static void optc3_wait_drr_doublebuffer_pending_clear(struct timing_generator *ovoid optc3_set_vtotal_min_max (struct timing_generator *optc,int vtotal_min,int vtotal_max) { -optc1_set_vtotal_min_max (optc, vtotal_min, vtotal_max); +struct dc *dc = optc->ctx->dc; + +if (dc->caps.dmub_caps.mclk_sw && !dc->debug.disable_fams) +dc_dmub_srv_drr_update_cmd (dc, optc->inst, vtotal_min, vtotal_max); +else +optc1_set_vtotal_min_max (optc, vtotal_min, vtotal_max); }void optc3_tg_init (struct timing_generator *optc)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +1 -1
@@ -360,7 +360,7 @@ union dmub_fw_boot_status { uint32_t optimized_init_done : 1; /**< 1 if optimized init done */ uint32_t restore_required : 1; /**< 1 if driver should call restore */ uint32_t defer_load : 1; /**< 1 if VBIOS data is deferred programmed */ - uint32_t reserved : 1; + uint32_t fams_enabled : 1; /**< 1 if VBIOS data is deferred programmed */ uint32_t detection_required: 1; /**< if detection need to be triggered by driver */ uint32_t hw_power_init_done: 1; /**< 1 if hw power init is completed */ } bits;/**< status bits */
Signature · 1 line
2.34.1
PATCH 25/66 drm/amd/display: Adding support for VESA SCR
In reply to Qingqing ZhuoFrom: Iswara Nagulendran <[email protected]>
[HOW&WHY]
Write DPCD 721 bit 7 to high, and
the appropriate luminance level
to DPCD 734-736 if bit 4 from DPCD register 734 is high, indicating that the panel luminance control is enabled from the panel side.
--- drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 7 +++++ .../dc/link/protocols/link_dp_capability.c | 9 +++++- .../link/protocols/link_edp_panel_control.c | 29 ++++++++++++++++--- include/drm/display/drm_dp.h | 3 ++ 4 files changed, 43 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_dp_types.h +7 -0
@@ -566,6 +566,12 @@ struct dpcd_amd_device_id {uint8_t dal_version_byte2; }; +struct target_luminance_value { +uint8_t byte0; +uint8_t byte1; +uint8_t byte2; +}; + struct dpcd_source_backlight_set { struct { uint8_t byte0;
@@ -1225,6 +1231,7 @@ struct dpcd_caps {union dp_main_line_channel_coding_cap channel_coding_cap;union dp_sink_video_fallback_formats fallback_formats;union dp_fec_capability1 fec_cap1; +bool panel_luminance_control;union dp_cable_id cable_id;uint8_t edp_rev;union edp_alpm_caps alpm_caps;
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c +8 -1
@@ -1449,7 +1449,8 @@ bool read_is_mst_supported(struct dc_link *link)*/ static bool dpcd_read_sink_ext_caps (struct dc_link *link) { -uint8_t dpcd_data; +uint8_t dpcd_data =0 ; +uint8_t edp_general_cap2 =0 ;if (!link)return false;
@@ -1458,6 +1459,12 @@ static bool dpcd_read_sink_ext_caps(struct dc_link *link)return false; link->dpcd_sink_ext_caps.raw = dpcd_data; + +if (core_link_read_dpcd (link,DP_EDP_GENERAL_CAP_2 , &edp_general_cap2,1 ) !=DC_OK ) +return false; + + link->dpcd_caps.panel_luminance_control = (edp_general_cap2 &DP_EDP_PANEL_LUMINANCE_CONTROL_CAPABLE ) !=0 ; +return true; }
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c +25 -4
@@ -164,14 +164,35 @@ bool edp_set_backlight_level_nits(struct dc_link *link, *(uint16_t *)&dpcd_backlight_set.backlight_transition_time_ms = (uint16_t )transition_time_in_ms; -if (core_link_write_dpcd (link,DP_SOURCE_BACKLIGHT_LEVEL , +if (!link->dpcd_caps.panel_luminance_control) { +if (core_link_write_dpcd (link,DP_SOURCE_BACKLIGHT_LEVEL , (uint8_t *)(&dpcd_backlight_set),sizeof (dpcd_backlight_set)) !=DC_OK ) -return false; +return false; -if (core_link_write_dpcd (link,DP_SOURCE_BACKLIGHT_CONTROL , +if (core_link_write_dpcd (link,DP_SOURCE_BACKLIGHT_CONTROL , &backlight_control,1 ) !=DC_OK ) -return false; +return false; + }else { +const uint8_t backlight_enable =DP_EDP_PANEL_LUMINANCE_CONTROL_ENABLE ; +struct target_luminance_value *target_luminance =NULL ; + +//if target luminance value is greater than 24 bits, clip the value to 24 bits +if (backlight_millinits >0xFFFFFF ) + backlight_millinits =0xFFFFFF ; + + target_luminance = (struct target_luminance_value *)&backlight_millinits; + +if (core_link_write_dpcd (link,DP_EDP_BACKLIGHT_MODE_SET_REGISTER , + &backlight_enable, +sizeof (backlight_enable)) !=DC_OK ) +return false; + +if (core_link_write_dpcd (link,DP_EDP_PANEL_TARGET_LUMINANCE_VALUE , + (uint8_t *)(target_luminance), +sizeof (struct target_luminance_value )) !=DC_OK ) +return false; + }return true; }
include/drm/display/drm_dp.h +3 -0
@@ -973,6 +973,7 @@#define DP_EDP_GENERAL_CAP_2 0x703# define DP_EDP_OVERDRIVE_ENGINE_ENABLED (1 << 0) +# define DP_EDP_PANEL_LUMINANCE_CONTROL_CAPABLE (1 << 4)#define DP_EDP_GENERAL_CAP_3 0x704/* eDP 1.4 */ # define DP_EDP_X_REGION_CAP_MASK (0xf << 0)
@@ -998,6 +999,7 @@# define DP_EDP_DYNAMIC_BACKLIGHT_ENABLE (1 << 4)# define DP_EDP_REGIONAL_BACKLIGHT_ENABLE (1 << 5)# define DP_EDP_UPDATE_REGION_BRIGHTNESS (1 << 6)/* eDP 1.4 */ +# define DP_EDP_PANEL_LUMINANCE_CONTROL_ENABLE (1 << 7)#define DP_EDP_BACKLIGHT_BRIGHTNESS_MSB 0x722#define DP_EDP_BACKLIGHT_BRIGHTNESS_LSB 0x723
@@ -1022,6 +1024,7 @@#define DP_EDP_DBC_MINIMUM_BRIGHTNESS_SET 0x732#define DP_EDP_DBC_MAXIMUM_BRIGHTNESS_SET 0x733 +#define DP_EDP_PANEL_TARGET_LUMINANCE_VALUE 0x734#define DP_EDP_REGIONAL_BACKLIGHT_BASE 0x740/* eDP 1.4 */ #define DP_EDP_REGIONAL_BACKLIGHT_0 0x741/* eDP 1.4 */
Signature · 1 line
2.34.1
PATCH 26/66 drm/amd/display: DSC policy override when ODM combine is forced
In reply to Qingqing ZhuoFrom: Nasir Osman <[email protected]>
[why]
When we force ODM combine with DSC, we lose several 8 bit and 10 bit modes in validation and thus not able to use HDR. This is due to the number of horizontal slices used in DSC not properly being accounted for currently when 2:1 ODM Combine is forced.
[how]
Enforce at least two horizontal slices are used for DSC when ODM combine is forced.
--- drivers/gpu/drm/amd/display/dc/dc_dsc.h | 1 + drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc_dsc.h +1 -0
@@ -58,6 +58,7 @@ struct dc_dsc_config_options {uint32_t dsc_min_slice_height_override;uint32_t max_target_bpp_limit_override_x16;uint32_t slice_height_granularity; +uint32_t dsc_force_odm_hslice_override; }; bool dc_dsc_parse_dsc_dpcd(const struct dc *dc,
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c +9 -1
@@ -700,7 +700,7 @@ static int inc_num_slices(union dsc_enc_slice_caps slice_caps, int num_slices) } } -if (new_num_slices == num_slices)// No biger number of slices found +if (new_num_slices == num_slices)// No bigger number of slices found new_num_slices++;return new_num_slices;
@@ -952,6 +952,13 @@ static bool setup_dsc_config(else is_dsc_possible = false; } +// When we force 2:1 ODM, we can't have 1 slice to divide amongst 2 separate DSC instances +// need to enforce at minimum 2 horizontal slices +if (options->dsc_force_odm_hslice_override) { + num_slices_h =fit_num_slices_up (dsc_common_caps.slice_caps,2 ); +if (num_slices_h ==0 ) + is_dsc_possible = false; + }if (!is_dsc_possible) goto done;
@@ -1163,6 +1170,7 @@ void dc_dsc_policy_set_disable_dsc_stream_overhead(bool disable)void dc_dsc_get_default_config_option (const struct dc *dc,struct dc_dsc_config_options *options) { options->dsc_min_slice_height_override = dc->debug.dsc_min_slice_height_override; + options->dsc_force_odm_hslice_override = dc->debug.force_odm_combine; options->max_target_bpp_limit_override_x16 =0 ; options->slice_height_granularity =1 ; }
Signature · 1 line
2.34.1
PATCH 27/66 drm/amd/display: Correct output color space during HW reinitialize
In reply to Qingqing ZhuoFrom: Michael Mityushkin <[email protected]>
[Why]
Doing core_link_disable_stream or set_dpms_off when reinitializing hardware causes issue to repro with external display connected. This is unnecessary, blanking pixel data should be sufficient.
[How]
Call disable_pixel_data while reinitializing hardware instead of core_link_disable_stream or set_dpms_off.
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 4 ++++ drivers/gpu/drm/amd/display/dc/dcn31/dcn31_init.c | 1 + drivers/gpu/drm/amd/display/dc/dcn314/dcn314_init.c | 1 + 3 files changed, 6 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +4 -0
@@ -313,6 +313,10 @@ void dcn20_init_blank( } opp = dc->res_pool->opps[opp_id_src0]; +/* don't override the blank pattern if already enabled with the correct one. */ +if (opp->funcs->dpg_is_blanked && opp->funcs->dpg_is_blanked (opp)) +return ; +if (num_opps ==2 ) { otg_active_width = otg_active_width /2 ;
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_init.c +1 -0
@@ -58,6 +58,7 @@ static const struct hw_sequencer_funcs dcn31_funcs = { .enable_audio_stream = dce110_enable_audio_stream, .disable_audio_stream = dce110_disable_audio_stream, .disable_plane = dcn20_disable_plane, + .disable_pixel_data = dcn20_disable_pixel_data, .pipe_control_lock = dcn20_pipe_control_lock, .interdependent_update_lock = dcn10_lock_all_pipes, .cursor_lock = dcn10_cursor_lock,
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_init.c +1 -0
@@ -60,6 +60,7 @@ static const struct hw_sequencer_funcs dcn314_funcs = { .enable_audio_stream = dce110_enable_audio_stream, .disable_audio_stream = dce110_disable_audio_stream, .disable_plane = dcn20_disable_plane, + .disable_pixel_data = dcn20_disable_pixel_data, .pipe_control_lock = dcn20_pipe_control_lock, .interdependent_update_lock = dcn10_lock_all_pipes, .cursor_lock = dcn10_cursor_lock,
Signature · 1 line
2.34.1
PATCH 28/66 drm/amd/display: Set watermarks set D equal to A
In reply to Qingqing ZhuoFrom: Alvin Lee <[email protected]>
[Description]
- Since we do not use optimized watermark settings for MALL, set D = A
- PMFW uses Set D for d0i3.1, so driver should make D = A for the time being
- If we choose to optimize in the future we can set watermarks D correctly
--- drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +5 -0
@@ -2062,6 +2062,7 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context,* sr_enter_exit/sr_exit should be lower than used for DRAM (TBD after bringup or later, use as decided in Clk Mgr) */ +/* if (dcn3_2_soc.num_states > 2) { vlevel_temp = 0; dcfclk = dc->clk_mgr->bw_params->clk_table.entries[0].dcfclk_mhz;
@@ -2088,6 +2089,7 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context,context->bw_ctx.bw.dcn.watermarks.d.urgent_latency_ns = get_urgent_latency(&context->bw_ctx.dml, pipes, pipe_cnt) * 1000; context->bw_ctx.bw.dcn.watermarks.d.cstate_pstate.fclk_pstate_change_ns = get_fclk_watermark(&context->bw_ctx.dml, pipes, pipe_cnt) * 1000; context->bw_ctx.bw.dcn.watermarks.d.usr_retraining_ns = get_usr_retraining_watermark(&context->bw_ctx.dml, pipes, pipe_cnt) * 1000; +*/ /* Set C, for Dummy P-State: * All clocks min.
@@ -2189,6 +2191,9 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context, context->bw_ctx.bw.dcn.watermarks.a.usr_retraining_ns =get_usr_retraining_watermark (&context->bw_ctx.dml, pipes, pipe_cnt) *1000 ; } +/* Make set D = set A since we do not optimized watermarks for MALL */ + 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)continue ;
Signature · 1 line
2.34.1
PATCH 29/66 drm/amd/display: Enable FPO + Vactive
In reply to Qingqing ZhuoFrom: Alvin Lee <[email protected]>
[Description]
- Enable FPO + Vactive
--- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +1 -1
@@ -726,7 +726,7 @@ static const struct dc_debug_options debug_defaults_drv = { .override_dispclk_programming = true, .disable_fpo_optimizations = false, .fpo_vactive_margin_us = 2000, // 2000us - .disable_fpo_vactive = true, + .disable_fpo_vactive = false, .disable_boot_optimizations = false, };
drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c +1 -1
@@ -725,7 +725,7 @@ static const struct dc_debug_options debug_defaults_drv = { .override_dispclk_programming = true, .disable_fpo_optimizations = false, .fpo_vactive_margin_us = 2000, // 2000us - .disable_fpo_vactive = true, + .disable_fpo_vactive = false, .disable_boot_optimizations = false, };
Signature · 1 line
2.34.1
PATCH 30/66 drm/amd/display: [FW Promotion] Release 0.0.162.0
In reply to Qingqing ZhuoFrom: Anthony Koo <[email protected]>
- Add DMUB_CMD__IDLE_OPT_DCN_NOTIFY_IDLE command
- Remove d3 entry event and instead check for stream mask
- dmu: Enable timeout recovery and detection for p-state
--- drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +6 -3
@@ -419,7 +419,8 @@ union dmub_fw_boot_options { uint32_t dpia_hpd_int_enable_supported: 1; /* 1 if dpia hpd int enable supported */ uint32_t usb4_dpia_bw_alloc_supported: 1; /* 1 if USB4 dpia BW allocation supported */ uint32_t disable_clk_ds: 1; /* 1 if disallow dispclk_ds and dppclk_ds*/ - uint32_t reserved : 14; /**< reserved */ + uint32_t disable_timeout_recovery : 1; /* 1 if timeout recovery should be disabled */ + uint32_t reserved : 13; /**< reserved */ } bits;/**< boot bits */ uint32_t all;/**< 32-bit access to bits */ };
@@ -1125,8 +1126,6 @@ struct dmub_rb_cmd_idle_opt_dcn_restore {*/ struct dmub_dcn_notify_idle_cntl_data {uint8_t driver_idle; -uint8_t d3_entry; -uint8_t trigger;uint8_t pad[1 ]; };
@@ -3550,6 +3549,10 @@ union dmub_rb_cmd {* Definition of a DMUB_CMD__DPIA_HPD_INT_ENABLE command. */ struct dmub_rb_cmd_dpia_hpd_int_enable dpia_hpd_int_enable; +/** +* Definition of a DMUB_CMD__IDLE_OPT_DCN_NOTIFY_IDLE command. +*/ +struct dmub_rb_cmd_idle_opt_dcn_notify_idle idle_opt_notify_idle; };/**
Signature · 1 line
2.34.1
PATCH 31/66 drm/amd/display: fix a divided-by-zero error
In reply to Qingqing ZhuoFrom: Alex Hung <[email protected]>
[Why & How]
timing.dsc_cfg.num_slices_v can be zero and it is necessary to check before using it.
This fixes the error "divide error: 0000 [#1] PREEMPT SMP NOPTI".
--- drivers/gpu/drm/amd/display/modules/power/power_helpers.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/display/modules/power/power_helpers.c +4 -0
@@ -927,6 +927,10 @@ bool psr_su_set_dsc_slice_height(struct dc *dc, struct dc_link *link, pic_height = stream->timing.v_addressable + stream->timing.v_border_top + stream->timing.v_border_bottom; + +if (stream->timing.dsc_cfg.num_slices_v ==0 ) +return false; + slice_height = pic_height / stream->timing.dsc_cfg.num_slices_v; config->dsc_slice_height = slice_height;
Signature · 1 line
2.34.1
PATCH 32/66 drm/amd/display: add extra dc odm debug options
In reply to Qingqing ZhuoFrom: Dmytro Laktyushkin <[email protected]>
[Why & How]
Add options for dc odm debug.
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 ++ drivers/gpu/drm/amd/display/dc/dc_stream.h | 5 +++++ 2 files changed, 7 insertions(+)
drivers/gpu/drm/amd/display/dc/dc.h +2 -0
@@ -879,6 +879,8 @@ struct dc_debug_options {uint32_t fpo_vactive_margin_us;bool disable_fpo_vactive;bool disable_boot_optimizations; +bool override_odm_optimization; +bool minimize_dispclk_using_odm; };struct gpu_info_soc_bounding_box_v1_0 ;
drivers/gpu/drm/amd/display/dc/dc_stream.h +5 -0
@@ -172,6 +172,10 @@ struct mall_temp_config {bool is_phantom_plane[MAX_PIPES ]; }; +struct dc_stream_debug_options { +char force_odm_combine_segments; +}; +struct dc_stream_state {// sink is deprecated, new code should not reference // this pointer
@@ -182,6 +186,7 @@ struct dc_stream_state {* a stream via the volatile dc_state rather than the static dc_link. */ struct link_encoder *link_enc; +struct dc_stream_debug_options debug;struct dc_panel_patch sink_patches;union display_content_support content_support;struct dc_crtc_timing timing;
Signature · 1 line
2.34.1
PATCH 33/66 drm/amd/display: Apply correct panel mode when reinitializing hardware
In reply to Qingqing ZhuoFrom: Michael Mityushkin <[email protected]>
[Why]
When link training during engine recovery, ASSR might fail causing panel mode to be reset to default. This should not happen for eDP as it will prevent the panel from turning back on.
[How]
Added dp_panel_mode to struct dc_link to remember previously applied panel mode. Do not reset panel mode to default while performing link training if previously used panel mode = eDP.
--- drivers/gpu/drm/amd/display/dc/dc.h | 1 + .../gpu/drm/amd/display/dc/link/protocols/link_dp_training.c | 5 ++++- .../amd/display/dc/link/protocols/link_edp_panel_control.c | 1 + 3 files changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -1456,6 +1456,7 @@ struct dc_link {struct ddc_service *ddc; +enum dp_panel_mode panel_mode;bool aux_mode;/* Private to DC core */
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c +4 -1
@@ -1586,7 +1586,10 @@ bool perform_link_training_with_retries(* Report and continue with eDP panel mode to * perform eDP link training with right settings */ - cp_psp->funcs.enable_assr (cp_psp->handle, link); +bool result; + result = cp_psp->funcs.enable_assr (cp_psp->handle, link); +if (!result && link->panel_mode !=DP_PANEL_MODE_EDP ) + panel_mode =DP_PANEL_MODE_DEFAULT ; } }
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c +1 -0
@@ -83,6 +83,7 @@ void dp_set_panel_mode(struct dc_link *link, enum dp_panel_mode panel_mode)ASSERT (result ==DC_OK ); } } + link->panel_mode = panel_mode; DC_LOG_DETECTION_DP_CAPS("Link: %d eDP panel mode supported: %d " "eDP panel mode enabled: %d \n", link->link_index,
Signature · 1 line
2.34.1
PATCH 34/66 drm/amd/display: Improvement for handling edp link training fails
In reply to Qingqing ZhuoFrom: Jingwen Zhu <[email protected]>
[Why]
The eDP retrain will cause the DPCD 300 to be reset to default. And cause the brightness can't be set correctly.
[How]
delete the call to edp panel power control in both enable_link_output/disable_link_output entirely and only call edp panel control in enable_link_dp and disable_link_dp once.
--- .../display/dc/dce110/dce110_hw_sequencer.c | 19 +++++++++++-------- .../gpu/drm/amd/display/dc/link/link_dpms.c | 5 +++++ 2 files changed, 16 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +11 -8
@@ -3031,10 +3031,12 @@ void dce110_enable_dp_link_output(const struct link_hwss *link_hwss =get_link_hwss (link, link_res);unsigned int i; - +/* +* Add the logic to extract BOTH power up and power down sequences +* from enable/disable link output and only call edp panel control +* in enable_link_dp and disable_link_dp once. +*/ if (link->connector_signal ==SIGNAL_TYPE_EDP ) { -if (!link->dc->config.edp_no_power_sequencing) - link->dc->hwss.edp_power_control (link, true); link->dc->hwss.edp_wait_for_hpd_ready (link, true); }
@@ -3096,11 +3098,12 @@ void dce110_disable_link_output(struct dc_link *link, link_hwss->disable_link_output (link, link_res, signal); link->phy_state.symclk_state =SYMCLK_OFF_TX_OFF ; - -if (signal ==SIGNAL_TYPE_EDP && - link->dc->hwss.edp_backlight_control) - link->dc->hwss.edp_power_control (link, false); -else if (dmcu !=NULL && dmcu->funcs->lock_phy) +/* +* Add the logic to extract BOTH power up and power down sequences +* from enable/disable link output and only call edp panel control +* in enable_link_dp and disable_link_dp once. +*/ +if (dmcu !=NULL && dmcu->funcs->lock_phy) dmcu->funcs->unlock_phy (dmcu); dc->link_srv->dp_trace_source_sequence (link,DPCD_SOURCE_SEQ_AFTER_DISABLE_LINK_PHY ); }
drivers/gpu/drm/amd/display/dc/link/link_dpms.c +5 -0
@@ -1927,6 +1927,11 @@ 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->dc->hwss.edp_power_control (link, false); + } +if (signal ==SIGNAL_TYPE_DISPLAY_PORT_MST )/* set the sink to SST mode after disabling the link */ enable_mst_on_sink (link, false);
Signature · 1 line
2.34.1
PATCH 35/66 drm/amd/display: limit timing for single dimm memory
In reply to Qingqing ZhuoFrom: Daniel Miess <[email protected]>
[Why]
1. It could hit bandwidth limitdation under single dimm memory when connecting 8K external monitor.
2. IsSupportedVidPn got validation failed with 2K240Hz eDP + 8K24Hz external monitor.
3. It's better to filter out such combination in EnumVidPnCofuncModality
4. For short term, filter out in dc bandwidth validation.
[How]
Force 2K@240Hz+8K@24Hz timing validation false in dc.
--- .../amd/display/dc/dcn314/dcn314_resource.c | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +20 -0
@@ -1696,6 +1696,23 @@ static void dcn314_get_panel_config_defaults(struct dc_panel_config *panel_confi *panel_config = panel_config_defaults; } +static bool filter_modes_for_single_channel_workaround (struct dc *dc, +struct dc_state *context) +{ +// Filter 2K@240Hz+8K@24fps above combination timing if memory only has single dimm LPDDR +if (dc->clk_mgr->bw_params->vram_type ==34 && dc->clk_mgr->bw_params->num_channels <2 ) { +int total_phy_pix_clk =0 ; + +for (int i =0 ; i < context->stream_count; i++) +if (context->res_ctx.pipe_ctx[i].stream) + total_phy_pix_clk += context->res_ctx.pipe_ctx[i].stream->phy_pix_clk; + +if (total_phy_pix_clk >= (1148928 +826260 ))//2K@240Hz+8K@24fps +return true; + } +return false; +} +bool dcn314_validate_bandwidth (struct dc *dc,struct dc_state *context,bool fast_validate)
@@ -1711,6 +1728,9 @@ bool dcn314_validate_bandwidth(struct dc *dc,BW_VAL_TRACE_COUNT (); +if (filter_modes_for_single_channel_workaround (dc, context)) + goto validate_fail; +DC_FP_START ();// do not support self refresh only out =dcn30_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, fast_validate, false);
Signature · 1 line
2.34.1
PATCH 36/66 drm/amd/display: set dcn315 lb bpp to 48
In reply to Qingqing ZhuoFrom: Dmytro Laktyushkin <[email protected]>
[Why & How]
Fix a typo for dcn315 line buffer bpp.
--- drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c +1 -1
@@ -222,7 +222,7 @@ struct _vcs_dpi_ip_params_st dcn3_15_ip = { .maximum_dsc_bits_per_component = 10, .dsc422_native_support = false, .is_line_buffer_bpp_fixed = true, - .line_buffer_fixed_bpp = 49, + .line_buffer_fixed_bpp = 48, .line_buffer_size_bits = 789504, .max_line_buffer_lines = 12, .writeback_interface_buffer_size_kbytes = 90,
Signature · 1 line
2.34.1
PATCH 37/66 drm/amd/display: add mechanism to skip DCN init
In reply to Qingqing ZhuoFrom: Eric Yang <[email protected]>
[Why]
If optimized init is done in FW. DCN init can be skipped in driver. This need to be communicated between driver and fw and maintain backwards compatibility.
[How]
Use DMUB scratch 0 bit 2 to indicate optimized init done in fw and use DMUB scatch 4 bit 0 to indicate drive supports the optimized flow so FW will perform it.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 -- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 28 +++++-------------- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 2 +- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 4 ++- drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 1 - .../gpu/drm/amd/display/dmub/src/dmub_dcn21.c | 6 ---- .../gpu/drm/amd/display/dmub/src/dmub_dcn21.h | 4 --- .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 25 +---------------- 8 files changed, 12 insertions(+), 61 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -3
@@ -4288,9 +4288,6 @@ void dc_set_power_state(dc_z10_restore (dc); -if (dc->ctx->dmub_srv) -dc_dmub_srv_wait_phy_init (dc->ctx->dmub_srv); - dc->hwss.init_hw (dc); if (dc->hwss.init_sys_ctx != NULL &&
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +7 -21
@@ -179,31 +179,17 @@ bool dc_dmub_srv_cmd_run_list(struct dc_dmub_srv *dc_dmub_srv, unsigned int counreturn true; } -void dc_dmub_srv_wait_phy_init (struct dc_dmub_srv *dc_dmub_srv) +bool dc_dmub_srv_optimized_init_done (struct dc_dmub_srv *dc_dmub_srv) { -struct dmub_srv *dmub = dc_dmub_srv->dmub; -struct dc_context *dc_ctx = dc_dmub_srv->ctx; -enum dmub_status status; - -for (;;) { -/* Wait up to a second for PHY init. */ - status =dmub_srv_wait_for_phy_init (dmub,1000000 ); -if (status ==DMUB_STATUS_OK ) -/* Initialization OK */ -break ; +struct dmub_srv *dmub; +union dmub_fw_boot_status status; -DC_ERROR ("DMCUB PHY init failed: status=%d\n" , status); -ASSERT (0 ); +if (!dc_dmub_srv || !dc_dmub_srv->dmub) +return false; -if (status !=DMUB_STATUS_TIMEOUT ) -/* -* Server likely initialized or we don't have -* DMCUB HW support - this won't end. -*/ -break ; + dmub = dc_dmub_srv->dmub; -/* Continue spinning so we don't hang the ASIC. */ - } +return status.bits.optimized_init_done; } bool dc_dmub_srv_notify_stream_mask(struct dc_dmub_srv *dc_dmub_srv,
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h +1 -1
@@ -54,7 +54,7 @@ struct dc_dmub_srv {void dc_dmub_srv_wait_idle (struct dc_dmub_srv *dc_dmub_srv); -void dc_dmub_srv_wait_phy_init (struct dc_dmub_srv *dc_dmub_srv); +bool dc_dmub_srv_optimized_init_done (struct dc_dmub_srv *dc_dmub_srv);bool dc_dmub_srv_cmd_run (struct dc_dmub_srv *dc_dmub_srv,union dmub_rb_cmd *cmd,enum dm_dmub_wait_type wait_type);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +3 -1
@@ -1524,7 +1524,9 @@ void dcn10_init_hw(struct dc *dc)if (!dcb->funcs->is_accelerated_mode (dcb)) hws->funcs.disable_vga (dc->hwseq); - hws->funcs.bios_golden_init (dc); +if (!dc_dmub_srv_optimized_init_done (dc->ctx->dmub_srv)) + hws->funcs.bios_golden_init (dc); +if (dc->ctx->dc_bios->fw_info_valid) { res_pool->ref_clocks.xtalin_clock_inKhz =
drivers/gpu/drm/amd/display/dmub/dmub_srv.h +0 -1
@@ -366,7 +366,6 @@ struct dmub_srv_hw_funcs {bool (*is_hw_init)(struct dmub_srv *dmub); -bool (*is_phy_init)(struct dmub_srv *dmub);void (*enable_dmub_boot_options)(struct dmub_srv *dmub,const struct dmub_srv_hw_params *params);
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn21.c +0 -6
@@ -54,9 +54,3 @@ const struct dmub_srv_common_regs dmub_srv_dcn21_regs = {#undef DMUB_SF }; -/* Shared functions. */ - -bool dmub_dcn21_is_phy_init (struct dmub_srv *dmub) -{ -return REG_READ (DMCUB_SCRATCH10 ) ==0 ; -}
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn21.h +0 -4
@@ -32,8 +32,4 @@extern const struct dmub_srv_common_regs dmub_srv_dcn21_regs; -/* Hardware functions. */ - -bool dmub_dcn21_is_phy_init (struct dmub_srv *dmub); -#endif /* _DMUB_DCN21_H_ */
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +1 -24
@@ -190,11 +190,9 @@ static bool dmub_srv_hw_setup(struct dmub_srv *dmub, enum dmub_asic asic) funcs->get_diagnostic_data = dmub_dcn20_get_diagnostic_data; -if (asic ==DMUB_ASIC_DCN21 ) { +if (asic ==DMUB_ASIC_DCN21 ) dmub->regs = &dmub_srv_dcn21_regs; - funcs->is_phy_init = dmub_dcn21_is_phy_init; - }if (asic ==DMUB_ASIC_DCN30 ) { dmub->regs = &dmub_srv_dcn30_regs;
@@ -721,27 +719,6 @@ enum dmub_status dmub_srv_wait_for_auto_load(struct dmub_srv *dmub,return DMUB_STATUS_TIMEOUT ; } -enum dmub_status dmub_srv_wait_for_phy_init (struct dmub_srv *dmub, -uint32_t timeout_us) -{ -uint32_t i =0 ; - -if (!dmub->hw_init) -return DMUB_STATUS_INVALID ; - -if (!dmub->hw_funcs.is_phy_init) -return DMUB_STATUS_OK ; - -for (i =0 ; i <= timeout_us; i +=10 ) { -if (dmub->hw_funcs.is_phy_init (dmub)) -return DMUB_STATUS_OK ; - -udelay (10 ); - } - -return DMUB_STATUS_TIMEOUT ; -} -enum dmub_status dmub_srv_wait_for_idle (struct dmub_srv *dmub,uint32_t timeout_us) {
Signature · 1 line
2.34.1
PATCH 38/66 drm/amd/display: Return error code on DSC atomic check failure
In reply to Qingqing ZhuoFrom: hersen wu <[email protected]>
[Why&How]
We were not returning -EINVAL on DSC atomic check fail. Add it.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 + drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 1 + 2 files changed, 2 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
@@ -10169,6 +10169,7 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, ret =compute_mst_dsc_configs_for_state (state, dm_state->context, vars);if (ret) {DRM_DEBUG_DRIVER ("compute_mst_dsc_configs_for_state() failed\n" ); + ret = -EINVAL ; goto fail; }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +1 -0
@@ -1410,6 +1410,7 @@ int pre_validate_dsc(struct drm_atomic_state *state, ret =pre_compute_mst_dsc_configs_for_state (state, local_dc_state, vars);if (ret !=0 ) {DRM_INFO_ONCE ("pre_compute_mst_dsc_configs_for_state() failed\n" ); + ret = -EINVAL ; goto clean_exit; }
Signature · 1 line
2.34.1
PATCH 39/66 drm/amd/display: remove incorrect early return
In reply to Qingqing ZhuoFrom: Aurabindo Pillai <[email protected]>
[Why&How]
Remove incorrect early return in a device specific fifo reset workaround
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +0 -1
@@ -687,7 +687,6 @@ static void apply_synaptics_fifo_reset_wa(struct drm_dp_aux *aux)return ; data[0 ] |= (1 <<1 );// set bit 1 to 1 -return ;if (!execute_synaptics_rc_command (aux, false,0x31 ,4 ,0x221198 , data))return ;
Signature · 1 line
2.34.1
PATCH 40/66 drm/amd/display: Write TEST_EDID_CHECKSUM_WRITE for EDID tests
In reply to Qingqing ZhuoFrom: Mikita Lipski <[email protected]>
Extract edid's checksum and send it back for verification if EDID_TEST is requested.
--- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +27 -3
@@ -885,10 +885,34 @@ enum dc_edid_status dm_helpers_read_local_edid(DRM_ERROR ("EDID err: %d, on connector: %s" , edid_status, aconnector->base.name); +if (link->aux_mode) { +union test_request test_request = {0 }; +union test_response test_response = {0 }; -/* DP Compliance Test 4.2.2.3 */ -if (link->aux_mode) -drm_dp_send_real_edid_checksum (&aconnector->dm_dp_aux.aux, sink->dc_edid.raw_edid[sink->dc_edid.length-1 ]); +dm_helpers_dp_read_dpcd (ctx, + link, +DP_TEST_REQUEST , + &test_request.raw, +sizeof (union test_request )); + +if (!test_request.bits.EDID_READ) +return edid_status; + + test_response.bits.EDID_CHECKSUM_WRITE =1 ; + +dm_helpers_dp_write_dpcd (ctx, + link, +DP_TEST_EDID_CHECKSUM , + &sink->dc_edid.raw_edid[sink->dc_edid.length-1 ], +1 ); + +dm_helpers_dp_write_dpcd (ctx, + link, +DP_TEST_RESPONSE , + &test_response.raw, +sizeof (test_response)); + + }return edid_status; }
Signature · 1 line
2.34.1
PATCH 41/66 drm/amd/display: Disable migration to ensure consistency of per-CPU variable
In reply to Qingqing ZhuoFrom: Tianci Yin <[email protected]>
[why]
Since the variable fpu_recursion_depth is per-CPU type, it has one copy on each CPU, thread migration causes data consistency issue, then the call trace shows up. And preemption disabling can't prevent migration.
[how]
Disable migration to ensure consistency of fpu_recursion_depth.
--- drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c +2 -0
@@ -89,6 +89,7 @@ void dc_fpu_begin(const char *function_name, const int line)if (*pcpu ==1 ) {#if defined(CONFIG_X86 ) +migrate_disable ();kernel_fpu_begin ();#elif defined(CONFIG_PPC64 )if (cpu_has_feature (CPU_FTR_VSX_COMP )) {
@@ -129,6 +130,7 @@ void dc_fpu_end(const char *function_name, const int line)if (*pcpu <=0 ) {#if defined(CONFIG_X86 )kernel_fpu_end (); +migrate_enable ();#elif defined(CONFIG_PPC64 )if (cpu_has_feature (CPU_FTR_VSX_COMP )) {disable_kernel_vsx ();
Signature · 1 line
2.34.1
PATCH 42/66 drm/amd/display: Add logging for display MALL refresh setting
In reply to Qingqing ZhuoFrom: Wesley Chalmers <[email protected]>
[WHY]
Add log entry for when display refresh from MALL
settings are sent to SMU.
--- .../drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.c +3 -0
@@ -312,6 +312,9 @@ void dcn30_smu_set_display_refresh_from_mall(struct clk_mgr_internal *clk_mgr, b/* bits 8:7 for cache timer scale, bits 6:1 for cache timer delay, bit 0 = 1 for enable, = 0 for disable */ uint32_t param = (cache_timer_scale <<7 ) | (cache_timer_delay <<1 ) | (enable ?1 :0 ); +smu_print ("SMU Set display refresh from mall: enable = %d, cache_timer_delay = %d, cache_timer_scale = %d\n" , + enable, cache_timer_delay, cache_timer_scale); +dcn30_smu_send_msg_with_param (clk_mgr, DALSMC_MSG_SetDisplayRefreshFromMall, param,NULL ); }
Signature · 1 line
2.34.1
PATCH 43/66 drm/amd/display: Update DTBCLK for DCN32
In reply to Qingqing ZhuoFrom: Alvin Lee <[email protected]>
[Why&How]
- Implement interface to program DTBCLK DTO’s according to reference DTBCLK returned by PMFW
- This is required because DTO programming requires exact DTBCLK reference freq or it could result in underflow
--- .../display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c +27 -0
@@ -233,6 +233,32 @@ void dcn32_init_clocks(struct clk_mgr *clk_mgr_base)DC_FP_END (); } +static void dcn32_update_clocks_update_dtb_dto (struct clk_mgr_internal *clk_mgr, +struct dc_state *context, +int ref_dtbclk_khz) +{ +struct dccg *dccg = clk_mgr->dccg; +uint32_t tg_mask =0 ; +int i; + +for (i =0 ; i < clk_mgr->base.ctx->dc->res_pool->pipe_count; i++) { +struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i]; +struct dtbclk_dto_params dto_params = {0 }; + +/* use mask to program DTO once per tg */ +if (pipe_ctx->stream_res.tg && + !(tg_mask & (1 << pipe_ctx->stream_res.tg->inst))) { + tg_mask |= (1 << pipe_ctx->stream_res.tg->inst); + + dto_params.otg_inst = pipe_ctx->stream_res.tg->inst; + dto_params.ref_dtbclk_khz = ref_dtbclk_khz; + + dccg->funcs->set_dtbclk_dto (clk_mgr->dccg, &dto_params); +//dccg->funcs->set_audio_dtbclk_dto(clk_mgr->dccg, &dto_params); + } + } +} +/* Since DPPCLK request to PMFW needs to be exact (due to DPP DTO programming), * update DPPCLK to be the exact frequency that will be set after the DPPCLK * divider is updated. This will prevent rounding issues that could cause DPP
@@ -570,6 +596,7 @@ static void dcn32_update_clocks(struct clk_mgr *clk_mgr_base,/* DCCG requires KHz precision for DTBCLK */ clk_mgr_base->clks.ref_dtbclk_khz =dcn32_smu_set_hard_min_by_freq (clk_mgr,PPCLK_DTBCLK ,khz_to_mhz_ceil (new_clocks->ref_dtbclk_khz)); +dcn32_update_clocks_update_dtb_dto (clk_mgr, context, clk_mgr_base->clks.ref_dtbclk_khz); }if (dc->config.forced_clocks == false || (force_reset && safe_to_lower)) {
Signature · 1 line
2.34.1
PATCH 44/66 drm/amd/display: Fixes for dcn32_clk_mgr implementation
In reply to Qingqing ZhuoFrom: Aurabindo Pillai <[email protected]>
[Why&How]
Fix CLK MGR early initialization and add logging.
--- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c +5 -0
@@ -905,6 +905,8 @@ void dcn32_clk_mgr_construct(struct pp_smu_funcs *pp_smu, struct dccg *dccg) { + struct clk_log_info log_info = {0}; + clk_mgr->base.ctx = ctx; clk_mgr->base.funcs = &dcn32_funcs;if (ASICREV_IS_GC_11_0_2 (clk_mgr->base.ctx->asic_id.hw_internal_rev)) {
@@ -938,6 +940,7 @@ void dcn32_clk_mgr_construct( clk_mgr->base.clks.ref_dtbclk_khz =268750 ; } +/* integer part is now VCO frequency in kHz */ clk_mgr->base.dentist_vco_freq_khz =dcn32_get_vco_frequency_from_reg (clk_mgr);
@@ -945,6 +948,8 @@ void dcn32_clk_mgr_construct(if (clk_mgr->base.dentist_vco_freq_khz ==0 ) clk_mgr->base.dentist_vco_freq_khz =4300000 ;/* Updated as per HW docs */ +dcn32_dump_clk_registers (&clk_mgr->base.boot_snapshot, &clk_mgr->base, &log_info); +if (ctx->dc->debug.disable_dtb_ref_clk_switch && clk_mgr->base.clks.ref_dtbclk_khz != clk_mgr->base.boot_snapshot.dtbclk) { clk_mgr->base.clks.ref_dtbclk_khz = clk_mgr->base.boot_snapshot.dtbclk;
Signature · 1 line
2.34.1
PATCH 45/66 drm/amd/display: Clear GPINT1 before taking DMCUB out of reset
In reply to Qingqing ZhuoFrom: Samson Tam <[email protected]>
[Why]
Workaround for DMCUB front door load
[How]
Clear GPINT after reset so its consistent
--- drivers/gpu/drm/amd/display/dmub/src/dmub_dcn32.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn32.c +4 -4
@@ -116,10 +116,6 @@ void dmub_dcn32_reset(struct dmub_srv *dmub)break ; } -/* Clear the GPINT command manually so we don't reset again. */ - cmd.all =0 ; - dmub->hw_funcs.set_gpint (dmub, cmd); -/* Force reset in case we timed out, DMCUB is likely hung. */ }
@@ -131,6 +127,10 @@ void dmub_dcn32_reset(struct dmub_srv *dmub)REG_WRITE (DMCUB_OUTBOX1_RPTR ,0 );REG_WRITE (DMCUB_OUTBOX1_WPTR ,0 );REG_WRITE (DMCUB_SCRATCH0 ,0 ); + +/* Clear the GPINT command manually so we don't reset again. */ + cmd.all =0 ; + dmub->hw_funcs.set_gpint (dmub, cmd); }void dmub_dcn32_reset_release (struct dmub_srv *dmub)
Signature · 1 line
2.34.1
PATCH 46/66 drm/amd/display: Reset OUTBOX0 r/w pointer on DMUB reset
In reply to Qingqing ZhuoFrom: Cruise Hung <[email protected]>
[Why & How]
We missed resetting OUTBOX0 mailbox r/w pointer on DMUB reset. Fix it.
--- drivers/gpu/drm/amd/display/dmub/src/dmub_dcn32.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn32.c +2 -0
@@ -126,6 +126,8 @@ void dmub_dcn32_reset(struct dmub_srv *dmub)REG_WRITE (DMCUB_INBOX1_WPTR ,0 );REG_WRITE (DMCUB_OUTBOX1_RPTR ,0 );REG_WRITE (DMCUB_OUTBOX1_WPTR ,0 ); +REG_WRITE (DMCUB_OUTBOX0_RPTR ,0 ); +REG_WRITE (DMCUB_OUTBOX0_WPTR ,0 );REG_WRITE (DMCUB_SCRATCH0 ,0 );/* Clear the GPINT command manually so we don't reset again. */
Signature · 1 line
2.34.1
PATCH 47/66 drm/amd/display: Do not clear GPINT register when releasing DMUB from reset
In reply to Qingqing ZhuoFrom: Aurabindo Pillai <[email protected]>
[Why & How]
There's no need to clear GPINT register for DMUB
when releasing it from reset. Fix that.
--- drivers/gpu/drm/amd/display/dmub/src/dmub_dcn32.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn32.c +0 -1
@@ -137,7 +137,6 @@ void dmub_dcn32_reset(struct dmub_srv *dmub)void dmub_dcn32_reset_release (struct dmub_srv *dmub) { -REG_WRITE (DMCUB_GPINT_DATAIN1 ,0 );REG_UPDATE (MMHUBBUB_SOFT_RESET ,DMUIF_SOFT_RESET ,0 );REG_WRITE (DMCUB_SCRATCH15 , dmub->psp_version &0x001100FF );REG_UPDATE_2 (DMCUB_CNTL ,DMCUB_ENABLE ,1 ,DMCUB_TRACEPORT_EN ,1 );
Signature · 1 line
2.34.1
PATCH 48/66 drm/amd/display: Update bounding box values for DCN321
In reply to Qingqing ZhuoFrom: Aurabindo Pillai <[email protected]>
[Why&how]
Update bounding box values as per hardware spec
--- .../amd/display/dc/dml/dcn321/dcn321_fpu.c | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn321/dcn321_fpu.c +12 -12
@@ -106,16 +106,16 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_21_soc = { .clock_limits = { { .state = 0, - .dcfclk_mhz = 1564.0, - .fabricclk_mhz = 400.0, - .dispclk_mhz = 2150.0, - .dppclk_mhz = 2150.0, + .dcfclk_mhz = 1434.0, + .fabricclk_mhz = 2250.0, + .dispclk_mhz = 1720.0, + .dppclk_mhz = 1720.0, .phyclk_mhz = 810.0, .phyclk_d18_mhz = 667.0, - .phyclk_d32_mhz = 625.0, + .phyclk_d32_mhz = 313.0, .socclk_mhz = 1200.0, - .dscclk_mhz = 716.667, - .dram_speed_mts = 1600.0, + .dscclk_mhz = 573.333, + .dram_speed_mts = 16000.0, .dtbclk_mhz = 1564.0, }, },
@@ -125,14 +125,14 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_21_soc = { .sr_exit_z8_time_us = 285.0, .sr_enter_plus_exit_z8_time_us = 320, .writeback_latency_us = 12.0, - .round_trip_ping_latency_dcfclk_cycles = 263, + .round_trip_ping_latency_dcfclk_cycles = 207, .urgent_latency_pixel_data_only_us = 4, .urgent_latency_pixel_mixed_with_vm_data_us = 4, .urgent_latency_vm_data_only_us = 4, - .fclk_change_latency_us = 20, - .usr_retraining_latency_us = 2, - .smn_latency_us = 2, - .mall_allocated_for_dcn_mbytes = 64, + .fclk_change_latency_us = 7, + .usr_retraining_latency_us = 0, + .smn_latency_us = 0, + .mall_allocated_for_dcn_mbytes = 32, .urgent_out_of_order_return_per_channel_pixel_only_bytes = 4096, .urgent_out_of_order_return_per_channel_pixel_and_vm_bytes = 4096, .urgent_out_of_order_return_per_channel_vm_only_bytes = 4096,
Signature · 1 line
2.34.1
PATCH 49/66 drm/amd/display: add support for low bpc
In reply to Qingqing ZhuoFrom: Aurabindo Pillai <[email protected]>
[WHY&HOW]
Low bpc timings are failing validation, port a patch to allow them to pass.
--- .../dc/dml/dcn32/display_mode_vba_util_32.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c +5 -9
@@ -1595,7 +1595,6 @@ double dml32_TruncToValidBPP(unsigned int NonDSCBPP0;unsigned int NonDSCBPP1;unsigned int NonDSCBPP2; -unsigned int NonDSCBPP3;if (Format == dm_420) { NonDSCBPP0 =12 ;
@@ -1604,10 +1603,9 @@ double dml32_TruncToValidBPP( MinDSCBPP =6 ; MaxDSCBPP =1.5 * DSCInputBitPerComponent -1 /16 ; }else if (Format == dm_444) { - NonDSCBPP0 =18 ; - NonDSCBPP1 =24 ; - NonDSCBPP2 =30 ; - NonDSCBPP3 =36 ; + NonDSCBPP0 =24 ; + NonDSCBPP1 =30 ; + NonDSCBPP2 =36 ; MinDSCBPP =8 ; MaxDSCBPP =3 * DSCInputBitPerComponent -1.0 /16 ; }else {
@@ -1661,9 +1659,7 @@ double dml32_TruncToValidBPP(else return dml_floor (16.0 * MaxLinkBPP,1.0 ) /16.0 ; }else { -if (MaxLinkBPP >= NonDSCBPP3) -return NonDSCBPP3; -else if (MaxLinkBPP >= NonDSCBPP2) +if (MaxLinkBPP >= NonDSCBPP2)return NonDSCBPP2;else if (MaxLinkBPP >= NonDSCBPP1)return NonDSCBPP1;
@@ -1674,7 +1670,7 @@ double dml32_TruncToValidBPP( } }else {if (!((DSCEnable == false && (DesiredBPP == NonDSCBPP2 || DesiredBPP == NonDSCBPP1 || - DesiredBPP == NonDSCBPP0 || DesiredBPP == NonDSCBPP3)) || + DesiredBPP <= NonDSCBPP0)) || (DSCEnable && DesiredBPP >= MinDSCBPP && DesiredBPP <= MaxDSCBPP)))return BPP_INVALID ;else
Signature · 1 line
2.34.1
PATCH 50/66 drm/amd/display: Set DRAM clock if retraining is required
In reply to Qingqing ZhuoFrom: Aurabindo Pillai <[email protected]>
Set DRAM clock change state if retraining is required.
--- .../gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c +1 -1
@@ -4338,7 +4338,7 @@ void dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport( + v->WritebackChunkSize *1024.0 /32.0 /SOCCLK ; }if (v->USRRetrainingRequiredFinal) - v->Watermark.WritebackUrgentWatermark = v->Watermark.WritebackUrgentWatermark + v->Watermark.WritebackDRAMClockChangeWatermark = v->Watermark.WritebackDRAMClockChangeWatermark + mmSOCParameters.USRRetrainingLatency;if (TotalActiveWriteback <=1 ) {
Signature · 1 line
2.34.1
PATCH 51/66 drm/amd/display: Add check for PState change in DCN32
In reply to Qingqing ZhuoFrom: Aurabindo Pillai <[email protected]>
For pstate change, allow DML to loop through all possible prefetch combinations so as to support more display configurations. Set the max and min prefetch modes to enable the sequence.
--- .../drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c +4 -0
@@ -4656,6 +4656,10 @@ void dml32_CalculateMinAndMaxPrefetchMode( }else if (AllowForPStateChangeOrStutterInVBlankFinal == dm_prefetch_support_uclk_fclk_and_stutter) { *MinPrefetchMode =0 ; *MaxPrefetchMode =0 ; + }else if (AllowForPStateChangeOrStutterInVBlankFinal == + dm_prefetch_support_uclk_fclk_and_stutter_if_possible) { + *MinPrefetchMode =0 ; + *MaxPrefetchMode =3 ; }else { *MinPrefetchMode =0 ; *MaxPrefetchMode =3 ;
Signature · 1 line
2.34.1
PATCH 52/66 drm/amd/display: Remove DET check from DCN32
In reply to Qingqing ZhuoFrom: Aurabindo Pillai <[email protected]>
Drop duplicate check for DET Swath in DCN32.
--- drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c +0 -1
@@ -1697,7 +1697,6 @@ static void mode_support_configuration(struct vba_vars_st *v, && mode_lib->vba.PTEBufferSizeNotExceeded[i][j] == true && mode_lib->vba.DCCMetaBufferSizeNotExceeded[i][j] == true && mode_lib->vba.NonsupportedDSCInputBPC == false - && mode_lib->vba.NotEnoughDETSwathFillLatencyHidingPerState[i][j] == false && !mode_lib->vba.ExceededMALLSize && (mode_lib->vba.NotEnoughDETSwathFillLatencyHidingPerState[i][j] == false || i == v->soc.num_states -1 )
Signature · 1 line
2.34.1
PATCH 53/66 drm/amd/display: Isolate remaining FPU code in DCN32
In reply to Qingqing ZhuoFrom: Jasdeep Dhillon <[email protected]>
[Why]
DCN32 resource contains code that uses FPU.
[How]
Moved code into DCN32 FPU
--- drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 6 ++++++ drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.h | 2 ++ 2 files changed, 8 insertions(+)
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +6 -0
@@ -2881,3 +2881,9 @@ bool dcn32_find_vactive_pipe(struct dc *dc, const struct dc_state *context, uint }return vactive_found; } + +void dcn32_set_clock_limits (const struct _vcs_dpi_soc_bounding_box_st *soc_bb) +{ +dc_assert_fp_enabled (); + dcn3_2_soc.clock_limits[0 ].dcfclk_mhz =1200.0 ; +}
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.h +2 -0
@@ -80,4 +80,6 @@ void dcn32_assign_fpo_vactive_candidate(struct dc *dc, const struct dc_state *cobool dcn32_find_vactive_pipe (struct dc *dc,const struct dc_state *context,uint32_t vactive_margin_req); +void dcn32_set_clock_limits (const struct _vcs_dpi_soc_bounding_box_st *soc_bb); +#endif
Signature · 1 line
2.34.1
PATCH 54/66 drm/amd/display: Limit nv21 dst_y
In reply to Qingqing ZhuoFrom: Dmytro Laktyushkin <[email protected]>
Dst_y can become negative in extreme odm 4to1 cases. While not strictly invalid, this should be limited to 0 for rq/dlg/ttu calculation.
--- .../gpu/drm/amd/display/dc/dml/dcn30/display_rq_dlg_calc_30.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn30/display_rq_dlg_calc_30.c +3 -1
@@ -980,7 +980,7 @@ static void dml_rq_dlg_get_dlg_params(struct display_mode_lib *mode_lib,unsigned int vstartup_start =0 ;unsigned int dst_x_after_scaler =0 ; -unsigned int dst_y_after_scaler =0 ; +int dst_y_after_scaler =0 ;double line_wait =0 ;double dst_y_prefetch =0 ;double dst_y_per_vm_vblank =0 ;
@@ -1171,6 +1171,8 @@ static void dml_rq_dlg_get_dlg_params(struct display_mode_lib *mode_lib, dst_x_after_scaler =get_dst_x_after_scaler (mode_lib, e2e_pipe_param, num_pipes, pipe_idx); dst_y_after_scaler =get_dst_y_after_scaler (mode_lib, e2e_pipe_param, num_pipes, pipe_idx); +if (dst_y_after_scaler <0 ) + dst_y_after_scaler =0 ;// do some adjustment on the dst_after scaler to account for odm combine mode dml_print("DML_DLG: %s: input dst_x_after_scaler = %d\n",
Signature · 1 line
2.34.1
PATCH 55/66 drm/amd/display: correct DML calc error
In reply to Qingqing ZhuoFrom: Sherry Wang <[email protected]>
[Why]
DML calculation is different from HW formula.
[How]
Correct the bug to keep it same as HW formula.
--- .../gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c | 4 ++-- .../gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c | 4 ++-- .../gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c +2 -2
@@ -4939,8 +4939,8 @@ void dml30_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l } v->TotImmediateFlipBytes =0.0 ;for (k =0 ; k <= v->NumberOfActivePlanes -1 ; k++) { - v->TotImmediateFlipBytes = v->TotImmediateFlipBytes + v->NoOfDPP[i][j][k] * v->PDEAndMetaPTEBytesPerFrame[i][j][k] - + v->MetaRowBytes[i][j][k] + v->DPTEBytesPerRow[i][j][k]; + v->TotImmediateFlipBytes = v->TotImmediateFlipBytes + v->NoOfDPP[i][j][k] * (v->PDEAndMetaPTEBytesPerFrame[i][j][k] + + v->MetaRowBytes[i][j][k] + v->DPTEBytesPerRow[i][j][k]); }for (k =0 ; k <= v->NumberOfActivePlanes -1 ; k++) {
drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c +2 -2
@@ -5274,8 +5274,8 @@ void dml31_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l v->TotImmediateFlipBytes =0.0 ;for (k =0 ; k < v->NumberOfActivePlanes; k++) { v->TotImmediateFlipBytes = v->TotImmediateFlipBytes - + v->NoOfDPP[i][j][k] * v->PDEAndMetaPTEBytesPerFrame[i][j][k] + v->MetaRowBytes[i][j][k] - + v->DPTEBytesPerRow[i][j][k]; + + v->NoOfDPP[i][j][k] * (v->PDEAndMetaPTEBytesPerFrame[i][j][k] + v->MetaRowBytes[i][j][k] + + v->DPTEBytesPerRow[i][j][k]); }for (k =0 ; k < v->NumberOfActivePlanes; k++) {
drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c +2 -2
@@ -5371,8 +5371,8 @@ void dml314_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_ v->TotImmediateFlipBytes =0.0 ;for (k =0 ; k < v->NumberOfActivePlanes; k++) { v->TotImmediateFlipBytes = v->TotImmediateFlipBytes - + v->NoOfDPP[i][j][k] * v->PDEAndMetaPTEBytesPerFrame[i][j][k] + v->MetaRowBytes[i][j][k] - + v->DPTEBytesPerRow[i][j][k]; + + v->NoOfDPP[i][j][k] * (v->PDEAndMetaPTEBytesPerFrame[i][j][k] + v->MetaRowBytes[i][j][k] + + v->DPTEBytesPerRow[i][j][k]); }for (k =0 ; k < v->NumberOfActivePlanes; k++) {
Signature · 1 line
2.34.1
PATCH 56/66 drm/amd/display: Add extra check for 444 16 format
In reply to Qingqing ZhuoFrom: Aurabindo Pillai <[email protected]>
DCN30 is missing a check for the pixel format 444 when using 16bits before setting the flag that Viewport exceeds the surface.
--- drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c +1 -1
@@ -5130,7 +5130,7 @@ void dml30_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l ViewportExceedsSurface = true;if (v->SourcePixelFormat[k] != dm_444_64 && v->SourcePixelFormat[k] != dm_444_32 && v->SourcePixelFormat[k] != dm_444_16 - && v->SourcePixelFormat[k] != dm_444_8 && v->SourcePixelFormat[k] != dm_rgbe) { + && v->SourcePixelFormat[k] != dm_444_16 && v->SourcePixelFormat[k] != dm_444_8 && v->SourcePixelFormat[k] != dm_rgbe) {if (v->ViewportWidthChroma[k] > v->SurfaceWidthC[k] || v->ViewportHeightChroma[k] > v->SurfaceHeightC[k]) { ViewportExceedsSurface = true; }
Signature · 1 line
2.34.1
PATCH 57/66 drm/amd/display: 3-plane MPO enablement for DCN321
In reply to Qingqing ZhuoFrom: Krunoslav Kovac <[email protected]>
Enable 3-planes MPO for DCN321 by reporting max_slave_planes in DC caps for each ASIC.
--- drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c +3 -3
@@ -1727,9 +1727,9 @@ static bool dcn321_resource_construct( dc->caps.subvp_pstate_allow_width_us =20 ; dc->caps.subvp_vertical_int_margin_us =30 ; dc->caps.subvp_drr_vblank_start_margin_us =100 ;// 100us margin - dc->caps.max_slave_planes =1 ; - dc->caps.max_slave_yuv_planes =1 ; - dc->caps.max_slave_rgb_planes =1 ; + dc->caps.max_slave_planes =2 ; + dc->caps.max_slave_yuv_planes =2 ; + dc->caps.max_slave_rgb_planes =2 ; dc->caps.post_blend_color_processing = true; dc->caps.force_dp_tps4_for_cp2520 = true; dc->caps.dp_hpo = true;
Signature · 1 line
2.34.1
PATCH 58/66 drm/amd/display: Adjust dmub outbox notification enable
In reply to Qingqing ZhuoFrom: Meenakshikumar Somasundaram <[email protected]>
[Why]
Currently driver enables dmub outbox notification before oubox ISR is registered. During boot scenario, sometimes dmub issues hpd outbox message before driver registers ISR and those messages are missed.
[How]
Enable dmub outbox notification after outbox ISR is registered. Also, restructured outbox enable code to call from dm layer and renamed APIs.
--- drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c +0 -4
@@ -197,10 +197,6 @@ void dcn31_init_hw(struct dc *dc) } } -/* Enables outbox notifications for usb4 dpia */ -if (dc->res_pool->usb4_dpia_count) -dmub_enable_outbox_notification (dc->ctx->dmub_srv); -/* we want to turn off all dp displays before doing detection */ dc->link_srv->blank_all_dp_displays (dc);
Signature · 1 line
2.34.1
PATCH 59/66 drm/amd/display: Set min_width and min_height capability for DCN30
In reply to Qingqing ZhuoFrom: Igor Kravchenko <[email protected]>
Add min_width, min_height fields to dc_plane_cap structure. Set values to 16x16 for discrete ASICs, and 64x64 for others.
--- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c +3 -1
@@ -701,7 +701,9 @@ static const struct dc_plane_cap plane_cap = { .argb8888 = 167, .nv12 = 167, .fp16 = 167 - } + }, + 16, +16 };static const struct dc_debug_options debug_defaults_drv = {
Signature · 1 line
2.34.1
PATCH 60/66 drm/amd/display: update GSP1 generic info packet for PSRSU
In reply to Qingqing ZhuoFrom: Po-Ting Chen <[email protected]>
Base on PSRSU specification, every seletive update frame need to use two SDP to indicate the frame active range. So we occupy another GSP1 for PSRSU execution.
--- .../display/dc/dcn30/dcn30_dio_stream_encoder.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_stream_encoder.c +15 -0
@@ -436,6 +436,21 @@ void enc3_stream_encoder_update_dp_info_packets( &info_frame->vsc, true); } +/* TODO: VSC SDP at packetIndex 1 should be retricted only if PSR-SU on. +* There should have another Infopacket type (e.g. vsc_psrsu) for PSR_SU. +* In addition, currently the driver check the valid bit then update and +* send the corresponding Infopacket. For PSR-SU, the SDP only be sent +* while entering PSR-SU mode. So we need another parameter(e.g. send) +* in dc_info_packet to indicate which infopacket should be enabled by +* default here. +*/ +if (info_frame->vsc.valid) { + enc->vpg->funcs->update_generic_info_packet ( + enc->vpg, +1 ,/* packetIndex */ + &info_frame->vsc, + true); + }/* TODO: VSC SDP at packetIndex 1 should be restricted only if PSR-SU on. * There should have another Infopacket type (e.g. vsc_psrsu) for PSR_SU. * In addition, currently the driver check the valid bit then update and
Signature · 1 line
2.34.1
PATCH 61/66 drm/amd/display: fix dpms_off issue when disabling bios mode
In reply to Qingqing ZhuoFrom: Zhongwei <[email protected]>
[Why]disable_vbios_mode_if_required() will set dpms_off to false during boot when pixel clk dismatches with driver requires. This will cause extra backlight on and off if OS call 2 times setmode.
[How]
Set dpms_off to true to keep power_off and let OS control backlight by display's powerState.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -1
@@ -1268,7 +1268,7 @@ static void disable_vbios_mode_if_required(if (pix_clk_100hz != requested_pix_clk_100hz) { dc->link_srv->set_dpms_off (pipe); - pipe->stream->dpms_off = false; + pipe->stream->dpms_off = true; } } }
Signature · 1 line
2.34.1
Re: [PATCH 61/66] drm/amd/display: fix dpms_off issue when disabling bios mode
Hi
This gives me a blank screen when booting on my Ryzen 9 5900HX Laptop
03:00.0 Display controller [0380]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT] [1002:73df] (rev c3)
08:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne [Radeon Vega Series / Radeon Vega Mobile Series] [1002:1638] (rev c4)
This is the second time this has been changed - the last time was back in November, I'll happily help debug why this is breaking on my laptop but I'd appreciate if this would be reverted and not reattempted until the underlying issue is fixed
Cheers
Mike
Quoted 34 lines · Qingqing Zhuo
From: Zhongwei <[email protected]>
[Why]
disable_vbios_mode_if_required()will setdpms_offto false during boot when pixel clk dismatches with driver requires. This will cause extra backlight on and off if OS call 2 times setmode.[How]
Setdpms_offto true to keeppower_offand let OS control backlight by display's powerState.Reviewed-by Rodrigo Siqueira <[email protected]>Signed-off-by Zhongwei <[email protected]>--- drivers/gpu/drm/amd/display/dc/core/dc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/display/dc/core/dc.c +1
-2@@ -1268,7 +1268,7 @@ static void disable_vbios_mode_if_required(if (pix_clk_100hz != requested_pix_clk_100hz) { dc->link_srv->set_dpms_off (pipe); - pipe->stream->dpms_off = false; + pipe->stream->dpms_off = true; } } } --2.34.1
PATCH 62/66 drm/amd/display: Explicitly specify update type per plane info change
In reply to Qingqing ZhuoFrom: Nicholas Kazlauskas <[email protected]>
[Why]
The bit for flip addr is being set causing the determination for FAST vs MEDIUM to always return MEDIUM when plane info is provided as a surface update. This causes extreme stuttering for the typical atomic update path on Linux.
[How]
Don't use update_flags->raw for determining FAST vs MEDIUM. It's too fragile to changes like this.
Explicitly specify the update type per update flag instead. It's not as clever as checking the bits itself but at least it's correct.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -3
@@ -2482,9 +2482,6 @@ static enum surface_update_type det_surface_update(const struct dc *dc,enum surface_update_type overall_type =UPDATE_TYPE_FAST ;union surface_update_flags *update_flags = &u->surface->update_flags; -if (u->flip_addr) - update_flags->bits.addr_update =1 ; -if (!is_surface_in_context (context, u->surface) || u->surface->force_full_update) { update_flags->raw =0xFFFFFFFF ;return UPDATE_TYPE_FULL ;
Signature · 1 line
2.34.1
Re: [PATCH 62/66] drm/amd/display: Explicitly specify update type per plane info change
Hi,
Please add:
Quoted 35 lines · Qingqing Zhuo
From: Nicholas Kazlauskas <[email protected]>
[Why]
The bit for flip addr is being set causing the determination for FAST vs MEDIUM to always return MEDIUM when plane info is provided as a surface update. This causes extreme stuttering for the typical atomic update path on Linux.[How]
Don't useupdate_flags->rawfor determining FAST vs MEDIUM. It's too fragile to changes like this.Explicitly specify the update type per update flag instead. It's not as clever as checking the bits itself but at least it's correct.
Reviewed-by Rodrigo Siqueira <[email protected]>Signed-off-by Nicholas Kazlauskas <[email protected]>--- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 --- 1 file changed, 3 deletions(-)drivers/gpu/drm/amd/display/dc/core/dc.c +0
-3@@ -2482,9 +2482,6 @@ static enum surface_update_type det_surface_update(const struct dc *dc,enum surface_update_type overall_type =UPDATE_TYPE_FAST ;union surface_update_flags *update_flags = &u->surface->update_flags; -if (u->flip_addr) - update_flags->bits.addr_update =1 ; -if (!is_surface_in_context (context, u->surface) || u->surface->force_full_update) { update_flags->raw =0xFFFFFFFF ;return UPDATE_TYPE_FULL ;
PATCH 63/66 drm/amd/display: Add FAMS capability to DCN31
In reply to Qingqing ZhuoFrom: Aurabindo Pillai <[email protected]>
DCN31 supports FAMS, but this was not correctly set to the hardware setup sequence. This commit fixes this issue by setting the MCLK switch capability based on the feature capability retrieved from the DMUB.
--- drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c +1 -0
@@ -295,6 +295,7 @@ void dcn31_init_hw(struct dc *dc)// Get DMCUB capabilities dc_dmub_srv_query_caps_cmd (dc->ctx->dmub_srv); dc->caps.dmub_caps.psr = dc->ctx->dmub_srv->dmub->feature_caps.psr; + dc->caps.dmub_caps.mclk_sw = dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch; } void dcn31_dsc_pg_control(
Signature · 1 line
2.34.1
PATCH 64/66 drm/amd/display: Add FAMS related definitions and documenation for enum fields
In reply to Qingqing ZhuoFrom: Aurabindo Pillai <[email protected]>
[Why&How]
Add Enum and documenation related to FAMS (Firmware Assisted Memclk Switching) and CAB (Cache As Buffer)
--- drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +15 -2
@@ -376,6 +376,7 @@ enum dmub_fw_boot_status_bit {DMUB_FW_BOOT_STATUS_BIT_OPTIMIZED_INIT_DONE = (1 <<2 ),/**< 1 if init done */ DMUB_FW_BOOT_STATUS_BIT_RESTORE_REQUIRED = (1 <<3 ),/**< 1 if driver should call restore */ DMUB_FW_BOOT_STATUS_BIT_DEFERRED_LOADED = (1 <<4 ),/**< 1 if VBIOS data is deferred programmed */ +DMUB_FW_BOOT_STATUS_BIT_FAMS_ENABLED = (1 <<5 ),/**< 1 if FAMS is enabled*/ DMUB_FW_BOOT_STATUS_BIT_DETECTION_REQUIRED = (1 <<6 ),/**< 1 if detection need to be triggered by driver*/ DMUB_FW_BOOT_STATUS_BIT_HW_POWER_INIT_DONE = (1 << 7), /**< 1 if hw power init is completed */ };
@@ -989,16 +990,25 @@ struct dmub_rb_cmd_mall { };/** -* enum dmub_cmd_cab_type - TODO: +* enum dmub_cmd_cab_type - CAB command data. */ enum dmub_cmd_cab_type { +/** +* No idle optimizations (i.e. no CAB) +*/ DMUB_CMD__CAB_NO_IDLE_OPTIMIZATION =0 , +/** +* No DCN requests for memory +*/ DMUB_CMD__CAB_NO_DCN_REQ =1 , +/** +* Fit surfaces in CAB (i.e. CAB enable) +*/ DMUB_CMD__CAB_DCN_SS_FIT_IN_CAB =2 , };/** -* struct dmub_rb_cmd_cab_for_ss - TODO: +* struct dmub_rb_cmd_cab - CAB command data. */ struct dmub_rb_cmd_cab_for_ss {struct dmub_cmd_header header;
@@ -1006,6 +1016,9 @@ struct dmub_rb_cmd_cab_for_ss {uint8_t debug_bits;/* debug bits */ }; +/** +* Enum for indicating which MCLK switch mode per pipe +*/ enum mclk_switch_mode {NONE =0 ,FPO =1 ,
Signature · 1 line
2.34.1
PATCH 65/66 drm/amd/display: remove some unused variables
In reply to Qingqing ZhuoFrom: Aurabindo Pillai <[email protected]>
[Why&How]
Fixes the following warnings:
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_hwseq.c: In function ‘dcn21_set_backlight_level’:drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_hwseq.c:229:18: warning: unused variable ‘otg_inst’ [-Wunused-variable]
229 | uint32_t otg_inst = pipe_ctx->stream_res.tg->inst;
| ^~~~~~~~drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_hwseq.c:226:27: warning: unused variable ‘cmd’ [-Wunused-variable]
226 | union dmub_rb_cmd cmd;
--- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c +0 -2
@@ -223,10 +223,8 @@ bool dcn21_set_backlight_level(struct pipe_ctx *pipe_ctx, uint32_t backlight_pwm_u16_16, uint32_t frame_ramp) { -union dmub_rb_cmd cmd;struct dc_context *dc = pipe_ctx->stream->ctx;struct abm *abm = pipe_ctx->stream_res.abm; -uint32_t otg_inst = pipe_ctx->stream_res.tg->inst;struct panel_cntl *panel_cntl = pipe_ctx->stream->link->panel_cntl;if (dc->dc->res_pool->dmcu) {
Signature · 1 line
2.34.1
PATCH 66/66 drm/amd/display: 3.2.231
In reply to Qingqing ZhuoFrom: Aric Cyr <[email protected]>
This DC version brings along:
- FW Release 0.0.162.0
- Enable FPO+Vactivate
- Support for VESA SCR on OLED
- Refactor DMUB commands
- Fixes in secure display, modeset, memleak and more
- Picked up missed patches in history
--- 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
@@ -45,7 +45,7 @@ struct aux_payload;struct set_config_cmd_payload ;struct dmub_notification ; -#define DC_VER "3.2.230" +#define DC_VER "3.2.231"#define MAX_SURFACES 3#define MAX_PLANES 6
Signature · 1 line
2.34.1
[Public]
Hi all,
This week this patchset was tested on the following systems:
Lenovo Thinkpad T14s Gen2, with AMD Ryzen 5 5650U
Lenovo Thinkpad T13s Gen4 with AMD Ryzen 5 6600U
Reference AMD RX6800
These systems were tested on the following display types:
eDP, (1080p 60hz [5650U]) (1920x1200 60hz [6600U]) (2560x1600 120hz[6600U]) VGA and DVI (1680x1050 60HZ [DP to VGA/DVI, USB-C to DVI/VGA]) DP/HDMI/USB-C (1440p 170hz, 4k 60hz, 4k 144hz [Includes USB-C to DP/HDMI adapters])
MST tested with Startech MST14DP123DP and 2x 4k 60Hz displays
DSC tested with Cable Matters 101075 (DP to 3x DP), and 201375 (USB-C to 3x DP) with 3x 4k60 displays HP Hook G2 with 1 and 2 4k60 Displays
The testing is a mix of automated and manual tests. Manual testing includes (but is not limited to):
Changing display configurations and settings
Benchmark testing
Feature testing (Freesync, etc.)
Automated testing includes (but is not limited to):
Script testing (scripts to automate some of the manual checks) IGT testing
The patchset consists of the amd-staging-drm-next branch (Head commit - c940e09ec9ad drm/amd/display: 3.2.230) with new patches added on top of it. This branch is used for both Ubuntu and Chrome OS testing (ChromeOS on a bi-weekly basis).
Tested on Ubuntu 22.04.1 and Chrome OS
Thank you,
Dan Wheeler
Sr. Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
amd.com
-----Original Message-----
From: Zhuo, Qingqing (Lillian) <[email protected]>
Sent: April 14, 2023 11:52 AM
To: [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Siqueira, Rodrigo <[email protected]>; Pillai, Aurabindo <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; Li, Roman <[email protected]>; Lin, Wayne <[email protected]>; Wang, Chao-kai (Stylon) <[email protected]>; Chiu, Solomon <[email protected]>; Kotarac, Pavle <[email protected]>; Gutierrez, Agustin <[email protected]>; Wheeler, Daniel <[email protected]>
Subject: [PATCH 00/66] DC Patches Apr 17th, 2023
This DC patchset brings improvements in multiple areas. In summary, we highlight:
- FW Release 0.0.162.0
- Enable FPO+Vactivate
- Support for VESA SCR on OLED
- Refactor DMUB commands
- Fixes in secure display, modeset, memleak and more
- Picked up missed patches in history
Alan Liu (1):
drm/amd/display: Fix in disabling secure display
Alex Hung (2):
drm/amd/display: allow edp updates for virtual signal drm/amd/display: fix a divided-by-zero error
Alvin Lee (5):
drm/amd/display: Only consider DISPCLK when using optimized boot path drm/amd/display: Reduce SubVP + DRR stretch margin drm/amd/display: Set watermarks set D equal to A drm/amd/display: Enable FPO + Vactive
drm/amd/display: Update DTBCLK for DCN32
Anthony Koo (1):
drm/amd/display: [FW Promotion] Release 0.0.162.0
Aric Cyr (1):
drm/amd/display: 3.2.231
Aurabindo Pillai (13):
drm/amd/display: Fix hang when skipping modeset drm/amd/display: remove incorrect early return drm/amd/display: Fixes for dcn32_clk_mgr implementation drm/amd/display: Do not clear GPINT register when releasing DMUB from
reset
drm/amd/display: Update bounding box values for DCN321 drm/amd/display: add support for low bpc
drm/amd/display: Set DRAM clock if retraining is required drm/amd/display: Add check for PState change in DCN32 drm/amd/display: Remove DET check from DCN32 drm/amd/display: Add extra check for 444 16 format drm/amd/display: Add FAMS capability to DCN31 drm/amd/display: Add FAMS related definitions and documenation for
enum fields
drm/amd/display: remove some unused variables
Cruise Hung (1):
drm/amd/display: Reset OUTBOX0 r/w pointer on DMUB reset
Daniel Miess (1):
drm/amd/display: limit timing for single dimm memory
Dmytro Laktyushkin (4):
drm/amd/display: update max streams per surface
drm/amd/display: add extra dc odm debug options
drm/amd/display: set dcn315 lb bpp to 48
drm/amd/display: Limit nv21 dst_y
Eric Yang (1):
drm/amd/display: add mechanism to skip DCN init
Hersen Wu (2):
drm/amd/display: fix memleak in aconnector->timing_requested drm/amd/display: fix access hdcp_workqueue assert
Igor Kravchenko (1):
drm/amd/display: Set min_width and min_height capability for DCN30
Iswara Nagulendran (1):
drm/amd/display: Adding support for VESA SCR
Jasdeep Dhillon (1):
drm/amd/display: Isolate remaining FPU code in DCN32
Jingwen Zhu (1):
drm/amd/display: Improvement for handling edp link training fails
Josip Pavic (3):
drm/amd/display: copy dmub caps to dc on dcn31 drm/amd/display: refactor dmub commands into single function drm/amd/display: drain dmub inbox if queue is full
Krunoslav Kovac (1):
drm/amd/display: 3-plane MPO enablement for DCN321
Leon Huang (2):
drm/amd/display: Refactor ABM feature
drm/amd/display: Fix ABM pipe/backlight issues when change backlight
Meenakshikumar Somasundaram (1):
drm/amd/display: Adjust dmub outbox notification enable
Michael Mityushkin (2):
drm/amd/display: Correct output color space during HW reinitialize drm/amd/display: Apply correct panel mode when reinitializing hardware
Mikita Lipski (1):
drm/amd/display: Write TEST_EDID_CHECKSUM_WRITE for EDID tests
Nasir Osman (1):
drm/amd/display: DSC policy override when ODM combine is forced
Nicholas Kazlauskas (1):
drm/amd/display: Explicitly specify update type per plane info change
Po-Ting Chen (1):
drm/amd/display: update GSP1 generic info packet for PSRSU
Rodrigo Siqueira (9):
drm/amd/display: Update bouding box values for DCN32 drm/amd/display: Add missing mclk update drm/amd/display: Adjust code identation and other minor details drm/amd/display: Set maximum VStartup if is DCN201 drm/amd/display: Set dp_rate to dm_dp_rate_na by default drm/amd/display: Remove wrong assignment of DP link rate drm/amd/display: Use pointer in the memcpy drm/amd/display: Add missing WA and MCLK validation drm/amd/display: Add FAMS validation before trying to use it
Samson Tam (1):
drm/amd/display: Clear GPINT1 before taking DMCUB out of reset
Sherry Wang (1):
drm/amd/display: correct DML calc error
Tianci Yin (1):
drm/amd/display: Disable migration to ensure consistency of per-CPU
variable
Wesley Chalmers (3):
drm/amd/display: Do not set drr on pipe commit drm/amd/display: Block optimize on consecutive FAMS enables drm/amd/display: Add logging for display MALL refresh setting
Zhongwei (1):
drm/amd/display: fix dpms_off issue when disabling bios mode
hersen wu (1):
drm/amd/display: Return error code on DSC atomic check failure
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 33 ++- .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 31 +- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 31 +- .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 17 +- .../gpu/drm/amd/display/amdgpu_dm/dc_fpu.c | 2 + .../drm/amd/display/dc/bios/command_table2.c | 25 +- .../dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.c | 3 + .../display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c | 4 +- .../dc/clk_mgr/dcn314/dcn314_clk_mgr.c | 4 +- .../dc/clk_mgr/dcn315/dcn315_clk_mgr.c | 4 +- .../dc/clk_mgr/dcn316/dcn316_clk_mgr.c | 4 +- .../display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 32 +++ drivers/gpu/drm/amd/display/dc/core/dc.c | 37 +-- .../gpu/drm/amd/display/dc/core/dc_resource.c | 3 + drivers/gpu/drm/amd/display/dc/dc.h | 5 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 201 +++++-------- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 15 +- drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 7 + drivers/gpu/drm/amd/display/dc/dc_dsc.h | 1 + drivers/gpu/drm/amd/display/dc/dc_helper.c | 28 +- drivers/gpu/drm/amd/display/dc/dc_stream.h | 8 +- drivers/gpu/drm/amd/display/dc/dc_types.h | 2 +- drivers/gpu/drm/amd/display/dc/dce/Makefile | 2 +- drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c | 264 +++++++---------- .../gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c | 272 ++++++++++++++++++ .../gpu/drm/amd/display/dc/dce/dmub_abm_lcd.h | 46 +++ .../drm/amd/display/dc/dce/dmub_hw_lock_mgr.c | 4 +- .../gpu/drm/amd/display/dc/dce/dmub_outbox.c | 4 +- drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 28 +- .../display/dc/dce110/dce110_hw_sequencer.c | 19 +- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 4 +- .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 13 + .../gpu/drm/amd/display/dc/dcn21/dcn21_hubp.c | 7 +- .../drm/amd/display/dc/dcn21/dcn21_hwseq.c | 68 +++-- .../dc/dcn30/dcn30_dio_stream_encoder.c | 15 + .../drm/amd/display/dc/dcn30/dcn30_hwseq.c | 41 ++- .../gpu/drm/amd/display/dc/dcn30/dcn30_optc.c | 7 +- .../drm/amd/display/dc/dcn30/dcn30_resource.c | 4 +- .../display/dc/dcn31/dcn31_dio_link_encoder.c | 8 +- .../drm/amd/display/dc/dcn31/dcn31_hwseq.c | 17 +- .../gpu/drm/amd/display/dc/dcn31/dcn31_init.c | 1 + .../amd/display/dc/dcn31/dcn31_panel_cntl.c | 4 +- .../drm/amd/display/dc/dcn314/dcn314_hwseq.c | 4 +- .../drm/amd/display/dc/dcn314/dcn314_init.c | 1 + .../amd/display/dc/dcn314/dcn314_resource.c | 20 ++ .../drm/amd/display/dc/dcn32/dcn32_hwseq.c | 19 +- .../drm/amd/display/dc/dcn32/dcn32_resource.c | 48 ++-- .../amd/display/dc/dcn321/dcn321_resource.c | 8 +- drivers/gpu/drm/amd/display/dc/dm_services.h | 7 + .../drm/amd/display/dc/dm_services_types.h | 6 + .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 178 ++++++------ .../drm/amd/display/dc/dml/dcn30/dcn30_fpu.c | 18 +- .../dc/dml/dcn30/display_mode_vba_30.c | 6 +- .../dc/dml/dcn30/display_rq_dlg_calc_30.c | 4 +- .../drm/amd/display/dc/dml/dcn31/dcn31_fpu.c | 2 +- .../dc/dml/dcn31/display_mode_vba_31.c | 4 +- .../dc/dml/dcn314/display_mode_vba_314.c | 4 +- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 22 +- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.h | 2 + .../dc/dml/dcn32/display_mode_vba_32.c | 1 - .../dc/dml/dcn32/display_mode_vba_util_32.c | 20 +- .../amd/display/dc/dml/dcn321/dcn321_fpu.c | 24 +- drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 10 +- drivers/gpu/drm/amd/display/dc/inc/hw/abm.h | 6 + .../gpu/drm/amd/display/dc/link/link_dpms.c | 5 + .../dc/link/protocols/link_dp_capability.c | 11 +- .../display/dc/link/protocols/link_dp_dpia.c | 2 +- .../dc/link/protocols/link_dp_training.c | 5 +- .../link/protocols/link_edp_panel_control.c | 30 +- drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 1 - .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 28 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn21.c | 6 - .../gpu/drm/amd/display/dmub/src/dmub_dcn21.h | 4 - .../gpu/drm/amd/display/dmub/src/dmub_dcn32.c | 11 +- .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 25 +- .../drm/amd/display/include/signal_types.h | 1 + .../amd/display/modules/power/power_helpers.c | 4 + include/drm/display/drm_dp.h | 3 + 78 files changed, 1149 insertions(+), 726 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c create mode 100644 drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.h
--
2.34.1