DC Patches - 2 Dec 2019
[email protected]
maintainercover DC Patches - 2 Dec 2019
From: Leo Li <[email protected]>
Summary of change:
* More DMCUB updates for Renoir
* Cleanup and refactor of DC hardware sequencer interface
Amanda Liu (1):
drm/amd/display: Fix screen tearing on vrr tests
Anthony Koo (4):
drm/amd/display: rename core_dc to dc drm/amd/display: add separate of private hwss functions drm/amd/display: add DP protocol version drm/amd/display: Limit NV12 chroma workaround
Aric Cyr (3):
drm/amd/display: 3.2.61
drm/amd/display: fix cursor positioning for multiplane cases drm/amd/display: 3.2.62
Brandon Syu (1):
drm/amd/display: fixed that I2C over AUX didn't read data issue
David Galiffi (1):
drm/amd/display: Fixed kernel panic when booting with DP-to-HDMI
dongle
Dmytro Laktyushkin (2):
drm/amd/display: fix dml20 min_dst_y_next_start calculation drm/amd/display: update dml related structs
Eric Yang (3):
drm/amd/display: update sr and pstate latencies for Renoir drm/amd/display: fix dprefclk and ss percentage reading on RN drm/amd/display: update dispclk and dppclk vco frequency
George Shen (1):
drm/amd/display: Increase the number of retries after AUX DEFER
Hugo Hu (1):
drm/amd/display: Save/restore link setting for disable phy when link
retraining
Jaehyun Chung (1):
drm/amd/display: Wrong ifdef guards were used around DML validation
Joseph Gravenor (5):
drm/amd/display: fix DalDramClockChangeLatencyNs override drm/amd/display: populate bios integrated info for renoir drm/amd/display: have two different sr and pstate latency tables for
renoir
drm/amd/display: update p-state latency for renoir when using lpddr4 drm/amd/display: update sr latency for renoir when using lpddr4
Krunoslav Kovac (1):
drm/amd/display: Change HDR_MULT check
Leo (Hanghong) Ma (1):
drm/amd/display: Change the delay time before enabling FEC
Lucy Li (1):
drm/amd/display: Disable link before reenable
Michael Strauss (2):
drm/amd/display: Fix Dali clk mgr construct drm/amd/display: Disable chroma viewport w/a when rotated 180 degrees
Mikita Lipski (1):
drm/amd/display: Return a correct error value
Nicholas Kazlauskas (6):
drm/amd/display: Only wait for DMUB phy init on dcn21 drm/amd/display: Return DMUB_STATUS_OK when autoload unsupported drm/amd/display: Program CW5 for tracebuffer for dcn20 drm/amd/display: Split DMUB cmd type into type/subtype drm/amd/display: Add shared DMCUB/driver firmware state cache window drm/amd/display: Extend DMCUB offload testing into dcn20/21
Nikola Cornij (2):
drm/amd/display: Map DSC resources 1-to-1 if numbers of OPPs and DSCs
are equal
drm/amd/display: Reset steer fifo before unblanking the stream
Noah Abradjian (3):
drm/amd/display: Remove flag check in mpcc update drm/amd/display: Modify logic for when to wait for mpcc idle drm/amd/display: Remove redundant call
Paul Hsieh (1):
drm/amd/display: Reset PHY in link re-training
Reza Amini (2):
drm/amd/display: Implement DePQ for DCN1
drm/amd/display: Implement DePQ for DCN2
Wenjing Liu (3):
drm/amd/display: add dc dsc functions to return bpp range for pixel
encoding
drm/amd/display: remove spam DSC log
drm/amd/display: add dsc policy getter
Yongqiang Sun (2):
drm/amd/display: Add DMCUB__PG_DONE trace code enum drm/amd/display: Compare clock state member to determine optimization.
abdoulaye berthe (3):
drm/amd/display: add log for lttpr
drm/amd/display: check for repeater when setting aux_rd_interval. drm/amd/display: correct log message for lttpr
.../drm/amd/display/dc/bios/bios_parser2.c | 2 + .../drm/amd/display/dc/bios/command_table2.c | 13 +- .../gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c | 7 + .../dc/clk_mgr/dce112/dce112_clk_mgr.c | 12 +- .../dc/clk_mgr/dcn10/rv1_clk_mgr_vbios_smu.c | 6 +- .../amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c | 146 +++++-- .../dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.c | 6 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 12 +- .../gpu/drm/amd/display/dc/core/dc_debug.c | 8 +- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 198 +++++----- .../gpu/drm/amd/display/dc/core/dc_link_ddc.c | 2 +- .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 209 +++++++--- .../drm/amd/display/dc/core/dc_link_hwss.c | 40 +- .../gpu/drm/amd/display/dc/core/dc_resource.c | 9 +- .../gpu/drm/amd/display/dc/core/dc_stream.c | 43 +- .../gpu/drm/amd/display/dc/core/dc_surface.c | 22 +- drivers/gpu/drm/amd/display/dc/dc.h | 7 +- drivers/gpu/drm/amd/display/dc/dc_dsc.h | 16 +- drivers/gpu/drm/amd/display/dc/dc_helper.c | 3 + drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 32 +- .../gpu/drm/amd/display/dc/dce/dce_hwseq.c | 2 +- .../gpu/drm/amd/display/dc/dce/dce_hwseq.h | 6 +- .../display/dc/dce100/dce100_hw_sequencer.c | 3 +- .../display/dc/dce100/dce100_hw_sequencer.h | 1 + .../display/dc/dce110/dce110_hw_sequencer.c | 85 ++-- .../display/dc/dce110/dce110_hw_sequencer.h | 1 + .../amd/display/dc/dce110/dce110_resource.c | 3 +- .../display/dc/dce112/dce112_hw_sequencer.c | 2 +- .../display/dc/dce112/dce112_hw_sequencer.h | 1 + .../display/dc/dce120/dce120_hw_sequencer.c | 2 +- .../display/dc/dce120/dce120_hw_sequencer.h | 1 + .../amd/display/dc/dce80/dce80_hw_sequencer.c | 2 +- .../amd/display/dc/dce80/dce80_hw_sequencer.h | 1 + .../drm/amd/display/dc/dcn10/dcn10_dpp_cm.c | 3 + .../gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 3 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h | 4 +- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 179 +++++---- .../amd/display/dc/dcn10/dcn10_hw_sequencer.h | 1 + .../gpu/drm/amd/display/dc/dcn10/dcn10_init.c | 38 +- .../drm/amd/display/dc/dcn20/dcn20_dpp_cm.c | 3 + .../gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c | 1 + .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 103 ++--- .../drm/amd/display/dc/dcn20/dcn20_hwseq.h | 3 + .../gpu/drm/amd/display/dc/dcn20/dcn20_init.c | 54 +-- .../gpu/drm/amd/display/dc/dcn20/dcn20_optc.c | 5 + .../drm/amd/display/dc/dcn20/dcn20_resource.c | 16 +- .../display/dc/dcn20/dcn20_stream_encoder.c | 12 +- .../gpu/drm/amd/display/dc/dcn21/dcn21_hubp.c | 8 +- .../drm/amd/display/dc/dcn21/dcn21_hwseq.c | 1 + .../drm/amd/display/dc/dcn21/dcn21_hwseq.h | 2 + .../gpu/drm/amd/display/dc/dcn21/dcn21_init.c | 63 +-- .../drm/amd/display/dc/dcn21/dcn21_resource.c | 22 +- .../dc/dml/dcn20/display_rq_dlg_calc_20.c | 3 +- .../amd/display/dc/dml/display_mode_structs.h | 3 + .../drm/amd/display/dc/dml/display_mode_vba.c | 2 +- drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 97 +++-- .../gpu/drm/amd/display/dc/inc/dc_link_dp.h | 5 +- .../gpu/drm/amd/display/dc/inc/hw/clk_mgr.h | 3 + drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h | 4 +- .../gpu/drm/amd/display/dc/inc/hw_sequencer.h | 370 +++++------------- .../amd/display/dc/inc/hw_sequencer_private.h | 156 ++++++++ .../dc/irq/dce110/irq_service_dce110.c | 4 +- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 48 +-- .../drm/amd/display/dmub/inc/dmub_cmd_dal.h | 41 ++ .../drm/amd/display/dmub/inc/dmub_cmd_vbios.h | 41 ++ .../drm/amd/display/dmub/inc/dmub_fw_state.h | 73 ++++ .../gpu/drm/amd/display/dmub/inc/dmub_srv.h | 8 +- .../amd/display/dmub/inc/dmub_trace_buffer.h | 1 + .../gpu/drm/amd/display/dmub/src/dmub_dcn20.c | 22 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn20.h | 5 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn21.c | 17 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn21.h | 5 +- .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 39 +- .../gpu/drm/amd/display/include/dal_asic_id.h | 12 +- .../amd/display/include/i2caux_interface.h | 2 +- .../amd/display/modules/color/color_gamma.c | 39 +- .../amd/display/modules/freesync/freesync.c | 32 +- .../amd/display/modules/inc/mod_freesync.h | 1 - 78 files changed, 1516 insertions(+), 941 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/inc/hw_sequencer_private.h create mode 100644 drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd_dal.h create mode 100644 drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd_vbios.h create mode 100644 drivers/gpu/drm/amd/display/dmub/inc/dmub_fw_state.h
--
2.24.0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 1/51 drm/amd/display: update sr and pstate latencies for Renoir
From: Eric Yang <[email protected]>
[Why]
DF team has produced more optimized latency numbers.
[How]
Add sr latencies to the wm table, use different latencies for different wm sets.
Also fix bb override from registery key for these latencies.
--- .../amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c | 16 ++++++++++++---- .../drm/amd/display/dc/dcn21/dcn21_resource.c | 15 ++++++++++++--- drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr.h | 2 ++ 3 files changed, 26 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c +12 -4
@@ -523,25 +523,33 @@ struct clk_bw_params rn_bw_params = { { .wm_inst = WM_A, .wm_type = WM_TYPE_PSTATE_CHG, - .pstate_latency_us = 23.84, + .pstate_latency_us = 11.72, + .sr_exit_time_us = 6.09, + .sr_enter_plus_exit_time_us = 7.14, .valid = true, }, { .wm_inst = WM_B, .wm_type = WM_TYPE_PSTATE_CHG, - .pstate_latency_us = 23.84, + .pstate_latency_us = 11.72, + .sr_exit_time_us = 10.12, + .sr_enter_plus_exit_time_us = 11.48, .valid = true, }, { .wm_inst = WM_C, .wm_type = WM_TYPE_PSTATE_CHG, - .pstate_latency_us = 23.84, + .pstate_latency_us = 11.72, + .sr_exit_time_us = 10.12, + .sr_enter_plus_exit_time_us = 11.48, .valid = true, }, { .wm_inst = WM_D, .wm_type = WM_TYPE_PSTATE_CHG, - .pstate_latency_us = 23.84, + .pstate_latency_us = 11.72, + .sr_exit_time_us = 10.12, + .sr_enter_plus_exit_time_us = 11.48, .valid = true, }, },
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +12 -3
@@ -972,6 +972,8 @@ static void calculate_wm_set_for_vlevel( pipes[0 ].clks_cfg.socclk_mhz = dml->soc.clock_limits[vlevel].socclk_mhz; dml->soc.dram_clock_change_latency_us = table_entry->pstate_latency_us; + dml->soc.sr_exit_time_us = table_entry->sr_exit_time_us; + dml->soc.sr_enter_plus_exit_time_us = table_entry->sr_enter_plus_exit_time_us; wm_set->urgent_ns =get_wm_urgent (dml, pipes, pipe_cnt) *1000 ; wm_set->cstate_pstate.cstate_enter_plus_exit_ns =get_wm_stutter_enter_exit (dml, pipes, pipe_cnt) *1000 ;
@@ -987,14 +989,21 @@ static void calculate_wm_set_for_vlevel(static void patch_bounding_box (struct dc *dc,struct _vcs_dpi_soc_bounding_box_st *bb) { +int i; +kernel_fpu_begin ();if (dc->bb_overrides.sr_exit_time_ns) { - bb->sr_exit_time_us = dc->bb_overrides.sr_exit_time_ns /1000.0 ; +for (i =0 ; i <WM_SET_COUNT ; i++) { + dc->clk_mgr->bw_params->wm_table.entries[i].sr_exit_time_us = + dc->bb_overrides.sr_exit_time_ns /1000.0 ; + } }if (dc->bb_overrides.sr_enter_plus_exit_time_ns) { - bb->sr_enter_plus_exit_time_us = - dc->bb_overrides.sr_enter_plus_exit_time_ns /1000.0 ; +for (i =0 ; i <WM_SET_COUNT ; i++) { + dc->clk_mgr->bw_params->wm_table.entries[i].sr_enter_plus_exit_time_us = + dc->bb_overrides.sr_enter_plus_exit_time_ns /1000.0 ; + } }if (dc->bb_overrides.urgent_latency_ns) {
drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr.h +2 -0
@@ -66,6 +66,8 @@ struct wm_range_table_entry {unsigned int wm_inst;unsigned int wm_type;double pstate_latency_us; +double sr_exit_time_us; +double sr_enter_plus_exit_time_us;bool valid; };
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 2/51 drm/amd/display: rename core_dc to dc
In reply to [email protected]From: Anthony Koo <[email protected]>
[Why]
First, to make code more consistent
Second, to get rid of those scenario where we create a second local pointer to dc when it's already passed in.
[How]
Rename core_dc to dc
Remove duplicate local pointers to dc
--- .../dc/clk_mgr/dce112/dce112_clk_mgr.c | 12 ++-- .../dc/clk_mgr/dcn10/rv1_clk_mgr_vbios_smu.c | 6 +- .../dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.c | 6 +- .../gpu/drm/amd/display/dc/core/dc_debug.c | 7 +- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 65 +++++++++---------- .../drm/amd/display/dc/core/dc_link_hwss.c | 26 ++++---- .../gpu/drm/amd/display/dc/core/dc_resource.c | 3 +- .../gpu/drm/amd/display/dc/core/dc_stream.c | 40 ++++++------ .../gpu/drm/amd/display/dc/core/dc_surface.c | 22 +++---- .../display/dc/dce110/dce110_hw_sequencer.c | 8 +-- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 10 +-- .../dc/irq/dce110/irq_service_dce110.c | 4 +- 12 files changed, 102 insertions(+), 107 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +6 -6
@@ -72,8 +72,8 @@ int dce112_set_clock(struct clk_mgr *clk_mgr_base, int requested_clk_khz)struct clk_mgr_internal *clk_mgr_dce =TO_CLK_MGR_INTERNAL (clk_mgr_base);struct bp_set_dce_clock_parameters dce_clk_params;struct dc_bios *bp = clk_mgr_base->ctx->dc_bios; -struct dc *core_dc = clk_mgr_base->ctx->dc; -struct dmcu *dmcu = core_dc->res_pool->dmcu; +struct dc *dc = clk_mgr_base->ctx->dc; +struct dmcu *dmcu = dc->res_pool->dmcu;int actual_clock = requested_clk_khz;/* Prepare to program display clock*/ memset (&dce_clk_params,0 ,sizeof (dce_clk_params));
@@ -110,7 +110,7 @@ int dce112_set_clock(struct clk_mgr *clk_mgr_base, int requested_clk_khz) bp->funcs->set_dce_clock (bp, &dce_clk_params); -if (!IS_FPGA_MAXIMUS_DC (core_dc->ctx->dce_environment)) { +if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) {if (dmcu && dmcu->funcs->is_dmcu_initialized (dmcu)) {if (clk_mgr_dce->dfs_bypass_disp_clk != actual_clock) dmcu->funcs->set_psr_wait_loop(dmcu,
@@ -126,8 +126,8 @@ int dce112_set_dispclk(struct clk_mgr_internal *clk_mgr, int requested_clk_khz) {struct bp_set_dce_clock_parameters dce_clk_params;struct dc_bios *bp = clk_mgr->base.ctx->dc_bios; -struct dc *core_dc = clk_mgr->base.ctx->dc; -struct dmcu *dmcu = core_dc->res_pool->dmcu; +struct dc *dc = clk_mgr->base.ctx->dc; +struct dmcu *dmcu = dc->res_pool->dmcu;int actual_clock = requested_clk_khz;/* Prepare to program display clock*/ memset (&dce_clk_params,0 ,sizeof (dce_clk_params));
@@ -152,7 +152,7 @@ int dce112_set_dispclk(struct clk_mgr_internal *clk_mgr, int requested_clk_khz) clk_mgr->cur_min_clks_state =DM_PP_CLOCKS_STATE_NOMINAL ; -if (!IS_FPGA_MAXIMUS_DC (core_dc->ctx->dce_environment)) { +if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) {if (dmcu && dmcu->funcs->is_dmcu_initialized (dmcu)) {if (clk_mgr->dfs_bypass_disp_clk != actual_clock) dmcu->funcs->set_psr_wait_loop(dmcu,
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr_vbios_smu.c +3 -3
@@ -88,8 +88,8 @@ int rv1_vbios_smu_send_msg_with_param(struct clk_mgr_internal *clk_mgr, unsignedint rv1_vbios_smu_set_dispclk (struct clk_mgr_internal *clk_mgr,int requested_dispclk_khz) {int actual_dispclk_set_mhz =-1 ; -struct dc *core_dc = clk_mgr->base.ctx->dc; -struct dmcu *dmcu = core_dc->res_pool->dmcu; +struct dc *dc = clk_mgr->base.ctx->dc; +struct dmcu *dmcu = dc->res_pool->dmcu;/* Unit of SMU msg parameter is Mhz */ actual_dispclk_set_mhz = rv1_vbios_smu_send_msg_with_param(
@@ -100,7 +100,7 @@ int rv1_vbios_smu_set_dispclk(struct clk_mgr_internal *clk_mgr, int requested_di/* Actual dispclk set is returned in the parameter register */ actual_dispclk_set_mhz =REG_READ (MP1_SMN_C2PMSG_83 ) *1000 ; -if (!IS_FPGA_MAXIMUS_DC (core_dc->ctx->dce_environment)) { +if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) {if (dmcu && dmcu->funcs->is_dmcu_initialized (dmcu)) {if (clk_mgr->dfs_bypass_disp_clk != actual_dispclk_set_mhz) dmcu->funcs->set_psr_wait_loop(dmcu,
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.c +3 -3
@@ -82,8 +82,8 @@ int rn_vbios_smu_get_smu_version(struct clk_mgr_internal *clk_mgr)int rn_vbios_smu_set_dispclk (struct clk_mgr_internal *clk_mgr,int requested_dispclk_khz) {int actual_dispclk_set_mhz =-1 ; -struct dc *core_dc = clk_mgr->base.ctx->dc; -struct dmcu *dmcu = core_dc->res_pool->dmcu; +struct dc *dc = clk_mgr->base.ctx->dc; +struct dmcu *dmcu = dc->res_pool->dmcu;/* Unit of SMU msg parameter is Mhz */ actual_dispclk_set_mhz = rn_vbios_smu_send_msg_with_param(
@@ -91,7 +91,7 @@ int rn_vbios_smu_set_dispclk(struct clk_mgr_internal *clk_mgr, int requested_dis VBIOSSMC_MSG_SetDispclkFreq, requested_dispclk_khz / 1000); -if (!IS_FPGA_MAXIMUS_DC (core_dc->ctx->dce_environment)) { +if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) {if (dmcu && dmcu->funcs->is_dmcu_initialized (dmcu)) {if (clk_mgr->dfs_bypass_disp_clk != actual_dispclk_set_mhz) dmcu->funcs->set_psr_wait_loop(dmcu,
drivers/gpu/drm/amd/display/dc/core/dc_debug.c +3 -4
@@ -310,14 +310,13 @@ void context_timing_trace( struct resource_context *res_ctx) {int i; -struct dc *core_dc = dc;int h_pos[MAX_PIPES ] = {0 }, v_pos[MAX_PIPES ] = {0 };struct crtc_position position; -unsigned int underlay_idx = core_dc->res_pool->underlay_pipe_index; +unsigned int underlay_idx = dc->res_pool->underlay_pipe_index;DC_LOGGER_INIT (dc->ctx->logger); -for (i =0 ; i < core_dc->res_pool->pipe_count; i++) { +for (i =0 ; i < dc->res_pool->pipe_count; i++) {struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i];/* get_position() returns CRTC vertical/horizontal counter * hence not applicable for underlay pipe
@@ -329,7 +328,7 @@ void context_timing_trace( h_pos[i] = position.horizontal_count; v_pos[i] = position.vertical_count; } -for (i =0 ; i < core_dc->res_pool->pipe_count; i++) { +for (i =0 ; i < dc->res_pool->pipe_count; i++) {struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i];if (pipe_ctx->stream ==NULL || pipe_ctx->pipe_idx == underlay_idx)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +32 -33
207 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c +13 -13
@@ -95,8 +95,8 @@ void dp_enable_link_phy( const struct dc_link_settings *link_settings) {struct link_encoder *link_enc = link->link_enc; -struct dc *core_dc = link->ctx->dc; -struct dmcu *dmcu = core_dc->res_pool->dmcu; +struct dc *dc = link->ctx->dc; +struct dmcu *dmcu = dc->res_pool->dmcu;struct pipe_ctx *pipes = link->dc->current_state->res_ctx.pipe_ctx;
@@ -200,8 +200,8 @@ bool edp_receiver_ready_T7(struct dc_link *link)void dp_disable_link_phy (struct dc_link *link,enum signal_type signal) { -struct dc *core_dc = link->ctx->dc; -struct dmcu *dmcu = core_dc->res_pool->dmcu; +struct dc *dc = link->ctx->dc; +struct dmcu *dmcu = dc->res_pool->dmcu;if (!link->wa_flags.dp_keep_receiver_powered)dp_receiver_power_ctrl (link, false);
@@ -395,14 +395,14 @@ static void dsc_optc_config_log(struct display_stream_compressor *dsc,static bool dp_set_dsc_on_rx (struct pipe_ctx *pipe_ctx,bool enable) { -struct dc *core_dc = pipe_ctx->stream->ctx->dc; +struct dc *dc = pipe_ctx->stream->ctx->dc;struct dc_stream_state *stream = pipe_ctx->stream;bool result = false; -if (IS_FPGA_MAXIMUS_DC (core_dc->ctx->dce_environment)) +if (IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) result = true;else - result =dm_helpers_dp_write_dsc_enable (core_dc->ctx, stream, enable); + result =dm_helpers_dp_write_dsc_enable (dc->ctx, stream, enable);return result; }
@@ -412,7 +412,7 @@ static bool dp_set_dsc_on_rx(struct pipe_ctx *pipe_ctx, bool enable)void dp_set_dsc_on_stream (struct pipe_ctx *pipe_ctx,bool enable) {struct display_stream_compressor *dsc = pipe_ctx->stream_res.dsc; -struct dc *core_dc = pipe_ctx->stream->ctx->dc; +struct dc *dc = pipe_ctx->stream->ctx->dc;struct dc_stream_state *stream = pipe_ctx->stream;struct pipe_ctx *odm_pipe;int opp_cnt =1 ;
@@ -448,7 +448,7 @@ void dp_set_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable) optc_dsc_mode = dsc_optc_cfg.is_pixel_format_444 ?OPTC_DSC_ENABLED_444 :OPTC_DSC_ENABLED_NATIVE_SUBSAMPLED ;/* Enable DSC in encoder */ -if (dc_is_dp_signal (stream->signal) && !IS_FPGA_MAXIMUS_DC (core_dc->ctx->dce_environment)) { +if (dc_is_dp_signal (stream->signal) && !IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) {DC_LOG_DSC ("Setting stream encoder DSC config for engine %d:" , (int )pipe_ctx->stream_res.stream_enc->id);dsc_optc_config_log (dsc, &dsc_optc_cfg); pipe_ctx->stream_res.stream_enc->funcs->dp_set_dsc_config(pipe_ctx->stream_res.stream_enc,
@@ -473,7 +473,7 @@ void dp_set_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable) OPTC_DSC_DISABLED, 0, 0);/* disable DSC in stream encoder */ -if (dc_is_dp_signal (stream->signal) && !IS_FPGA_MAXIMUS_DC (core_dc->ctx->dce_environment)) { +if (dc_is_dp_signal (stream->signal) && !IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { pipe_ctx->stream_res.stream_enc->funcs->dp_set_dsc_config ( pipe_ctx->stream_res.stream_enc,OPTC_DSC_DISABLED ,0 ,0 );
@@ -516,7 +516,7 @@ bool dp_set_dsc_enable(struct pipe_ctx *pipe_ctx, bool enable)bool dp_set_dsc_pps_sdp (struct pipe_ctx *pipe_ctx,bool enable) {struct display_stream_compressor *dsc = pipe_ctx->stream_res.dsc; -struct dc *core_dc = pipe_ctx->stream->ctx->dc; +struct dc *dc = pipe_ctx->stream->ctx->dc;struct dc_stream_state *stream = pipe_ctx->stream;if (!pipe_ctx->stream->timing.flags.DSC || !dsc)
@@ -535,7 +535,7 @@ bool dp_set_dsc_pps_sdp(struct pipe_ctx *pipe_ctx, bool enable)DC_LOG_DSC (" " ); dsc->funcs->dsc_get_packed_pps (dsc, &dsc_cfg, &dsc_packed_pps[0 ]); -if (dc_is_dp_signal (stream->signal) && !IS_FPGA_MAXIMUS_DC (core_dc->ctx->dce_environment)) { +if (dc_is_dp_signal (stream->signal) && !IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) {DC_LOG_DSC ("Setting stream encoder DSC PPS SDP for engine %d\n" , (int )pipe_ctx->stream_res.stream_enc->id); pipe_ctx->stream_res.stream_enc->funcs->dp_set_dsc_pps_info_packet( pipe_ctx->stream_res.stream_enc,
@@ -544,7 +544,7 @@ bool dp_set_dsc_pps_sdp(struct pipe_ctx *pipe_ctx, bool enable) } }else {/* disable DSC PPS in stream encoder */ -if (dc_is_dp_signal (stream->signal) && !IS_FPGA_MAXIMUS_DC (core_dc->ctx->dce_environment)) { +if (dc_is_dp_signal (stream->signal) && !IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { pipe_ctx->stream_res.stream_enc->funcs->dp_set_dsc_pps_info_packet ( pipe_ctx->stream_res.stream_enc, false,NULL ); }
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1 -2
@@ -2747,9 +2747,8 @@ void resource_build_bit_depth_reduction_params(struct dc_stream_state *stream,enum dc_status dc_validate_stream (struct dc *dc,struct dc_stream_state *stream) { -struct dc *core_dc = dc;struct dc_link *link = stream->link; -struct timing_generator *tg = core_dc->res_pool->timing_generators[0 ]; +struct timing_generator *tg = dc->res_pool->timing_generators[0 ];enum dc_status res =DC_OK ;calculate_phy_pix_clks (stream);
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +20 -20
@@ -271,7 +271,7 @@ bool dc_stream_set_cursor_attributes( const struct dc_cursor_attributes *attributes) {int i; -struct dc *core_dc; +struct dc *dc;struct resource_context *res_ctx;struct pipe_ctx *pipe_to_program =NULL ;
@@ -289,8 +289,8 @@ bool dc_stream_set_cursor_attributes(return false; } - core_dc = stream->ctx->dc; - res_ctx = &core_dc->current_state->res_ctx; + dc = stream->ctx->dc; + res_ctx = &dc->current_state->res_ctx; stream->cursor_attributes = *attributes;for (i =0 ; i <MAX_PIPES ; i++) {
@@ -302,17 +302,17 @@ bool dc_stream_set_cursor_attributes(if (!pipe_to_program) { pipe_to_program = pipe_ctx; -delay_cursor_until_vupdate (pipe_ctx, core_dc); - core_dc->hwss.pipe_control_lock (core_dc, pipe_to_program, true); +delay_cursor_until_vupdate (pipe_ctx, dc); + dc->hwss.pipe_control_lock (dc, pipe_to_program, true); } - core_dc->hwss.set_cursor_attribute (pipe_ctx); -if (core_dc->hwss.set_cursor_sdr_white_level) - core_dc->hwss.set_cursor_sdr_white_level (pipe_ctx); + dc->hwss.set_cursor_attribute (pipe_ctx); +if (dc->hwss.set_cursor_sdr_white_level) + dc->hwss.set_cursor_sdr_white_level (pipe_ctx); }if (pipe_to_program) - core_dc->hwss.pipe_control_lock (core_dc, pipe_to_program, false); + dc->hwss.pipe_control_lock (dc, pipe_to_program, false);return true; }
@@ -322,7 +322,7 @@ bool dc_stream_set_cursor_position( const struct dc_cursor_position *position) {int i; -struct dc *core_dc; +struct dc *dc;struct resource_context *res_ctx;struct pipe_ctx *pipe_to_program =NULL ;
@@ -336,8 +336,8 @@ bool dc_stream_set_cursor_position(return false; } - core_dc = stream->ctx->dc; - res_ctx = &core_dc->current_state->res_ctx; + dc = stream->ctx->dc; + res_ctx = &dc->current_state->res_ctx; stream->cursor_position = *position;for (i =0 ; i <MAX_PIPES ; i++) {
@@ -353,15 +353,15 @@ bool dc_stream_set_cursor_position(if (!pipe_to_program) { pipe_to_program = pipe_ctx; -delay_cursor_until_vupdate (pipe_ctx, core_dc); - core_dc->hwss.pipe_control_lock (core_dc, pipe_to_program, true); +delay_cursor_until_vupdate (pipe_ctx, dc); + dc->hwss.pipe_control_lock (dc, pipe_to_program, true); } - core_dc->hwss.set_cursor_position (pipe_ctx); + dc->hwss.set_cursor_position (pipe_ctx); }if (pipe_to_program) - core_dc->hwss.pipe_control_lock (core_dc, pipe_to_program, false); + dc->hwss.pipe_control_lock (dc, pipe_to_program, false);return true; }
@@ -482,9 +482,9 @@ bool dc_stream_remove_writeback(struct dc *dc,uint32_t dc_stream_get_vblank_counter (const struct dc_stream_state *stream) {uint8_t i; -struct dc *core_dc = stream->ctx->dc; +struct dc *dc = stream->ctx->dc;struct resource_context *res_ctx = - &core_dc->current_state->res_ctx; + &dc->current_state->res_ctx;for (i =0 ; i <MAX_PIPES ; i++) {struct timing_generator *tg = res_ctx->pipe_ctx[i].stream_res.tg;
@@ -541,9 +541,9 @@ bool dc_stream_get_scanoutpos(const struct dc_stream_state *stream, {uint8_t i;bool ret = false; -struct dc *core_dc = stream->ctx->dc; +struct dc *dc = stream->ctx->dc;struct resource_context *res_ctx = - &core_dc->current_state->res_ctx; + &dc->current_state->res_ctx;for (i =0 ; i <MAX_PIPES ; i++) {struct timing_generator *tg = res_ctx->pipe_ctx[i].stream_res.tg;
drivers/gpu/drm/amd/display/dc/core/dc_surface.c +10 -12
@@ -108,16 +108,14 @@ void enable_surface_flip_reporting(struct dc_plane_state *plane_state,struct dc_plane_state *dc_create_plane_state (struct dc *dc) { -struct dc *core_dc = dc; -struct dc_plane_state *plane_state =kvzalloc (sizeof (*plane_state), -GFP_KERNEL ); +GFP_KERNEL );if (NULL == plane_state)return NULL ;kref_init (&plane_state->refcount); -dc_plane_construct (core_dc->ctx, plane_state); +dc_plane_construct (dc->ctx, plane_state);return plane_state; }
@@ -137,7 +135,7 @@ const struct dc_plane_status *dc_plane_get_status( const struct dc_plane_state *plane_state) {const struct dc_plane_status *plane_status; -struct dc *core_dc; +struct dc *dc;int i; if (!plane_state ||
@@ -148,15 +146,15 @@ const struct dc_plane_status *dc_plane_get_status( } plane_status = &plane_state->status; - core_dc = plane_state->ctx->dc; + dc = plane_state->ctx->dc; -if (core_dc->current_state ==NULL ) +if (dc->current_state ==NULL )return NULL ;/* Find the current plane state and set its pending bit to false */ -for (i =0 ; i < core_dc->res_pool->pipe_count; i++) { +for (i =0 ; i < dc->res_pool->pipe_count; i++) {struct pipe_ctx *pipe_ctx = - &core_dc->current_state->res_ctx.pipe_ctx[i]; + &dc->current_state->res_ctx.pipe_ctx[i];if (pipe_ctx->plane_state != plane_state)continue ;
@@ -166,14 +164,14 @@ const struct dc_plane_status *dc_plane_get_status(break ; } -for (i =0 ; i < core_dc->res_pool->pipe_count; i++) { +for (i =0 ; i < dc->res_pool->pipe_count; i++) {struct pipe_ctx *pipe_ctx = - &core_dc->current_state->res_ctx.pipe_ctx[i]; + &dc->current_state->res_ctx.pipe_ctx[i];if (pipe_ctx->plane_state != plane_state)continue ; - core_dc->hwss.update_pending_status (pipe_ctx); + dc->hwss.update_pending_status (pipe_ctx); }return plane_status;
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +4 -4
@@ -945,15 +945,15 @@ void dce110_edp_backlight_control(void dce110_enable_audio_stream (struct pipe_ctx *pipe_ctx) {/* notify audio driver for audio modes of monitor */ -struct dc *core_dc; +struct dc *dc;struct clk_mgr *clk_mgr;unsigned int i, num_audio =1 ;if (!pipe_ctx->stream)return ; - core_dc = pipe_ctx->stream->ctx->dc; - clk_mgr = core_dc->clk_mgr; + dc = pipe_ctx->stream->ctx->dc; + clk_mgr = dc->clk_mgr;if (pipe_ctx->stream_res.audio && pipe_ctx->stream_res.audio->enabled == true)return ;
@@ -961,7 +961,7 @@ void dce110_enable_audio_stream(struct pipe_ctx *pipe_ctx)if (pipe_ctx->stream_res.audio) {for (i =0 ; i <MAX_PIPES ; i++) {/*current_state not updated yet*/ -if (core_dc->current_state->res_ctx.pipe_ctx[i].stream_res.audio !=NULL ) +if (dc->current_state->res_ctx.pipe_ctx[i].stream_res.audio !=NULL ) num_audio++; }
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +5 -5
@@ -1655,10 +1655,10 @@ void dcn10_enable_per_frame_crtc_position_reset( }/*static void print_rq_dlg_ttu( -struct dc *core_dc, +struct dc *dc, struct pipe_ctx *pipe_ctx) { -DC_LOG_BANDWIDTH_CALCS(core_dc->ctx->logger, +DC_LOG_BANDWIDTH_CALCS(dc->ctx->logger, "\n============== DML TTU Output parameters [%d] ==============\n" "qos_level_low_wm: %d, \n" "qos_level_high_wm: %d, \n"
@@ -1688,7 +1688,7 @@ void dcn10_enable_per_frame_crtc_position_reset( pipe_ctx->ttu_regs.refcyc_per_req_delivery_pre_c ); -DC_LOG_BANDWIDTH_CALCS (core_dc->ctx->logger, +DC_LOG_BANDWIDTH_CALCS (dc->ctx->logger,"\n============== DML DLG Output parameters [%d] ==============\n" "refcyc_h_blank_end: %d, \n" "dlg_vblank_end: %d, \n"
@@ -1723,7 +1723,7 @@ void dcn10_enable_per_frame_crtc_position_reset( pipe_ctx->dlg_regs.refcyc_per_pte_group_nom_l ); -DC_LOG_BANDWIDTH_CALCS (core_dc->ctx->logger, +DC_LOG_BANDWIDTH_CALCS (dc->ctx->logger,"\ndst_y_per_meta_row_nom_l: %d, \n" "refcyc_per_meta_chunk_nom_l: %d, \n" "refcyc_per_line_delivery_pre_l: %d, \n"
@@ -1753,7 +1753,7 @@ void dcn10_enable_per_frame_crtc_position_reset( pipe_ctx->dlg_regs.refcyc_per_line_delivery_c ); -DC_LOG_BANDWIDTH_CALCS (core_dc->ctx->logger, +DC_LOG_BANDWIDTH_CALCS (dc->ctx->logger,"\n============== DML RQ Output parameters [%d] ==============\n" "chunk_size: %d \n" "min_chunk_size: %d \n"
drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c +2 -2
@@ -204,7 +204,7 @@ bool dce110_vblank_set(struct irq_service *irq_service, bool enable) {struct dc_context *dc_ctx = irq_service->ctx; -struct dc *core_dc = irq_service->ctx->dc; +struct dc *dc = irq_service->ctx->dc;enum dc_irq_source dal_irq_src = dc_interrupt_to_irq_source(irq_service->ctx->dc, info->src_id,
@@ -212,7 +212,7 @@ bool dce110_vblank_set(struct irq_service *irq_service,uint8_t pipe_offset = dal_irq_src -IRQ_TYPE_VBLANK ;struct timing_generator *tg = - core_dc->current_state->res_ctx.pipe_ctx[pipe_offset].stream_res.tg; + dc->current_state->res_ctx.pipe_ctx[pipe_offset].stream_res.tg;if (enable) {if (!tg || !tg->funcs->arm_vert_intr (tg,2 )) {
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 3/51 drm/amd/display: add separate of private hwss functions
In reply to [email protected]From: Anthony Koo <[email protected]>
[Why]
Some function pointers in the hwss function pointer table are meant to be hw sequencer entry points to be called from dc.
However some of those function pointers are not meant to be entry points, but instead used as a code reuse/inheritance tool called directly by other hwss functions, not by dc.
Therefore, we want a more clear separation of which functions we determine to be interface functions vs the functions we use within hwss.
[How]
DC interface functions will be stored in:
struct hw_sequencer_funcs
Functions used within HWSS will be stored in:
struct hwseq_private_funcs
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 6 + .../gpu/drm/amd/display/dc/core/dc_debug.c | 1 - .../gpu/drm/amd/display/dc/core/dc_stream.c | 3 - .../gpu/drm/amd/display/dc/dce/dce_hwseq.c | 2 +- .../gpu/drm/amd/display/dc/dce/dce_hwseq.h | 6 +- .../display/dc/dce100/dce100_hw_sequencer.c | 3 +- .../display/dc/dce100/dce100_hw_sequencer.h | 1 + .../display/dc/dce110/dce110_hw_sequencer.c | 77 ++-- .../display/dc/dce110/dce110_hw_sequencer.h | 1 + .../amd/display/dc/dce110/dce110_resource.c | 3 +- .../display/dc/dce112/dce112_hw_sequencer.c | 2 +- .../display/dc/dce112/dce112_hw_sequencer.h | 1 + .../display/dc/dce120/dce120_hw_sequencer.c | 2 +- .../display/dc/dce120/dce120_hw_sequencer.h | 1 + .../amd/display/dc/dce80/dce80_hw_sequencer.c | 2 +- .../amd/display/dc/dce80/dce80_hw_sequencer.h | 1 + .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 124 +++--- .../amd/display/dc/dcn10/dcn10_hw_sequencer.h | 1 + .../gpu/drm/amd/display/dc/dcn10/dcn10_init.c | 38 +- .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 71 ++-- .../drm/amd/display/dc/dcn20/dcn20_hwseq.h | 3 + .../gpu/drm/amd/display/dc/dcn20/dcn20_init.c | 54 +-- .../drm/amd/display/dc/dcn21/dcn21_hwseq.c | 1 + .../drm/amd/display/dc/dcn21/dcn21_hwseq.h | 2 + .../gpu/drm/amd/display/dc/dcn21/dcn21_init.c | 63 +-- .../gpu/drm/amd/display/dc/inc/hw_sequencer.h | 370 +++++------------- .../amd/display/dc/inc/hw_sequencer_private.h | 156 ++++++++ 27 files changed, 525 insertions(+), 470 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/inc/hw_sequencer_private.h
drivers/gpu/drm/amd/display/dc/core/dc.c +6 -0
@@ -2004,6 +2004,12 @@ static void commit_planes_do_stream_update(struct dc *dc, dc->hwss.update_info_frame (pipe_ctx); } +if (stream_update->hdr_static_metadata && + stream->use_dynamic_meta && + dc->hwss.set_dmdata_attributes && + pipe_ctx->stream->dmdata_address.quad_part !=0 ) + dc->hwss.set_dmdata_attributes (pipe_ctx); +if (stream_update->gamut_remap)dc_stream_set_gamut_remap (dc, stream);
drivers/gpu/drm/amd/display/dc/core/dc_debug.c +0 -1
@@ -33,7 +33,6 @@#include "core_status.h" #include "core_types.h" -#include "hw_sequencer.h" #include "resource.h"
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +0 -3
@@ -33,9 +33,6 @@#include "resource.h" #include "ipp.h" #include "timing_generator.h" -#if defined(CONFIG_DRM_AMD_DC_DCN ) -#include "dcn10/dcn10_hw_sequencer.h" -#endif #define DC_LOGGER dc->ctx->logger
drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.c +1 -1
@@ -25,7 +25,7 @@#include "dce_hwseq.h" #include "reg_helper.h" -#include "hw_sequencer.h" +#include "hw_sequencer_private.h" #include "core_types.h" #define CTX \
drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h +5 -1
@@ -25,7 +25,7 @@#ifndef __DCE_HWSEQ_H__#define __DCE_HWSEQ_H__ -#include "hw_sequencer.h" +#include "dc_types.h" #define BL_REG_LIST ()\ SR(LVTMA_PWRSEQ_CNTL), \
@@ -811,6 +811,10 @@ enum blnd_mode { BLND_MODE_BLENDING,/* Alpha blending - blend 'current' and 'other' */ }; +struct dce_hwseq ; +struct pipe_ctx ; +struct clock_source ; +void dce_enable_fe_clock (struct dce_hwseq *hwss,unsigned int inst,bool enable);
drivers/gpu/drm/amd/display/dc/dce100/dce100_hw_sequencer.c +1 -2
@@ -26,7 +26,6 @@#include "dc.h" #include "core_types.h" #include "clk_mgr.h" -#include "hw_sequencer.h" #include "dce100_hw_sequencer.h" #include "resource.h"
@@ -136,7 +135,7 @@ void dce100_hw_sequencer_construct(struct dc *dc) {dce110_hw_sequencer_construct (dc); - dc->hwss.enable_display_power_gating = dce100_enable_display_power_gating; + dc->hwseq->funcs.enable_display_power_gating = dce100_enable_display_power_gating; dc->hwss.prepare_bandwidth = dce100_prepare_bandwidth; dc->hwss.optimize_bandwidth = dce100_optimize_bandwidth; }
drivers/gpu/drm/amd/display/dc/dce100/dce100_hw_sequencer.h +1 -0
@@ -27,6 +27,7 @@#define __DC_HWSS_DCE100_H__#include "core_types.h" +#include "hw_sequencer_private.h" struct dc ;struct dc_state ;
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +45 -32
231 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.h +1 -0
@@ -27,6 +27,7 @@#define __DC_HWSS_DCE110_H__#include "core_types.h" +#include "hw_sequencer_private.h" struct dc ;struct dc_state ;
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +2 -1
@@ -1097,6 +1097,7 @@ static struct pipe_ctx *dce110_acquire_underlay( struct dc_stream_state *stream) {struct dc *dc = stream->ctx->dc; +struct dce_hwseq *hws = dc->hwseq;struct resource_context *res_ctx = &context->res_ctx;unsigned int underlay_idx = pool->underlay_pipe_index;struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[underlay_idx];
@@ -1117,7 +1118,7 @@ static struct pipe_ctx *dce110_acquire_underlay(struct tg_color black_color = {0 };struct dc_bios *dcb = dc->ctx->dc_bios; - dc->hwss.enable_display_power_gating ( + hws->funcs.enable_display_power_gating ( dc, pipe_ctx->stream_res.tg->inst, dcb,PIPE_GATING_CONTROL_DISABLE );
drivers/gpu/drm/amd/display/dc/dce112/dce112_hw_sequencer.c +1 -1
@@ -158,6 +158,6 @@ void dce112_hw_sequencer_construct(struct dc *dc)* structure */ dce110_hw_sequencer_construct (dc); - dc->hwss.enable_display_power_gating = dce112_enable_display_power_gating; + dc->hwseq->funcs.enable_display_power_gating = dce112_enable_display_power_gating; }
drivers/gpu/drm/amd/display/dc/dce112/dce112_hw_sequencer.h +1 -0
@@ -27,6 +27,7 @@#define __DC_HWSS_DCE112_H__#include "core_types.h" +#include "hw_sequencer_private.h" struct dc ;
drivers/gpu/drm/amd/display/dc/dce120/dce120_hw_sequencer.c +1 -1
@@ -265,7 +265,7 @@ void dce120_hw_sequencer_construct(struct dc *dc)* structure */ dce110_hw_sequencer_construct (dc); - dc->hwss.enable_display_power_gating = dce120_enable_display_power_gating; + dc->hwseq->funcs.enable_display_power_gating = dce120_enable_display_power_gating; dc->hwss.update_dchub = dce120_update_dchub; }
drivers/gpu/drm/amd/display/dc/dce120/dce120_hw_sequencer.h +1 -0
@@ -27,6 +27,7 @@#define __DC_HWSS_DCE120_H__#include "core_types.h" +#include "hw_sequencer_private.h" struct dc ;
drivers/gpu/drm/amd/display/dc/dce80/dce80_hw_sequencer.c +1 -1
@@ -74,7 +74,7 @@ void dce80_hw_sequencer_construct(struct dc *dc) {dce110_hw_sequencer_construct (dc); - dc->hwss.enable_display_power_gating = dce100_enable_display_power_gating; + dc->hwseq->funcs.enable_display_power_gating = dce100_enable_display_power_gating; dc->hwss.pipe_control_lock = dce_pipe_control_lock; dc->hwss.prepare_bandwidth = dce100_prepare_bandwidth; dc->hwss.optimize_bandwidth = dce100_optimize_bandwidth;
drivers/gpu/drm/amd/display/dc/dce80/dce80_hw_sequencer.h +1 -0
@@ -27,6 +27,7 @@#define __DC_HWSS_DCE80_H__#include "core_types.h" +#include "hw_sequencer_private.h" struct dc ;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +72 -52
443 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h +1 -0
@@ -27,6 +27,7 @@#define __DC_HWSS_DCN10_H__#include "core_types.h" +#include "hw_sequencer_private.h" struct dc ;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_init.c +22 -16
@@ -23,25 +23,19 @@* */ +#include "hw_sequencer_private.h" #include "dce110/dce110_hw_sequencer.h" #include "dcn10_hw_sequencer.h" static const struct hw_sequencer_funcs dcn10_funcs = { .program_gamut_remap = dcn10_program_gamut_remap, .init_hw = dcn10_init_hw, - .init_pipes = dcn10_init_pipes, .apply_ctx_to_hw = dce110_apply_ctx_to_hw, .apply_ctx_for_surface = dcn10_apply_ctx_for_surface, .update_plane_addr = dcn10_update_plane_addr, - .plane_atomic_disconnect = dcn10_plane_atomic_disconnect, - .program_pipe = dcn10_program_pipe, .update_dchub = dcn10_update_dchub, - .update_mpcc = dcn10_update_mpcc, .update_pending_status = dcn10_update_pending_status, - .set_input_transfer_func = dcn10_set_input_transfer_func, - .set_output_transfer_func = dcn10_set_output_transfer_func, .program_output_csc = dcn10_program_output_csc, - .power_down = dce110_power_down, .enable_accelerated_mode = dce110_enable_accelerated_mode, .enable_timing_synchronization = dcn10_enable_timing_synchronization, .enable_per_frame_crtc_position_reset = dcn10_enable_per_frame_crtc_position_reset,
@@ -53,14 +47,10 @@ static const struct hw_sequencer_funcs dcn10_funcs = { .blank_stream = dce110_blank_stream, .enable_audio_stream = dce110_enable_audio_stream, .disable_audio_stream = dce110_disable_audio_stream, - .enable_display_power_gating = dcn10_dummy_display_power_gating, .disable_plane = dcn10_disable_plane, - .blank_pixel_data = dcn10_blank_pixel_data, .pipe_control_lock = dcn10_pipe_control_lock, .prepare_bandwidth = dcn10_prepare_bandwidth, .optimize_bandwidth = dcn10_optimize_bandwidth, - .reset_hw_ctx_wrap = dcn10_reset_hw_ctx_wrap, - .enable_stream_timing = dcn10_enable_stream_timing, .set_drr = dcn10_set_drr, .get_position = dcn10_get_position, .set_static_screen_control = dcn10_set_static_screen_control,
@@ -70,18 +60,34 @@ static const struct hw_sequencer_funcs dcn10_funcs = { .get_hw_state = dcn10_get_hw_state, .clear_status_bits = dcn10_clear_status_bits, .wait_for_mpcc_disconnect = dcn10_wait_for_mpcc_disconnect, - .edp_backlight_control = dce110_edp_backlight_control, .edp_power_control = dce110_edp_power_control, .edp_wait_for_hpd_ready = dce110_edp_wait_for_hpd_ready, .set_cursor_position = dcn10_set_cursor_position, .set_cursor_attribute = dcn10_set_cursor_attribute, .set_cursor_sdr_white_level = dcn10_set_cursor_sdr_white_level, - .disable_stream_gating = NULL, - .enable_stream_gating = NULL, .setup_periodic_interrupt = dcn10_setup_periodic_interrupt, - .setup_vupdate_interrupt = dcn10_setup_vupdate_interrupt, .set_clock = dcn10_set_clock, .get_clock = dcn10_get_clock, + .get_vupdate_offset_from_vsync = dcn10_get_vupdate_offset_from_vsync, +}; + +static const struct hwseq_private_funcs dcn10_private_funcs = { + .init_pipes = dcn10_init_pipes, + .update_plane_addr = dcn10_update_plane_addr, + .plane_atomic_disconnect = dcn10_plane_atomic_disconnect, + .program_pipe = dcn10_program_pipe, + .update_mpcc = dcn10_update_mpcc, + .set_input_transfer_func = dcn10_set_input_transfer_func, + .set_output_transfer_func = dcn10_set_output_transfer_func, + .power_down = dce110_power_down, + .enable_display_power_gating = dcn10_dummy_display_power_gating, + .blank_pixel_data = dcn10_blank_pixel_data, + .reset_hw_ctx_wrap = dcn10_reset_hw_ctx_wrap, + .enable_stream_timing = dcn10_enable_stream_timing, + .edp_backlight_control = dce110_edp_backlight_control, + .disable_stream_gating =NULL , + .enable_stream_gating =NULL , + .setup_vupdate_interrupt = dcn10_setup_vupdate_interrupt, .did_underflow_occur = dcn10_did_underflow_occur, .init_blank =NULL , .disable_vga = dcn10_disable_vga,
@@ -96,10 +102,10 @@ static const struct hw_sequencer_funcs dcn10_funcs = { .get_hdr_visual_confirm_color = dcn10_get_hdr_visual_confirm_color, .set_hdr_multiplier = dcn10_set_hdr_multiplier, .verify_allow_pstate_change_high = dcn10_verify_allow_pstate_change_high, - .get_vupdate_offset_from_vsync = dcn10_get_vupdate_offset_from_vsync, };void dcn10_hw_sequencer_construct (struct dc *dc) { dc->hwss = dcn10_funcs; + dc->hwseq->funcs = dcn10_private_funcs; }
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +41 -30
268 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.h +3 -0
@@ -26,6 +26,8 @@#ifndef __DC_HWSS_DCN20_H__#define __DC_HWSS_DCN20_H__ +#include "hw_sequencer_private.h" +bool dcn20_set_blend_lut (struct pipe_ctx *pipe_ctx,const struct dc_plane_state *plane_state); bool dcn20_set_shaper_3dlut(
@@ -111,6 +113,7 @@ void dcn20_disable_writeback(void dcn20_update_odm (struct dc *dc,struct dc_state *context,struct pipe_ctx *pipe_ctx);bool dcn20_dmdata_status_done (struct pipe_ctx *pipe_ctx);void dcn20_program_dmdata_engine (struct pipe_ctx *pipe_ctx); +void dcn20_set_dmdata_attributes (struct pipe_ctx *pipe_ctx); void dcn20_init_vm_ctx( struct dce_hwseq *hws, struct dc *dc,
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_init.c +30 -24
113 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c +1 -0
@@ -28,6 +28,7 @@#include "core_types.h" #include "resource.h" #include "dce/dce_hwseq.h" +#include "dcn21_hwseq.h" #include "vmid.h" #include "reg_helper.h" #include "hw/clk_mgr.h"
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.h +2 -0
@@ -26,6 +26,8 @@#ifndef __DC_HWSS_DCN21_H__#define __DC_HWSS_DCN21_H__ +#include "hw_sequencer_private.h" +struct dc ; int dcn21_init_sys_ctx(struct dce_hwseq *hws,
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_init.c +37 -26
126 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +92 -278
431 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer_private.h new file +156 -0
156 lines not on this page · raw message
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 4/51 drm/amd/display: Fix Dali clk mgr construct
In reply to [email protected]From: Michael Strauss <[email protected]>
[WHY]
Dali is currently being misinterpreted as Renoir,
as a result uses wrong clk mgr constructor
[HOW]
Add check to init Dali as Raven2 before it can be misidentified Clean up & fix Raven2 & Dali ASIC checks
--- drivers/gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c | 7 +++++++ drivers/gpu/drm/amd/display/include/dal_asic_id.h | 12 +++++------- 2 files changed, 12 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c +7 -0
@@ -134,6 +134,13 @@ struct clk_mgr *dc_clk_mgr_create(struct dc_context *ctx, struct pp_smu_funcs *p#if defined(CONFIG_DRM_AMD_DC_DCN )case FAMILY_RV : +if (ASICREV_IS_DALI (asic_id.hw_internal_rev)) { +/* TEMP: this check has to come before ASICREV_IS_RENOIR */ +/* which also incorrectly returns true for Dali */ +rv2_clk_mgr_construct (ctx, clk_mgr, pp_smu); +break ; + } +if (ASICREV_IS_RENOIR (asic_id.hw_internal_rev)) {rn_clk_mgr_construct (ctx, clk_mgr, pp_smu, dccg);break ;
drivers/gpu/drm/amd/display/include/dal_asic_id.h +5 -7
@@ -134,19 +134,17 @@#define PICASSO_A0 0x41/* DCN1_01 */ #define RAVEN2_A0 0x81 +#define RAVEN2_15D8_REV_E3 0xE3 +#define RAVEN2_15D8_REV_E4 0xE4#define RAVEN1_F0 0xF0#define RAVEN_UNKNOWN 0xFF -#define PICASSO_15D8_REV_E3 0xE3 -#define PICASSO_15D8_REV_E4 0xE4 -#define ASICREV_IS_RAVEN (eChipRev) ((eChipRev >= RAVEN_A0) && eChipRev < RAVEN_UNKNOWN)#define ASICREV_IS_PICASSO (eChipRev) ((eChipRev >= PICASSO_A0) && (eChipRev < RAVEN2_A0)) -#define ASICREV_IS_RAVEN2 (eChipRev) ((eChipRev >= RAVEN2_A0) && (eChipRev < PICASSO_15D8_REV_E3)) -#define ASICREV_IS_DALI (eChipRev) ((eChipRev >= PICASSO_15D8_REV_E3) && (eChipRev < RAVEN1_F0)) - +#define ASICREV_IS_RAVEN2 (eChipRev) ((eChipRev >= RAVEN2_A0) && (eChipRev < RAVEN1_F0))#define ASICREV_IS_RV1_F0 (eChipRev) ((eChipRev >= RAVEN1_F0) && (eChipRev < RAVEN_UNKNOWN)) - +#define ASICREV_IS_DALI (eChipRev) ((eChipRev == RAVEN2_15D8_REV_E3) \ + || (eChipRev == RAVEN2_15D8_REV_E4))#define FAMILY_RV 142/* DCN 1*/
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 5/51 drm/amd/display: Map DSC resources 1-to-1 if numbers of OPPs and DSCs are equal
In reply to [email protected]From: Nikola Cornij <[email protected]>
[why]
On ASICs where number of DSCs is the same as OPPs there's no need for DSC resource management. Mappping 1-to-1 fixes mode-set- or S3- -related issues for such platforms.
[how]
Map DSC resources 1-to-1 to pipes only if number of OPPs is the same as number of DSCs. This will still keep other ASICs working. A follow-up patch to fix mode-set issues on those ASICs will be required if testing shows issues with mode set.
--- .../gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +10 -3
@@ -1458,13 +1458,20 @@ enum dc_status dcn20_build_mapped_resource(const struct dc *dc, struct dc_statestatic void acquire_dsc (struct resource_context *res_ctx,const struct resource_pool *pool, -struct display_stream_compressor **dsc) +struct display_stream_compressor **dsc, +int pipe_idx) {int i;ASSERT (*dsc ==NULL ); *dsc =NULL ; +if (pool->res_cap->num_dsc == pool->res_cap->num_opp) { + *dsc = pool->dscs[pipe_idx]; + res_ctx->is_dsc_acquired[pipe_idx] = true; +return ; + } +/* Find first free DSC */ for (i =0 ; i < pool->res_cap->num_dsc; i++)if (!res_ctx->is_dsc_acquired[i]) {
@@ -1505,7 +1512,7 @@ static enum dc_status add_dsc_to_stream_resource(struct dc *dc,if (pipe_ctx->stream != dc_stream)continue ; -acquire_dsc (&dc_ctx->res_ctx, pool, &pipe_ctx->stream_res.dsc); +acquire_dsc (&dc_ctx->res_ctx, pool, &pipe_ctx->stream_res.dsc, i);/* The number of DSCs can be less than the number of pipes */ if (!pipe_ctx->stream_res.dsc) {
@@ -1697,7 +1704,7 @@ bool dcn20_split_stream_for_odm( } next_odm_pipe->stream_res.opp = pool->opps[next_odm_pipe->pipe_idx];if (next_odm_pipe->stream->timing.flags.DSC ==1 ) { -acquire_dsc (res_ctx, pool, &next_odm_pipe->stream_res.dsc); +acquire_dsc (res_ctx, pool, &next_odm_pipe->stream_res.dsc, next_odm_pipe->pipe_idx);ASSERT (next_odm_pipe->stream_res.dsc);if (next_odm_pipe->stream_res.dsc ==NULL )return false;
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 6/51 drm/amd/display: fix DalDramClockChangeLatencyNs override
In reply to [email protected]From: Joseph Gravenor <[email protected]>
[why]pstate_latency_us never gets updated from the hard coded value in rn_clk_mgr.c
[how]
update the wm table's values before we do calculations with them
--- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +4 -1
@@ -1011,9 +1011,12 @@ static void patch_bounding_box(struct dc *dc, struct _vcs_dpi_soc_bounding_box_s }if (dc->bb_overrides.dram_clock_change_latency_ns) { - bb->dram_clock_change_latency_us = +for (i =0 ; i <WM_SET_COUNT ; i++) { + dc->clk_mgr->bw_params->wm_table.entries[i].pstate_latency_us = dc->bb_overrides.dram_clock_change_latency_ns /1000.0 ; + } } +kernel_fpu_end (); }
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 7/51 drm/amd/display: Wrong ifdef guards were used around DML validation
In reply to [email protected]From: Jaehyun Chung <[email protected]>
[Why]
Wrong guards were causing the debug option not to run.
[How]
Changed the guard to the correct one, matching the rq, ttu, dlg regs struct members that need to be guarded. Also log a message when validation starts.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c | 1 + drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubp.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -1
@@ -2187,7 +2187,7 @@ static void commit_planes_for_stream(struct dc *dc, }if (dc->hwss.program_front_end_for_ctx && update_type !=UPDATE_TYPE_FAST ) { dc->hwss.program_front_end_for_ctx (dc, context); -#ifdef CONFIG_DRM_AMD_DC_DCN1_0 +#ifdef CONFIG_DRM_AMD_DC_DCN if (dc->debug.validate_dml_output) {for (i =0 ; i < dc->res_pool->pipe_count; i++) {struct pipe_ctx cur_pipe = context->res_ctx.pipe_ctx[i];
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +1 -0
@@ -1257,6 +1257,7 @@ void hubp2_validate_dml_output(struct hubp *hubp,struct _vcs_dpi_display_dlg_regs_st dlg_attr = {0 };struct _vcs_dpi_display_ttu_regs_st ttu_attr = {0 };DC_LOGGER_INIT (ctx->logger); +DC_LOG_DEBUG ("DML Validation | Running Validation" );/* Requestor Regs */ REG_GET(HUBPRET_CONTROL,
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubp.c +1 -0
@@ -267,6 +267,7 @@ void hubp21_validate_dml_output(struct hubp *hubp,struct _vcs_dpi_display_dlg_regs_st dlg_attr = {0 };struct _vcs_dpi_display_ttu_regs_st ttu_attr = {0 };DC_LOGGER_INIT (ctx->logger); +DC_LOG_DEBUG ("DML Validation | Running Validation" );/* Requester - Per hubp */ REG_GET(HUBPRET_CONTROL,
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 8/51 drm/amd/display: Reset PHY in link re-training
In reply to [email protected]From: Paul Hsieh <[email protected]>
[Why]
Link training failed randomly when plugging USB-C display in/out.
[How]
If link training failed, reset PHY in link re-training.
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 32 ++------- .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 68 +++++++++++++++---- .../drm/amd/display/dc/core/dc_link_hwss.c | 14 +--- .../gpu/drm/amd/display/dc/inc/dc_link_dp.h | 5 +- 4 files changed, 66 insertions(+), 53 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +4 -28
@@ -1495,7 +1495,6 @@ static enum dc_status enable_link_dp(bool skip_video_pattern;struct dc_link *link = stream->link;struct dc_link_settings link_settings = {0 }; -enum dp_panel_mode panel_mode;bool fec_enable;int i;bool apply_seamless_boot_optimization = false;
@@ -1531,40 +1530,17 @@ static enum dc_status enable_link_dp(if (state->clk_mgr && !apply_seamless_boot_optimization) state->clk_mgr->funcs->update_clocks (state->clk_mgr, state, false); -dp_enable_link_phy ( - link, - pipe_ctx->stream->signal, - pipe_ctx->clock_source->id, - &link_settings); - -if (stream->sink_patches.dppowerup_delay >0 ) { -int delay_dp_power_up_in_ms = stream->sink_patches.dppowerup_delay; - -msleep (delay_dp_power_up_in_ms); - } - - panel_mode =dp_get_panel_mode (link); -dp_set_panel_mode (link, panel_mode); - -/* We need to do this before the link training to ensure the idle pattern in SST -* mode will be sent right after the link training */ - link->link_enc->funcs->connect_dig_be_to_fe (link->link_enc, - pipe_ctx->stream_res.stream_enc->id, true); skip_video_pattern = true;if (link_settings.link_rate ==LINK_RATE_LOW ) skip_video_pattern = false; -if (link->aux_access_disabled) { -dc_link_dp_perform_link_training_skip_aux (link, &link_settings); - - link->cur_link_settings = link_settings; - status =DC_OK ; - }else if (perform_link_training_with_retries ( - link, +if (perform_link_training_with_retries ( &link_settings, skip_video_pattern, -LINK_TRAINING_ATTEMPTS )) { +LINK_TRAINING_ATTEMPTS , + pipe_ctx, + pipe_ctx->stream->signal)) { link->cur_link_settings = link_settings; status =DC_OK ; }
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +56 -12
96 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c +3 -11
@@ -333,20 +333,12 @@ void dp_retrain_link_dp_test(struct dc_link *link,memset (&link->cur_link_settings,0 ,sizeof (link->cur_link_settings)); - link->link_enc->funcs->enable_dp_output ( - link->link_enc, - link_setting, - pipes[i].clock_source->id); - link->cur_link_settings = *link_setting; - -dp_receiver_power_ctrl (link, true); -perform_link_training_with_retries ( - link, link_setting, skip_video_pattern, -LINK_TRAINING_ATTEMPTS ); - +LINK_TRAINING_ATTEMPTS , + &pipes[i], +SIGNAL_TYPE_DISPLAY_PORT ); link->dc->hwss.enable_stream (&pipes[i]);
drivers/gpu/drm/amd/display/dc/inc/dc_link_dp.h +3 -2
@@ -57,10 +57,11 @@ void decide_link_settings( struct dc_link_settings *link_setting);bool perform_link_training_with_retries ( -struct dc_link *link,const struct dc_link_settings *link_setting,bool skip_video_pattern, -int attempts); +int attempts, +struct pipe_ctx *pipe_ctx, +enum signal_type signal);bool is_mst_supported (struct dc_link *link);
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 9/51 drm/amd/display: Disable link before reenable
In reply to [email protected]From: Lucy Li <[email protected]>
[Why]
Black screen seen after display is disabled then re-enabled. Caused by difference in link settings when switching between different resolutions.
[How]
In PnP case, or whenever the display is
still enabled but the driver is unloaded, disable link before re-enabling with new link settings.
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 99 ++++++++++--------- 1 file changed, 52 insertions(+), 47 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +52 -47
@@ -1511,15 +1511,6 @@ static enum dc_status enable_link_dp(decide_link_settings (stream, &link_settings);if (pipe_ctx->stream->signal ==SIGNAL_TYPE_EDP ) { -/* If link settings are different than current and link already enabled -* then need to disable before programming to new rate. -*/ -if (link->link_status.link_active && - (link->cur_link_settings.lane_count != link_settings.lane_count || - link->cur_link_settings.link_rate != link_settings.link_rate)) { -dp_disable_link_phy (link, pipe_ctx->stream->signal); - } -/*in case it is not on*/ link->dc->hwss.edp_power_control (link, true); link->dc->hwss.edp_wait_for_hpd_ready (link, true);
@@ -2039,6 +2030,45 @@ static void write_i2c_redriver_setting(ASSERT (i2c_success); } +static void disable_link (struct dc_link *link,enum signal_type signal) +{ +/* +* TODO: implement call for dp_set_hw_test_pattern +* it is needed for compliance testing +*/ + +/* Here we need to specify that encoder output settings +* need to be calculated as for the set mode, +* it will lead to querying dynamic link capabilities +* which should be done before enable output +*/ + +if (dc_is_dp_signal (signal)) { +/* SST DP, eDP */ +if (dc_is_dp_sst_signal (signal)) +dp_disable_link_phy (link, signal); +else +dp_disable_link_phy_mst (link, signal); + +if (dc_is_dp_sst_signal (signal) || + link->mst_stream_alloc_table.stream_count ==0 ) { +dp_set_fec_enable (link, false); +dp_set_fec_ready (link, false); + } + }else { +if (signal !=SIGNAL_TYPE_VIRTUAL ) + link->link_enc->funcs->disable_output (link->link_enc, signal); + } + +if (signal ==SIGNAL_TYPE_DISPLAY_PORT_MST ) { +/* MST disable link only when no stream use the link */ +if (link->mst_stream_alloc_table.stream_count <=0 ) + link->link_status.link_active = false; + }else { + link->link_status.link_active = false; + } +} +static void enable_link_hdmi (struct pipe_ctx *pipe_ctx) {struct dc_stream_state *stream = pipe_ctx->stream;
@@ -2123,6 +2153,19 @@ static enum dc_status enable_link( struct pipe_ctx *pipe_ctx) {enum dc_status status =DC_ERROR_UNEXPECTED ; +struct dc_stream_state *stream = pipe_ctx->stream; +struct dc_link *link = stream->link; + +/* There's some scenarios where driver is unloaded with display +* still enabled. When driver is reloaded, it may cause a display +* to not light up if there is a mismatch between old and new +* link settings. Need to call disable first before enabling at +* new link settings. +*/ +if (link->link_status.link_active) { +disable_link (link, pipe_ctx->stream->signal); + } +switch (pipe_ctx->stream->signal) {case SIGNAL_TYPE_DISPLAY_PORT : status =enable_link_dp (state, pipe_ctx);
@@ -2157,44 +2200,6 @@ static enum dc_status enable_link(return status; } -static void disable_link (struct dc_link *link,enum signal_type signal) -{ -/* -* TODO: implement call for dp_set_hw_test_pattern -* it is needed for compliance testing -*/ - -/* here we need to specify that encoder output settings -* need to be calculated as for the set mode, -* it will lead to querying dynamic link capabilities -* which should be done before enable output */ - -if (dc_is_dp_signal (signal)) { -/* SST DP, eDP */ -if (dc_is_dp_sst_signal (signal)) -dp_disable_link_phy (link, signal); -else -dp_disable_link_phy_mst (link, signal); - -if (dc_is_dp_sst_signal (signal) || - link->mst_stream_alloc_table.stream_count ==0 ) { -dp_set_fec_enable (link, false); -dp_set_fec_ready (link, false); - } - }else { -if (signal !=SIGNAL_TYPE_VIRTUAL ) - link->link_enc->funcs->disable_output (link->link_enc, signal); - } - -if (signal ==SIGNAL_TYPE_DISPLAY_PORT_MST ) { -/* MST disable link only when no stream use the link */ -if (link->mst_stream_alloc_table.stream_count <=0 ) - link->link_status.link_active = false; - }else { - link->link_status.link_active = false; - } -} -static uint32_t get_timing_pixel_clock_100hz (const struct dc_crtc_timing *timing) {
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 10/51 drm/amd/display: Add DMCUB__PG_DONE trace code enum
In reply to [email protected]From: Yongqiang Sun <[email protected]>
--- drivers/gpu/drm/amd/display/dmub/inc/dmub_trace_buffer.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dmub/inc/dmub_trace_buffer.h +1 -0
@@ -45,6 +45,7 @@ enum dmucb_trace_code {DMCUB__DMCU_ISR_LOAD_END ,DMCUB__MAIN_IDLE ,DMCUB__PERF_TRACE , + DMCUB__PG_DONE, }; struct dmcub_trace_buf_entry {
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 11/51 drm/amd/display: Only wait for DMUB phy init on dcn21
In reply to [email protected]From: Nicholas Kazlauskas <[email protected]>
[Why]
The wait for PHY init won't finish if the firmware doesn't support it.
[How]
Only hook this functionality up on DCN21 and move it out of DCN20.
For ASIC without support then this should return OK so we don't hang while waiting in DC.
--- drivers/gpu/drm/amd/display/dmub/src/dmub_dcn20.c | 5 ----- drivers/gpu/drm/amd/display/dmub/src/dmub_dcn20.h | 2 -- drivers/gpu/drm/amd/display/dmub/src/dmub_dcn21.c | 5 +++++ drivers/gpu/drm/amd/display/dmub/src/dmub_dcn21.h | 2 ++ drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn20.c +0 -5
@@ -135,8 +135,3 @@ bool dmub_dcn20_is_supported(struct dmub_srv *dmub)return supported; } - -bool dmub_dcn20_is_phy_init (struct dmub_srv *dmub) -{ -return REG_READ (DMCUB_SCRATCH10 ) ==0 ; -}
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn20.h +0 -2
@@ -59,6 +59,4 @@ bool dmub_dcn20_is_hw_init(struct dmub_srv *dmub);bool dmub_dcn20_is_supported (struct dmub_srv *dmub); -bool dmub_dcn20_is_phy_init (struct dmub_srv *dmub); -#endif /* _DMUB_DCN20_H_ */
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn21.c +5 -0
@@ -124,3 +124,8 @@ bool dmub_dcn21_is_auto_load_done(struct dmub_srv *dmub) {return (REG_READ (DMCUB_SCRATCH0 ) ==3 ); } + +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 +2 -0
@@ -42,4 +42,6 @@ void dmub_dcn21_setup_windows(struct dmub_srv *dmub,bool dmub_dcn21_is_auto_load_done (struct dmub_srv *dmub); +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 -1
@@ -76,13 +76,13 @@ static bool dmub_srv_hw_setup(struct dmub_srv *dmub, enum dmub_asic asic) funcs->get_inbox1_rptr = dmub_dcn20_get_inbox1_rptr; funcs->set_inbox1_wptr = dmub_dcn20_set_inbox1_wptr; funcs->is_supported = dmub_dcn20_is_supported; - funcs->is_phy_init = dmub_dcn20_is_phy_init; funcs->is_hw_init = dmub_dcn20_is_hw_init;if (asic ==DMUB_ASIC_DCN21 ) { funcs->backdoor_load = dmub_dcn21_backdoor_load; funcs->setup_windows = dmub_dcn21_setup_windows; funcs->is_auto_load_done = dmub_dcn21_is_auto_load_done; + funcs->is_phy_init = dmub_dcn21_is_phy_init; }break ;
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 12/51 drm/amd/display: Return DMUB_STATUS_OK when autoload unsupported
In reply to [email protected]From: Nicholas Kazlauskas <[email protected]>
[Why]
Not having support for autoload isn't an error. If the DMUB firmware doesn't support it then don't return DMUB_STATUS_INVALID.
[How]
Return DMUB_STATUS_OK when ->is_auto_load_done is NULL.
--- drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +8 -2
@@ -379,9 +379,12 @@ enum dmub_status dmub_srv_wait_for_auto_load(struct dmub_srv *dmub, {uint32_t i; -if (!dmub->hw_init || !dmub->hw_funcs.is_auto_load_done) +if (!dmub->hw_init)return DMUB_STATUS_INVALID ; +if (!dmub->hw_funcs.is_auto_load_done) +return DMUB_STATUS_OK ; +for (i =0 ; i <= timeout_us; i +=100 ) {if (dmub->hw_funcs.is_auto_load_done (dmub))return DMUB_STATUS_OK ;
@@ -397,9 +400,12 @@ enum dmub_status dmub_srv_wait_for_phy_init(struct dmub_srv *dmub, {uint32_t i =0 ; -if (!dmub->hw_init || !dmub->hw_funcs.is_phy_init) +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 ;
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 13/51 drm/amd/display: Program CW5 for tracebuffer for dcn20
In reply to [email protected]From: Nicholas Kazlauskas <[email protected]>
[Why]
On dcn21 this is programmed for tracebuffer support but isn't being programmed on dcn20.
DMCUB execution hits an undefined address 65000000 on tracebuffer access.
[How]
Program CW5.
--- drivers/gpu/drm/amd/display/dmub/src/dmub_dcn20.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn20.c +7 -0
@@ -99,6 +99,13 @@ void dmub_dcn20_setup_windows(struct dmub_srv *dmub,REG_SET_2 (DMCUB_REGION4_TOP_ADDRESS ,0 ,DMCUB_REGION4_TOP_ADDRESS , cw4->region.top - cw4->region.base -1 ,DMCUB_REGION4_ENABLE ,1 ); + +REG_WRITE (DMCUB_REGION3_CW5_OFFSET , cw5->offset.u.low_part); +REG_WRITE (DMCUB_REGION3_CW5_OFFSET_HIGH , cw5->offset.u.high_part); +REG_WRITE (DMCUB_REGION3_CW5_BASE_ADDRESS , cw5->region.base); +REG_SET_2 (DMCUB_REGION3_CW5_TOP_ADDRESS ,0 , +DMCUB_REGION3_CW5_TOP_ADDRESS , cw5->region.top, +DMCUB_REGION3_CW5_ENABLE ,1 ); } void dmub_dcn20_setup_mailbox(struct dmub_srv *dmub,
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 14/51 drm/amd/display: populate bios integrated info for renoir
In reply to [email protected]From: Joseph Gravenor <[email protected]>
[Why]
When video_memory_type bw_params->vram_type
is assigned, wedistinguish between Ddr4MemType and LpDdr4MemType. Because of this we will never report that we are using LpDdr4MemType and never re-purpose WM set D
[How]
populate bios integrated info for renoir by adding the revision number for renoir and use that integrated info table instead of of asic_id to get the vram type
--- drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c | 1 + .../gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +1 -0
@@ -1638,6 +1638,7 @@ static enum bp_result construct_integrated_info(/* Don't need to check major revision as they are all 1 */ switch (revision.minor) {case 11 : +case 12 : result =get_integrated_info_v11 (bp, info);break ;default :
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c +6 -4
@@ -569,7 +569,7 @@ static unsigned int find_dcfclk_for_voltage(struct dpm_clocks *clock_table, unsireturn 0 ; } -static void rn_clk_mgr_helper_populate_bw_params (struct clk_bw_params *bw_params,struct dpm_clocks *clock_table,struct hw_asic_id *asic_id) +static void rn_clk_mgr_helper_populate_bw_params (struct clk_bw_params *bw_params,struct dpm_clocks *clock_table,struct integrated_info *bios_info) {int i, j =0 ;
@@ -601,8 +601,8 @@ static void rn_clk_mgr_helper_populate_bw_params(struct clk_bw_params *bw_params bw_params->clk_table.entries[i].dcfclk_mhz =find_dcfclk_for_voltage (clock_table, clock_table->FClocks[j].Vol); } - bw_params->vram_type = asic_id->vram_type; - bw_params->num_channels = asic_id->vram_width /DDR4_DRAM_WIDTH ; + bw_params->vram_type = bios_info->memory_type; + bw_params->num_channels = bios_info->ma_channel_number;for (i =0 ; i <WM_SET_COUNT ; i++) { bw_params->wm_table.entries[i].wm_inst = i;
@@ -685,7 +685,9 @@ void rn_clk_mgr_construct(if (pp_smu && pp_smu->rn_funcs.get_dpm_clock_table) { pp_smu->rn_funcs.get_dpm_clock_table (&pp_smu->rn_funcs.pp_smu, &clock_table); -rn_clk_mgr_helper_populate_bw_params (clk_mgr->base.bw_params, &clock_table, &ctx->asic_id); +if (ctx->dc_bios && ctx->dc_bios->integrated_info) { +rn_clk_mgr_helper_populate_bw_params (clk_mgr->base.bw_params, &clock_table, ctx->dc_bios->integrated_info); + } }if (!IS_FPGA_MAXIMUS_DC (ctx->dce_environment) && clk_mgr->smu_ver >=0x00371500 ) {
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 15/51 drm/amd/display: Fixed kernel panic when booting with DP-to-HDMI dongle
In reply to [email protected]From: David Galiffi <[email protected]>
[Why]
In dc_link_is_dp_sink_present, if dal_ddc_open fails, then dal_gpio_destroy_ddc is called, destroying pin_data and pin_clock. They are created only on dc_construct, and next aux access will cause a panic.
[How]
Instead of calling dal_gpio_destroy_ddc, call dal_ddc_close.
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +1 -1
@@ -372,7 +372,7 @@ bool dc_link_is_dp_sink_present(struct dc_link *link)if (GPIO_RESULT_OK !=dal_ddc_open ( ddc,GPIO_MODE_INPUT ,GPIO_DDC_CONFIG_TYPE_MODE_I2C )) { -dal_gpio_destroy_ddc (&ddc); +dal_ddc_close (ddc);return present; }
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 16/51 drm/amd/display: have two different sr and pstate latency tables for renoir
In reply to [email protected]From: Joseph Gravenor <[email protected]>
[Why]
new sr and pstate latencies are optimized for the case when we are not using lpddr4 memory
[How]
have two different wm tables, one for the lpddr case and one for non lpddr case
--- .../amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c | 114 ++++++++++++------ 1 file changed, 80 insertions(+), 34 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c +80 -34
@@ -518,44 +518,83 @@ struct clk_bw_params rn_bw_params = { .num_entries = 4, }, - .wm_table = { - .entries = { - { - .wm_inst = WM_A, - .wm_type = WM_TYPE_PSTATE_CHG, - .pstate_latency_us = 11.72, - .sr_exit_time_us = 6.09, - .sr_enter_plus_exit_time_us = 7.14, - .valid = true, - }, - { - .wm_inst = WM_B, - .wm_type = WM_TYPE_PSTATE_CHG, - .pstate_latency_us = 11.72, - .sr_exit_time_us = 10.12, - .sr_enter_plus_exit_time_us = 11.48, - .valid = true, - }, - { - .wm_inst = WM_C, - .wm_type = WM_TYPE_PSTATE_CHG, - .pstate_latency_us = 11.72, - .sr_exit_time_us = 10.12, - .sr_enter_plus_exit_time_us = 11.48, - .valid = true, - }, - { - .wm_inst = WM_D, - .wm_type = WM_TYPE_PSTATE_CHG, - .pstate_latency_us = 11.72, - .sr_exit_time_us = 10.12, - .sr_enter_plus_exit_time_us = 11.48, - .valid = true, - }, +}; + +struct wm_table ddr4_wm_table = { + .entries = { + { + .wm_inst =WM_A , + .wm_type =WM_TYPE_PSTATE_CHG , + .pstate_latency_us =11.72 , + .sr_exit_time_us =6.09 , + .sr_enter_plus_exit_time_us =7.14 , + .valid = true, + }, + { + .wm_inst =WM_B , + .wm_type =WM_TYPE_PSTATE_CHG , + .pstate_latency_us =11.72 , + .sr_exit_time_us =10.12 , + .sr_enter_plus_exit_time_us =11.48 , + .valid = true, + }, + { + .wm_inst =WM_C , + .wm_type =WM_TYPE_PSTATE_CHG , + .pstate_latency_us =11.72 , + .sr_exit_time_us =10.12 , + .sr_enter_plus_exit_time_us =11.48 , + .valid = true, + }, + { + .wm_inst =WM_D , + .wm_type =WM_TYPE_PSTATE_CHG , + .pstate_latency_us =11.72 , + .sr_exit_time_us =10.12 , + .sr_enter_plus_exit_time_us =11.48 , + .valid = true, }, } }; +struct wm_table lpddr4_wm_table = { + .entries = { + { + .wm_inst =WM_A , + .wm_type =WM_TYPE_PSTATE_CHG , + .pstate_latency_us =23.84 , + .sr_exit_time_us =12.5 , + .sr_enter_plus_exit_time_us =17.0 , + .valid = true, + }, + { + .wm_inst =WM_B , + .wm_type =WM_TYPE_PSTATE_CHG , + .pstate_latency_us =23.84 , + .sr_exit_time_us =12.5 , + .sr_enter_plus_exit_time_us =17.0 , + .valid = true, + }, + { + .wm_inst =WM_C , + .wm_type =WM_TYPE_PSTATE_CHG , + .pstate_latency_us =23.84 , + .sr_exit_time_us =12.5 , + .sr_enter_plus_exit_time_us =17.0 , + .valid = true, + }, + { + .wm_inst =WM_D , + .wm_type =WM_TYPE_PSTATE_CHG , + .pstate_latency_us =23.84 , + .sr_exit_time_us =12.5 , + .sr_enter_plus_exit_time_us =17.0 , + .valid = true, + }, + } +}; + +static unsigned int find_dcfclk_for_voltage (struct dpm_clocks *clock_table,unsigned int voltage) {int i;
@@ -677,10 +716,17 @@ void rn_clk_mgr_construct(ASSERT (clk_mgr->base.dprefclk_khz ==600000 ); clk_mgr->base.dprefclk_khz =600000 ; } + +if (ctx->dc_bios->integrated_info->memory_type == LpDdr4MemType) { + rn_bw_params.wm_table = lpddr4_wm_table; + }else { + rn_bw_params.wm_table = ddr4_wm_table; + } }dce_clock_read_ss_info (clk_mgr); + clk_mgr->base.bw_params = &rn_bw_params;if (pp_smu && pp_smu->rn_funcs.get_dpm_clock_table) {
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 17/51 drm/amd/display: fix dprefclk and ss percentage reading on RN
In reply to [email protected]From: Eric Yang <[email protected]>
[Why]
Before was using HW counter value to determine the dprefclk. Which take into account ss, but has large variation, not good enough for generating audio dto. Also, the bios parser code to get the ss percentage was not working.
[How]
After this change, dprefclk is hard coded, same as on RV. We don't expect this to change on Renoir. Modified bios parser code to get the right ss percentage.
--- .../gpu/drm/amd/display/dc/bios/bios_parser2.c | 1 + .../amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c | 16 +++------------- drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr.h | 1 + 3 files changed, 5 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +1 -0
@@ -834,6 +834,7 @@ static enum bp_result bios_parser_get_spread_spectrum_info(case 1 :return get_ss_info_v4_1 (bp, signal, index, ss_info);case 2 : +case 3 :return get_ss_info_v4_2 (bp, signal, index, ss_info);default :break ;
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c +3 -13
@@ -675,7 +675,6 @@ void rn_clk_mgr_construct( {struct dc_debug_options *debug = &ctx->dc->debug;struct dpm_clocks clock_table = {0 }; -struct clk_state_registers_and_bypass s = {0 }; clk_mgr->base.ctx = ctx; clk_mgr->base.funcs = &dcn21_funcs;
@@ -695,7 +694,6 @@ void rn_clk_mgr_construct(if (IS_FPGA_MAXIMUS_DC (ctx->dce_environment)) { dcn21_funcs.update_clocks = dcn2_update_clocks_fpga; clk_mgr->base.dentist_vco_freq_khz =3600000 ; - clk_mgr->base.dprefclk_khz =600000 ; }else {struct clk_log_info log_info = {0 };
@@ -706,24 +704,16 @@ void rn_clk_mgr_construct(if (clk_mgr->base.dentist_vco_freq_khz ==0 ) clk_mgr->base.dentist_vco_freq_khz =3600000 ; -rn_dump_clk_registers (&s, &clk_mgr->base, &log_info); -/* Convert dprefclk units from MHz to KHz */ -/* Value already divided by 10, some resolution lost */ - clk_mgr->base.dprefclk_khz = s.dprefclk *1000 ; - -/* in case we don't get a value from the register, use default */ -if (clk_mgr->base.dprefclk_khz ==0 ) { -ASSERT (clk_mgr->base.dprefclk_khz ==600000 ); - clk_mgr->base.dprefclk_khz =600000 ; - } -if (ctx->dc_bios->integrated_info->memory_type == LpDdr4MemType) { rn_bw_params.wm_table = lpddr4_wm_table; }else { rn_bw_params.wm_table = ddr4_wm_table; } +/* Saved clocks configured at boot for debug purposes */ +rn_dump_clk_registers (&clk_mgr->base.boot_snapshot, &clk_mgr->base, &log_info); } + clk_mgr->base.dprefclk_khz =600000 ;dce_clock_read_ss_info (clk_mgr);
drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr.h +1 -0
@@ -191,6 +191,7 @@ struct clk_mgr {bool psr_allow_active_cache;int dprefclk_khz;// Used by program pixel clock in clock source funcs, need to figureout where this goes int dentist_vco_freq_khz; +struct clk_state_registers_and_bypass boot_snapshot;struct clk_bw_params *bw_params; };
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 18/51 drm/amd/display: 3.2.61
In reply to [email protected]From: Aric Cyr <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -39,7 +39,7 @@#include "inc/hw/dmcu.h" #include "dml/display_mode_lib.h" -#define DC_VER "3.2.60" +#define DC_VER "3.2.61"#define MAX_SURFACES 3#define MAX_PLANES 6
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 19/51 drm/amd/display: Change the delay time before enabling FEC
In reply to [email protected]From: "Leo (Hanghong) Ma" <[email protected]>
[why]
DP spec requires 1000 symbols delay between the end of link training and enabling FEC in the stream. Currently we are using 1 miliseconds delay which is not accurate.
[how]
One lane RBR should have the maximum time for transmitting 1000 LL codes which is 6.173 us. So using 7 microseconds delay instead of 1 miliseconds.
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +8 -1
@@ -3951,7 +3951,14 @@ void dp_set_fec_enable(struct dc_link *link, bool enable)if (link_enc->funcs->fec_set_enable && link->dpcd_caps.fec_cap.bits.FEC_CAPABLE) {if (link->fec_state == dc_link_fec_ready && enable) { -msleep (1 ); +/* Accord to DP spec, FEC enable sequence can first +* be transmitted anytime after 1000 LL codes have +* been transmitted on the link after link training +* completion. Using 1 lane RBR should have the maximum +* time for transmitting 1000 LL codes which is 6.173 us. +* So use 7 microseconds delay instead. +*/ +udelay (7 ); link_enc->funcs->fec_set_enable (link_enc, true); link->fec_state = dc_link_fec_enabled; }else if (link->fec_state == dc_link_fec_enabled && !enable) {
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 20/51 drm/amd/display: fixed that I2C over AUX didn't read data issue
In reply to [email protected]From: Brandon Syu <[email protected]>
[Why]
The variable mismatch assignment error.
[How]
To use uint32_t replace it.
--- drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c | 2 +- drivers/gpu/drm/amd/display/include/i2caux_interface.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c +1 -1
@@ -589,7 +589,7 @@ bool dal_ddc_service_query_ddc_data(bool dal_ddc_submit_aux_command (struct ddc_service *ddc,struct aux_payload *payload) { -uint8_t retrieved =0 ; +uint32_t retrieved =0 ;bool ret =0 ;if (!ddc)
drivers/gpu/drm/amd/display/include/i2caux_interface.h +1 -1
@@ -42,7 +42,7 @@ struct aux_payload {bool write;bool mot;uint32_t address; -uint8_t length; +uint32_t length;uint8_t *data;/* * used to return the reply type of the transaction
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 21/51 drm/amd/display: add log for lttpr
In reply to [email protected]From: abdoulaye berthe <[email protected]>
--- .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 125 +++++++++++++----- 1 file changed, 93 insertions(+), 32 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +93 -32
@@ -255,11 +255,18 @@ static void dpcd_set_lt_pattern_and_lane_settings( dpcd_lt_buffer[DP_TRAINING_PATTERN_SET -DP_TRAINING_PATTERN_SET ] = dpcd_pattern.raw; -DC_LOG_HW_LINK_TRAINING ("%s\n 0x%X pattern = %x\n" , - __func__, - dpcd_base_lt_offset, - dpcd_pattern.v1_4.TRAINING_PATTERN_SET); - +if (is_repeater (link, offset)) { +DC_LOG_HW_LINK_TRAINING ("%s\n LTTPR Repeater ID: %d\n 0x%X pattern = %x\n" , + __func__, + offset, + dpcd_base_lt_offset, + dpcd_pattern.v1_4.TRAINING_PATTERN_SET); + }else { +DC_LOG_HW_LINK_TRAINING ("%s\n 0x%X pattern = %x\n" , + __func__, + dpcd_base_lt_offset, + dpcd_pattern.v1_4.TRAINING_PATTERN_SET); + }/***************************************************************** * DpcdAddress_Lane0Set -> DpcdAddress_Lane3Set *****************************************************************/
@@ -289,14 +296,25 @@ static void dpcd_set_lt_pattern_and_lane_settings( dpcd_lane, size_in_bytes); -DC_LOG_HW_LINK_TRAINING ("%s:\n 0x%X VS set = %x PE set = %x max VS Reached = %x max PE Reached = %x\n" , - __func__, - dpcd_base_lt_offset, - dpcd_lane[0 ].bits.VOLTAGE_SWING_SET, - dpcd_lane[0 ].bits.PRE_EMPHASIS_SET, - dpcd_lane[0 ].bits.MAX_SWING_REACHED, - dpcd_lane[0 ].bits.MAX_PRE_EMPHASIS_REACHED); - +if (is_repeater (link, offset)) { +DC_LOG_HW_LINK_TRAINING ("%s:\n LTTPR Repeater ID: %d\n" +" 0x%X VS set = %x PE set = %x max VS Reached = %x max PE Reached = %x\n" , + __func__, + offset, + dpcd_base_lt_offset, + dpcd_lane[0 ].bits.VOLTAGE_SWING_SET, + dpcd_lane[0 ].bits.PRE_EMPHASIS_SET, + dpcd_lane[0 ].bits.MAX_SWING_REACHED, + dpcd_lane[0 ].bits.MAX_PRE_EMPHASIS_REACHED); + }else { +DC_LOG_HW_LINK_TRAINING ("%s:\n 0x%X VS set = %x PE set = %x max VS Reached = %x max PE Reached = %x\n" , + __func__, + dpcd_base_lt_offset, + dpcd_lane[0 ].bits.VOLTAGE_SWING_SET, + dpcd_lane[0 ].bits.PRE_EMPHASIS_SET, + dpcd_lane[0 ].bits.MAX_SWING_REACHED, + dpcd_lane[0 ].bits.MAX_PRE_EMPHASIS_REACHED); + }if (edp_workaround) {/* for eDP write in 2 parts because the 5-byte burst is * causing issues on some eDP panels (EPR#366724)
@@ -544,23 +562,42 @@ static void get_lane_status_and_drive_settings( ln_status_updated->raw = dpcd_buf[2 ]; -DC_LOG_HW_LINK_TRAINING ("%s:\n 0x%X Lane01Status = %x\n 0x%X Lane23Status = %x\n " , - __func__, - lane01_status_address, dpcd_buf[0 ], - lane01_status_address +1 , dpcd_buf[1 ]); - +if (is_repeater (link, offset)) { +DC_LOG_HW_LINK_TRAINING ("%s:\n LTTPR Repeater ID: %d\n" +" 0x%X Lane01Status = %x\n 0x%X Lane23Status = %x\n " , + __func__, + offset, + lane01_status_address, dpcd_buf[0 ], + lane01_status_address +1 , dpcd_buf[1 ]); + }else { +DC_LOG_HW_LINK_TRAINING ("%s:\n 0x%X Lane01Status = %x\n 0x%X Lane23Status = %x\n " , + __func__, + lane01_status_address, dpcd_buf[0 ], + lane01_status_address +1 , dpcd_buf[1 ]); + } lane01_adjust_address =DP_ADJUST_REQUEST_LANE0_1 ;if (is_repeater (link, offset)) lane01_adjust_address =DP_ADJUST_REQUEST_LANE0_1_PHY_REPEATER1 + ((DP_REPEATER_CONFIGURATION_AND_STATUS_SIZE ) * (offset -1 )); -DC_LOG_HW_LINK_TRAINING ("%s:\n 0x%X Lane01AdjustRequest = %x\n 0x%X Lane23AdjustRequest = %x\n" , - __func__, - lane01_adjust_address, - dpcd_buf[lane_adjust_offset], - lane01_adjust_address +1 , - dpcd_buf[lane_adjust_offset +1 ]); +if (is_repeater (link, offset)) { +DC_LOG_HW_LINK_TRAINING ("%s:\n LTTPR Repeater ID: %d\n" +" 0x%X Lane01AdjustRequest = %x\n 0x%X Lane23AdjustRequest = %x\n" , + __func__, + offset, + lane01_adjust_address, + dpcd_buf[lane_adjust_offset], + lane01_adjust_address +1 , + dpcd_buf[lane_adjust_offset +1 ]); + }else { +DC_LOG_HW_LINK_TRAINING ("%s:\n 0x%X Lane01AdjustRequest = %x\n 0x%X Lane23AdjustRequest = %x\n" , + __func__, + lane01_adjust_address, + dpcd_buf[lane_adjust_offset], + lane01_adjust_address +1 , + dpcd_buf[lane_adjust_offset +1 ]); + }/*copy to req_settings*/ request_settings.link_settings.lane_count =
@@ -656,14 +693,26 @@ static void dpcd_set_lane_settings(} */ -DC_LOG_HW_LINK_TRAINING ("%s\n 0x%X VS set = %x PE set = %x max VS Reached = %x max PE Reached = %x\n" , - __func__, - lane0_set_address, - dpcd_lane[0 ].bits.VOLTAGE_SWING_SET, - dpcd_lane[0 ].bits.PRE_EMPHASIS_SET, - dpcd_lane[0 ].bits.MAX_SWING_REACHED, - dpcd_lane[0 ].bits.MAX_PRE_EMPHASIS_REACHED); +if (is_repeater (link, offset)) { +DC_LOG_HW_LINK_TRAINING ("%s\n LTTPR Repeater ID: %d\n" +" 0x%X VS set = %x PE set = %x max VS Reached = %x max PE Reached = %x\n" , + __func__, + offset, + lane0_set_address, + dpcd_lane[0 ].bits.VOLTAGE_SWING_SET, + dpcd_lane[0 ].bits.PRE_EMPHASIS_SET, + dpcd_lane[0 ].bits.MAX_SWING_REACHED, + dpcd_lane[0 ].bits.MAX_PRE_EMPHASIS_REACHED); + }else { +DC_LOG_HW_LINK_TRAINING ("%s\n 0x%X VS set = %x PE set = %x max VS Reached = %x max PE Reached = %x\n" , + __func__, + lane0_set_address, + dpcd_lane[0 ].bits.VOLTAGE_SWING_SET, + dpcd_lane[0 ].bits.PRE_EMPHASIS_SET, + dpcd_lane[0 ].bits.MAX_SWING_REACHED, + dpcd_lane[0 ].bits.MAX_PRE_EMPHASIS_REACHED); + } link->cur_lane_setting = link_training_setting->lane_settings[0 ]; }
@@ -1170,12 +1219,16 @@ static void configure_lttpr_mode(struct dc_link *link)uint8_t repeater_id;uint8_t repeater_mode =DP_PHY_REPEATER_MODE_TRANSPARENT ; +DC_LOG_HW_LINK_TRAINING ("%s\n Set LTTPR to Non Transparent Mode\n" , __func__);core_link_write_dpcd (link,DP_PHY_REPEATER_MODE , (uint8_t *)&repeater_mode,sizeof (repeater_mode));if (!link->is_lttpr_mode_transparent) { + +DC_LOG_HW_LINK_TRAINING ("%s\n Set LTTPR to Transparent Mode\n" , __func__); + repeater_mode =DP_PHY_REPEATER_MODE_NON_TRANSPARENT ; core_link_write_dpcd(link, DP_PHY_REPEATER_MODE,
@@ -1212,8 +1265,9 @@ static void repeater_training_done(struct dc_link *link, uint32_t offset) &dpcd_pattern.raw, 1); -DC_LOG_HW_LINK_TRAINING ("%s\n 0x%X pattern = %x\n" , +DC_LOG_HW_LINK_TRAINING ("%s\n LTTPR Id: %d 0x%X pattern = %x\n" , __func__, + offset, dpcd_base_lt_offset, dpcd_pattern.v1_4.TRAINING_PATTERN_SET); }
@@ -1663,6 +1717,11 @@ static struct dc_link_settings get_max_link_cap(struct dc_link *link)if (link->dpcd_caps.lttpr_caps.max_link_rate < max_link_cap.link_rate) max_link_cap.link_rate = link->dpcd_caps.lttpr_caps.max_link_rate; + +DC_LOG_HW_LINK_TRAINING ("%s\n Training with LTTPR, max_lane count %d max_link rate %d \n" , + __func__, + max_link_cap.lane_count, + max_link_cap.link_rate); }return max_link_cap; }
@@ -3196,6 +3255,8 @@ static bool retrieve_link_cap(struct dc_link *link) link->is_lttpr_mode_transparent = true;dc_link_aux_configure_timeout (link->ddc,LINK_AUX_DEFAULT_TIMEOUT_PERIOD ); } + +CONN_DATA_DETECT (link, lttpr_dpcd_data,sizeof (lttpr_dpcd_data),"LTTPR Caps: " ); } {
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 22/51 drm/amd/display: Disable chroma viewport w/a when rotated 180 degrees
In reply to [email protected]From: Michael Strauss <[email protected]>
[WHY]
Previous Renoir chroma viewport workaround fixed an MPO flicker by increasing the chroma viewport size. However, when the MPO plane is rotated 180 degrees, the viewport is read in reverse. Since the workaround increases viewport size, when reading in reverse it causes a vertical chroma offset.
[HOW]
Pass rotation value to viewport set functions
Temporarily disable the chroma viewport w/a when hubp is rotated 180 degrees
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 3 ++- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h | 4 +++- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 3 ++- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 3 ++- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubp.c | 7 +++++-- drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h | 4 +++- 6 files changed, 17 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c +2 -1
@@ -810,7 +810,8 @@ static void hubp1_set_vm_context0_settings(struct hubp *hubp,void min_set_viewport (struct hubp *hubp,const struct rect *viewport, -const struct rect *viewport_c) +const struct rect *viewport_c, +enum dc_rotation_angle rotation) {struct dcn10_hubp *hubp1 =TO_DCN10_HUBP (hubp);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h +3 -1
@@ -749,7 +749,9 @@ void hubp1_set_blank(struct hubp *hubp, bool blank);void min_set_viewport (struct hubp *hubp,const struct rect *viewport, -const struct rect *viewport_c); +const struct rect *viewport_c, +enum dc_rotation_angle rotation); +/* rotation angle added for use by hubp21_set_viewport */ void hubp1_clk_cntl (struct hubp *hubp,bool enable);void hubp1_vtg_sel (struct hubp *hubp,uint32_t otg_inst);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +2 -1
@@ -2286,7 +2286,8 @@ static void dcn10_update_dchubp_dpp( hubp->funcs->mem_program_viewport ( hubp, &pipe_ctx->plane_res.scl_data.viewport, - &pipe_ctx->plane_res.scl_data.viewport_c); + &pipe_ctx->plane_res.scl_data.viewport_c, + plane_state->rotation); }if (pipe_ctx->stream->cursor_attributes.address.quad_part !=0 ) {
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +2 -1
@@ -1363,7 +1363,8 @@ static void dcn20_update_dchubp_dpp( hubp->funcs->mem_program_viewport ( hubp, &pipe_ctx->plane_res.scl_data.viewport, - &pipe_ctx->plane_res.scl_data.viewport_c); + &pipe_ctx->plane_res.scl_data.viewport_c, + plane_state->rotation);/* Any updates are handled in dc interface, just need to apply existing for plane enable */ if ((pipe_ctx->update_flags.bits.enable || pipe_ctx->update_flags.bits.opp_changed)
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubp.c +5 -2
@@ -169,7 +169,8 @@ static void hubp21_setup(void hubp21_set_viewport (struct hubp *hubp,const struct rect *viewport, -const struct rect *viewport_c) +const struct rect *viewport_c, +enum dc_rotation_angle rotation) {struct dcn21_hubp *hubp21 =TO_DCN21_HUBP (hubp);int patched_viewport_height =0 ;
@@ -196,9 +197,11 @@ void hubp21_set_viewport(* Work around for underflow issue with NV12 + rIOMMU translation * + immediate flip. This will cause hubp underflow, but will not * be user visible since underflow is in blank region +* Disable w/a when rotated 180 degrees, causes vertical chroma offset */ patched_viewport_height = viewport_c->height; -if (viewport_c->height !=0 && debug->nv12_iflip_vm_wa) { +if (viewport_c->height !=0 && debug->nv12_iflip_vm_wa && + rotation !=ROTATION_ANGLE_180 ) {int pte_row_height =0 ;int pte_rows =0 ;
drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h +3 -1
@@ -82,7 +82,9 @@ struct hubp_funcs {void (*mem_program_viewport)(struct hubp *hubp,const struct rect *viewport, -const struct rect *viewport_c); +const struct rect *viewport_c, +enum dc_rotation_angle rotation); +/* rotation needed for Renoir workaround */ bool (*hubp_program_surface_flip_and_addr)( struct hubp *hubp,
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 23/51 drm/amd/display: fix dml20 min_dst_y_next_start calculation
In reply to [email protected]From: Dmytro Laktyushkin <[email protected]>
Bring this calculation in line with HW programming guide.
--- .../gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20.c +1 -2
@@ -929,8 +929,7 @@ static void dml20_rq_dlg_get_dlg_params(struct display_mode_lib *mode_lib, min_dst_y_ttu_vblank = min_ttu_vblank * pclk_freq_in_mhz / (double ) htotal; dlg_vblank_start = interlaced ? (vblank_start /2 ) : vblank_start; - disp_dlg_regs->min_dst_y_next_start = (unsigned int ) (((double ) dlg_vblank_start - + min_dst_y_ttu_vblank) *dml_pow (2 ,2 )); + disp_dlg_regs->min_dst_y_next_start = (unsigned int ) ((double ) dlg_vblank_start *dml_pow (2 ,2 ));ASSERT (disp_dlg_regs->min_dst_y_next_start < (unsigned int )dml_pow (2 ,18 )); dml_print("DML_DLG: %s: min_dcfclk_mhz = %3.2f\n",
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 24/51 drm/amd/display: Reset steer fifo before unblanking the stream
In reply to [email protected]From: Nikola Cornij <[email protected]>
[why]
During mode transition steer fifo could overflow. Quite often it recovers by itself, but sometimes it doesn't.
[how]
Add steer fifo reset before unblanking the stream. Also add a short delay when resetting dig resync fifo to make sure register writes don't end up back-to-back, in which case the HW might miss the reset request.
--- .../drm/amd/display/dc/dcn20/dcn20_stream_encoder.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_stream_encoder.c +10 -2
@@ -488,15 +488,23 @@ void enc2_stream_encoder_dp_unblank( DP_VID_N_MUL, n_multiply); } -/* set DIG_START to 0x1 to reset FIFO */ +/* make sure stream is disabled before resetting steer fifo */ +REG_UPDATE (DP_VID_STREAM_CNTL ,DP_VID_STREAM_ENABLE , false); +REG_WAIT (DP_VID_STREAM_CNTL ,DP_VID_STREAM_STATUS ,0 ,10 ,5000 ); +/* set DIG_START to 0x1 to reset FIFO */ REG_UPDATE (DIG_FE_CNTL ,DIG_START ,1 ); +udelay (1 );/* write 0 to take the FIFO out of reset */ REG_UPDATE (DIG_FE_CNTL ,DIG_START ,0 ); -/* switch DP encoder to CRTC data */ +/* switch DP encoder to CRTC data, but reset it the fifo first. It may happen +* that it overflows during mode transition, and sometimes doesn't recover. +*/ +REG_UPDATE (DP_STEER_FIFO ,DP_STEER_FIFO_RESET ,1 ); +udelay (10 );REG_UPDATE (DP_STEER_FIFO ,DP_STEER_FIFO_RESET ,0 );
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 25/51 drm/amd/display: Implement DePQ for DCN1
In reply to [email protected]From: Reza Amini <[email protected]>
[Why]
Need support for more color management in 10bit
surface.
[How]
Provide support for DePQ for 10bit surface
--- .../drm/amd/display/dc/dcn10/dcn10_dpp_cm.c | 3 ++ .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 5 +++ .../amd/display/modules/color/color_gamma.c | 39 ++++++++++++++----- 3 files changed, 38 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c +3 -0
@@ -628,6 +628,9 @@ void dpp1_set_degamma(case IPP_DEGAMMA_MODE_HW_xvYCC:REG_UPDATE (CM_DGAM_CONTROL ,CM_DGAM_LUT_MODE ,2 );break ; +case IPP_DEGAMMA_MODE_USER_PWL : +REG_UPDATE (CM_DGAM_CONTROL ,CM_DGAM_LUT_MODE ,3 ); +break ;default :BREAK_TO_DEBUGGER ();break ;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +5 -0
@@ -1465,6 +1465,11 @@ bool dcn10_set_input_transfer_func(struct dc *dc, struct pipe_ctx *pipe_ctx, dpp_base->funcs->dpp_set_degamma (dpp_base,IPP_DEGAMMA_MODE_BYPASS );break ;case TRANSFER_FUNCTION_PQ : + dpp_base->funcs->dpp_set_degamma (dpp_base,IPP_DEGAMMA_MODE_USER_PWL ); +cm_helper_translate_curve_to_degamma_hw_format (tf, &dpp_base->degamma_params); + dpp_base->funcs->dpp_program_degamma_pwl (dpp_base, &dpp_base->degamma_params); + result = true; +break ;default : result = false;break ;
drivers/gpu/drm/amd/display/modules/color/color_gamma.c +30 -9
@@ -154,6 +154,7 @@ static void compute_de_pq(struct fixed31_32 in_x, struct fixed31_32 *out_y)struct fixed31_32 l_pow_m1;struct fixed31_32 base, div; +struct fixed31_32 base2;if (dc_fixpt_lt (in_x, dc_fixpt_zero))
@@ -163,13 +164,15 @@ static void compute_de_pq(struct fixed31_32 in_x, struct fixed31_32 *out_y) dc_fixpt_div(dc_fixpt_one, m2)); base =dc_fixpt_sub (l_pow_m1, c1); -if (dc_fixpt_lt (base, dc_fixpt_zero)) - base = dc_fixpt_zero; - div =dc_fixpt_sub (c2,dc_fixpt_mul (c3, l_pow_m1)); - *out_y =dc_fixpt_pow (dc_fixpt_div (base, div), -dc_fixpt_div (dc_fixpt_one, m1)); + base2 =dc_fixpt_div (base, div); +//avoid complex numbers +if (dc_fixpt_lt (base2, dc_fixpt_zero)) + base2 =dc_fixpt_sub (dc_fixpt_zero, base2); + + + *out_y =dc_fixpt_pow (base2,dc_fixpt_div (dc_fixpt_one, m1)); }
@@ -1998,10 +2001,28 @@ bool mod_color_calculate_degamma_params(struct dc_transfer_func *input_tf, tf_pts->x_point_at_y1_green =1 ; tf_pts->x_point_at_y1_blue =1 ; -map_regamma_hw_to_x_user (ramp, coeff, rgb_user, - coordinates_x, axis_x, curve, -MAX_HW_POINTS , tf_pts, - mapUserRamp && ramp && ramp->type ==GAMMA_RGB_256 ); +if (input_tf->tf ==TRANSFER_FUNCTION_PQ ) { +/* just copy current rgb_regamma into tf_pts */ +struct pwl_float_data_ex *curvePt = curve; +int i =0 ; + +while (i <=MAX_HW_POINTS ) { + tf_pts->red[i] = curvePt->r; + tf_pts->green[i] = curvePt->g; + tf_pts->blue[i] = curvePt->b; + ++curvePt; + ++i; + } + }else { +//clamps to 0-1 +map_regamma_hw_to_x_user (ramp, coeff, rgb_user, + coordinates_x, axis_x, curve, +MAX_HW_POINTS , tf_pts, + mapUserRamp && ramp && ramp->type ==GAMMA_RGB_256 ); + } + + +if (ramp->type ==GAMMA_CUSTOM )apply_lut_1d (ramp,MAX_HW_POINTS , tf_pts);
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 26/51 drm/amd/display: update p-state latency for renoir when using lpddr4
In reply to [email protected]From: Joseph Gravenor <[email protected]>
[Why]
DF team has produced more optimized latency numbers, for lpddr4
[How]
change the p-state laency in the lpddr4 wm table to the new latency number
--- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c +4 -4
@@ -562,7 +562,7 @@ struct wm_table lpddr4_wm_table = { { .wm_inst = WM_A, .wm_type = WM_TYPE_PSTATE_CHG, - .pstate_latency_us = 23.84, + .pstate_latency_us = 11.65333, .sr_exit_time_us = 12.5, .sr_enter_plus_exit_time_us = 17.0, .valid = true,
@@ -570,7 +570,7 @@ struct wm_table lpddr4_wm_table = { { .wm_inst = WM_B, .wm_type = WM_TYPE_PSTATE_CHG, - .pstate_latency_us = 23.84, + .pstate_latency_us = 11.65333, .sr_exit_time_us = 12.5, .sr_enter_plus_exit_time_us = 17.0, .valid = true,
@@ -578,7 +578,7 @@ struct wm_table lpddr4_wm_table = { { .wm_inst = WM_C, .wm_type = WM_TYPE_PSTATE_CHG, - .pstate_latency_us = 23.84, + .pstate_latency_us = 11.65333, .sr_exit_time_us = 12.5, .sr_enter_plus_exit_time_us = 17.0, .valid = true,
@@ -586,7 +586,7 @@ struct wm_table lpddr4_wm_table = { { .wm_inst = WM_D, .wm_type = WM_TYPE_PSTATE_CHG, - .pstate_latency_us = 23.84, + .pstate_latency_us = 11.65333, .sr_exit_time_us = 12.5, .sr_enter_plus_exit_time_us = 17.0, .valid = true,
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 27/51 drm/amd/display: add DP protocol version
In reply to [email protected]From: Anthony Koo <[email protected]>
[Why]
We want to know DP protocol version
[How]
In DC create we initialize a cap to indicate the max DP protocol version supported
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 2 ++ drivers/gpu/drm/amd/display/dc/dc.h | 5 +++++ 2 files changed, 7 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -0
@@ -809,6 +809,8 @@ struct dc *dc_create(const struct dc_init_data *init_params) dc->caps.max_audios = dc->res_pool->audio_count; dc->caps.linear_pitch_alignment =64 ; + dc->caps.max_dp_protocol_version =DP_VERSION_1_4 ; +/* Populate versioning information */ dc->versions.dc_ver =DC_VER ;
drivers/gpu/drm/amd/display/dc/dc.h +5 -0
@@ -54,6 +54,10 @@ struct dc_versions {struct dmcu_version dmcu_version; }; +enum dp_protocol_version { +DP_VERSION_1_4 , +}; +enum dc_plane_type {DC_PLANE_TYPE_INVALID ,DC_PLANE_TYPE_DCE_RGB ,
@@ -114,6 +118,7 @@ struct dc_caps {bool extended_aux_timeout_support;bool dmcub_support;bool hw_3d_lut; +enum dp_protocol_version max_dp_protocol_version;struct dc_plane_cap planes[MAX_PLANES ]; };
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 28/51 drm/amd/display: Save/restore link setting for disable phy when link retraining
In reply to [email protected]From: Hugo Hu <[email protected]>
[Why]
The link setting will be modify after disable phy and due to DP Compliance Fails.
[How]
Save and resotre link setting for disable link phy when link retraining.
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +3 -2
@@ -2788,9 +2788,9 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpdunion hpd_irq_data hpd_irq_dpcd_data = { { { {0 } } } };union device_service_irq device_service_clear = { {0 } };enum dc_status result; -bool status = false;struct pipe_ctx *pipe_ctx; +struct dc_link_settings previous_link_settings;int i;if (out_link_loss)
@@ -2873,9 +2873,10 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpdif (pipe_ctx ==NULL || pipe_ctx->stream ==NULL )return false; + previous_link_settings = link->cur_link_settings;dp_disable_link_phy (link, pipe_ctx->stream->signal); -perform_link_training_with_retries (&link->cur_link_settings, +perform_link_training_with_retries (&previous_link_settings, true,LINK_TRAINING_ATTEMPTS , pipe_ctx, pipe_ctx->stream->signal);
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 29/51 drm/amd/display: Return a correct error value
In reply to [email protected]From: Mikita Lipski <[email protected]>
[why]
The function is expected to return instance of the timing generator therefore we shouldn't be returning boolean in integer function, and we shouldn't be returning zero so changing it to -1.
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +3 -3
@@ -1866,7 +1866,7 @@ static int acquire_resource_from_hw_enabled_state( inst = link->link_enc->funcs->get_dig_frontend (link->link_enc);if (inst ==ENGINE_ID_UNKNOWN ) -return false; +return -1 ;for (i =0 ; i < pool->stream_enc_count; i++) {if (pool->stream_enc[i]->id == inst) {
@@ -1878,10 +1878,10 @@ static int acquire_resource_from_hw_enabled_state(// tg_inst not found if (i == pool->stream_enc_count) -return false; +return -1 ;if (tg_inst >= pool->timing_generator_count) -return false; +return -1 ;if (!res_ctx->pipe_ctx[tg_inst].stream) {struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[tg_inst];
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 30/51 drm/amd/display: Split DMUB cmd type into type/subtype
In reply to [email protected]From: Nicholas Kazlauskas <[email protected]>
[Why]
Commands will be considered a stable ABI between driver and firmware.
Commands are also split between DC commands, DAL feature commands, and VBIOS commands.
Commands are currently not designated to a specific ID and the enum does not provide a stable ABI.
We currently group all of these into a single command type of 8-bits. With the stable ABI consideration in mind it's not unreasonable to run out of command IDs.
For cleaner separation and versioning split the commands into a main type and a subtype.
[How]
For commands where performance matters (like reg sequences) these are still considered main commands.
Sub commands will be split by ownership/feature.
Update existing command sequences to reflect new changes.
--- .../drm/amd/display/dc/bios/command_table2.c | 13 +++-- drivers/gpu/drm/amd/display/dc/dc_helper.c | 3 ++ .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 48 +++++++------------ .../drm/amd/display/dmub/inc/dmub_cmd_dal.h | 41 ++++++++++++++++ .../drm/amd/display/dmub/inc/dmub_cmd_vbios.h | 41 ++++++++++++++++ 5 files changed, 112 insertions(+), 34 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd_dal.h create mode 100644 drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd_vbios.h
drivers/gpu/drm/amd/display/dc/bios/command_table2.c +9 -4
@@ -111,7 +111,8 @@ static void encoder_control_dmcub( {struct dmub_rb_cmd_digx_encoder_control encoder_control = {0 }; - encoder_control.header.type =DMUB_CMD__DIGX_ENCODER_CONTROL ; + encoder_control.header.type =DMUB_CMD__VBIOS ; + encoder_control.header.sub_type =DMUB_CMD__VBIOS_DIGX_ENCODER_CONTROL ; encoder_control.encoder_control.dig.stream_param = *dig;dc_dmub_srv_cmd_queue (dmcub, &encoder_control.header);
@@ -219,7 +220,9 @@ static void transmitter_control_dmcub( {struct dmub_rb_cmd_dig1_transmitter_control transmitter_control; - transmitter_control.header.type =DMUB_CMD__DIG1_TRANSMITTER_CONTROL ; + transmitter_control.header.type =DMUB_CMD__VBIOS ; + transmitter_control.header.sub_type = +DMUB_CMD__VBIOS_DIG1_TRANSMITTER_CONTROL ; transmitter_control.transmitter_control.dig = *dig;dc_dmub_srv_cmd_queue (dmcub, &transmitter_control.header);
@@ -302,7 +305,8 @@ static void set_pixel_clock_dmcub( {struct dmub_rb_cmd_set_pixel_clock pixel_clock = {0 }; - pixel_clock.header.type =DMUB_CMD__SET_PIXEL_CLOCK ; + pixel_clock.header.type =DMUB_CMD__VBIOS ; + pixel_clock.header.sub_type =DMUB_CMD__VBIOS_SET_PIXEL_CLOCK ; pixel_clock.pixel_clock.clk = *clk;dc_dmub_srv_cmd_queue (dmcub, &pixel_clock.header);
@@ -650,7 +654,8 @@ static void enable_disp_power_gating_dmcub( {struct dmub_rb_cmd_enable_disp_power_gating power_gating; - power_gating.header.type =DMUB_CMD__ENABLE_DISP_POWER_GATING ; + power_gating.header.type =DMUB_CMD__VBIOS ; + power_gating.header.sub_type =DMUB_CMD__VBIOS_ENABLE_DISP_POWER_GATING ; power_gating.power_gating.pwr = *pwr;dc_dmub_srv_cmd_queue (dmcub, &power_gating.header);
drivers/gpu/drm/amd/display/dc/dc_helper.c +3 -0
@@ -178,6 +178,7 @@ static bool dmub_reg_value_burst_set_pack(const struct dc_context *ctx, uint32_t } cmd_buf->header.type =DMUB_CMD__REG_SEQ_BURST_WRITE ; + cmd_buf->header.sub_type =0 ; cmd_buf->addr = addr; cmd_buf->write_values[offload->reg_seq_count] = reg_val; offload->reg_seq_count++;
@@ -206,6 +207,7 @@ static uint32_t dmub_reg_value_pack(const struct dc_context *ctx, uint32_t addr,/* pack commands */ cmd_buf->header.type =DMUB_CMD__REG_SEQ_READ_MODIFY_WRITE ; + cmd_buf->header.sub_type =0 ; seq = &cmd_buf->seq[offload->reg_seq_count];if (offload->reg_seq_count) {
@@ -230,6 +232,7 @@ static void dmub_reg_wait_done_pack(const struct dc_context *ctx, uint32_t addr,struct dmub_rb_cmd_reg_wait *cmd_buf = &offload->cmd_data.reg_wait; cmd_buf->header.type =DMUB_CMD__REG_REG_WAIT ; + cmd_buf->header.sub_type =0 ; cmd_buf->reg_wait.addr = addr; cmd_buf->reg_wait.condition_field_value = mask & (condition_value << shift); cmd_buf->reg_wait.mask = mask;
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +18 -30
67 lines not on this page · raw message
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd_dal.h new file +41 -0
41 lines not on this page · raw message
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd_vbios.h new file +41 -0
41 lines not on this page · raw message
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 31/51 drm/amd/display: Add shared DMCUB/driver firmware state cache window
In reply to [email protected]From: Nicholas Kazlauskas <[email protected]>
[Why]
Scratch registers are limited on the DMCUB and we have an expanding list of state to track between driver and DMCUB.
[How]
Place shared state in cache window 6. The cache window size is aligned to the size of the cache line on the DMCUB to make it easy to invalidate.
The shared state is intended to be read only from driver side so it's been marked as const.
The use of volatile is intentional. The memory for the shared firmware state is memory mapped from the framebuffer memory. The DMCUB will flush its cache after modifying the region. There's no way for x86 to known whether this data is stale or not so we want to intentionally disable optimization to force the read at every access.
--- .../drm/amd/display/dmub/inc/dmub_fw_state.h | 73 +++++++++++++++++++ .../gpu/drm/amd/display/dmub/inc/dmub_srv.h | 8 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn20.c | 10 ++- .../gpu/drm/amd/display/dmub/src/dmub_dcn20.h | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn21.c | 12 ++- .../gpu/drm/amd/display/dmub/src/dmub_dcn21.h | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 27 +++++-- 7 files changed, 125 insertions(+), 11 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dmub/inc/dmub_fw_state.h
drivers/gpu/drm/amd/display/dmub/inc/dmub_fw_state.h new file +73 -0
@@ -0,0 +1,73 @@ +/* +* Copyright 2019 Advanced Micro Devices, Inc. +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR +* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +* Authors: AMD +* +*/ + +#ifndef _DMUB_FW_STATE_H_ +#define _DMUB_FW_STATE_H_ + +#include "dmub_types.h" + +#pragma pack(push, 1) + +struct dmub_fw_state { +/** +* @phy_initialized_during_fw_boot: +* +* Detects if VBIOS/VBL has ran before firmware boot. +* A value of 1 will usually mean S0i3 boot. +*/ +uint8_t phy_initialized_during_fw_boot; + +/** +* @intialized_phy: +* +* Bit vector of initialized PHY. +*/ +uint8_t initialized_phy; + +/** +* @enabled_phy: +* +* Bit vector of enabled PHY for DP alt mode switch tracking. +*/ +uint8_t enabled_phy; + +/** +* @dmcu_fw_loaded: +* +* DMCU auto load state. +*/ +uint8_t dmcu_fw_loaded; + +/** +* @psr_state: +* +* PSR state tracking. +*/ +uint8_t psr_state; +}; + +#pragma pack(pop) + +#endif /* _DMUB_FW_STATE_H_ */
drivers/gpu/drm/amd/display/dmub/inc/dmub_srv.h +6 -2
@@ -67,6 +67,7 @@#include "dmub_types.h" #include "dmub_cmd.h" #include "dmub_rb.h" +#include "dmub_fw_state.h" #if defined(__cplusplus)extern "C" {
@@ -102,7 +103,7 @@ enum dmub_window_id {DMUB_WINDOW_3_VBIOS ,DMUB_WINDOW_4_MAILBOX ,DMUB_WINDOW_5_TRACEBUFF , -DMUB_WINDOW_6_RESERVED , +DMUB_WINDOW_6_FW_STATE ,DMUB_WINDOW_7_RESERVED , DMUB_WINDOW_TOTAL, };
@@ -241,7 +242,8 @@ struct dmub_srv_hw_funcs {const struct dmub_window *cw2, const struct dmub_window *cw3, const struct dmub_window *cw4, - const struct dmub_window *cw5); + const struct dmub_window *cw5, + const struct dmub_window *cw6);void (*setup_mailbox)(struct dmub_srv *dmub,const struct dmub_region *inbox1);
@@ -296,11 +298,13 @@ struct dmub_srv_hw_params {* @asic: dmub asic identifier * @user_ctx: user provided context for the dmub_srv * @is_virtual: false if hardware support only +* @fw_state: dmub firmware state pointer */ struct dmub_srv {enum dmub_asic asic;void *user_ctx;bool is_virtual; +volatile const struct dmub_fw_state *fw_state;/* private: internal use only */ struct dmub_srv_base_funcs funcs;
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn20.c +9 -1
@@ -76,7 +76,8 @@ void dmub_dcn20_setup_windows(struct dmub_srv *dmub,const struct dmub_window *cw2, const struct dmub_window *cw3, const struct dmub_window *cw4, - const struct dmub_window *cw5) + const struct dmub_window *cw5, + const struct dmub_window *cw6) { REG_WRITE(DMCUB_REGION3_CW2_OFFSET, cw2->offset.u.low_part);REG_WRITE (DMCUB_REGION3_CW2_OFFSET_HIGH , cw2->offset.u.high_part);
@@ -106,6 +107,13 @@ void dmub_dcn20_setup_windows(struct dmub_srv *dmub,REG_SET_2 (DMCUB_REGION3_CW5_TOP_ADDRESS ,0 ,DMCUB_REGION3_CW5_TOP_ADDRESS , cw5->region.top,DMCUB_REGION3_CW5_ENABLE ,1 ); + +REG_WRITE (DMCUB_REGION3_CW6_OFFSET , cw6->offset.u.low_part); +REG_WRITE (DMCUB_REGION3_CW6_OFFSET_HIGH , cw6->offset.u.high_part); +REG_WRITE (DMCUB_REGION3_CW6_BASE_ADDRESS , cw6->region.base); +REG_SET_2 (DMCUB_REGION3_CW6_TOP_ADDRESS ,0 , +DMCUB_REGION3_CW6_TOP_ADDRESS , cw6->region.top, +DMCUB_REGION3_CW6_ENABLE ,1 ); } void dmub_dcn20_setup_mailbox(struct dmub_srv *dmub,
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn20.h +2 -1
@@ -46,7 +46,8 @@ void dmub_dcn20_setup_windows(struct dmub_srv *dmub,const struct dmub_window *cw2, const struct dmub_window *cw3, const struct dmub_window *cw4, - const struct dmub_window *cw5); + const struct dmub_window *cw5, + const struct dmub_window *cw6);void dmub_dcn20_setup_mailbox (struct dmub_srv *dmub,const struct dmub_region *inbox1);
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn21.c +11 -1
@@ -78,7 +78,8 @@ void dmub_dcn21_setup_windows(struct dmub_srv *dmub,const struct dmub_window *cw2, const struct dmub_window *cw3, const struct dmub_window *cw4, - const struct dmub_window *cw5) + const struct dmub_window *cw5, + const struct dmub_window *cw6) { union dmub_addr offset;uint64_t fb_base = dmub->fb_base, fb_offset = dmub->fb_offset;
@@ -118,6 +119,15 @@ void dmub_dcn21_setup_windows(struct dmub_srv *dmub,REG_SET_2 (DMCUB_REGION3_CW5_TOP_ADDRESS ,0 ,DMCUB_REGION3_CW5_TOP_ADDRESS , cw5->region.top,DMCUB_REGION3_CW5_ENABLE ,1 ); + +dmub_dcn21_translate_addr (&cw6->offset, fb_base, fb_offset, &offset); + +REG_WRITE (DMCUB_REGION3_CW6_OFFSET , offset.u.low_part); +REG_WRITE (DMCUB_REGION3_CW6_OFFSET_HIGH , offset.u.high_part); +REG_WRITE (DMCUB_REGION3_CW6_BASE_ADDRESS , cw6->region.base); +REG_SET_2 (DMCUB_REGION3_CW6_TOP_ADDRESS ,0 , +DMCUB_REGION3_CW6_TOP_ADDRESS , cw6->region.top, +DMCUB_REGION3_CW6_ENABLE ,1 ); }bool dmub_dcn21_is_auto_load_done (struct dmub_srv *dmub)
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn21.h +2 -1
@@ -38,7 +38,8 @@ void dmub_dcn21_setup_windows(struct dmub_srv *dmub,const struct dmub_window *cw2, const struct dmub_window *cw3, const struct dmub_window *cw4, - const struct dmub_window *cw5); + const struct dmub_window *cw5, + const struct dmub_window *cw6);bool dmub_dcn21_is_auto_load_done (struct dmub_srv *dmub);
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +22 -5
@@ -48,13 +48,14 @@/* Number of windows in use. */ -#define DMUB_NUM_WINDOWS (DMUB_WINDOW_5_TRACEBUFF + 1) +#define DMUB_NUM_WINDOWS (DMUB_WINDOW_6_FW_STATE + 1)/* Base addresses. */ #define DMUB_CW0_BASE (0x60000000)#define DMUB_CW1_BASE (0x61000000)#define DMUB_CW3_BASE (0x63000000)#define DMUB_CW5_BASE (0x65000000) +#define DMUB_CW6_BASE (0x66000000)static inline uint32_t dmub_align (uint32_t val,uint32_t factor) {
@@ -158,6 +159,7 @@ dmub_srv_calc_region_info(struct dmub_srv *dmub,struct dmub_region *bios = &out->regions[DMUB_WINDOW_3_VBIOS ];struct dmub_region *mail = &out->regions[DMUB_WINDOW_4_MAILBOX ];struct dmub_region *trace_buff = &out->regions[DMUB_WINDOW_5_TRACEBUFF ]; +struct dmub_region *fw_state = &out->regions[DMUB_WINDOW_6_FW_STATE ];if (!dmub->sw_init)return DMUB_STATUS_INVALID ;
@@ -184,7 +186,13 @@ dmub_srv_calc_region_info(struct dmub_srv *dmub, trace_buff->base =dmub_align (mail->top,256 ); trace_buff->top = trace_buff->base +TRACE_BUF_SIZE ; - out->fb_size =dmub_align (trace_buff->top,4096 ); + fw_state->base =dmub_align (trace_buff->top,256 ); + +/* Align firmware state to size of cache line. */ + fw_state->top = + fw_state->base +dmub_align (sizeof (struct dmub_fw_state ),64 ); + + out->fb_size =dmub_align (fw_state->top,4096 );return DMUB_STATUS_OK ; }
@@ -258,9 +266,10 @@ enum dmub_status dmub_srv_hw_init(struct dmub_srv *dmub,struct dmub_fb *bios_fb = params->fb[DMUB_WINDOW_3_VBIOS ];struct dmub_fb *mail_fb = params->fb[DMUB_WINDOW_4_MAILBOX ];struct dmub_fb *tracebuff_fb = params->fb[DMUB_WINDOW_5_TRACEBUFF ]; +struct dmub_fb *fw_state_fb = params->fb[DMUB_WINDOW_6_FW_STATE ];struct dmub_rb_init_params rb_params; -struct dmub_window cw0, cw1, cw2, cw3, cw4, cw5; +struct dmub_window cw0, cw1, cw2, cw3, cw4, cw5, cw6;struct dmub_region inbox1;if (!dmub->sw_init)
@@ -286,7 +295,8 @@ enum dmub_status dmub_srv_hw_init(struct dmub_srv *dmub,if (dmub->hw_funcs.reset) dmub->hw_funcs.reset (dmub); -if (inst_fb && data_fb && bios_fb && mail_fb) { +if (inst_fb && data_fb && bios_fb && mail_fb && tracebuff_fb && + fw_state_fb) { cw2.offset.quad_part = data_fb->gpu_addr; cw2.region.base =DMUB_CW0_BASE + inst_fb->size; cw2.region.top = cw2.region.base + data_fb->size;
@@ -306,8 +316,15 @@ enum dmub_status dmub_srv_hw_init(struct dmub_srv *dmub, cw5.region.base =DMUB_CW5_BASE ; cw5.region.top = cw5.region.base + tracebuff_fb->size; + cw6.offset.quad_part = fw_state_fb->gpu_addr; + cw6.region.base =DMUB_CW6_BASE ; + cw6.region.top = cw6.region.base + fw_state_fb->size; + + dmub->fw_state = fw_state_fb->cpu_addr; +if (dmub->hw_funcs.setup_windows) - dmub->hw_funcs.setup_windows (dmub, &cw2, &cw3, &cw4, &cw5); + dmub->hw_funcs.setup_windows (dmub, &cw2, &cw3, &cw4, + &cw5, &cw6);if (dmub->hw_funcs.setup_mailbox) dmub->hw_funcs.setup_mailbox (dmub, &inbox1);
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 32/51 drm/amd/display: update sr latency for renoir when using lpddr4
In reply to [email protected]From: Joseph Gravenor <[email protected]>
[Why]
DF team has produced more optimized sr latency numbers, for lpddr4
[How]
change the sr laency in the lpddr4 wm table to the new latency number
--- .../amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c +8 -8
@@ -563,32 +563,32 @@ struct wm_table lpddr4_wm_table = { .wm_inst = WM_A, .wm_type = WM_TYPE_PSTATE_CHG, .pstate_latency_us = 11.65333, - .sr_exit_time_us = 12.5, - .sr_enter_plus_exit_time_us = 17.0, + .sr_exit_time_us = 5.32, + .sr_enter_plus_exit_time_us = 6.38, .valid = true, }, { .wm_inst = WM_B, .wm_type = WM_TYPE_PSTATE_CHG, .pstate_latency_us = 11.65333, - .sr_exit_time_us = 12.5, - .sr_enter_plus_exit_time_us = 17.0, + .sr_exit_time_us = 9.82, + .sr_enter_plus_exit_time_us = 11.196, .valid = true, }, { .wm_inst = WM_C, .wm_type = WM_TYPE_PSTATE_CHG, .pstate_latency_us = 11.65333, - .sr_exit_time_us = 12.5, - .sr_enter_plus_exit_time_us = 17.0, + .sr_exit_time_us = 9.89, + .sr_enter_plus_exit_time_us = 11.24, .valid = true, }, { .wm_inst = WM_D, .wm_type = WM_TYPE_PSTATE_CHG, .pstate_latency_us = 11.65333, - .sr_exit_time_us = 12.5, - .sr_enter_plus_exit_time_us = 17.0, + .sr_exit_time_us = 9.748, + .sr_enter_plus_exit_time_us = 11.102, .valid = true, }, }
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 33/51 drm/amd/display: Remove flag check in mpcc update
In reply to [email protected]From: Noah Abradjian <[email protected]>
[Why]
MPCC programming was being missed during certain split pipe enables due to full_update flag not being true. This caused a momentary flash on half the screen. After discussion, determined we should not have that flag check within update_mpcc, as it should always perform full programming when called.
[How]
Remove flag check. We call update_blending within insert_plane, so we do not need to replace its call from the if block.
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +0 -6
@@ -2139,12 +2139,6 @@ void dcn20_update_mpcc(struct dc *dc, struct pipe_ctx *pipe_ctx)*/ mpcc_id = hubp->inst; -/* If there is no full update, don't need to touch MPC tree*/ -if (!pipe_ctx->plane_state->update_flags.bits.full_update) { - mpc->funcs->update_blending (mpc, &blnd_cfg, mpcc_id); -return ; - } -/* check if this MPCC is already being used */ new_mpcc = mpc->funcs->get_mpcc_for_dpp (mpc_tree_params, mpcc_id);/* remove MPCC if being used */
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 34/51 drm/amd/display: check for repeater when setting aux_rd_interval.
In reply to [email protected]From: abdoulaye berthe <[email protected]>
[Why]
When training with repeater the aux read interval must be set to repeater specific aux_red_interval. This value is always 100us for CR.
[How]
Check for repeater when setting the aux_rd_interval in channel equalization.
Use the right offset in the aux_rd_interval array
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +2 -2
@@ -906,10 +906,10 @@ static enum link_training_result perform_channel_equalization_sequence(/* 3. wait for receiver to lock-on*/ wait_time_microsec = lt_settings->eq_pattern_time; -if (!link->is_lttpr_mode_transparent) +if (is_repeater (link, offset)) wait_time_microsec =translate_training_aux_read_interval ( - link->dpcd_caps.lttpr_caps.aux_rd_interval[offset]); + link->dpcd_caps.lttpr_caps.aux_rd_interval[offset -1 ]); wait_for_training_aux_rd_interval( link,
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 35/51 drm/amd/display: Modify logic for when to wait for mpcc idle
In reply to [email protected]From: Noah Abradjian <[email protected]>
[Why]
I was advised that we may need to check for mpcc idle in more cases than just when opp_changed is true. Also, mpcc_inst is equal to pipe_idx, so remove for loop.
[How]
Remove opp_changed flag check and mpcc_inst loop.
--- .../gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +9 -9
@@ -1330,16 +1330,16 @@ static void dcn20_update_dchubp_dpp(if (pipe_ctx->update_flags.bits.mpcc || plane_state->update_flags.bits.global_alpha_change || plane_state->update_flags.bits.per_pixel_alpha_change) { -/* Need mpcc to be idle if changing opp */ -if (pipe_ctx->update_flags.bits.opp_changed) { -struct pipe_ctx *old_pipe_ctx = &dc->current_state->res_ctx.pipe_ctx[pipe_ctx->pipe_idx]; -int mpcc_inst; - -for (mpcc_inst =0 ; mpcc_inst <MAX_PIPES ; mpcc_inst++) { -if (!old_pipe_ctx->stream_res.opp->mpcc_disconnect_pending[mpcc_inst]) -continue ; +// MPCC inst is equal to pipe index in practice +int mpcc_inst = pipe_ctx->pipe_idx; +int opp_inst; +int opp_count = dc->res_pool->res_cap->num_opp; + +for (opp_inst =0 ; opp_inst < opp_count; opp_inst++) { +if (dc->res_pool->opps[opp_inst]->mpcc_disconnect_pending[mpcc_inst]) { dc->res_pool->mpc->funcs->wait_for_idle (dc->res_pool->mpc, mpcc_inst); - old_pipe_ctx->stream_res.opp->mpcc_disconnect_pending[mpcc_inst] = false; + dc->res_pool->opps[opp_inst]->mpcc_disconnect_pending[mpcc_inst] = false; +break ; } } hws->funcs.update_mpcc (dc, pipe_ctx);
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 36/51 drm/amd/display: Remove redundant call
In reply to [email protected]From: Noah Abradjian <[email protected]>
[Why]
I was advised that we don't need this call of program_front_end, as earlier and later calls in the same sequence are sufficient.
[How]
Remove first call of program_front_end in dc_commit_state_no_check.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -2
@@ -1167,8 +1167,6 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *c context->stream_status[i].plane_count, context); /* use new pipe config in new context */ } -if (dc->hwss.program_front_end_for_ctx) - dc->hwss.program_front_end_for_ctx (dc, context);/* Program hardware */ for (i =0 ; i < dc->res_pool->pipe_count; i++) {
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 37/51 drm/amd/display: add dc dsc functions to return bpp range for pixel encoding
In reply to [email protected]From: Wenjing Liu <[email protected]>
[why]
Need to support 6 bpp for 420 pixel encoding only.
[how]
Add a dc function to determine what bpp range can be supported for given pixel encoding.
--- drivers/gpu/drm/amd/display/dc/dc_dsc.h | 8 +++-- drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 38 +++++++++++++++++---- 2 files changed, 37 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_dsc.h +6 -2
@@ -52,8 +52,8 @@ bool dc_dsc_parse_dsc_dpcd(const uint8_t *dpcd_dsc_basic_data,bool dc_dsc_compute_bandwidth_range (const struct display_stream_compressor *dsc,const uint32_t dsc_min_slice_height_override, -const uint32_t min_kbps, -const uint32_t max_kbps, +const uint32_t min_bpp, +const uint32_t max_bpp,const struct dsc_dec_dpcd_caps *dsc_sink_caps,const struct dc_crtc_timing *timing,struct dc_dsc_bw_range *range);
@@ -65,4 +65,8 @@ bool dc_dsc_compute_config(uint32_t target_bandwidth_kbps, const struct dc_crtc_timing *timing, struct dc_dsc_config *dsc_cfg); + +bool dc_dsc_get_bpp_range_for_pixel_encoding (enum dc_pixel_encoding pixel_enc, +uint32_t *min_bpp, +uint32_t *max_bpp);#endif
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c +31 -7
@@ -31,16 +31,12 @@ struct dc_dsc_policy {bool use_min_slices_h;int max_slices_h;// Maximum available if 0 int min_sice_height;// Must not be less than 8 -int max_target_bpp; -int min_target_bpp;// Minimum target bits per pixel };const struct dc_dsc_policy dsc_policy = { .use_min_slices_h = true,// DSC Policy: Use minimum number of slices that fits the pixel clock .max_slices_h =0 ,// DSC Policy: Use max available slices (in our case 4 for or 8, depending on the mode) .min_sice_height =108 ,// DSC Policy: Use slice height recommended by VESA DSC Spreadsheet user guide - .max_target_bpp =16 , - .min_target_bpp =8 , };
@@ -374,7 +370,6 @@ static void get_dsc_bandwidth_range(* or if it couldn't be applied based on DSC policy. */ static bool decide_dsc_target_bpp_x16( - const struct dc_dsc_policy *policy, const struct dsc_enc_caps *dsc_common_caps, const int target_bandwidth_kbps, const struct dc_crtc_timing *timing,
@@ -382,10 +377,13 @@ static bool decide_dsc_target_bpp_x16( {bool should_use_dsc = false;struct dc_dsc_bw_range range; +uint32_t min_target_bpp =0 ; +uint32_t max_target_bpp =0 ;memset (&range,0 ,sizeof (range)); -get_dsc_bandwidth_range (policy->min_target_bpp, policy->max_target_bpp, +dc_dsc_get_bpp_range_for_pixel_encoding (timing->pixel_encoding, &min_target_bpp, &max_target_bpp); +get_dsc_bandwidth_range (min_target_bpp, max_target_bpp, dsc_common_caps, timing, &range);if (target_bandwidth_kbps >= range.stream_kbps) {/* enough bandwidth without dsc */
@@ -599,7 +597,7 @@ static bool setup_dsc_config( goto done;if (target_bandwidth_kbps >0 ) { - is_dsc_possible =decide_dsc_target_bpp_x16 (&dsc_policy, &dsc_common_caps, target_bandwidth_kbps, timing, &target_bpp); + is_dsc_possible =decide_dsc_target_bpp_x16 (&dsc_common_caps, target_bandwidth_kbps, timing, &target_bpp); dsc_cfg->bits_per_pixel = target_bpp; }if (!is_dsc_possible)
@@ -906,3 +904,29 @@ bool dc_dsc_compute_config( timing, dsc_min_slice_height_override, dsc_cfg);return is_dsc_possible; } + +bool dc_dsc_get_bpp_range_for_pixel_encoding (enum dc_pixel_encoding pixel_enc, +uint32_t *min_bpp, +uint32_t *max_bpp) +{ +bool result = true; + +switch (pixel_enc) { +case PIXEL_ENCODING_RGB : +case PIXEL_ENCODING_YCBCR444 : +case PIXEL_ENCODING_YCBCR422 : + *min_bpp =8 ; + *max_bpp =16 ; +break ; +case PIXEL_ENCODING_YCBCR420 : + *min_bpp =6 ; + *max_bpp =16 ; +break ; +default : + *min_bpp =0 ; + *max_bpp =0 ; + result = false; + } + +return result; +}
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 38/51 drm/amd/display: remove spam DSC log
In reply to [email protected]From: Wenjing Liu <[email protected]>
[why]add_dsc_to_stream_resource could be called for validation. Failing validation is completely fine.
However failing it inside commit streams is bad. This code could be triggered for both contexts. The function itself cannot distinguish the caller, which makes it impossible to output the log only in the meaningful case (commit streams).
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +0 -1
@@ -1516,7 +1516,6 @@ static enum dc_status add_dsc_to_stream_resource(struct dc *dc,/* The number of DSCs can be less than the number of pipes */ if (!pipe_ctx->stream_res.dsc) { -dm_output_to_console ("No DSCs available\n" ); result =DC_NO_DSC_RESOURCE ; }
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 39/51 drm/amd/display: add dsc policy getter
In reply to [email protected]From: Wenjing Liu <[email protected]>
dc needs to expose its internal dsc policy.
--- drivers/gpu/drm/amd/display/dc/dc_dsc.h | 14 ++- drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 103 ++++++++++++-------- 2 files changed, 75 insertions(+), 42 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_dsc.h +11 -3
@@ -45,6 +45,14 @@ struct display_stream_compressor {int inst; }; +struct dc_dsc_policy { +bool use_min_slices_h; +int max_slices_h;// Maximum available if 0 +int min_slice_height;// Must not be less than 8 +uint32_t max_target_bpp; +uint32_t min_target_bpp; +}; +bool dc_dsc_parse_dsc_dpcd (const uint8_t *dpcd_dsc_basic_data,const uint8_t *dpcd_dsc_ext_data,struct dsc_dec_dpcd_caps *dsc_sink_caps);
@@ -66,7 +74,7 @@ bool dc_dsc_compute_config(const struct dc_crtc_timing *timing, struct dc_dsc_config *dsc_cfg); -bool dc_dsc_get_bpp_range_for_pixel_encoding (enum dc_pixel_encoding pixel_enc, -uint32_t *min_bpp, -uint32_t *max_bpp); +void dc_dsc_get_policy_for_timing (const struct dc_crtc_timing *timing, +struct dc_dsc_policy *policy); +#endif
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c +64 -39
173 lines not on this page · raw message
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 40/51 drm/amd/display: Limit NV12 chroma workaround
In reply to [email protected]From: Anthony Koo <[email protected]>
[Why]
It is causing green Line at the bottom of SDR 480p MPO playback
[How]
Limit workaround to vertical > 512
--- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubp.c +1 -1
@@ -200,7 +200,7 @@ void hubp21_set_viewport(* Disable w/a when rotated 180 degrees, causes vertical chroma offset */ patched_viewport_height = viewport_c->height; -if (viewport_c->height !=0 && debug->nv12_iflip_vm_wa && +if (debug->nv12_iflip_vm_wa && viewport_c->height >512 && rotation !=ROTATION_ANGLE_180 ) {int pte_row_height =0 ;int pte_rows =0 ;
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 41/51 drm/amd/display: fix cursor positioning for multiplane cases
In reply to [email protected]From: Aric Cyr <[email protected]>
[Why]
Cursor position needs to take into account plane scaling as well.
[How]
Translate cursor coords from stream space to plane space.
--- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 33 ++++++++++++++----- 1 file changed, 24 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +24 -9
@@ -2913,15 +2913,30 @@ void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx) .rotation = pipe_ctx->plane_state->rotation, .mirror = pipe_ctx->plane_state->horizontal_mirror }; -uint32_t x_plane = pipe_ctx->plane_state->dst_rect.x; -uint32_t y_plane = pipe_ctx->plane_state->dst_rect.y; -uint32_t x_offset =min (x_plane, pos_cpy.x); -uint32_t y_offset =min (y_plane, pos_cpy.y); - - pos_cpy.x -= x_offset; - pos_cpy.y -= y_offset; - pos_cpy.x_hotspot += (x_plane - x_offset); - pos_cpy.y_hotspot += (y_plane - y_offset); + +int x_plane = pipe_ctx->plane_state->dst_rect.x; +int y_plane = pipe_ctx->plane_state->dst_rect.y; +int x_pos = pos_cpy.x; +int y_pos = pos_cpy.y; + +// translate cursor from stream space to plane space + x_pos = (x_pos - x_plane) * pipe_ctx->plane_state->src_rect.width / + pipe_ctx->plane_state->dst_rect.width; + y_pos = (y_pos - y_plane) * pipe_ctx->plane_state->src_rect.height / + pipe_ctx->plane_state->dst_rect.height; + +if (x_pos <0 ) { + pos_cpy.x_hotspot -= x_pos; + x_pos =0 ; + } + +if (y_pos <0 ) { + pos_cpy.y_hotspot -= y_pos; + y_pos =0 ; + } + + pos_cpy.x = (uint32_t )x_pos; + pos_cpy.y = (uint32_t )y_pos;if (pipe_ctx->plane_state->address.type ==PLN_ADDR_TYPE_VIDEO_PROGRESSIVE )
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 42/51 drm/amd/display: Fix screen tearing on vrr tests
In reply to [email protected]From: Amanda Liu <[email protected]>
[Why]
Screen tearing is present in tests when setting the frame rate to certain fps
[How]
Revert previous optimizations for low frame rates.
--- .../amd/display/modules/freesync/freesync.c | 32 ++++++++----------- .../amd/display/modules/inc/mod_freesync.h | 1 - 2 files changed, 13 insertions(+), 20 deletions(-)
drivers/gpu/drm/amd/display/modules/freesync/freesync.c +13 -19
@@ -37,8 +37,8 @@#define STATIC_SCREEN_RAMP_DELTA_REFRESH_RATE_PER_FRAME ((1000 / 60) * 65)/* Number of elements in the render times cache array */ #define RENDER_TIMES_MAX_COUNT 10 -/* Threshold to exit/exit BTR (to avoid frequent enter-exits at the lower limit) */ -#define BTR_MAX_MARGIN 2500 +/* Threshold to exit BTR (to avoid frequent enter-exits at the lower limit) */ +#define BTR_EXIT_MARGIN 2000/* Threshold to change BTR multiplier (to avoid frequent changes) */ #define BTR_DRIFT_MARGIN 2000/*Threshold to exit fixed refresh rate*/
@@ -254,22 +254,24 @@ static void apply_below_the_range(struct core_freesync *core_freesync,unsigned int delta_from_mid_point_in_us_1 =0xFFFFFFFF ;unsigned int delta_from_mid_point_in_us_2 =0xFFFFFFFF ;unsigned int frames_to_insert =0 ; +unsigned int min_frame_duration_in_ns =0 ; +unsigned int max_render_time_in_us = in_out_vrr->max_duration_in_us;unsigned int delta_from_mid_point_delta_in_us; -unsigned int max_render_time_in_us = - in_out_vrr->max_duration_in_us - in_out_vrr->btr.margin_in_us; + + min_frame_duration_in_ns = ((unsigned int ) (div64_u64 ( + (1000000000ULL *1000000 ), + in_out_vrr->max_refresh_in_uhz)));/* Program BTR */ -if ((last_render_time_in_us + in_out_vrr->btr.margin_in_us /2 ) < max_render_time_in_us) { +if (last_render_time_in_us +BTR_EXIT_MARGIN < max_render_time_in_us) {/* Exit Below the Range */ if (in_out_vrr->btr.btr_active) { in_out_vrr->btr.frame_counter =0 ; in_out_vrr->btr.btr_active = false; } - }else if (last_render_time_in_us > (max_render_time_in_us + in_out_vrr->btr.margin_in_us /2 )) { + }else if (last_render_time_in_us > max_render_time_in_us) {/* Enter Below the Range */ -if (!in_out_vrr->btr.btr_active) { - in_out_vrr->btr.btr_active = true; - } + in_out_vrr->btr.btr_active = true; }/* BTR set to "not active" so disengage */
@@ -325,9 +327,7 @@ static void apply_below_the_range(struct core_freesync *core_freesync,/* Choose number of frames to insert based on how close it * can get to the mid point of the variable range. */ -if ((frame_time_in_us / mid_point_frames_ceil) > in_out_vrr->min_duration_in_us && - (delta_from_mid_point_in_us_1 < delta_from_mid_point_in_us_2 || - mid_point_frames_floor <2 )) { +if (delta_from_mid_point_in_us_1 < delta_from_mid_point_in_us_2) { frames_to_insert = mid_point_frames_ceil; delta_from_mid_point_delta_in_us = delta_from_mid_point_in_us_2 - delta_from_mid_point_in_us_1;
@@ -343,7 +343,7 @@ static void apply_below_the_range(struct core_freesync *core_freesync,if (in_out_vrr->btr.frames_to_insert !=0 && delta_from_mid_point_delta_in_us <BTR_DRIFT_MARGIN ) {if (((last_render_time_in_us / in_out_vrr->btr.frames_to_insert) < - max_render_time_in_us) && + in_out_vrr->max_duration_in_us) && ((last_render_time_in_us / in_out_vrr->btr.frames_to_insert) > in_out_vrr->min_duration_in_us)) frames_to_insert = in_out_vrr->btr.frames_to_insert;
@@ -796,11 +796,6 @@ void mod_freesync_build_vrr_params(struct mod_freesync *mod_freesync, refresh_range = in_out_vrr->max_refresh_in_uhz - in_out_vrr->min_refresh_in_uhz; - in_out_vrr->btr.margin_in_us = in_out_vrr->max_duration_in_us - -2 * in_out_vrr->min_duration_in_us; -if (in_out_vrr->btr.margin_in_us >BTR_MAX_MARGIN ) - in_out_vrr->btr.margin_in_us =BTR_MAX_MARGIN ; - in_out_vrr->supported = true; }
@@ -816,7 +811,6 @@ void mod_freesync_build_vrr_params(struct mod_freesync *mod_freesync, in_out_vrr->btr.inserted_duration_in_us =0 ; in_out_vrr->btr.frames_to_insert =0 ; in_out_vrr->btr.frame_counter =0 ; - in_out_vrr->btr.mid_point_in_us = (in_out_vrr->min_duration_in_us + in_out_vrr->max_duration_in_us) /2 ;
drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h +0 -1
@@ -92,7 +92,6 @@ struct mod_vrr_params_btr {uint32_t inserted_duration_in_us;uint32_t frames_to_insert;uint32_t frame_counter; -uint32_t margin_in_us; };struct mod_vrr_params_fixed_refresh {
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 43/51 drm/amd/display: update dispclk and dppclk vco frequency
In reply to [email protected]From: Eric Yang <[email protected]>
Value obtained from DV is not allowing 8k60 CTA mode with DSC to pass, after checking real value being used in hw, find out that correct value is 3600, which will allow that mode.
--- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +1 -1
@@ -255,7 +255,7 @@ struct _vcs_dpi_soc_bounding_box_st dcn2_1_soc = { .vmm_page_size_bytes = 4096, .dram_clock_change_latency_us = 23.84, .return_bus_width_bytes = 64, - .dispclk_dppclk_vco_speed_mhz = 3550, + .dispclk_dppclk_vco_speed_mhz = 3600, .xfc_bus_transport_time_us = 4, .xfc_xbuf_latency_tolerance_us = 4, .use_urgent_burst_bw = 1,
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 44/51 drm/amd/display: Implement DePQ for DCN2
In reply to [email protected]From: Reza Amini <[email protected]>
[Why]
Need support for more color management in 10bit
surface.
[How]
Provide support for DePQ for 10bit surface
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dpp_cm.c | 3 +++ drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 5 +++++ 2 files changed, 8 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dpp_cm.c +3 -0
@@ -149,6 +149,9 @@ void dpp2_set_degamma(case IPP_DEGAMMA_MODE_HW_xvYCC:REG_UPDATE (CM_DGAM_CONTROL ,CM_DGAM_LUT_MODE ,2 );break ; +case IPP_DEGAMMA_MODE_USER_PWL : +REG_UPDATE (CM_DGAM_CONTROL ,CM_DGAM_LUT_MODE ,3 ); +break ;default :BREAK_TO_DEBUGGER ();break ;
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +5 -0
@@ -878,6 +878,11 @@ bool dcn20_set_input_transfer_func(struct dc *dc, IPP_DEGAMMA_MODE_BYPASS);break ;case TRANSFER_FUNCTION_PQ : + dpp_base->funcs->dpp_set_degamma (dpp_base,IPP_DEGAMMA_MODE_USER_PWL ); +cm_helper_translate_curve_to_degamma_hw_format (tf, &dpp_base->degamma_params); + dpp_base->funcs->dpp_program_degamma_pwl (dpp_base, &dpp_base->degamma_params); + result = true; +break ;default : result = false;break ;
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 45/51 drm/amd/display: 3.2.62
In reply to [email protected]From: Aric Cyr <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -39,7 +39,7 @@#include "inc/hw/dmcu.h" #include "dml/display_mode_lib.h" -#define DC_VER "3.2.61" +#define DC_VER "3.2.62"#define MAX_SURFACES 3#define MAX_PLANES 6
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 46/51 drm/amd/display: Change HDR_MULT check
In reply to [email protected]From: Krunoslav Kovac <[email protected]>
[Why]
Currently we require HDR_MULT >= 1.0
There are scenarios where we need < 1.0
[How]
Only guard against 0 - it will black-screen image. It is up to higher-level logic to decide what HDR_MULT values are allowed in each particular case.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +1 -5
@@ -2390,17 +2390,13 @@ void dcn10_set_hdr_multiplier(struct pipe_ctx *pipe_ctx)struct fixed31_32 multiplier = pipe_ctx->plane_state->hdr_mult;uint32_t hw_mult =0x1f000 ;// 1.0 default multiplier struct custom_float_format fmt; -bool mult_negative;// True if fixed31_32 sign bit indicates negative value -uint32_t mult_int;// int component of fixed31_32 fmt.exponenta_bits =6 ; fmt.mantissa_bits =12 ; fmt.sign = true; - mult_negative = multiplier.value >>63 !=0 ; - mult_int = multiplier.value >>32 ; -if (mult_int && !mult_negative)// Check if greater than 1 +if (!dc_fixpt_eq (multiplier,dc_fixpt_from_int (0 )))// check != 0 convert_to_custom_float_format (multiplier, &fmt, &hw_mult); pipe_ctx->plane_res.dpp->funcs->dpp_set_hdr_multiplier(
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 47/51 drm/amd/display: Increase the number of retries after AUX DEFER
In reply to [email protected]From: George Shen <[email protected]>
[Why]
When a timeout occurs after a DEFER, some devices require more retries than in the case of a regular timeout.
[How]
In a timeout occurrence, check whether a DEFER has occurred before the timeout and retry MAX_DEFER_RETRIES retries times instead of MAX_TIMEOUT_RETRIES.
--- drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 32 ++++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_aux.c +22 -10
@@ -611,6 +611,8 @@ bool dce_aux_transfer_with_retries(struct ddc_service *ddc,uint8_t reply;bool payload_reply = true;enum aux_channel_operation_result operation_result; +bool retry_on_defer = false; +int aux_ack_retries =0 , aux_defer_retries =0 , aux_i2c_defer_retries = 0,
@@ -641,8 +643,9 @@ bool dce_aux_transfer_with_retries(struct ddc_service *ddc,break ;case AUX_TRANSACTION_REPLY_AUX_DEFER : -case AUX_TRANSACTION_REPLY_I2C_OVER_AUX_NACK :case AUX_TRANSACTION_REPLY_I2C_OVER_AUX_DEFER : + retry_on_defer = true; +case AUX_TRANSACTION_REPLY_I2C_OVER_AUX_NACK :if (++aux_defer_retries >=AUX_MAX_DEFER_RETRIES ) { goto fail; }else {
@@ -675,15 +678,24 @@ bool dce_aux_transfer_with_retries(struct ddc_service *ddc,break ;case AUX_CHANNEL_OPERATION_FAILED_TIMEOUT : -if (++aux_timeout_retries >=AUX_MAX_TIMEOUT_RETRIES ) - goto fail; -else { -/* -* DP 1.4, 2.8.2: AUX Transaction Response/Reply Timeouts -* According to the DP spec there should be 3 retries total -* with a 400us wait inbetween each. Hardware already waits -* for 550us therefore no wait is required here. -*/ +// Check whether a DEFER had occurred before the timeout. +// If so, treat timeout as a DEFER. +if (retry_on_defer) { +if (++aux_defer_retries >=AUX_MAX_DEFER_RETRIES ) + goto fail; +else if (payload->defer_delay >0 ) +msleep (payload->defer_delay); + }else { +if (++aux_timeout_retries >=AUX_MAX_TIMEOUT_RETRIES ) + goto fail; +else { +/* +* DP 1.4, 2.8.2: AUX Transaction Response/Reply Timeouts +* According to the DP spec there should be 3 retries total +* with a 400us wait inbetween each. Hardware already waits +* for 550us therefore no wait is required here. +*/ + } }break ;
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 48/51 drm/amd/display: Compare clock state member to determine optimization.
In reply to [email protected]From: Yongqiang Sun <[email protected]>
[Why]
It seems always request passive flip on RN due to incorrect compare clock state to determine optization.
[How]
Instead of calling memcmp, compare clock state member to determine the condition.
--- .../amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c +17 -1
@@ -471,12 +471,28 @@ static void rn_notify_wm_ranges(struct clk_mgr *clk_mgr_base) } +static bool rn_are_clock_states_equal (struct dc_clocks *a, +struct dc_clocks *b) +{ +if (a->dispclk_khz != b->dispclk_khz) +return false; +else if (a->dppclk_khz != b->dppclk_khz) +return false; +else if (a->dcfclk_khz != b->dcfclk_khz) +return false; +else if (a->dcfclk_deep_sleep_khz != b->dcfclk_deep_sleep_khz) +return false; + +return true; +} + +static struct clk_mgr_funcs dcn21_funcs = { .get_dp_ref_clk_frequency = dce12_get_dp_ref_freq_khz, .update_clocks = rn_update_clocks, .init_clocks = rn_init_clocks, .enable_pme_wa = rn_enable_pme_wa, -/* .dump_clk_registers = rn_dump_clk_registers, */ + .are_clock_states_equal = rn_are_clock_states_equal, .notify_wm_ranges = rn_notify_wm_ranges };
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 49/51 drm/amd/display: update dml related structs
In reply to [email protected]From: Dmytro Laktyushkin <[email protected]>
In preparation for further changes
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 2 ++ drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h | 3 +++ drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +2 -0
@@ -1967,6 +1967,7 @@ int dcn20_populate_dml_pipes_from_context( pipes[pipe_cnt].pipe.src.viewport_height = timing->v_addressable;if (pipes[pipe_cnt].pipe.src.viewport_height >1080 ) pipes[pipe_cnt].pipe.src.viewport_height =1080 ; + pipes[pipe_cnt].pipe.src.surface_height_y = pipes[pipe_cnt].pipe.src.viewport_height; pipes[pipe_cnt].pipe.src.data_pitch = ((pipes[pipe_cnt].pipe.src.viewport_width +63 ) /64 ) *64 ;/* linear sw only */ pipes[pipe_cnt].pipe.src.source_format = dm_444_32; pipes[pipe_cnt].pipe.dest.recout_width = pipes[pipe_cnt].pipe.src.viewport_width;/*vp_width/hratio*/
@@ -2000,6 +2001,7 @@ int dcn20_populate_dml_pipes_from_context( pipes[pipe_cnt].pipe.src.viewport_width_c = scl->viewport_c.width; pipes[pipe_cnt].pipe.src.viewport_height = scl->viewport.height; pipes[pipe_cnt].pipe.src.viewport_height_c = scl->viewport_c.height; + pipes[pipe_cnt].pipe.src.surface_height_y = pln->plane_size.surface_size.height;if (pln->format >=SURFACE_PIXEL_FORMAT_VIDEO_BEGIN ) { pipes[pipe_cnt].pipe.src.data_pitch = pln->plane_size.surface_pitch; pipes[pipe_cnt].pipe.src.data_pitch_c = pln->plane_size.chroma_pitch;
drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h +3 -0
@@ -99,6 +99,7 @@ struct _vcs_dpi_soc_bounding_box_st {unsigned int num_chans;unsigned int vmm_page_size_bytes;unsigned int hostvm_min_page_size_bytes; +unsigned int gpuvm_min_page_size_bytes;double dram_clock_change_latency_us;double dummy_pstate_latency_us;double writeback_dram_clock_change_latency_us;
@@ -224,6 +225,7 @@ struct _vcs_dpi_display_pipe_source_params_st {int source_scan;int sw_mode;int macro_tile_size; +unsigned int surface_height_y;unsigned int viewport_width;unsigned int viewport_height;unsigned int viewport_y_y;
@@ -400,6 +402,7 @@ struct _vcs_dpi_display_rq_misc_params_st {struct _vcs_dpi_display_rq_params_st {unsigned char yuv420;unsigned char yuv420_10bpc; +unsigned char rgbe_alpha;display_rq_misc_params_st misc;display_rq_sizing_params_st sizing;display_rq_dlg_params_st dlg;
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c +1 -1
@@ -231,7 +231,7 @@ static void fetch_socbb_params(struct display_mode_lib *mode_lib) mode_lib->vba.DISPCLKDPPCLKDSCCLKDownSpreading = soc->dcn_downspread_percent;// new mode_lib->vba.DISPCLKDPPCLKVCOSpeed = soc->dispclk_dppclk_vco_speed_mhz;// new mode_lib->vba.VMMPageSize = soc->vmm_page_size_bytes; - mode_lib->vba.GPUVMMinPageSize = soc->vmm_page_size_bytes /1024 ; + mode_lib->vba.GPUVMMinPageSize = soc->gpuvm_min_page_size_bytes /1024 ; mode_lib->vba.HostVMMinPageSize = soc->hostvm_min_page_size_bytes /1024 ;// Set the voltage scaling clocks as the defaults. Most of these will // be set to different values by the test
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 50/51 drm/amd/display: correct log message for lttpr
In reply to [email protected]From: abdoulaye berthe <[email protected]>
[Why]
When setting lttpr mode, the new mode to bet is not logged properly.
[How]
Update log message to show the right mode.
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +2 -2
@@ -1219,7 +1219,7 @@ static void configure_lttpr_mode(struct dc_link *link)uint8_t repeater_id;uint8_t repeater_mode =DP_PHY_REPEATER_MODE_TRANSPARENT ; -DC_LOG_HW_LINK_TRAINING ("%s\n Set LTTPR to Non Transparent Mode\n" , __func__); +DC_LOG_HW_LINK_TRAINING ("%s\n Set LTTPR to Transparent Mode\n" , __func__); core_link_write_dpcd(link, DP_PHY_REPEATER_MODE, (uint8_t *)&repeater_mode,
@@ -1227,7 +1227,7 @@ static void configure_lttpr_mode(struct dc_link *link)if (!link->is_lttpr_mode_transparent) { -DC_LOG_HW_LINK_TRAINING ("%s\n Set LTTPR to Transparent Mode\n" , __func__); +DC_LOG_HW_LINK_TRAINING ("%s\n Set LTTPR to Non Transparent Mode\n" , __func__); repeater_mode =DP_PHY_REPEATER_MODE_NON_TRANSPARENT ; core_link_write_dpcd(link,
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[email protected]
maintainerPATCH 51/51 drm/amd/display: Extend DMCUB offload testing into dcn20/21
In reply to [email protected]From: Nicholas Kazlauskas <[email protected]>
[Why]
To quickly validate whether DMCUB is running and accepting commands for offload testing we want to intercept a common sequence as part of modeset programming.
[How]
OTG enable will cause the most impact in terms of golden register changes and it's a single register write.
This approach was previously done in dcn10 code when it was shared with dcn20 but it wasn't ported over to the dcn20 code.
Port over start, execute and wait sequence into dcn20_optc.
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_optc.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_optc.c +5 -0
@@ -59,11 +59,16 @@ bool optc2_enable_crtc(struct timing_generator *optc)REG_UPDATE (CONTROL ,VTG0_ENABLE ,1 ); +REG_SEQ_START (); +/* Enable CRTC */ REG_UPDATE_2 (OTG_CONTROL ,OTG_DISABLE_POINT_CNTL ,3 ,OTG_MASTER_EN ,1 ); +REG_SEQ_SUBMIT (); +REG_SEQ_WAIT_DONE (); +return true; }
Signature · 6 lines
2.24.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx