DC Patches December 14th, 2020
Subsystems (3)
cover DC Patches December 14th, 2020
This DC patchset brings improvements in multiple areas. In summary, we highlight:
* DC 3.2.116
* Firmware release 0.0.46
* Bug fixes on VR light up issues, missing register definitions, etc.
* Improvements on OGAM LUT calculation, FP2 timing and more
---
Anthony Koo (1):
drm/amd/display: [FW Promotion] Release 0.0.46
Aric Cyr (4):
drm/amd/display: HP Reverb G2 VR fails to light up drm/amd/display: Only update FP2 for full updates drm/amd/display: Fix cleanup typo in MPCC visual confirm drm/amd/display: 3.2.116
Eric Bernstein (1):
drm/amd/display: add dcn30_link_encoder_validate_output_with_stream to
header
Felipe (1):
drm/amd/display: Fix OGAM LUT calculation precision
Jake Wang (1):
drm/amd/display: updated wm table for Renoir
Leo (Hanghong) Ma (1):
drm/amd/display: Add DP info frame update for dcn30
Martin Leung (1):
drm/amd/display: delay fp2 programming until vactive before lock
Max Tseng (1):
drm/amd/display: Add missing DP_SEC register definitions and masks
Victor Lu (1):
drm/amd/display: Change pstate expected timeout warning to 180us on
linux
Wayne Lin (1):
drm/amd/display: Fix to be able to stop crc calculation
.../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 13 +++- .../amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c | 12 ++-- drivers/gpu/drm/amd/display/dc/core/dc.c | 20 ++++++ drivers/gpu/drm/amd/display/dc/dc.h | 2 +- .../drm/amd/display/dc/dce/dce_link_encoder.c | 2 +- .../dc/dce120/dce120_timing_generator.c | 2 +- .../drm/amd/display/dc/dcn10/dcn10_hubbub.c | 6 +- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 2 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 15 +++-- .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.h | 2 +- .../display/dc/dcn10/dcn10_stream_encoder.h | 6 ++ .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 29 +++------ .../display/dc/dcn20/dcn20_stream_encoder.h | 2 + .../display/dc/dcn30/dcn30_dio_link_encoder.c | 2 +- .../display/dc/dcn30/dcn30_dio_link_encoder.h | 4 ++ .../drm/amd/display/dc/dcn30/dcn30_hwseq.c | 2 +- .../gpu/drm/amd/display/dc/dcn30/dcn30_optc.c | 2 +- .../amd/display/dc/inc/hw/timing_generator.h | 2 +- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 62 +++++++++++-------- .../amd/display/modules/color/color_gamma.c | 22 +++++-- 20 files changed, 134 insertions(+), 75 deletions(-)
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 1/13 drm/amd/display: Change pstate expected timeout warning to 180us on linux
From: Victor Lu <[email protected]>
[Why]
There is a warning that triggers when pstate takes too long. Pstate can take up to ~200us on Linux without hanging but it is currently set to 40us.
[How]
Change the timeout for the warning to be 180us on Linux.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c +3 -3
@@ -124,11 +124,11 @@ bool hubbub1_verify_allow_pstate_change_high(* still not asserted, we are probably stuck and going to hang * * TODO: Figure out why it takes ~100us on linux -* pstate takes around ~100us on linux. Unknown currently as to -* why it takes that long on linux +* pstate takes around ~100us (up to 200us) on linux. Unknown currently +* as to why it takes that long on linux */ const unsigned int pstate_wait_timeout_us =200 ; -const unsigned int pstate_wait_expected_timeout_us =40 ; +const unsigned int pstate_wait_expected_timeout_us =180 ;static unsigned int max_sampled_pstate_wait_us;/* data collection */ static bool forced_pstate_allow;/* help with revert wa */
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/13 drm/amd/display: Add missing DP_SEC register definitions and masks
In reply to Qingqing ZhuoFrom: Max Tseng <[email protected]>
[Why]
some DP_SEC register defs and masks are missing.
[How]
add the missing defs and masks.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.h | 6 ++++++ drivers/gpu/drm/amd/display/dc/dcn20/dcn20_stream_encoder.h | 2 ++ 2 files changed, 8 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.h +6 -0
@@ -81,7 +81,9 @@SRI (DP_MSE_RATE_UPDATE ,DP , id), \SRI (DP_PIXEL_FORMAT ,DP , id), \SRI (DP_SEC_CNTL ,DP , id), \ +SRI (DP_SEC_CNTL1 ,DP , id), \SRI (DP_SEC_CNTL2 ,DP , id), \ +SRI (DP_SEC_CNTL5 ,DP , id), \SRI (DP_SEC_CNTL6 ,DP , id), \SRI (DP_STEER_FIFO ,DP , id), \ SRI(DP_VID_M, DP, id), \
@@ -126,7 +128,9 @@ struct dcn10_stream_enc_registers {uint32_t DP_MSE_RATE_UPDATE ;uint32_t DP_PIXEL_FORMAT ;uint32_t DP_SEC_CNTL ; +uint32_t DP_SEC_CNTL1 ;uint32_t DP_SEC_CNTL2 ; +uint32_t DP_SEC_CNTL5 ;uint32_t DP_SEC_CNTL6 ;uint32_t DP_STEER_FIFO ;uint32_t DP_VID_M ;
@@ -411,6 +415,8 @@ struct dcn10_stream_enc_registers {type DP_SEC_GSP3_ENABLE ;\type DP_SEC_GSP4_ENABLE ;\type DP_SEC_GSP5_ENABLE ;\ +type DP_SEC_GSP5_LINE_NUM ;\ +type DP_SEC_GSP5_LINE_REFERENCE ;\type DP_SEC_GSP6_ENABLE ;\type DP_SEC_GSP7_ENABLE ;\type DP_SEC_GSP7_PPS ;\
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_stream_encoder.h +2 -0
@@ -83,6 +83,8 @@SE_SF (DIG0_HDMI_METADATA_PACKET_CONTROL ,HDMI_METADATA_PACKET_LINE , mask_sh),\SE_SF (DIG0_DIG_FE_CNTL ,DOLBY_VISION_EN , mask_sh),\SE_SF (DP0_DP_PIXEL_FORMAT ,DP_PIXEL_COMBINE , mask_sh),\ +SE_SF (DP0_DP_SEC_CNTL1 ,DP_SEC_GSP5_LINE_REFERENCE , mask_sh),\ +SE_SF (DP0_DP_SEC_CNTL5 ,DP_SEC_GSP5_LINE_NUM , mask_sh),\ SE_SF(DP0_DP_SEC_FRAMING4, DP_SST_SDP_SPLITTING, mask_sh) void dcn20_stream_encoder_construct(
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/13 drm/amd/display: HP Reverb G2 VR fails to light up
In reply to Qingqing ZhuoFrom: Aric Cyr <[email protected]>
[Why]
Many VR headsets require a HSYNC width of 4, but DCN has default minimum of 8.
[How]
Change the arbitrary minimum HSYNC width to 4 to match DCN20.
--- drivers/gpu/drm/amd/display/dc/dce120/dce120_timing_generator.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_optc.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dce120/dce120_timing_generator.c +1 -1
@@ -1268,7 +1268,7 @@ void dce120_timing_generator_construct( tg110->min_h_front_porch =0 ; tg110->min_h_back_porch =0 ; - tg110->min_h_sync_width =8 ; + tg110->min_h_sync_width =4 ; tg110->min_v_sync_width =1 ; tg110->min_v_blank =3 ; }
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c +1 -1
@@ -1540,7 +1540,7 @@ void dcn10_timing_generator_init(struct optc *optc1) optc1->min_h_blank =32 ; optc1->min_v_blank =3 ; optc1->min_v_blank_interlace =5 ; - optc1->min_h_sync_width =8 ; + optc1->min_h_sync_width =4 ; optc1->min_v_sync_width =1 ; }
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_optc.c +1 -1
@@ -350,7 +350,7 @@ void dcn30_timing_generator_init(struct optc *optc1) optc1->min_h_blank =32 ; optc1->min_v_blank =3 ; optc1->min_v_blank_interlace =5 ; - optc1->min_h_sync_width =8 ; + optc1->min_h_sync_width =4 ; optc1->min_v_sync_width =1 ; }
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/13 drm/amd/display: Fix to be able to stop crc calculation
In reply to Qingqing ZhuoFrom: Wayne Lin <[email protected]>
[Why]
Find out when we try to disable CRC calculation, crc generation is still enabled. Main reason is that dc_stream_configure_crc() will never get called when the source is AMDGPU_DM_PIPE_CRC_SOURCE_NONE.
[How]
Add checking condition that when source is AMDGPU_DM_PIPE_CRC_SOURCE_NONE, we should also call dc_stream_configure_crc() to disable crc calculation. Also, clean up crc window when disable crc calculation.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c +12 -1
@@ -81,6 +81,14 @@ const char *const *amdgpu_dm_crtc_get_crc_sources(struct drm_crtc *crtc,return pipe_crc_sources; } +static void amdgpu_dm_set_crc_window_default (struct dm_crtc_state *dm_crtc_state) +{ + dm_crtc_state->crc_window.x_start =0 ; + dm_crtc_state->crc_window.y_start =0 ; + dm_crtc_state->crc_window.x_end =0 ; + dm_crtc_state->crc_window.y_end =0 ; +} +bool amdgpu_dm_crc_window_is_default (struct dm_crtc_state *dm_crtc_state) {bool ret = true;
@@ -141,7 +149,10 @@ int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc *crtc,mutex_lock (&adev->dm.dc_lock);/* Enable CRTC CRC generation if necessary. */ -if (dm_is_crc_source_crtc (source)) { +if (dm_is_crc_source_crtc (source) || source ==AMDGPU_DM_PIPE_CRC_SOURCE_NONE ) { +if (!enable) +amdgpu_dm_set_crc_window_default (dm_crtc_state); +if (!amdgpu_dm_crc_window_is_default (dm_crtc_state)) { crc_window = &tmp_window;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/13 drm/amd/display: add dcn30_link_encoder_validate_output_with_stream to header
In reply to Qingqing ZhuoFrom: Eric Bernstein <[email protected]>
[Why]dcn30_link_encoder_validate_output_with_stream was a static function.
[How]
remove the static define and include it in the header.
--- drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_link_encoder.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_link_encoder.h | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +1 -1
@@ -119,7 +119,7 @@ static const struct link_encoder_funcs dce110_lnk_enc_funcs = { .disable_hpd = dce110_link_encoder_disable_hpd, .is_dig_enabled = dce110_is_dig_enabled, .destroy = dce110_link_encoder_destroy, - .get_max_link_cap = dce110_link_encoder_get_max_link_cap + .get_max_link_cap = dce110_link_encoder_get_max_link_cap, }; static enum bp_result link_transmitter_control(
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_link_encoder.c +1 -1
@@ -51,7 +51,7 @@ (enc10->link_regs->index) -static bool dcn30_link_encoder_validate_output_with_stream ( +bool dcn30_link_encoder_validate_output_with_stream (struct link_encoder *enc,const struct dc_stream_state *stream) {
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_link_encoder.h +4 -0
@@ -78,4 +78,8 @@ void dcn30_link_encoder_construct(void enc3_hw_init (struct link_encoder *enc); +bool dcn30_link_encoder_validate_output_with_stream ( +struct link_encoder *enc, +const struct dc_stream_state *stream); +#endif /* __DC_LINK_ENCODER__DCN30_H__ */
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/13 drm/amd/display: Add DP info frame update for dcn30
In reply to Qingqing ZhuoFrom: "Leo (Hanghong) Ma" <[email protected]>
[Why]
We are missing the DP info frame update on dcn30, and this will lead to DP SDPs not being sent;
[How]
Add the DP info frame update for dcn30;
--- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c +1 -1
@@ -668,7 +668,7 @@ void dcn30_update_info_frame(struct pipe_ctx *pipe_ctx) is_hdmi_tmds =dc_is_hdmi_tmds_signal (pipe_ctx->stream->signal); is_dp =dc_is_dp_signal (pipe_ctx->stream->signal); -if (!is_hdmi_tmds) +if (!is_hdmi_tmds && !is_dp)return ;if (is_hdmi_tmds)
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/13 drm/amd/display: delay fp2 programming until vactive before lock
In reply to Qingqing ZhuoFrom: Martin Leung <[email protected]>
[Why]
race condition of programming FP2 wrt pipe locking and vactive state can cause underflow/black screen
[How]
Enforce the FP2 is only programmed during vactive, and unlock pipe soon afterwards.
--- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 2 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 13 +++++++---- .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.h | 2 +- .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 23 +++++++++++-------- .../amd/display/dc/inc/hw/timing_generator.h | 2 +- 5 files changed, 24 insertions(+), 18 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +1 -1
@@ -2736,7 +2736,7 @@ static void dcn10_program_all_pipe_in_tree( pipe_ctx->pipe_dlg_param.vupdate_width); pipe_ctx->stream_res.tg->funcs->set_vtg_params ( - pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing); + pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing, true);if (hws->funcs.setup_vupdate_interrupt) hws->funcs.setup_vupdate_interrupt (dc, pipe_ctx);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c +8 -5
@@ -272,7 +272,7 @@ void optc1_program_timing( vupdate_offset, vupdate_width); - optc->funcs->set_vtg_params (optc, dc_crtc_timing); + optc->funcs->set_vtg_params (optc, dc_crtc_timing, true);/* TODO * patched_crtc_timing.flags.HORZ_COUNT_BY_TWO == 1
@@ -312,7 +312,7 @@ void optc1_program_timing( }void optc1_set_vtg_params (struct timing_generator *optc, -const struct dc_crtc_timing *dc_crtc_timing) +const struct dc_crtc_timing *dc_crtc_timing,bool program_fp2) {struct dc_crtc_timing patched_crtc_timing;uint32_t asic_blank_end;
@@ -348,9 +348,12 @@ void optc1_set_vtg_params(struct timing_generator *optc, } } -REG_UPDATE_2 (CONTROL , -VTG0_FP2 , v_fp2, -VTG0_VCOUNT_INIT , v_init); +if (program_fp2) +REG_UPDATE_2 (CONTROL , +VTG0_FP2 , v_fp2, +VTG0_VCOUNT_INIT , v_init); +else +REG_UPDATE (CONTROL ,VTG0_VCOUNT_INIT , v_init); }void optc1_set_blank_data_double_buffer (struct timing_generator *optc,bool enable)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h +1 -1
@@ -700,6 +700,6 @@ bool optc1_get_crc(struct timing_generator *optc,bool optc1_is_two_pixels_per_containter (const struct dc_crtc_timing *timing);void optc1_set_vtg_params (struct timing_generator *optc, -const struct dc_crtc_timing *dc_crtc_timing); +const struct dc_crtc_timing *dc_crtc_timing,bool program_fp2);#endif /* __DC_TIMING_GENERATOR_DCN10_H__ */
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +13 -10
@@ -1214,6 +1214,17 @@ void dcn20_pipe_control_lock( !flip_immediate)dcn20_setup_gsl_group_as_lock (dc, pipe, false); + +// If changing VTG FP2: wait until back in vactive to program FP2 +// Need to ensure that pipe unlock happens soon after to minimize race condition +if (!lock && pipe->update_flags.bits.global_sync) { + pipe->stream_res.tg->funcs->wait_for_state (pipe->stream_res.tg,CRTC_STATE_VBLANK ); + pipe->stream_res.tg->funcs->wait_for_state (pipe->stream_res.tg,CRTC_STATE_VACTIVE ); + + pipe->stream_res.tg->funcs->set_vtg_params ( + pipe->stream_res.tg, &pipe->stream->timing, true); + } +if (pipe->stream &&should_use_dmub_lock (pipe->stream->link)) {union dmub_hw_lock_flags hw_locks = {0 };struct dmub_hw_lock_inst_flags inst_flags = {0 };
@@ -1595,7 +1606,7 @@ static void dcn20_program_pipe( pipe_ctx->pipe_dlg_param.vupdate_width); pipe_ctx->stream_res.tg->funcs->set_vtg_params ( - pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing); + pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing, false);if (hws->funcs.setup_vupdate_interrupt) hws->funcs.setup_vupdate_interrupt (dc, pipe_ctx);
@@ -1695,14 +1706,6 @@ void dcn20_program_front_end_for_ctx( && context->res_ctx.pipe_ctx[i].stream) hws->funcs.blank_pixel_data(dc, &context->res_ctx.pipe_ctx[i], true); -/* wait for outstanding pending changes before adding or removing planes */ -for (i =0 ; i < dc->res_pool->pipe_count; i++) { -if (context->res_ctx.pipe_ctx[i].update_flags.bits.disable || - context->res_ctx.pipe_ctx[i].update_flags.bits.enable) { - dc->hwss.wait_for_pending_cleared (dc, context); -break ; - } - }/* Disconnect mpcc */ for (i =0 ; i < dc->res_pool->pipe_count; i++)
@@ -1856,7 +1859,7 @@ bool dcn20_update_bandwidth( pipe_ctx->pipe_dlg_param.vupdate_width); pipe_ctx->stream_res.tg->funcs->set_vtg_params ( - pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing); + pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing, false);if (pipe_ctx->prev_odm_pipe ==NULL ) hws->funcs.blank_pixel_data (dc, pipe_ctx, blank);
drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h +1 -1
@@ -271,7 +271,7 @@ struct timing_generator_funcs { struct dc_crtc_timing *hw_crtc_timing);void (*set_vtg_params)(struct timing_generator *optc, -const struct dc_crtc_timing *dc_crtc_timing); +const struct dc_crtc_timing *dc_crtc_timing,bool program_fp2); void (*set_dsc_config)(struct timing_generator *optc, enum optc_dsc_mode dsc_mode,
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/13 drm/amd/display: updated wm table for Renoir
In reply to Qingqing ZhuoFrom: Jake Wang <[email protected]>
[Why]
For certain timings, Renoir may underflow due to sr exit latency being too slow.
[How]
Updated wm table for renoir.
--- .../drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c +6 -6
@@ -746,24 +746,24 @@ static struct wm_table ddr4_wm_table_rn = { .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, + .sr_exit_time_us = 11.12, + .sr_enter_plus_exit_time_us = 12.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, + .sr_exit_time_us = 11.12, + .sr_enter_plus_exit_time_us = 12.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, + .sr_exit_time_us = 11.12, + .sr_enter_plus_exit_time_us = 12.48, .valid = true, }, }
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 9/13 drm/amd/display: Only update FP2 for full updates
In reply to Qingqing ZhuoFrom: Aric Cyr <[email protected]>
[Why]
FP2 is not double buffered and must wait for VACTIVE before programming.
[How]
Only update when there is a full update we should change FP2 to avoid delay every flip.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 20 +++++++++++++++++++ .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 11 ---------- 2 files changed, 20 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +20 -0
@@ -2625,6 +2625,26 @@ static void commit_planes_for_stream(struct dc *dc, } } +if (update_type !=UPDATE_TYPE_FAST ) { +// If changing VTG FP2: wait until back in vactive to program FP2 +// Need to ensure that pipe unlock happens soon after to minimize race condition +for (i =0 ; i < dc->res_pool->pipe_count; i++) { +struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i]; + +if (pipe_ctx->top_pipe || pipe_ctx->stream != stream) +continue ; + +if (!pipe_ctx->update_flags.bits.global_sync) +continue ; + + pipe_ctx->stream_res.tg->funcs->wait_for_state (pipe_ctx->stream_res.tg,CRTC_STATE_VBLANK ); + pipe_ctx->stream_res.tg->funcs->wait_for_state (pipe_ctx->stream_res.tg,CRTC_STATE_VACTIVE ); + + pipe_ctx->stream_res.tg->funcs->set_vtg_params ( + pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing, true); + } + } +if ((update_type !=UPDATE_TYPE_FAST ) && dc->hwss.interdependent_update_lock) dc->hwss.interdependent_update_lock (dc, context, false);else
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +0 -11
@@ -1214,17 +1214,6 @@ void dcn20_pipe_control_lock( !flip_immediate)dcn20_setup_gsl_group_as_lock (dc, pipe, false); - -// If changing VTG FP2: wait until back in vactive to program FP2 -// Need to ensure that pipe unlock happens soon after to minimize race condition -if (!lock && pipe->update_flags.bits.global_sync) { - pipe->stream_res.tg->funcs->wait_for_state (pipe->stream_res.tg,CRTC_STATE_VBLANK ); - pipe->stream_res.tg->funcs->wait_for_state (pipe->stream_res.tg,CRTC_STATE_VACTIVE ); - - pipe->stream_res.tg->funcs->set_vtg_params ( - pipe->stream_res.tg, &pipe->stream->timing, true); - } -if (pipe->stream &&should_use_dmub_lock (pipe->stream->link)) {union dmub_hw_lock_flags hw_locks = {0 };struct dmub_hw_lock_inst_flags inst_flags = {0 };
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 10/13 drm/amd/display: Fix OGAM LUT calculation precision
In reply to Qingqing ZhuoFrom: Felipe <[email protected]>
[Why]
The OGAM LUT precision was accumulating too much error in the higher end.
[How]
Instead of calculating all points of the LUT in relation to the previous ones, perform a full calculation in one of the intermediate segments to stop error propagation.
--- .../amd/display/modules/color/color_gamma.c | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/modules/color/color_gamma.c +17 -5
@@ -30,6 +30,14 @@#include "opp.h" #include "color_gamma.h" +/* When calculating LUT values the first region and at least one subsequent +* region are calculated with full precision. These defines are a demarcation +* of where the second region starts and ends. +* These are hardcoded values to avoid recalculating them in loops. +*/ +#define PRECISE_LUT_REGION_START 224 +#define PRECISE_LUT_REGION_END 239 +static struct hw_x_point coordinates_x[MAX_HW_POINTS +2 ];// these are helpers for calculations to reduce stack usage
@@ -346,7 +354,13 @@ static struct fixed31_32 translate_from_linear_space( dc_fixpt_recip(args->gamma)); } scratch_1 =dc_fixpt_add (one, args->a3); -if (cal_buffer->buffer_index <16 ) +/* In the first region (first 16 points) and in the +* region delimited by START/END we calculate with +* full precision to avoid error accumulation. +*/ +if ((cal_buffer->buffer_index >=PRECISE_LUT_REGION_START && + cal_buffer->buffer_index <=PRECISE_LUT_REGION_END ) || + (cal_buffer->buffer_index <16 )) scratch_2 =dc_fixpt_pow (args->arg,dc_fixpt_recip (args->gamma));else
@@ -397,9 +411,7 @@ static struct fixed31_32 translate_from_linear_space_long( dc_fixpt_recip(args->gamma))), args->a2); else - return dc_fixpt_mul( - args->arg, - args->a1); + return dc_fixpt_mul(args->arg, args->a1); }static struct fixed31_32 calculate_gamma22 (struct fixed31_32 arg,bool use_eetf,struct calculate_buffer *cal_buffer)
@@ -717,7 +729,6 @@ static struct fixed31_32 calculate_mapped_value(BREAK_TO_DEBUGGER (); result = dc_fixpt_zero; }else { -BREAK_TO_DEBUGGER (); result = dc_fixpt_one; }
@@ -976,6 +987,7 @@ static bool build_freesync_hdr(struct pwl_float_data_ex *rgb_regamma, cal_buffer->buffer_index =0 ;// see var definition for more info rgb +=32 ;// first 32 points have problems with fixed point, too small coord_x +=32 ; +for (i =32 ; i <= hw_points_num; i++) {if (!is_clipped) {if (use_eetf) {
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 11/13 drm/amd/display: Fix cleanup typo in MPCC visual confirm
In reply to Qingqing ZhuoFrom: Aric Cyr <[email protected]>
[Why]
Typo in MPCC visual confirmation.
[How]
Fix to correct values.
--- .../gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +7 -10
@@ -2243,11 +2243,11 @@ void dcn20_get_mpctree_visual_confirm_color( {const struct tg_color pipe_colors[6 ] = { {MAX_TG_COLOR_VALUE ,0 ,0 },// red - {MAX_TG_COLOR_VALUE ,0 ,MAX_TG_COLOR_VALUE },// yellow - {0 ,MAX_TG_COLOR_VALUE ,0 },// blue + {MAX_TG_COLOR_VALUE ,MAX_TG_COLOR_VALUE /4 ,0 },// orange + {MAX_TG_COLOR_VALUE ,MAX_TG_COLOR_VALUE ,0 },// yellow + {0 ,MAX_TG_COLOR_VALUE ,0 },// green + {0 ,0 ,MAX_TG_COLOR_VALUE },// blue {MAX_TG_COLOR_VALUE /2 ,0 ,MAX_TG_COLOR_VALUE /2 },// purple - {0 ,0 ,MAX_TG_COLOR_VALUE },// green - {MAX_TG_COLOR_VALUE ,MAX_TG_COLOR_VALUE *2 /3 ,0 },// orange };struct pipe_ctx *top_pipe = pipe_ctx;
@@ -2272,14 +2272,11 @@ void dcn20_update_mpcc(struct dc *dc, struct pipe_ctx *pipe_ctx)// input to MPCC is always RGB, by default leave black_color at 0 if (dc->debug.visual_confirm ==VISUAL_CONFIRM_HDR ) { - hws->funcs.get_hdr_visual_confirm_color ( - pipe_ctx, &blnd_cfg.black_color); + hws->funcs.get_hdr_visual_confirm_color (pipe_ctx, &blnd_cfg.black_color); }else if (dc->debug.visual_confirm ==VISUAL_CONFIRM_SURFACE ) { - hws->funcs.get_surface_visual_confirm_color ( - pipe_ctx, &blnd_cfg.black_color); + hws->funcs.get_surface_visual_confirm_color (pipe_ctx, &blnd_cfg.black_color); }else if (dc->debug.visual_confirm ==VISUAL_CONFIRM_MPCTREE ) { -dcn20_get_mpctree_visual_confirm_color ( - pipe_ctx, &blnd_cfg.black_color); +dcn20_get_mpctree_visual_confirm_color (pipe_ctx, &blnd_cfg.black_color); }if (per_pixel_alpha)
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 12/13 drm/amd/display: [FW Promotion] Release 0.0.46
In reply to Qingqing ZhuoFrom: Anthony Koo <[email protected]>
- Add new aux_channel_type
- Changed port_index to instance in dmub_cmd_dp_aux_control_data
- Change aux_return_code_type to sync up with driver
- param for ramping abm based on backlight level
--- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 62 +++++++++++-------- 1 file changed, 37 insertions(+), 25 deletions(-)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +37 -25
@@ -47,10 +47,10 @@/* Firmware versioning. */ #ifdef DMUB_EXPOSE_VERSION -#define DMUB_FW_VERSION_GIT_HASH 0x931573111 +#define DMUB_FW_VERSION_GIT_HASH 0xa18e25995#define DMUB_FW_VERSION_MAJOR 0#define DMUB_FW_VERSION_MINOR 0 -#define DMUB_FW_VERSION_REVISION 45 +#define DMUB_FW_VERSION_REVISION 46#define DMUB_FW_VERSION_TEST 0#define DMUB_FW_VERSION_VBIOS 0#define DMUB_FW_VERSION_HOTFIX 0
@@ -514,12 +514,20 @@ enum dp_aux_request_action {enum aux_return_code_type {AUX_RET_SUCCESS =0 , +AUX_RET_ERROR_UNKNOWN , +AUX_RET_ERROR_INVALID_REPLY ,AUX_RET_ERROR_TIMEOUT , -AUX_RET_ERROR_NO_DATA , +AUX_RET_ERROR_HPD_DISCON , +AUX_RET_ERROR_ENGINE_ACQUIRE ,AUX_RET_ERROR_INVALID_OPERATION ,AUX_RET_ERROR_PROTOCOL_ERROR , }; +enum aux_channel_type { +AUX_CHANNEL_LEGACY_DDC , +AUX_CHANNEL_DPIA +}; +/* DP AUX command */ struct aux_transaction_parameters {uint8_t is_i2c_over_aux;
@@ -532,9 +540,10 @@ struct aux_transaction_parameters {struct dmub_cmd_dp_aux_control_data {uint32_t handle; -uint8_t port_index; +uint8_t instance;uint8_t sw_crc_enabled;uint16_t timeout; +enum aux_channel_type type;struct aux_transaction_parameters dpaux; };
@@ -558,7 +567,7 @@ struct aux_reply_data {struct aux_reply_control_data {uint32_t handle; -uint8_t phy_port_index; +uint8_t instance;uint8_t result;uint16_t pad; };
@@ -581,7 +590,7 @@ enum dp_hpd_status { };struct dp_hpd_data { -uint8_t phy_port_index; +uint8_t instance;uint8_t hpd_type;uint8_t hpd_status;uint8_t pad;
@@ -732,27 +741,30 @@ enum dmub_cmd_abm_type {struct abm_config_table {/* Parameters for crgb conversion */ uint16_t crgb_thresh[NUM_POWER_FN_SEGS ];// 0B -uint16_t crgb_offset[NUM_POWER_FN_SEGS ];// 15B -uint16_t crgb_slope[NUM_POWER_FN_SEGS ];// 31B +uint16_t crgb_offset[NUM_POWER_FN_SEGS ];// 16B +uint16_t crgb_slope[NUM_POWER_FN_SEGS ];// 32B /* Parameters for custom curve */ -uint16_t backlight_thresholds[NUM_BL_CURVE_SEGS ];// 47B -uint16_t backlight_offsets[NUM_BL_CURVE_SEGS ];// 79B - -uint16_t ambient_thresholds_lux[NUM_AMBI_LEVEL ];// 111B -uint16_t min_abm_backlight;// 121B - -uint8_t min_reduction[NUM_AMBI_LEVEL ][NUM_AGGR_LEVEL ];// 123B -uint8_t max_reduction[NUM_AMBI_LEVEL ][NUM_AGGR_LEVEL ];// 143B -uint8_t bright_pos_gain[NUM_AMBI_LEVEL ][NUM_AGGR_LEVEL ];// 163B -uint8_t dark_pos_gain[NUM_AMBI_LEVEL ][NUM_AGGR_LEVEL ];// 183B -uint8_t hybrid_factor[NUM_AGGR_LEVEL ];// 203B -uint8_t contrast_factor[NUM_AGGR_LEVEL ];// 207B -uint8_t deviation_gain[NUM_AGGR_LEVEL ];// 211B -uint8_t min_knee[NUM_AGGR_LEVEL ];// 215B -uint8_t max_knee[NUM_AGGR_LEVEL ];// 219B -uint8_t iir_curve[NUM_AMBI_LEVEL ];// 223B -uint8_t pad3[3 ];// 228B +uint16_t backlight_thresholds[NUM_BL_CURVE_SEGS ];// 48B +uint16_t backlight_offsets[NUM_BL_CURVE_SEGS ];// 78B + +uint16_t ambient_thresholds_lux[NUM_AMBI_LEVEL ];// 112B +uint16_t min_abm_backlight;// 122B + +uint8_t min_reduction[NUM_AMBI_LEVEL ][NUM_AGGR_LEVEL ];// 124B +uint8_t max_reduction[NUM_AMBI_LEVEL ][NUM_AGGR_LEVEL ];// 144B +uint8_t bright_pos_gain[NUM_AMBI_LEVEL ][NUM_AGGR_LEVEL ];// 164B +uint8_t dark_pos_gain[NUM_AMBI_LEVEL ][NUM_AGGR_LEVEL ];// 184B +uint8_t hybrid_factor[NUM_AGGR_LEVEL ];// 204B +uint8_t contrast_factor[NUM_AGGR_LEVEL ];// 208B +uint8_t deviation_gain[NUM_AGGR_LEVEL ];// 212B +uint8_t min_knee[NUM_AGGR_LEVEL ];// 216B +uint8_t max_knee[NUM_AGGR_LEVEL ];// 220B +uint8_t iir_curve[NUM_AMBI_LEVEL ];// 224B +uint8_t pad3[3 ];// 229B + +uint16_t blRampReduction[NUM_AGGR_LEVEL ];// 232B +uint16_t blRampStart[NUM_AGGR_LEVEL ];// 240B };struct dmub_cmd_abm_set_pipe_data {
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 13/13 drm/amd/display: 3.2.116
In reply to Qingqing ZhuoFrom: 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
@@ -42,7 +42,7 @@#include "inc/hw/dmcu.h" #include "dml/display_mode_lib.h" -#define DC_VER "3.2.115" +#define DC_VER "3.2.116"#define MAX_SURFACES 3#define MAX_PLANES 6
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx