DC Patches December 20, 2024
Subsystems (5)
cover DC Patches December 20, 2024
From: Roman Li <[email protected]>
- Improvements for DP, Replay/PSR, DML, SPL, DCN32, DCN35, DCN401
- Extended logging for DSC, VABC and stream crc
- Optimization for cursor position updates
Aric Cyr (1):
drm/amd/display: Optimize cursor position updates
Aurabindo Pillai (1):
drm/amd/display: Add guards around MAX/MIN
Brandon Syu (1):
drm/amd/display: modify init dc_power_state
Dennis.Chan (1):
drm/amd/display: Implement Replay Low Hz Visual Confirm
Dillon Varone (1):
drm/amd/display: Cleanup outdated interfaces in dcn401_clk_mgr
Fangzhi Zuo (1):
drm/amd/display: Add Interface to Dump DSC Caps from dm
George Shen (5):
drm/amd/display: Parse RECEIVE_PORT0_CAP capabilities from DPCD drm/amd/display: Add DP required HBlank size calc to link interface drm/amd/display: Add expanded HBlank field to dc_crtc_timing drm/amd/display: Add HBlank reduction DPCD write to DPMS sequence drm/amd/display: Add 6bpc RGB case for dcn32 output bpp calculations
Iswara Nagulendran (1):
drm/amd/display: Add VC for VESA Aux Backlight Control
Karthi Kandasamy (2):
drm/amd/display: Update dc_tiling_info union to structure drm/amd/display: Ensure correct GFX tiling info passed to DML
Martin Leung (1):
drm/amd/display: Promote DC to 3.2.315
Natanel Roizenman (1):
drm/amd/display: correct type mismatches in comparisons in DML2
Peichen Huang (1):
drm/amd/display: have pretrain for dpia
Roman Li (1):
drm/amd/display: Add check for granularity in dml ceil/floor helpers
Samson Tam (2):
drm/amd/display: fix init_adj offset for cositing in SPL drm/amd/display: Clean up SPL code
Tom Chung (2):
drm/amd/display: Fix PSR-SU not support but still call the
amdgpu_dm_psr_enable
drm/amd/display: Disable replay and psr while VRR is enabled
Wayne Lin (4):
drm/amd/display: Add support for setting multiple CRC windows in dc drm/amd/display: Extend dc_stream_get_crc to support 2nd crc engine drm/amd/display: Adjust dm to use supported interfaces for setting
multiple crc windows
drm/amd/display: Extend capability to get multiple ROI CRCs
Yihan Zhu (2):
drm/amd/display: update sequential pg logic DCN35 drm/amd/display: power up all gating blocks when releasing hw DCN35
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 31 ++- .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 214 ++++++++++++---- .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h | 23 +- .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 2 +- .../amd/display/amdgpu_dm/amdgpu_dm_crtc.h | 2 +- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 31 +-- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 6 + .../display/amdgpu_dm/amdgpu_dm_irq_params.h | 4 +- .../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 17 +- .../amd/display/amdgpu_dm/amdgpu_dm_plane.h | 2 +- .../dc/clk_mgr/dcn401/dcn401_clk_mgr.c | 240 ++---------------- drivers/gpu/drm/amd/display/dc/core/dc.c | 75 +++++- .../drm/amd/display/dc/core/dc_hw_sequencer.c | 38 +++ .../drm/amd/display/dc/core/dc_link_exports.c | 8 + .../gpu/drm/amd/display/dc/core/dc_stream.c | 2 + drivers/gpu/drm/amd/display/dc/dc.h | 38 ++- drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 16 ++ drivers/gpu/drm/amd/display/dc/dc_dsc.h | 5 + drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 179 +++++++------ drivers/gpu/drm/amd/display/dc/dc_stream.h | 6 + drivers/gpu/drm/amd/display/dc/dc_types.h | 26 +- .../drm/amd/display/dc/dce/dce_mem_input.c | 10 +- .../display/dc/dce110/dce110_mem_input_v.c | 8 +- .../dc/dce110/dce110_timing_generator.c | 32 ++- .../dc/dce110/dce110_timing_generator.h | 2 +- .../dc/dce120/dce120_timing_generator.c | 34 ++- .../dc/dio/dcn35/dcn35_dio_link_encoder.c | 80 ++++++ .../dc/dio/dcn35/dcn35_dio_link_encoder.h | 18 ++ drivers/gpu/drm/amd/display/dc/dm_helpers.h | 5 + .../dc/dml/dcn32/display_mode_vba_util_32.c | 4 + .../drm/amd/display/dc/dml/dml_inline_defs.h | 8 + .../dc/dml2/dml21/dml21_translation_helper.c | 16 +- .../dml2/dml21/src/dml2_dpmm/dml2_dpmm_dcn4.c | 12 +- .../dml2/dml21/src/dml2_pmo/dml2_pmo_dcn3.c | 6 +- .../dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c | 30 +-- .../drm/amd/display/dc/dpp/dcn10/dcn10_dpp.c | 7 +- .../amd/display/dc/dpp/dcn401/dcn401_dpp_cm.c | 6 +- drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 45 ++++ .../amd/display/dc/hubp/dcn10/dcn10_hubp.c | 4 +- .../amd/display/dc/hubp/dcn10/dcn10_hubp.h | 4 +- .../amd/display/dc/hubp/dcn20/dcn20_hubp.c | 12 +- .../amd/display/dc/hubp/dcn20/dcn20_hubp.h | 2 +- .../amd/display/dc/hubp/dcn201/dcn201_hubp.c | 2 +- .../amd/display/dc/hubp/dcn30/dcn30_hubp.c | 4 +- .../amd/display/dc/hubp/dcn30/dcn30_hubp.h | 4 +- .../amd/display/dc/hubp/dcn35/dcn35_hubp.c | 2 +- .../amd/display/dc/hubp/dcn35/dcn35_hubp.h | 2 +- .../amd/display/dc/hubp/dcn401/dcn401_hubp.c | 14 +- .../amd/display/dc/hubp/dcn401/dcn401_hubp.h | 4 +- .../amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 41 ++- .../amd/display/dc/hwss/dcn35/dcn35_hwseq.h | 2 + .../amd/display/dc/hwss/dcn35/dcn35_init.c | 1 + .../drm/amd/display/dc/hwss/hw_sequencer.h | 6 +- drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h | 4 +- .../drm/amd/display/dc/inc/hw/link_encoder.h | 8 + .../gpu/drm/amd/display/dc/inc/hw/mem_input.h | 4 +- drivers/gpu/drm/amd/display/dc/inc/hw/optc.h | 2 +- .../amd/display/dc/inc/hw/timing_generator.h | 2 +- drivers/gpu/drm/amd/display/dc/inc/link.h | 4 + .../amd/display/dc/link/hwss/link_hwss_dio.c | 4 +- .../amd/display/dc/link/hwss/link_hwss_dpia.c | 61 ++++- .../amd/display/dc/link/hwss/link_hwss_dpia.h | 3 + .../drm/amd/display/dc/link/link_detection.c | 3 +- .../gpu/drm/amd/display/dc/link/link_dpms.c | 20 +- .../drm/amd/display/dc/link/link_factory.c | 1 + .../drm/amd/display/dc/link/link_validation.c | 179 +++++++++++++ .../drm/amd/display/dc/link/link_validation.h | 5 + .../dc/link/protocols/link_dp_capability.c | 5 + .../dc/link/protocols/link_dp_irq_handler.c | 5 +- .../amd/display/dc/optc/dcn10/dcn10_optc.c | 33 ++- .../amd/display/dc/optc/dcn10/dcn10_optc.h | 19 ++ .../dc/resource/dcn35/dcn35_resource.c | 9 +- .../dc/resource/dcn35/dcn35_resource.h | 1 + .../dc/resource/dcn351/dcn351_resource.c | 2 +- .../dc/resource/dcn401/dcn401_resource.c | 3 +- drivers/gpu/drm/amd/display/dc/spl/dc_spl.c | 99 ++++---- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 64 ++++- 77 files changed, 1356 insertions(+), 576 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/28 drm/amd/display: update sequential pg logic DCN35
From: Yihan Zhu <[email protected]>
[WHY & HOW]
No check for HUBP/DPP power gating when DSC instance is still running. Avoid HUBP/DPP to power gate when corresponding DSC block is still running in the power gating calculation.
--- drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +6 -1
@@ -1032,8 +1032,13 @@ void dcn35_calc_blocks_to_gate(struct dc *dc, struct dc_state *context,if (pipe_ctx->plane_res.dpp || pipe_ctx->stream_res.opp) update_state->pg_pipe_res_update[PG_MPCC ][pipe_ctx->plane_res.mpcc_inst] = false; -if (pipe_ctx->stream_res.dsc) +if (pipe_ctx->stream_res.dsc) { update_state->pg_pipe_res_update[PG_DSC ][pipe_ctx->stream_res.dsc->inst] = false; +if (dc->caps.sequential_ono) { + update_state->pg_pipe_res_update[PG_HUBP ][pipe_ctx->stream_res.dsc->inst] = false; + update_state->pg_pipe_res_update[PG_DPP ][pipe_ctx->stream_res.dsc->inst] = false; + } + }if (pipe_ctx->stream_res.opp) update_state->pg_pipe_res_update[PG_OPP ][pipe_ctx->stream_res.opp->inst] = false;
Signature · 1 line
2.34.1
PATCH 2/28 drm/amd/display: power up all gating blocks when releasing hw DCN35
In reply to [email protected]From: Yihan Zhu <[email protected]>
[WHY & HOW]
Driver disable will deallocate framebuffer to reset IPS state, this will cause IPS start with INIT state to blindly power gate ONO region to break power sequence. All the gating blocks should be powered up when releasing hw to ensure all the power optimizations are identical to pre-OS.
--- .../amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 34 +++++++++++++++++++ .../amd/display/dc/hwss/dcn35/dcn35_hwseq.h | 2 ++ .../amd/display/dc/hwss/dcn35/dcn35_init.c | 1 + 3 files changed, 37 insertions(+)
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +34 -0
@@ -1596,3 +1596,37 @@ bool dcn35_is_dp_dig_pixel_rate_div_policy(struct pipe_ctx *pipe_ctx)return false; } + +/* +* Set powerup to true for every pipe to match pre-OS configuration. +*/ +static void dcn35_calc_blocks_to_ungate_for_hw_release (struct dc *dc,struct pg_block_update *update_state) +{ +int i =0 , j =0 ; + +memset (update_state,0 ,sizeof (struct pg_block_update )); + +for (i =0 ; i < dc->res_pool->pipe_count; i++) +for (j =0 ; j <PG_HW_PIPE_RESOURCES_NUM_ELEMENT ; j++) + update_state->pg_pipe_res_update[j][i] = true; + + update_state->pg_res_update[PG_HPO ] = true; + update_state->pg_res_update[PG_DWB ] = true; +} + +/* +* The purpose is to power up all gatings to restore optimization to pre-OS env. +* Re-use hwss func and existing PG&RCG flags to decide powerup sequence. +*/ +void dcn35_hardware_release (struct dc *dc) +{ +struct pg_block_update pg_update_state; + +dcn35_calc_blocks_to_ungate_for_hw_release (dc, &pg_update_state); + +if (dc->hwss.root_clock_control) + dc->hwss.root_clock_control (dc, &pg_update_state, true); +/*power up required HW block*/ +if (dc->hwss.hw_block_power_up) + dc->hwss.hw_block_power_up (dc, &pg_update_state); +}
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h +2 -0
@@ -99,4 +99,6 @@ void dcn35_set_long_vblank(struct pipe_ctx **pipe_ctx,bool dcn35_is_dp_dig_pixel_rate_div_policy (struct pipe_ctx *pipe_ctx); +void dcn35_hardware_release (struct dc *dc); +#endif /* __DC_HWSS_DCN35_H__ */
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c +1 -0
@@ -122,6 +122,7 @@ static const struct hw_sequencer_funcs dcn35_funcs = { .root_clock_control = dcn35_root_clock_control, .set_long_vtotal = dcn35_set_long_vblank, .calculate_pix_rate_divider = dcn32_calculate_pix_rate_divider, + .hardware_release = dcn35_hardware_release, };static const struct hwseq_private_funcs dcn35_private_funcs = {
Signature · 1 line
2.34.1
PATCH 3/28 drm/amd/display: Cleanup outdated interfaces in dcn401_clk_mgr
In reply to [email protected]From: Dillon Varone <[email protected]>
[WHY&HOW]
- Remove legacy update clocks sequence
- FCLK P-State allow message is not required
--- .../dc/clk_mgr/dcn401/dcn401_clk_mgr.c | 240 ++---------------- drivers/gpu/drm/amd/display/dc/dc.h | 1 - 2 files changed, 17 insertions(+), 224 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c +17 -223
@@ -628,207 +628,6 @@ static void dcn401_update_clocks_update_dentist( } -static void dcn401_update_clocks_legacy (struct clk_mgr *clk_mgr_base, -struct dc_state *context, -bool safe_to_lower) -{ -struct clk_mgr_internal *clk_mgr =TO_CLK_MGR_INTERNAL (clk_mgr_base); -struct dc_clocks *new_clocks = &context->bw_ctx.bw.dcn.clk; -struct dc *dc = clk_mgr_base->ctx->dc; -int display_count; -bool update_dppclk = false; -bool update_dispclk = false; -bool enter_display_off = false; -bool dpp_clock_lowered = false; -struct dmcu *dmcu = clk_mgr_base->ctx->dc->res_pool->dmcu; -bool force_reset = false; -bool update_uclk = false, update_fclk = false; -bool p_state_change_support; -bool fclk_p_state_change_support; -int total_plane_count; - -if (dc->work_arounds.skip_clock_update) -return ; - -if (clk_mgr_base->clks.dispclk_khz ==0 || - (dc->debug.force_clock_mode &0x1 )) { -/* This is from resume or boot up, if forced_clock cfg option used, -* we bypass program dispclk and DPPCLK, but need set them for S3. -*/ - force_reset = true; - -dcn2_read_clocks_from_hw_dentist (clk_mgr_base); - -/* Force_clock_mode 0x1: force reset the clock even it is the same clock -* as long as it is in Passive level. -*/ - } - display_count =clk_mgr_helper_get_active_display_cnt (dc, context); - -if (display_count ==0 ) - enter_display_off = true; - -if (clk_mgr->smu_present) { -if (enter_display_off == safe_to_lower) -dcn401_smu_set_num_of_displays (clk_mgr, display_count); - - clk_mgr_base->clks.fclk_prev_p_state_change_support = clk_mgr_base->clks.fclk_p_state_change_support; - - total_plane_count =clk_mgr_helper_get_active_plane_cnt (dc, context); - fclk_p_state_change_support = new_clocks->fclk_p_state_change_support || (total_plane_count ==0 ); - -if (should_update_pstate_support (safe_to_lower, fclk_p_state_change_support, clk_mgr_base->clks.fclk_p_state_change_support)) { - clk_mgr_base->clks.fclk_p_state_change_support = fclk_p_state_change_support; - -/* To enable FCLK P-state switching, send PSTATE_SUPPORTED message to PMFW */ -if (clk_mgr_base->clks.fclk_p_state_change_support) { -/* Handle the code for sending a message to PMFW that FCLK P-state change is supported */ -dcn401_smu_send_fclk_pstate_message (clk_mgr, true); - } - } - -if (dc->debug.force_min_dcfclk_mhz >0 ) - new_clocks->dcfclk_khz = (new_clocks->dcfclk_khz > (dc->debug.force_min_dcfclk_mhz *1000 )) ? - new_clocks->dcfclk_khz : (dc->debug.force_min_dcfclk_mhz *1000 ); - -if (should_set_clock (safe_to_lower, new_clocks->dcfclk_khz, clk_mgr_base->clks.dcfclk_khz)) { - clk_mgr_base->clks.dcfclk_khz = new_clocks->dcfclk_khz; -if (dcn401_is_ppclk_dpm_enabled (clk_mgr,PPCLK_DCFCLK )) -dcn401_smu_set_hard_min_by_freq (clk_mgr,PPCLK_DCFCLK ,khz_to_mhz_ceil (clk_mgr_base->clks.dcfclk_khz)); - } - -if (should_set_clock (safe_to_lower, new_clocks->dcfclk_deep_sleep_khz, clk_mgr_base->clks.dcfclk_deep_sleep_khz)) { - clk_mgr_base->clks.dcfclk_deep_sleep_khz = new_clocks->dcfclk_deep_sleep_khz; -if (dcn401_is_ppclk_dpm_enabled (clk_mgr,PPCLK_DCFCLK )) -dcn401_smu_set_min_deep_sleep_dcef_clk (clk_mgr,khz_to_mhz_ceil (clk_mgr_base->clks.dcfclk_deep_sleep_khz)); - } - -if (should_set_clock (safe_to_lower, new_clocks->socclk_khz, clk_mgr_base->clks.socclk_khz)) -/* We don't actually care about socclk, don't notify SMU of hard min */ - clk_mgr_base->clks.socclk_khz = new_clocks->socclk_khz; - - clk_mgr_base->clks.prev_p_state_change_support = clk_mgr_base->clks.p_state_change_support; - clk_mgr_base->clks.prev_num_ways = clk_mgr_base->clks.num_ways; - -if (clk_mgr_base->clks.num_ways != new_clocks->num_ways && - clk_mgr_base->clks.num_ways < new_clocks->num_ways) { - clk_mgr_base->clks.num_ways = new_clocks->num_ways; -if (dcn401_is_ppclk_dpm_enabled (clk_mgr,PPCLK_UCLK )) -dcn401_smu_send_cab_for_uclk_message (clk_mgr, clk_mgr_base->clks.num_ways); - } - - - p_state_change_support = new_clocks->p_state_change_support || (total_plane_count ==0 ); -if (should_update_pstate_support (safe_to_lower, p_state_change_support, clk_mgr_base->clks.prev_p_state_change_support)) { - clk_mgr_base->clks.p_state_change_support = p_state_change_support; - clk_mgr_base->clks.fw_based_mclk_switching = p_state_change_support && new_clocks->fw_based_mclk_switching; - -/* to disable P-State switching, set UCLK min = max */ -if (!clk_mgr_base->clks.p_state_change_support &&dcn401_is_ppclk_dpm_enabled (clk_mgr,PPCLK_UCLK )) -dcn401_smu_set_hard_min_by_freq (clk_mgr,PPCLK_UCLK , - clk_mgr_base->bw_params->clk_table.entries[clk_mgr_base->bw_params->clk_table.num_entries_per_clk.num_memclk_levels -1 ].memclk_mhz); - } - -/* Always update saved value, even if new value not set due to P-State switching unsupported. Also check safe_to_lower for FCLK */ -if (safe_to_lower && (clk_mgr_base->clks.fclk_p_state_change_support != clk_mgr_base->clks.fclk_prev_p_state_change_support)) { - update_fclk = true; - } - -if (!clk_mgr_base->clks.fclk_p_state_change_support && - update_fclk && -dcn401_is_ppclk_dpm_enabled (clk_mgr,PPCLK_FCLK )) { -/* Handle code for sending a message to PMFW that FCLK P-state change is not supported */ -dcn401_smu_send_fclk_pstate_message (clk_mgr, false); - } - -/* Always update saved value, even if new value not set due to P-State switching unsupported */ -if (should_set_clock (safe_to_lower, new_clocks->dramclk_khz, clk_mgr_base->clks.dramclk_khz)) { - clk_mgr_base->clks.dramclk_khz = new_clocks->dramclk_khz; - update_uclk = true; - } - -/* set UCLK to requested value if P-State switching is supported, or to re-enable P-State switching */ -if (clk_mgr_base->clks.p_state_change_support && - (update_uclk || !clk_mgr_base->clks.prev_p_state_change_support) && -dcn401_is_ppclk_dpm_enabled (clk_mgr,PPCLK_UCLK )) -dcn401_smu_set_hard_min_by_freq (clk_mgr,PPCLK_UCLK ,khz_to_mhz_ceil (clk_mgr_base->clks.dramclk_khz)); - -if (clk_mgr_base->clks.num_ways != new_clocks->num_ways && - clk_mgr_base->clks.num_ways > new_clocks->num_ways) { - clk_mgr_base->clks.num_ways = new_clocks->num_ways; -if (dcn401_is_ppclk_dpm_enabled (clk_mgr,PPCLK_UCLK )) -dcn401_smu_send_cab_for_uclk_message (clk_mgr, clk_mgr_base->clks.num_ways); - } - } - -if (should_set_clock (safe_to_lower, new_clocks->dppclk_khz, clk_mgr_base->clks.dppclk_khz)) { -if (clk_mgr_base->clks.dppclk_khz > new_clocks->dppclk_khz) - dpp_clock_lowered = true; - - clk_mgr_base->clks.dppclk_khz = new_clocks->dppclk_khz; - clk_mgr_base->clks.actual_dppclk_khz = new_clocks->dppclk_khz; - -if (clk_mgr->smu_present && !dpp_clock_lowered &&dcn401_is_ppclk_dpm_enabled (clk_mgr,PPCLK_DPPCLK )) - clk_mgr_base->clks.actual_dppclk_khz =dcn401_set_hard_min_by_freq_optimized (clk_mgr,PPCLK_DPPCLK , clk_mgr_base->clks.dppclk_khz); - update_dppclk = true; - } - -if (should_set_clock (safe_to_lower, new_clocks->dispclk_khz, clk_mgr_base->clks.dispclk_khz)) { - clk_mgr_base->clks.dispclk_khz = new_clocks->dispclk_khz; - -if (clk_mgr->smu_present &&dcn401_is_ppclk_dpm_enabled (clk_mgr,PPCLK_DISPCLK )) - clk_mgr_base->clks.actual_dispclk_khz =dcn401_set_hard_min_by_freq_optimized (clk_mgr,PPCLK_DISPCLK , clk_mgr_base->clks.dispclk_khz); - - update_dispclk = true; - } - -if (!new_clocks->dtbclk_en &&dcn401_is_ppclk_dpm_enabled (clk_mgr,PPCLK_DTBCLK )) { - new_clocks->ref_dtbclk_khz = clk_mgr_base->bw_params->clk_table.entries[0 ].dtbclk_mhz *1000 ; - } - -/* clock limits are received with MHz precision, divide by 1000 to prevent setting clocks at every call */ -if (!dc->debug.disable_dtb_ref_clk_switch && -should_set_clock (safe_to_lower, new_clocks->ref_dtbclk_khz /1000 , clk_mgr_base->clks.ref_dtbclk_khz /1000 ) && -dcn401_is_ppclk_dpm_enabled (clk_mgr,PPCLK_DTBCLK )) { -/* DCCG requires KHz precision for DTBCLK */ - clk_mgr_base->clks.ref_dtbclk_khz = -dcn401_smu_set_hard_min_by_freq (clk_mgr,PPCLK_DTBCLK ,khz_to_mhz_ceil (new_clocks->ref_dtbclk_khz)); - -dcn401_update_clocks_update_dtb_dto (clk_mgr, context, clk_mgr_base->clks.ref_dtbclk_khz); - } - -if (dc->config.forced_clocks == false || (force_reset && safe_to_lower)) { -if (dpp_clock_lowered) { -/* if clock is being lowered, increase DTO before lowering refclk */ -dcn401_update_clocks_update_dpp_dto (clk_mgr, context, - safe_to_lower, clk_mgr_base->clks.dppclk_khz); -dcn401_update_clocks_update_dentist (clk_mgr, context); -if (clk_mgr->smu_present &&dcn401_is_ppclk_dpm_enabled (clk_mgr,PPCLK_DPPCLK )) { - clk_mgr_base->clks.actual_dppclk_khz =dcn401_set_hard_min_by_freq_optimized (clk_mgr,PPCLK_DPPCLK , - clk_mgr_base->clks.dppclk_khz); -dcn401_update_clocks_update_dpp_dto (clk_mgr, context, safe_to_lower, - clk_mgr_base->clks.actual_dppclk_khz); - } - - }else { -/* if clock is being raised, increase refclk before lowering DTO */ -if (update_dppclk || update_dispclk) -dcn401_update_clocks_update_dentist (clk_mgr, context); -/* There is a check inside dcn20_update_clocks_update_dpp_dto which ensures -* that we do not lower dto when it is not safe to lower. We do not need to -* compare the current and new dppclk before calling this function. -*/ -dcn401_update_clocks_update_dpp_dto (clk_mgr, context, - safe_to_lower, clk_mgr_base->clks.actual_dppclk_khz); - } - } - -if (update_dispclk && dmcu && dmcu->funcs->is_dmcu_initialized (dmcu)) -/*update dmcu for wait_loop count*/ - dmcu->funcs->set_psr_wait_loop (dmcu, - clk_mgr_base->clks.dispclk_khz /1000 /7 ); -} -static void dcn401_execute_block_sequence (struct clk_mgr *clk_mgr_base,unsigned int num_steps) {struct clk_mgr_internal *clk_mgr_internal =TO_CLK_MGR_INTERNAL (clk_mgr_base);
@@ -1008,15 +807,15 @@ static unsigned int dcn401_build_update_bandwidth_clocks_sequence( update_active_fclk = true; update_idle_fclk = true; -/* To enable FCLK P-state switching, send PSTATE_SUPPORTED message to PMFW */ -if (clk_mgr_base->clks.fclk_p_state_change_support) { -/* Handle the code for sending a message to PMFW that FCLK P-state change is supported */ -if (dcn401_is_ppclk_dpm_enabled (clk_mgr_internal,PPCLK_FCLK )) { - block_sequence[num_steps].params.update_pstate_support_params.support = true; - block_sequence[num_steps].func =CLK_MGR401_UPDATE_FCLK_PSTATE_SUPPORT ; - num_steps++; - } - } +/* To enable FCLK P-state switching, send PSTATE_SUPPORTED message to PMFW (message not supported on DCN401)*/ +// if (clk_mgr_base->clks.fclk_p_state_change_support) { +// /* Handle the code for sending a message to PMFW that FCLK P-state change is supported */ +// if (dcn401_is_ppclk_dpm_enabled(clk_mgr_internal, PPCLK_FCLK)) { +// block_sequence[num_steps].params.update_pstate_support_params.support = true; +// block_sequence[num_steps].func = CLK_MGR401_UPDATE_FCLK_PSTATE_SUPPORT; +// num_steps++; +// } +// } }if (!clk_mgr_base->clks.fclk_p_state_change_support &&dcn401_is_ppclk_dpm_enabled (clk_mgr_internal,PPCLK_FCLK )) {
@@ -1224,14 +1023,14 @@ static unsigned int dcn401_build_update_bandwidth_clocks_sequence(// (*num_steps)++; // } -/* disable FCLK P-State support if needed */ -if (!fclk_p_state_change_support && -should_update_pstate_support (safe_to_lower, fclk_p_state_change_support, clk_mgr_base->clks.fclk_prev_p_state_change_support) && -dcn401_is_ppclk_dpm_enabled (clk_mgr_internal,PPCLK_FCLK )) { - block_sequence[num_steps].params.update_pstate_support_params.support = false; - block_sequence[num_steps].func =CLK_MGR401_UPDATE_FCLK_PSTATE_SUPPORT ; - num_steps++; - } +/* disable FCLK P-State support if needed (message not supported on DCN401)*/ +// if (!fclk_p_state_change_support && +// should_update_pstate_support(safe_to_lower, fclk_p_state_change_support, clk_mgr_base->clks.fclk_prev_p_state_change_support) && +// dcn401_is_ppclk_dpm_enabled(clk_mgr_internal, PPCLK_FCLK)) { +// block_sequence[num_steps].params.update_pstate_support_params.support = false; +// block_sequence[num_steps].func = CLK_MGR401_UPDATE_FCLK_PSTATE_SUPPORT; +// num_steps++; +// } } if (new_clocks->fw_based_mclk_switching != clk_mgr_base->clks.fw_based_mclk_switching &&
@@ -1412,11 +1211,6 @@ static void dcn401_update_clocks(struct clk_mgr *clk_mgr_base,unsigned int num_steps =0 ; -if (dc->debug.enable_legacy_clock_update) { -dcn401_update_clocks_legacy (clk_mgr_base, context, safe_to_lower); -return ; - } -/* build bandwidth related clocks update sequence */ num_steps = dcn401_build_update_bandwidth_clocks_sequence(clk_mgr_base, context,
drivers/gpu/drm/amd/display/dc/dc.h +0 -1
@@ -1060,7 +1060,6 @@ struct dc_debug_options {uint32_t dml21_disable_pstate_method_mask;union fw_assisted_mclk_switch_version fams_version;union dmub_fams2_global_feature_config fams2_config; -bool enable_legacy_clock_update;unsigned int force_cositing;unsigned int disable_spl;unsigned int force_easf;
Signature · 1 line
2.34.1
PATCH 4/28 drm/amd/display: Parse RECEIVE_PORT0_CAP capabilities from DPCD
In reply to [email protected]From: George Shen <[email protected]>
[Why]
DPCD register RECEIVE_PORT0_CAP contains HBlank expansion/reduction capabilities of a DP device. These capabilities are required to enable HBlank expansion/reduction logic.
[How]
Read raw RECEIVE_PORT0_CAP register values and store parsed fields.
--- drivers/gpu/drm/amd/display/dc/dc.h | 8 ++++++++ drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 16 ++++++++++++++++ drivers/gpu/drm/amd/display/dc/dc_types.h | 8 ++++++++ .../dc/link/protocols/link_dp_capability.c | 5 +++++ 4 files changed, 37 insertions(+)
drivers/gpu/drm/amd/display/dc/dc.h +8 -0
@@ -2383,6 +2383,13 @@ struct dc_sink_dsc_caps {struct dsc_dec_dpcd_caps dsc_dec_caps; }; +struct dc_sink_hblank_expansion_caps { +// 'true' if these are virtual DPCD's HBlank expansion caps (immediately upstream of sink in MST topology), +// 'false' if they are sink's HBlank expansion caps +bool is_virtual_dpcd_hblank_expansion; +struct hblank_expansion_dpcd_caps dpcd_caps; +}; +struct dc_sink_fec_caps {bool is_rx_fec_supported;bool is_topology_fec_supported;
@@ -2409,6 +2416,7 @@ struct dc_sink {struct scdc_caps scdc_caps;struct dc_sink_dsc_caps dsc_caps;struct dc_sink_fec_caps fec_caps; +struct dc_sink_hblank_expansion_caps hblank_expansion_caps;bool is_vsc_sdp_colorimetry_supported;
drivers/gpu/drm/amd/display/dc/dc_dp_types.h +16 -0
@@ -969,6 +969,21 @@ union dp_sink_video_fallback_formats {uint8_t raw; }; +union dp_receive_port0_cap { +struct { +uint8_t RESERVED :1 ; +uint8_t LOCAL_EDID_PRESENT :1 ; +uint8_t ASSOCIATED_TO_PRECEDING_PORT:1 ; +uint8_t HBLANK_EXPANSION_CAPABLE :1 ; +uint8_t BUFFER_SIZE_UNIT :1 ; +uint8_t BUFFER_SIZE_PER_PORT :1 ; +uint8_t HBLANK_REDUCTION_CAPABLE :1 ; +uint8_t RESERVED2:1 ; +uint8_t BUFFER_SIZE:8 ; + } bits; +uint8_t raw[2 ]; +}; +union dpcd_max_uncompressed_pixel_rate_cap {struct {uint16_t max_uncompressed_pixel_rate_cap :15 ;
@@ -1193,6 +1208,7 @@ struct dpcd_caps {struct replay_info pr_info;uint16_t edp_oled_emission_rate; +union dp_receive_port0_cap receive_port0_cap; };union dpcd_sink_ext_caps {
drivers/gpu/drm/amd/display/dc/dc_types.h +8 -0
@@ -875,6 +875,14 @@ struct dsc_dec_dpcd_caps {bool is_dp;/* Decoded format */ }; +struct hblank_expansion_dpcd_caps { +bool expansion_supported; +bool reduction_supported; +bool buffer_unit_bytes;/* True: buffer size in bytes. False: buffer size in pixels*/ +bool buffer_per_port;/* True: buffer size per port. False: buffer size per lane*/ +uint32_t buffer_size;/* Add 1 to value and multiply by 32 */ +}; +struct dc_golden_table {uint16_t dc_golden_table_ver;uint32_t aux_dphy_rx_control0_val;
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c +5 -0
@@ -1779,6 +1779,11 @@ static bool retrieve_link_cap(struct dc_link *link) link->test_pattern_enabled = false; link->compliance_test_state.raw =0 ; + link->dpcd_caps.receive_port0_cap.raw[0 ] = + dpcd_data[DP_RECEIVE_PORT_0_CAP_0 -DP_DPCD_REV ]; + link->dpcd_caps.receive_port0_cap.raw[1 ] = + dpcd_data[DP_RECEIVE_PORT_0_BUFFER_SIZE -DP_DPCD_REV ]; +/* read sink count */ core_link_read_dpcd(link, DP_SINK_COUNT,
Signature · 1 line
2.34.1
PATCH 5/28 drm/amd/display: Add DP required HBlank size calc to link interface
In reply to [email protected]From: George Shen <[email protected]>
[Why]
Some features, such as HBlank expansion/reduction, needs to know how much HBlank is required to support basic audio.
[How]
Add interface to link to calculate required HBlank size for a given link + timing combination to support basic audio (i.e. 2-channel 48KHz).
--- .../drm/amd/display/dc/core/dc_link_exports.c | 8 + drivers/gpu/drm/amd/display/dc/dc.h | 18 ++ drivers/gpu/drm/amd/display/dc/inc/link.h | 4 + .../drm/amd/display/dc/link/link_factory.c | 1 + .../drm/amd/display/dc/link/link_validation.c | 179 ++++++++++++++++++ .../drm/amd/display/dc/link/link_validation.h | 5 + 6 files changed, 215 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_link_exports.c +8 -0
@@ -125,6 +125,14 @@ uint32_t dc_link_bandwidth_kbps(return link->dc->link_srv->dp_link_bandwidth_kbps (link, link_settings); } +uint32_t dc_link_required_hblank_size_bytes ( +const struct dc_link *link, +struct dp_audio_bandwidth_params *audio_params) +{ +return link->dc->link_srv->dp_required_hblank_size_bytes (link, + audio_params); +} +void dc_get_cur_link_res_map (const struct dc *dc,uint32_t *map) { dc->link_srv->get_cur_res_map (dc, map);
drivers/gpu/drm/amd/display/dc/dc.h +18 -0
@@ -2024,6 +2024,24 @@ uint32_t dc_link_bandwidth_kbps(const struct dc_link *link, const struct dc_link_settings *link_setting); +struct dp_audio_bandwidth_params { +const struct dc_crtc_timing *crtc_timing; +enum dp_link_encoding link_encoding; +uint32_t channel_count; +uint32_t sample_rate_hz; +}; + +/* The function calculates the minimum size of hblank (in bytes) needed to +* support the specified channel count and sample rate combination, given the +* link encoding and timing to be used. This calculation is not supported +* for 8b/10b SST. +* +* return - min hblank size in bytes, 0 if 8b/10b SST. +*/ +uint32_t dc_link_required_hblank_size_bytes ( +const struct dc_link *link, +struct dp_audio_bandwidth_params *audio_params); +/* The function takes a snapshot of current link resource allocation state * @dc: pointer to dc of the dm calling this * @map: a dc link resource snapshot defined internally to dc.
drivers/gpu/drm/amd/display/dc/inc/link.h +4 -0
@@ -148,6 +148,10 @@ struct link_service {const struct dc_stream_state *stream, const unsigned int num_streams); +uint32_t (*dp_required_hblank_size_bytes)( +const struct dc_link *link, +struct dp_audio_bandwidth_params *audio_params); +/*************************** DPMS *************************************/ void (*set_dpms_on)(struct dc_state *state,struct pipe_ctx *pipe_ctx);
drivers/gpu/drm/amd/display/dc/link/link_factory.c +1 -0
@@ -101,6 +101,7 @@ static void construct_link_service_validation(struct link_service *link_srv) link_srv->validate_mode_timing = link_validate_mode_timing; link_srv->dp_link_bandwidth_kbps = dp_link_bandwidth_kbps; link_srv->validate_dpia_bandwidth = link_validate_dpia_bandwidth; + link_srv->dp_required_hblank_size_bytes = dp_required_hblank_size_bytes; }/* link dpms owns the programming sequence of stream's dpms state associated
drivers/gpu/drm/amd/display/dc/link/link_validation.c +179 -0
182 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/link/link_validation.h +5 -0
@@ -37,4 +37,9 @@ uint32_t dp_link_bandwidth_kbps(const struct dc_link *link, const struct dc_link_settings *link_settings); + +uint32_t dp_required_hblank_size_bytes ( +const struct dc_link *link, +struct dp_audio_bandwidth_params *audio_params); +#endif /* __LINK_VALIDATION_H__ */
Signature · 1 line
2.34.1
PATCH 6/28 drm/amd/display: Add expanded HBlank field to dc_crtc_timing
In reply to [email protected]From: George Shen <[email protected]>
[Why]
For DP HBlank expansion/reduction, the HBlank parameters of the original EDID timing needs to be notified to the sink in order for the timing to be reduced back to the original HBlank size.
[How]
Add parameter in dc_crtc_timing to track the increased HBlank.
--- drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +3 -0
@@ -975,6 +975,9 @@ struct dc_crtc_timing {struct dc_crtc_timing_flags flags;uint32_t dsc_fixed_bits_per_pixel_x16;/* DSC target bitrate in 1/16 of bpp (e.g. 128 -> 8bpp) */ struct dc_dsc_config dsc_cfg; + +/* The number of pixels that HBlank has been expanded by from the original EDID timing. */ +uint32_t expanded_hblank; };enum trigger_delay {
Signature · 1 line
2.34.1
PATCH 7/28 drm/amd/display: Add support for setting multiple CRC windows in dc
In reply to [email protected]From: Wayne Lin <[email protected]>
[Why & How]
Have to support multiple CRC windows setting to dmub. Add new dmub forward functions for supporting/forwarding multiple crc windows setting to dmub.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 62 ++++++++++++++++++++++ drivers/gpu/drm/amd/display/dc/dc_stream.h | 5 ++ drivers/gpu/drm/amd/display/dc/dc_types.h | 7 +++ 3 files changed, 74 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +62 -0
@@ -615,6 +615,68 @@ dc_stream_forward_crc_window(struct dc_stream_state *stream,return true; } + +static void +dc_stream_forward_dmub_multiple_crc_window (struct dc_dmub_srv *dmub_srv, +struct crc_window *window,struct otg_phy_mux *mux_mapping,bool stop) +{ +int i; +union dmub_rb_cmd cmd = {0 }; + + cmd.secure_display.mul_roi_ctl.phy_id = mux_mapping->phy_output_num; + cmd.secure_display.mul_roi_ctl.otg_id = mux_mapping->otg_output_num; + + cmd.secure_display.header.type =DMUB_CMD__SECURE_DISPLAY ; + +if (stop) { + cmd.secure_display.header.sub_type =DMUB_CMD__SECURE_DISPLAY_MULTIPLE_CRC_STOP_UPDATE ; + }else { + cmd.secure_display.header.sub_type =DMUB_CMD__SECURE_DISPLAY_MULTIPLE_CRC_WIN_NOTIFY ; +for (i =0 ; i <MAX_CRC_WINDOW_NUM ; i++) { + cmd.secure_display.mul_roi_ctl.roi_ctl[i].x_start = window[i].rect.x; + cmd.secure_display.mul_roi_ctl.roi_ctl[i].y_start = window[i].rect.y; + cmd.secure_display.mul_roi_ctl.roi_ctl[i].x_end = window[i].rect.x + window[i].rect.width; + cmd.secure_display.mul_roi_ctl.roi_ctl[i].y_end = window[i].rect.y + window[i].rect.height; + cmd.secure_display.mul_roi_ctl.roi_ctl[i].enable = window[i].enable; + } + } + +dc_wake_and_execute_dmub_cmd (dmub_srv->ctx, &cmd,DM_DMUB_WAIT_TYPE_NO_WAIT ); +} + +bool +dc_stream_forward_multiple_crc_window (struct dc_stream_state *stream, +struct crc_window *window,uint8_t phy_id,bool stop) +{ +struct dc_dmub_srv *dmub_srv; +struct otg_phy_mux mux_mapping; +struct pipe_ctx *pipe; +int i; +struct dc *dc = stream->ctx->dc; + +for (i =0 ; i <MAX_PIPES ; i++) { + pipe = &dc->current_state->res_ctx.pipe_ctx[i]; +if (pipe->stream == stream && !pipe->top_pipe && !pipe->prev_odm_pipe) +break ; + } + +/* Stream not found */ +if (i ==MAX_PIPES ) +return false; + + mux_mapping.phy_output_num = phy_id; + mux_mapping.otg_output_num = pipe->stream_res.tg->inst; + + dmub_srv = dc->ctx->dmub_srv; + +/* forward to dmub only. no dmcu support*/ +if (dmub_srv) +dc_stream_forward_dmub_multiple_crc_window (dmub_srv, window, &mux_mapping, stop); +else +return false; + +return true; +}#endif /* CONFIG_DRM_AMD_SECURE_DISPLAY */ /**
drivers/gpu/drm/amd/display/dc/dc_stream.h +5 -0
@@ -539,6 +539,11 @@ bool dc_stream_forward_crc_window(struct dc_stream_state *stream,struct rect *rect, uint8_t phy_id, bool is_stop); + +bool dc_stream_forward_multiple_crc_window (struct dc_stream_state *stream, +struct crc_window *window, +uint8_t phy_id, +bool stop);#endif bool dc_stream_configure_crc(struct dc *dc,
drivers/gpu/drm/amd/display/dc/dc_types.h +7 -0
@@ -940,10 +940,17 @@ enum backlight_control_type { };#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY ) +#define MAX_CRC_WINDOW_NUM 2 +struct otg_phy_mux {uint8_t phy_output_num;uint8_t otg_output_num; }; + +struct crc_window { +struct rect rect; +bool enable; +};#endif enum dc_detect_reason {
Signature · 1 line
2.34.1
PATCH 8/28 drm/amd/display: Extend dc_stream_get_crc to support 2nd crc engine
In reply to [email protected]From: Wayne Lin <[email protected]>
[Why & How]
Since now we can set multiple crc windows for secure display, add a new input parameter for dc_stream_get_crc to indicate to fetch crc from which crc engine.
--- .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 2 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 5 +-- drivers/gpu/drm/amd/display/dc/dc_stream.h | 1 + .../dc/dce110/dce110_timing_generator.c | 32 ++++++++++++----- .../dc/dce110/dce110_timing_generator.h | 2 +- .../dc/dce120/dce120_timing_generator.c | 34 ++++++++++++++----- drivers/gpu/drm/amd/display/dc/inc/hw/optc.h | 2 +- .../amd/display/dc/inc/hw/timing_generator.h | 2 +- .../amd/display/dc/optc/dcn10/dcn10_optc.c | 33 +++++++++++++----- .../amd/display/dc/optc/dcn10/dcn10_optc.h | 19 +++++++++++ 10 files changed, 101 insertions(+), 31 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c +1 -1
@@ -709,7 +709,7 @@ void amdgpu_dm_crtc_handle_crc_irq(struct drm_crtc *crtc) }if (dm_is_crc_source_crtc (cur_crc_src)) { -if (!dc_stream_get_crc (stream_state->ctx->dc, stream_state, +if (!dc_stream_get_crc (stream_state->ctx->dc, stream_state,0 , &crcs[0 ], &crcs[1 ], &crcs[2 ]))return ;
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -2
@@ -753,6 +753,7 @@ bool dc_stream_configure_crc(struct dc *dc, struct dc_stream_state *stream,* * @dc: DC object. * @stream: The DC stream state of the stream to get CRCs from. +* @idx: index of crc engine to get CRC from * @r_cr: CRC value for the red component. * @g_y: CRC value for the green component. * @b_cb: CRC value for the blue component.
@@ -762,7 +763,7 @@ bool dc_stream_configure_crc(struct dc *dc, struct dc_stream_state *stream,* Return: * %false if stream is not found, or if CRCs are not enabled. */ -bool dc_stream_get_crc (struct dc *dc,struct dc_stream_state *stream, +bool dc_stream_get_crc (struct dc *dc,struct dc_stream_state *stream,uint8_t idx,uint32_t *r_cr,uint32_t *g_y,uint32_t *b_cb) {int i;
@@ -783,7 +784,7 @@ bool dc_stream_get_crc(struct dc *dc, struct dc_stream_state *stream, tg = pipe->stream_res.tg;if (tg->funcs->get_crc) -return tg->funcs->get_crc (tg, r_cr, g_y, b_cb); +return tg->funcs->get_crc (tg, idx, r_cr, g_y, b_cb);DC_LOG_WARNING ("CRC capture not supported." );return false; }
drivers/gpu/drm/amd/display/dc/dc_stream.h +1 -0
@@ -554,6 +554,7 @@ bool dc_stream_configure_crc(struct dc *dc,bool dc_stream_get_crc (struct dc *dc,struct dc_stream_state *stream, +uint8_t idx,uint32_t *r_cr,uint32_t *g_y,uint32_t *b_cb);
drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator.c +24 -8
@@ -2190,7 +2190,7 @@ bool dce110_configure_crc(struct timing_generator *tg,return true; } -bool dce110_get_crc (struct timing_generator *tg, +bool dce110_get_crc (struct timing_generator *tg,uint8_t idx,uint32_t *r_cr,uint32_t *g_y,uint32_t *b_cb) {uint32_t addr =0 ;
@@ -2206,14 +2206,30 @@ bool dce110_get_crc(struct timing_generator *tg,if (!field)return false; - addr =CRTC_REG (mmCRTC_CRC0_DATA_RG); - value =dm_read_reg (tg->ctx, addr); - *r_cr =get_reg_field_value (value,CRTC_CRC0_DATA_RG ,CRC0_R_CR ); - *g_y =get_reg_field_value (value,CRTC_CRC0_DATA_RG ,CRC0_G_Y ); +switch (idx) { +case 0 : + addr =CRTC_REG (mmCRTC_CRC0_DATA_RG); + value =dm_read_reg (tg->ctx, addr); + *r_cr =get_reg_field_value (value,CRTC_CRC0_DATA_RG ,CRC0_R_CR ); + *g_y =get_reg_field_value (value,CRTC_CRC0_DATA_RG ,CRC0_G_Y ); - addr =CRTC_REG (mmCRTC_CRC0_DATA_B); - value =dm_read_reg (tg->ctx, addr); - *b_cb =get_reg_field_value (value,CRTC_CRC0_DATA_B ,CRC0_B_CB ); + addr =CRTC_REG (mmCRTC_CRC0_DATA_B); + value =dm_read_reg (tg->ctx, addr); + *b_cb =get_reg_field_value (value,CRTC_CRC0_DATA_B ,CRC0_B_CB ); +break ; +case 1 : + addr =CRTC_REG (mmCRTC_CRC1_DATA_RG); + value =dm_read_reg (tg->ctx, addr); + *r_cr =get_reg_field_value (value,CRTC_CRC1_DATA_RG ,CRC1_R_CR ); + *g_y =get_reg_field_value (value,CRTC_CRC1_DATA_RG ,CRC1_G_Y ); + + addr =CRTC_REG (mmCRTC_CRC1_DATA_B); + value =dm_read_reg (tg->ctx, addr); + *b_cb =get_reg_field_value (value,CRTC_CRC1_DATA_B ,CRC1_B_CB ); +break ; +default : +return false; + }return true; }
drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator.h +1 -1
@@ -286,7 +286,7 @@ bool dce110_arm_vert_intr(bool dce110_configure_crc (struct timing_generator *tg,const struct crc_params *params); -bool dce110_get_crc (struct timing_generator *tg, +bool dce110_get_crc (struct timing_generator *tg,uint8_t idx,uint32_t *r_cr,uint32_t *g_y,uint32_t *b_cb);bool dce110_is_two_pixels_per_container (const struct dc_crtc_timing *timing);
drivers/gpu/drm/amd/display/dc/dce120/dce120_timing_generator.c +25 -9
@@ -1137,8 +1137,8 @@ static bool dce120_configure_crc(struct timing_generator *tg,return true; } -static bool dce120_get_crc (struct timing_generator *tg,uint32_t *r_cr, -uint32_t *g_y,uint32_t *b_cb) +static bool dce120_get_crc (struct timing_generator *tg,uint8_t idx, +uint32_t *r_cr,uint32_t *g_y,uint32_t *b_cb) {struct dce110_timing_generator *tg110 =DCE110TG_FROM_TG (tg);uint32_t value, field;
@@ -1151,14 +1151,30 @@ static bool dce120_get_crc(struct timing_generator *tg, uint32_t *r_cr,if (!field)return false; - value =dm_read_reg_soc15 (tg->ctx, mmCRTC0_CRTC_CRC0_DATA_RG, - tg110->offsets.crtc); - *r_cr =get_reg_field_value (value,CRTC0_CRTC_CRC0_DATA_RG ,CRC0_R_CR ); - *g_y =get_reg_field_value (value,CRTC0_CRTC_CRC0_DATA_RG ,CRC0_G_Y ); +switch (idx) { +case 0 : + value =dm_read_reg_soc15 (tg->ctx, mmCRTC0_CRTC_CRC0_DATA_RG, + tg110->offsets.crtc); + *r_cr =get_reg_field_value (value,CRTC0_CRTC_CRC0_DATA_RG ,CRC0_R_CR ); + *g_y =get_reg_field_value (value,CRTC0_CRTC_CRC0_DATA_RG ,CRC0_G_Y ); - value =dm_read_reg_soc15 (tg->ctx, mmCRTC0_CRTC_CRC0_DATA_B, - tg110->offsets.crtc); - *b_cb =get_reg_field_value (value,CRTC0_CRTC_CRC0_DATA_B ,CRC0_B_CB ); + value =dm_read_reg_soc15 (tg->ctx, mmCRTC0_CRTC_CRC0_DATA_B, + tg110->offsets.crtc); + *b_cb =get_reg_field_value (value,CRTC0_CRTC_CRC0_DATA_B ,CRC0_B_CB ); +break ; +case 1 : + value =dm_read_reg_soc15 (tg->ctx, mmCRTC0_CRTC_CRC1_DATA_RG, + tg110->offsets.crtc); + *r_cr =get_reg_field_value (value,CRTC0_CRTC_CRC1_DATA_RG ,CRC1_R_CR ); + *g_y =get_reg_field_value (value,CRTC0_CRTC_CRC1_DATA_RG ,CRC1_G_Y ); + + value =dm_read_reg_soc15 (tg->ctx, mmCRTC0_CRTC_CRC1_DATA_B, + tg110->offsets.crtc); + *b_cb =get_reg_field_value (value,CRTC0_CRTC_CRC1_DATA_B ,CRC1_B_CB ); +break ; +default : +return false; + }return true; }
drivers/gpu/drm/amd/display/dc/inc/hw/optc.h +1 -1
@@ -210,7 +210,7 @@ void optc1_enable_crtc_reset(struct timing_generator *optc,bool optc1_configure_crc (struct timing_generator *optc,const struct crc_params *params); -bool optc1_get_crc (struct timing_generator *optc, +bool optc1_get_crc (struct timing_generator *optc,uint8_t idx,uint32_t *r_cr,uint32_t *g_y,uint32_t *b_cb);
drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h +1 -1
@@ -291,7 +291,7 @@ struct timing_generator_funcs {* @get_crc: Get CRCs for the given timing generator. Return false if * CRCs are not enabled (via configure_crc). */ -bool (*get_crc)(struct timing_generator *tg, +bool (*get_crc)(struct timing_generator *tg,uint8_t idx,uint32_t *r_cr,uint32_t *g_y,uint32_t *b_cb);void (*program_manual_trigger)(struct timing_generator *optc);
drivers/gpu/drm/amd/display/dc/optc/dcn10/dcn10_optc.c +25 -8
@@ -1510,6 +1510,7 @@ bool optc1_configure_crc(struct timing_generator *optc,* optc1_get_crc - Capture CRC result per component * * @optc: timing_generator instance. +* @idx: index of crc engine to get CRC from * @r_cr: 16-bit primary CRC signature for red data. * @g_y: 16-bit primary CRC signature for green data. * @b_cb: 16-bit primary CRC signature for blue data.
@@ -1521,7 +1522,7 @@ bool optc1_configure_crc(struct timing_generator *optc,* If CRC is disabled, return false; otherwise, return true, and the CRC * results in the parameters. */ -bool optc1_get_crc (struct timing_generator *optc, +bool optc1_get_crc (struct timing_generator *optc,uint8_t idx,uint32_t *r_cr,uint32_t *g_y,uint32_t *b_cb) {uint32_t field =0 ;
@@ -1533,14 +1534,30 @@ bool optc1_get_crc(struct timing_generator *optc,if (!field)return false; -/* OTG_CRC0_DATA_RG has the CRC16 results for the red and green component */ -REG_GET_2 (OTG_CRC0_DATA_RG , -CRC0_R_CR , r_cr, -CRC0_G_Y , g_y); +switch (idx) { +case 0 : +/* OTG_CRC0_DATA_RG has the CRC16 results for the red and green component */ +REG_GET_2 (OTG_CRC0_DATA_RG , +CRC0_R_CR , r_cr, +CRC0_G_Y , g_y); -/* OTG_CRC0_DATA_B has the CRC16 results for the blue component */ -REG_GET (OTG_CRC0_DATA_B , -CRC0_B_CB , b_cb); +/* OTG_CRC0_DATA_B has the CRC16 results for the blue component */ +REG_GET (OTG_CRC0_DATA_B , +CRC0_B_CB , b_cb); +break ; +case 1 : +/* OTG_CRC1_DATA_RG has the CRC16 results for the red and green component */ +REG_GET_2 (OTG_CRC1_DATA_RG , +CRC1_R_CR , r_cr, +CRC1_G_Y , g_y); + +/* OTG_CRC1_DATA_B has the CRC16 results for the blue component */ +REG_GET (OTG_CRC1_DATA_B , +CRC1_B_CB , b_cb); +break ; +default : +return false; + }return true; }
drivers/gpu/drm/amd/display/dc/optc/dcn10/dcn10_optc.h +19 -0
@@ -86,6 +86,12 @@SRI (OTG_CRC0_WINDOWA_Y_CONTROL ,OTG , inst),\SRI (OTG_CRC0_WINDOWB_X_CONTROL ,OTG , inst),\SRI (OTG_CRC0_WINDOWB_Y_CONTROL ,OTG , inst),\ +SRI (OTG_CRC1_DATA_RG ,OTG , inst),\ +SRI (OTG_CRC1_DATA_B ,OTG , inst),\ +SRI (OTG_CRC1_WINDOWA_X_CONTROL ,OTG , inst),\ +SRI (OTG_CRC1_WINDOWA_Y_CONTROL ,OTG , inst),\ +SRI (OTG_CRC1_WINDOWB_X_CONTROL ,OTG , inst),\ +SRI (OTG_CRC1_WINDOWB_Y_CONTROL ,OTG , inst),\SR (GSL_SOURCE_SELECT ),\SRI (OTG_GLOBAL_CONTROL2 ,OTG , inst),\SRI (OTG_TRIGA_MANUAL_TRIG ,OTG , inst)
@@ -315,6 +321,7 @@ struct dcn_optc_registers {SF (OTG0_OTG_GSL_CONTROL ,OTG_GSL_CHECK_ALL_FIELDS , mask_sh),\SF (OTG0_OTG_CRC_CNTL ,OTG_CRC_CONT_EN , mask_sh),\SF (OTG0_OTG_CRC_CNTL ,OTG_CRC0_SELECT , mask_sh),\ +SF (OTG0_OTG_CRC_CNTL ,OTG_CRC1_SELECT , mask_sh),\SF (OTG0_OTG_CRC_CNTL ,OTG_CRC_EN , mask_sh),\SF (OTG0_OTG_CRC0_DATA_RG ,CRC0_R_CR , mask_sh),\ SF(OTG0_OTG_CRC0_DATA_RG, CRC0_G_Y, mask_sh),\
@@ -327,6 +334,17 @@ struct dcn_optc_registers {SF (OTG0_OTG_CRC0_WINDOWB_X_CONTROL ,OTG_CRC0_WINDOWB_X_END , mask_sh),\SF (OTG0_OTG_CRC0_WINDOWB_Y_CONTROL ,OTG_CRC0_WINDOWB_Y_START , mask_sh),\SF (OTG0_OTG_CRC0_WINDOWB_Y_CONTROL ,OTG_CRC0_WINDOWB_Y_END , mask_sh),\ +SF (OTG0_OTG_CRC1_DATA_RG ,CRC1_R_CR , mask_sh),\ +SF (OTG0_OTG_CRC1_DATA_RG ,CRC1_G_Y , mask_sh),\ +SF (OTG0_OTG_CRC1_DATA_B ,CRC1_B_CB , mask_sh),\ +SF (OTG0_OTG_CRC1_WINDOWA_X_CONTROL ,OTG_CRC1_WINDOWA_X_START , mask_sh),\ +SF (OTG0_OTG_CRC1_WINDOWA_X_CONTROL ,OTG_CRC1_WINDOWA_X_END , mask_sh),\ +SF (OTG0_OTG_CRC1_WINDOWA_Y_CONTROL ,OTG_CRC1_WINDOWA_Y_START , mask_sh),\ +SF (OTG0_OTG_CRC1_WINDOWA_Y_CONTROL ,OTG_CRC1_WINDOWA_Y_END , mask_sh),\ +SF (OTG0_OTG_CRC1_WINDOWB_X_CONTROL ,OTG_CRC1_WINDOWB_X_START , mask_sh),\ +SF (OTG0_OTG_CRC1_WINDOWB_X_CONTROL ,OTG_CRC1_WINDOWB_X_END , mask_sh),\ +SF (OTG0_OTG_CRC1_WINDOWB_Y_CONTROL ,OTG_CRC1_WINDOWB_Y_START , mask_sh),\ +SF (OTG0_OTG_CRC1_WINDOWB_Y_CONTROL ,OTG_CRC1_WINDOWB_Y_END , mask_sh),\SF (GSL_SOURCE_SELECT ,GSL0_READY_SOURCE_SEL , mask_sh),\SF (GSL_SOURCE_SELECT ,GSL1_READY_SOURCE_SEL , mask_sh),\ SF(GSL_SOURCE_SELECT, GSL2_READY_SOURCE_SEL, mask_sh),\
@@ -482,6 +500,7 @@ struct dcn_optc_registers {type OTG_MASTER_UPDATE_LOCK_VUPDATE_KEEPOUT_EN ;\type OTG_CRC_CONT_EN ;\type OTG_CRC0_SELECT ;\ +type OTG_CRC1_SELECT ;\type OTG_CRC_EN ;\type CRC0_R_CR ;\type CRC0_G_Y ;\
Signature · 1 line
2.34.1
PATCH 9/28 drm/amd/display: Adjust dm to use supported interfaces for setting multiple crc windows
In reply to [email protected]From: Wayne Lin <[email protected]>
[Why & How]
We actually have the capability to calculate independent CRC for 2 crc window at the same time. Extend dm with the capability by having array to configure/maintain multiple crc windows. Add the flexibility but use 1st CRC instance only for now. Can change to use the 2nd CRC instance if needed.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 23 ++- .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 176 +++++++++++++----- .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h | 23 ++- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 31 +-- .../display/amdgpu_dm/amdgpu_dm_irq_params.h | 4 +- 5 files changed, 185 insertions(+), 72 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +16 -7
@@ -2155,6 +2155,10 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)amdgpu_dm_crtc_secure_display_create_contexts (adev);if (!adev->dm.secure_display_ctx.crtc_ctx)DRM_ERROR ("amdgpu: failed to initialize secure display contexts.\n" ); + +if (amdgpu_ip_version (adev,DCE_HWIP ,0 ) >=IP_VERSION (4 ,0 ,1 )) + adev->dm.secure_display_ctx.support_mul_roi = true; +#endif DRM_DEBUG_DRIVER ("KMS initialized.\n" );
@@ -10058,14 +10062,19 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)if (amdgpu_dm_is_valid_crc_source (cur_crc_src)) {#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY )if (amdgpu_dm_crc_window_is_activated (crtc)) { +uint8_t cnt;spin_lock_irqsave (&adev_to_drm (adev)->event_lock, flags); - acrtc->dm_irq_params.window_param.update_win = true; - -/** -* It takes 2 frames for HW to stably generate CRC when -* resuming from suspend, so we set skip_frame_cnt 2. -*/ - acrtc->dm_irq_params.window_param.skip_frame_cnt =2 ; +for (cnt =0 ; cnt <MAX_CRC_WINDOW_NUM ; cnt++) { +if (acrtc->dm_irq_params.window_param[cnt].enable) { + acrtc->dm_irq_params.window_param[cnt].update_win = true; + +/** +* It takes 2 frames for HW to stably generate CRC when +* resuming from suspend, so we set skip_frame_cnt 2. +*/ + acrtc->dm_irq_params.window_param[cnt].skip_frame_cnt =2 ; + } + }spin_unlock_irqrestore (&adev_to_drm (adev)->event_lock, flags); }#endif
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c +130 -46
245 lines not on this page · raw message
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h +20 -3
@@ -51,13 +51,27 @@ struct phy_id_mapping {u8 rad[8 ]; }; +struct crc_data { +uint32_t crc_R; +uint32_t crc_G; +uint32_t crc_B; +uint32_t frame_count; +bool crc_ready; +}; + +struct crc_info { +struct crc_data crc[MAX_CRC_WINDOW_NUM ]; +struct completion completion; +spinlock_t lock; +}; +struct crc_window_param {uint16_t x_start;uint16_t y_start;uint16_t x_end;uint16_t y_end;/* CRC window is activated or not*/ -bool activated; +bool enable;/* Update crc window during vertical blank or not */ bool update_win;/* skip reading/writing for few frames */
@@ -74,13 +88,16 @@ struct secure_display_crtc_context {struct drm_crtc *crtc;/* Region of Interest (ROI) */ -struct rect rect; +struct crc_window roi[MAX_CRC_WINDOW_NUM ]; + +struct crc_info crc_info; };struct secure_display_context {struct secure_display_crtc_context *crtc_ctx; - +/* Whether dmub support multiple ROI setting */ +bool support_mul_roi;bool phy_mapping_updated;int phy_id_mapping_cnt;struct phy_id_mapping phy_id_mapping[MAX_CRTC ];
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +16 -15
@@ -3477,8 +3477,8 @@ static int crc_win_x_start_set(void *data, u64 val)struct amdgpu_crtc *acrtc =to_amdgpu_crtc (crtc);spin_lock_irq (&drm_dev->event_lock); - acrtc->dm_irq_params.window_param.x_start = (uint16_t ) val; - acrtc->dm_irq_params.window_param.update_win = false; + acrtc->dm_irq_params.window_param[0 ].x_start = (uint16_t ) val; + acrtc->dm_irq_params.window_param[0 ].update_win = false;spin_unlock_irq (&drm_dev->event_lock);return 0 ;
@@ -3494,7 +3494,7 @@ static int crc_win_x_start_get(void *data, u64 *val)struct amdgpu_crtc *acrtc =to_amdgpu_crtc (crtc);spin_lock_irq (&drm_dev->event_lock); - *val = acrtc->dm_irq_params.window_param.x_start; + *val = acrtc->dm_irq_params.window_param[0 ].x_start;spin_unlock_irq (&drm_dev->event_lock);return 0 ;
@@ -3514,8 +3514,8 @@ static int crc_win_y_start_set(void *data, u64 val)struct amdgpu_crtc *acrtc =to_amdgpu_crtc (crtc);spin_lock_irq (&drm_dev->event_lock); - acrtc->dm_irq_params.window_param.y_start = (uint16_t ) val; - acrtc->dm_irq_params.window_param.update_win = false; + acrtc->dm_irq_params.window_param[0 ].y_start = (uint16_t ) val; + acrtc->dm_irq_params.window_param[0 ].update_win = false;spin_unlock_irq (&drm_dev->event_lock);return 0 ;
@@ -3531,7 +3531,7 @@ static int crc_win_y_start_get(void *data, u64 *val)struct amdgpu_crtc *acrtc =to_amdgpu_crtc (crtc);spin_lock_irq (&drm_dev->event_lock); - *val = acrtc->dm_irq_params.window_param.y_start; + *val = acrtc->dm_irq_params.window_param[0 ].y_start;spin_unlock_irq (&drm_dev->event_lock);return 0 ;
@@ -3550,8 +3550,8 @@ static int crc_win_x_end_set(void *data, u64 val)struct amdgpu_crtc *acrtc =to_amdgpu_crtc (crtc);spin_lock_irq (&drm_dev->event_lock); - acrtc->dm_irq_params.window_param.x_end = (uint16_t ) val; - acrtc->dm_irq_params.window_param.update_win = false; + acrtc->dm_irq_params.window_param[0 ].x_end = (uint16_t ) val; + acrtc->dm_irq_params.window_param[0 ].update_win = false;spin_unlock_irq (&drm_dev->event_lock);return 0 ;
@@ -3567,7 +3567,7 @@ static int crc_win_x_end_get(void *data, u64 *val)struct amdgpu_crtc *acrtc =to_amdgpu_crtc (crtc);spin_lock_irq (&drm_dev->event_lock); - *val = acrtc->dm_irq_params.window_param.x_end; + *val = acrtc->dm_irq_params.window_param[0 ].x_end;spin_unlock_irq (&drm_dev->event_lock);return 0 ;
@@ -3586,8 +3586,8 @@ static int crc_win_y_end_set(void *data, u64 val)struct amdgpu_crtc *acrtc =to_amdgpu_crtc (crtc);spin_lock_irq (&drm_dev->event_lock); - acrtc->dm_irq_params.window_param.y_end = (uint16_t ) val; - acrtc->dm_irq_params.window_param.update_win = false; + acrtc->dm_irq_params.window_param[0 ].y_end = (uint16_t ) val; + acrtc->dm_irq_params.window_param[0 ].update_win = false;spin_unlock_irq (&drm_dev->event_lock);return 0 ;
@@ -3603,7 +3603,7 @@ static int crc_win_y_end_get(void *data, u64 *val)struct amdgpu_crtc *acrtc =to_amdgpu_crtc (crtc);spin_lock_irq (&drm_dev->event_lock); - *val = acrtc->dm_irq_params.window_param.y_end; + *val = acrtc->dm_irq_params.window_param[0 ].y_end;spin_unlock_irq (&drm_dev->event_lock);return 0 ;
@@ -3630,9 +3630,10 @@ static int crc_win_update_set(void *data, u64 val)spin_lock_irq (&adev_to_drm (adev)->event_lock); - acrtc->dm_irq_params.window_param.activated = true; - acrtc->dm_irq_params.window_param.update_win = true; - acrtc->dm_irq_params.window_param.skip_frame_cnt =0 ; + acrtc->dm_irq_params.window_param[0 ].enable = true; + acrtc->dm_irq_params.window_param[0 ].update_win = true; + acrtc->dm_irq_params.window_param[0 ].skip_frame_cnt =0 ; + acrtc->dm_irq_params.crc_window_activated = true;spin_unlock_irq (&adev_to_drm (adev)->event_lock);mutex_unlock (&adev->dm.dc_lock);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq_params.h +3 -1
@@ -39,7 +39,9 @@ struct dm_irq_params {#ifdef CONFIG_DEBUG_FS enum amdgpu_dm_pipe_crc_source crc_src;#ifdef CONFIG_DRM_AMD_SECURE_DISPLAY -struct crc_window_param window_param; +struct crc_window_param window_param[MAX_CRC_WINDOW_NUM ]; +/* At least one CRC window is activated or not*/ +bool crc_window_activated;#endif #endif };
Signature · 1 line
2.34.1
PATCH 10/28 drm/amd/display: correct type mismatches in comparisons in DML2
In reply to [email protected]From: Natanel Roizenman <[email protected]>
[Why]
Comparisons were made between unsigned char and unsigned int.
[How]
Corrected by changing variable types.
--- .../dml2/dml21/src/dml2_dpmm/dml2_dpmm_dcn4.c | 12 ++++---- .../dml2/dml21/src/dml2_pmo/dml2_pmo_dcn3.c | 6 ++-- .../dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c | 30 +++++++++---------- 3 files changed, 24 insertions(+), 24 deletions(-)
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_dpmm/dml2_dpmm_dcn4.c +6 -6
@@ -417,11 +417,11 @@ static bool map_min_clocks_to_dpm(const struct dml2_core_mode_support_result *mostatic bool are_timings_trivially_synchronizable (struct dml2_display_cfg *display_config,int mask) { -unsigned char i; +unsigned int i;bool identical = true;bool contains_drr = false; -unsigned char remap_array[DML2_MAX_PLANES ]; -unsigned char remap_array_size =0 ; +unsigned int remap_array[DML2_MAX_PLANES ]; +unsigned int remap_array_size =0 ;// Create a remap array to enable simple iteration through only masked stream indicies for (i =0 ; i < display_config->num_streams; i++) {
@@ -456,10 +456,10 @@ static bool are_timings_trivially_synchronizable(struct dml2_display_cfg *displastatic int find_smallest_idle_time_in_vblank_us (struct dml2_dpmm_map_mode_to_soc_dpm_params_in_out *in_out,int mask) { -unsigned char i; +unsigned int i;int min_idle_us =0 ; -unsigned char remap_array[DML2_MAX_PLANES ]; -unsigned char remap_array_size =0 ; +unsigned int remap_array[DML2_MAX_PLANES ]; +unsigned int remap_array_size =0 ;const struct dml2_core_mode_support_result *mode_support_result = &in_out->display_cfg->mode_support_result;// Create a remap array to enable simple iteration through only masked stream indicies
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_dcn3.c +3 -3
@@ -195,11 +195,11 @@ static int count_planes_with_stream_index(const struct dml2_display_cfg *displaystatic bool are_timings_trivially_synchronizable (struct display_configuation_with_meta *display_config,int mask) { -unsigned char i; +unsigned int i;bool identical = true;bool contains_drr = false; -unsigned char remap_array[DML2_MAX_PLANES ]; -unsigned char remap_array_size =0 ; +unsigned int remap_array[DML2_MAX_PLANES ]; +unsigned int remap_array_size =0 ;// Create a remap array to enable simple iteration through only masked stream indicies for (i =0 ; i < display_config->display_config.num_streams; i++) {
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c +15 -15
@@ -986,7 +986,7 @@ static bool all_timings_support_vactive(const struct dml2_pmo_instance *pmo,const struct display_configuation_with_meta *display_config, unsigned int mask) { - unsigned char i; + unsigned int i;bool valid = true;// Create a remap array to enable simple iteration through only masked stream indicies
@@ -1035,7 +1035,7 @@ static bool all_timings_support_drr(const struct dml2_pmo_instance *pmo,const struct display_configuation_with_meta *display_config, unsigned int mask) { - unsigned char i; + unsigned int i;for (i =0 ; i <DML2_MAX_PLANES ; i++) {const struct dml2_stream_parameters *stream_descriptor;const struct dml2_fams2_meta *stream_fams2_meta;
@@ -1077,7 +1077,7 @@ static bool all_timings_support_svp(const struct dml2_pmo_instance *pmo,const struct dml2_plane_parameters *plane_descriptor;const struct dml2_fams2_meta *stream_fams2_meta;unsigned int microschedule_vlines; -unsigned char i; +unsigned int i;unsigned int num_planes_per_stream[DML2_MAX_PLANES ] = {0 };
@@ -1194,7 +1194,7 @@ static enum dml2_uclk_pstate_change_strategy pstate_method_to_uclk_pstate_stratestatic bool all_planes_match_method (const struct display_configuation_with_meta *display_cfg,int plane_mask,enum dml2_pstate_method method) { -unsigned char i; +unsigned int i;for (i =0 ; i <DML2_MAX_PLANES ; i++) {if (is_bit_set_in_bitfield (plane_mask, i)) {
@@ -1545,7 +1545,7 @@ static bool validate_pstate_support_strategy_cofunctionality(struct dml2_pmo_ins {struct dml2_pmo_scratch *s = &pmo->scratch; -unsigned char stream_index =0 ; +unsigned int stream_index =0 ;unsigned int svp_count =0 ;unsigned int svp_stream_mask =0 ;
@@ -1609,7 +1609,7 @@ static bool validate_pstate_support_strategy_cofunctionality(struct dml2_pmo_insstatic int get_vactive_pstate_margin (const struct display_configuation_with_meta *display_cfg,int plane_mask) { -unsigned char i; +unsigned int i;int min_vactive_margin_us =0xFFFFFFF ;for (i =0 ; i <DML2_MAX_PLANES ; i++) {
@@ -1817,7 +1817,7 @@ bool pmo_dcn4_fams2_init_for_pstate_support(struct dml2_pmo_init_for_pstate_suppconst struct dml2_pmo_pstate_strategy *strategy_list =NULL ;struct dml2_pmo_pstate_strategy override_base_strategy = {0 };unsigned int strategy_list_size =0 ; -unsigned char plane_index, stream_index, i; +unsigned int plane_index, stream_index, i;bool build_override_strategy = true; state->performed = true;
@@ -1940,7 +1940,7 @@ static void setup_planes_for_drr_by_mask(struct display_configuation_with_meta * struct dml2_pmo_instance *pmo, int plane_mask) { -unsigned char plane_index; +unsigned int plane_index;struct dml2_plane_parameters *plane;for (plane_index =0 ; plane_index < display_config->display_config.num_planes; plane_index++) {
@@ -1961,7 +1961,7 @@ static void setup_planes_for_svp_by_mask(struct display_configuation_with_meta * {struct dml2_pmo_scratch *scratch = &pmo->scratch; -unsigned char plane_index; +unsigned int plane_index;int stream_index =-1 ;for (plane_index =0 ; plane_index < display_config->display_config.num_planes; plane_index++) {
@@ -1984,7 +1984,7 @@ static void setup_planes_for_svp_drr_by_mask(struct display_configuation_with_me {struct dml2_pmo_scratch *scratch = &pmo->scratch; -unsigned char plane_index; +unsigned int plane_index;int stream_index =-1 ;for (plane_index =0 ; plane_index < display_config->display_config.num_planes; plane_index++) {
@@ -2005,7 +2005,7 @@ static void setup_planes_for_vblank_by_mask(struct display_configuation_with_met struct dml2_pmo_instance *pmo, int plane_mask) { -unsigned char plane_index; +unsigned int plane_index;struct dml2_plane_parameters *plane;for (plane_index =0 ; plane_index < display_config->display_config.num_planes; plane_index++) {
@@ -2025,7 +2025,7 @@ static void setup_planes_for_vblank_drr_by_mask(struct display_configuation_with struct dml2_pmo_instance *pmo, int plane_mask) { -unsigned char plane_index; +unsigned int plane_index;struct dml2_plane_parameters *plane;for (plane_index =0 ; plane_index < display_config->display_config.num_planes; plane_index++) {
@@ -2042,7 +2042,7 @@ static void setup_planes_for_vactive_by_mask(struct display_configuation_with_me struct dml2_pmo_instance *pmo, int plane_mask) { -unsigned char plane_index; +unsigned int plane_index;unsigned int stream_index;for (plane_index =0 ; plane_index < display_config->display_config.num_planes; plane_index++) {
@@ -2063,7 +2063,7 @@ static void setup_planes_for_vactive_drr_by_mask(struct display_configuation_wit struct dml2_pmo_instance *pmo, int plane_mask) { -unsigned char plane_index; +unsigned int plane_index;unsigned int stream_index;for (plane_index =0 ; plane_index < display_config->display_config.num_planes; plane_index++) {
@@ -2131,7 +2131,7 @@ static bool setup_display_config(struct display_configuation_with_meta *display_static int get_minimum_reserved_time_us_for_planes (struct display_configuation_with_meta *display_config,int plane_mask) {int min_time_us =0xFFFFFF ; -unsigned char plane_index =0 ; +unsigned int plane_index =0 ;for (plane_index =0 ; plane_index < display_config->display_config.num_planes; plane_index++) {if (is_bit_set_in_bitfield (plane_mask, plane_index)) {
Signature · 1 line
2.34.1
PATCH 11/28 drm/amd/display: Add guards around MAX/MIN
In reply to [email protected]From: Aurabindo Pillai <[email protected]>
MAX/MIN macros maybe defined already, hence add a guard around them to prevent errors that complain about redefinition like:
drivers/gpu/drm/amd/amdgpu/../dal-dev/modules/hdcp/hdcp_ddc.c:31: error: "MIN" redefined [-Werror]
31 | #define MIN(a, b) ((a) < (b) ? (a) : (b))
|
In file included from ./include/linux/kernel.h:28,
from ./include/linux/cpumask.h:11,
from ./include/linux/smp.h:13,
from ./include/linux/lockdep.h:14,
from ./include/linux/spinlock.h:63,
from ./include/linux/mmzone.h:8,
from ./include/linux/gfp.h:7,
from ./include/linux/slab.h:16,
from drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:37,
from drivers/gpu/drm/amd/amdgpu/../display/modules/inc/mod_hdcp.h:29,
from drivers/gpu/drm/amd/amdgpu/../display/modules/hdcp/hdcp.h:29,
from drivers/gpu/drm/amd/amdgpu/../display/modules/hdcp/hdcp_ddc.c:29:
./include/linux/minmax.h:329: note: this is the location of the previous definition
329 | #define MIN(a,b) __cmp(min,a,b)
|cc1: all warnings being treated as errors
--- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +2 -0
@@ -37,6 +37,8 @@#define DC_LOGGER dc->ctx->logger#ifndef MIN #define MIN (X ,Y ) ((X) < (Y) ? (X) : (Y)) +#endif +#ifndef MAX #define MAX (x, y) ((x > y) ? x : y)#endif
Signature · 1 line
2.34.1
PATCH 12/28 drm/amd/display: Add Interface to Dump DSC Caps from dm
In reply to [email protected]From: Fangzhi Zuo <[email protected]>
No common dsc params found between encoder and decoder is one of the reason that could prevent dsc from properly enabled.
Dump the params to a specific timing to help locate possible invalid dsc params in either encoder or decoder side.
--- drivers/gpu/drm/amd/display/dc/dc_dsc.h | 5 +++ drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 45 +++++++++++++++++++++ 2 files changed, 50 insertions(+)
drivers/gpu/drm/amd/display/dc/dc_dsc.h +5 -0
@@ -94,6 +94,11 @@ uint32_t dc_dsc_stream_bandwidth_overhead_in_kbps(const int num_slices_h, const bool is_dp); +void dc_dsc_dump_decoder_caps (const struct display_stream_compressor *dsc, +const struct dsc_dec_dpcd_caps *dsc_sink_caps); +void dc_dsc_dump_encoder_caps (const struct display_stream_compressor *dsc, +const struct dc_crtc_timing *timing); +/* TODO - Hardware/specs limitation should be owned by dc dsc and returned to DM, * and DM can choose to OVERRIDE the limitation on CASE BY CASE basis. * Hardware/specs limitation should not be writable by DM.
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c +45 -0
57 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH 13/28 drm/amd/display: Implement Replay Low Hz Visual Confirm
In reply to [email protected]From: "Dennis.Chan" <[email protected]>
[why]
Add new Visual confirm color for Replay Low Hz.
--- drivers/gpu/drm/amd/display/dc/dc_types.h | 11 ++-- .../dc/link/protocols/link_dp_irq_handler.c | 2 + .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 64 ++++++++++++++++++- 3 files changed, 72 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_types.h +7 -4
@@ -1067,10 +1067,13 @@ enum replay_FW_Message_type {union replay_error_status {struct { -unsigned char STATE_TRANSITION_ERROR :1 ; -unsigned char LINK_CRC_ERROR :1 ; -unsigned char DESYNC_ERROR :1 ; -unsigned char RESERVED :5 ; +unsigned int STATE_TRANSITION_ERROR :1 ; +unsigned int LINK_CRC_ERROR :1 ; +unsigned int DESYNC_ERROR :1 ; +unsigned int RESERVED_3 :1 ; +unsigned int LOW_RR_INCORRECT_VTOTAL :1 ; +unsigned int NO_DOUBLED_RR :1 ; +unsigned int RESERVED_6_7 :2 ; } bits;unsigned char raw; };
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_irq_handler.c +2 -0
@@ -226,6 +226,8 @@ static void handle_hpd_irq_replay_sink(struct dc_link *link) replay_configuration.bits.STATE_TRANSITION_ERROR_STATUS) {bool allow_active; + link->replay_settings.config.replay_error_status.raw |= replay_error_status.raw; +if (link->replay_settings.config.force_disable_desync_error_check)return ;
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +63 -1
76 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH 14/28 drm/amd/display: have pretrain for dpia
In reply to [email protected]From: Peichen Huang <[email protected]>
[WHY]
We like to have pretrain for dpia link so that dp and dp tunneling have aligned behavior. The Main difficult for dpia pretrain is that encoder can not get corresponded dpia port when link detection in current implementation.
[HOW]
1. create enable/disable dpia output functions for dcn35 encoder and have dpia_id and other necessary info as inputs.
2. dcn35 dpia use the new functions to enable/disable output.
3. have a option to enable/disable the change.
--- drivers/gpu/drm/amd/display/dc/dc.h | 4 +- .../dc/dio/dcn35/dcn35_dio_link_encoder.c | 80 +++++++++++++++++++ .../dc/dio/dcn35/dcn35_dio_link_encoder.h | 18 +++++ .../drm/amd/display/dc/inc/hw/link_encoder.h | 8 ++ .../amd/display/dc/link/hwss/link_hwss_dio.c | 4 +- .../amd/display/dc/link/hwss/link_hwss_dpia.c | 61 +++++++++++++- .../amd/display/dc/link/hwss/link_hwss_dpia.h | 3 + .../drm/amd/display/dc/link/link_detection.c | 3 +- .../gpu/drm/amd/display/dc/link/link_dpms.c | 3 +- .../dc/link/protocols/link_dp_irq_handler.c | 3 +- 10 files changed, 180 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +3 -1
@@ -472,6 +472,7 @@ struct dc_config {bool disable_hbr_audio_dp2;bool consolidated_dpia_dp_lt;bool set_pipe_unlock_order; +bool enable_dpia_pre_training; };enum visual_confirm {
@@ -775,7 +776,8 @@ union dpia_debug_options { uint32_t enable_force_tbt3_work_around:1; /* bit 4 */ uint32_t disable_usb4_pm_support:1; /* bit 5 */ uint32_t enable_consolidated_dpia_dp_lt:1; /* bit 6 */ - uint32_t reserved:25; + uint32_t enable_dpia_pre_training:1; /* bit 7 */ + uint32_t reserved:24; } bits;uint32_t raw; };
drivers/gpu/drm/amd/display/dc/dio/dcn35/dcn35_dio_link_encoder.c +80 -0
95 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dio/dcn35/dcn35_dio_link_encoder.h +18 -0
@@ -144,4 +144,22 @@ bool dcn35_is_dig_enabled(struct link_encoder *enc);enum signal_type dcn35_get_dig_mode (struct link_encoder *enc);void dcn35_link_encoder_setup (struct link_encoder *enc,enum signal_type signal); +/* +* Enable DP transmitter and its encoder for dpia port. +*/ +void dcn35_link_encoder_enable_dpia_output ( +struct link_encoder *enc, +const struct dc_link_settings *link_settings, +uint8_t dpia_id, +uint8_t digmode, +uint8_t fec_rdy); + +/* +* Disable transmitter and its encoder for dpia port. +*/ +void dcn35_link_encoder_disable_dpia_output ( +struct link_encoder *enc, +uint8_t dpia_id, +uint8_t digmode); +#endif /* __DC_LINK_ENCODER__DCN35_H__ */
drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h +8 -0
@@ -168,6 +168,14 @@ struct link_encoder_funcs {struct link_encoder *enc, enum encoder_type_select sel, uint32_t hpo_inst); +void (*enable_dpia_output)(struct link_encoder *enc, +const struct dc_link_settings *link_settings, +uint8_t dpia_id, +uint8_t digmode, +uint8_t fec_rdy); +void (*disable_dpia_output)(struct link_encoder *link_enc, +uint8_t dpia_id, +uint8_t digmode); };/*
drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dio.c +3 -1
@@ -164,7 +164,9 @@ void disable_dio_link_output(struct dc_link *link, {struct link_encoder *link_enc =link_enc_cfg_get_link_enc (link); - link_enc->funcs->disable_output (link_enc, signal); +if (link_enc !=NULL ) + link_enc->funcs->disable_output (link_enc, signal); + link->dc->link_srv->dp_trace_source_sequence (link,DPCD_SOURCE_SEQ_AFTER_DISABLE_LINK_PHY ); }
drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dpia.c +59 -2
76 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dpia.h +3 -0
@@ -27,6 +27,9 @@#include "link_hwss.h" +#define DIG_SST_MODE 0 +#define DIG_MST_MODE 5 +const struct link_hwss *get_dpia_link_hwss (void );bool can_use_dpia_link_hwss (const struct dc_link *link,const struct link_resource *link_res);
drivers/gpu/drm/amd/display/dc/link/link_detection.c +2 -1
@@ -829,7 +829,8 @@ static bool should_verify_link_capability_destructively(struct dc_link *link,if (link->dc->debug.skip_detection_link_training ||dc_is_embedded_signal (link->local_sink->sink_signal) || - link->ep_type ==DISPLAY_ENDPOINT_USB4_DPIA ) { + (link->ep_type ==DISPLAY_ENDPOINT_USB4_DPIA && + !link->dc->config.enable_dpia_pre_training)) { destrictive = false; }else if (link_dp_get_encoding_format (&max_link_cap) == DP_8b_10b_ENCODING) {
drivers/gpu/drm/amd/display/dc/link/link_dpms.c +2 -1
@@ -2043,7 +2043,8 @@ static enum dc_status enable_link_dp(struct dc_state *state,/* Train with fallback when enabling DPIA link. Conventional links are * trained with fallback during sink detection. */ -if (link->ep_type ==DISPLAY_ENDPOINT_USB4_DPIA ) +if (link->ep_type ==DISPLAY_ENDPOINT_USB4_DPIA && + !link->dc->config.enable_dpia_pre_training) do_fallback = true;/*
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_irq_handler.c +2 -1
@@ -410,7 +410,8 @@ bool dp_handle_hpd_rx_irq(struct dc_link *link,if (hpd_irq_dpcd_data.bytes.device_service_irq.bits.AUTOMATED_TEST) {// Workaround for DP 1.4a LL Compliance CTS as USB4 has to share encoders unlike DP and USBC -if (link->ep_type ==DISPLAY_ENDPOINT_USB4_DPIA ) +if (link->ep_type ==DISPLAY_ENDPOINT_USB4_DPIA && + !link->dc->config.enable_dpia_pre_training) link->skip_fallback_on_link_loss = true; device_service_clear.bits.AUTOMATED_TEST =1 ;
Signature · 1 line
2.34.1
PATCH 15/28 drm/amd/display: modify init dc_power_state
In reply to [email protected]From: Brandon Syu <[email protected]>
[why]
initialize the power state for dc use,
but dc_set_power_state it not called at D3.
It would cause can't recognize last power state
[how]
remove initialize the power state for dc use, it is not necessary.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -4
@@ -5379,13 +5379,9 @@ void dc_set_power_state(struct dc *dc, enum dc_acpi_cm_power_state power_state) dc->vm_pa_config.valid) { dc->hwss.init_sys_ctx (dc->hwseq, dc, &dc->vm_pa_config); } -/*mark d0 last*/ - dc->power_state = power_state;break ;default :ASSERT (dc->current_state->stream_count ==0 ); -/*mark d3 first*/ - dc->power_state = power_state;dc_dmub_srv_notify_fw_dc_power_state (dc->ctx->dmub_srv, power_state);dc_state_destruct (dc->current_state);
Signature · 1 line
2.34.1
PATCH 16/28 drm/amd/display: Update dc_tiling_info union to structure
In reply to [email protected]From: Karthi Kandasamy <[email protected]>
[WHY]
The dc_tiling_info union previously did not have a field to specify the active GFX format, assuming only one format would be used per DCN version. from DCN4+, support for switching between different GFX formats is introduced, requiring a way to track which format is currently in use.
[HOW]
Updated the dc_tiling_info union to include a new field that explicitly indicates the currently used GFX format. This allows the system to determine the active GFX format and take the correct programming path accordingly.
[Description]
The union dc_tiling_info has been updated to support multiple GFX formats by adding a new field for identifying the active format. This update ensures that the correct programming path is followed based on the selected format. All references to dc_tiling_info in the codebase have been updated to reflect the new structure.
--- .../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 14 +- .../amd/display/amdgpu_dm/amdgpu_dm_plane.h | 2 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 2 +- drivers/gpu/drm/amd/display/dc/dc.h | 4 +- drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 176 ++++++++++-------- .../drm/amd/display/dc/dce/dce_mem_input.c | 10 +- .../display/dc/dce110/dce110_mem_input_v.c | 8 +- .../amd/display/dc/hubp/dcn10/dcn10_hubp.c | 4 +- .../amd/display/dc/hubp/dcn10/dcn10_hubp.h | 4 +- .../amd/display/dc/hubp/dcn20/dcn20_hubp.c | 4 +- .../amd/display/dc/hubp/dcn20/dcn20_hubp.h | 2 +- .../amd/display/dc/hubp/dcn201/dcn201_hubp.c | 2 +- .../amd/display/dc/hubp/dcn30/dcn30_hubp.c | 4 +- .../amd/display/dc/hubp/dcn30/dcn30_hubp.h | 4 +- .../amd/display/dc/hubp/dcn35/dcn35_hubp.c | 2 +- .../amd/display/dc/hubp/dcn35/dcn35_hubp.h | 2 +- .../amd/display/dc/hubp/dcn401/dcn401_hubp.c | 4 +- .../amd/display/dc/hubp/dcn401/dcn401_hubp.h | 4 +- drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h | 4 +- .../gpu/drm/amd/display/dc/inc/hw/mem_input.h | 4 +- 20 files changed, 136 insertions(+), 124 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +7 -7
@@ -177,7 +177,7 @@ static unsigned int amdgpu_dm_plane_modifier_gfx9_swizzle_mode(uint64_t modifierreturn AMD_FMT_MOD_GET (TILE , modifier); } -static void amdgpu_dm_plane_fill_gfx8_tiling_info_from_flags (union dc_tiling_info *tiling_info, +static void amdgpu_dm_plane_fill_gfx8_tiling_info_from_flags (struct dc_tiling_info *tiling_info,uint64_t tiling_flags) {/* Fill GFX8 params */
@@ -210,7 +210,7 @@ static void amdgpu_dm_plane_fill_gfx8_tiling_info_from_flags(union dc_tiling_inf }static void amdgpu_dm_plane_fill_gfx9_tiling_info_from_device (const struct amdgpu_device *adev, -union dc_tiling_info *tiling_info) +struct dc_tiling_info *tiling_info) {/* Fill GFX9 params */ tiling_info->gfx9.num_pipes =
@@ -231,7 +231,7 @@ static void amdgpu_dm_plane_fill_gfx9_tiling_info_from_device(const struct amdgp }static void amdgpu_dm_plane_fill_gfx9_tiling_info_from_modifier (const struct amdgpu_device *adev, -union dc_tiling_info *tiling_info, +struct dc_tiling_info *tiling_info,uint64_t modifier) {unsigned int mod_bank_xor_bits =AMD_FMT_MOD_GET (BANK_XOR_BITS , modifier);
@@ -261,7 +261,7 @@ static void amdgpu_dm_plane_fill_gfx9_tiling_info_from_modifier(const struct amdstatic int amdgpu_dm_plane_validate_dcc (struct amdgpu_device *adev,const enum surface_pixel_format format,const enum dc_rotation_angle rotation, -const union dc_tiling_info *tiling_info, +const struct dc_tiling_info *tiling_info,const struct dc_plane_dcc_param *dcc,const struct dc_plane_address *address,const struct plane_size *plane_size)
@@ -308,7 +308,7 @@ static int amdgpu_dm_plane_fill_gfx9_plane_attributes_from_modifiers(struct amdgconst enum surface_pixel_format format, const enum dc_rotation_angle rotation, const struct plane_size *plane_size, - union dc_tiling_info *tiling_info, + struct dc_tiling_info *tiling_info, struct dc_plane_dcc_param *dcc, struct dc_plane_address *address) {
@@ -358,7 +358,7 @@ static int amdgpu_dm_plane_fill_gfx12_plane_attributes_from_modifiers(struct amdconst enum surface_pixel_format format, const enum dc_rotation_angle rotation, const struct plane_size *plane_size, - union dc_tiling_info *tiling_info, + struct dc_tiling_info *tiling_info, struct dc_plane_dcc_param *dcc, struct dc_plane_address *address) {
@@ -834,7 +834,7 @@ int amdgpu_dm_plane_fill_plane_buffer_attributes(struct amdgpu_device *adev,const enum surface_pixel_format format, const enum dc_rotation_angle rotation, const uint64_t tiling_flags, - union dc_tiling_info *tiling_info, + struct dc_tiling_info *tiling_info, struct plane_size *plane_size, struct dc_plane_dcc_param *dcc, struct dc_plane_address *address,
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.h +1 -1
@@ -47,7 +47,7 @@ int amdgpu_dm_plane_fill_plane_buffer_attributes(struct amdgpu_device *adev,const enum surface_pixel_format format, const enum dc_rotation_angle rotation, const uint64_t tiling_flags, - union dc_tiling_info *tiling_info, + struct dc_tiling_info *tiling_info, struct plane_size *plane_size, struct dc_plane_dcc_param *dcc, struct dc_plane_address *address,
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -1
@@ -2555,7 +2555,7 @@ static enum surface_update_type get_plane_info_update_type(const struct dc *dc,if (memcmp (&u->plane_info->tiling_info, &u->surface->tiling_info, -sizeof (union dc_tiling_info )) !=0 ) { +sizeof (struct dc_tiling_info )) !=0 ) { update_flags->bits.swizzle_change =1 ;elevate_update_type (&update_type,UPDATE_TYPE_MED );
drivers/gpu/drm/amd/display/dc/dc.h +2 -2
@@ -1306,7 +1306,7 @@ struct dc_plane_state {struct rect clip_rect;struct plane_size plane_size; -union dc_tiling_info tiling_info; +struct dc_tiling_info tiling_info;struct dc_plane_dcc_param dcc;
@@ -1377,7 +1377,7 @@ struct dc_plane_state {struct dc_plane_info {struct plane_size plane_size; -union dc_tiling_info tiling_info; +struct dc_tiling_info tiling_info;struct dc_plane_dcc_param dcc;enum surface_pixel_format format;enum dc_rotation_angle rotation;
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +94 -82
183 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c +5 -5
@@ -98,7 +98,7 @@ static enum mi_bits_per_pixel get_mi_bpp( }static enum mi_tiling_format get_mi_tiling ( -union dc_tiling_info *tiling_info) +struct dc_tiling_info *tiling_info) {switch (tiling_info->gfx8.array_mode) {case DC_ARRAY_1D_TILED_THIN1 :
@@ -133,7 +133,7 @@ static bool is_vert_scan(enum dc_rotation_angle rotation)static void dce_mi_program_pte_vm (struct mem_input *mi,enum surface_pixel_format format, -union dc_tiling_info *tiling_info, +struct dc_tiling_info *tiling_info,enum dc_rotation_angle rotation) {struct dce_mem_input *dce_mi =TO_DCE_MEM_INPUT (mi);
@@ -430,7 +430,7 @@ static void dce120_mi_program_display_marks(struct mem_input *mi, }static void program_tiling ( -struct dce_mem_input *dce_mi,const union dc_tiling_info *info) +struct dce_mem_input *dce_mi,const struct dc_tiling_info *info) {if (dce_mi->masks->GRPH_SW_MODE) {/* GFX9 */ REG_UPDATE_6(GRPH_CONTROL,
@@ -650,7 +650,7 @@ static void dce_mi_clear_tiling( static void dce_mi_program_surface_config( struct mem_input *mi, enum surface_pixel_format format, - union dc_tiling_info *tiling_info, + struct dc_tiling_info *tiling_info, struct plane_size *plane_size, enum dc_rotation_angle rotation, struct dc_plane_dcc_param *dcc,
@@ -670,7 +670,7 @@ static void dce_mi_program_surface_config( static void dce60_mi_program_surface_config( struct mem_input *mi, enum surface_pixel_format format, - union dc_tiling_info *tiling_info, + struct dc_tiling_info *tiling_info, struct plane_size *plane_size, enum dc_rotation_angle rotation, /* not used in DCE6 */ struct dc_plane_dcc_param *dcc,
drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c +4 -4
@@ -162,7 +162,7 @@ static void enable(struct dce_mem_input *mem_input110)static void program_tiling (struct dce_mem_input *mem_input110, -const union dc_tiling_info *info, +const struct dc_tiling_info *info,const enum surface_pixel_format pixel_format) {uint32_t value =0 ;
@@ -523,7 +523,7 @@ static const unsigned int dvmm_Hw_Setting_Linear[4][9] = {/* Helper to get table entry from surface info */ static const unsigned int *get_dvmm_hw_setting ( -union dc_tiling_info *tiling_info, +struct dc_tiling_info *tiling_info,enum surface_pixel_format format,bool chroma) {
@@ -563,7 +563,7 @@ static const unsigned int *get_dvmm_hw_setting(static void dce_mem_input_v_program_pte_vm (struct mem_input *mem_input,enum surface_pixel_format format, -union dc_tiling_info *tiling_info, +struct dc_tiling_info *tiling_info,enum dc_rotation_angle rotation) {struct dce_mem_input *mem_input110 =TO_DCE_MEM_INPUT (mem_input);
@@ -636,7 +636,7 @@ static void dce_mem_input_v_program_pte_vm( static void dce_mem_input_v_program_surface_config( struct mem_input *mem_input, enum surface_pixel_format format, - union dc_tiling_info *tiling_info, + struct dc_tiling_info *tiling_info, struct plane_size *plane_size, enum dc_rotation_angle rotation, struct dc_plane_dcc_param *dcc,
drivers/gpu/drm/amd/display/dc/hubp/dcn10/dcn10_hubp.c +2 -2
@@ -140,7 +140,7 @@ void hubp1_vready_workaround(struct hubp *hubp,void hubp1_program_tiling (struct hubp *hubp, -const union dc_tiling_info *info, +const struct dc_tiling_info *info,const enum surface_pixel_format pixel_format) {struct dcn10_hubp *hubp1 =TO_DCN10_HUBP (hubp);
@@ -549,7 +549,7 @@ void hubp1_dcc_control(struct hubp *hubp, bool enable, void hubp1_program_surface_config( struct hubp *hubp, enum surface_pixel_format format, - union dc_tiling_info *tiling_info, + struct dc_tiling_info *tiling_info, struct plane_size *plane_size, enum dc_rotation_angle rotation, struct dc_plane_dcc_param *dcc,
drivers/gpu/drm/amd/display/dc/hubp/dcn10/dcn10_hubp.h +2 -2
@@ -706,7 +706,7 @@ struct dcn10_hubp { void hubp1_program_surface_config( struct hubp *hubp, enum surface_pixel_format format, - union dc_tiling_info *tiling_info, + struct dc_tiling_info *tiling_info, struct plane_size *plane_size, enum dc_rotation_angle rotation, struct dc_plane_dcc_param *dcc,
@@ -739,7 +739,7 @@ void hubp1_program_rotation(void hubp1_program_tiling (struct hubp *hubp, -const union dc_tiling_info *info, +const struct dc_tiling_info *info,const enum surface_pixel_format pixel_format); void hubp1_dcc_control(struct hubp *hubp,
drivers/gpu/drm/amd/display/dc/hubp/dcn20/dcn20_hubp.c +2 -2
@@ -310,7 +310,7 @@ void hubp2_setup_interdependent(*/ static void hubp2_program_tiling (struct dcn20_hubp *hubp2, -const union dc_tiling_info *info, +const struct dc_tiling_info *info,const enum surface_pixel_format pixel_format) { REG_UPDATE_3(DCSURF_ADDR_CONFIG,
@@ -550,7 +550,7 @@ void hubp2_program_pixel_format( void hubp2_program_surface_config( struct hubp *hubp, enum surface_pixel_format format, - union dc_tiling_info *tiling_info, + struct dc_tiling_info *tiling_info, struct plane_size *plane_size, enum dc_rotation_angle rotation, struct dc_plane_dcc_param *dcc,
drivers/gpu/drm/amd/display/dc/hubp/dcn20/dcn20_hubp.h +1 -1
@@ -382,7 +382,7 @@ void hubp2_program_pixel_format( void hubp2_program_surface_config( struct hubp *hubp, enum surface_pixel_format format, - union dc_tiling_info *tiling_info, + struct dc_tiling_info *tiling_info, struct plane_size *plane_size, enum dc_rotation_angle rotation, struct dc_plane_dcc_param *dcc,
drivers/gpu/drm/amd/display/dc/hubp/dcn201/dcn201_hubp.c +1 -1
@@ -42,7 +42,7 @@ static void hubp201_program_surface_config( struct hubp *hubp, enum surface_pixel_format format, - union dc_tiling_info *tiling_info, + struct dc_tiling_info *tiling_info, struct plane_size *plane_size, enum dc_rotation_angle rotation, struct dc_plane_dcc_param *dcc,
drivers/gpu/drm/amd/display/dc/hubp/dcn30/dcn30_hubp.c +2 -2
@@ -318,7 +318,7 @@ bool hubp3_program_surface_flip_and_addr(void hubp3_program_tiling (struct dcn20_hubp *hubp2, -const union dc_tiling_info *info, +const struct dc_tiling_info *info,const enum surface_pixel_format pixel_format) { REG_UPDATE_4(DCSURF_ADDR_CONFIG,
@@ -411,7 +411,7 @@ void hubp3_dmdata_set_attributes( void hubp3_program_surface_config( struct hubp *hubp, enum surface_pixel_format format, - union dc_tiling_info *tiling_info, + struct dc_tiling_info *tiling_info, struct plane_size *plane_size, enum dc_rotation_angle rotation, struct dc_plane_dcc_param *dcc,
drivers/gpu/drm/amd/display/dc/hubp/dcn30/dcn30_hubp.h +2 -2
@@ -264,7 +264,7 @@ bool hubp3_program_surface_flip_and_addr( void hubp3_program_surface_config( struct hubp *hubp, enum surface_pixel_format format, - union dc_tiling_info *tiling_info, + struct dc_tiling_info *tiling_info, struct plane_size *plane_size, enum dc_rotation_angle rotation, struct dc_plane_dcc_param *dcc,
@@ -280,7 +280,7 @@ void hubp3_setup(void hubp3_program_tiling (struct dcn20_hubp *hubp2, -const union dc_tiling_info *info, +const struct dc_tiling_info *info,const enum surface_pixel_format pixel_format); void hubp3_dcc_control(struct hubp *hubp, bool enable,
drivers/gpu/drm/amd/display/dc/hubp/dcn35/dcn35_hubp.c +1 -1
@@ -172,7 +172,7 @@ void hubp35_program_pixel_format( void hubp35_program_surface_config( struct hubp *hubp, enum surface_pixel_format format, - union dc_tiling_info *tiling_info, + struct dc_tiling_info *tiling_info, struct plane_size *plane_size, enum dc_rotation_angle rotation, struct dc_plane_dcc_param *dcc,
drivers/gpu/drm/amd/display/dc/hubp/dcn35/dcn35_hubp.h +1 -1
@@ -65,7 +65,7 @@ void hubp35_program_pixel_format( void hubp35_program_surface_config( struct hubp *hubp, enum surface_pixel_format format, - union dc_tiling_info *tiling_info, + struct dc_tiling_info *tiling_info, struct plane_size *plane_size, enum dc_rotation_angle rotation, struct dc_plane_dcc_param *dcc,
drivers/gpu/drm/amd/display/dc/hubp/dcn401/dcn401_hubp.c +2 -2
@@ -532,7 +532,7 @@ void hubp401_dcc_control(struct hubp *hubp,void hubp401_program_tiling (struct dcn20_hubp *hubp2, -const union dc_tiling_info *info, +const struct dc_tiling_info *info,const enum surface_pixel_format pixel_format) {/* DCSURF_ADDR_CONFIG still shows up in reg spec, but does not need to be programmed for DCN4x
@@ -580,7 +580,7 @@ void hubp401_program_size( void hubp401_program_surface_config( struct hubp *hubp, enum surface_pixel_format format, - union dc_tiling_info *tiling_info, + struct dc_tiling_info *tiling_info, struct plane_size *plane_size, enum dc_rotation_angle rotation, struct dc_plane_dcc_param *dcc,
drivers/gpu/drm/amd/display/dc/hubp/dcn401/dcn401_hubp.h +2 -2
@@ -290,7 +290,7 @@ void hubp401_dcc_control(struct hubp *hubp,void hubp401_program_tiling (struct dcn20_hubp *hubp2, -const union dc_tiling_info *info, +const struct dc_tiling_info *info,const enum surface_pixel_format pixel_format); void hubp401_program_size(
@@ -302,7 +302,7 @@ void hubp401_program_size( void hubp401_program_surface_config( struct hubp *hubp, enum surface_pixel_format format, - union dc_tiling_info *tiling_info, + struct dc_tiling_info *tiling_info, struct plane_size *plane_size, enum dc_rotation_angle rotation, struct dc_plane_dcc_param *dcc,
drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h +2 -2
@@ -165,7 +165,7 @@ struct hubp_funcs {void (*hubp_program_pte_vm)(struct hubp *hubp,enum surface_pixel_format format, -union dc_tiling_info *tiling_info, +struct dc_tiling_info *tiling_info,enum dc_rotation_angle rotation); void (*hubp_set_vm_system_aperture_settings)(
@@ -179,7 +179,7 @@ struct hubp_funcs { void (*hubp_program_surface_config)( struct hubp *hubp, enum surface_pixel_format format, - union dc_tiling_info *tiling_info, + struct dc_tiling_info *tiling_info, struct plane_size *plane_size, enum dc_rotation_angle rotation, struct dc_plane_dcc_param *dcc,
drivers/gpu/drm/amd/display/dc/inc/hw/mem_input.h +2 -2
@@ -150,7 +150,7 @@ struct mem_input_funcs {void (*mem_input_program_pte_vm)(struct mem_input *mem_input,enum surface_pixel_format format, -union dc_tiling_info *tiling_info, +struct dc_tiling_info *tiling_info,enum dc_rotation_angle rotation); void (*mem_input_set_vm_system_aperture_settings)(
@@ -164,7 +164,7 @@ struct mem_input_funcs { void (*mem_input_program_surface_config)( struct mem_input *mem_input, enum surface_pixel_format format, - union dc_tiling_info *tiling_info, + struct dc_tiling_info *tiling_info, struct plane_size *plane_size, enum dc_rotation_angle rotation, struct dc_plane_dcc_param *dcc,
Signature · 1 line
2.34.1
PATCH 17/28 drm/amd/display: Ensure correct GFX tiling info passed to DML
In reply to [email protected]From: Karthi Kandasamy <[email protected]>
[Why]
To ensure DML validation receives the correct tiling information, such as swizzle mode or array mode, based on the active GFX format
[How]
- For new GFX format passed swizzle_mode to DML.
- For legacy GFX format passed array_mode to DML.
- Dynamically determined the appropriate tiling info based on the active GFX format.
[Description]
This commit ensures that the correct GFX tiling information is passed to DML. Depending on the active GFX format, the appropriate tiling info is passed to DML. This change accommodates the different GFX formats supported by latest platforms, ensuring compatibility and proper DML validation.
--- .../drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 3 +++ .../dc/dml2/dml21/dml21_translation_helper.c | 16 +++++++++++++--- .../display/dc/resource/dcn35/dcn35_resource.c | 9 ++++++++- .../display/dc/resource/dcn35/dcn35_resource.h | 1 + .../display/dc/resource/dcn351/dcn351_resource.c | 2 +- .../display/dc/resource/dcn401/dcn401_resource.c | 1 + 6 files changed, 27 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +3 -0
@@ -190,6 +190,7 @@ static void amdgpu_dm_plane_fill_gfx8_tiling_info_from_flags(struct dc_tiling_in tile_split =AMDGPU_TILING_GET (tiling_flags,TILE_SPLIT ); num_banks =AMDGPU_TILING_GET (tiling_flags,NUM_BANKS ); + tiling_info->gfxversion = DcGfxVersion8;/* XXX fix me for VI */ tiling_info->gfx8.num_banks = num_banks; tiling_info->gfx8.array_mode =
@@ -317,6 +318,7 @@ static int amdgpu_dm_plane_fill_gfx9_plane_attributes_from_modifiers(struct amdgamdgpu_dm_plane_fill_gfx9_tiling_info_from_modifier (adev, tiling_info, modifier); tiling_info->gfx9.swizzle =amdgpu_dm_plane_modifier_gfx9_swizzle_mode (modifier); + tiling_info->gfxversion = DcGfxVersion9;if (amdgpu_dm_plane_modifier_has_dcc (modifier)) {uint64_t dcc_address = afb->address + afb->base.offsets[1 ];
@@ -369,6 +371,7 @@ static int amdgpu_dm_plane_fill_gfx12_plane_attributes_from_modifiers(struct amdamdgpu_dm_plane_fill_gfx9_tiling_info_from_device (adev, tiling_info); tiling_info->gfx9.swizzle =amdgpu_dm_plane_modifier_gfx9_swizzle_mode (modifier); + tiling_info->gfxversion = DcGfxAddr3;if (amdgpu_dm_plane_modifier_has_dcc (modifier)) {int max_compressed_block =AMD_FMT_MOD_GET (DCC_MAX_COMPRESSED_BLOCK , modifier);
drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c +13 -3
@@ -721,11 +721,21 @@ static void populate_dml21_surface_config_from_plane_state( surface->dcc.informative.fraction_of_zero_size_request_plane1 = plane_state->dcc.independent_64b_blks_c; surface->dcc.plane0.pitch = plane_state->dcc.meta_pitch; surface->dcc.plane1.pitch = plane_state->dcc.meta_pitch_c; -if (in_dc->ctx->dce_version <DCN_VERSION_4_01 ) { -/* needed for N-1 testing */ + +// Update swizzle / array mode based on the gfx_format +switch (plane_state->tiling_info.gfxversion) { +case DcGfxVersion7: +case DcGfxVersion8: +// Placeholder for programming the array_mode +break ; +case DcGfxVersion9: +case DcGfxVersion10: +case DcGfxVersion11: surface->tiling =gfx9_to_dml2_swizzle_mode (plane_state->tiling_info.gfx9.swizzle); - }else { +break ; +case DcGfxAddr3: surface->tiling =gfx_addr3_to_dml2_swizzle_mode (plane_state->tiling_info.gfx_addr3.swizzle); +break ; } }
drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c +8 -1
@@ -1752,6 +1752,13 @@ static bool dcn35_validate_bandwidth(struct dc *dc,return out; } +enum dc_status dcn35_patch_unknown_plane_state (struct dc_plane_state *plane_state) +{ + plane_state->tiling_info.gfxversion = DcGfxVersion9; +dcn20_patch_unknown_plane_state (plane_state); +return DC_OK ; +} +static struct resource_funcs dcn35_res_pool_funcs = { .destroy = dcn35_destroy_resource_pool,
@@ -1775,7 +1782,7 @@ static struct resource_funcs dcn35_res_pool_funcs = { .acquire_post_bldn_3dlut = dcn30_acquire_post_bldn_3dlut, .release_post_bldn_3dlut = dcn30_release_post_bldn_3dlut, .update_bw_bounding_box = dcn35_update_bw_bounding_box_fpu, - .patch_unknown_plane_state = dcn20_patch_unknown_plane_state, + .patch_unknown_plane_state = dcn35_patch_unknown_plane_state, .get_panel_config_defaults = dcn35_get_panel_config_defaults, .get_preferred_eng_id_dpia = dcn35_get_preferred_eng_id_dpia, .get_det_buffer_size = dcn31_get_det_buffer_size,
drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.h +1 -0
@@ -35,6 +35,7 @@extern struct _vcs_dpi_ip_params_st dcn3_5_ip;extern struct _vcs_dpi_soc_bounding_box_st dcn3_5_soc; +enum dc_status dcn35_patch_unknown_plane_state (struct dc_plane_state *plane_state);struct dcn35_resource_pool {struct resource_pool base;
drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c +1 -1
@@ -1754,7 +1754,7 @@ static struct resource_funcs dcn351_res_pool_funcs = { .acquire_post_bldn_3dlut = dcn30_acquire_post_bldn_3dlut, .release_post_bldn_3dlut = dcn30_release_post_bldn_3dlut, .update_bw_bounding_box = dcn351_update_bw_bounding_box_fpu, - .patch_unknown_plane_state = dcn20_patch_unknown_plane_state, + .patch_unknown_plane_state = dcn35_patch_unknown_plane_state, .get_panel_config_defaults = dcn35_get_panel_config_defaults, .get_preferred_eng_id_dpia = dcn351_get_preferred_eng_id_dpia, .get_det_buffer_size = dcn31_get_det_buffer_size,
drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c +1 -0
@@ -1609,6 +1609,7 @@ static void dcn401_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *benum dc_status dcn401_patch_unknown_plane_state (struct dc_plane_state *plane_state) { + plane_state->tiling_info.gfxversion = DcGfxAddr3; plane_state->tiling_info.gfx_addr3.swizzle =DC_ADDR3_SW_64KB_2D ;return DC_OK ; }
Signature · 1 line
2.34.1
PATCH 18/28 drm/amd/display: fix init_adj offset for cositing in SPL
In reply to [email protected]From: Samson Tam <[email protected]>
[Why & How]init_adj offset is applied when cosited not interstitial Adjust cositing offset in SPL
--- .../amd/display/dc/resource/dcn401/dcn401_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/spl/dc_spl.c | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c +1 -1
@@ -737,7 +737,7 @@ static const struct dc_debug_options debug_defaults_drv = { .enable_stall_recovery = true, } }, - .force_cositing = CHROMA_COSITING_TOPLEFT + 1, + .force_cositing = CHROMA_COSITING_NONE + 1, }; static struct dce_aux *dcn401_aux_engine_create(
drivers/gpu/drm/amd/display/dc/spl/dc_spl.c +6 -5
@@ -633,20 +633,21 @@ static void spl_calculate_inits_and_viewports(struct spl_in *spl_in,switch (spl_in->basic_in.cositing) { -case CHROMA_COSITING_LEFT : - init_adj_h = spl_fixpt_zero; +case CHROMA_COSITING_TOPLEFT : + init_adj_h =spl_fixpt_from_fraction (sign,4 ); init_adj_v =spl_fixpt_from_fraction (sign,4 );break ; -case CHROMA_COSITING_NONE : +case CHROMA_COSITING_LEFT : init_adj_h =spl_fixpt_from_fraction (sign,4 ); - init_adj_v =spl_fixpt_from_fraction (sign,4 ); + init_adj_v = spl_fixpt_zero;break ; -case CHROMA_COSITING_TOPLEFT : +case CHROMA_COSITING_NONE :default : init_adj_h = spl_fixpt_zero; init_adj_v = spl_fixpt_zero;break ; } + } spl_calculate_init_and_vp(
Signature · 1 line
2.34.1
PATCH 19/28 drm/amd/display: Optimize cursor position updates
In reply to [email protected]From: Aric Cyr <[email protected]>
[why]
Updating the cursor enablement register can be a slow operation and accumulates when high polling rate cursors cause frequent updates asynchronously to the cursor position.
[how]
Since the cursor enable bit is cached there is no need to update the enablement register if there is no change to it. This removes the read-modify-write from the cursor position programming path in HUBP and DPP, leaving only the register writes.
--- drivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp.c | 7 ++++--- .../gpu/drm/amd/display/dc/dpp/dcn401/dcn401_dpp_cm.c | 6 ++++-- drivers/gpu/drm/amd/display/dc/hubp/dcn20/dcn20_hubp.c | 8 +++++--- .../gpu/drm/amd/display/dc/hubp/dcn401/dcn401_hubp.c | 10 ++++++---- 4 files changed, 19 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp.c +4 -3
@@ -480,10 +480,11 @@ void dpp1_set_cursor_position(if (src_y_offset + cursor_height <=0 ) cur_en =0 ;/* not visible beyond top edge*/ -REG_UPDATE (CURSOR0_CONTROL , -CUR0_ENABLE , cur_en); +if (dpp_base->pos.cur0_ctl.bits.cur0_enable != cur_en) { +REG_UPDATE (CURSOR0_CONTROL ,CUR0_ENABLE , cur_en); - dpp_base->pos.cur0_ctl.bits.cur0_enable = cur_en; + dpp_base->pos.cur0_ctl.bits.cur0_enable = cur_en; + } } void dpp1_cnv_set_optional_cursor_attributes(
drivers/gpu/drm/amd/display/dc/dpp/dcn401/dcn401_dpp_cm.c +4 -2
@@ -154,9 +154,11 @@ void dpp401_set_cursor_position(struct dcn401_dpp *dpp =TO_DCN401_DPP (dpp_base);uint32_t cur_en = pos->enable ?1 :0 ; -REG_UPDATE (CURSOR0_CONTROL ,CUR0_ENABLE , cur_en); +if (dpp_base->pos.cur0_ctl.bits.cur0_enable != cur_en) { +REG_UPDATE (CURSOR0_CONTROL ,CUR0_ENABLE , cur_en); - dpp_base->pos.cur0_ctl.bits.cur0_enable = cur_en; + dpp_base->pos.cur0_ctl.bits.cur0_enable = cur_en; + } } void dpp401_set_optional_cursor_attributes(
drivers/gpu/drm/amd/display/dc/hubp/dcn20/dcn20_hubp.c +5 -3
@@ -1058,11 +1058,13 @@ void hubp2_cursor_set_position(if (src_y_offset + cursor_height <=0 ) cur_en =0 ;/* not visible beyond top edge*/ -if (cur_en &®_READ (CURSOR_SURFACE_ADDRESS ) ==0 ) - hubp->funcs->set_cursor_attributes (hubp, &hubp->curs_attr); +if (hubp->pos.cur_ctl.bits.cur_enable != cur_en) { +if (cur_en &®_READ (CURSOR_SURFACE_ADDRESS ) ==0 ) + hubp->funcs->set_cursor_attributes (hubp, &hubp->curs_attr); -REG_UPDATE (CURSOR_CONTROL , +REG_UPDATE (CURSOR_CONTROL ,CURSOR_ENABLE , cur_en); + } REG_SET_2(CURSOR_POSITION, 0, CURSOR_X_POSITION, pos->x,
drivers/gpu/drm/amd/display/dc/hubp/dcn401/dcn401_hubp.c +6 -4
@@ -730,11 +730,13 @@ void hubp401_cursor_set_position(dc_fixpt_from_int (dst_x_offset), param->h_scale_ratio)); -if (cur_en &®_READ (CURSOR_SURFACE_ADDRESS ) ==0 ) - hubp->funcs->set_cursor_attributes (hubp, &hubp->curs_attr); +if (hubp->pos.cur_ctl.bits.cur_enable != cur_en) { +if (cur_en &®_READ (CURSOR_SURFACE_ADDRESS ) ==0 ) + hubp->funcs->set_cursor_attributes (hubp, &hubp->curs_attr); -REG_UPDATE (CURSOR_CONTROL , -CURSOR_ENABLE , cur_en); +REG_UPDATE (CURSOR_CONTROL , +CURSOR_ENABLE , cur_en); + } REG_SET_2(CURSOR_POSITION, 0, CURSOR_X_POSITION, x_pos,
Signature · 1 line
2.34.1
PATCH 20/28 drm/amd/display: Add HBlank reduction DPCD write to DPMS sequence
In reply to [email protected]From: George Shen <[email protected]>
[Why]
Certain small HBlank timings may not have a large enough HBlank to support audio when low bpp DSC is enabled. HBlank expansion by the source can solve this problem, but requires the branch/sink to support HBlank reduction.
[How]
Update DPMS sequence to call DM to perform DPCD write to enable HBlank reduction on the branch/sink. Add stub in dm_helpers to be implemented later.
--- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 6 ++++++ drivers/gpu/drm/amd/display/dc/dm_helpers.h | 5 +++++ drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 17 +++++++++++++++++ 3 files changed, 28 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +6 -0
@@ -885,6 +885,12 @@ bool dm_helpers_dp_write_dsc_enable(return ret; } +bool dm_helpers_dp_write_hblank_reduction (struct dc_context *ctx,const struct dc_stream_state *stream) +{ +// TODO +return false; +} +bool dm_helpers_is_dp_sink_present (struct dc_link *link) {bool dp_sink_present;
drivers/gpu/drm/amd/display/dc/dm_helpers.h +5 -0
@@ -158,6 +158,11 @@ bool dm_helpers_dp_write_dsc_enable(const struct dc_stream_state *stream, bool enable ); + +bool dm_helpers_dp_write_hblank_reduction ( +struct dc_context *ctx, +const struct dc_stream_state *stream); +bool dm_helpers_is_dp_sink_present (struct dc_link *link);
drivers/gpu/drm/amd/display/dc/link/link_dpms.c +17 -0
@@ -772,6 +772,20 @@ static bool dp_set_dsc_on_rx(struct pipe_ctx *pipe_ctx, bool enable)return result; } +static bool dp_set_hblank_reduction_on_rx (struct pipe_ctx *pipe_ctx) +{ +struct dc *dc = pipe_ctx->stream->ctx->dc; +struct dc_stream_state *stream = pipe_ctx->stream; +bool result = false; + +if (dc_is_virtual_signal (stream->signal)) + result = true; +else + result =dm_helpers_dp_write_hblank_reduction (dc->ctx, stream); +return result; +} + +/* The stream with these settings can be sent (unblanked) only after DSC was enabled on RX first, * i.e. after dp_enable_dsc_on_rx() had been called */
@@ -2599,6 +2613,9 @@ void link_set_dpms_on( } } +if (dc_is_dp_signal (pipe_ctx->stream->signal)) +dp_set_hblank_reduction_on_rx (pipe_ctx); +if (pipe_ctx->stream->link->ep_type ==DISPLAY_ENDPOINT_USB4_DPIA )allocate_usb4_bandwidth (pipe_ctx->stream);
Signature · 1 line
2.34.1
PATCH 21/28 drm/amd/display: Fix PSR-SU not support but still call the amdgpu_dm_psr_enable
In reply to [email protected]From: Tom Chung <[email protected]>
[Why]
The enum DC_PSR_VERSION_SU_1 of psr_version is 1 and DC_PSR_VERSION_UNSUPPORTED is 0xFFFFFFFF.
The original code may has chance trigger the amdgpu_dm_psr_enable() while psr version is set to DC_PSR_VERSION_UNSUPPORTED.
[How]
Modify the condition to psr->psr_version == DC_PSR_VERSION_SU_1
--- 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
@@ -8962,7 +8962,7 @@ static void amdgpu_dm_enable_self_refresh(struct amdgpu_crtc *acrtc_attach, (current_ts - psr->psr_dirty_rects_change_timestamp_ns) > 500000000) {if (pr->replay_feature_enabled && !pr->replay_allow_active)amdgpu_dm_replay_enable (acrtc_state->stream, true); -if (psr->psr_version >=DC_PSR_VERSION_SU_1 && +if (psr->psr_version ==DC_PSR_VERSION_SU_1 && !psr->psr_allow_active && !aconn->disallow_edp_enter_psr)amdgpu_dm_psr_enable (acrtc_state->stream); }
Signature · 1 line
2.34.1
PATCH 22/28 drm/amd/display: Disable replay and psr while VRR is enabled
In reply to [email protected]From: Tom Chung <[email protected]>
[Why]
Replay and PSR will cause some video corruption while VRR is enabled.
[How]
1. Disable the Replay and PSR while VRR is enabled.
2. Change the amdgpu_dm_crtc_vrr_active() parameter to const. Because the function will only read data from dm_crtc_state.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++-- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 2 +- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.h | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -2
@@ -8929,6 +8929,7 @@ static void amdgpu_dm_enable_self_refresh(struct amdgpu_crtc *acrtc_attach,struct replay_settings *pr = &acrtc_state->stream->link->replay_settings;struct amdgpu_dm_connector *aconn = (struct amdgpu_dm_connector *)acrtc_state->stream->dm_stream_context; +bool vrr_active =amdgpu_dm_crtc_vrr_active (acrtc_state);if (acrtc_state->update_type >UPDATE_TYPE_FAST ) {if (pr->config.replay_supported && !pr->replay_feature_enabled)
@@ -8955,7 +8956,8 @@ static void amdgpu_dm_enable_self_refresh(struct amdgpu_crtc *acrtc_attach,* adequate number of fast atomic commits to notify KMD * of update events. See `vblank_control_worker()`. */ - if (acrtc_attach->dm_irq_params.allow_sr_entry && + if (!vrr_active && + acrtc_attach->dm_irq_params.allow_sr_entry &&#ifdef CONFIG_DRM_AMD_SECURE_DISPLAY !amdgpu_dm_crc_window_is_activated(acrtc_state->base.crtc) &&#endif
@@ -9299,7 +9301,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, bundle->stream_update.abm_level = &acrtc_state->abm_level;mutex_lock (&dm->dc_lock); -if (acrtc_state->update_type >UPDATE_TYPE_FAST ) { +if ((acrtc_state->update_type >UPDATE_TYPE_FAST ) || vrr_active) {if (acrtc_state->stream->link->replay_settings.replay_allow_active)amdgpu_dm_replay_disable (acrtc_state->stream);if (acrtc_state->stream->link->psr_settings.psr_allow_active)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +1 -1
@@ -93,7 +93,7 @@ int amdgpu_dm_crtc_set_vupdate_irq(struct drm_crtc *crtc, bool enable)return rc; } -bool amdgpu_dm_crtc_vrr_active (struct dm_crtc_state *dm_state) +bool amdgpu_dm_crtc_vrr_active (const struct dm_crtc_state *dm_state) {return dm_state->freesync_config.state ==VRR_STATE_ACTIVE_VARIABLE || dm_state->freesync_config.state ==VRR_STATE_ACTIVE_FIXED ;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.h +1 -1
@@ -37,7 +37,7 @@ int amdgpu_dm_crtc_set_vupdate_irq(struct drm_crtc *crtc, bool enable);bool amdgpu_dm_crtc_vrr_active_irq (struct amdgpu_crtc *acrtc); -bool amdgpu_dm_crtc_vrr_active (struct dm_crtc_state *dm_state); +bool amdgpu_dm_crtc_vrr_active (const struct dm_crtc_state *dm_state);int amdgpu_dm_crtc_enable_vblank (struct drm_crtc *crtc);
Signature · 1 line
2.34.1
PATCH 23/28 drm/amd/display: Add 6bpc RGB case for dcn32 output bpp calculations
In reply to [email protected]From: George Shen <[email protected]>
[Why]
Current DCN32 calculation doesn't consider RGB 6bpc for the DP case. This results in an invalid output bpp being calculated when DSC is not enabled in the configuration, failing the mode validation.
[How]
Add special case to handle 6bpc RGB in the output bpp calculation.
--- .../drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c +4 -0
@@ -1595,6 +1595,7 @@ double dml32_TruncToValidBPP(unsigned int NonDSCBPP0;unsigned int NonDSCBPP1;unsigned int NonDSCBPP2; +unsigned int NonDSCBPP3 =BPP_INVALID ;if (Format == dm_420) { NonDSCBPP0 =12 ;
@@ -1603,6 +1604,7 @@ double dml32_TruncToValidBPP( MinDSCBPP =6 ; MaxDSCBPP =1.5 * DSCInputBitPerComponent -1.0 /16 ; }else if (Format == dm_444) { + NonDSCBPP3 =18 ; NonDSCBPP0 =24 ; NonDSCBPP1 =30 ; NonDSCBPP2 =36 ;
@@ -1667,6 +1669,8 @@ double dml32_TruncToValidBPP(return NonDSCBPP1; else if (MaxLinkBPP >= NonDSCBPP0) return 16.0; + else if ((Output == dm_dp2p0 || Output == dm_dp) && NonDSCBPP3 != BPP_INVALID && MaxLinkBPP >= NonDSCBPP3) +return NonDSCBPP3;// Special case to allow 6bpc RGB for DP connections. else return BPP_INVALID; }
Signature · 1 line
2.34.1
PATCH 24/28 drm/amd/display: Add check for granularity in dml ceil/floor helpers
In reply to [email protected]From: Roman Li <[email protected]>
[Why]
Wrapper functions for dcn_bw_ceil2() and dcn_bw_floor2() should check for granularity is non zero to avoid assert and divide-by-zero error in dcn_bw_ functions.
[How]
Add check for granularity 0.
--- drivers/gpu/drm/amd/display/dc/dml/dml_inline_defs.h | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/display/dc/dml/dml_inline_defs.h +8 -0
@@ -66,11 +66,15 @@ static inline double dml_max5(double a, double b, double c, double d, double e)static inline double dml_ceil (double a,double granularity) { +if (granularity ==0 ) +return 0 ;return (double )dcn_bw_ceil2 (a, granularity); }static inline double dml_floor (double a,double granularity) { +if (granularity ==0 ) +return 0 ;return (double )dcn_bw_floor2 (a, granularity); }
@@ -114,11 +118,15 @@ static inline double dml_ceil_2(double f)static inline double dml_ceil_ex (double x,double granularity) { +if (granularity ==0 ) +return 0 ;return (double )dcn_bw_ceil2 (x, granularity); }static inline double dml_floor_ex (double x,double granularity) { +if (granularity ==0 ) +return 0 ;return (double )dcn_bw_floor2 (x, granularity); }
Signature · 1 line
2.34.1
PATCH 25/28 drm/amd/display: Clean up SPL code
In reply to [email protected]From: Samson Tam <[email protected]>
[Why & How]
Use helper functions for checking formats Apply cositing offset in rotation case
--- drivers/gpu/drm/amd/display/dc/spl/dc_spl.c | 88 ++++++++++----------- 1 file changed, 43 insertions(+), 45 deletions(-)
drivers/gpu/drm/amd/display/dc/spl/dc_spl.c +43 -45
@@ -11,6 +11,41 @@#define IDENTITY_RATIO (ratio) (spl_fixpt_u2d19(ratio) == (1 << 19))#define MIN_VIEWPORT_SIZE 12 +static bool spl_is_yuv420 (enum spl_pixel_format format) +{ +if ((format >=SPL_PIXEL_FORMAT_420BPP8 ) && + (format <=SPL_PIXEL_FORMAT_420BPP10 )) +return true; + +return false; +} + +static bool spl_is_rgb8 (enum spl_pixel_format format) +{ +if (format ==SPL_PIXEL_FORMAT_ARGB8888 ) +return true; + +return false; +} + +static bool spl_is_video_format (enum spl_pixel_format format) +{ +if (format >=SPL_PIXEL_FORMAT_VIDEO_BEGIN + && format <=SPL_PIXEL_FORMAT_VIDEO_END ) +return true; +else +return false; +} + +static bool spl_is_subsampled_format (enum spl_pixel_format format) +{ +if (format >=SPL_PIXEL_FORMAT_SUBSAMPLED_BEGIN + && format <=SPL_PIXEL_FORMAT_SUBSAMPLED_END ) +return true; +else +return false; +} +static struct spl_rect intersect_rec (const struct spl_rect *r0,const struct spl_rect *r1) {struct spl_rect rec;
@@ -408,8 +443,7 @@ static void spl_calculate_scaling_ratios(struct spl_in *spl_in, spl_scratch->scl_data.ratios.horz_c = spl_scratch->scl_data.ratios.horz; spl_scratch->scl_data.ratios.vert_c = spl_scratch->scl_data.ratios.vert; -if (spl_in->basic_in.format ==SPL_PIXEL_FORMAT_420BPP8 - || spl_in->basic_in.format ==SPL_PIXEL_FORMAT_420BPP10 ) { +if (spl_is_yuv420 (spl_in->basic_in.format)) { spl_scratch->scl_data.ratios.horz_c.value /=2 ; spl_scratch->scl_data.ratios.vert_c.value /=2 ; }
@@ -546,41 +580,6 @@ static void spl_calculate_init_and_vp(bool flip_scan_dir, *vp_offset = src_size - *vp_offset - *vp_size; } -static bool spl_is_yuv420 (enum spl_pixel_format format) -{ -if ((format >=SPL_PIXEL_FORMAT_420BPP8 ) && - (format <=SPL_PIXEL_FORMAT_420BPP10 )) -return true; - -return false; -} - -static bool spl_is_rgb8 (enum spl_pixel_format format) -{ -if (format ==SPL_PIXEL_FORMAT_ARGB8888 ) -return true; - -return false; -} - -static bool spl_is_video_format (enum spl_pixel_format format) -{ -if (format >=SPL_PIXEL_FORMAT_VIDEO_BEGIN - && format <=SPL_PIXEL_FORMAT_VIDEO_END ) -return true; -else -return false; -} - -static bool spl_is_subsampled_format (enum spl_pixel_format format) -{ -if (format >=SPL_PIXEL_FORMAT_SUBSAMPLED_BEGIN - && format <=SPL_PIXEL_FORMAT_SUBSAMPLED_END ) -return true; -else -return false; -} -/*Calculate inits and viewport */ static void spl_calculate_inits_and_viewports (struct spl_in *spl_in,struct spl_scratch *spl_scratch)
@@ -591,8 +590,7 @@ static void spl_calculate_inits_and_viewports(struct spl_in *spl_in,struct spl_rect recout_clip_in_recout_dst;struct spl_rect overlap_in_active_timing;struct spl_rect odm_slice =calculate_odm_slice_in_timing_active (spl_in); -int vpc_div = (spl_in->basic_in.format ==SPL_PIXEL_FORMAT_420BPP8 - || spl_in->basic_in.format ==SPL_PIXEL_FORMAT_420BPP10 ) ?2 :1 ; +int vpc_div =spl_is_subsampled_format (spl_in->basic_in.format) ?2 :1 ;bool orthogonal_rotation, flip_vert_scan_dir, flip_horz_scan_dir;struct spl_fixed31_32 init_adj_h = spl_fixpt_zero;struct spl_fixed31_32 init_adj_v = spl_fixpt_zero;
@@ -620,11 +618,6 @@ static void spl_calculate_inits_and_viewports(struct spl_in *spl_in, &flip_vert_scan_dir, &flip_horz_scan_dir); -if (orthogonal_rotation) { -spl_swap (src.width, src.height); -spl_swap (flip_vert_scan_dir, flip_horz_scan_dir); - } -if (spl_is_subsampled_format (spl_in->basic_in.format)) {/* this gives the direction of the cositing (negative will move * left, right otherwise)
@@ -647,7 +640,12 @@ static void spl_calculate_inits_and_viewports(struct spl_in *spl_in, init_adj_v = spl_fixpt_zero;break ; } + } +if (orthogonal_rotation) { +spl_swap (src.width, src.height); +spl_swap (flip_vert_scan_dir, flip_horz_scan_dir); +spl_swap (init_adj_h, init_adj_v); } spl_calculate_init_and_vp(
@@ -1600,7 +1598,7 @@ static void spl_set_easf_data(struct spl_scratch *spl_scratch, struct spl_out *s0x0 ;// fp1.5.10, C3 coefficient } -if (spl_is_video_format (format)) {/* TODO: 0 = RGB, 1 = YUV */ +if (spl_is_subsampled_format (format)) {/* TODO: 0 = RGB, 1 = YUV */ dscl_prog_data->easf_matrix_mode =1 ;/* * 2-bit, BF3 chroma mode correction calculation mode
Signature · 1 line
2.34.1
PATCH 26/28 drm/amd/display: Add VC for VESA Aux Backlight Control
In reply to [email protected]From: Iswara Nagulendran <[email protected]>
[WHY]
There is no way to distinguish
the static backlight control type
being used and the VABC support
without the use of a debugger or
reading DPCD registers.
[HOW]
Add Visual Confirm support
for VESA Aux-based Backlight Control.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 2 + .../drm/amd/display/dc/core/dc_hw_sequencer.c | 38 +++++++++++++++++++ drivers/gpu/drm/amd/display/dc/dc.h | 1 + .../drm/amd/display/dc/hwss/hw_sequencer.h | 6 +-- 4 files changed, 44 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -0
@@ -1236,6 +1236,8 @@ static void dc_update_visual_confirm_color(struct dc *dc, struct dc_state *conteget_mclk_switch_visual_confirm_color (pipe_ctx, &(pipe_ctx->visual_confirm_color)); else if (dc->debug.visual_confirm == VISUAL_CONFIRM_FAMS2) get_fams2_visual_confirm_color(dc, context, pipe_ctx, &(pipe_ctx->visual_confirm_color)); + else if (dc->debug.visual_confirm == VISUAL_CONFIRM_VABC) + get_vabc_visual_confirm_color(pipe_ctx, &(pipe_ctx->visual_confirm_color)); } } }
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +38 -0
@@ -425,6 +425,44 @@ void get_hdr_visual_confirm_color( } } +/* Visual Confirm color definition for VABC */ +void get_vabc_visual_confirm_color ( +struct pipe_ctx *pipe_ctx, +struct tg_color *color) +{ +uint32_t color_value =MAX_TG_COLOR_VALUE ; +struct dc_link *edp_link =NULL ; + +if (pipe_ctx && pipe_ctx->stream && pipe_ctx->stream->link) { +if (pipe_ctx->stream->link->connector_signal ==SIGNAL_TYPE_EDP ) + edp_link = pipe_ctx->stream->link; + } + +if (edp_link) { +switch (edp_link->backlight_control_type) { +case BACKLIGHT_CONTROL_PWM : + color->color_r_cr = color_value; + color->color_g_y =0 ; + color->color_b_cb =0 ; +break ; +case BACKLIGHT_CONTROL_AMD_AUX : + color->color_r_cr =0 ; + color->color_g_y = color_value; + color->color_b_cb =0 ; +break ; +case BACKLIGHT_CONTROL_VESA_AUX : + color->color_r_cr =0 ; + color->color_g_y =0 ; + color->color_b_cb = color_value; +break ; + } + }else { + color->color_r_cr =0 ; + color->color_g_y =0 ; + color->color_b_cb =0 ; + } +} +void get_subvp_visual_confirm_color (struct pipe_ctx *pipe_ctx,struct tg_color *color)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -489,6 +489,7 @@ enum visual_confirm {VISUAL_CONFIRM_MCLK_SWITCH =16 ,VISUAL_CONFIRM_FAMS2 =19 ,VISUAL_CONFIRM_HW_CURSOR =20 , + VISUAL_CONFIRM_VABC = 21, }; enum dc_psr_power_opts {
drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h +3 -3
@@ -194,7 +194,6 @@ enum block_sequence_func {DMUB_SUBVP_SAVE_SURF_ADDR ,HUBP_WAIT_FOR_DCC_META_PROP , DMUB_FAMS2_GLOBAL_CONTROL_LOCK_FAST, - }; struct block_sequence {
@@ -485,11 +484,12 @@ void get_hdr_visual_confirm_color(void get_mpctree_visual_confirm_color (struct pipe_ctx *pipe_ctx,struct tg_color *color); - +void get_vabc_visual_confirm_color ( +struct pipe_ctx *pipe_ctx, +struct tg_color *color);void get_subvp_visual_confirm_color (struct pipe_ctx *pipe_ctx,struct tg_color *color); - void get_fams2_visual_confirm_color( struct dc *dc, struct dc_state *context,
Signature · 1 line
2.34.1
PATCH 27/28 drm/amd/display: Extend capability to get multiple ROI CRCs
In reply to [email protected]From: Wayne Lin <[email protected]>
[Why & How]
We already extend our dm, dc and dmub to support setting of multiple CRC instances, now extend the capability to return back the ROI/CRC pair result from psp by specifying activated ROI instances.
--- .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 36 +++++++++++++++---- 1 file changed, 29 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c +29 -7
@@ -343,7 +343,11 @@ static void amdgpu_dm_crtc_notify_ta_to_read(struct work_struct *work)struct amdgpu_dm_connector *aconnector;uint8_t phy_inst;struct amdgpu_display_manager *dm; +struct crc_data crc_cpy[MAX_CRC_WINDOW_NUM ]; +unsigned long flags; +uint8_t roi_idx =0 ;int ret; +int i; crtc_ctx = container_of(work, struct secure_display_crtc_context, notify_ta_work); crtc = crtc_ctx->crtc;
@@ -372,18 +376,36 @@ static void amdgpu_dm_crtc_notify_ta_to_read(struct work_struct *work) }mutex_unlock (&crtc->dev->mode_config.mutex); +spin_lock_irqsave (&crtc->dev->event_lock, flags); +memcpy (crc_cpy, crtc_ctx->crc_info.crc,sizeof (struct crc_data ) *MAX_CRC_WINDOW_NUM ); +spin_unlock_irqrestore (&crtc->dev->event_lock, flags); +/* need lock for multiple crtcs to use the command buffer */ mutex_lock (&psp->securedisplay_context.mutex); - -psp_prep_securedisplay_cmd_buf (psp, &securedisplay_cmd, -TA_SECUREDISPLAY_COMMAND__SEND_ROI_CRC ); - - securedisplay_cmd->securedisplay_in_message.send_roi_crc.phy_id = phy_inst; -/* PSP TA is expected to finish data transmission over I2C within current frame, * even there are up to 4 crtcs request to send in this frame. */ - ret =psp_securedisplay_invoke (psp,TA_SECUREDISPLAY_COMMAND__SEND_ROI_CRC ); +if (dm->secure_display_ctx.support_mul_roi) { +psp_prep_securedisplay_cmd_buf (psp, &securedisplay_cmd, +TA_SECUREDISPLAY_COMMAND__SEND_ROI_CRC_V2 ); + + securedisplay_cmd->securedisplay_in_message.send_roi_crc_v2.phy_id = phy_inst; + +for (i =0 ; i <MAX_CRC_WINDOW_NUM ; i++) { +if (crc_cpy[i].crc_ready) + roi_idx |=1 << i; + } + securedisplay_cmd->securedisplay_in_message.send_roi_crc_v2.roi_idx = roi_idx; + + ret =psp_securedisplay_invoke (psp,TA_SECUREDISPLAY_COMMAND__SEND_ROI_CRC_V2 ); + }else { +psp_prep_securedisplay_cmd_buf (psp, &securedisplay_cmd, +TA_SECUREDISPLAY_COMMAND__SEND_ROI_CRC ); + + securedisplay_cmd->securedisplay_in_message.send_roi_crc.phy_id = phy_inst; + + ret =psp_securedisplay_invoke (psp,TA_SECUREDISPLAY_COMMAND__SEND_ROI_CRC ); + }if (!ret) {if (securedisplay_cmd->status !=TA_SECUREDISPLAY_STATUS__SUCCESS )
Signature · 1 line
2.34.1
PATCH 28/28 drm/amd/display: Promote DC to 3.2.315
In reply to [email protected]From: Martin Leung <[email protected]>
This version brings along the following:
- Add Interface to Dump DSC Caps from dm
- Add DP required HBlank size calc to link interface
- Add 6bpc RGB case for dcn32 output bpp calculations
- Add VC for VESA Aux Backlight Control
- Add support for setting multiple CRC windows in dc
- Clean up SPL code and outdated interfaces in dcn401_clk_mgr
- Disable replay and psr while VRR is enabled
- Fix PSR-SU not support but still call the amdgpu_dm_psr_enable
- Implement Replay Low Hz Visual Confirm
- Extend dc_stream_get_crc to support 2nd crc engine
- Update power gating logic for DCN35 hw
--- 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.314" +#define DC_VER "3.2.315"#define MAX_SURFACES 3#define MAX_PLANES 6
Signature · 1 line
2.34.1
[Public]
Hi all,
This week is the last test set for the year, the testing will resume the week of the 6th of January 2025. Have a great holiday break everyone!
This week this patchset was tested on 4 systems, two dGPU and two APU based, and tested across multiple display and connection types.
APU
* Single Display eDP -> 1080p 60hz, 2560x1600 120hz, 1920x1200 165hz
* Single Display DP (SST DSC) -> 4k144hz, 4k240hz
* Multi display -> eDP + DP/HDMI/USB-C -> 1080p 60hz eDP + 4k 144hz, 4k 240hz (Includes USB-C to DP/HDMI adapters)
* Thunderbolt -> LG Ultrafine 5k
* MST DSC -> Cable Matters 101075 (DP to 3x DP) with 3x 4k60hz displays, HP Hook G2 with 2x 4k60hz displays
* USB 4 -> HP Hook G4, Lenovo Thunderbolt Dock, both with 2x 4k60hz DP and 1x 4k60hz HDMI displays
* SST PCON -> Club3D CAC-1085 + 1x 4k 144hz, FRL3, at a max resolution supported by the dongle of 4k 120hz YUV420 12bpc.
* MST PCON -> 1x 4k 144hz, FRL3, at a max resolution supported by the adapter of 4k 120hz RGB 8bpc.
DGPU
* Single Display DP (SST DSC) -> 4k144hz, 4k240hz
* Multiple Display DP -> 4k240hz + 4k144hz
* MST (Startech MST14DP123DP [DP to 3x DP] and 2x 4k 60hz displays)
* MST DSC (with Cable Matters 101075 [DP to 3x DP] with 3x 4k60hz displays)
The testing is a mix of automated and manual tests. Manual testing includes (but is not limited to)
* Changing display configurations and settings
* Video/Audio playback
* Benchmark testing
* Suspend/Resume testing
* Feature testing (Freesync, HDCP, etc.)
Automated testing includes (but is not limited to)
* Script testing (scripts to automate some of the manual checks)
* IGT testing
The testing is mainly tested on the following displays, but occasionally there are tests with other displays
* Samsung G8 Neo 4k240hz
* Samsung QN55QN95B 4k 120hz
* Acer XV322QKKV 4k144hz
* HP U27 4k Wireless 4k60hz
* LG 27UD58B 4k60hz
* LG 32UN650WA 4k60hz
* LG Ultrafine 5k 5k60hz
* AU Optronics B140HAN01.1 1080p 60hz eDP
* AU Optronics B160UAN01.J 1920x1200 165hz eDP
* AU Optronics B160QAN02.L 2560x1600 120hz eDP
The patchset consists of the amd-staging-drm-next branch (Head commit - 179c7f1e901522b474135c66a5ba00e7a743eb89 -> drm/amd/display: 3.2.314) with new patches added on top of it.
Tested on Ubuntu 24.04.1, 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
Facebook | Twitter | amd.com
-----Original Message-----
From: [email protected] <[email protected]>
Sent: Friday, December 20, 2024 4:48 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]>; Chung, ChiaHsuan (Tom) <[email protected]>; Zuo, Jerry <[email protected]>; Mohamed, Zaeem <[email protected]>; Chiu, Solomon <[email protected]>; Wheeler, Daniel <[email protected]>; Li, Roman <[email protected]>
Subject: [PATCH 00/28] DC Patches December 20, 2024
From: Roman Li <[email protected]>
- Improvements for DP, Replay/PSR, DML, SPL, DCN32, DCN35, DCN401
- Extended logging for DSC, VABC and stream crc
- Optimization for cursor position updates
Aric Cyr (1):
drm/amd/display: Optimize cursor position updates
Aurabindo Pillai (1):
drm/amd/display: Add guards around MAX/MIN
Brandon Syu (1):
drm/amd/display: modify init dc_power_state
Dennis.Chan (1):
drm/amd/display: Implement Replay Low Hz Visual Confirm
Dillon Varone (1):
drm/amd/display: Cleanup outdated interfaces in dcn401_clk_mgr
Fangzhi Zuo (1):
drm/amd/display: Add Interface to Dump DSC Caps from dm
George Shen (5):
drm/amd/display: Parse RECEIVE_PORT0_CAP capabilities from DPCD drm/amd/display: Add DP required HBlank size calc to link interface drm/amd/display: Add expanded HBlank field to dc_crtc_timing drm/amd/display: Add HBlank reduction DPCD write to DPMS sequence drm/amd/display: Add 6bpc RGB case for dcn32 output bpp calculations
Iswara Nagulendran (1):
drm/amd/display: Add VC for VESA Aux Backlight Control
Karthi Kandasamy (2):
drm/amd/display: Update dc_tiling_info union to structure drm/amd/display: Ensure correct GFX tiling info passed to DML
Martin Leung (1):
drm/amd/display: Promote DC to 3.2.315
Natanel Roizenman (1):
drm/amd/display: correct type mismatches in comparisons in DML2
Peichen Huang (1):
drm/amd/display: have pretrain for dpia
Roman Li (1):
drm/amd/display: Add check for granularity in dml ceil/floor helpers
Samson Tam (2):
drm/amd/display: fix init_adj offset for cositing in SPL drm/amd/display: Clean up SPL code
Tom Chung (2):
drm/amd/display: Fix PSR-SU not support but still call the
amdgpu_dm_psr_enable
drm/amd/display: Disable replay and psr while VRR is enabled
Wayne Lin (4):
drm/amd/display: Add support for setting multiple CRC windows in dc drm/amd/display: Extend dc_stream_get_crc to support 2nd crc engine drm/amd/display: Adjust dm to use supported interfaces for setting
multiple crc windows
drm/amd/display: Extend capability to get multiple ROI CRCs
Yihan Zhu (2):
drm/amd/display: update sequential pg logic DCN35 drm/amd/display: power up all gating blocks when releasing hw DCN35
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 31 ++- .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 214 ++++++++++++---- .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h | 23 +- .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 2 +- .../amd/display/amdgpu_dm/amdgpu_dm_crtc.h | 2 +- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 31 +-- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 6 + .../display/amdgpu_dm/amdgpu_dm_irq_params.h | 4 +- .../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 17 +- .../amd/display/amdgpu_dm/amdgpu_dm_plane.h | 2 +- .../dc/clk_mgr/dcn401/dcn401_clk_mgr.c | 240 ++---------------- drivers/gpu/drm/amd/display/dc/core/dc.c | 75 +++++- .../drm/amd/display/dc/core/dc_hw_sequencer.c | 38 +++ .../drm/amd/display/dc/core/dc_link_exports.c | 8 + .../gpu/drm/amd/display/dc/core/dc_stream.c | 2 + drivers/gpu/drm/amd/display/dc/dc.h | 38 ++- drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 16 ++ drivers/gpu/drm/amd/display/dc/dc_dsc.h | 5 + drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 179 +++++++------ drivers/gpu/drm/amd/display/dc/dc_stream.h | 6 + drivers/gpu/drm/amd/display/dc/dc_types.h | 26 +- .../drm/amd/display/dc/dce/dce_mem_input.c | 10 +- .../display/dc/dce110/dce110_mem_input_v.c | 8 +- .../dc/dce110/dce110_timing_generator.c | 32 ++- .../dc/dce110/dce110_timing_generator.h | 2 +- .../dc/dce120/dce120_timing_generator.c | 34 ++- .../dc/dio/dcn35/dcn35_dio_link_encoder.c | 80 ++++++ .../dc/dio/dcn35/dcn35_dio_link_encoder.h | 18 ++ drivers/gpu/drm/amd/display/dc/dm_helpers.h | 5 + .../dc/dml/dcn32/display_mode_vba_util_32.c | 4 + .../drm/amd/display/dc/dml/dml_inline_defs.h | 8 + .../dc/dml2/dml21/dml21_translation_helper.c | 16 +- .../dml2/dml21/src/dml2_dpmm/dml2_dpmm_dcn4.c | 12 +- .../dml2/dml21/src/dml2_pmo/dml2_pmo_dcn3.c | 6 +- .../dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c | 30 +-- .../drm/amd/display/dc/dpp/dcn10/dcn10_dpp.c | 7 +- .../amd/display/dc/dpp/dcn401/dcn401_dpp_cm.c | 6 +- drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 45 ++++ .../amd/display/dc/hubp/dcn10/dcn10_hubp.c | 4 +- .../amd/display/dc/hubp/dcn10/dcn10_hubp.h | 4 +- .../amd/display/dc/hubp/dcn20/dcn20_hubp.c | 12 +- .../amd/display/dc/hubp/dcn20/dcn20_hubp.h | 2 +- .../amd/display/dc/hubp/dcn201/dcn201_hubp.c | 2 +- .../amd/display/dc/hubp/dcn30/dcn30_hubp.c | 4 +- .../amd/display/dc/hubp/dcn30/dcn30_hubp.h | 4 +- .../amd/display/dc/hubp/dcn35/dcn35_hubp.c | 2 +- .../amd/display/dc/hubp/dcn35/dcn35_hubp.h | 2 +- .../amd/display/dc/hubp/dcn401/dcn401_hubp.c | 14 +- .../amd/display/dc/hubp/dcn401/dcn401_hubp.h | 4 +- .../amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 41 ++- .../amd/display/dc/hwss/dcn35/dcn35_hwseq.h | 2 + .../amd/display/dc/hwss/dcn35/dcn35_init.c | 1 + .../drm/amd/display/dc/hwss/hw_sequencer.h | 6 +- drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h | 4 +- .../drm/amd/display/dc/inc/hw/link_encoder.h | 8 + .../gpu/drm/amd/display/dc/inc/hw/mem_input.h | 4 +- drivers/gpu/drm/amd/display/dc/inc/hw/optc.h | 2 +- .../amd/display/dc/inc/hw/timing_generator.h | 2 +- drivers/gpu/drm/amd/display/dc/inc/link.h | 4 + .../amd/display/dc/link/hwss/link_hwss_dio.c | 4 +- .../amd/display/dc/link/hwss/link_hwss_dpia.c | 61 ++++- .../amd/display/dc/link/hwss/link_hwss_dpia.h | 3 + .../drm/amd/display/dc/link/link_detection.c | 3 +- .../gpu/drm/amd/display/dc/link/link_dpms.c | 20 +- .../drm/amd/display/dc/link/link_factory.c | 1 + .../drm/amd/display/dc/link/link_validation.c | 179 +++++++++++++ .../drm/amd/display/dc/link/link_validation.h | 5 + .../dc/link/protocols/link_dp_capability.c | 5 + .../dc/link/protocols/link_dp_irq_handler.c | 5 +- .../amd/display/dc/optc/dcn10/dcn10_optc.c | 33 ++- .../amd/display/dc/optc/dcn10/dcn10_optc.h | 19 ++ .../dc/resource/dcn35/dcn35_resource.c | 9 +- .../dc/resource/dcn35/dcn35_resource.h | 1 + .../dc/resource/dcn351/dcn351_resource.c | 2 +- .../dc/resource/dcn401/dcn401_resource.c | 3 +- drivers/gpu/drm/amd/display/dc/spl/dc_spl.c | 99 ++++---- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 64 ++++- 77 files changed, 1356 insertions(+), 576 deletions(-)
--
2.34.1