DC Patches June 27th, 2024
cover DC Patches June 27th, 2024
This DC patchset brings improvements in multiple areas. In summary, we highlight:
* FW Release 0.0.224.0
* Fix bw issue for dcn351
* Fix FAMS2 logic issue for dcn401
* Fix Coverity issues
* Fix cursor issues
* Refactor dio sources
Alex Hung (3):
drm/amd/display: Fix possible overflow in integer multiplication drm/amd/display: Check denominator pbn_div before used drm/amd/display: Check denominator crb_pipes before used
Alvin Lee (1):
drm/amd/display: Account for cursor prefetch BW in DML1 mode support
Anthony Koo (1):
drm/amd/display: Add replay state entry to replay_state
Aric Cyr (1):
drm/amd/display: 3.2.291
Bhuvanachandra Pinninti (1):
drm/amd/display: Move dio files into dio folder
Dillon Varone (1):
drm/amd/display: Cleanup dce_get_dp_ref_freq_khz
Fangzhi Zuo (2):
drm/amd/display: Fix dmub timeout after fams2 enabled drm/amd/display: Update efficiency bandwidth for dcn351
George Shen (2):
drm/amd/display: Fix divide by zero in CURSOR_DST_X_OFFSET calculation drm/amd/display: Add ASIC cap to limit DCC surface width
Joshua Aberback (1):
drm/amd/display: Remove unnecessary error message
Nevenko Stupar (1):
drm/amd/display: Adjust cursor visibility between MPC slices
Nicholas Kazlauskas (1):
drm/amd/display: Add debug option for disabling SLDO optimizations
Paul Hsieh (1):
drm/amd/display: un-block 8k with single dimm
Roman Li (1):
drm/amd/display: Fix array-index-out-of-bounds in
dml2/FCLKChangeSupport
Ryan Seto (1):
drm/amd/display: Add available bandwidth calculation for audio
(#16909)
Sherry Wang (1):
drm/amd/display: Skip unnecessary abm disable
Sung Joon Kim (1):
drm/amd/display: Choose HUBP unbounded request based on DML output
Teeger (1):
drm/amd/display: Revert Add workaround to restrict max frac urgent for
DPM0
Tom Chung (3):
drm/amd/display: Reset freesync config before update new state drm/amd/display: Add refresh rate range check drm/amd/display: Fix refresh rate range for some panel
Wenjing Liu (1):
drm/amd/display: fix a crash when clock source is reference for non
otg master pipe
Xi (Alex) Liu (1):
drm/amd/display: replace CRTC disable function call
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 55 +++++++++++++++-
.../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 4 +-
.../drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 2 +-
.../gpu/drm/amd/display/dc/basics/dce_calcs.c | 2 +-
.../display/dc/clk_mgr/dce100/dce_clk_mgr.c | 2 +-
.../display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 2 +-
.../display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c | 4 +-
.../dc/clk_mgr/dcn401/dcn401_clk_mgr.c | 38 ++++++------
.../gpu/drm/amd/display/dc/core/dc_resource.c | 8 +--
.../gpu/drm/amd/display/dc/core/dc_stream.c | 6 +-
drivers/gpu/drm/amd/display/dc/dc.h | 4 +-
.../gpu/drm/amd/display/dc/dce/dce_audio.c | 5 +-
.../drm/amd/display/dc/dce/dce_clock_source.c | 8 +--
.../drm/amd/display/dc/dce/dce_panel_cntl.c | 2 +-
drivers/gpu/drm/amd/display/dc/dcn10/Makefile | 1 -
drivers/gpu/drm/amd/display/dc/dcn20/Makefile | 1 -
drivers/gpu/drm/amd/display/dc/dcn30/Makefile | 2 -
drivers/gpu/drm/amd/display/dc/dcn31/Makefile | 2 +-
drivers/gpu/drm/amd/display/dc/dio/Makefile | 36 +++++++++++
.../dc/{ => dio}/dcn10/dcn10_link_encoder.c | 0
.../dc/{ => dio}/dcn10/dcn10_link_encoder.h | 0
.../dc/{ => dio}/dcn10/dcn10_stream_encoder.c | 0
.../dc/{ => dio}/dcn10/dcn10_stream_encoder.h | 0
.../dc/{ => dio}/dcn20/dcn20_link_encoder.c | 0
.../dc/{ => dio}/dcn20/dcn20_link_encoder.h | 0
.../dc/{ => dio}/dcn20/dcn20_stream_encoder.c | 0
.../dc/{ => dio}/dcn20/dcn20_stream_encoder.h | 0
.../{ => dio}/dcn30/dcn30_dio_link_encoder.c | 0
.../{ => dio}/dcn30/dcn30_dio_link_encoder.h | 0
.../dcn30/dcn30_dio_stream_encoder.c | 0
.../dcn30/dcn30_dio_stream_encoder.h | 0
.../{ => dio}/dcn31/dcn31_dio_link_encoder.c | 0
.../{ => dio}/dcn31/dcn31_dio_link_encoder.h | 0
.../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 2 +-
.../dc/dml/dcn32/display_mode_vba_32.c | 3 +
.../amd/display/dc/dml2/dml21/dml21_wrapper.c | 7 ++-
.../display/dc/dml2/dml2_translation_helper.c | 1 +
.../gpu/drm/amd/display/dc/dml2/dml2_utils.c | 14 +----
.../drm/amd/display/dc/dml2/dml2_wrapper.c | 15 -----
.../drm/amd/display/dc/dml2/dml2_wrapper.h | 2 -
.../display/dc/hubbub/dcn401/dcn401_hubbub.c | 6 ++
.../amd/display/dc/hubp/dcn401/dcn401_hubp.c | 15 ++++-
.../amd/display/dc/hwss/dce110/dce110_hwseq.c | 62 +++++++++++++++++--
.../amd/display/dc/hwss/dcn10/dcn10_hwseq.c | 2 +-
.../amd/display/dc/hwss/dcn21/dcn21_hwseq.c | 6 ++
.../amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 47 +++++++++++---
.../amd/display/dc/hwss/dcn401/dcn401_hwseq.h | 1 +
.../link/protocols/link_edp_panel_control.c | 2 +-
.../dc/resource/dcn314/dcn314_resource.c | 22 -------
.../dc/resource/dcn315/dcn315_resource.c | 2 +-
.../dc/resource/dcn35/dcn35_resource.c | 2 -
.../dc/resource/dcn401/dcn401_resource.c | 3 +
drivers/gpu/drm/amd/display/dc/spl/dc_spl.c | 8 +--
drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 1 +
.../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 5 +-
.../gpu/drm/amd/display/dmub/src/dmub_dcn35.c | 1 +
.../amd/display/modules/freesync/freesync.c | 2 +-
57 files changed, 287 insertions(+), 128 deletions(-)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn10/dcn10_link_encoder.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn10/dcn10_link_encoder.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn10/dcn10_stream_encoder.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn10/dcn10_stream_encoder.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn20/dcn20_link_encoder.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn20/dcn20_link_encoder.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn20/dcn20_stream_encoder.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn20/dcn20_stream_encoder.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn30/dcn30_dio_link_encoder.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn30/dcn30_dio_link_encoder.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn30/dcn30_dio_stream_encoder.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn30/dcn30_dio_stream_encoder.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn31/dcn31_dio_link_encoder.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn31/dcn31_dio_link_encoder.h (100%)Signature · 1 line
2.34.1
PATCH 1/26 drm/amd/display: Add replay state entry to replay_state
From: Anthony Koo <[email protected]>
- Add new Replay states 2A (initial Replay entry) and 4E (frame update) to check is there is new frame update before sending
--- drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +2 -0
@@ -3326,6 +3326,7 @@ enum replay_state {REPLAY_STATE_1 =0x10 ,REPLAY_STATE_1A =0x11 ,REPLAY_STATE_2 =0x20 , +REPLAY_STATE_2A =0x21 ,REPLAY_STATE_3 =0x30 ,REPLAY_STATE_3INIT =0x31 , REPLAY_STATE_4 = 0x40,
@@ -3333,6 +3334,7 @@ enum replay_state {REPLAY_STATE_4B =0x42 ,REPLAY_STATE_4C =0x43 ,REPLAY_STATE_4D =0x44 , +REPLAY_STATE_4E =0x45 ,REPLAY_STATE_4B_LOCKED =0x4A ,REPLAY_STATE_4C_UNLOCKED =0x4B , REPLAY_STATE_5 = 0x50,
Signature · 1 line
2.34.1
PATCH 2/26 drm/amd/display: Reset freesync config before update new state
In reply to Fangzhi ZuoFrom: Tom Chung <[email protected]>
[Why]
Sometimes the new_crtc_state->vrr_infopacket did not sync up with the current state.
It will affect the update_freesync_state_on_stream() does not update the state correctly.
[How]
Reset the freesync config before get_freesync_config_for_crtc() to make sure we have the correct new_crtc_state for VRR.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
@@ -10471,6 +10471,7 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm, }/* Update Freesync settings. */ +reset_freesync_config_for_crtc (dm_new_crtc_state);get_freesync_config_for_crtc (dm_new_crtc_state, dm_new_conn_state);
Signature · 1 line
2.34.1
PATCH 3/26 drm/amd/display: Fix divide by zero in CURSOR_DST_X_OFFSET calculation
In reply to Fangzhi ZuoFrom: George Shen <[email protected]>
[Why]
Certain situations cause pipes to have a recout of 0, such as when the dst_rect lies completely outside of a given ODM slice.
[How]
Skip calculation that transforms cursor coordinates to viewport space.
--- .../drm/amd/display/dc/hubp/dcn401/dcn401_hubp.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/hubp/dcn401/dcn401_hubp.c +13 -2
@@ -677,12 +677,23 @@ void hubp401_cursor_set_position(int rec_x_offset = x_pos - pos->x_hotspot;int rec_y_offset = y_pos - pos->y_hotspot;int dst_x_offset; -int x_pos_viewport = x_pos * param->viewport.width / param->recout.width; -int x_hot_viewport = pos->x_hotspot * param->viewport.width / param->recout.width; +int x_pos_viewport =0 ; +int x_hot_viewport =0 ;uint32_t cur_en = pos->enable ?1 :0 ; hubp->curs_pos = *pos; +/* Recout is zero for pipes if the entire dst_rect is contained +* within preceeding ODM slices. +*/ +if (param->recout.width) { + x_pos_viewport = x_pos * param->viewport.width / param->recout.width; + x_hot_viewport = pos->x_hotspot * param->viewport.width / param->recout.width; + }else { +ASSERT (!cur_en || x_pos ==0 ); +ASSERT (!cur_en || pos->x_hotspot ==0 ); + } +/* * Guard aganst cursor_set_position() from being called with invalid * attributes
Signature · 1 line
2.34.1
PATCH 4/26 drm/amd/display: Remove unnecessary error message
In reply to Fangzhi ZuoFrom: Joshua Aberback <[email protected]>
[Why]
This error message is unnecessary because returning when aconnector is uninitialized is the desired outcome during initialization. As well, there is no equivalent error message for read_dpcd.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +1 -3
@@ -575,10 +575,8 @@ bool dm_helpers_dp_write_dpcd( {struct amdgpu_dm_connector *aconnector = link->priv; -if (!aconnector) { -DRM_ERROR ("Failed to find connector for link!" ); +if (!aconnector)return false; - }return drm_dp_dpcd_write (&aconnector->dm_dp_aux.aux, address, (uint8_t *)data, size) >0 ;
Signature · 1 line
2.34.1
PATCH 5/26 drm/amd/display: Choose HUBP unbounded request based on DML output
In reply to Fangzhi ZuoFrom: Sung Joon Kim <[email protected]>
[why]
Previously, we decide on the unbounded request purely based on pipe_cnt which is a wrong variable to use to determine how many pipes are in "use". DML already accounts for number of pipes in use along with other various factors and is a more reliable method of determination.
[how]
Use UnboundedRequestEnabledThisState to decide
on unbounbded_req_enabled.
--- drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c +2 -10
@@ -288,7 +288,6 @@ void dml2_calculate_rq_and_dlg_params(const struct dc *dc, struct dc_state *cont {unsigned int dc_pipe_ctx_index, dml_pipe_idx, plane_id;enum mall_stream_type pipe_mall_type; -bool unbounded_req_enabled = false;struct dml2_calculate_rq_and_dlg_params_scratch *s = &in_ctx->v20.scratch.calculate_rq_and_dlg_params_scratch; context->bw_ctx.bw.dcn.clk.dcfclk_deep_sleep_khz = (unsigned int )in_ctx->v20.dml_core_ctx.mp.DCFCLKDeepSleep *1000 ;
@@ -302,14 +301,6 @@ void dml2_calculate_rq_and_dlg_params(const struct dc *dc, struct dc_state *contif (context->bw_ctx.bw.dcn.clk.dispclk_khz < dc->debug.min_disp_clk_khz) context->bw_ctx.bw.dcn.clk.dispclk_khz = dc->debug.min_disp_clk_khz; - unbounded_req_enabled = in_ctx->v20.dml_core_ctx.ms.UnboundedRequestEnabledThisState; - -if (unbounded_req_enabled && pipe_cnt >1 ) { -// Unbounded requesting should not ever be used when more than 1 pipe is enabled. -//ASSERT(false); - unbounded_req_enabled = false; - } - context->bw_ctx.bw.dcn.compbuf_size_kb = in_ctx->v20.dml_core_ctx.ip.config_return_buffer_size_in_kbytes;for (dc_pipe_ctx_index =0 ; dc_pipe_ctx_index < pipe_cnt; dc_pipe_ctx_index++) {
@@ -344,7 +335,8 @@ void dml2_calculate_rq_and_dlg_params(const struct dc *dc, struct dc_state *cont context->res_ctx.pipe_ctx[dc_pipe_ctx_index].unbounded_req = false; }else { context->res_ctx.pipe_ctx[dc_pipe_ctx_index].det_buffer_size_kb =dml_get_det_buffer_size_kbytes (&context->bw_ctx.dml2->v20.dml_core_ctx, dml_pipe_idx); - context->res_ctx.pipe_ctx[dc_pipe_ctx_index].unbounded_req = unbounded_req_enabled; +// Unbounded requesting should not ever be used when more than 1 pipe is enabled. + context->res_ctx.pipe_ctx[dc_pipe_ctx_index].unbounded_req = in_ctx->v20.dml_core_ctx.ms.UnboundedRequestEnabledThisState; } context->bw_ctx.bw.dcn.compbuf_size_kb -= context->res_ctx.pipe_ctx[dc_pipe_ctx_index].det_buffer_size_kb;
Signature · 1 line
2.34.1
PATCH 6/26 drm/amd/display: Revert Add workaround to restrict max frac urgent for DPM0
In reply to Fangzhi ZuoFrom: Teeger <[email protected]>
This reverts commit a698d910ea7714e512261fa due to multiple issues found.
--- .../gpu/drm/amd/display/dc/dml2/dml2_wrapper.c | 15 --------------- .../gpu/drm/amd/display/dc/dml2/dml2_wrapper.h | 2 -- .../display/dc/resource/dcn35/dcn35_resource.c | 2 -- 3 files changed, 19 deletions(-)
drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.c +0 -15
@@ -626,21 +626,6 @@ static bool dml2_validate_and_build_resource(const struct dc *in_dc, struct dc_sif (result) {unsigned int lowest_state_idx = s->mode_support_params.out_lowest_state_idx; -double min_fclk_mhz_for_urgent_workaround = (double )dml2->config.min_fclk_for_urgent_workaround_khz /1000.0 ; -double max_frac_urgent = (double )dml2->config.max_frac_urgent_for_min_fclk_x1000 /1000.0 ; - -if (min_fclk_mhz_for_urgent_workaround >0.0 && max_frac_urgent >0.0 && - (dml2->v20.dml_core_ctx.mp.FractionOfUrgentBandwidth > max_frac_urgent || - dml2->v20.dml_core_ctx.mp.FractionOfUrgentBandwidthImmediateFlip > max_frac_urgent)) { -unsigned int forced_lowest_state_idx = lowest_state_idx; - -while (forced_lowest_state_idx < dml2->v20.dml_core_ctx.states.num_states && - dml2->v20.dml_core_ctx.states.state_array[forced_lowest_state_idx].fabricclk_mhz <= min_fclk_mhz_for_urgent_workaround) { - forced_lowest_state_idx +=1 ; - } - lowest_state_idx = forced_lowest_state_idx; - } - out_clks.dispclk_khz = (unsigned int )dml2->v20.dml_core_ctx.mp.Dispclk_calculated *1000 ; out_clks.p_state_supported = s->mode_support_info.DRAMClockChangeSupport[0 ] != dml_dram_clock_change_unsupported; if (in_dc->config.use_default_clock_table &&
drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h +0 -2
@@ -237,8 +237,6 @@ struct dml2_configuration_options {bool use_clock_dc_limits;bool gpuvm_enable;struct dml2_soc_bb *bb_from_dmub; -int max_frac_urgent_for_min_fclk_x1000; -int min_fclk_for_urgent_workaround_khz; };/*
drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c +0 -2
@@ -2153,8 +2153,6 @@ static bool dcn35_resource_construct( dc->dml2_options.max_segments_per_hubp =24 ; dc->dml2_options.det_segment_size =DCN3_2_DET_SEG_SIZE ;/*todo*/ - dc->dml2_options.max_frac_urgent_for_min_fclk_x1000 =900 ; - dc->dml2_options.min_fclk_for_urgent_workaround_khz =400 *1000 ;if (dc->config.sdpif_request_limit_words_per_umc ==0 ) dc->config.sdpif_request_limit_words_per_umc =16 ;/*todo*/
Signature · 1 line
2.34.1
PATCH 7/26 drm/amd/display: Add ASIC cap to limit DCC surface width
In reply to Fangzhi ZuoFrom: George Shen <[email protected]>
[Why]
Certain configurations of DCN401 require ODM4:1 to support DCC for 10K surfaces. DCC should be conservatively disabled in those cases.
The issue is that current logic limits 10K surface DCC for all configurations of DCN401.
[How]
Add DC ASIC cap to indicate max surface width that can support DCC. Disable DCC if this ASIC cap is non-zero and surface width exceeds it.
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 ++ .../gpu/drm/amd/display/dc/hubbub/dcn401/dcn401_hubbub.c | 6 ++++++ .../drm/amd/display/dc/resource/dcn401/dcn401_resource.c | 3 +++ 3 files changed, 11 insertions(+)
drivers/gpu/drm/amd/display/dc/dc.h +2 -0
@@ -293,6 +293,8 @@ struct dc_caps {bool cursor_not_scaled;bool dcmode_power_limits_present;bool sequential_ono; +/* Conservative limit for DCC cases which require ODM4:1 to support*/ +uint32_t dcc_plane_width_limit; };struct dc_bug_wa {
drivers/gpu/drm/amd/display/dc/hubbub/dcn401/dcn401_hubbub.c +6 -0
@@ -829,6 +829,7 @@ bool hubbub401_get_dcc_compression_cap(struct hubbub *hubbub, struct dc_surface_dcc_cap *output) {struct dc *dc = hubbub->ctx->dc; +const unsigned int max_dcc_plane_width = dc->caps.dcc_plane_width_limit;/* DCN4_Programming_Guide_DCHUB.docx, Section 5.11.2.2 */ enum dcc_control dcc_control;unsigned int plane0_bpe, plane1_bpe;
@@ -843,6 +844,11 @@ bool hubbub401_get_dcc_compression_cap(struct hubbub *hubbub,if (dc->debug.disable_dcc ==DCC_DISABLE )return false; +/* Conservatively disable DCC for cases where ODM4:1 may be required. */ +if (max_dcc_plane_width !=0 && + (input->surface_size.width > max_dcc_plane_width || input->plane1_size.width > max_dcc_plane_width)) +return false; +switch (input->format) {default : is_dual_plane = false;
drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c +3 -0
@@ -1822,6 +1822,9 @@ static bool dcn401_resource_construct( dc->caps.extended_aux_timeout_support = true; dc->caps.dmcub_support = true; +if (ASICREV_IS_GC_12_0_1_A0 (dc->ctx->asic_id.hw_internal_rev)) + dc->caps.dcc_plane_width_limit =7680 ; +/* Color pipeline capabilities */ dc->caps.color.dpp.dcn_arch =1 ; dc->caps.color.dpp.input_lut_shared =0 ;
Signature · 1 line
2.34.1
PATCH 8/26 drm/amd/display: Fix possible overflow in integer multiplication
In reply to Fangzhi ZuoFrom: Alex Hung <[email protected]>
[WHAT & HOW]
Integer multiplies integer may overflow in context that expects an expression of unsigned/siged long long (64 bits). This can be fixed by casting integer to unsigned/siged long long to force 64 bits results.
This fixes 26 OVERFLOW_BEFORE_WIDEN issues reported by Coverity.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 2 +- drivers/gpu/drm/amd/display/dc/basics/dce_calcs.c | 2 +- .../gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 2 +- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 8 ++++---- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 6 +++--- drivers/gpu/drm/amd/display/dc/dce/dce_audio.c | 2 +- drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c | 8 ++++---- drivers/gpu/drm/amd/display/dc/dce/dce_panel_cntl.c | 2 +- drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 2 +- drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c | 2 +- .../display/dc/link/protocols/link_edp_panel_control.c | 2 +- drivers/gpu/drm/amd/display/dc/spl/dc_spl.c | 8 ++++---- drivers/gpu/drm/amd/display/modules/freesync/freesync.c | 2 +- 13 files changed, 24 insertions(+), 24 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c +1 -1
@@ -158,7 +158,7 @@ void amdgpu_dm_psr_enable(struct dc_stream_state *stream)DRM_DEBUG_DRIVER ("Enabling psr...\n" ); vsync_rate_hz =div64_u64 (div64_u64 (( - stream->timing.pix_clk_100hz *100 ), + stream->timing.pix_clk_100hz * (uint64_t )100 ), stream->timing.v_total), stream->timing.h_total);
drivers/gpu/drm/amd/display/dc/basics/dce_calcs.c +1 -1
@@ -1853,7 +1853,7 @@ static void calculate_bandwidth(/*compute total time to request one chunk from each active display pipe*/ for (i =0 ; i <= maximum_number_of_surfaces -1 ; i++) {if (data->enable[i]) { - data->chunk_request_time =bw_add (data->chunk_request_time, (bw_div ((bw_div (bw_int_to_fixed (pixels_per_chunk * data->bytes_per_pixel[i]), data->useful_bytes_per_request[i])),bw_min2 (sclk[data->sclk_level],bw_div (data->dispclk,bw_int_to_fixed (2 )))))); + data->chunk_request_time =bw_add (data->chunk_request_time, (bw_div ((bw_div (bw_int_to_fixed (pixels_per_chunk * (int64_t )data->bytes_per_pixel[i]), data->useful_bytes_per_request[i])),bw_min2 (sclk[data->sclk_level],bw_div (data->dispclk,bw_int_to_fixed (2 )))))); } }/*compute total time to request cursor data*/
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c +1 -1
@@ -576,7 +576,7 @@ static void dcn32_auto_dpm_test_log( p_state_list[i] = curr_pipe_ctx->p_state_type; refresh_rate = (curr_pipe_ctx->stream->timing.pix_clk_100hz * (uint64_t )100 + - curr_pipe_ctx->stream->timing.v_total * curr_pipe_ctx->stream->timing.h_total - (uint64_t )1 ); + curr_pipe_ctx->stream->timing.v_total * (uint64_t )curr_pipe_ctx->stream->timing.h_total - (uint64_t )1 ); refresh_rate =div_u64 (refresh_rate, curr_pipe_ctx->stream->timing.v_total); refresh_rate =div_u64 (refresh_rate, curr_pipe_ctx->stream->timing.h_total); disp_src_refresh_list[i] = refresh_rate;
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +4 -4
@@ -888,21 +888,21 @@ static struct rect calculate_plane_rec_in_timing_active(struct rect rec_out = {0 };struct fixed31_32 temp; - temp =dc_fixpt_from_fraction (rec_in->x * stream->dst.width, + temp =dc_fixpt_from_fraction (rec_in->x * (long long )stream->dst.width, stream->src.width); rec_out.x = stream->dst.x +dc_fixpt_round (temp); temp =dc_fixpt_from_fraction ( - (rec_in->x + rec_in->width) * stream->dst.width, + (rec_in->x + rec_in->width) * (long long )stream->dst.width, stream->src.width); rec_out.width = stream->dst.x +dc_fixpt_round (temp) - rec_out.x; - temp =dc_fixpt_from_fraction (rec_in->y * stream->dst.height, + temp =dc_fixpt_from_fraction (rec_in->y * (long long )stream->dst.height, stream->src.height); rec_out.y = stream->dst.y +dc_fixpt_round (temp); temp =dc_fixpt_from_fraction ( - (rec_in->y + rec_in->height) * stream->dst.height, + (rec_in->y + rec_in->height) * (long long )stream->dst.height, stream->src.height); rec_out.height = stream->dst.y +dc_fixpt_round (temp) - rec_out.y;
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +3 -3
@@ -975,7 +975,7 @@ static int dc_stream_calculate_flickerless_refresh_rate(struct dc_stream_state * }if (search_for_max_increase) -return (int )div64_s64 ((long long )stream->timing.pix_clk_100hz*100 , stream->timing.v_total*stream->timing.h_total); +return (int )div64_s64 ((long long )stream->timing.pix_clk_100hz*100 , stream->timing.v_total*(long long )stream->timing.h_total);else return stream->lumin_data.refresh_rate_hz[0 ]; }
@@ -1024,7 +1024,7 @@ static unsigned int dc_stream_get_max_flickerless_instant_vtotal_delta(struct dcif (stream->timing.v_total * stream->timing.h_total ==0 )return 0 ; -int current_refresh_hz = (int )div64_s64 ((long long )stream->timing.pix_clk_100hz*100 , stream->timing.v_total*stream->timing.h_total); +int current_refresh_hz = (int )div64_s64 ((long long )stream->timing.pix_clk_100hz*100 , stream->timing.v_total*(long long )stream->timing.h_total); int safe_refresh_hz = dc_stream_calculate_flickerless_refresh_rate(stream, dc_stream_get_brightness_millinits_from_refresh(stream, current_refresh_hz),
@@ -1032,7 +1032,7 @@ static unsigned int dc_stream_get_max_flickerless_instant_vtotal_delta(struct dc is_gaming, increase); -int safe_refresh_v_total = (int )div64_s64 ((long long )stream->timing.pix_clk_100hz*100 , safe_refresh_hz*stream->timing.h_total); +int safe_refresh_v_total = (int )div64_s64 ((long long )stream->timing.pix_clk_100hz*100 , safe_refresh_hz*(long long )stream->timing.h_total);if (increase)return (((int ) stream->timing.v_total - safe_refresh_v_total) >=0 ) ? (stream->timing.v_total - safe_refresh_v_total) :0 ;
drivers/gpu/drm/amd/display/dc/dce/dce_audio.c +1 -1
@@ -353,7 +353,7 @@ static uint32_t calculate_required_audio_bw_in_symbols(/* DP spec recommends between 1.05 to 1.1 safety margin to prevent sample under-run */ struct fixed31_32 audio_sdp_margin =dc_fixpt_from_fraction (110 ,100 );struct fixed31_32 horizontal_line_freq_khz =dc_fixpt_from_fraction ( - crtc_info->requested_pixel_clock_100Hz, crtc_info->h_total *10 ); + crtc_info->requested_pixel_clock_100Hz, (long long )crtc_info->h_total *10 );struct fixed31_32 samples_per_line;struct fixed31_32 layouts_per_line;struct fixed31_32 symbols_per_sdp_max_layout;
drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c +4 -4
@@ -217,7 +217,7 @@ static bool calc_fb_divider_checking_tolerance( actual_calc_clk_100hz = (uint64_t )feedback_divider * calc_pll_cs->fract_fb_divider_factor + fract_feedback_divider; - actual_calc_clk_100hz *= calc_pll_cs->ref_freq_khz *10 ; + actual_calc_clk_100hz *= (uint64_t )calc_pll_cs->ref_freq_khz *10 ; actual_calc_clk_100hz = div_u64(actual_calc_clk_100hz, ref_divider * post_divider *
@@ -680,7 +680,7 @@ static bool calculate_ss(* so have to divided by 100 * 100*/ ss_amount =dc_fixpt_mul ( fb_div,dc_fixpt_from_fraction (ss_data->percentage, -100 * ss_data->percentage_divider)); +100 * (long long )ss_data->percentage_divider)); ds_data->feedback_amount =dc_fixpt_floor (ss_amount); ss_nslip_amount = dc_fixpt_sub(ss_amount,
@@ -695,8 +695,8 @@ static bool calculate_ss(/* compute SS_STEP_SIZE_DSFRAC */ modulation_time =dc_fixpt_from_fraction ( - pll_settings->reference_freq *1000 , - pll_settings->reference_divider * ss_data->modulation_freq_hz); + pll_settings->reference_freq * (uint64_t )1000 , + pll_settings->reference_divider * (uint64_t )ss_data->modulation_freq_hz);if (ss_data->flags.CENTER_SPREAD) modulation_time =dc_fixpt_div_int (modulation_time,4 );
drivers/gpu/drm/amd/display/dc/dce/dce_panel_cntl.c +1 -1
@@ -218,7 +218,7 @@ static void dce_driver_set_backlight(struct panel_cntl *panel_cntl,* contain integer component, lower 16 bits contain fractional component * of active duty cycle e.g. 0x21BDC0 = 0xEFF0 * 0x24 */ - active_duty_cycle = backlight_pwm_u16_16 * masked_pwm_period; + active_duty_cycle = backlight_pwm_u16_16 * (uint64_t )masked_pwm_period;/* 1.3 Calculate 16 bit active duty cycle from integer and fractional * components shift by bitCount then mask 16 bits and add rounding bit
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +1 -1
@@ -997,7 +997,7 @@ static bool subvp_subvp_admissable(struct dc *dc,if (pipe->plane_state && !pipe->top_pipe &&dc_state_get_pipe_subvp_type (context, pipe) ==SUBVP_MAIN ) { refresh_rate = (pipe->stream->timing.pix_clk_100hz * (uint64_t )100 + - pipe->stream->timing.v_total * pipe->stream->timing.h_total - (uint64_t )1 ); + pipe->stream->timing.v_total * (uint64_t )pipe->stream->timing.h_total - (uint64_t )1 ); refresh_rate =div_u64 (refresh_rate, pipe->stream->timing.v_total); refresh_rate =div_u64 (refresh_rate, pipe->stream->timing.h_total);
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +1 -1
@@ -2208,7 +2208,7 @@ static int dcn10_align_pixel_clocks(struct dc *dc, int group_size, grouped_pipes[i]->stream->signal)) { embedded = i; master = i; - phase[i] = embedded_pix_clk_100hz*100; + phase[i] = embedded_pix_clk_100hz*(uint64_t)100; modulo[i] = dp_ref_clk_100hz*100; } else {
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c +1 -1
@@ -763,7 +763,7 @@ bool edp_setup_psr(struct dc_link *link, psr_context->crtcTimingVerticalTotal = stream->timing.v_total; psr_context->vsync_rate_hz =div64_u64 (div64_u64 ((stream-> - timing.pix_clk_100hz *100 ), + timing.pix_clk_100hz * (u64 )100 ), stream->timing.v_total), stream->timing.h_total);
drivers/gpu/drm/amd/display/dc/spl/dc_spl.c +4 -4
@@ -110,21 +110,21 @@ static struct spl_rect calculate_plane_rec_in_timing_active(struct fixed31_32 temp; - temp =dc_fixpt_from_fraction (rec_in->x * stream_dst->width, + temp =dc_fixpt_from_fraction (rec_in->x * (long long )stream_dst->width, stream_src->width); rec_out.x = stream_dst->x +dc_fixpt_round (temp); temp =dc_fixpt_from_fraction ( - (rec_in->x + rec_in->width) * stream_dst->width, + (rec_in->x + rec_in->width) * (long long )stream_dst->width, stream_src->width); rec_out.width = stream_dst->x +dc_fixpt_round (temp) - rec_out.x; - temp =dc_fixpt_from_fraction (rec_in->y * stream_dst->height, + temp =dc_fixpt_from_fraction (rec_in->y * (long long )stream_dst->height, stream_src->height); rec_out.y = stream_dst->y +dc_fixpt_round (temp); temp =dc_fixpt_from_fraction ( - (rec_in->y + rec_in->height) * stream_dst->height, + (rec_in->y + rec_in->height) * (long long )stream_dst->height, stream_src->height); rec_out.height = stream_dst->y +dc_fixpt_round (temp) - rec_out.y;
drivers/gpu/drm/amd/display/modules/freesync/freesync.c +1 -1
@@ -1002,7 +1002,7 @@ void mod_freesync_build_vrr_params(struct mod_freesync *mod_freesync,if (stream->ctx->dc->caps.max_v_total !=0 && stream->timing.h_total !=0 ) { min_hardware_refresh_in_uhz =div64_u64 ((stream->timing.pix_clk_100hz *100000000ULL ), - (stream->timing.h_total * stream->ctx->dc->caps.max_v_total)); + (stream->timing.h_total * (long long )stream->ctx->dc->caps.max_v_total)); }/* Limit minimum refresh rate to what can be supported by hardware */ min_refresh_in_uhz = min_hardware_refresh_in_uhz > in_config->min_refresh_in_uhz ?
Signature · 1 line
2.34.1
PATCH 9/26 drm/amd/display: Skip unnecessary abm disable
In reply to Fangzhi ZuoFrom: Sherry Wang <[email protected]>
[Why]
We try to disable abm immediately when it's being gradually disabled, which causes backlight ramping being paused in the middle
[How]
Don't disable abm immediately if abm has been or is being disabled through set_abm_level path
--- drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.c +6 -0
@@ -183,6 +183,12 @@ void dcn21_set_abm_immediate_disable(struct pipe_ctx *pipe_ctx)struct panel_cntl *panel_cntl = pipe_ctx->stream->link->panel_cntl;struct dmcu *dmcu = pipe_ctx->stream->ctx->dc->res_pool->dmcu; +// make a short term w/a for an issue that backlight ramping unexpectedly paused in the middle, +// will decouple backlight from ABM and redefine DMUB interface, then this w/a could be removed +if (pipe_ctx->stream->abm_level ==0 || pipe_ctx->stream->abm_level ==ABM_LEVEL_IMMEDIATE_DISABLE ) { +return ; + } +if (dmcu) {dce110_set_abm_immediate_disable (pipe_ctx);return ;
Signature · 1 line
2.34.1
PATCH 10/26 drm/amd/display: Adjust cursor visibility between MPC slices
In reply to Fangzhi ZuoFrom: Nevenko Stupar <[email protected]>
[Why & How]
When MPC enabled, need to adjust x and hot spot x position on one pipe when the cursor is between MPC slices i.e. when the cursor is moving from one MPC slice to next slice, while whole cursor size is not contained within one pipe, to make part of the cursor to be visible on the other pipe.
--- .../amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 47 +++++++++++++++---- .../amd/display/dc/hwss/dcn401/dcn401_hwseq.h | 1 + 2 files changed, 39 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c +38 -9
@@ -1088,6 +1088,17 @@ static bool dcn401_can_pipe_disable_cursor(struct pipe_ctx *pipe_ctx)return false; } +void adjust_hotspot_between_slices_for_2x_magnify (uint32_t cursor_width,struct dc_cursor_position *pos_cpy) +{ +if (cursor_width <=128 ) { + pos_cpy->x_hotspot /=2 ; + pos_cpy->x_hotspot +=1 ; + }else { + pos_cpy->x_hotspot /=2 ; + pos_cpy->x_hotspot +=2 ; + } +} +void dcn401_set_cursor_position (struct pipe_ctx *pipe_ctx) {struct dc_cursor_position pos_cpy = pipe_ctx->stream->cursor_position;
@@ -1109,12 +1120,21 @@ void dcn401_set_cursor_position(struct pipe_ctx *pipe_ctx)int prev_odm_width =0 ;int prev_odm_offset =0 ;struct pipe_ctx *prev_odm_pipe =NULL ; +bool mpc_combine_on = false; +int bottom_pipe_x_pos =0 ;int x_pos = pos_cpy.x;int y_pos = pos_cpy.y;int recout_x_pos =0 ;int recout_y_pos =0 ; +if ((pipe_ctx->top_pipe !=NULL ) || (pipe_ctx->bottom_pipe !=NULL )) { +if ((pipe_ctx->plane_state->src_rect.width != pipe_ctx->plane_res.scl_data.viewport.width) || + (pipe_ctx->plane_state->src_rect.height != pipe_ctx->plane_res.scl_data.viewport.height)) { + mpc_combine_on = true; + } + } +/* DCN4 moved cursor composition after Scaler, so in HW it is in * recout space and for HW Cursor position programming need to * translate to recout space.
@@ -1177,15 +1197,8 @@ void dcn401_set_cursor_position(struct pipe_ctx *pipe_ctx)if (x_pos <0 ) { pos_cpy.x_hotspot -= x_pos; -if ((odm_combine_on) && (hubp->curs_attr.attribute_flags.bits.ENABLE_MAGNIFICATION)) { -if (hubp->curs_attr.width <=128 ) { - pos_cpy.x_hotspot /=2 ; - pos_cpy.x_hotspot +=1 ; - }else { - pos_cpy.x_hotspot /=2 ; - pos_cpy.x_hotspot +=2 ; - } - } +if (hubp->curs_attr.attribute_flags.bits.ENABLE_MAGNIFICATION) +adjust_hotspot_between_slices_for_2x_magnify (hubp->curs_attr.width, &pos_cpy); x_pos =0 ; }
@@ -1194,6 +1207,22 @@ void dcn401_set_cursor_position(struct pipe_ctx *pipe_ctx) y_pos =0 ; } +/* If the position on bottom MPC pipe is negative then we need to add to the hotspot and +* adjust x_pos on bottom pipe to make cursor visible when crossing between MPC slices. +*/ +if (mpc_combine_on && + pipe_ctx->top_pipe && + (pipe_ctx == pipe_ctx->top_pipe->bottom_pipe)) { + + bottom_pipe_x_pos = x_pos - pipe_ctx->plane_res.scl_data.recout.x; +if (bottom_pipe_x_pos <0 ) { + x_pos = pipe_ctx->plane_res.scl_data.recout.x; + pos_cpy.x_hotspot -= bottom_pipe_x_pos; +if (hubp->curs_attr.attribute_flags.bits.ENABLE_MAGNIFICATION) +adjust_hotspot_between_slices_for_2x_magnify (hubp->curs_attr.width, &pos_cpy); + } + } + pos_cpy.x = (uint32_t )x_pos; pos_cpy.y = (uint32_t )y_pos;
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.h +1 -0
@@ -80,4 +80,5 @@ void dcn401_unblank_stream(struct pipe_ctx *pipe_ctx, struct dc_link_settings *lvoid dcn401_hardware_release (struct dc *dc);void dcn401_update_odm (struct dc *dc,struct dc_state *context,struct pipe_ctx *otg_master); +void adjust_hotspot_between_slices_for_2x_magnify (uint32_t cursor_width,struct dc_cursor_position *pos_cpy);#endif /* __DC_HWSS_DCN401_H__ */
Signature · 1 line
2.34.1
PATCH 11/26 drm/amd/display: Check denominator pbn_div before used
In reply to Fangzhi ZuoFrom: Alex Hung <[email protected]>
[WHAT & HOW]
A denominator cannot be 0, and is checked before used.
This fixes 1 DIVIDE_BY_ZERO issue reported by Coverity.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
@@ -7570,7 +7570,7 @@ static int dm_update_mst_vcpi_slots_for_dsc(struct drm_atomic_state *state, } } -if (j == dc_state->stream_count) +if (j == dc_state->stream_count || pbn_div ==0 )continue ; slot_num =DIV_ROUND_UP (pbn, pbn_div);
Signature · 1 line
2.34.1
PATCH 12/26 drm/amd/display: Check denominator crb_pipes before used
In reply to Fangzhi ZuoFrom: Alex Hung <[email protected]>
[WHAT & HOW]
A denominator cannot be 0, and is checked before used.
This fixes 2 DIVIDE_BY_ZERO issues reported by Coverity.
--- .../gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c +1 -1
@@ -1760,7 +1760,7 @@ static int dcn315_populate_dml_pipes_from_context(bool split_required = pipe->stream->timing.pix_clk_100hz >=dcn_get_max_non_odm_pix_rate_100hz (&dc->dml.soc) || (pipe->plane_state && pipe->plane_state->src_rect.width >5120 ); -if (remaining_det_segs >MIN_RESERVED_DET_SEGS ) +if (remaining_det_segs >MIN_RESERVED_DET_SEGS && crb_pipes !=0 ) pipes[pipe_cnt].pipe.src.det_size_override += (remaining_det_segs -MIN_RESERVED_DET_SEGS ) / crb_pipes + (crb_idx < (remaining_det_segs -MIN_RESERVED_DET_SEGS ) % crb_pipes ?1 :0 );if (pipes[pipe_cnt].pipe.src.det_size_override >2 *DCN3_15_MAX_DET_SEGS ) {
Signature · 1 line
2.34.1
PATCH 13/26 drm/amd/display: Cleanup dce_get_dp_ref_freq_khz
In reply to Fangzhi ZuoFrom: Dillon Varone <[email protected]>
[WHY&HOW]
Cleanup unnecessary code pathes as compile guards were added and removed overtime.
--- drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +1 -1
@@ -131,7 +131,7 @@ int dce_get_dp_ref_freq_khz(struct clk_mgr *clk_mgr_base)struct clk_mgr_internal *clk_mgr =TO_CLK_MGR_INTERNAL (clk_mgr_base);int dprefclk_wdivider;int dprefclk_src_sel; -int dp_ref_clk_khz =600000 ; +int dp_ref_clk_khz;int target_div;/* ASSERT DP Reference Clock source is from DFS*/
Signature · 1 line
2.34.1
PATCH 14/26 drm/amd/display: Add refresh rate range check
In reply to Fangzhi ZuoFrom: Tom Chung <[email protected]>
[Why]
We only enable the VRR while monitor usable refresh rate range is greater than 10 Hz.
But we did not check the range in DRM_EDID_FEATURE_CONTINUOUS_FREQ case.
[How]
Add a refresh rate range check before set the freesync_capable flag in DRM_EDID_FEATURE_CONTINUOUS_FREQ case.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -1
@@ -12000,9 +12000,11 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector,if (is_dp_capable_without_timing_msa (adev->dm.dc, amdgpu_dm_connector)) {if (edid->features &DRM_EDID_FEATURE_CONTINUOUS_FREQ ) { - freesync_capable = true; amdgpu_dm_connector->min_vfreq = connector->display_info.monitor_range.min_vfreq; amdgpu_dm_connector->max_vfreq = connector->display_info.monitor_range.max_vfreq; +if (amdgpu_dm_connector->max_vfreq - + amdgpu_dm_connector->min_vfreq >10 ) + freesync_capable = true; }else { edid_check_required = edid->version > 1 || (edid->version == 1 &&
Signature · 1 line
2.34.1
PATCH 15/26 drm/amd/display: Add available bandwidth calculation for audio (#16909)
In reply to Fangzhi ZuoFrom: Ryan Seto <[email protected]>
[Why]
Audio for 8K 240Hz monitor was not available when it should be
[How]
Added calculation based on stream state
--- .../gpu/drm/amd/display/dc/dce/dce_audio.c | 3 +- .../amd/display/dc/hwss/dce110/dce110_hwseq.c | 62 +++++++++++++++++-- 2 files changed, 59 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_audio.c +2 -1
@@ -455,7 +455,8 @@ static uint32_t calculate_available_hblank_bw_in_symbols( available_hblank_bw -= crtc_info->dsc_num_slices *4 ;/* EOC overhead */ if (available_hblank_bw < dp_link_info->hblank_min_symbol_width) - available_hblank_bw = dp_link_info->hblank_min_symbol_width; +/* Each symbol takes 4 frames */ + available_hblank_bw =4 * dp_link_info->hblank_min_symbol_width;if (available_hblank_bw <12 ) available_hblank_bw =0 ;
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +57 -5
70 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH 16/26 drm/amd/display: un-block 8k with single dimm
In reply to Fangzhi ZuoFrom: Paul Hsieh <[email protected]>
[Why]
Driver doesn't validate multi-display with scaling when OS calls DDI. This behavior causes the validated result to be a mismatch between some automated test cases.
To address this issue, some workaround was added that caused issues in 8k.
[How]
Since the origin issue had been root caused,
revert the previous workaround and unblock 8k with a single dimm.
--- .../dc/resource/dcn314/dcn314_resource.c | 22 ------------------- 1 file changed, 22 deletions(-)
drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.c +0 -22
@@ -1695,25 +1695,6 @@ static void dcn314_get_panel_config_defaults(struct dc_panel_config *panel_confi *panel_config = panel_config_defaults; } -static bool filter_modes_for_single_channel_workaround (struct dc *dc, -struct dc_state *context) -{ -// Filter 2K@240Hz+8K@24fps above combination timing if memory only has single dimm LPDDR -if (dc->clk_mgr->bw_params->vram_type ==34 && - dc->clk_mgr->bw_params->num_channels <2 && - context->stream_count >1 ) { -int total_phy_pix_clk =0 ; - -for (int i =0 ; i < context->stream_count; i++) -if (context->res_ctx.pipe_ctx[i].stream) - total_phy_pix_clk += context->res_ctx.pipe_ctx[i].stream->phy_pix_clk; - -if (total_phy_pix_clk >= (1148928 +826260 ))//2K@240Hz+8K@24fps -return true; - } -return false; -} -bool dcn314_validate_bandwidth (struct dc *dc,struct dc_state *context,bool fast_validate)
@@ -1732,9 +1713,6 @@ bool dcn314_validate_bandwidth(struct dc *dc,if (!pipes) goto validate_fail; -if (filter_modes_for_single_channel_workaround (dc, context)) - goto validate_fail; -DC_FP_START ();// do not support self refresh only out =dcn30_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, fast_validate, false);
Signature · 1 line
2.34.1
PATCH 17/26 drm/amd/display: Add debug option for disabling SLDO optimizations
In reply to Fangzhi ZuoFrom: Nicholas Kazlauskas <[email protected]>
[Why]
DM can hook this up to disable SLDO optimizations in firmware during DMCUB initialization for debug purposes.
[How]
Add the option and pass it through dmub_srv.
--- drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 1 + drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 3 ++- drivers/gpu/drm/amd/display/dmub/src/dmub_dcn35.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dmub/dmub_srv.h +1 -0
@@ -299,6 +299,7 @@ struct dmub_srv_hw_params {enum dmub_memory_access_type mem_access_type;enum dmub_ips_disable_type disable_ips;bool disallow_phy_access; +bool disable_sldo_opt; };/**
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +2 -1
@@ -684,7 +684,8 @@ union dmub_fw_boot_options { uint32_t ips_pg_disable: 1; /* 1 to disable ONO domains power gating*/ uint32_t ips_disable: 3; /* options to disable ips support*/ uint32_t ips_sequential_ono: 1; /**< 1 to enable sequential ONO IPS sequence */ - uint32_t reserved : 8; /**< reserved */ + uint32_t disable_sldo_opt: 1; /**< 1 to disable SLDO optimizations */ + uint32_t reserved : 7; /**< reserved */ } bits;/**< boot bits */ uint32_t all;/**< 32-bit access to bits */ };
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn35.c +1 -0
@@ -424,6 +424,7 @@ void dmub_dcn35_enable_dmub_boot_options(struct dmub_srv *dmub, const struct dmu boot_options.bits.disable_clk_gate = params->disable_clock_gate; boot_options.bits.ips_disable = params->disable_ips; boot_options.bits.ips_sequential_ono = params->ips_sequential_ono; + boot_options.bits.disable_sldo_opt = params->disable_sldo_opt;REG_WRITE (DMCUB_SCRATCH14 , boot_options.all); }
Signature · 1 line
2.34.1
PATCH 18/26 drm/amd/display: Fix dmub timeout after fams2 enabled
In reply to Fangzhi ZuoFrom: Fangzhi Zuo <[email protected]>
Reset fams stream count upon stream removal, otherwise fams2 state machine in dmub will get corrupted.
--- drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_wrapper.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_wrapper.c +6 -1
@@ -197,8 +197,13 @@ static bool dml21_mode_check_and_programming(const struct dc *in_dc, struct dc_smemset (&dml_ctx->v21.dml_to_dc_pipe_mapping,0 ,sizeof (struct dml2_dml_to_dc_pipe_mapping ));memset (&dml_ctx->v21.mode_programming.dml2_instance->scratch.build_mode_programming_locals.mode_programming_params,0 ,sizeof (struct dml2_core_mode_programming_in_out )); -if (!context || context->stream_count ==0 ) +if (!context) +return true; + +if (context->stream_count ==0 ) { +dml21_build_fams2_programming (in_dc, context, dml_ctx);return true; + }/* scrub phantom's from current dc_state */ dml_ctx->config.svp_pstate.callbacks.remove_phantom_streams_and_planes (in_dc, context);
Signature · 1 line
2.34.1
PATCH 19/26 drm/amd/display: fix a crash when clock source is reference for non otg master pipe
In reply to Fangzhi ZuoFrom: Wenjing Liu <[email protected]>
[why]
The function enumerates all pipes without checking pipe type. It is only supposed to call program pixel clock for OTG master pipe only.
--- .../dc/clk_mgr/dcn401/dcn401_clk_mgr.c | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c +20 -18
@@ -306,27 +306,29 @@ static void dcn401_update_clocks_update_dtb_dto(struct clk_mgr_internal *clk_mgrstruct dc_state *context, int ref_dtbclk_khz) { -struct dccg *dccg = clk_mgr->dccg; -uint32_t tg_mask =0 ; int i; +struct dccg *dccg = clk_mgr->dccg; +struct pipe_ctx *otg_master; +bool use_hpo_encoder; -for (i =0 ; i < clk_mgr->base.ctx->dc->res_pool->pipe_count; i++) { -struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i]; - -/* use mask to program DTO once per tg */ -if (pipe_ctx->stream_res.tg && - !(tg_mask & (1 << pipe_ctx->stream_res.tg->inst))) { - tg_mask |= (1 << pipe_ctx->stream_res.tg->inst); - -if (dccg->ctx->dc->link_srv->dp_is_128b_132b_signal (pipe_ctx)) { - pipe_ctx->clock_source->funcs->program_pix_clk ( - pipe_ctx->clock_source, - &pipe_ctx->stream_res.pix_clk_params, - dccg->ctx->dc->link_srv->dp_get_encoding_format (&pipe_ctx->link_config.dp_link_settings), - &pipe_ctx->pll_settings); - } - } +for (i =0 ; i < context->stream_count; i++) { + otg_master =resource_get_otg_master_for_stream ( + &context->res_ctx, context->streams[i]); +ASSERT (otg_master); +ASSERT (otg_master->clock_source); +ASSERT (otg_master->clock_source->funcs->program_pix_clk); +ASSERT (otg_master->stream_res.pix_clk_params.controller_id >=CONTROLLER_ID_D0 ); + + use_hpo_encoder = dccg->ctx->dc->link_srv->dp_is_128b_132b_signal (otg_master); +if (!use_hpo_encoder) +continue ; + + otg_master->clock_source->funcs->program_pix_clk ( + otg_master->clock_source, + &otg_master->stream_res.pix_clk_params, + dccg->ctx->dc->link_srv->dp_get_encoding_format (&otg_master->link_config.dp_link_settings), + &otg_master->pll_settings); } }
Signature · 1 line
2.34.1
PATCH 20/26 drm/amd/display: Account for cursor prefetch BW in DML1 mode support
In reply to Fangzhi ZuoFrom: Alvin Lee <[email protected]>
[Description]
We need to ensure to take into account cursor prefetch BW in mode support or we may pass ModeQuery but fail an actual flip which will cause a hang. Flip may fail because the cursor_pre_bw is populated during mode programming (and mode programming is never called prior to ModeQuery).
--- drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c +3 -0
@@ -3364,6 +3364,9 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l &mode_lib->vba.UrgentBurstFactorLumaPre[k], &mode_lib->vba.UrgentBurstFactorChromaPre[k], &mode_lib->vba.NotUrgentLatencyHidingPre[k]); + + v->cursor_bw_pre[k] = mode_lib->vba.NumberOfCursors[k] * mode_lib->vba.CursorWidth[k][0 ] * mode_lib->vba.CursorBPP[k][0 ] / +8.0 / (mode_lib->vba.HTotal[k] / mode_lib->vba.PixelClock[k]) * v->VRatioPreY[i][j][k]; } {
Signature · 1 line
2.34.1
PATCH 21/26 drm/amd/display: Move dio files into dio folder
In reply to Fangzhi ZuoFrom: Bhuvanachandra Pinninti <[email protected]>
[why]
Refactor the code of dio to unit test.
[how]
Moved files to respective folders and changed cMakeLists and makefiles.
---
drivers/gpu/drm/amd/display/dc/dcn10/Makefile | 1 -
drivers/gpu/drm/amd/display/dc/dcn20/Makefile | 1 -
drivers/gpu/drm/amd/display/dc/dcn30/Makefile | 2 --
drivers/gpu/drm/amd/display/dc/dcn31/Makefile | 2 +-
drivers/gpu/drm/amd/display/dc/dio/Makefile | 36 +++++++++++++++++++
.../dc/{ => dio}/dcn10/dcn10_link_encoder.c | 0
.../dc/{ => dio}/dcn10/dcn10_link_encoder.h | 0
.../dc/{ => dio}/dcn10/dcn10_stream_encoder.c | 0
.../dc/{ => dio}/dcn10/dcn10_stream_encoder.h | 0
.../dc/{ => dio}/dcn20/dcn20_link_encoder.c | 0
.../dc/{ => dio}/dcn20/dcn20_link_encoder.h | 0
.../dc/{ => dio}/dcn20/dcn20_stream_encoder.c | 0
.../dc/{ => dio}/dcn20/dcn20_stream_encoder.h | 0
.../{ => dio}/dcn30/dcn30_dio_link_encoder.c | 0
.../{ => dio}/dcn30/dcn30_dio_link_encoder.h | 0
.../dcn30/dcn30_dio_stream_encoder.c | 0
.../dcn30/dcn30_dio_stream_encoder.h | 0
.../{ => dio}/dcn31/dcn31_dio_link_encoder.c | 0
.../{ => dio}/dcn31/dcn31_dio_link_encoder.h | 0
19 files changed, 37 insertions(+), 5 deletions(-)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn10/dcn10_link_encoder.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn10/dcn10_link_encoder.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn10/dcn10_stream_encoder.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn10/dcn10_stream_encoder.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn20/dcn20_link_encoder.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn20/dcn20_link_encoder.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn20/dcn20_stream_encoder.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn20/dcn20_stream_encoder.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn30/dcn30_dio_link_encoder.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn30/dcn30_dio_link_encoder.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn30/dcn30_dio_stream_encoder.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn30/dcn30_dio_stream_encoder.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn31/dcn31_dio_link_encoder.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn31/dcn31_dio_link_encoder.h (100%)drivers/gpu/drm/amd/display/dc/dcn10/Makefile +0 -1
@@ -27,7 +27,6 @@ DCN10 = dcn10_ipp.o \ dcn10_opp.o \ dcn10_mpc.o \ dcn10_cm_common.o \ - dcn10_stream_encoder.o dcn10_link_encoder.o AMD_DAL_DCN10 = $(addprefix $(AMDDALPATH)/dc/dcn10/,$(DCN10))
drivers/gpu/drm/amd/display/dc/dcn20/Makefile +0 -1
@@ -2,7 +2,6 @@ # Copyright © 2019-2024 Advanced Micro Devices, Inc. All rights reserved. DCN20 = dcn20_mpc.o dcn20_opp.o dcn20_mmhubbub.o \ - dcn20_stream_encoder.o dcn20_link_encoder.o \ dcn20_vmid.o dcn20_dwb.o dcn20_dwb_scl.o AMD_DAL_DCN20 = $(addprefix $(AMDDALPATH)/dc/dcn20/,$(DCN20))
drivers/gpu/drm/amd/display/dc/dcn30/Makefile +0 -2
@@ -25,12 +25,10 @@ DCN30 := dcn30_mpc.o dcn30_vpg.o \ dcn30_afmt.o \ - dcn30_dio_stream_encoder.o \ dcn30_dwb.o \ dcn30_dwb_cm.o \ dcn30_cm_common.o \ dcn30_mmhubbub.o \ - dcn30_dio_link_encoder.o
drivers/gpu/drm/amd/display/dc/dcn31/Makefile +1 -1
@@ -10,7 +10,7 @@ # # Makefile for dcn31. -DCN31 = dcn31_dio_link_encoder.o dcn31_panel_cntl.o \ +DCN31 = dcn31_panel_cntl.o \ dcn31_apg.o dcn31_hpo_dp_stream_encoder.o dcn31_hpo_dp_link_encoder.o \ dcn31_afmt.o dcn31_vpg.o
drivers/gpu/drm/amd/display/dc/dio/Makefile +36 -0
@@ -24,6 +24,42 @@ # ifdef CONFIG_DRM_AMD_DC_FP +############################################################################### +# DCN10 +############################################################################### +DIO_DCN10 = dcn10_link_encoder.o dcn10_stream_encoder.o + +AMD_DAL_DIO_DCN10 = $(addprefix $(AMDDALPATH)/dc/dio/dcn10/,$(DIO_DCN10)) + +AMD_DISPLAY_FILES += $(AMD_DAL_DIO_DCN10) + +############################################################################### +# DCN20 +############################################################################### +DIO_DCN20 = dcn20_link_encoder.o dcn20_stream_encoder.o + +AMD_DAL_DIO_DCN20 = $(addprefix $(AMDDALPATH)/dc/dio/dcn20/,$(DIO_DCN20)) + +AMD_DISPLAY_FILES += $(AMD_DAL_DIO_DCN20) + +############################################################################### +# DCN30 +############################################################################### +DIO_DCN30 = dcn30_dio_link_encoder.o dcn30_dio_stream_encoder.o + +AMD_DAL_DIO_DCN30 = $(addprefix $(AMDDALPATH)/dc/dio/dcn30/,$(DIO_DCN30)) + +AMD_DISPLAY_FILES += $(AMD_DAL_DIO_DCN30) + +############################################################################### +# DCN31 +############################################################################### +DIO_DCN31 = dcn31_dio_link_encoder.o + +AMD_DAL_DIO_DCN31 = $(addprefix $(AMDDALPATH)/dc/dio/dcn31/,$(DIO_DCN31)) + +AMD_DISPLAY_FILES += $(AMD_DAL_DIO_DCN31) + ############################################################################### # DCN32 ###############################################################################
drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_link_encoder.c renamed from drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c +0 -0
drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_link_encoder.h renamed from drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.h +0 -0
drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c renamed from drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c +0 -0
drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.h renamed from drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.h +0 -0
drivers/gpu/drm/amd/display/dc/dio/dcn20/dcn20_link_encoder.c renamed from drivers/gpu/drm/amd/display/dc/dcn20/dcn20_link_encoder.c +0 -0
drivers/gpu/drm/amd/display/dc/dio/dcn20/dcn20_link_encoder.h renamed from drivers/gpu/drm/amd/display/dc/dcn20/dcn20_link_encoder.h +0 -0
drivers/gpu/drm/amd/display/dc/dio/dcn20/dcn20_stream_encoder.c renamed from drivers/gpu/drm/amd/display/dc/dcn20/dcn20_stream_encoder.c +0 -0
drivers/gpu/drm/amd/display/dc/dio/dcn20/dcn20_stream_encoder.h renamed from drivers/gpu/drm/amd/display/dc/dcn20/dcn20_stream_encoder.h +0 -0
drivers/gpu/drm/amd/display/dc/dio/dcn30/dcn30_dio_link_encoder.c renamed from drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_link_encoder.c +0 -0
drivers/gpu/drm/amd/display/dc/dio/dcn30/dcn30_dio_link_encoder.h renamed from drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_link_encoder.h +0 -0
drivers/gpu/drm/amd/display/dc/dio/dcn30/dcn30_dio_stream_encoder.c renamed from drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_stream_encoder.c +0 -0
drivers/gpu/drm/amd/display/dc/dio/dcn30/dcn30_dio_stream_encoder.h renamed from drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_stream_encoder.h +0 -0
drivers/gpu/drm/amd/display/dc/dio/dcn31/dcn31_dio_link_encoder.c renamed from drivers/gpu/drm/amd/display/dc/dcn31/dcn31_dio_link_encoder.c +0 -0
drivers/gpu/drm/amd/display/dc/dio/dcn31/dcn31_dio_link_encoder.h renamed from drivers/gpu/drm/amd/display/dc/dcn31/dcn31_dio_link_encoder.h +0 -0
Signature · 1 line
2.34.1
PATCH 22/26 drm/amd/display: replace CRTC disable function call
In reply to Fangzhi ZuoFrom: "Xi (Alex) Liu" <[email protected]>
[Why]
In OTG disable workarund, CRTC is disabled immediately to improve performance, but this may cause timing issue in DP HPO encoder FIFO and result in blank CRCs.
[How]
Replace the immediate CRTC disable call with normal disable call
--- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c +2 -2
@@ -137,8 +137,8 @@ static void dcn35_disable_otg_wa(struct clk_mgr *clk_mgr_base, struct dc_state *if (pipe->stream && (pipe->stream->dpms_off ||dc_is_virtual_signal (pipe->stream->signal) || !pipe->stream->link_enc)) {if (disable) { -if (pipe->stream_res.tg && pipe->stream_res.tg->funcs->immediate_disable_crtc) - pipe->stream_res.tg->funcs->immediate_disable_crtc (pipe->stream_res.tg); +if (pipe->stream_res.tg && pipe->stream_res.tg->funcs->disable_crtc) + pipe->stream_res.tg->funcs->disable_crtc (pipe->stream_res.tg);reset_sync_context_for_pipe (dc, context, i); }else {
Signature · 1 line
2.34.1
PATCH 23/26 drm/amd/display: Fix refresh rate range for some panel
In reply to Fangzhi ZuoFrom: Tom Chung <[email protected]>
[Why]
Some of the panels does not have the refresh rate range info in base EDID and only have the refresh rate range info in DisplayID block.
It will cause the max/min freesync refresh rate set to 0.
[How]
Try to parse the refresh rate range info from DisplayID if the max/min refresh rate is 0.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +48 -0
@@ -11873,6 +11873,49 @@ static bool parse_edid_cea(struct amdgpu_dm_connector *aconnector,return ret; } +static void parse_edid_displayid_vrr (struct drm_connector *connector, +struct edid *edid) +{ +u8 *edid_ext =NULL ; +int i; +int j =0 ; +u16 min_vfreq; +u16 max_vfreq; + +if (edid ==NULL || edid->extensions ==0 ) +return ; + +/* Find DisplayID extension */ +for (i =0 ; i < edid->extensions; i++) { + edid_ext = (void *)(edid + (i +1 )); +if (edid_ext[0 ] ==DISPLAYID_EXT ) +break ; + } + +if (edid_ext ==NULL ) +return ; + +while (j <EDID_LENGTH ) { +/* Get dynamic video timing range from DisplayID if available */ +if (EDID_LENGTH - j >13 && edid_ext[j] ==0x25 && + (edid_ext[j+1 ] &0xFE ) ==0 && (edid_ext[j+2 ] ==9 )) { + min_vfreq = edid_ext[j+9 ]; +if (edid_ext[j+1 ] &7 ) + max_vfreq = edid_ext[j+10 ] + ((edid_ext[j+11 ] &3 ) <<8 ); +else + max_vfreq = edid_ext[j+10 ]; + +if (max_vfreq && min_vfreq) { + connector->display_info.monitor_range.max_vfreq = max_vfreq; + connector->display_info.monitor_range.min_vfreq = min_vfreq; + +return ; + } + } + j++; + } +} +static int parse_amd_vsdb (struct amdgpu_dm_connector *aconnector,struct edid *edid,struct amdgpu_hdmi_vsdb_info *vsdb_info) {
@@ -11993,6 +12036,11 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector,if (!adev->dm.freesync_module) goto update; +/* Some eDP panels only have the refresh rate range info in DisplayID */ +if ((connector->display_info.monitor_range.min_vfreq ==0 || + connector->display_info.monitor_range.max_vfreq ==0 )) +parse_edid_displayid_vrr (connector, edid); +if (edid && (sink->sink_signal ==SIGNAL_TYPE_DISPLAY_PORT || sink->sink_signal ==SIGNAL_TYPE_EDP )) {bool edid_check_required = false;
Signature · 1 line
2.34.1
PATCH 24/26 drm/amd/display: Update efficiency bandwidth for dcn351
In reply to Fangzhi ZuoFix 4k240 underflow on dcn351
--- drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c +1 -0
@@ -296,6 +296,7 @@ void dml2_init_socbb_params(struct dml2_context *dml2, const struct dc *in_dc, s out->round_trip_ping_latency_dcfclk_cycles =106 ; out->smn_latency_us =2 ; out->dispclk_dppclk_vco_speed_mhz =3600 ; + out->pct_ideal_dram_bw_after_urgent_pixel_only =65.0 ;break ;case dml_project_dcn401:
Signature · 1 line
2.34.1
PATCH 25/26 drm/amd/display: Fix array-index-out-of-bounds in dml2/FCLKChangeSupport
In reply to Fangzhi ZuoFrom: Roman Li <[email protected]>
[Why]
Potential out of bounds access in dml2_calculate_rq_and_dlg_params() because the value of out_lowest_state_idx used as an index for FCLKChangeSupport array can be greater than 1.
[How]
Currently dml2 core specifies identical values for all FCLKChangeSupport elements. Always use index 0 in the condition to avoid out of bounds access.
--- drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c +1 -1
@@ -293,7 +293,7 @@ void dml2_calculate_rq_and_dlg_params(const struct dc *dc, struct dc_state *cont context->bw_ctx.bw.dcn.clk.dcfclk_deep_sleep_khz = (unsigned int )in_ctx->v20.dml_core_ctx.mp.DCFCLKDeepSleep *1000 ; context->bw_ctx.bw.dcn.clk.dppclk_khz =0 ; -if (in_ctx->v20.dml_core_ctx.ms.support.FCLKChangeSupport[in_ctx->v20.scratch.mode_support_params.out_lowest_state_idx] == dml_fclock_change_unsupported) +if (in_ctx->v20.dml_core_ctx.ms.support.FCLKChangeSupport[0 ] == dml_fclock_change_unsupported) context->bw_ctx.bw.dcn.clk.fclk_p_state_change_support = false;else context->bw_ctx.bw.dcn.clk.fclk_p_state_change_support = true;
Signature · 1 line
2.34.1
PATCH 26/26 drm/amd/display: 3.2.291
In reply to Fangzhi ZuoFrom: Aric Cyr <[email protected]>
* FW Release 0.0.224.0
* Fix bw issue for dcn351
* Fix FAMS2 logic issue for dcn401
* Fix Coverity issues
* Fix cursor issues
* Refactor dio sources
--- 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
@@ -55,7 +55,7 @@ struct aux_payload;struct set_config_cmd_payload ;struct dmub_notification ; -#define DC_VER "3.2.290" +#define DC_VER "3.2.291"#define MAX_SURFACES 3#define MAX_PLANES 6
Signature · 1 line
2.34.1
[Public]
Hi all,
This week this patchset was tested on the following systems:
* Lenovo ThinkBook T13s Gen4 with AMD Ryzen 5 6600U
* MSI Gaming X Trio RX 6800
* Gigabyte Gaming OC RX 7900 XTX
These systems were tested on the following display/connection types:
* eDP, (1080p 60hz [5650U]) (1920x1200 60hz [6600U]) (2560x1600 120hz[6600U])
* VGA and DVI (1680x1050 60hz [DP to VGA/DVI, USB-C to VGA/DVI])
* DP/HDMI/USB-C (1440p 170hz, 4k 60hz, 4k 144hz, 4k 240hz [Includes USB-C to DP/HDMI adapters])
* Thunderbolt (LG Ultrafine 5k)
* MST (Startech MST14DP123DP [DP to 3x DP] and 2x 4k 60Hz displays)
* DSC (with Cable Matters 101075 [DP to 3x DP] with 3x 4k60 displays, and HP Hook G2 with 1 4k60 display)
* USB 4 (Kensington SD5700T and 1x 4k 60Hz display)
* PCON (Club3D CAC-1085 and 1x 4k 144Hz display [at 4k 120HZ, as that is the max the adapter supports])
The testing is a mix of automated and manual tests. Manual testing includes (but is not limited to):
* Changing display configurations and settings
* Benchmark testing
* Feature testing (Freesync, etc.)
Automated testing includes (but is not limited to):
* Script testing (scripts to automate some of the manual checks)
* IGT testing
The patchset consists of the amd-staging-drm-next branch (Head commit - a2010c00faa46264d7722486609cd9a40aaffd69 -> drm/amd: Add some missing register definitions) with new patches added on top of it.
Tested on Ubuntu 22.04.3, on Wayland and X11, using KDE Plasma and Gnome.
Thank you,
Dan Wheeler
Sr. Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
amd.com
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Fangzhi Zuo
Sent: Thursday, June 27, 2024 5:13 PM
To: [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Pillai, Aurabindo <[email protected]>; Li, Roman <[email protected]>; Lin, Wayne <[email protected]>; Gutierrez, Agustin <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; Zuo, Jerry <[email protected]>; Zuo, Jerry <[email protected]>
Subject: [PATCH 00/26] DC Patches June 27th, 2024
This DC patchset brings improvements in multiple areas. In summary, we highlight:
* FW Release 0.0.224.0
* Fix bw issue for dcn351
* Fix FAMS2 logic issue for dcn401
* Fix Coverity issues
* Fix cursor issues
* Refactor dio sources
Alex Hung (3):
drm/amd/display: Fix possible overflow in integer multiplication drm/amd/display: Check denominator pbn_div before used drm/amd/display: Check denominator crb_pipes before used
Alvin Lee (1):
drm/amd/display: Account for cursor prefetch BW in DML1 mode support
Anthony Koo (1):
drm/amd/display: Add replay state entry to replay_state
Aric Cyr (1):
drm/amd/display: 3.2.291
Bhuvanachandra Pinninti (1):
drm/amd/display: Move dio files into dio folder
Dillon Varone (1):
drm/amd/display: Cleanup dce_get_dp_ref_freq_khz
Fangzhi Zuo (2):
drm/amd/display: Fix dmub timeout after fams2 enabled drm/amd/display: Update efficiency bandwidth for dcn351
George Shen (2):
drm/amd/display: Fix divide by zero in CURSOR_DST_X_OFFSET calculation drm/amd/display: Add ASIC cap to limit DCC surface width
Joshua Aberback (1):
drm/amd/display: Remove unnecessary error message
Nevenko Stupar (1):
drm/amd/display: Adjust cursor visibility between MPC slices
Nicholas Kazlauskas (1):
drm/amd/display: Add debug option for disabling SLDO optimizations
Paul Hsieh (1):
drm/amd/display: un-block 8k with single dimm
Roman Li (1):
drm/amd/display: Fix array-index-out-of-bounds in
dml2/FCLKChangeSupport
Ryan Seto (1):
drm/amd/display: Add available bandwidth calculation for audio
(#16909)
Sherry Wang (1):
drm/amd/display: Skip unnecessary abm disable
Sung Joon Kim (1):
drm/amd/display: Choose HUBP unbounded request based on DML output
Teeger (1):
drm/amd/display: Revert Add workaround to restrict max frac urgent for
DPM0
Tom Chung (3):
drm/amd/display: Reset freesync config before update new state drm/amd/display: Add refresh rate range check drm/amd/display: Fix refresh rate range for some panel
Wenjing Liu (1):
drm/amd/display: fix a crash when clock source is reference for non
otg master pipe
Xi (Alex) Liu (1):
drm/amd/display: replace CRTC disable function call
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 55 +++++++++++++++- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 4 +- .../drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 2 +- .../gpu/drm/amd/display/dc/basics/dce_calcs.c | 2 +-
.../display/dc/clk_mgr/dce100/dce_clk_mgr.c | 2 +-
.../display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 2 +- .../display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c | 4 +-
.../dc/clk_mgr/dcn401/dcn401_clk_mgr.c | 38 ++++++------
.../gpu/drm/amd/display/dc/core/dc_resource.c | 8 +--
.../gpu/drm/amd/display/dc/core/dc_stream.c | 6 +-
drivers/gpu/drm/amd/display/dc/dc.h | 4 +-
.../gpu/drm/amd/display/dc/dce/dce_audio.c | 5 +-
.../drm/amd/display/dc/dce/dce_clock_source.c | 8 +--
.../drm/amd/display/dc/dce/dce_panel_cntl.c | 2 +-
drivers/gpu/drm/amd/display/dc/dcn10/Makefile | 1 - drivers/gpu/drm/amd/display/dc/dcn20/Makefile | 1 - drivers/gpu/drm/amd/display/dc/dcn30/Makefile | 2 - drivers/gpu/drm/amd/display/dc/dcn31/Makefile | 2 +-
drivers/gpu/drm/amd/display/dc/dio/Makefile | 36 +++++++++++
.../dc/{ => dio}/dcn10/dcn10_link_encoder.c | 0
.../dc/{ => dio}/dcn10/dcn10_link_encoder.h | 0
.../dc/{ => dio}/dcn10/dcn10_stream_encoder.c | 0 .../dc/{ => dio}/dcn10/dcn10_stream_encoder.h | 0
.../dc/{ => dio}/dcn20/dcn20_link_encoder.c | 0
.../dc/{ => dio}/dcn20/dcn20_link_encoder.h | 0
.../dc/{ => dio}/dcn20/dcn20_stream_encoder.c | 0 .../dc/{ => dio}/dcn20/dcn20_stream_encoder.h | 0 .../{ => dio}/dcn30/dcn30_dio_link_encoder.c | 0 .../{ => dio}/dcn30/dcn30_dio_link_encoder.h | 0
.../dcn30/dcn30_dio_stream_encoder.c | 0
.../dcn30/dcn30_dio_stream_encoder.h | 0
.../{ => dio}/dcn31/dcn31_dio_link_encoder.c | 0 .../{ => dio}/dcn31/dcn31_dio_link_encoder.h | 0 .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 2 +-
.../dc/dml/dcn32/display_mode_vba_32.c | 3 +
.../amd/display/dc/dml2/dml21/dml21_wrapper.c | 7 ++- .../display/dc/dml2/dml2_translation_helper.c | 1 + .../gpu/drm/amd/display/dc/dml2/dml2_utils.c | 14 +----
.../drm/amd/display/dc/dml2/dml2_wrapper.c | 15 -----
.../drm/amd/display/dc/dml2/dml2_wrapper.h | 2 -
.../display/dc/hubbub/dcn401/dcn401_hubbub.c | 6 ++ .../amd/display/dc/hubp/dcn401/dcn401_hubp.c | 15 ++++- .../amd/display/dc/hwss/dce110/dce110_hwseq.c | 62 +++++++++++++++++--
.../amd/display/dc/hwss/dcn10/dcn10_hwseq.c | 2 +-
.../amd/display/dc/hwss/dcn21/dcn21_hwseq.c | 6 ++
.../amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 47 +++++++++++--- .../amd/display/dc/hwss/dcn401/dcn401_hwseq.h | 1 +
.../link/protocols/link_edp_panel_control.c | 2 +-
.../dc/resource/dcn314/dcn314_resource.c | 22 -------
.../dc/resource/dcn315/dcn315_resource.c | 2 +-
.../dc/resource/dcn35/dcn35_resource.c | 2 -
.../dc/resource/dcn401/dcn401_resource.c | 3 +
drivers/gpu/drm/amd/display/dc/spl/dc_spl.c | 8 +--
drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 1 +
.../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 5 +-
.../gpu/drm/amd/display/dmub/src/dmub_dcn35.c | 1 +
.../amd/display/modules/freesync/freesync.c | 2 +-
57 files changed, 287 insertions(+), 128 deletions(-) rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn10/dcn10_link_encoder.c (100%) rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn10/dcn10_link_encoder.h (100%) rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn10/dcn10_stream_encoder.c (100%) rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn10/dcn10_stream_encoder.h (100%) rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn20/dcn20_link_encoder.c (100%) rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn20/dcn20_link_encoder.h (100%) rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn20/dcn20_stream_encoder.c (100%) rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn20/dcn20_stream_encoder.h (100%) rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn30/dcn30_dio_link_encoder.c (100%) rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn30/dcn30_dio_link_encoder.h (100%) rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn30/dcn30_dio_stream_encoder.c (100%) rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn30/dcn30_dio_stream_encoder.h (100%) rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn31/dcn31_dio_link_encoder.c (100%) rename drivers/gpu/drm/amd/display/dc/{ => dio}/dcn31/dcn31_dio_link_encoder.h (100%)--
2.34.1