DC Patches Apr 1, 2024
cover DC Patches Apr 1, 2024
From: Roman Li <[email protected]>
This DC patchset brings improvements in multiple areas. In summary, we have:
- Fix underflow in subvp/non-subvp configs
- Fix compiler warnings
- Add handling for DC power mode
- Add extra logging for DMUB, HUBP and OTG
- Add timing pixel encoding for mst mode validation
- Expand supported Replay residency mode
- Allow HPO PG and RCG for DCN35
- Update pipe topology log to support subvp
- Disable Z8 minimum stutter period check for DCN35
- Enable RCO for HDMISTREAMCLK in DCN35
Alex Hung (1):
drm/amd/display: Skip on writeback when it's not applicable
Alvin Lee (2):
drm/amd/display: Add extra logging for HUBP and OTG drm/amd/display: Add extra DMUB logging to track message timeout
Aric Cyr (2):
drm/amd/display: Fix compiler warnings on high compiler warning levels drm/amd/display: 3.2.279
Daniel Miess (2):
drm/amd/display: Toggle additional RCO options in DCN35 drm/amd/display: Enable RCO for HDMISTREAMCLK in DCN35
Dillon Varone (1):
drm/amd/display: Add dmub additional interface support for FAMS
Duncan Ma (1):
drm/amd/display: Allow HPO PG for DCN35
Eric Bernstein (1):
drm/amd/display: Fix MPCC DTN logging
George Shen (1):
drm/amd/display: Add dummy interface for tracing DCN32 SMU messages
Hersen Wu (2):
drm/amd/display: Add timing pixel encoding for mst mode validation drm/amd/display: FEC overhead should be checked once for mst slot nums
Joshua Aberback (3):
drm/amd/display: handle invalid connector indices drm/amd/display: remove context->dml2 dependency from DML21 wrapper drm/amd/display: Add handling for DC power mode
Leo (Hanghong) Ma (1):
drm/amd/display: Add OTG check for set AV mute
Leon Huang (1):
drm/amd/display: Expand supported Replay residency mode
Mounika Adhuri (1):
drm/amd/display: Fix compiler redefinition warnings for certain
configs
Nicholas Kazlauskas (1):
drm/amd/display: Disable Z8 minimum stutter period check for DCN35
Rodrigo Siqueira (15):
drm/amd/display: Initialize DP ref clk with the correct clock drm/amd/display: Set alpha enable to 0 for some specific formats drm/amd/display: Enable cur_rom_en even if cursor degamma is not
enabled
drm/amd/display: Add some missing debug registers drm/amd/display: Update DSC compute parameter calculation drm/amd/display: Drop legacy code
drm/amd/display: Add missing registers drm/amd/display: Remove redundant RESERVE0 and RESERVE1 drm/amd/display: Add missing SFB and OPP_SF drm/amd/display: Initialize debug variable data drm/amd/display: Add WBSCL ram coefficient for writeback drm/amd/display: Add code comments clock and encode code drm/amd/display: Includes adjustments drm/amd/display: Add color logs for dcn20 drm/amd/display: Enable FGCG for DCN351
Roman Li (2):
drm/amd/display: Decouple dcn35 and dcn351 dmub firmware drm/amd/display: Allow RCG for Static Screen + LVP for DCN35
Samson Tam (1):
drm/amd/display: fix underflow in some two display subvp/non-subvp
configs
Sung Joon Kim (1):
drm/amd/display: Enable DTBCLK DTO earlier in the sequence
Wenjing Liu (3):
drm/amd/display: optimize dml2 pipe resource allocation order drm/amd/display: update pipe topology log to support subvp drm/amd/display: move build test pattern params as part of pipe
resource update for odm
Xi (Alex) Liu (1):
drm/amd/display: add root clock control function pointer to fix
display corruption
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 37 ++- .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 66 +++-- .../display/amdgpu_dm/amdgpu_dm_mst_types.h | 3 - .../display/amdgpu_dm/amdgpu_dm_services.c | 8 + .../drm/amd/display/dc/bios/bios_parser2.c | 2 - .../display/dc/clk_mgr/dce100/dce_clk_mgr.c | 4 +- .../display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c | 2 +- .../dc/clk_mgr/dcn201/dcn201_clk_mgr.c | 11 + .../amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c | 5 +- .../display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c | 2 +- .../dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.c | 5 +- .../display/dc/clk_mgr/dcn301/vg_clk_mgr.c | 3 +- .../display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c | 3 +- .../dc/clk_mgr/dcn316/dcn316_clk_mgr.c | 3 +- .../dc/clk_mgr/dcn32/dcn32_clk_mgr_smu_msg.c | 9 + drivers/gpu/drm/amd/display/dc/core/dc.c | 64 +++-- .../drm/amd/display/dc/core/dc_hw_sequencer.c | 2 +- .../gpu/drm/amd/display/dc/core/dc_resource.c | 105 +++++-- .../gpu/drm/amd/display/dc/core/dc_state.c | 29 +- drivers/gpu/drm/amd/display/dc/dc.h | 19 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 12 +- drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 13 +- drivers/gpu/drm/amd/display/dc/dc_state.h | 2 +- drivers/gpu/drm/amd/display/dc/dc_stream.h | 8 - drivers/gpu/drm/amd/display/dc/dc_types.h | 16 ++ .../drm/amd/display/dc/dce/dce_mem_input.h | 1 + drivers/gpu/drm/amd/display/dc/dce/dce_opp.h | 1 + .../drm/amd/display/dc/dce/dce_transform.c | 2 +- .../gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c | 4 - .../drm/amd/display/dc/dcn10/dcn10_hubbub.c | 2 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h | 1 + .../dc/dcn10/dcn10_hw_sequencer_debug.c | 2 +- .../amd/display/dc/dcn10/dcn10_link_encoder.c | 1 - .../gpu/drm/amd/display/dc/dcn20/dcn20_dwb.c | 11 + .../gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c | 6 + .../drm/amd/display/dc/dcn201/dcn201_hubbub.c | 2 +- .../display/dc/dcn30/dcn30_dio_link_encoder.c | 2 - .../dc/dcn30/dcn30_dio_stream_encoder.c | 2 - .../gpu/drm/amd/display/dc/dcn30/dcn30_hubp.c | 3 + .../dc/dcn31/dcn31_hpo_dp_stream_encoder.c | 4 + .../display/dc/dcn32/dcn32_resource_helpers.c | 2 +- .../gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c | 207 +++++++++++++- .../display/dc/dcn35/dcn35_dio_link_encoder.c | 1 - .../dc/dcn35/dcn35_dio_stream_encoder.h | 1 - drivers/gpu/drm/amd/display/dc/dm_services.h | 10 + .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 2 - .../dc/dml/dcn30/display_mode_vba_30.c | 1 - .../dc/dml/dcn31/display_mode_vba_31.c | 1 - .../amd/display/dc/dml/dcn314/dcn314_fpu.c | 2 +- .../dc/dml/dcn314/display_mode_vba_314.c | 1 - .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 267 ++++++++++-------- .../dc/dml/dcn32/display_mode_vba_util_32.c | 14 +- .../drm/amd/display/dc/dml/dcn35/dcn35_fpu.c | 2 +- .../amd/display/dc/dml/dcn351/dcn351_fpu.c | 2 +- .../amd/display/dc/dml2/display_mode_core.c | 12 +- .../display/dc/dml2/dml2_dc_resource_mgmt.c | 132 ++++++--- .../amd/display/dc/dml2/dml2_internal_types.h | 11 + .../gpu/drm/amd/display/dc/dml2/dml2_utils.c | 2 +- .../drm/amd/display/dc/dml2/dml2_wrapper.c | 6 +- .../drm/amd/display/dc/dml2/dml2_wrapper.h | 6 + .../drm/amd/display/dc/dpp/dcn10/dcn10_dpp.h | 3 +- .../drm/amd/display/dc/dpp/dcn30/dcn30_dpp.c | 8 +- .../drm/amd/display/dc/dpp/dcn30/dcn30_dpp.h | 4 + .../drm/amd/display/dc/dpp/dcn35/dcn35_dpp.c | 69 ++++- .../drm/amd/display/dc/dpp/dcn35/dcn35_dpp.h | 9 +- drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 8 +- .../gpu/drm/amd/display/dc/dsc/rc_calc_dpi.c | 7 +- .../dc/gpio/dcn21/hw_translate_dcn21.c | 13 - .../amd/display/dc/hwss/dce110/dce110_hwseq.c | 6 +- .../amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 32 +-- .../amd/display/dc/hwss/dcn20/dcn20_init.c | 1 + .../amd/display/dc/hwss/dcn30/dcn30_hwseq.c | 6 +- .../amd/display/dc/hwss/dcn31/dcn31_hwseq.c | 2 +- .../amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 2 +- .../amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 44 ++- .../amd/display/dc/hwss/dcn35/dcn35_hwseq.h | 2 + .../amd/display/dc/hwss/dcn35/dcn35_init.c | 1 + .../amd/display/dc/hwss/dcn351/dcn351_init.c | 1 + .../drm/amd/display/dc/hwss/hw_sequencer.h | 2 +- .../display/dc/hwss/hw_sequencer_private.h | 4 + .../gpu/drm/amd/display/dc/inc/core_types.h | 3 + .../gpu/drm/amd/display/dc/inc/dcn_calcs.h | 2 +- .../amd/display/dc/inc/hw/clk_mgr_internal.h | 2 +- drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h | 4 + .../gpu/drm/amd/display/dc/inc/hw/hw_shared.h | 1 + drivers/gpu/drm/amd/display/dc/inc/hw/optc.h | 2 + drivers/gpu/drm/amd/display/dc/inc/link.h | 2 +- .../display/dc/link/accessories/link_dp_cts.c | 2 +- .../gpu/drm/amd/display/dc/link/link_dpms.c | 2 +- .../dc/link/protocols/link_dp_dpia_bw.c | 4 +- .../dc/link/protocols/link_dp_training_dpia.c | 4 +- .../link/protocols/link_edp_panel_control.c | 7 +- .../link/protocols/link_edp_panel_control.h | 2 +- .../amd/display/dc/optc/dcn10/dcn10_optc.c | 3 + .../gpu/drm/amd/display/dc/resource/Makefile | 6 - .../dc/resource/dce112/dce112_resource.c | 2 - .../dc/resource/dce120/dce120_resource.c | 2 +- .../dc/resource/dcn30/dcn30_resource.c | 2 +- .../dc/resource/dcn31/dcn31_resource.c | 2 +- .../dc/resource/dcn316/dcn316_resource.c | 2 +- .../dc/resource/dcn32/dcn32_resource.c | 86 +++++- .../dc/resource/dcn321/dcn321_resource.c | 12 +- .../dc/resource/dcn35/dcn35_resource.c | 8 +- .../dc/resource/dcn351/dcn351_resource.c | 6 +- drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 17 +- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 6 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn20.c | 1 + .../gpu/drm/amd/display/dmub/src/dmub_dcn31.c | 1 + .../gpu/drm/amd/display/dmub/src/dmub_dcn32.c | 2 + .../gpu/drm/amd/display/dmub/src/dmub_dcn35.c | 1 + .../drm/amd/display/include/grph_object_id.h | 4 +- .../amd/display/modules/color/color_gamma.c | 2 +- .../display/modules/hdcp/hdcp2_execution.c | 2 +- .../include/asic_reg/dcn/dcn_3_0_0_offset.h | 24 ++ .../include/asic_reg/dcn/dcn_3_0_0_sh_mask.h | 9 + .../include/asic_reg/dcn/dcn_3_0_2_offset.h | 20 ++ .../include/asic_reg/dcn/dcn_3_0_2_sh_mask.h | 8 + .../include/asic_reg/dcn/dcn_3_0_3_offset.h | 28 ++ .../include/asic_reg/dcn/dcn_3_0_3_sh_mask.h | 18 ++ .../include/asic_reg/dcn/dcn_3_1_2_offset.h | 4 + .../include/asic_reg/dcn/dcn_3_1_2_sh_mask.h | 19 ++ .../include/asic_reg/dcn/dcn_3_2_0_offset.h | 60 ++++ .../include/asic_reg/dcn/dcn_3_2_0_sh_mask.h | 27 ++ .../asic_reg/dpcs/dpcs_3_0_3_sh_mask.h | 4 +- .../include/asic_reg/dpcs/dpcs_4_2_0_offset.h | 10 + 125 files changed, 1354 insertions(+), 464 deletions(-)
Signature · 1 line
2.34.1
PATCH 2/43 drm/amd/display: Add timing pixel encoding for mst mode validation
From: Hersen Wu <[email protected]>
[Why] Mode pbn is not calculated correctly because timing pixel encoding is not checked within convert_dc_color_depth_into_bpc.
[How] Get mode kbps from dc_bandwidth_in_kbps_from_timing, then calculate pbn by kbps_to_peak_pbn.
--- .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 35 ++++++++++++++++--- 1 file changed, 30 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +30 -5
@@ -1601,7 +1601,7 @@ enum dc_status dm_dp_mst_is_port_support_mode(struct amdgpu_dm_connector *aconnector, struct dc_stream_state *stream) { - int bpp, pbn, branch_max_throughput_mps = 0; + int pbn, branch_max_throughput_mps = 0;struct dc_link_settings cur_link_settings;unsigned int end_to_end_bw_in_kbps =0 ;unsigned int upper_link_bw_in_kbps =0 , down_link_bw_in_kbps =0 ;
@@ -1651,11 +1651,36 @@ enum dc_status dm_dp_mst_is_port_support_mode( } } }else { -/* check if mode could be supported within full_pbn */ - bpp =convert_dc_color_depth_into_bpc (stream->timing.display_color_depth) *3 ; - pbn =drm_dp_calc_pbn_mode (stream->timing.pix_clk_100hz /10 , bpp <<4 ); -if (pbn > aconnector->mst_output_port->full_pbn) +/* Check if mode could be supported within max slot +* number of current mst link and full_pbn of mst links. +*/ +int pbn_div, slot_num, max_slot_num; +enum dc_link_encoding_format link_encoding; +uint16_t fec_overhead_multiplier_x1000 = +get_fec_overhead_multiplier (stream->link); +uint32_t stream_kbps = +dc_bandwidth_in_kbps_from_timing (&stream->timing, +dc_link_get_highest_encoding_format (stream->link)); + + pbn =kbps_to_peak_pbn (stream_kbps, fec_overhead_multiplier_x1000); + pbn_div =dm_mst_get_pbn_divider (stream->link); + slot_num =DIV_ROUND_UP (pbn, pbn_div); + + link_encoding =dc_link_get_highest_encoding_format (stream->link); +if (link_encoding == DC_LINK_ENCODING_DP_8b_10b) + max_slot_num =63 ; +else if (link_encoding == DC_LINK_ENCODING_DP_128b_132b) + max_slot_num =64 ; +else { +DRM_DEBUG_DRIVER ("Invalid link encoding format\n" );return DC_FAIL_BANDWIDTH_VALIDATE ; + } + +if (slot_num > max_slot_num || + pbn > aconnector->mst_output_port->full_pbn) { +DRM_DEBUG_DRIVER ("Mode can not be supported within mst links!" ); +return DC_FAIL_BANDWIDTH_VALIDATE ; + } }/* check is mst dsc output bandwidth branch_overall_throughput_0_mps */
Signature · 1 line
2.34.1
PATCH 4/43 drm/amd/display: optimize dml2 pipe resource allocation order
In reply to [email protected]From: Wenjing Liu <[email protected]>
[why]
There could be cases that we are transition from MPC to ODM combine. In this case if we map pipes before unmapping MPC pipes, we might temporarly run out of pipes. The change reorders pipe resource allocation. So we unmapping pipes before mapping new pipes.
--- .../gpu/drm/amd/display/dc/core/dc_resource.c | 2 + .../display/dc/dml2/dml2_dc_resource_mgmt.c | 126 ++++++++++++------ .../amd/display/dc/dml2/dml2_internal_types.h | 11 ++ .../drm/amd/display/dc/dml2/dml2_wrapper.h | 2 + 4 files changed, 97 insertions(+), 44 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +2 -0
@@ -5052,7 +5052,9 @@ void resource_init_common_dml2_callbacks(struct dc *dc, struct dml2_configuratio dml2_options->callbacks.update_pipes_for_stream_with_slice_count = &resource_update_pipes_for_stream_with_slice_count; dml2_options->callbacks.update_pipes_for_plane_with_slice_count = &resource_update_pipes_for_plane_with_slice_count; dml2_options->callbacks.get_mpc_slice_index = &resource_get_mpc_slice_index; + dml2_options->callbacks.get_mpc_slice_count = &resource_get_mpc_slice_count; dml2_options->callbacks.get_odm_slice_index = &resource_get_odm_slice_index; + dml2_options->callbacks.get_odm_slice_count = &resource_get_odm_slice_count; dml2_options->callbacks.get_opp_head = &resource_get_opp_head; dml2_options->callbacks.get_otg_master_for_stream = &resource_get_otg_master_for_stream; dml2_options->callbacks.get_opp_heads_for_otg_master = &resource_get_opp_heads_for_otg_master;
drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c +82 -44
195 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml2/dml2_internal_types.h +11 -0
@@ -109,10 +109,21 @@ enum dml2_architecture { dml2_architecture_20, }; +struct dml2_pipe_combine_factor { +unsigned int source; +unsigned int target; +}; + +struct dml2_pipe_combine_scratch { +struct dml2_pipe_combine_factor odm_factors[MAX_PIPES ]; +struct dml2_pipe_combine_factor mpc_factors[MAX_PIPES ][MAX_PIPES ]; +}; + struct dml2_context { enum dml2_architecture architecture; struct dml2_configuration_options config; struct dml2_helper_det_policy_scratch det_helper_scratch; + struct dml2_pipe_combine_scratch pipe_combine_scratch; union { struct { struct display_mode_lib_st dml_core_ctx;
drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h +2 -0
@@ -86,7 +86,9 @@ struct dml2_dc_callbacks {const struct dc_plane_state *plane, int slice_count);int (*get_odm_slice_index)(const struct pipe_ctx *opp_head); +int (*get_odm_slice_count)(const struct pipe_ctx *opp_head);int (*get_mpc_slice_index)(const struct pipe_ctx *dpp_pipe); +int (*get_mpc_slice_count)(const struct pipe_ctx *dpp_pipe);struct pipe_ctx *(*get_opp_head)(const struct pipe_ctx *pipe_ctx); struct pipe_ctx *(*get_otg_master_for_stream)( struct resource_context *res_ctx,
Signature · 1 line
2.34.1
PATCH 1/43 drm/amd/display: Fix compiler redefinition warnings for certain configs
In reply to [email protected]From: Mounika Adhuri <[email protected]>
[why & how]
Modified definitions of 1 function and 2 structs to remove warnings on certain specific compiler configurations due to redefinition.
--- drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c | 4 ++-- drivers/gpu/drm/amd/display/include/grph_object_id.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +2 -2
@@ -249,7 +249,7 @@ static bool dce110_enable_display_power_gating(return false; } -static void build_prescale_params (struct ipp_prescale_params *prescale_params, +static void dce110_prescale_params (struct ipp_prescale_params *prescale_params,const struct dc_plane_state *plane_state) { prescale_params->mode =IPP_PRESCALE_MODE_FIXED_UNSIGNED ;
@@ -291,7 +291,7 @@ dce110_set_input_transfer_func(struct dc *dc, struct pipe_ctx *pipe_ctx, tf = &plane_state->in_transfer_func; -build_prescale_params (&prescale_params, plane_state); +dce110_prescale_params (&prescale_params, plane_state); ipp->funcs->ipp_program_prescale (ipp, &prescale_params); if (!plane_state->gamma_correction.is_identity &&
drivers/gpu/drm/amd/display/include/grph_object_id.h +2 -2
@@ -226,8 +226,8 @@ enum dp_alt_mode {struct graphics_object_id {uint32_t id:8 ; -uint32_t enum_id:4 ; -uint32_t type:4 ; +enum object_enum_id enum_id; +enum object_type type;uint32_t reserved:16 ;/* for padding. total size should be u32 */ };
Signature · 1 line
2.34.1
PATCH 3/43 drm/amd/display: fix underflow in some two display subvp/non-subvp configs
In reply to [email protected]From: Samson Tam <[email protected]>
[Why]
In two display configuration, switching between subvp and non-subvp
may cause underflow because it moves an existing pipe between displays
[How]
Create helper function for applying pipe split flags Apply pipe split flags prior to deciding on subvp
During subvp check, do not merge pipes, so it can retain previous
pipe configuration
Add check for prev odm pipe in subvp check
For single display subvp case, use same odm policy for phantom pipes
as main subvp pipe
--- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 259 ++++++++++-------- .../dc/resource/dcn32/dcn32_resource.c | 70 ++++- 2 files changed, 199 insertions(+), 130 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +138 -121
@@ -180,6 +180,9 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_2_soc = { .urgent_latency_adjustment_fabric_clock_reference_mhz = 3000, }; +static bool dcn32_apply_merge_split_flags_helper (struct dc *dc,struct dc_state *context, +bool *repopulate_pipes,int *split,bool *merge); +void dcn32_build_wm_range_table_fpu (struct clk_mgr_internal *clk_mgr) {/* defaults */
@@ -622,7 +625,7 @@ static bool dcn32_assign_subvp_pipe(struct dc *dc,* to combine this with SubVP can cause issues with the scheduling). * - Not TMZ surface */ - if (pipe->plane_state && !pipe->top_pipe && !dcn32_is_center_timing(pipe) && + if (pipe->plane_state && !pipe->top_pipe && !pipe->prev_odm_pipe && !dcn32_is_center_timing(pipe) && !(pipe->stream->timing.pix_clk_100hz / 10000 > DCN3_2_MAX_SUBVP_PIXEL_RATE_MHZ) && (!dcn32_is_psr_capable(pipe) || (context->stream_count == 1 && dc->caps.dmub_caps.subvp_psr)) && dc_state_get_pipe_subvp_type(context, pipe) == SUBVP_NONE &&
@@ -1425,13 +1428,14 @@ static bool is_test_pattern_enabled(return false; } -static void dcn32_full_validate_bw_helper (struct dc *dc, +static bool dcn32_full_validate_bw_helper (struct dc *dc,struct dc_state *context,display_e2e_pipe_params_st *pipes,int *vlevel,int *split,bool *merge, -int *pipe_cnt) +int *pipe_cnt, +bool *repopulate_pipes) {struct vba_vars_st *vba = &context->bw_ctx.dml.vba;unsigned int dc_pipe_idx =0 ;
@@ -1461,6 +1465,12 @@ static void dcn32_full_validate_bw_helper(struct dc *dc, vba->VoltageLevel = *vlevel; } +/* Apply split and merge flags before checking for subvp */ +if (!dcn32_apply_merge_split_flags_helper (dc, context, repopulate_pipes, split, merge)) +return false; +memset (split,0 ,MAX_PIPES *sizeof (int )); +memset (merge,0 ,MAX_PIPES *sizeof (bool )); +/* Conditions for setting up phantom pipes for SubVP: * 1. Not force disable SubVP * 2. Full update (i.e. !fast_validate)
@@ -1475,19 +1485,7 @@ static void dcn32_full_validate_bw_helper(struct dc *dc, vba->DRAMClockChangeSupport[*vlevel][vba->maxMpcComb] == dm_dram_clock_change_unsupported || dc->debug.force_subvp_mclk_switch)) { -dcn32_merge_pipes_for_subvp (dc, context); -memset (merge,0 ,MAX_PIPES *sizeof (bool )); - vlevel_temp = *vlevel; -/* to re-initialize viewport after the pipe merge */ -for (i =0 ; i < dc->res_pool->pipe_count; i++) { -struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i]; - -if (!pipe_ctx->plane_state || !pipe_ctx->stream) -continue ; - -resource_build_scaling_params (pipe_ctx); - }while (!found_supported_config &&dcn32_enough_pipes_for_subvp (dc, context) &&dcn32_assign_subvp_pipe (dc, context, &dc_pipe_idx)) {
@@ -1576,8 +1574,6 @@ static void dcn32_full_validate_bw_helper(struct dc *dc,* add phantom pipes. If pipe split (ODM / MPC) is required, both the main * and phantom pipes will be split in the regular pipe splitting sequence. */ -memset (split,0 ,MAX_PIPES *sizeof (int )); -memset (merge,0 ,MAX_PIPES *sizeof (bool )); *vlevel =dcn20_validate_apply_pipe_split_flags (dc, context, *vlevel, split, merge); vba->VoltageLevel = *vlevel;// Note: We can't apply the phantom pipes to hardware at this time. We have to wait
@@ -1590,6 +1586,7 @@ static void dcn32_full_validate_bw_helper(struct dc *dc,try_odm_power_optimization_and_revalidate ( dc, context, pipes, split, merge, vlevel, *pipe_cnt); +return true; }static bool is_dtbclk_required (struct dc *dc,struct dc_state *context)
@@ -1929,106 +1926,23 @@ static bool dcn32_split_stream_for_mpc_or_odm(return true; } -bool dcn32_internal_validate_bw (struct dc *dc, -struct dc_state *context, -display_e2e_pipe_params_st *pipes, -int *pipe_cnt_out, -int *vlevel_out, -bool fast_validate) +static bool dcn32_apply_merge_split_flags_helper ( +struct dc *dc, +struct dc_state *context, +bool *repopulate_pipes, +int *split, +bool *merge) { -bool out = false; -bool repopulate_pipes = false; -int split[MAX_PIPES ] = {0 }; -bool merge[MAX_PIPES ] = { false }; +int i, pipe_idx;bool newly_split[MAX_PIPES ] = { false }; -int pipe_cnt, i, pipe_idx; -int vlevel = context->bw_ctx.dml.soc.num_states;struct vba_vars_st *vba = &context->bw_ctx.dml.vba; -dc_assert_fp_enabled (); - -ASSERT (pipes); -if (!pipes) -return false; - -// For each full update, remove all existing phantom pipes first -dc_state_remove_phantom_streams_and_planes (dc, context); -dc_state_release_phantom_streams_and_planes (dc, context); - - dc->res_pool->funcs->update_soc_for_wm_a (dc, context); - - pipe_cnt = dc->res_pool->funcs->populate_dml_pipes (dc, context, pipes, fast_validate); - -if (!pipe_cnt) { - out = true; - goto validate_out; - } - -dml_log_pipe_params (&context->bw_ctx.dml, pipes, pipe_cnt); - context->bw_ctx.dml.soc.max_vratio_pre =dcn32_determine_max_vratio_prefetch (dc, context); - -if (!fast_validate) -dcn32_full_validate_bw_helper (dc, context, pipes, &vlevel, split, merge, &pipe_cnt); - -if (fast_validate || - (dc->debug.dml_disallow_alternate_prefetch_modes && - (vlevel == context->bw_ctx.dml.soc.num_states || - vba->DRAMClockChangeSupport[vlevel][vba->maxMpcComb] == dm_dram_clock_change_unsupported))) { -/* -* If dml_disallow_alternate_prefetch_modes is false, then we have already -* tried alternate prefetch modes during full validation. -* -* If mode is unsupported or there is no p-state support, then -* fall back to favouring voltage. -* -* If Prefetch mode 0 failed for this config, or passed with Max UCLK, then try -* to support with Prefetch mode 1 (dm_prefetch_support_fclk_and_stutter == 2) -*/ - context->bw_ctx.dml.soc.allow_for_pstate_or_stutter_in_vblank_final = - dm_prefetch_support_none; - - context->bw_ctx.dml.validate_max_state = fast_validate; - vlevel =dml_get_voltage_level (&context->bw_ctx.dml, pipes, pipe_cnt); - - context->bw_ctx.dml.validate_max_state = false; - -if (vlevel < context->bw_ctx.dml.soc.num_states) { -memset (split,0 ,sizeof (split)); -memset (merge,0 ,sizeof (merge)); - vlevel =dcn20_validate_apply_pipe_split_flags (dc, context, vlevel, split, merge); -// dcn20_validate_apply_pipe_split_flags can modify voltage level outside of DML - vba->VoltageLevel = vlevel; - } - } - -dml_log_mode_support_params (&context->bw_ctx.dml); - -if (vlevel == context->bw_ctx.dml.soc.num_states) - goto validate_fail; - -for (i =0 , pipe_idx =0 ; i < dc->res_pool->pipe_count; i++) { -struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i]; -struct pipe_ctx *mpo_pipe = pipe->bottom_pipe; - -if (!pipe->stream) -continue ; - -if (vba->ODMCombineEnabled[vba->pipe_plane[pipe_idx]] != dm_odm_combine_mode_disabled - && !dc->config.enable_windowed_mpo_odm - && pipe->plane_state && mpo_pipe - &&memcmp (&mpo_pipe->plane_state->clip_rect, - &pipe->stream->src, -sizeof (struct rect )) !=0 ) { -ASSERT (mpo_pipe->plane_state != pipe->plane_state); - goto validate_fail; - } - pipe_idx++; - } -if (dc->config.enable_windowed_mpo_odm) { - repopulate_pipes =update_pipes_with_split_flags ( - dc, context, vba, split, merge); +if (update_pipes_with_split_flags ( + dc, context, vba, split, merge)) + *repopulate_pipes = true; }else { +/* the code below will be removed once windowed mpo odm is fully * enabled. */
@@ -2085,7 +1999,7 @@ bool dcn32_internal_validate_bw(struct dc *dc,memset (&pipe->plane_res,0 ,sizeof (pipe->plane_res));memset (&pipe->stream_res,0 ,sizeof (pipe->stream_res));memset (&pipe->link_res,0 ,sizeof (pipe->link_res)); - repopulate_pipes = true; + *repopulate_pipes = true; }else if (pipe->top_pipe && pipe->top_pipe->plane_state == pipe->plane_state) {struct pipe_ctx *top_pipe = pipe->top_pipe;struct pipe_ctx *bottom_pipe = pipe->bottom_pipe;
@@ -2101,7 +2015,7 @@ bool dcn32_internal_validate_bw(struct dc *dc,memset (&pipe->plane_res,0 ,sizeof (pipe->plane_res));memset (&pipe->stream_res,0 ,sizeof (pipe->stream_res));memset (&pipe->link_res,0 ,sizeof (pipe->link_res)); - repopulate_pipes = true; + *repopulate_pipes = true; }else ASSERT (0 );/* Should never try to merge master pipe */
@@ -2140,15 +2054,15 @@ bool dcn32_internal_validate_bw(struct dc *dc, hsplit_pipe =dcn32_find_split_pipe (dc, context, old_index);ASSERT (hsplit_pipe);if (!hsplit_pipe) - goto validate_fail; +return false;if (!dcn32_split_stream_for_mpc_or_odm ( dc, &context->res_ctx, pipe, hsplit_pipe, odm)) - goto validate_fail; +return false; newly_split[hsplit_pipe->pipe_idx] = true; - repopulate_pipes = true; + *repopulate_pipes = true; }if (split[i] ==4 ) {struct pipe_ctx *pipe_4to1;
@@ -2163,11 +2077,11 @@ bool dcn32_internal_validate_bw(struct dc *dc, pipe_4to1 =dcn32_find_split_pipe (dc, context, old_index);ASSERT (pipe_4to1);if (!pipe_4to1) - goto validate_fail; +return false;if (!dcn32_split_stream_for_mpc_or_odm ( dc, &context->res_ctx, pipe, pipe_4to1, odm)) - goto validate_fail; +return false; newly_split[pipe_4to1->pipe_idx] = true; if (odm && old_pipe->next_odm_pipe && old_pipe->next_odm_pipe->next_odm_pipe
@@ -2182,11 +2096,11 @@ bool dcn32_internal_validate_bw(struct dc *dc, pipe_4to1 =dcn32_find_split_pipe (dc, context, old_index);ASSERT (pipe_4to1);if (!pipe_4to1) - goto validate_fail; +return false;if (!dcn32_split_stream_for_mpc_or_odm ( dc, &context->res_ctx, hsplit_pipe, pipe_4to1, odm)) - goto validate_fail; +return false; newly_split[pipe_4to1->pipe_idx] = true; }if (odm)
@@ -2198,10 +2112,113 @@ bool dcn32_internal_validate_bw(struct dc *dc,if (pipe->plane_state) {if (!resource_build_scaling_params (pipe)) - goto validate_fail; +return false; } } } +return true; +} + +bool dcn32_internal_validate_bw (struct dc *dc, +struct dc_state *context, +display_e2e_pipe_params_st *pipes, +int *pipe_cnt_out, +int *vlevel_out, +bool fast_validate) +{ +bool out = false; +bool repopulate_pipes = false; +int split[MAX_PIPES ] = {0 }; +bool merge[MAX_PIPES ] = { false }; +int pipe_cnt, i, pipe_idx; +int vlevel = context->bw_ctx.dml.soc.num_states; +struct vba_vars_st *vba = &context->bw_ctx.dml.vba; + +dc_assert_fp_enabled (); + +ASSERT (pipes); +if (!pipes) +return false; + +/* For each full update, remove all existing phantom pipes first */ +dc_state_remove_phantom_streams_and_planes (dc, context); +dc_state_release_phantom_streams_and_planes (dc, context); + + dc->res_pool->funcs->update_soc_for_wm_a (dc, context); + + pipe_cnt = dc->res_pool->funcs->populate_dml_pipes (dc, context, pipes, fast_validate); + +if (!pipe_cnt) { + out = true; + goto validate_out; + } + +dml_log_pipe_params (&context->bw_ctx.dml, pipes, pipe_cnt); + context->bw_ctx.dml.soc.max_vratio_pre =dcn32_determine_max_vratio_prefetch (dc, context); + +if (!fast_validate) { +if (!dcn32_full_validate_bw_helper (dc, context, pipes, &vlevel, split, merge, + &pipe_cnt, &repopulate_pipes)) + goto validate_fail; + } + +if (fast_validate || + (dc->debug.dml_disallow_alternate_prefetch_modes && + (vlevel == context->bw_ctx.dml.soc.num_states || + vba->DRAMClockChangeSupport[vlevel][vba->maxMpcComb] == dm_dram_clock_change_unsupported))) { +/* +* If dml_disallow_alternate_prefetch_modes is false, then we have already +* tried alternate prefetch modes during full validation. +* +* If mode is unsupported or there is no p-state support, then +* fall back to favouring voltage. +* +* If Prefetch mode 0 failed for this config, or passed with Max UCLK, then try +* to support with Prefetch mode 1 (dm_prefetch_support_fclk_and_stutter == 2) +*/ + context->bw_ctx.dml.soc.allow_for_pstate_or_stutter_in_vblank_final = + dm_prefetch_support_none; + + context->bw_ctx.dml.validate_max_state = fast_validate; + vlevel =dml_get_voltage_level (&context->bw_ctx.dml, pipes, pipe_cnt); + + context->bw_ctx.dml.validate_max_state = false; + +if (vlevel < context->bw_ctx.dml.soc.num_states) { +memset (split,0 ,sizeof (split)); +memset (merge,0 ,sizeof (merge)); + vlevel =dcn20_validate_apply_pipe_split_flags (dc, context, vlevel, split, merge); +/* dcn20_validate_apply_pipe_split_flags can modify voltage level outside of DML */ + vba->VoltageLevel = vlevel; + } + } + +dml_log_mode_support_params (&context->bw_ctx.dml); + +if (vlevel == context->bw_ctx.dml.soc.num_states) + goto validate_fail; + +for (i =0 , pipe_idx =0 ; i < dc->res_pool->pipe_count; i++) { +struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i]; +struct pipe_ctx *mpo_pipe = pipe->bottom_pipe; + +if (!pipe->stream) +continue ; + +if (vba->ODMCombineEnabled[vba->pipe_plane[pipe_idx]] != dm_odm_combine_mode_disabled + && !dc->config.enable_windowed_mpo_odm + && pipe->plane_state && mpo_pipe + &&memcmp (&mpo_pipe->plane_state->clip_rect, + &pipe->stream->src, +sizeof (struct rect )) !=0 ) { +ASSERT (mpo_pipe->plane_state != pipe->plane_state); + goto validate_fail; + } + pipe_idx++; + } + +if (!dcn32_apply_merge_split_flags_helper (dc, context, &repopulate_pipes, split, merge)) + goto validate_fail;/* Actual dsc count per stream dsc validation*/ if (!dcn20_validate_dsc (dc, context)) {
drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c +61 -9
89 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH 6/43 drm/amd/display: Decouple dcn35 and dcn351 dmub firmware
In reply to [email protected]From: Roman Li <[email protected]>
[Why]
dcn351 dmub fw was decoupled from dcn35.
[How]
Add dcn351 dmub fw load path.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +6 -1
@@ -148,6 +148,9 @@ MODULE_FIRMWARE(FIRMWARE_NAVI12_DMCU);#define FIRMWARE_DCN_35_DMUB "amdgpu/dcn_3_5_dmcub.bin"MODULE_FIRMWARE (FIRMWARE_DCN_35_DMUB ); +#define FIRMWARE_DCN_351_DMUB "amdgpu/dcn_3_5_1_dmcub.bin" +MODULE_FIRMWARE (FIRMWARE_DCN_351_DMUB ); +/* Number of bytes in PSP header for firmware. */ #define PSP_HEADER_BYTES 0x100
@@ -4820,9 +4823,11 @@ static int dm_init_microcode(struct amdgpu_device *adev) fw_name_dmub =FIRMWARE_DCN_V3_2_1_DMCUB ;break ;case IP_VERSION (3 ,5 ,0 ): -case IP_VERSION (3 ,5 ,1 ): fw_name_dmub =FIRMWARE_DCN_35_DMUB ;break ; +case IP_VERSION (3 ,5 ,1 ): + fw_name_dmub =FIRMWARE_DCN_351_DMUB ; +break ;default :/* ASIC doesn't support DMUB. */ return 0 ;
Signature · 1 line
2.34.1
PATCH 9/43 drm/amd/display: handle invalid connector indices
In reply to [email protected]From: Joshua Aberback <[email protected]>
[Why]
The function to count the number of valid connectors does not guarantee that the first n indices are valid, only that there exist n valid indices. When invalid indices are present, this results in later valid connectors being missed, as processing would end after checking n indices.
[How]
- count valid indices separately from total indices examined
- add explicit definition of MAX_LINKS
--- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c | 2 +- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c | 2 +- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c | 2 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 ++- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr_internal.h | 2 +- drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h | 1 + .../gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c | 4 ++-- 8 files changed, 10 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c +1 -1
@@ -503,7 +503,7 @@ static void dcn2_notify_link_rate_change(struct clk_mgr *clk_mgr_base, struct dc clk_mgr->cur_phyclk_req_table[link->link_index] = link->cur_link_settings.link_rate *LINK_RATE_REF_FREQ_IN_KHZ ; -for (i =0 ; i <MAX_PIPES *2 ; i++) { +for (i =0 ; i <MAX_LINKS ; i++) {if (clk_mgr->cur_phyclk_req_table[i] > max_phyclk_req) max_phyclk_req = clk_mgr->cur_phyclk_req_table[i]; }
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c +1 -1
@@ -548,7 +548,7 @@ static void rn_notify_link_rate_change(struct clk_mgr *clk_mgr_base, struct dc_l clk_mgr->cur_phyclk_req_table[link->link_index] = link->cur_link_settings.link_rate *LINK_RATE_REF_FREQ_IN_KHZ ; -for (i =0 ; i <MAX_PIPES *2 ; i++) { +for (i =0 ; i <MAX_LINKS ; i++) {if (clk_mgr->cur_phyclk_req_table[i] > max_phyclk_req) max_phyclk_req = clk_mgr->cur_phyclk_req_table[i]; }
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c +1 -1
@@ -474,7 +474,7 @@ static void dcn30_notify_link_rate_change(struct clk_mgr *clk_mgr_base, struct d clk_mgr->cur_phyclk_req_table[link->link_index] = link->cur_link_settings.link_rate *LINK_RATE_REF_FREQ_IN_KHZ ; -for (i =0 ; i <MAX_PIPES *2 ; i++) { +for (i =0 ; i <MAX_LINKS ; i++) {if (clk_mgr->cur_phyclk_req_table[i] > max_phyclk_req) max_phyclk_req = clk_mgr->cur_phyclk_req_table[i]; }
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -1
@@ -212,7 +212,8 @@ static bool create_links( connectors_num, num_virtual_links); -for (i =0 ; i < connectors_num; i++) { +// condition loop on link_count to allow skipping invalid indices +for (i =0 ; dc->link_count < connectors_num && i <MAX_LINKS ; i++) {struct link_init_data link_init_params = {0 };struct dc_link *link;
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -1327,7 +1327,7 @@ struct dc {struct dc_phy_addr_space_config vm_pa_config;uint8_t link_count; -struct dc_link *links[MAX_PIPES *2 ]; +struct dc_link *links[MAX_LINKS ];struct link_service *link_srv;struct dc_state *current_state;
drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr_internal.h +1 -1
@@ -349,7 +349,7 @@ struct clk_mgr_internal {enum dm_pp_clocks_state cur_min_clks_state;bool periodic_retraining_disabled; -unsigned int cur_phyclk_req_table[MAX_PIPES *2 ]; +unsigned int cur_phyclk_req_table[MAX_LINKS ];bool smu_present;void *wm_range_table;
drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h +1 -0
@@ -44,6 +44,7 @@*/ #define MAX_PIPES 6#define MAX_PHANTOM_PIPES (MAX_PIPES / 2) +#define MAX_LINKS (MAX_PIPES * 2)#define MAX_DIG_LINK_ENCODERS 7#define MAX_DWB_PIPES 1#define MAX_HPO_DP2_ENCODERS 4
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c +2 -2
@@ -166,7 +166,7 @@ static uint8_t get_lowest_dpia_index(struct dc_link *link)uint8_t idx =0xFF ;int i; -for (i =0 ; i <MAX_PIPES *2 ; ++i) { +for (i =0 ; i <MAX_LINKS ; ++i) {if (!dc_struct->links[i] || dc_struct->links[i]->ep_type !=DISPLAY_ENDPOINT_USB4_DPIA )
@@ -196,7 +196,7 @@ static int get_host_router_total_dp_tunnel_bw(const struct dc *dc, uint8_t hr_instruct dc_link *link_dpia_primary, *link_dpia_secondary;int total_bw =0 ; -for (uint8_t i =0 ; i < (MAX_PIPES *2 ) -1 ; ++i) { +for (uint8_t i =0 ; i <MAX_LINKS -1 ; ++i) {if (!dc->links[i] || dc->links[i]->ep_type !=DISPLAY_ENDPOINT_USB4_DPIA )continue ;
Signature · 1 line
2.34.1
PATCH 7/43 drm/amd/display: Expand supported Replay residency mode
In reply to [email protected]From: Leon Huang <[email protected]>
[Why]
Dmub provides several Replay residency calculation methods, but current interface only supports either ALPM or PHY mode
[How]
Modify the interface for supporting different types of Replay residency calculation.
--- drivers/gpu/drm/amd/display/dc/inc/link.h | 2 +- .../amd/display/dc/link/protocols/link_edp_panel_control.c | 7 +++++-- .../amd/display/dc/link/protocols/link_edp_panel_control.h | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/inc/link.h +1 -1
@@ -288,7 +288,7 @@ struct link_service { struct dc_link *link, uint32_t coasting_vtotal);bool (*edp_replay_residency)(const struct dc_link *link,unsigned int *residency,const bool is_start, -const bool is_alpm); +const enum pr_residency_mode mode);bool (*edp_set_replay_power_opt_and_coasting_vtotal)(struct dc_link *link,const unsigned int *power_opts,uint32_t coasting_vtotal);
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c +5 -2
@@ -1056,7 +1056,7 @@ bool edp_set_coasting_vtotal(struct dc_link *link, uint32_t coasting_vtotal) }bool edp_replay_residency (const struct dc_link *link, -unsigned int *residency,const bool is_start,const bool is_alpm) +unsigned int *residency,const bool is_start,const enum pr_residency_mode mode) {struct dc *dc = link->ctx->dc;struct dmub_replay *replay = dc->res_pool->replay;
@@ -1065,8 +1065,11 @@ bool edp_replay_residency(const struct dc_link *link,if (!dc_get_edp_link_panel_inst (dc, link, &panel_inst))return false; +if (!residency) +return false; +if (replay !=NULL && link->replay_settings.replay_feature_enabled) - replay->funcs->replay_residency (replay, panel_inst, residency, is_start, is_alpm); + replay->funcs->replay_residency (replay, panel_inst, residency, is_start, mode);else *residency =0 ;
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.h +1 -1
@@ -61,7 +61,7 @@ bool edp_send_replay_cmd(struct dc_link *link, union dmub_replay_cmd_set *cmd_data);bool edp_set_coasting_vtotal (struct dc_link *link,uint32_t coasting_vtotal);bool edp_replay_residency (const struct dc_link *link, -unsigned int *residency,const bool is_start,const bool is_alpm); +unsigned int *residency,const bool is_start,const enum pr_residency_mode mode);bool edp_get_replay_state (const struct dc_link *link,uint64_t *state);bool edp_set_replay_power_opt_and_coasting_vtotal (struct dc_link *link,const unsigned int *power_opts,uint32_t coasting_vtotal);
Signature · 1 line
2.34.1
PATCH 5/43 drm/amd/display: Toggle additional RCO options in DCN35
In reply to [email protected]From: Daniel Miess <[email protected]>
[Why]
With root clock optimization now enabled for DCN35 there are still RCO registers still not being toggled
[How]
Add in logic to toggle RCO registers for DPPCLK, DPSTREAMCLK and DSCCLK
--- drivers/gpu/drm/amd/display/dc/dc.h | 1 + .../gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c | 207 +++++++++++++++++- .../drm/amd/display/dc/dpp/dcn10/dcn10_dpp.h | 3 +- .../drm/amd/display/dc/dpp/dcn35/dcn35_dpp.c | 69 +++++- .../drm/amd/display/dc/dpp/dcn35/dcn35_dpp.h | 9 +- .../amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 28 +++ .../amd/display/dc/hwss/dcn35/dcn35_hwseq.h | 2 + .../amd/display/dc/hwss/dcn35/dcn35_init.c | 1 + .../display/dc/hwss/hw_sequencer_private.h | 4 + drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h | 4 + 10 files changed, 314 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -695,6 +695,7 @@ enum pg_hw_pipe_resources {PG_MPCC ,PG_OPP ,PG_OPTC , +PG_DPSTREAM , PG_HW_PIPE_RESOURCES_NUM_ELEMENT };
drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c +200 -7
500 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp.h +2 -1
@@ -1090,7 +1090,8 @@type DPP_CLOCK_ENABLE ; \type CM_HDR_MULT_COEF ; \type CUR0_FP_BIAS ; \ -type CUR0_FP_SCALE ; +type CUR0_FP_SCALE ;\ +type DISPCLK_R_GATE_DISABLE ;struct dcn_dpp_shift {TF_REG_FIELD_LIST (uint8_t )
drivers/gpu/drm/amd/display/dc/dpp/dcn35/dcn35_dpp.c +64 -5
78 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dpp/dcn35/dcn35_dpp.h +8 -1
@@ -31,7 +31,9 @@#define DPP_REG_LIST_SH_MASK_DCN35 (mask_sh) \ DPP_REG_LIST_SH_MASK_DCN30_COMMON(mask_sh), \ - TF_SF(DPP_TOP0_DPP_CONTROL, DPP_FGCG_REP_DIS, mask_sh) + TF_SF(DPP_TOP0_DPP_CONTROL, DPP_FGCG_REP_DIS, mask_sh), \ + TF_SF(DPP_TOP0_DPP_CONTROL, DPP_FGCG_REP_DIS, mask_sh), \ + TF_SF(DPP_TOP0_DPP_CONTROL, DISPCLK_R_GATE_DISABLE, mask_sh)#define DPP_REG_FIELD_LIST_DCN35 (type) \ struct { \
@@ -47,6 +49,11 @@ struct dcn35_dpp_mask {DPP_REG_FIELD_LIST_DCN35 (uint32_t); }; +void dpp35_dppclk_control ( +struct dpp *dpp_base, +bool dppclk_div, +bool enable); + bool dpp35_construct(struct dcn3_dpp *dpp3, struct dc_context *ctx, uint32_t inst, const struct dcn3_dpp_registers *tf_regs, const struct dcn35_dpp_shift *tf_shift,
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +28 -0
@@ -495,6 +495,17 @@ void dcn35_dpp_root_clock_control(struct dce_hwseq *hws, unsigned int dpp_inst, } } +void dcn35_dpstream_root_clock_control (struct dce_hwseq *hws,unsigned int dp_hpo_inst,bool clock_on) +{ +if (!hws->ctx->dc->debug.root_clock_optimization.bits.dpstream) +return ; + +if (hws->ctx->dc->res_pool->dccg->funcs->set_dpstreamclk_root_clock_gating) { + hws->ctx->dc->res_pool->dccg->funcs->set_dpstreamclk_root_clock_gating ( + hws->ctx->dc->res_pool->dccg, dp_hpo_inst, clock_on); + } +} + void dcn35_dsc_pg_control( struct dce_hwseq *hws, unsigned int dsc_inst,
@@ -1002,6 +1013,9 @@ void dcn35_calc_blocks_to_gate(struct dc *dc, struct dc_state *context,if (pipe_ctx->stream_res.opp) update_state->pg_pipe_res_update[PG_OPP ][pipe_ctx->stream_res.opp->inst] = false; + +if (pipe_ctx->stream_res.hpo_dp_stream_enc) + update_state->pg_pipe_res_update[PG_DPSTREAM ][pipe_ctx->stream_res.hpo_dp_stream_enc->inst] = false; }/*domain24 controls all the otg, mpc, opp, as long as one otg is still up, avoid enabling OTG PG*/ for (i =0 ; i < dc->res_pool->timing_generator_count; i++) {
@@ -1059,6 +1073,9 @@ void dcn35_calc_blocks_to_ungate(struct dc *dc, struct dc_state *context,if (j ==PG_OPTC && new_pipe->stream_res.tg) update_state->pg_pipe_res_update[j][new_pipe->stream_res.tg->inst] = true; + +if (j ==PG_DPSTREAM && new_pipe->stream_res.hpo_dp_stream_enc) + update_state->pg_pipe_res_update[j][new_pipe->stream_res.hpo_dp_stream_enc->inst] = true; } }else if (cur_pipe->plane_state == new_pipe->plane_state || cur_pipe == new_pipe) {
@@ -1088,6 +1105,11 @@ void dcn35_calc_blocks_to_ungate(struct dc *dc, struct dc_state *context, cur_pipe->stream_res.tg != new_pipe->stream_res.tg && new_pipe->stream_res.tg) update_state->pg_pipe_res_update[j][new_pipe->stream_res.tg->inst] = true; + +if (j ==PG_DPSTREAM && + cur_pipe->stream_res.hpo_dp_stream_enc != new_pipe->stream_res.hpo_dp_stream_enc && + new_pipe->stream_res.hpo_dp_stream_enc) + update_state->pg_pipe_res_update[j][new_pipe->stream_res.hpo_dp_stream_enc->inst] = true; } } }
@@ -1234,6 +1256,9 @@ void dcn35_root_clock_control(struct dc *dc,if (dc->hwseq->funcs.dpp_root_clock_control) dc->hwseq->funcs.dpp_root_clock_control (dc->hwseq, i, power_on); } +if (update_state->pg_pipe_res_update[PG_DPSTREAM ][i]) +if (dc->hwseq->funcs.dpstream_root_clock_control) + dc->hwseq->funcs.dpstream_root_clock_control (dc->hwseq, i, power_on); }for (i =0 ; i < dc->res_pool->res_cap->num_dsc; i++) {if (update_state->pg_pipe_res_update[PG_DSC ][i]) {
@@ -1254,6 +1279,9 @@ void dcn35_root_clock_control(struct dc *dc,if (dc->hwseq->funcs.dpp_root_clock_control) dc->hwseq->funcs.dpp_root_clock_control (dc->hwseq, i, power_on); } +if (update_state->pg_pipe_res_update[PG_DPSTREAM ][i]) +if (dc->hwseq->funcs.dpstream_root_clock_control) + dc->hwseq->funcs.dpstream_root_clock_control (dc->hwseq, i, power_on); } }
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h +2 -0
@@ -37,6 +37,8 @@ void dcn35_dsc_pg_control(struct dce_hwseq *hws, unsigned int dsc_inst, bool powvoid dcn35_dpp_root_clock_control (struct dce_hwseq *hws,unsigned int dpp_inst,bool clock_on); +void dcn35_dpstream_root_clock_control (struct dce_hwseq *hws,unsigned int dp_hpo_inst,bool clock_on); +void dcn35_enable_power_gating_plane (struct dce_hwseq *hws,bool enable);void dcn35_set_dmu_fgcg (struct dce_hwseq *hws,bool enable);
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c +1 -0
@@ -147,6 +147,7 @@ static const struct hwseq_private_funcs dcn35_private_funcs = {//.hubp_pg_control = dcn35_hubp_pg_control, .enable_power_gating_plane = dcn35_enable_power_gating_plane, .dpp_root_clock_control = dcn35_dpp_root_clock_control, + .dpstream_root_clock_control = dcn35_dpstream_root_clock_control, .program_all_writeback_pipes_in_tree = dcn30_program_all_writeback_pipes_in_tree, .update_odm = dcn35_update_odm, .set_hdr_multiplier = dcn10_set_hdr_multiplier,
drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer_private.h +4 -0
@@ -120,6 +120,10 @@ struct hwseq_private_funcs {struct dce_hwseq *hws, unsigned int dpp_inst, bool clock_on); +void (*dpstream_root_clock_control)( +struct dce_hwseq *hws, +unsigned int dpp_inst, +bool clock_on);void (*dpp_pg_control)(struct dce_hwseq *hws,unsigned int dpp_inst,bool power_on);
drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h +4 -0
@@ -106,6 +106,10 @@ struct dccg_funcs {void (*otg_drop_pixel)(struct dccg *dccg,uint32_t otg_inst);void (*dccg_init)(struct dccg *dccg); +void (*set_dpstreamclk_root_clock_gating)( +struct dccg *dccg, +int dp_hpo_inst, +bool enable); void (*set_dpstreamclk)( struct dccg *dccg,
Signature · 1 line
2.34.1
PATCH 10/43 drm/amd/display: Add dmub additional interface support for FAMS
In reply to [email protected]From: Dillon Varone <[email protected]>
[WHY&HOW]
Update dmub and driver interface for future FAMS revisions.
--- drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c | 2 +- drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.c | 2 +- drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 2 +- drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 2 +- drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 6 +++++- 5 files changed, 9 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c +1 -1
@@ -799,7 +799,7 @@ void dcn30_init_hw(struct dc *dc)// Get DMCUB capabilities dc_dmub_srv_query_caps_cmd (dc->ctx->dmub_srv); dc->caps.dmub_caps.psr = dc->ctx->dmub_srv->dmub->feature_caps.psr; - dc->caps.dmub_caps.mclk_sw = dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch; + dc->caps.dmub_caps.mclk_sw = dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch_ver; }void dcn30_set_avmute (struct pipe_ctx *pipe_ctx,bool enable)
drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.c +1 -1
@@ -273,7 +273,7 @@ void dcn31_init_hw(struct dc *dc)// Get DMCUB capabilities dc_dmub_srv_query_caps_cmd (dc->ctx->dmub_srv); dc->caps.dmub_caps.psr = dc->ctx->dmub_srv->dmub->feature_caps.psr; - dc->caps.dmub_caps.mclk_sw = dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch; + dc->caps.dmub_caps.mclk_sw = dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch_ver; } void dcn31_dsc_pg_control(
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c +1 -1
@@ -953,7 +953,7 @@ void dcn32_init_hw(struct dc *dc) dc->caps.dmub_caps.psr = dc->ctx->dmub_srv->dmub->feature_caps.psr; dc->caps.dmub_caps.subvp_psr = dc->ctx->dmub_srv->dmub->feature_caps.subvp_psr_support; dc->caps.dmub_caps.gecc_enable = dc->ctx->dmub_srv->dmub->feature_caps.gecc_enable; - dc->caps.dmub_caps.mclk_sw = dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch; + dc->caps.dmub_caps.mclk_sw = dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch_ver;if (dc->ctx->dmub_srv->dmub->fw_version <DMUB_FW_VERSION (7 ,0 ,35 )) {
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +1 -1
@@ -349,7 +349,7 @@ void dcn35_init_hw(struct dc *dc)if (dc->ctx->dmub_srv) {dc_dmub_srv_query_caps_cmd (dc->ctx->dmub_srv); dc->caps.dmub_caps.psr = dc->ctx->dmub_srv->dmub->feature_caps.psr; - dc->caps.dmub_caps.mclk_sw = dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch; + dc->caps.dmub_caps.mclk_sw = dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch_ver; }if (dc->res_pool->pg_cntl) {
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +5 -1
@@ -97,6 +97,9 @@/* Maximum number of planes on any ASIC. */ #define DMUB_MAX_PLANES 6 +/* Maximum number of phantom planes on any ASIC */ +#define DMUB_MAX_PHANTOM_PLANES (DMUB_MAX_PLANES) / 2 +/* Trace buffer offset for entry */ #define TRACE_BUFFER_ENTRY_OFFSET 16
@@ -466,7 +469,7 @@ struct dmub_feature_caps {* Max PSR version supported by FW. */ uint8_t psr; -uint8_t fw_assisted_mclk_switch; +uint8_t fw_assisted_mclk_switch_ver;uint8_t reserved[4 ];uint8_t subvp_psr_support;uint8_t gecc_enable;
@@ -4667,6 +4670,7 @@ union dmub_rb_cmd {* Definition of a DMUB_CMD__PSP_ASSR_ENABLE command. */ struct dmub_rb_cmd_assr_enable assr_enable; + };/**
Signature · 1 line
2.34.1
PATCH 12/43 drm/amd/display: Enable DTBCLK DTO earlier in the sequence
In reply to [email protected]From: Sung Joon Kim <[email protected]>
[why]
As per programming guide, we need to enable the virtual pixel clock via DTBCLK DTO and ungate the clock before we begin programming OPP/OPTC control registers. Otherwise, the double-buffered registers will be left pending until the clocks are enabled.
[how]
Move the DTBCLK DTO programming up to
where we do the legacy DP DTO programming.
--- .../amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-)
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c +16 -16
@@ -873,6 +873,22 @@ enum dc_status dcn20_enable_stream_timing(return DC_ERROR_UNEXPECTED ; } +if (dc->link_srv->dp_is_128b_132b_signal (pipe_ctx)) { +struct dccg *dccg = dc->res_pool->dccg; +struct timing_generator *tg = pipe_ctx->stream_res.tg; +struct dtbclk_dto_params dto_params = {0 }; + +if (dccg->funcs->set_dtbclk_p_src) + dccg->funcs->set_dtbclk_p_src (dccg,DTBCLK0 , tg->inst); + + dto_params.otg_inst = tg->inst; + dto_params.pixclk_khz = pipe_ctx->stream->timing.pix_clk_100hz /10 ; + dto_params.num_odm_segments =get_odm_segment_count (pipe_ctx); + dto_params.timing = &pipe_ctx->stream->timing; + dto_params.ref_dtbclk_khz = dc->clk_mgr->funcs->get_dtb_ref_clk_frequency (dc->clk_mgr); + dccg->funcs->set_dtbclk_dto (dccg, &dto_params); + } +if (dc_is_hdmi_tmds_signal (stream->signal)) { stream->link->phy_state.symclk_ref_cnts.otg =1 ;if (stream->link->phy_state.symclk_state ==SYMCLK_OFF_TX_OFF )
@@ -959,22 +975,6 @@ enum dc_status dcn20_enable_stream_timing( pipe_ctx->stream_res.tg->funcs->phantom_crtc_post_enable (pipe_ctx->stream_res.tg); } -if (dc->link_srv->dp_is_128b_132b_signal (pipe_ctx)) { -struct dccg *dccg = dc->res_pool->dccg; -struct timing_generator *tg = pipe_ctx->stream_res.tg; -struct dtbclk_dto_params dto_params = {0 }; - -if (dccg->funcs->set_dtbclk_p_src) - dccg->funcs->set_dtbclk_p_src (dccg,DTBCLK0 , tg->inst); - - dto_params.otg_inst = tg->inst; - dto_params.pixclk_khz = pipe_ctx->stream->timing.pix_clk_100hz /10 ; - dto_params.num_odm_segments =get_odm_segment_count (pipe_ctx); - dto_params.timing = &pipe_ctx->stream->timing; - dto_params.ref_dtbclk_khz = dc->clk_mgr->funcs->get_dtb_ref_clk_frequency (dc->clk_mgr); - dccg->funcs->set_dtbclk_dto (dccg, &dto_params); - } -return DC_OK ; }
Signature · 1 line
2.34.1
PATCH 13/43 drm/amd/display: Add dummy interface for tracing DCN32 SMU messages
In reply to [email protected]From: George Shen <[email protected]>
[Why/How]
Some issues may require a trace of the previous SMU messages from DC to understand the context and aid in debugging. Actual logging to be implemented when needed.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c | 8 ++++++++ .../display/dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.c | 5 ++++- .../display/dc/clk_mgr/dcn32/dcn32_clk_mgr_smu_msg.c | 9 +++++++++ drivers/gpu/drm/amd/display/dc/dm_services.h | 10 ++++++++++ 4 files changed, 31 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c +8 -0
@@ -52,4 +52,12 @@ void dm_perf_trace_timestamp(const char *func_name, unsigned int line, struct dc func_name, line); } +void dm_trace_smu_msg (uint32_t msg_id,uint32_t param_in,struct dc_context *ctx) +{ +} + +void dm_trace_smu_delay (uint32_t delay,struct dc_context *ctx) +{ +} +/**** power component interfaces ****/
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.c +4 -1
@@ -54,6 +54,7 @@*/ static uint32_t dcn30_smu_wait_for_response (struct clk_mgr_internal *clk_mgr,unsigned int delay_us,unsigned int max_retries) { +const uint32_t initial_max_retries = max_retries;uint32_t reg =0 ; do {
@@ -69,7 +70,7 @@ static uint32_t dcn30_smu_wait_for_response(struct clk_mgr_internal *clk_mgr, un/* handle DALSMC_Result_CmdRejectedBusy? */ -/* Log? */ +TRACE_SMU_DELAY (delay_us * (initial_max_retries - max_retries), clk_mgr->base.ctx);return reg; }
@@ -89,6 +90,8 @@ static bool dcn30_smu_send_msg_with_param(struct clk_mgr_internal *clk_mgr, uint/* Trigger the message transaction by writing the message ID */ REG_WRITE (DAL_MSG_REG , msg_id); +TRACE_SMU_MSG (msg_id, param_in, clk_mgr->base.ctx); + result =dcn30_smu_wait_for_response (clk_mgr,10 ,200000 );if (IS_SMU_TIMEOUT (result)) {
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr_smu_msg.c +9 -0
@@ -49,6 +49,7 @@*/ static uint32_t dcn32_smu_wait_for_response (struct clk_mgr_internal *clk_mgr,unsigned int delay_us,unsigned int max_retries) { +const uint32_t initial_max_retries = max_retries;uint32_t reg =0 ; do {
@@ -62,6 +63,8 @@ static uint32_t dcn32_smu_wait_for_response(struct clk_mgr_internal *clk_mgr, unudelay (delay_us); }while (max_retries--); +TRACE_SMU_DELAY (delay_us * (initial_max_retries - max_retries), clk_mgr->base.ctx); +return reg; }
@@ -79,6 +82,8 @@ static bool dcn32_smu_send_msg_with_param(struct clk_mgr_internal *clk_mgr, uint/* Trigger the message transaction by writing the message ID */ REG_WRITE (DAL_MSG_REG , msg_id); +TRACE_SMU_MSG (msg_id, param_in, clk_mgr->base.ctx); +/* Wait for response */ if (dcn32_smu_wait_for_response (clk_mgr,10 ,200000 ) == DALSMC_Result_OK) {if (param_out)
@@ -115,6 +120,8 @@ static uint32_t dcn32_smu_wait_for_response_delay(struct clk_mgr_internal *clk_m *total_delay_us += delay_us; }while (max_retries--); +TRACE_SMU_DELAY (*total_delay_us, clk_mgr->base.ctx); +return reg; }
@@ -135,6 +142,8 @@ static bool dcn32_smu_send_msg_with_param_delay(struct clk_mgr_internal *clk_mgr/* Trigger the message transaction by writing the message ID */ REG_WRITE (DAL_MSG_REG , msg_id); +TRACE_SMU_MSG (msg_id, param_in, clk_mgr->base.ctx); +/* Wait for response */ if (dcn32_smu_wait_for_response_delay (clk_mgr,10 ,200000 , &delay2_us) == DALSMC_Result_OK) {if (param_out)
drivers/gpu/drm/amd/display/dc/dm_services.h +10 -0
@@ -274,6 +274,16 @@ void dm_perf_trace_timestamp(const char *func_name, unsigned int line, struct dc#define PERF_TRACE () dm_perf_trace_timestamp(__func__, __LINE__, CTX)#define PERF_TRACE_CTX (__CTX) dm_perf_trace_timestamp(__func__, __LINE__, __CTX) +/* +* SMU message tracing +*/ +void dm_trace_smu_msg (uint32_t msg_id,uint32_t param_in,struct dc_context *ctx); +void dm_trace_smu_delay (uint32_t delay,struct dc_context *ctx); + +#define TRACE_SMU_MSG (msg_id, param_in, ctx) dm_trace_smu_msg(msg_id, param_in, ctx) +#define TRACE_SMU_DELAY (response_delay, ctx) dm_trace_smu_delay(response_delay, ctx) + +/* * DMUB Interfaces */
Signature · 1 line
2.34.1
PATCH 8/43 drm/amd/display: FEC overhead should be checked once for mst slot nums
In reply to [email protected]From: Hersen Wu <[email protected]>
[Why] Mst slot nums equals to pbn / pbn_div.
Today, pbn_div refers to dm_mst_get_pbn_divider -> dc_link_bandwidth_kbps. In dp_link_bandwidth_kbps, which includes effect of FEC overhead already. As result, we should not include effect of FEC overhead again while calculating pbn by kpbs_to_peak_pbn (stream_kbps).
[How] Include FEC overhead within dp_link_bandwidth_kbps. Remove FEC overhead from kbps_to_peak_pbn.
--- .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 37 +++++-------------- .../display/amdgpu_dm/amdgpu_dm_mst_types.h | 3 -- 2 files changed, 10 insertions(+), 30 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +10 -27
@@ -791,25 +791,12 @@ struct dsc_mst_fairness_params {struct amdgpu_dm_connector *aconnector; }; -static uint16_t get_fec_overhead_multiplier (struct dc_link *dc_link) -{ -u8 link_coding_cap; -uint16_t fec_overhead_multiplier_x1000 =PBN_FEC_OVERHEAD_MULTIPLIER_8B_10B ; - - link_coding_cap =dc_link_dp_mst_decide_link_encoding_format (dc_link); -if (link_coding_cap == DP_128b_132b_ENCODING) - fec_overhead_multiplier_x1000 =PBN_FEC_OVERHEAD_MULTIPLIER_128B_132B ; - -return fec_overhead_multiplier_x1000; -} - -static int kbps_to_peak_pbn (int kbps,uint16_t fec_overhead_multiplier_x1000) +static int kbps_to_peak_pbn (int kbps) {u64 peak_kbps = kbps; peak_kbps *=1006 ; - peak_kbps *= fec_overhead_multiplier_x1000; - peak_kbps =div_u64 (peak_kbps,1000 *1000 ); + peak_kbps =div_u64 (peak_kbps,1000 );return (int )DIV64_U64_ROUND_UP (peak_kbps *64 , (54 *8 *1000 )); }
@@ -910,12 +897,11 @@ static int increase_dsc_bpp(struct drm_atomic_state *state,int link_timeslots_used;int fair_pbn_alloc;int ret =0 ; -uint16_t fec_overhead_multiplier_x1000 =get_fec_overhead_multiplier (dc_link);for (i =0 ; i < count; i++) {if (vars[i + k].dsc_enabled) { initial_slack[i] = -kbps_to_peak_pbn (params[i].bw_range.max_kbps, fec_overhead_multiplier_x1000) - vars[i + k].pbn; +kbps_to_peak_pbn (params[i].bw_range.max_kbps) - vars[i + k].pbn; bpp_increased[i] = false; remaining_to_increase +=1 ; }else {
@@ -1011,7 +997,6 @@ static int try_disable_dsc(struct drm_atomic_state *state,int next_index;int remaining_to_try =0 ;int ret; -uint16_t fec_overhead_multiplier_x1000 =get_fec_overhead_multiplier (dc_link);for (i =0 ; i < count; i++) { if (vars[i + k].dsc_enabled
@@ -1041,7 +1026,7 @@ static int try_disable_dsc(struct drm_atomic_state *state,if (next_index ==-1 )break ; - vars[next_index].pbn =kbps_to_peak_pbn (params[next_index].bw_range.stream_kbps, fec_overhead_multiplier_x1000); + vars[next_index].pbn =kbps_to_peak_pbn (params[next_index].bw_range.stream_kbps); ret = drm_dp_atomic_find_time_slots(state, params[next_index].port->mgr, params[next_index].port,
@@ -1054,7 +1039,8 @@ static int try_disable_dsc(struct drm_atomic_state *state, vars[next_index].dsc_enabled = false; vars[next_index].bpp_x16 =0 ; }else { - vars[next_index].pbn =kbps_to_peak_pbn (params[next_index].bw_range.max_kbps, fec_overhead_multiplier_x1000); + vars[next_index].pbn =kbps_to_peak_pbn ( + params[next_index].bw_range.max_kbps); ret = drm_dp_atomic_find_time_slots(state, params[next_index].port->mgr, params[next_index].port,
@@ -1083,7 +1069,6 @@ static int compute_mst_dsc_configs_for_link(struct drm_atomic_state *state,int count =0 ;int i, k, ret;bool debugfs_overwrite = false; -uint16_t fec_overhead_multiplier_x1000 =get_fec_overhead_multiplier (dc_link);memset (params,0 ,sizeof (params));
@@ -1148,7 +1133,7 @@ static int compute_mst_dsc_configs_for_link(struct drm_atomic_state *state,/* Try no compression */ for (i =0 ; i < count; i++) { vars[i + k].aconnector = params[i].aconnector; - vars[i + k].pbn =kbps_to_peak_pbn (params[i].bw_range.stream_kbps, fec_overhead_multiplier_x1000); + vars[i + k].pbn =kbps_to_peak_pbn (params[i].bw_range.stream_kbps); vars[i + k].dsc_enabled = false; vars[i + k].bpp_x16 =0 ; ret = drm_dp_atomic_find_time_slots(state, params[i].port->mgr, params[i].port,
@@ -1167,7 +1152,7 @@ static int compute_mst_dsc_configs_for_link(struct drm_atomic_state *state,/* Try max compression */ for (i =0 ; i < count; i++) {if (params[i].compression_possible && params[i].clock_force_enable !=DSC_CLK_FORCE_DISABLE ) { - vars[i + k].pbn =kbps_to_peak_pbn (params[i].bw_range.min_kbps, fec_overhead_multiplier_x1000); + vars[i + k].pbn =kbps_to_peak_pbn (params[i].bw_range.min_kbps); vars[i + k].dsc_enabled = true; vars[i + k].bpp_x16 = params[i].bw_range.min_target_bpp_x16; ret = drm_dp_atomic_find_time_slots(state, params[i].port->mgr,
@@ -1175,7 +1160,7 @@ static int compute_mst_dsc_configs_for_link(struct drm_atomic_state *state,if (ret <0 )return ret; }else { - vars[i + k].pbn =kbps_to_peak_pbn (params[i].bw_range.stream_kbps, fec_overhead_multiplier_x1000); + vars[i + k].pbn =kbps_to_peak_pbn (params[i].bw_range.stream_kbps); vars[i + k].dsc_enabled = false; vars[i + k].bpp_x16 =0 ; ret = drm_dp_atomic_find_time_slots(state, params[i].port->mgr,
@@ -1656,13 +1641,11 @@ enum dc_status dm_dp_mst_is_port_support_mode(*/ int pbn_div, slot_num, max_slot_num;enum dc_link_encoding_format link_encoding; -uint16_t fec_overhead_multiplier_x1000 = -get_fec_overhead_multiplier (stream->link);uint32_t stream_kbps =dc_bandwidth_in_kbps_from_timing (&stream->timing,dc_link_get_highest_encoding_format (stream->link)); - pbn =kbps_to_peak_pbn (stream_kbps, fec_overhead_multiplier_x1000); + pbn =kbps_to_peak_pbn (stream_kbps); pbn_div =dm_mst_get_pbn_divider (stream->link); slot_num =DIV_ROUND_UP (pbn, pbn_div);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.h +0 -3
@@ -46,9 +46,6 @@#define SYNAPTICS_CASCADED_HUB_ID 0x5A#define IS_SYNAPTICS_CASCADED_PANAMERA (devName, data) ((IS_SYNAPTICS_PANAMERA(devName) && ((int)data[2] == SYNAPTICS_CASCADED_HUB_ID)) ? 1 : 0) -#define PBN_FEC_OVERHEAD_MULTIPLIER_8B_10B 1031 -#define PBN_FEC_OVERHEAD_MULTIPLIER_128B_132B 1000 -enum mst_msg_ready_type {NONE_MSG_RDY_EVENT =0 ,DOWN_REP_MSG_RDY_EVENT =1 ,
Signature · 1 line
2.34.1
PATCH 11/43 drm/amd/display: update pipe topology log to support subvp
In reply to [email protected]From: Wenjing Liu <[email protected]>
[why]
There is an ambiguity in subvp pipe topology log. The log doesn't show subvp relation to main stream and it is not clear that certain stream is an internal stream for subvp pipes.
[how]
Separate subvp pipe topology logging from main pipe topology. Log main stream indices instead of the internal stream for subvp pipes. The following is a sample log showing 2 streams with subvp enabled on both:
pipe topology update
________________________
| plane0 slice0 stream0| |DPP1----OPP1----OTG1----| | plane0 slice0 stream1| |DPP0----OPP0----OTG0----| | (phantom pipes) | | plane0 slice0 stream0| |DPP3----OPP3----OTG3----| | plane0 slice0 stream1| |DPP2----OPP2----OTG2----| |________________________|
--- .../gpu/drm/amd/display/dc/core/dc_resource.c | 96 +++++++++++++------ 1 file changed, 65 insertions(+), 31 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +65 -31
@@ -2193,50 +2193,84 @@ static void resource_log_pipe(struct dc *dc, struct pipe_ctx *pipe, } } -void resource_log_pipe_topology_update (struct dc *dc,struct dc_state *state) +static void resource_log_pipe_for_stream (struct dc *dc,struct dc_state *state, +struct pipe_ctx *otg_master,int stream_idx) { -struct pipe_ctx *otg_master;struct pipe_ctx *opp_heads[MAX_PIPES ];struct pipe_ctx *dpp_pipes[MAX_PIPES ]; -int stream_idx, slice_idx, dpp_idx, plane_idx, slice_count, dpp_count; +int slice_idx, dpp_idx, plane_idx, slice_count, dpp_count;bool is_primary;DC_LOGGER_INIT (dc->ctx->logger); + slice_count =resource_get_opp_heads_for_otg_master (otg_master, + &state->res_ctx, opp_heads); +for (slice_idx =0 ; slice_idx < slice_count; slice_idx++) { + plane_idx =-1 ; +if (opp_heads[slice_idx]->plane_state) { + dpp_count =resource_get_dpp_pipes_for_opp_head ( + opp_heads[slice_idx], + &state->res_ctx, + dpp_pipes); +for (dpp_idx =0 ; dpp_idx < dpp_count; dpp_idx++) { + is_primary = !dpp_pipes[dpp_idx]->top_pipe || + dpp_pipes[dpp_idx]->top_pipe->plane_state != dpp_pipes[dpp_idx]->plane_state; +if (is_primary) + plane_idx++; +resource_log_pipe (dc, dpp_pipes[dpp_idx], + stream_idx, slice_idx, + plane_idx, slice_count, + is_primary); + } + }else { +resource_log_pipe (dc, opp_heads[slice_idx], + stream_idx, slice_idx, plane_idx, + slice_count, true); + } + + } +} + +static int resource_stream_to_stream_idx (struct dc_state *state, +struct dc_stream_state *stream) +{ +int i, stream_idx =-1 ; + +for (i =0 ; i < state->stream_count; i++) +if (state->streams[i] == stream) { + stream_idx = i; +break ; + } +return stream_idx; +} + +void resource_log_pipe_topology_update (struct dc *dc,struct dc_state *state) +{ +struct pipe_ctx *otg_master; +int stream_idx, phantom_stream_idx; +DC_LOGGER_INIT (dc->ctx->logger); +DC_LOG_DC (" pipe topology update" );DC_LOG_DC (" ________________________" );for (stream_idx =0 ; stream_idx < state->stream_count; stream_idx++) { +if (state->streams[stream_idx]->is_phantom) +continue ; + otg_master =resource_get_otg_master_for_stream ( &state->res_ctx, state->streams[stream_idx]); -if (!otg_master || otg_master->stream_res.tg ==NULL ) { -DC_LOG_DC ("topology update: otg_master NULL stream_idx %d!\n" , stream_idx); -return ; - } - slice_count =resource_get_opp_heads_for_otg_master (otg_master, - &state->res_ctx, opp_heads); -for (slice_idx =0 ; slice_idx < slice_count; slice_idx++) { - plane_idx =-1 ; -if (opp_heads[slice_idx]->plane_state) { - dpp_count =resource_get_dpp_pipes_for_opp_head ( - opp_heads[slice_idx], - &state->res_ctx, - dpp_pipes); -for (dpp_idx =0 ; dpp_idx < dpp_count; dpp_idx++) { - is_primary = !dpp_pipes[dpp_idx]->top_pipe || - dpp_pipes[dpp_idx]->top_pipe->plane_state != dpp_pipes[dpp_idx]->plane_state; -if (is_primary) - plane_idx++; -resource_log_pipe (dc, dpp_pipes[dpp_idx], - stream_idx, slice_idx, - plane_idx, slice_count, - is_primary); - } - }else { -resource_log_pipe (dc, opp_heads[slice_idx], - stream_idx, slice_idx, plane_idx, - slice_count, true); - } +resource_log_pipe_for_stream (dc, state, otg_master, stream_idx); + } +if (state->phantom_stream_count >0 ) { +DC_LOG_DC (" | (phantom pipes) |" ); +for (stream_idx =0 ; stream_idx < state->stream_count; stream_idx++) { +if (state->stream_status[stream_idx].mall_stream_config.type !=SUBVP_MAIN ) +continue ; + phantom_stream_idx =resource_stream_to_stream_idx (state, + state->stream_status[stream_idx].mall_stream_config.paired_stream); + otg_master =resource_get_otg_master_for_stream ( + &state->res_ctx, state->streams[phantom_stream_idx]); +resource_log_pipe_for_stream (dc, state, otg_master, stream_idx); } }DC_LOG_DC (" |________________________|\n" );
Signature · 1 line
2.34.1
PATCH 15/43 drm/amd/display: Allow HPO PG for DCN35
In reply to [email protected]From: Duncan Ma <[email protected]>
[Why]
HPO can be power gated unconditionally for
DCN35.
[How]
Set disable flag to false.
--- drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c +1 -1
@@ -721,7 +721,7 @@ static const struct dc_debug_options debug_defaults_drv = { .disable_dpp_power_gate = true, .disable_hubp_power_gate = true, .disable_optc_power_gate = true, /*should the same as above two*/ - .disable_hpo_power_gate = true, /*dmubfw force domain25 on*/ + .disable_hpo_power_gate = false, /*dmubfw force domain25 on*/ .disable_clock_gate = false, .disable_dsc_power_gate = true, .vsr_support = true,
Signature · 1 line
2.34.1
PATCH 16/43 drm/amd/display: Skip on writeback when it's not applicable
In reply to [email protected]From: Alex Hung <[email protected]>
[WHY]
dynamic memory safety error detector (KASAN) catches and generates error messages "BUG: KASAN: slab-out-of-bounds" as writeback connector does not support certain features which are not initialized.
[HOW]
Skip them when connector type is DRM_MODE_CONNECTOR_WRITEBACK.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +8 -1
@@ -3047,6 +3047,10 @@ static int dm_resume(void *handle)/* Do mst topology probing after resuming cached state*/ drm_connector_list_iter_begin (ddev, &iter);drm_for_each_connector_iter (connector, &iter) { + +if (connector->connector_type ==DRM_MODE_CONNECTOR_WRITEBACK ) +continue ; + aconnector =to_amdgpu_dm_connector (connector);if (aconnector->dc_link->type != dc_connection_mst_branch || aconnector->mst_root)
@@ -5926,6 +5930,9 @@ get_highest_refresh_rate_mode(struct amdgpu_dm_connector *aconnector, &aconnector->base.probed_modes : &aconnector->base.modes; +if (aconnector->base.connector_type ==DRM_MODE_CONNECTOR_WRITEBACK ) +return NULL ; +if (aconnector->freesync_vid_base.clock !=0 )return &aconnector->freesync_vid_base;
@@ -8768,10 +8775,10 @@ static void amdgpu_dm_commit_audio(struct drm_device *dev,if (!drm_atomic_crtc_needs_modeset (new_crtc_state))continue ; +notify:if (connector->connector_type ==DRM_MODE_CONNECTOR_WRITEBACK )continue ; -notify: aconnector =to_amdgpu_dm_connector (connector);mutex_lock (&adev->dm.audio_lock);
Signature · 1 line
2.34.1
PATCH 17/43 drm/amd/display: Add OTG check for set AV mute
In reply to [email protected]From: "Leo (Hanghong) Ma" <[email protected]>
[Why && How]
OTG can be disabled before setting dpms on. Add check to skip wait when setting AV mute if OTG is disabled.
--- drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c +1 -1
@@ -813,7 +813,7 @@ void dcn30_set_avmute(struct pipe_ctx *pipe_ctx, bool enable) enable);/* Wait for two frame to make sure AV mute is sent out */ -if (enable) { +if (enable && pipe_ctx->stream_res.tg->funcs->is_tg_enabled (pipe_ctx->stream_res.tg)) { pipe_ctx->stream_res.tg->funcs->wait_for_state (pipe_ctx->stream_res.tg,CRTC_STATE_VACTIVE ); pipe_ctx->stream_res.tg->funcs->wait_for_state (pipe_ctx->stream_res.tg,CRTC_STATE_VBLANK ); pipe_ctx->stream_res.tg->funcs->wait_for_state (pipe_ctx->stream_res.tg,CRTC_STATE_VACTIVE );
Signature · 1 line
2.34.1
PATCH 18/43 drm/amd/display: Add extra logging for HUBP and OTG
In reply to [email protected]From: Alvin Lee <[email protected]>
[Description]
Add extra logging for DCSURF_FLIP_CNTL, DCHUBP_CNTL, OTG_MASTER_EN, and OTG_DOUBLE_BUFFER_CONTROL for more debuggability for a system crash.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h | 1 + drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c | 6 ++++++ drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubp.c | 3 +++ drivers/gpu/drm/amd/display/dc/inc/hw/optc.h | 2 ++ drivers/gpu/drm/amd/display/dc/optc/dcn10/dcn10_optc.c | 3 +++ 5 files changed, 15 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h +1 -0
@@ -692,6 +692,7 @@ struct dcn_hubp_state {uint32_t primary_meta_addr_hi;uint32_t uclk_pstate_force;uint32_t hubp_cntl; +uint32_t flip_control; };struct dcn10_hubp {
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +6 -0
@@ -1331,6 +1331,12 @@ void hubp2_read_state(struct hubp *hubp)SWATH_HEIGHT_C , &rq_regs->rq_regs_c.swath_height, PTE_ROW_HEIGHT_LINEAR_C, &rq_regs->rq_regs_c.pte_row_height_linear); +if (REG (DCHUBP_CNTL )) + s->hubp_cntl =REG_READ (DCHUBP_CNTL ); + +if (REG (DCSURF_FLIP_CONTROL )) + s->flip_control =REG_READ (DCSURF_FLIP_CONTROL ); + } static void hubp2_validate_dml_output(struct hubp *hubp,
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubp.c +3 -0
@@ -455,6 +455,9 @@ void hubp3_read_state(struct hubp *hubp)if (REG (DCHUBP_CNTL )) s->hubp_cntl =REG_READ (DCHUBP_CNTL ); +if (REG (DCSURF_FLIP_CONTROL )) + s->flip_control =REG_READ (DCSURF_FLIP_CONTROL ); + } void hubp3_setup(
drivers/gpu/drm/amd/display/dc/inc/hw/optc.h +2 -0
@@ -93,6 +93,8 @@ struct dcn_otg_state {uint32_t vertical_interrupt1_line;uint32_t vertical_interrupt2_en;uint32_t vertical_interrupt2_line; +uint32_t otg_master_update_lock; +uint32_t otg_double_buffer_control; };void optc1_read_otg_state (struct optc *optc1,struct dcn_otg_state *s);
drivers/gpu/drm/amd/display/dc/optc/dcn10/dcn10_optc.c +3 -0
@@ -1383,6 +1383,9 @@ void optc1_read_otg_state(struct optc *optc1,REG_GET (OTG_VERTICAL_INTERRUPT2_POSITION ,OTG_VERTICAL_INTERRUPT2_LINE_START , &s->vertical_interrupt2_line); + + s->otg_master_update_lock =REG_READ (OTG_MASTER_UPDATE_LOCK ); + s->otg_double_buffer_control =REG_READ (OTG_DOUBLE_BUFFER_CONTROL ); } bool optc1_get_otg_active_size(struct timing_generator *optc,
Signature · 1 line
2.34.1
PATCH 14/43 drm/amd/display: Enable RCO for HDMISTREAMCLK in DCN35
In reply to [email protected]From: Daniel Miess <[email protected]>
[Why & How]
Enable root clock optimization for HDMISTREAMCLK and only disable it when it's actively being used.
--- drivers/gpu/drm/amd/display/dc/dc.h | 1 + .../drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -696,6 +696,7 @@ enum pg_hw_pipe_resources {PG_OPP ,PG_OPTC ,PG_DPSTREAM , +PG_HDMISTREAM , PG_HW_PIPE_RESOURCES_NUM_ELEMENT };
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +12 -2
@@ -988,6 +988,9 @@ void dcn35_calc_blocks_to_gate(struct dc *dc, struct dc_state *context,if (!hpo_frl_stream_enc_acquired && !hpo_dp_stream_enc_acquired) update_state->pg_res_update[PG_HPO ] = true; +if (hpo_frl_stream_enc_acquired) + update_state->pg_pipe_res_update[PG_HDMISTREAM ][0 ] = true; + update_state->pg_res_update[PG_DWB ] = true;for (i =0 ; i < dc->res_pool->pipe_count; i++) {
@@ -1125,6 +1128,9 @@ void dcn35_calc_blocks_to_ungate(struct dc *dc, struct dc_state *context,if (hpo_frl_stream_enc_acquired || hpo_dp_stream_enc_acquired) update_state->pg_res_update[PG_HPO ] = true; +if (hpo_frl_stream_enc_acquired) + update_state->pg_pipe_res_update[PG_HDMISTREAM ][0 ] = true; + }/**
@@ -1249,7 +1255,7 @@ void dcn35_root_clock_control(struct dc *dc,if (!pg_cntl)return ;/*enable root clock first when power up*/ -if (power_on) +if (power_on) {for (i =0 ; i < dc->res_pool->pipe_count; i++) {if (update_state->pg_pipe_res_update[PG_HUBP ][i] && update_state->pg_pipe_res_update[PG_DPP ][i]) {
@@ -1260,6 +1266,8 @@ void dcn35_root_clock_control(struct dc *dc,if (dc->hwseq->funcs.dpstream_root_clock_control) dc->hwseq->funcs.dpstream_root_clock_control (dc->hwseq, i, power_on); } + + }for (i =0 ; i < dc->res_pool->res_cap->num_dsc; i++) {if (update_state->pg_pipe_res_update[PG_DSC ][i]) {if (power_on) {
@@ -1272,7 +1280,7 @@ void dcn35_root_clock_control(struct dc *dc, } }/*disable root clock first when power down*/ -if (!power_on) +if (!power_on) {for (i =0 ; i < dc->res_pool->pipe_count; i++) {if (update_state->pg_pipe_res_update[PG_HUBP ][i] && update_state->pg_pipe_res_update[PG_DPP ][i]) {
@@ -1283,6 +1291,8 @@ void dcn35_root_clock_control(struct dc *dc,if (dc->hwseq->funcs.dpstream_root_clock_control) dc->hwseq->funcs.dpstream_root_clock_control (dc->hwseq, i, power_on); } + + } } void dcn35_prepare_bandwidth(
Signature · 1 line
2.34.1
PATCH 19/43 drm/amd/display: Disable Z8 minimum stutter period check for DCN35
In reply to [email protected]From: Nicholas Kazlauskas <[email protected]>
[Why]
The threshold is no longer useful for blocking suboptimal power states for DCN35 based on real measurement.
[How]
Reduce to the minimum threshold duration, 1us.
--- drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c +1 -1
@@ -764,7 +764,7 @@ static const struct dc_debug_options debug_defaults_drv = { }, .seamless_boot_odm_combine = DML_FAIL_SOURCE_PIXEL_FORMAT, .enable_z9_disable_interface = true, /* Allow support for the PMFW interface for disable Z9*/ - .minimum_z8_residency_time = 2100, + .minimum_z8_residency_time = 1, /* Always allow when other conditions are met */ .using_dml2 = true, .support_eDP1_5 = true, .enable_hpo_pg_support = false,
Signature · 1 line
2.34.1
PATCH 21/43 drm/amd/display: Add extra DMUB logging to track message timeout
In reply to [email protected]From: Alvin Lee <[email protected]>
[Description]
- Add logging for first DMUB inbox message that timed out to diagnostic data
- It is useful to track the first failed message for debug purposes because once DMUB becomes hung (typically on a message), it will remain hung and all subsequent messages. In these cases we're interested in knowing which is the first message that failed.
--- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 10 +++++++++- drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 17 ++++++++++++++++- .../gpu/drm/amd/display/dmub/src/dmub_dcn20.c | 1 + .../gpu/drm/amd/display/dmub/src/dmub_dcn31.c | 1 + .../gpu/drm/amd/display/dmub/src/dmub_dcn32.c | 2 ++ .../gpu/drm/amd/display/dmub/src/dmub_dcn35.c | 1 + 6 files changed, 30 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +9 -1
@@ -23,6 +23,7 @@* */ +#include "dm_services.h" #include "dc.h" #include "dc_dmub_srv.h" #include "../dmub/dmub_srv.h"
@@ -198,6 +199,11 @@ bool dc_dmub_srv_wait_for_idle(struct dc_dmub_srv *dc_dmub_srv,if (status !=DMUB_STATUS_OK ) {DC_LOG_DEBUG ("No reply for DMUB command: status=%d\n" , status); +if (!dmub->debug.timeout_occured) { + dmub->debug.timeout_occured = true; + dmub->debug.timeout_cmd = *cmd_list; + dmub->debug.timestamp =dm_get_timestamp (dc_dmub_srv->ctx); + }dc_dmub_srv_log_diagnostic_data (dc_dmub_srv);return false; }
@@ -904,6 +910,7 @@ bool dc_dmub_srv_get_diagnostic_data(struct dc_dmub_srv *dc_dmub_srv, struct dmuvoid dc_dmub_srv_log_diagnostic_data (struct dc_dmub_srv *dc_dmub_srv) {struct dmub_diagnostic_data diag_data = {0 }; +uint32_t i;if (!dc_dmub_srv || !dc_dmub_srv->dmub) {DC_LOG_ERROR ("%s: invalid parameters." , __func__);
@@ -935,7 +942,8 @@ void dc_dmub_srv_log_diagnostic_data(struct dc_dmub_srv *dc_dmub_srv)DC_LOG_DEBUG (" scratch [13] : %08x" , diag_data.scratch[13 ]);DC_LOG_DEBUG (" scratch [14] : %08x" , diag_data.scratch[14 ]);DC_LOG_DEBUG (" scratch [15] : %08x" , diag_data.scratch[15 ]); -DC_LOG_DEBUG (" pc : %08x" , diag_data.pc); +for (i =0 ; i <DMUB_PC_SNAPSHOT_COUNT ; i++) +DC_LOG_DEBUG (" pc[%d] : %08x" , i, diag_data.pc[i]);DC_LOG_DEBUG (" unk_fault_addr : %08x" , diag_data.undefined_address_fault_addr);DC_LOG_DEBUG (" inst_fault_addr : %08x" , diag_data.inst_fetch_fault_addr);DC_LOG_DEBUG (" data_fault_addr : %08x" , diag_data.data_write_fault_addr);
drivers/gpu/drm/amd/display/dmub/dmub_srv.h +16 -1
@@ -71,6 +71,8 @@extern "C" {#endif +#define DMUB_PC_SNAPSHOT_COUNT 10 +/* Forward declarations */ struct dmub_srv ;struct dmub_srv_common_regs ;
@@ -299,6 +301,17 @@ struct dmub_srv_hw_params {enum dmub_ips_disable_type disable_ips; }; +/** +* struct dmub_srv_debug - Debug info for dmub_srv +* @timeout_occured: Indicates a timeout occured on any message from driver to dmub +* @timeout_cmd: first cmd sent from driver that timed out - subsequent timeouts are not stored +*/ +struct dmub_srv_debug { +bool timeout_occured; +union dmub_rb_cmd timeout_cmd; +unsigned long long timestamp; +}; +/** * struct dmub_diagnostic_data - Diagnostic data retrieved from DMCUB for * debugging purposes, including logging, crash analysis, etc.
@@ -306,7 +319,7 @@ struct dmub_srv_hw_params {struct dmub_diagnostic_data {uint32_t dmcub_version;uint32_t scratch[17 ]; -uint32_t pc; +uint32_t pc[DMUB_PC_SNAPSHOT_COUNT ];uint32_t undefined_address_fault_addr;uint32_t inst_fetch_fault_addr;uint32_t data_write_fault_addr;
@@ -317,6 +330,7 @@ struct dmub_diagnostic_data {uint32_t inbox0_wptr;uint32_t inbox0_size;uint32_t gpint_datain0; +struct dmub_srv_debug timeout_info; uint8_t is_dmcub_enabled : 1; uint8_t is_dmcub_soft_reset : 1; uint8_t is_dmcub_secure_reset : 1;
@@ -506,6 +520,7 @@ struct dmub_srv {struct dmub_visual_confirm_color visual_confirm_color;enum dmub_srv_power_state_type power_state; +struct dmub_srv_debug debug; };/**
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn20.c +1 -0
@@ -472,4 +472,5 @@ void dmub_dcn20_get_diagnostic_data(struct dmub_srv *dmub, struct dmub_diagnostiREG_GET (DMCUB_REGION3_CW6_TOP_ADDRESS ,DMCUB_REGION3_CW6_ENABLE , &is_cw6_enabled); diag_data->is_cw6_enabled = is_cw6_enabled; + diag_data->timeout_info = dmub->debug; }
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.c +1 -0
@@ -466,6 +466,7 @@ void dmub_dcn31_get_diagnostic_data(struct dmub_srv *dmub, struct dmub_diagnostiREG_GET (DMCUB_REGION3_CW6_TOP_ADDRESS ,DMCUB_REGION3_CW6_ENABLE , &is_cw6_enabled); diag_data->is_cw6_enabled = is_cw6_enabled; + diag_data->timeout_info = dmub->debug; }bool dmub_dcn31_should_detect (struct dmub_srv *dmub)
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn32.c +2 -0
@@ -478,6 +478,8 @@ void dmub_dcn32_get_diagnostic_data(struct dmub_srv *dmub, struct dmub_diagnosti diag_data->is_cw6_enabled = is_cw6_enabled; diag_data->gpint_datain0 =REG_READ (DMCUB_GPINT_DATAIN0 ); + + diag_data->timeout_info = dmub->debug; }void dmub_dcn32_configure_dmub_in_system_memory (struct dmub_srv *dmub) {
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn35.c +1 -0
@@ -516,6 +516,7 @@ void dmub_dcn35_get_diagnostic_data(struct dmub_srv *dmub, struct dmub_diagnosti diag_data->is_cw6_enabled = is_cw6_enabled; diag_data->gpint_datain0 =REG_READ (DMCUB_GPINT_DATAIN0 ); + diag_data->timeout_info = dmub->debug; }void dmub_dcn35_configure_dmub_in_system_memory (struct dmub_srv *dmub) {
Signature · 1 line
2.34.1
PATCH 24/43 drm/amd/display: move build test pattern params as part of pipe resource update for odm
In reply to [email protected]From: Wenjing Liu <[email protected]>
[why]
Move built test pattern as part of pipe resource update for odm to ensure we rebuild test pattern params every time we have an ODM update
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 24 ++++++++++++------- .../gpu/drm/amd/display/dc/core/dc_resource.c | 7 ++++++ .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 8 +++++++ .../display/dc/dml2/dml2_dc_resource_mgmt.c | 6 +++++ .../drm/amd/display/dc/dml2/dml2_wrapper.h | 1 + 5 files changed, 37 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +15 -9
@@ -3235,14 +3235,6 @@ static bool update_planes_and_stream_state(struct dc *dc,BREAK_TO_DEBUGGER (); goto fail; } - -for (i =0 ; i < context->stream_count; i++) { -struct pipe_ctx *otg_master =resource_get_otg_master_for_stream (&context->res_ctx, - context->streams[i]); - -if (otg_master && otg_master->stream->test_pattern.type !=DP_TEST_PATTERN_VIDEO_MODE ) -resource_build_test_pattern_params (&context->res_ctx, otg_master); - } }update_seamless_boot_flags (dc, context, surface_count, stream);
@@ -3338,12 +3330,26 @@ static void commit_planes_do_stream_update(struct dc *dc, }if (stream_update->pending_test_pattern) { -dc_link_dp_set_test_pattern (stream->link, +/* +* test pattern params depends on ODM topology +* changes that we could be applying to front +* end. Since at the current stage front end +* changes are not yet applied. We can only +* apply test pattern in hw based on current +* state and populate the final test pattern +* params in new state. If current and new test +* pattern params are different as result of +* different ODM topology being used, it will be +* detected and handle during front end +* programming update. +*/ + dc->link_srv->dp_set_test_pattern (stream->link, stream->test_pattern.type, stream->test_pattern.color_space, stream->test_pattern.p_link_settings, stream->test_pattern.p_custom_pattern, stream->test_pattern.cust_pattern_size); +resource_build_test_pattern_params (&context->res_ctx, pipe_ctx); }if (stream_update->dpms_off) {
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +7 -0
@@ -1457,6 +1457,9 @@ void resource_build_test_pattern_params(struct resource_context *res_ctx, controller_color_space =convert_dp_to_controller_color_space ( otg_master->stream->test_pattern.color_space); +if (controller_test_pattern ==CONTROLLER_DP_TEST_PATTERN_VIDEOMODE ) +return ; + odm_cnt =resource_get_opp_heads_for_otg_master (otg_master, res_ctx, opp_heads); odm_slice_width = h_active / odm_cnt;
@@ -2325,6 +2328,9 @@ static bool update_pipe_params_after_odm_slice_count_change(if (pool->funcs->build_pipe_pix_clk_params) pool->funcs->build_pipe_pix_clk_params (otg_master); + +if (otg_master->stream->test_pattern.type !=DP_TEST_PATTERN_VIDEO_MODE ) +resource_build_test_pattern_params (&context->res_ctx, otg_master);return result; }
@@ -5082,6 +5088,7 @@ void resource_init_common_dml2_callbacks(struct dc *dc, struct dml2_configuratio { dml2_options->callbacks.dc = dc; dml2_options->callbacks.build_scaling_params = &resource_build_scaling_params; + dml2_options->callbacks.build_test_pattern_params = &resource_build_test_pattern_params; dml2_options->callbacks.acquire_secondary_pipe_for_mpc_odm = &dc_resource_acquire_secondary_pipe_for_mpc_odm_legacy; dml2_options->callbacks.update_pipes_for_stream_with_slice_count = &resource_update_pipes_for_stream_with_slice_count; dml2_options->callbacks.update_pipes_for_plane_with_slice_count = &resource_update_pipes_for_plane_with_slice_count;
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +8 -0
@@ -2115,6 +2115,14 @@ static bool dcn32_apply_merge_split_flags_helper(return false; } } + +for (i =0 ; i < context->stream_count; i++) { +struct pipe_ctx *otg_master =resource_get_otg_master_for_stream (&context->res_ctx, + context->streams[i]); + +if (otg_master && otg_master->stream->test_pattern.type !=DP_TEST_PATTERN_VIDEO_MODE ) +resource_build_test_pattern_params (&context->res_ctx, otg_master); + } }return true; }
drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c +6 -0
@@ -1078,6 +1078,12 @@ bool dml2_map_dc_pipes(struct dml2_context *ctx, struct dc_state *state, const sASSERT (false); } } + +if (ctx->config.callbacks.build_test_pattern_params && + pipe->stream && + pipe->prev_odm_pipe ==NULL && + pipe->top_pipe ==NULL ) + ctx->config.callbacks.build_test_pattern_params (&state->res_ctx, pipe); }return true;
drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h +1 -0
@@ -71,6 +71,7 @@ struct dml2_dcn_clocks {struct dml2_dc_callbacks {struct dc *dc;bool (*build_scaling_params)(struct pipe_ctx *pipe_ctx); +void (*build_test_pattern_params)(struct resource_context *res_ctx,struct pipe_ctx *otg_master);bool (*can_support_mclk_switch_using_fw_based_vblank_stretch)(struct dc *dc,struct dc_state *context);bool (*acquire_secondary_pipe_for_mpc_odm)(const struct dc *dc,struct dc_state *state,struct pipe_ctx *pri_pipe,struct pipe_ctx *sec_pipe,bool odm); bool (*update_pipes_for_stream_with_slice_count)(
Signature · 1 line
2.34.1
PATCH 23/43 drm/amd/display: Add handling for DC power mode
In reply to [email protected]From: Joshua Aberback <[email protected]>
[Why]
Future implementations will require a distinction between AC power and DC power (wall power and battery power, respectively). To accomplish this, adding a power mode parameter to certain dc interfaces, and adding a separate DML2 instance for DC mode validation. Default behaviour unchanged.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 17 ++++++--- drivers/gpu/drm/amd/display/dc/core/dc.c | 37 ++++++++++--------- .../gpu/drm/amd/display/dc/core/dc_state.c | 29 +++++++++++++-- drivers/gpu/drm/amd/display/dc/dc.h | 13 +++++-- drivers/gpu/drm/amd/display/dc/dc_state.h | 2 +- drivers/gpu/drm/amd/display/dc/dc_stream.h | 8 ---- drivers/gpu/drm/amd/display/dc/dc_types.h | 16 ++++++++ .../drm/amd/display/dc/dml2/dml2_wrapper.h | 2 + .../gpu/drm/amd/display/dc/inc/core_types.h | 3 ++ .../dc/resource/dcn32/dcn32_resource.c | 16 +++++++- .../dc/resource/dcn321/dcn321_resource.c | 12 +++++- .../dc/resource/dcn35/dcn35_resource.c | 4 +- .../dc/resource/dcn351/dcn351_resource.c | 4 +- 13 files changed, 120 insertions(+), 43 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +12 -5
@@ -2629,6 +2629,7 @@ static enum dc_status amdgpu_dm_commit_zero_streams(struct dc *dc)int i;struct dc_stream_state *del_streams[MAX_PIPES ];int del_streams_count =0 ; +struct dc_commit_streams_params params = {};memset (del_streams,0 ,sizeof (del_streams));
@@ -2655,7 +2656,9 @@ static enum dc_status amdgpu_dm_commit_zero_streams(struct dc *dc) goto fail; } - res =dc_commit_streams (dc, context->streams, context->stream_count); + params.streams = context->streams; + params.stream_count = context->stream_count; + res =dc_commit_streams (dc, ¶ms); fail:dc_state_release (context);
@@ -2877,6 +2880,7 @@ static int dm_resume(void *handle)struct dc_state *dc_state;int i, r, j, ret;bool need_hotplug = false; +struct dc_commit_streams_params commit_params = {};if (dm->dc->caps.ips_support) {dc_dmub_srv_apply_idle_power_optimizations (dm->dc, false);
@@ -2926,7 +2930,9 @@ static int dm_resume(void *handle)dc_enable_dmub_outbox (adev->dm.dc); } -WARN_ON (!dc_commit_streams (dm->dc, dc_state->streams, dc_state->stream_count)); + commit_params.streams = dc_state->streams; + commit_params.stream_count = dc_state->stream_count; +WARN_ON (!dc_commit_streams (dm->dc, &commit_params));dm_gpureset_commit_state (dm->cached_dc_state, dm);
@@ -2943,7 +2949,7 @@ static int dm_resume(void *handle) }/* Recreate dc_state - DC invalidates it when setting power state to S3. */ dc_state_release (dm_state->context); - dm_state->context =dc_state_create (dm->dc); + dm_state->context =dc_state_create (dm->dc,NULL );/* TODO: Remove dc_state->dccg, use dc->dccg directly. */ /* Before powering on DC we need to re-initialize DMUB. */
@@ -6802,7 +6808,7 @@ static enum dc_status dm_validate_stream_and_context(struct dc *dc,if (!dc_plane_state) goto cleanup; - dc_state =dc_state_create (dc); + dc_state =dc_state_create (dc,NULL );if (!dc_state) goto cleanup;
@@ -8858,6 +8864,7 @@ static void amdgpu_dm_commit_streams(struct drm_atomic_state *state,struct drm_connector *connector;bool mode_set_reset_required = false;u32 i; +struct dc_commit_streams_params params = {dc_state->streams, dc_state->stream_count};/* Disable writeback */ for_each_old_connector_in_state (state, connector, old_con_state, i) {
@@ -8994,7 +9001,7 @@ static void amdgpu_dm_commit_streams(struct drm_atomic_state *state,dm_enable_per_frame_crtc_master_sync (dc_state);mutex_lock (&dm->dc_lock); -WARN_ON (!dc_commit_streams (dm->dc, dc_state->streams, dc_state->stream_count)); +WARN_ON (!dc_commit_streams (dm->dc, ¶ms));/* Allow idle optimization when vblank count is 0 for display off */ if (dm->active_vblank_irq_count ==0 )
drivers/gpu/drm/amd/display/dc/core/dc.c +20 -17
@@ -1089,8 +1089,7 @@ static bool dc_construct(struct dc *dc,* is initialized in dc_create_resource_pool because * on creation it copies the contents of dc->dml */ - - dc->current_state =dc_state_create (dc); + dc->current_state =dc_state_create (dc,NULL );if (!dc->current_state) {dm_error ("%s: failed to create validate ctx\n" , __func__);
@@ -2135,9 +2134,7 @@ static bool commit_minimal_transition_state(struct dc *dc,* Return DC_OK if everything work as expected, otherwise, return a dc_status * code. */ -enum dc_status dc_commit_streams (struct dc *dc, -struct dc_stream_state *streams[], -uint8_t stream_count) +enum dc_status dc_commit_streams (struct dc *dc,struct dc_commit_streams_params *params) {int i, j;struct dc_state *context;
@@ -2146,18 +2143,22 @@ enum dc_status dc_commit_streams(struct dc *dc,struct pipe_ctx *pipe;bool handle_exit_odm2to1 = false; +if (!params) +return DC_ERROR_UNEXPECTED ; +if (dc->ctx->dce_environment ==DCE_ENV_VIRTUAL_HW )return res; -if (!streams_changed (dc, streams, stream_count)) +if (!streams_changed (dc, params->streams, params->stream_count) && + dc->current_state->power_source == params->power_source)return res;dc_exit_ips_for_hw_access (dc); -DC_LOG_DC ("%s: %d streams\n" , __func__, stream_count); +DC_LOG_DC ("%s: %d streams\n" , __func__, params->stream_count); -for (i =0 ; i < stream_count; i++) { -struct dc_stream_state *stream = streams[i]; +for (i =0 ; i < params->stream_count; i++) { +struct dc_stream_state *stream = params->streams[i];struct dc_stream_status *status =dc_stream_get_status (stream);dc_stream_log (dc, stream);
@@ -2175,7 +2176,7 @@ enum dc_status dc_commit_streams(struct dc *dc,* scenario, it uses extra pipes than needed to reduce power consumption * We need to switch off this feature to make room for new streams. */ -if (stream_count > dc->current_state->stream_count && +if (params->stream_count > dc->current_state->stream_count && dc->current_state->stream_count ==1 ) {for (i =0 ; i < dc->res_pool->pipe_count; i++) { pipe = &dc->current_state->res_ctx.pipe_ctx[i];
@@ -2191,7 +2192,9 @@ enum dc_status dc_commit_streams(struct dc *dc,if (!context) goto context_alloc_fail; - res =dc_validate_with_context (dc, set, stream_count, context, false); + context->power_source = params->power_source; + + res =dc_validate_with_context (dc, set, params->stream_count, context, false);if (res !=DC_OK ) {BREAK_TO_DEBUGGER (); goto fail;
@@ -2199,16 +2202,16 @@ enum dc_status dc_commit_streams(struct dc *dc, res =dc_commit_state_no_check (dc, context); -for (i =0 ; i < stream_count; i++) { +for (i =0 ; i < params->stream_count; i++) {for (j =0 ; j < context->stream_count; j++) { -if (streams[i]->stream_id == context->streams[j]->stream_id) - streams[i]->out.otg_offset = context->stream_status[j].primary_otg_inst; +if (params->streams[i]->stream_id == context->streams[j]->stream_id) + params->streams[i]->out.otg_offset = context->stream_status[j].primary_otg_inst; -if (dc_is_embedded_signal (streams[i]->signal)) { -struct dc_stream_status *status =dc_state_get_stream_status (context, streams[i]); +if (dc_is_embedded_signal (params->streams[i]->signal)) { +struct dc_stream_status *status =dc_state_get_stream_status (context, params->streams[i]);if (dc->hwss.is_abm_supported) - status->is_abm_supported = dc->hwss.is_abm_supported (dc, context, streams[i]); + status->is_abm_supported = dc->hwss.is_abm_supported (dc, context, params->streams[i]);else status->is_abm_supported = true; }
drivers/gpu/drm/amd/display/dc/core/dc_state.c +26 -3
@@ -188,8 +188,11 @@ static void init_state(struct dc *dc, struct dc_state *state) }/* Public dc_state functions */ -struct dc_state *dc_state_create (struct dc *dc) +struct dc_state *dc_state_create (struct dc *dc,struct dc_state_create_params *params) { +#ifdef CONFIG_DRM_AMD_DC_FP +struct dml2_configuration_options dml2_opt = dc->dml2_options; +#endif struct dc_state *state =kvzalloc (sizeof (struct dc_state ),GFP_KERNEL );
@@ -198,10 +201,16 @@ struct dc_state *dc_state_create(struct dc *dc)init_state (dc, state);dc_state_construct (dc, state); + state->power_source = params ? params->power_source :DC_POWER_SOURCE_AC ;#ifdef CONFIG_DRM_AMD_DC_FP -if (dc->debug.using_dml2) -dml2_create (dc, &dc->dml2_options, &state->bw_ctx.dml2); +if (dc->debug.using_dml2) { + dml2_opt.use_clock_dc_limits = false; +dml2_create (dc, &dml2_opt, &state->bw_ctx.dml2); + + dml2_opt.use_clock_dc_limits = true; +dml2_create (dc, &dml2_opt, &state->bw_ctx.dml2_dc_power_source); + }#endif kref_init (&state->refcount);
@@ -214,6 +223,7 @@ void dc_state_copy(struct dc_state *dst_state, struct dc_state *src_state)struct kref refcount = dst_state->refcount;#ifdef CONFIG_DRM_AMD_DC_FP struct dml2_context *dst_dml2 = dst_state->bw_ctx.dml2; +struct dml2_context *dst_dml2_dc_power_source = dst_state->bw_ctx.dml2_dc_power_source;#endif dc_state_copy_internal (dst_state, src_state);
@@ -222,6 +232,10 @@ void dc_state_copy(struct dc_state *dst_state, struct dc_state *src_state) dst_state->bw_ctx.dml2 = dst_dml2;if (src_state->bw_ctx.dml2)dml2_copy (dst_state->bw_ctx.dml2, src_state->bw_ctx.dml2); + + dst_state->bw_ctx.dml2_dc_power_source = dst_dml2_dc_power_source; +if (src_state->bw_ctx.dml2_dc_power_source) +dml2_copy (dst_state->bw_ctx.dml2_dc_power_source, src_state->bw_ctx.dml2_dc_power_source);#endif /* context refcount should not be overridden */
@@ -245,6 +259,12 @@ struct dc_state *dc_state_create_copy(struct dc_state *src_state)dc_state_release (new_state); return NULL; } + +if (src_state->bw_ctx.dml2_dc_power_source && + !dml2_create_copy (&new_state->bw_ctx.dml2_dc_power_source, src_state->bw_ctx.dml2_dc_power_source)) { +dc_state_release (new_state); +return NULL ; + }#endif kref_init (&new_state->refcount);
@@ -326,6 +346,9 @@ static void dc_state_free(struct kref *kref)#ifdef CONFIG_DRM_AMD_DC_FP dml2_destroy (state->bw_ctx.dml2); state->bw_ctx.dml2 =0 ; + +dml2_destroy (state->bw_ctx.dml2_dc_power_source); + state->bw_ctx.dml2_dc_power_source =0 ;#endif kvfree (state);
drivers/gpu/drm/amd/display/dc/dc.h +9 -4
@@ -1504,10 +1504,15 @@ bool dc_acquire_release_mpc_3dlut(bool dc_resource_is_dsc_encoding_supported (const struct dc *dc);void get_audio_check (struct audio_info *aud_modes,struct audio_check *aud_chk); - -enum dc_status dc_commit_streams (struct dc *dc, -struct dc_stream_state *streams[], -uint8_t stream_count); +/* +* Set up streams and links associated to drive sinks +* The streams parameter is an absolute set of all active streams. +* +* After this call: +* Phy, Encoder, Timing Generator are programmed and enabled. +* New streams are enabled with blank stream; no memory read. +*/ +enum dc_status dc_commit_streams (struct dc *dc,struct dc_commit_streams_params *params); struct dc_plane_state *dc_get_surface_for_mpcc(struct dc *dc,
drivers/gpu/drm/amd/display/dc/dc_state.h +1 -1
@@ -29,7 +29,7 @@#include "dc.h" #include "inc/core_status.h" -struct dc_state *dc_state_create (struct dc *dc); +struct dc_state *dc_state_create (struct dc *dc,struct dc_state_create_params *params);void dc_state_copy (struct dc_state *dst_state,struct dc_state *src_state);struct dc_state *dc_state_create_copy (struct dc_state *src_state);void dc_state_copy_current (struct dc *dc,struct dc_state *dst_state);
drivers/gpu/drm/amd/display/dc/dc_stream.h +0 -8
@@ -427,14 +427,6 @@ bool dc_stream_set_dynamic_metadata(struct dc *dc,enum dc_status dc_validate_stream (struct dc *dc,struct dc_stream_state *stream); -/* -* Set up streams and links associated to drive sinks -* The streams parameter is an absolute set of all active streams. -* -* After this call: -* Phy, Encoder, Timing Generator are programmed and enabled. -* New streams are enabled with blank stream; no memory read. -*/ /* * Enable stereo when commit_streams is not required, * for example, frame alternate.
drivers/gpu/drm/amd/display/dc/dc_types.h +16 -0
@@ -1175,4 +1175,20 @@ enum mall_stream_type {SUBVP_MAIN ,// subvp in use, this stream is main stream SUBVP_PHANTOM, // subvp in use, this stream is a phantom stream }; + +enum dc_power_source_type { +DC_POWER_SOURCE_AC ,// wall power +DC_POWER_SOURCE_DC ,// battery power +}; + +struct dc_state_create_params { +enum dc_power_source_type power_source; +}; + +struct dc_commit_streams_params { +struct dc_stream_state **streams; +uint8_t stream_count; +enum dc_power_source_type power_source; +}; +#endif /* DC_TYPES_H_ */
drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h +2 -0
@@ -215,6 +215,8 @@ struct dml2_configuration_options {unsigned int max_segments_per_hubp;unsigned int det_segment_size;bool map_dc_pipes_with_callbacks; + +bool use_clock_dc_limits; };/*
drivers/gpu/drm/amd/display/dc/inc/core_types.h +3 -0
@@ -518,6 +518,7 @@ struct bw_context {union bw_output bw;struct display_mode_lib dml;struct dml2_context *dml2; +struct dml2_context *dml2_dc_power_source; };struct dc_dmub_cmd {
@@ -606,6 +607,8 @@ struct dc_state {struct {unsigned int stutter_period_us; } perf_params; + +enum dc_power_source_type power_source; };struct replay_context {
drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c +14 -2
@@ -1799,7 +1799,9 @@ bool dcn32_validate_bandwidth(struct dc *dc,bool out = false;if (dc->debug.using_dml2) - out =dml2_validate (dc, context, context->bw_ctx.dml2, fast_validate); + out =dml2_validate (dc, context, + context->power_source ==DC_POWER_SOURCE_DC ? context->bw_ctx.dml2_dc_power_source : context->bw_ctx.dml2, + fast_validate);else out =dml1_validate (dc, context, fast_validate);return out;
@@ -1997,10 +1999,20 @@ void dcn32_calculate_wm_and_dlg(struct dc *dc, struct dc_state *context,static void dcn32_update_bw_bounding_box (struct dc *dc,struct clk_bw_params *bw_params) { +struct dml2_configuration_options dml2_opt = dc->dml2_options; +DC_FP_START (); +dcn32_update_bw_bounding_box_fpu (dc, bw_params); + + dml2_opt.use_clock_dc_limits = false;if (dc->debug.using_dml2 && dc->current_state && dc->current_state->bw_ctx.dml2) -dml2_reinit (dc, &dc->dml2_options, &dc->current_state->bw_ctx.dml2); +dml2_reinit (dc, &dml2_opt, &dc->current_state->bw_ctx.dml2); + + dml2_opt.use_clock_dc_limits = true; +if (dc->debug.using_dml2 && dc->current_state && dc->current_state->bw_ctx.dml2_dc_power_source) +dml2_reinit (dc, &dml2_opt, &dc->current_state->bw_ctx.dml2_dc_power_source); +DC_FP_END (); }
drivers/gpu/drm/amd/display/dc/resource/dcn321/dcn321_resource.c +11 -1
@@ -1579,10 +1579,20 @@ static struct dc_cap_funcs cap_funcs = {static void dcn321_update_bw_bounding_box (struct dc *dc,struct clk_bw_params *bw_params) { +struct dml2_configuration_options dml2_opt = dc->dml2_options; +DC_FP_START (); +dcn321_update_bw_bounding_box_fpu (dc, bw_params); + + dml2_opt.use_clock_dc_limits = false;if (dc->debug.using_dml2 && dc->current_state && dc->current_state->bw_ctx.dml2) -dml2_reinit (dc, &dc->dml2_options, &dc->current_state->bw_ctx.dml2); +dml2_reinit (dc, &dml2_opt, &dc->current_state->bw_ctx.dml2); + + dml2_opt.use_clock_dc_limits = true; +if (dc->debug.using_dml2 && dc->current_state && dc->current_state->bw_ctx.dml2_dc_power_source) +dml2_reinit (dc, &dml2_opt, &dc->current_state->bw_ctx.dml2_dc_power_source); +DC_FP_END (); }
drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c +3 -1
@@ -1734,7 +1734,9 @@ static bool dcn35_validate_bandwidth(struct dc *dc, {bool out = false; - out =dml2_validate (dc, context, context->bw_ctx.dml2, fast_validate); + out =dml2_validate (dc, context, + context->power_source ==DC_POWER_SOURCE_DC ? context->bw_ctx.dml2_dc_power_source : context->bw_ctx.dml2, + fast_validate);if (fast_validate)return out;
drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c +3 -1
@@ -1714,7 +1714,9 @@ static bool dcn351_validate_bandwidth(struct dc *dc, {bool out = false; - out =dml2_validate (dc, context, context->bw_ctx.dml2, fast_validate); + out =dml2_validate (dc, context, + context->power_source ==DC_POWER_SOURCE_DC ? context->bw_ctx.dml2_dc_power_source : context->bw_ctx.dml2, + fast_validate);if (fast_validate)return out;
Signature · 1 line
2.34.1
PATCH 20/43 drm/amd/display: add root clock control function pointer to fix display corruption
In reply to [email protected]From: "Xi (Alex) Liu" <[email protected]>
[Why and how]
External display has corruption because no root clock control function. Add the function pointer to fix the issue.
--- drivers/gpu/drm/amd/display/dc/hwss/dcn351/dcn351_init.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/hwss/dcn351/dcn351_init.c +1 -0
@@ -145,6 +145,7 @@ static const struct hwseq_private_funcs dcn351_private_funcs = {//.hubp_pg_control = dcn35_hubp_pg_control, .enable_power_gating_plane = dcn35_enable_power_gating_plane, .dpp_root_clock_control = dcn35_dpp_root_clock_control, + .dpstream_root_clock_control = dcn35_dpstream_root_clock_control, .program_all_writeback_pipes_in_tree = dcn30_program_all_writeback_pipes_in_tree, .update_odm = dcn35_update_odm, .set_hdr_multiplier = dcn10_set_hdr_multiplier,
Signature · 1 line
2.34.1
PATCH 22/43 drm/amd/display: remove context->dml2 dependency from DML21 wrapper
In reply to [email protected]From: Joshua Aberback <[email protected]>
[Why]
When the DML2 wrapper explicitly accesses context->dml2, that creates a dependency on where dc saves the DML object. This dependency makes it harder to have multiple co-existing DML objects, which we would like to have for upcoming functionality.
[How]
- make all DML21 interfaces take in a DML2 object as parameter
- remove all references to context->dml2, use parameter instead
--- drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.c | 6 +++--- drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h | 1 + .../gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c | 2 +- .../gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c | 2 +- .../drm/amd/display/dc/resource/dcn351/dcn351_resource.c | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.c +3 -3
@@ -690,13 +690,13 @@ static void dml2_apply_debug_options(const struct dc *dc, struct dml2_context *d } } -bool dml2_validate (const struct dc *in_dc,struct dc_state *context,bool fast_validate) +bool dml2_validate (const struct dc *in_dc,struct dc_state *context,struct dml2_context *dml2,bool fast_validate) {bool out = false; -if (!(context->bw_ctx.dml2)) +if (!dml2)return false; -dml2_apply_debug_options (in_dc, context->bw_ctx.dml2); +dml2_apply_debug_options (in_dc, dml2);/* Use dml_validate_only for fast_validate path */
drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h +1 -0
@@ -268,6 +268,7 @@ void dml2_reinit(const struct dc *in_dc,*/ bool dml2_validate (const struct dc *in_dc,struct dc_state *context, +struct dml2_context *dml2,bool fast_validate);/*
drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c +1 -1
@@ -1799,7 +1799,7 @@ bool dcn32_validate_bandwidth(struct dc *dc,bool out = false;if (dc->debug.using_dml2) - out =dml2_validate (dc, context, fast_validate); + out =dml2_validate (dc, context, context->bw_ctx.dml2, fast_validate);else out =dml1_validate (dc, context, fast_validate);return out;
drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c +1 -1
@@ -1734,7 +1734,7 @@ static bool dcn35_validate_bandwidth(struct dc *dc, {bool out = false; - out =dml2_validate (dc, context, fast_validate); + out =dml2_validate (dc, context, context->bw_ctx.dml2, fast_validate);if (fast_validate)return out;
drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c +1 -1
@@ -1714,7 +1714,7 @@ static bool dcn351_validate_bandwidth(struct dc *dc, {bool out = false; - out =dml2_validate (dc, context, fast_validate); + out =dml2_validate (dc, context, context->bw_ctx.dml2, fast_validate);if (fast_validate)return out;
Signature · 1 line
2.34.1
PATCH 27/43 drm/amd/display: 3.2.279
In reply to [email protected]From: Aric Cyr <[email protected]>
This version pairs with DMUB FW Release 0.0.211.0 for dcn314, dcn35, dcn351 and brings along the following:
- Fix underflow in subvp/non-subvp configs
- Fix compiler warnings
- Add handling for DC power mode
- Add extra logging for DMUB, HUBP and OTG
- Add timing pixel encoding for mst mode validation
- Expand supported Replay residency mode
- Allow HPO PG and RCG for DCN35
- Update pipe topology log to support subvp
- Disable Z8 minimum stutter period check for DCN35
- Enable RCO for HDMISTREAMCLK in DCN35
--- 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
@@ -51,7 +51,7 @@ struct aux_payload;struct set_config_cmd_payload ;struct dmub_notification ; -#define DC_VER "3.2.278" +#define DC_VER "3.2.279"#define MAX_SURFACES 3#define MAX_PLANES 6
Signature · 1 line
2.34.1
PATCH 26/43 drm/amd/display: Allow RCG for Static Screen + LVP for DCN35
In reply to [email protected]From: Roman Li <[email protected]>
[Why]
We want to block IPS2 for static screen but allow it for power state transitions.
[How]
Set DalDisableIPS=6 for DCN35 which allows:
1. RCG during static screen
2. RCG during LVP
3. IPS2 for display off / S0i3
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -1
@@ -1726,8 +1726,10 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)if (amdgpu_dc_debug_mask &DC_DISABLE_IPS ) init_data.flags.disable_ips =DMUB_IPS_DISABLE_ALL ; +else + init_data.flags.disable_ips =DMUB_IPS_RCG_IN_ACTIVE_IPS2_IN_OFF ; - init_data.flags.disable_ips_in_vpb =1 ; + init_data.flags.disable_ips_in_vpb =0 ;/* Enable DWB for tested platforms only */ if (amdgpu_ip_version (adev,DCE_HWIP ,0 ) >=IP_VERSION (3 ,0 ,0 ))
Signature · 1 line
2.34.1
PATCH 40/43 drm/amd/display: Add code comments clock and encode code
In reply to [email protected]From: Rodrigo Siqueira <[email protected]>
This commit adds some comments to make easier to understand the clock update for DCN 201, the encode function, and other minor comments.
--- .../amd/display/dc/clk_mgr/dcn201/dcn201_clk_mgr.c | 11 +++++++++++ drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hubbub.c | 2 +- .../display/dc/dcn31/dcn31_hpo_dp_stream_encoder.c | 4 ++++ drivers/gpu/drm/amd/display/dc/resource/Makefile | 6 ------ 4 files changed, 16 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn201/dcn201_clk_mgr.c +11 -0
@@ -100,7 +100,15 @@ static void dcn201_update_clocks(struct clk_mgr *clk_mgr_base,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; +/* force_clock_mode 0x1: force reset the clock even it is the +* same clock as long as it is in Passive level. +*/ dcn2_read_clocks_from_hw_dentist (clk_mgr_base); }
@@ -150,11 +158,14 @@ static void dcn201_update_clocks(struct clk_mgr *clk_mgr_base,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 dcn20_update_clocks_update_dpp_dto (clk_mgr, context, safe_to_lower);dcn20_update_clocks_update_dentist (clk_mgr, context); }else { +// if clock is being raised, increase refclk before lowering DTO if (update_dppclk || update_dispclk)dcn20_update_clocks_update_dentist (clk_mgr, context); +// always update dtos unless clock is lowered and not safe to lower dcn20_update_clocks_update_dpp_dto (clk_mgr, context, safe_to_lower); } }
drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hubbub.c +1 -1
@@ -103,5 +103,5 @@ void hubbub201_construct(struct dcn20_hubbub *hubbub, hubbub->masks = hubbub_mask; hubbub->debug_test_index_pstate =0xB ; - hubbub->detile_buf_size =164 *1024 ; + hubbub->detile_buf_size =164 *1024 ;/* 164KB for DCN2.0 */ }
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hpo_dp_stream_encoder.c +4 -0
@@ -474,6 +474,10 @@ static void dcn31_hpo_dp_stream_enc_update_dp_info_packets( &info_frame->hdrsmd, true); +/* packetIndex 4 is used for send immediate sdp message, and please +* use other packetIndex (such as 5,6) for other info packet +*/ +if (info_frame->adaptive_sync.valid) enc->vpg->funcs->update_generic_info_packet( enc->vpg,
drivers/gpu/drm/amd/display/dc/resource/Makefile +0 -6
@@ -102,10 +102,6 @@ AMD_DISPLAY_FILES += $(AMD_DAL_RESOURCE_DCN21) ############################################################################### -############################################################################### - -############################################################################### - RESOURCE_DCN30 = dcn30_resource.o AMD_DAL_RESOURCE_DCN30 = $(addprefix $(AMDDALPATH)/dc/resource/dcn30/,$(RESOURCE_DCN30))
@@ -202,6 +198,4 @@ AMD_DISPLAY_FILES += $(AMD_DAL_RESOURCE_DCN351) ############################################################################### -############################################################################### - endif
Signature · 1 line
2.34.1
PATCH 25/43 drm/amd/display: Fix compiler warnings on high compiler warning levels
In reply to [email protected]From: Aric Cyr <[email protected]>
[why]
Enabling higher compiler warning levels results in many issues that can be trivially resolved as well as some potentially critical issues.
[how]
Fix all compiler warnings found with various compilers and higher warning levels. Primarily, potentially uninitialized variables and unreachable code.
--- drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c | 2 -- .../drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c | 3 ++- .../drm/amd/display/dc/clk_mgr/dcn301/vg_clk_mgr.c | 3 ++- .../amd/display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c | 3 ++- .../amd/display/dc/clk_mgr/dcn316/dcn316_clk_mgr.c | 3 ++- .../gpu/drm/amd/display/dc/core/dc_hw_sequencer.c | 2 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 2 +- drivers/gpu/drm/amd/display/dc/dce/dce_transform.c | 2 +- .../drm/amd/display/dc/dcn10/dcn10_link_encoder.c | 1 - .../amd/display/dc/dcn32/dcn32_resource_helpers.c | 2 +- .../amd/display/dc/dcn35/dcn35_dio_link_encoder.c | 1 - .../gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 2 -- .../amd/display/dc/dml/dcn30/display_mode_vba_30.c | 1 - .../amd/display/dc/dml/dcn31/display_mode_vba_31.c | 1 - .../gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c | 2 +- .../display/dc/dml/dcn314/display_mode_vba_314.c | 1 - .../dc/dml/dcn32/display_mode_vba_util_32.c | 14 ++++++-------- .../gpu/drm/amd/display/dc/dml/dcn35/dcn35_fpu.c | 2 +- .../gpu/drm/amd/display/dc/dml/dcn351/dcn351_fpu.c | 2 +- .../drm/amd/display/dc/dml2/display_mode_core.c | 12 +++++------- drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c | 2 +- drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 8 ++++---- .../drm/amd/display/dc/hwss/dce110/dce110_hwseq.c | 2 +- .../drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c | 2 +- drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h | 2 +- .../amd/display/dc/link/accessories/link_dp_cts.c | 2 +- drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 2 +- .../dc/link/protocols/link_dp_training_dpia.c | 4 ++-- .../display/dc/resource/dce112/dce112_resource.c | 2 -- .../display/dc/resource/dce120/dce120_resource.c | 2 +- .../amd/display/dc/resource/dcn30/dcn30_resource.c | 2 +- .../amd/display/dc/resource/dcn31/dcn31_resource.c | 2 +- .../display/dc/resource/dcn316/dcn316_resource.c | 2 +- .../drm/amd/display/modules/color/color_gamma.c | 2 +- .../drm/amd/display/modules/hdcp/hdcp2_execution.c | 2 +- 35 files changed, 44 insertions(+), 55 deletions(-)
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +0 -2
@@ -1594,8 +1594,6 @@ static bool bios_parser_is_device_id_supported(return (le16_to_cpu (bp->object_info_tbl.v1_5->supporteddevices) & mask) !=0 ;break ; } - -return false; } static uint32_t bios_parser_get_ss_entry_number(
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c +2 -1
@@ -642,7 +642,8 @@ static void rn_clk_mgr_helper_populate_bw_params(struct clk_bw_params *bw_params j =-1 ; -ASSERT (PP_SMU_NUM_FCLK_DPM_LEVELS <=MAX_NUM_DPM_LVL ); +static_assert (PP_SMU_NUM_FCLK_DPM_LEVELS <=MAX_NUM_DPM_LVL , +"number of reported FCLK DPM levels exceed maximum" );/* Find lowest DPM, FCLK is filled in reverse order*/
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn301/vg_clk_mgr.c +2 -1
@@ -566,7 +566,8 @@ static void vg_clk_mgr_helper_populate_bw_params( j =-1 ; -ASSERT (VG_NUM_FCLK_DPM_LEVELS <=MAX_NUM_DPM_LVL ); +static_assert (VG_NUM_FCLK_DPM_LEVELS <=MAX_NUM_DPM_LVL , +"number of reported FCLK DPM levels exceeds maximum" );/* Find lowest DPM, FCLK is filled in reverse order*/
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c +2 -1
@@ -562,7 +562,8 @@ static void dcn31_clk_mgr_helper_populate_bw_params(struct clk_mgr_internal *clk j =-1 ; -ASSERT (NUM_DF_PSTATE_LEVELS <=MAX_NUM_DPM_LVL ); +static_assert (NUM_DF_PSTATE_LEVELS <=MAX_NUM_DPM_LVL , +"number of reported pstate levels exceeds maximum" );/* Find lowest DPM, FCLK is filled in reverse order*/
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn316/dcn316_clk_mgr.c +2 -1
@@ -480,7 +480,8 @@ static void dcn316_clk_mgr_helper_populate_bw_params( j =-1 ; -ASSERT (NUM_DF_PSTATE_LEVELS <=MAX_NUM_DPM_LVL ); +static_assert (NUM_DF_PSTATE_LEVELS <=MAX_NUM_DPM_LVL , +"number of reported pstate levels exceeds maximum" );/* Find lowest DPM, FCLK is filled in reverse order*/
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +1 -1
@@ -558,7 +558,7 @@ void hwss_build_fast_sequence(struct dc *dc,struct dc_dmub_cmd *dc_dmub_cmd, unsigned int dmub_cmd_count, struct block_sequence block_sequence[], - int *num_steps, + unsigned int *num_steps, struct pipe_ctx *pipe_ctx, struct dc_stream_status *stream_status) {
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +1 -1
@@ -1316,7 +1316,7 @@ static void dc_dmub_srv_notify_idle(const struct dc *dc, bool allow_idle)static void dc_dmub_srv_exit_low_power_state (const struct dc *dc) {struct dc_dmub_srv *dc_dmub_srv; -uint32_t rcg_exit_count, ips1_exit_count, ips2_exit_count; +uint32_t rcg_exit_count =0 , ips1_exit_count =0 , ips2_exit_count =0 ;if (dc->debug.dmcub_emulation)return ;
drivers/gpu/drm/amd/display/dc/dce/dce_transform.c +1 -1
@@ -1408,7 +1408,7 @@ void dce110_opp_set_csc_default(static void program_pwl (struct dce_transform *xfm_dce,const struct pwl_params *params) { -int retval; +uint32_t retval;uint8_t max_tries =10 ;uint8_t counter =0 ;uint32_t i =0 ;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c +0 -1
@@ -1439,7 +1439,6 @@ enum signal_type dcn10_get_dig_mode(default :return SIGNAL_TYPE_NONE ; } -return SIGNAL_TYPE_NONE ; } void dcn10_link_encoder_get_max_link_cap(struct link_encoder *enc,
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c +1 -1
@@ -382,7 +382,7 @@ void dcn32_set_det_allocations(struct dc *dc, struct dc_state *context, {int i, pipe_cnt;struct resource_context *res_ctx = &context->res_ctx; -struct pipe_ctx *pipe; +struct pipe_ctx *pipe =0 ;bool disable_unbounded_requesting = dc->debug.disable_z9_mpc || dc->debug.disable_unbounded_requesting;for (i =0 , pipe_cnt =0 ; i < dc->res_pool->pipe_count; i++) {
drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dio_link_encoder.c +0 -1
@@ -80,7 +80,6 @@ enum signal_type dcn35_get_dig_mode(default :return SIGNAL_TYPE_NONE ; } -return SIGNAL_TYPE_NONE ; } void dcn35_link_encoder_setup(
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c +0 -2
@@ -1102,8 +1102,6 @@ static enum dcn_zstate_support_state decide_zstate_support(struct dc *dc, struc }else {return DCN_ZSTATE_SUPPORT_DISALLOW ; } - -return DCN_ZSTATE_SUPPORT_DISALLOW ; } static void dcn20_adjust_freesync_v_startup(
drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c +0 -1
@@ -3535,7 +3535,6 @@ static double TruncToValidBPP(return DesiredBPP; } } -return BPP_INVALID ; }void dml30_ModeSupportAndSystemConfigurationFull (struct display_mode_lib *mode_lib)
drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c +0 -1
@@ -3679,7 +3679,6 @@ static double TruncToValidBPP(return DesiredBPP; } } -return BPP_INVALID ; } static noinline void CalculatePrefetchSchedulePerPlane(
drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c +1 -1
@@ -310,7 +310,7 @@ int dcn314_populate_dml_pipes_from_context_fpu(struct dc *dc, struct dc_state *c {int i, pipe_cnt;struct resource_context *res_ctx = &context->res_ctx; -struct pipe_ctx *pipe; +struct pipe_ctx *pipe =0 ;bool upscaled = false;const unsigned int max_allowed_vblank_nom =1023 ;
drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c +0 -1
@@ -3788,7 +3788,6 @@ static double TruncToValidBPP(return DesiredBPP; } } -return BPP_INVALID ; } static noinline void CalculatePrefetchSchedulePerPlane(
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c +6 -8
@@ -1650,6 +1650,8 @@ double dml32_TruncToValidBPP( MaxLinkBPP =2 * MaxLinkBPP; } + *RequiredSlots =dml_ceil (DesiredBPP / MaxLinkBPP *64 ,1 ); +if (DesiredBPP ==0 ) {if (DSCEnable) {if (MaxLinkBPP < MinDSCBPP)
@@ -1676,10 +1678,6 @@ double dml32_TruncToValidBPP(else return DesiredBPP; } - - *RequiredSlots =dml_ceil (DesiredBPP / MaxLinkBPP *64 ,1 ); - -return BPP_INVALID ; }// TruncToValidBPP double dml32_RequiredDTBCLK(
@@ -4291,7 +4289,7 @@ void dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport(unsigned int i, j, k;unsigned int SurfaceWithMinActiveFCLKChangeMargin =0 ;unsigned int DRAMClockChangeSupportNumber =0 ; -unsigned int LastSurfaceWithoutMargin; +unsigned int LastSurfaceWithoutMargin =0 ;unsigned int DRAMClockChangeMethod =0 ;bool FoundFirstSurfaceWithMinActiveFCLKChangeMargin = false;double MinActiveFCLKChangeMargin =0. ;
@@ -5656,9 +5654,9 @@ void dml32_CalculateStutterEfficiency(double LastZ8StutterPeriod =0.0 ;double LastStutterPeriod =0.0 ;unsigned int TotalNumberOfActiveOTG =0 ; -double doublePixelClock; -unsigned int doubleHTotal; -unsigned int doubleVTotal; +double doublePixelClock =0 ; +unsigned int doubleHTotal =0 ; +unsigned int doubleVTotal =0 ;bool SameTiming = true;double DETBufferingTimeY;double SwathWidthYCriticalSurface =0.0 ;
drivers/gpu/drm/amd/display/dc/dml/dcn35/dcn35_fpu.c +1 -1
@@ -439,7 +439,7 @@ int dcn35_populate_dml_pipes_from_context_fpu(struct dc *dc, {int i, pipe_cnt;struct resource_context *res_ctx = &context->res_ctx; -struct pipe_ctx *pipe; +struct pipe_ctx *pipe =0 ;bool upscaled = false;const unsigned int max_allowed_vblank_nom =1023 ;
drivers/gpu/drm/amd/display/dc/dml/dcn351/dcn351_fpu.c +1 -1
@@ -474,7 +474,7 @@ int dcn351_populate_dml_pipes_from_context_fpu(struct dc *dc, {int i, pipe_cnt;struct resource_context *res_ctx = &context->res_ctx; -struct pipe_ctx *pipe; +struct pipe_ctx *pipe =0 ;bool upscaled = false;const unsigned int max_allowed_vblank_nom =1023 ;
drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c +5 -7
@@ -2784,6 +2784,8 @@ static dml_float_t TruncToValidBPP( } } + *RequiredSlots = (dml_uint_t)(dml_ceil (DesiredBPP / MaxLinkBPP *64 ,1 )); +if (DesiredBPP ==0 ) {if (DSCEnable) {if (MaxLinkBPP < MinDSCBPP) {
@@ -2812,10 +2814,6 @@ static dml_float_t TruncToValidBPP(return DesiredBPP; } } - - *RequiredSlots = (dml_uint_t)(dml_ceil (DesiredBPP / MaxLinkBPP *64 ,1 )); - -return __DML_DPP_INVALID__; }// TruncToValidBPP static void CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport(
@@ -3792,9 +3790,9 @@ static void CalculateStutterEfficiency(struct display_mode_lib_scratch_st *scratdml_bool_t FoundCriticalSurface = false;dml_uint_t TotalNumberOfActiveOTG =0 ; -dml_float_t SinglePixelClock; -dml_uint_t SingleHTotal; -dml_uint_t SingleVTotal; +dml_float_t SinglePixelClock =0 ; +dml_uint_t SingleHTotal =0 ; +dml_uint_t SingleVTotal =0 ;dml_bool_t SameTiming = true;dml_float_t LastStutterPeriod =0.0 ;
drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c +1 -1
@@ -224,7 +224,7 @@ static int find_dml_pipe_idx_by_plane_id(struct dml2_context *ctx, unsigned intstatic bool get_plane_id (struct dml2_context *dml2,const struct dc_state *state,const struct dc_plane_state *plane,unsigned int stream_id,unsigned int plane_index,unsigned int *plane_id) { -int i, j; +unsigned int i, j;bool is_plane_duplicate = dml2->v20.scratch.plane_duplicate_exists;if (!plane_id)
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c +4 -4
@@ -458,7 +458,7 @@ bool dc_dsc_compute_bandwidth_range(bool is_dsc_possible = false;struct dsc_enc_caps dsc_enc_caps;struct dsc_enc_caps dsc_common_caps; -struct dc_dsc_config config; +struct dc_dsc_config config = {0 };struct dc_dsc_config_options options = {0 }; options.dsc_min_slice_height_override = dsc_min_slice_height_override;
@@ -868,9 +868,9 @@ static bool setup_dsc_config( struct dc_dsc_config *dsc_cfg) {struct dsc_enc_caps dsc_common_caps; -int max_slices_h; -int min_slices_h; -int num_slices_h; +int max_slices_h =0 ; +int min_slices_h =0 ; +int num_slices_h =0 ;int pic_width;int slice_width;int target_bpp;
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +1 -1
@@ -2188,7 +2188,7 @@ static void dce110_setup_audio_dto(struct dc *dc, struct dc_state *context) { - int i; + unsigned int i;/* program audio wall clock. use HDMI as clock source if HDMI * audio active. Otherwise, use DP as clock source
drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c +1 -1
@@ -885,7 +885,7 @@ bool dcn30_apply_idle_power_optimizations(struct dc *dc, bool enable) {union dmub_rb_cmd cmd;uint32_t tmr_delay =0 , tmr_scale =0 ; -struct dc_cursor_attributes cursor_attr; +struct dc_cursor_attributes cursor_attr = {0 };bool cursor_cache_enable = false;struct dc_stream_state *stream =NULL ;struct dc_plane_state *plane =NULL ;
drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h +1 -1
@@ -480,7 +480,7 @@ void hwss_build_fast_sequence(struct dc *dc,struct dc_dmub_cmd *dc_dmub_cmd, unsigned int dmub_cmd_count, struct block_sequence block_sequence[], - int *num_steps, + unsigned int *num_steps, struct pipe_ctx *pipe_ctx, struct dc_stream_status *stream_status);
drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_cts.c +1 -1
@@ -884,7 +884,7 @@ void dp_set_preferred_link_settings(struct dc *dc, {int i;struct pipe_ctx *pipe; -struct dc_stream_state *link_stream; +struct dc_stream_state *link_stream =0 ;struct dc_link_settings store_settings = *link_setting; link->preferred_link_setting = store_settings;
drivers/gpu/drm/amd/display/dc/link/link_dpms.c +1 -1
@@ -127,7 +127,7 @@ void link_blank_dp_stream(struct dc_link *link, bool hw_init)if (link->ep_type ==DISPLAY_ENDPOINT_PHY && link->link_enc->funcs->get_dig_frontend && link->link_enc->funcs->is_dig_enabled (link->link_enc)) { -unsigned int fe = link->link_enc->funcs->get_dig_frontend (link->link_enc); +int fe = link->link_enc->funcs->get_dig_frontend (link->link_enc);if (fe !=ENGINE_ID_UNKNOWN )for (j =0 ; j < dc->res_pool->stream_enc_count; j++) {
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training_dpia.c +2 -2
@@ -291,7 +291,7 @@ static enum link_training_result dpia_training_cr_non_transparent( {enum link_training_result result =LINK_TRAINING_CR_FAIL_LANE0 ;uint8_t repeater_cnt =0 ;/* Number of hops/repeaters in display path. */ -enum dc_status status; +enum dc_status status =DC_ERROR_UNEXPECTED ;uint32_t retries_cr =0 ;/* Number of consecutive attempts with same VS or PE. */ uint32_t retry_count =0 ;uint32_t wait_time_microsec =TRAINING_AUX_RD_INTERVAL ;/* From DP spec, CR read interval is always 100us. */
@@ -617,7 +617,7 @@ static enum link_training_result dpia_training_eq_non_transparent(enum link_training_result result =LINK_TRAINING_EQ_FAIL_EQ ;uint8_t repeater_cnt =0 ;/* Number of hops/repeaters in display path. */ uint32_t retries_eq =0 ; -enum dc_status status; +enum dc_status status =DC_ERROR_UNEXPECTED ;enum dc_dp_training_pattern tr_pattern;uint32_t wait_time_microsec =0 ;enum dc_lane_count lane_count = lt_settings->link_settings.lane_count;
drivers/gpu/drm/amd/display/dc/resource/dce112/dce112_resource.c +0 -2
@@ -864,8 +864,6 @@ static struct clock_source *find_matching_pll(default :return NULL ; } - -return NULL ; } static enum dc_status build_mapped_resource(
drivers/gpu/drm/amd/display/dc/resource/dce120/dce120_resource.c +1 -1
@@ -1060,7 +1060,7 @@ static bool dce120_resource_construct(struct irq_service_init_data irq_init_data;static const struct resource_create_funcs *res_funcs;bool is_vg20 =ASICREV_IS_VEGA20_P (ctx->asic_id.hw_internal_rev); -uint32_t pipe_fuses; +uint32_t pipe_fuses =0 ; ctx->dc_bios->regs = &bios_regs;
drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c +1 -1
@@ -1639,7 +1639,7 @@ noinline bool dcn30_internal_validate_bw(int split[MAX_PIPES ] = {0 };bool merge[MAX_PIPES ] = { false };bool newly_split[MAX_PIPES ] = { false }; -int pipe_cnt, i, pipe_idx, vlevel; +int pipe_cnt, i, pipe_idx, vlevel =0 ;struct vba_vars_st *vba = &context->bw_ctx.dml.vba;ASSERT (pipes);
drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c +1 -1
@@ -1644,7 +1644,7 @@ int dcn31_populate_dml_pipes_from_context( {int i, pipe_cnt;struct resource_context *res_ctx = &context->res_ctx; -struct pipe_ctx *pipe; +struct pipe_ctx *pipe =0 ;bool upscaled = false;DC_FP_START ();
drivers/gpu/drm/amd/display/dc/resource/dcn316/dcn316_resource.c +1 -1
@@ -1613,7 +1613,7 @@ static int dcn316_populate_dml_pipes_from_context( {int i, pipe_cnt;struct resource_context *res_ctx = &context->res_ctx; -struct pipe_ctx *pipe; +struct pipe_ctx *pipe =0 ;const int max_usable_det = context->bw_ctx.dml.ip.config_return_buffer_size_in_kbytes -DCN3_16_MIN_COMPBUF_SIZE_KB ;DC_FP_START ();
drivers/gpu/drm/amd/display/modules/color/color_gamma.c +1 -1
@@ -1059,7 +1059,7 @@ static bool build_freesync_hdr(struct pwl_float_data_ex *rgb_regamma,struct fixed31_32 min_display;struct fixed31_32 max_content;struct fixed31_32 clip = dc_fixpt_one; -struct fixed31_32 output; +struct fixed31_32 output = dc_fixpt_zero;bool use_eetf = false;bool is_clipped = false;struct fixed31_32 sdr_white_level;
drivers/gpu/drm/amd/display/modules/hdcp/hdcp2_execution.c +1 -1
@@ -151,7 +151,7 @@ static enum mod_hdcp_status check_pairing_info_available(struct mod_hdcp *hdcp)static enum mod_hdcp_status poll_l_prime_available (struct mod_hdcp *hdcp) { -enum mod_hdcp_status status; +enum mod_hdcp_status status =MOD_HDCP_STATUS_FAILURE ;uint8_t size;uint16_t max_wait =20 ;// units of ms uint16_t num_polls =5 ;
Signature · 1 line
2.34.1
PATCH 32/43 drm/amd/display: Update DSC compute parameter calculation
In reply to [email protected]From: Rodrigo Siqueira <[email protected]>
Adjust bytes per pixel calculation to use div_u64.
--- drivers/gpu/drm/amd/display/dc/dsc/rc_calc_dpi.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dsc/rc_calc_dpi.c +3 -4
@@ -101,7 +101,6 @@ int dscc_compute_dsc_parameters(const struct drm_dsc_config *pps, {int ret;struct drm_dsc_config dsc_cfg; -unsigned long long tmp; dsc_params->pps = *pps; dsc_params->pps.initial_scale_value =8 * rc->rc_model_size / (rc->rc_model_size - rc->initial_fullness_offset);
@@ -112,9 +111,9 @@ int dscc_compute_dsc_parameters(const struct drm_dsc_config *pps, dsc_cfg.mux_word_size = dsc_params->pps.bits_per_component <=10 ?48 :64 ; ret =drm_dsc_compute_rc_parameters (&dsc_cfg); - tmp = (unsigned long long )dsc_cfg.slice_chunk_size *0x10000000 + (dsc_cfg.slice_width -1 ); -do_div (tmp, (uint32_t )dsc_cfg.slice_width);//ROUND-UP - dsc_params->bytes_per_pixel = (uint32_t )tmp; + dsc_params->bytes_per_pixel = + (uint32_t )(div_u64 (((uint64_t )dsc_cfg.slice_chunk_size *0x10000000 + (dsc_cfg.slice_width -1 )), + (uint32_t )dsc_cfg.slice_width));/* Round-up */ copy_pps_fields (&dsc_params->pps, &dsc_cfg); dsc_params->rc_buffer_model_size = dsc_cfg.rc_bits;
Signature · 1 line
2.34.1
PATCH 30/43 drm/amd/display: Enable cur_rom_en even if cursor degamma is not enabled
In reply to [email protected]From: Rodrigo Siqueira <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dpp/dcn30/dcn30_dpp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dpp/dcn30/dcn30_dpp.c +1 -3
@@ -395,9 +395,7 @@ void dpp3_set_cursor_attributes(if (color_format ==CURSOR_MODE_COLOR_PRE_MULTIPLIED_ALPHA || color_format ==CURSOR_MODE_COLOR_UN_PRE_MULTIPLIED_ALPHA ) { -if (cursor_attributes->attribute_flags.bits.ENABLE_CURSOR_DEGAMMA) { - cur_rom_en =1 ; - } + cur_rom_en =1 ; } REG_UPDATE_3(CURSOR0_CONTROL,
Signature · 1 line
2.34.1
PATCH 35/43 drm/amd/display: Remove redundant RESERVE0 and RESERVE1
In reply to [email protected]From: Rodrigo Siqueira <[email protected]>
This commit drops the RESERVE0 and RESERVE1 since both of them can be summarized as RESERVED.
--- drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_dp_types.h +1 -2
@@ -1222,8 +1222,7 @@ union replay_enable_and_configuration { unsigned char FREESYNC_PANEL_REPLAY_MODE :1; unsigned char TIMING_DESYNC_ERROR_VERIFICATION :1; unsigned char STATE_TRANSITION_ERROR_DETECTION :1; - unsigned char RESERVED0 :1; - unsigned char RESERVED1 :4; + unsigned char RESERVED :5; } bits;unsigned char raw; };
Signature · 1 line
2.34.1
PATCH 29/43 drm/amd/display: Set alpha enable to 0 for some specific formats
In reply to [email protected]From: Rodrigo Siqueira <[email protected]>
Set alpha_en to 0 in some specific color formats.
--- drivers/gpu/drm/amd/display/dc/dpp/dcn30/dcn30_dpp.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/display/dc/dpp/dcn30/dcn30_dpp.c +4 -0
@@ -293,9 +293,11 @@ void dpp3_cnv_setup (break ;case SURFACE_PIXEL_FORMAT_GRPH_RGB111110_FIX : pixel_format =112 ; + alpha_en =0 ;break ;case SURFACE_PIXEL_FORMAT_GRPH_BGR101111_FIX : pixel_format =113 ; + alpha_en =0 ;break ;case SURFACE_PIXEL_FORMAT_VIDEO_ACrYCb2101010: pixel_format =114 ;
@@ -319,9 +321,11 @@ void dpp3_cnv_setup (break ;case SURFACE_PIXEL_FORMAT_GRPH_RGB111110_FLOAT : pixel_format =118 ; + alpha_en =0 ;break ;case SURFACE_PIXEL_FORMAT_GRPH_BGR101111_FLOAT : pixel_format =119 ; + alpha_en =0 ;break ;default :break ;
Signature · 1 line
2.34.1
PATCH 28/43 drm/amd/display: Initialize DP ref clk with the correct clock
In reply to [email protected]From: Rodrigo Siqueira <[email protected]>
--- drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +2 -2
@@ -131,8 +131,8 @@ int dce_get_dp_ref_freq_khz(struct clk_mgr *clk_mgr_base)struct clk_mgr_internal *clk_mgr =TO_CLK_MGR_INTERNAL (clk_mgr_base);int dprefclk_wdivider;int dprefclk_src_sel; -int dp_ref_clk_khz; -int target_div =600000 ; +int dp_ref_clk_khz =600000 ; +int target_div;/* ASSERT DP Reference Clock source is from DFS*/ REG_GET (DPREFCLK_CNTL ,DPREFCLK_SRC_SEL , &dprefclk_src_sel);
Signature · 1 line
2.34.1
PATCH 34/43 drm/amd/display: Add missing registers
In reply to [email protected]From: Rodrigo Siqueira <[email protected]>
--- .../include/asic_reg/dcn/dcn_3_0_3_offset.h | 20 +++++++ .../include/asic_reg/dcn/dcn_3_0_3_sh_mask.h | 11 ++++ .../include/asic_reg/dcn/dcn_3_1_2_offset.h | 4 ++ .../include/asic_reg/dcn/dcn_3_1_2_sh_mask.h | 19 ++++++ .../include/asic_reg/dcn/dcn_3_2_0_offset.h | 60 +++++++++++++++++++ .../include/asic_reg/dcn/dcn_3_2_0_sh_mask.h | 22 +++++++ .../asic_reg/dpcs/dpcs_3_0_3_sh_mask.h | 4 +- .../include/asic_reg/dpcs/dpcs_4_2_0_offset.h | 10 ++++ 8 files changed, 149 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_0_3_offset.h +20 -0
@@ -5695,6 +5695,16 @@#define mmDSCC0_DSCC_RATE_CONTROL_BUFFER2_MAX_FULLNESS_LEVEL_BASE_IDX 2#define mmDSCC0_DSCC_RATE_CONTROL_BUFFER3_MAX_FULLNESS_LEVEL 0x3035#define mmDSCC0_DSCC_RATE_CONTROL_BUFFER3_MAX_FULLNESS_LEVEL_BASE_IDX 2 +#define mmDSCC0_DSCC_TEST_DEBUG_BUS_ROTATE 0x303a +#define mmDSCC0_DSCC_TEST_DEBUG_BUS_ROTATE_BASE_IDX 2 +#define mmDSCC0_DSCC_TEST_DEBUG_DATA0 0x303b +#define mmDSCC0_DSCC_TEST_DEBUG_DATA0_BASE_IDX 2 +#define mmDSCC0_DSCC_TEST_DEBUG_DATA1 0x303c +#define mmDSCC0_DSCC_TEST_DEBUG_DATA1_BASE_IDX 2 +#define mmDSCC0_DSCC_TEST_DEBUG_DATA2 0x303d +#define mmDSCC0_DSCC_TEST_DEBUG_DATA2_BASE_IDX 2 +#define mmDSCC0_DSCC_TEST_DEBUG_DATA3 0x303e +#define mmDSCC0_DSCC_TEST_DEBUG_DATA3_BASE_IDX 2// addressBlock: dce_dc_dsc0_dispdec_dsc_dcperfmon_dc_perfmon_dispdec
@@ -5825,6 +5835,16 @@#define mmDSCC1_DSCC_RATE_CONTROL_BUFFER2_MAX_FULLNESS_LEVEL_BASE_IDX 2#define mmDSCC1_DSCC_RATE_CONTROL_BUFFER3_MAX_FULLNESS_LEVEL 0x3091#define mmDSCC1_DSCC_RATE_CONTROL_BUFFER3_MAX_FULLNESS_LEVEL_BASE_IDX 2 +#define mmDSCC1_DSCC_TEST_DEBUG_BUS_ROTATE 0x3096 +#define mmDSCC1_DSCC_TEST_DEBUG_BUS_ROTATE_BASE_IDX 2 +#define mmDSCC1_DSCC_TEST_DEBUG_DATA0 0x3097 +#define mmDSCC1_DSCC_TEST_DEBUG_DATA0_BASE_IDX 2 +#define mmDSCC1_DSCC_TEST_DEBUG_DATA1 0x3098 +#define mmDSCC1_DSCC_TEST_DEBUG_DATA1_BASE_IDX 2 +#define mmDSCC1_DSCC_TEST_DEBUG_DATA2 0x3099 +#define mmDSCC1_DSCC_TEST_DEBUG_DATA2_BASE_IDX 2 +#define mmDSCC1_DSCC_TEST_DEBUG_DATA3 0x309a +#define mmDSCC1_DSCC_TEST_DEBUG_DATA3_BASE_IDX 2// addressBlock: dce_dc_dsc1_dispdec_dsc_dcperfmon_dc_perfmon_dispdec
drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_0_3_sh_mask.h +11 -0
@@ -22265,7 +22265,9 @@#define DSC_TOP0_DSC_TOP_CONTROL__DSC_DSCCLK_R_GATE_DIS_MASK 0x00000100L//DSC_TOP0_DSC_DEBUG_CONTROL #define DSC_TOP0_DSC_DEBUG_CONTROL__DSC_DBG_EN__SHIFT 0x0 +#define DSC_TOP0_DSC_DEBUG_CONTROL__DSC_TEST_CLOCK_MUX_SEL__SHIFT 0x4#define DSC_TOP0_DSC_DEBUG_CONTROL__DSC_DBG_EN_MASK 0x00000001L +#define DSC_TOP0_DSC_DEBUG_CONTROL__DSC_TEST_CLOCK_MUX_SEL_MASK 0x00000070L// addressBlock: dce_dc_dsc0_dispdec_dsccif_dispdec
@@ -22638,6 +22640,15 @@//DSCC0_DSCC_RATE_CONTROL_BUFFER3_MAX_FULLNESS_LEVEL #define DSCC0_DSCC_RATE_CONTROL_BUFFER3_MAX_FULLNESS_LEVEL__DSCC_RATE_CONTROL_BUFFER3_MAX_FULLNESS_LEVEL__SHIFT 0x0#define DSCC0_DSCC_RATE_CONTROL_BUFFER3_MAX_FULLNESS_LEVEL__DSCC_RATE_CONTROL_BUFFER3_MAX_FULLNESS_LEVEL_MASK 0x0003FFFFL +//DSCC0_DSCC_TEST_DEBUG_BUS_ROTATE +#define DSCC0_DSCC_TEST_DEBUG_BUS_ROTATE__DSCC_TEST_DEBUG_BUS0_ROTATE__SHIFT 0x0 +#define DSCC0_DSCC_TEST_DEBUG_BUS_ROTATE__DSCC_TEST_DEBUG_BUS1_ROTATE__SHIFT 0x8 +#define DSCC0_DSCC_TEST_DEBUG_BUS_ROTATE__DSCC_TEST_DEBUG_BUS2_ROTATE__SHIFT 0x10 +#define DSCC0_DSCC_TEST_DEBUG_BUS_ROTATE__DSCC_TEST_DEBUG_BUS3_ROTATE__SHIFT 0x18 +#define DSCC0_DSCC_TEST_DEBUG_BUS_ROTATE__DSCC_TEST_DEBUG_BUS0_ROTATE_MASK 0x0000001FL +#define DSCC0_DSCC_TEST_DEBUG_BUS_ROTATE__DSCC_TEST_DEBUG_BUS1_ROTATE_MASK 0x00001F00L +#define DSCC0_DSCC_TEST_DEBUG_BUS_ROTATE__DSCC_TEST_DEBUG_BUS2_ROTATE_MASK 0x001F0000L +#define DSCC0_DSCC_TEST_DEBUG_BUS_ROTATE__DSCC_TEST_DEBUG_BUS3_ROTATE_MASK 0x1F000000L// addressBlock: dce_dc_dsc0_dispdec_dsc_dcperfmon_dc_perfmon_dispdec
drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_1_2_offset.h +4 -0
@@ -424,6 +424,8 @@#define regDTBCLK_DTO2_MODULO_BASE_IDX 2#define regDTBCLK_DTO3_MODULO 0x0022#define regDTBCLK_DTO3_MODULO_BASE_IDX 2 +#define regHDMICHARCLK0_CLOCK_CNTL 0x004a +#define regHDMICHARCLK0_CLOCK_CNTL_BASE_IDX 2#define regPHYASYMCLK_CLOCK_CNTL 0x0052#define regPHYASYMCLK_CLOCK_CNTL_BASE_IDX 2#define regPHYBSYMCLK_CLOCK_CNTL 0x0053
@@ -434,6 +436,8 @@#define regPHYDSYMCLK_CLOCK_CNTL_BASE_IDX 2#define regPHYESYMCLK_CLOCK_CNTL 0x0056#define regPHYESYMCLK_CLOCK_CNTL_BASE_IDX 2 +#define regHDMISTREAMCLK_CNTL 0x0059 +#define regHDMISTREAMCLK_CNTL_BASE_IDX 2#define regDCCG_GATE_DISABLE_CNTL3 0x005a#define regDCCG_GATE_DISABLE_CNTL3_BASE_IDX 2#define regHDMISTREAMCLK0_DTO_PARAM 0x005b
drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_1_2_sh_mask.h +19 -0
@@ -1372,6 +1372,11 @@//DTBCLK_DTO3_MODULO #define DTBCLK_DTO3_MODULO__DTBCLK_DTO3_MODULO__SHIFT 0x0#define DTBCLK_DTO3_MODULO__DTBCLK_DTO3_MODULO_MASK 0xFFFFFFFFL +//HDMICHARCLK0_CLOCK_CNTL +#define HDMICHARCLK0_CLOCK_CNTL__HDMICHARCLK0_EN__SHIFT 0x0 +#define HDMICHARCLK0_CLOCK_CNTL__HDMICHARCLK0_SRC_SEL__SHIFT 0x4 +#define HDMICHARCLK0_CLOCK_CNTL__HDMICHARCLK0_EN_MASK 0x00000001L +#define HDMICHARCLK0_CLOCK_CNTL__HDMICHARCLK0_SRC_SEL_MASK 0x00000070L//PHYASYMCLK_CLOCK_CNTL #define PHYASYMCLK_CLOCK_CNTL__PHYASYMCLK_FORCE_EN__SHIFT 0x0#define PHYASYMCLK_CLOCK_CNTL__PHYASYMCLK_FORCE_SRC_SEL__SHIFT 0x4
@@ -1397,6 +1402,13 @@#define PHYESYMCLK_CLOCK_CNTL__PHYESYMCLK_FORCE_SRC_SEL__SHIFT 0x4#define PHYESYMCLK_CLOCK_CNTL__PHYESYMCLK_FORCE_EN_MASK 0x00000001L#define PHYESYMCLK_CLOCK_CNTL__PHYESYMCLK_FORCE_SRC_SEL_MASK 0x00000030L +//HDMISTREAMCLK_CNTL +#define HDMISTREAMCLK_CNTL__HDMISTREAMCLK0_SRC_SEL__SHIFT 0x0 +#define HDMISTREAMCLK_CNTL__HDMISTREAMCLK0_EN__SHIFT 0x3 +#define HDMISTREAMCLK_CNTL__HDMISTREAMCLK0_DTO_FORCE_DIS__SHIFT 0x4 +#define HDMISTREAMCLK_CNTL__HDMISTREAMCLK0_SRC_SEL_MASK 0x00000007L +#define HDMISTREAMCLK_CNTL__HDMISTREAMCLK0_EN_MASK 0x00000008L +#define HDMISTREAMCLK_CNTL__HDMISTREAMCLK0_DTO_FORCE_DIS_MASK 0x00000010L//DCCG_GATE_DISABLE_CNTL3 #define DCCG_GATE_DISABLE_CNTL3__HDMISTREAMCLK0_GATE_DISABLE__SHIFT 0x0#define DCCG_GATE_DISABLE_CNTL3__HDMISTREAMCLK1_GATE_DISABLE__SHIFT 0x1
@@ -46978,6 +46990,13 @@#define DSC_TOP0_DSC_TOP_CONTROL__DSC_CLOCK_EN_MASK 0x00000001L#define DSC_TOP0_DSC_TOP_CONTROL__DSC_DISPCLK_R_GATE_DIS_MASK 0x00000010L#define DSC_TOP0_DSC_TOP_CONTROL__DSC_DSCCLK_R_GATE_DIS_MASK 0x00000100L + + +//DSC_TOP0_DSC_DEBUG_CONTROL +#define DSC_TOP0_DSC_DEBUG_CONTROL__DSC_DBG_EN__SHIFT 0x0 +#define DSC_TOP0_DSC_DEBUG_CONTROL__DSC_TEST_CLOCK_MUX_SEL__SHIFT 0x4 +#define DSC_TOP0_DSC_DEBUG_CONTROL__DSC_DBG_EN_MASK 0x00000001L +#define DSC_TOP0_DSC_DEBUG_CONTROL__DSC_TEST_CLOCK_MUX_SEL_MASK 0x00000070L//DSC_TOP0_DSC_DEBUG_CONTROL #define DSC_TOP0_DSC_DEBUG_CONTROL__DSC_DBG_EN__SHIFT 0x0#define DSC_TOP0_DSC_DEBUG_CONTROL__DSC_TEST_CLOCK_MUX_SEL__SHIFT 0x4
drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_2_0_offset.h +60 -0
114 lines not on this page · raw message
drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_2_0_sh_mask.h +22 -0
@@ -42272,6 +42272,18 @@//DSCC0_DSCC_RATE_CONTROL_BUFFER3_MAX_FULLNESS_LEVEL #define DSCC0_DSCC_RATE_CONTROL_BUFFER3_MAX_FULLNESS_LEVEL__DSCC_RATE_CONTROL_BUFFER3_MAX_FULLNESS_LEVEL__SHIFT 0x0#define DSCC0_DSCC_RATE_CONTROL_BUFFER3_MAX_FULLNESS_LEVEL__DSCC_RATE_CONTROL_BUFFER3_MAX_FULLNESS_LEVEL_MASK 0x0003FFFFL +//DSCC0_DSCC_TEST_DEBUG_INDEX2 +#define DSCC0_DSCC_TEST_DEBUG_INDEX2__DSCC_TEST_DEBUG_INDEX2__SHIFT 0x0 +#define DSCC0_DSCC_TEST_DEBUG_INDEX2__DSCC_TEST_DEBUG_INDEX2_MASK 0x000000FFL +//DSCC0_DSCC_TEST_DEBUG_BUS_ROTATE +#define DSCC0_DSCC_TEST_DEBUG_BUS_ROTATE__DSCC_TEST_DEBUG_BUS0_ROTATE__SHIFT 0x0 +#define DSCC0_DSCC_TEST_DEBUG_BUS_ROTATE__DSCC_TEST_DEBUG_BUS1_ROTATE__SHIFT 0x8 +#define DSCC0_DSCC_TEST_DEBUG_BUS_ROTATE__DSCC_TEST_DEBUG_BUS2_ROTATE__SHIFT 0x10 +#define DSCC0_DSCC_TEST_DEBUG_BUS_ROTATE__DSCC_TEST_DEBUG_BUS3_ROTATE__SHIFT 0x18 +#define DSCC0_DSCC_TEST_DEBUG_BUS_ROTATE__DSCC_TEST_DEBUG_BUS0_ROTATE_MASK 0x0000001FL +#define DSCC0_DSCC_TEST_DEBUG_BUS_ROTATE__DSCC_TEST_DEBUG_BUS1_ROTATE_MASK 0x00001F00L +#define DSCC0_DSCC_TEST_DEBUG_BUS_ROTATE__DSCC_TEST_DEBUG_BUS2_ROTATE_MASK 0x001F0000L +#define DSCC0_DSCC_TEST_DEBUG_BUS_ROTATE__DSCC_TEST_DEBUG_BUS3_ROTATE_MASK 0x1F000000L// addressBlock: dcn_dc_dsc0_dispdec_dsccif_dispdec
@@ -42305,6 +42317,16 @@#define DSC_TOP0_DSC_TOP_CONTROL__DSC_DSCCLK_R_GATE_DIS_MASK 0x00000100L//DSC_TOP0_DSC_DEBUG_CONTROL #define DSC_TOP0_DSC_DEBUG_CONTROL__DSC_DBG_EN__SHIFT 0x0 +#define DSC_TOP0_DSC_DEBUG_CONTROL__DSC_TEST_CLOCK_MUX_SEL__SHIFT 0x4 +#define DSC_TOP0_DSC_DEBUG_CONTROL__DSC_DBG_EN_MASK 0x00000001L +#define DSC_TOP0_DSC_DEBUG_CONTROL__DSC_TEST_CLOCK_MUX_SEL_MASK 0x00000070L + + +//DSC_TOP0_DSC_DEBUG_CONTROL +#define DSC_TOP0_DSC_DEBUG_CONTROL__DSC_DBG_EN__SHIFT 0x0 +#define DSC_TOP0_DSC_DEBUG_CONTROL__DSC_TEST_CLOCK_MUX_SEL__SHIFT 0x4 +//DSC_TOP0_DSC_DEBUG_CONTROL +#define DSC_TOP0_DSC_DEBUG_CONTROL__DSC_DBG_EN__SHIFT 0x0#define DSC_TOP0_DSC_DEBUG_CONTROL__DSC_DBG_EN_MASK 0x00000001L
drivers/gpu/drm/amd/include/asic_reg/dpcs/dpcs_3_0_3_sh_mask.h +3 -1
@@ -70,7 +70,9 @@//DPCSTX0_DPCSTX_PLL_UPDATE_DATA #define DPCSTX0_DPCSTX_PLL_UPDATE_DATA__DPCS_PLL_UPDATE_DATA__SHIFT 0x0#define DPCSTX0_DPCSTX_PLL_UPDATE_DATA__DPCS_PLL_UPDATE_DATA_MASK 0xFFFFFFFFL - +//DPCSTX0_DPCSTX_DEBUG_CONFIG +#define DPCSTX0_DPCSTX_DEBUG_CONFIG__DPCS_DBG_CBUS_DIS__SHIFT 0xe +#define DPCSTX0_DPCSTX_DEBUG_CONFIG__DPCS_DBG_CBUS_DIS_MASK 0x00004000L// addressBlock: dpcssys_dpcs0_rdpcstx0_dispdec //RDPCSTX0_RDPCSTX_CNTL
drivers/gpu/drm/amd/include/asic_reg/dpcs/dpcs_4_2_0_offset.h +10 -0
@@ -155,6 +155,8 @@#define regRDPCSTX0_RDPCSTX_CNTL2_BASE_IDX 2#define regRDPCSTX0_RDPCSTX_DMCU_DPALT_DIS_BLOCK_REG 0x293c#define regRDPCSTX0_RDPCSTX_DMCU_DPALT_DIS_BLOCK_REG_BASE_IDX 2 +#define regRDPCSTX0_RDPCSTX_DEBUG_CONFIG 0x293d +#define regRDPCSTX0_RDPCSTX_DEBUG_CONFIG_BASE_IDX 2#define regRDPCSTX0_RDPCSTX_PHY_CNTL0 0x2940#define regRDPCSTX0_RDPCSTX_PHY_CNTL0_BASE_IDX 2#define regRDPCSTX0_RDPCSTX_PHY_CNTL1 0x2941
@@ -239,6 +241,8 @@#define regRDPCSTX1_RDPCSTX_CNTL2_BASE_IDX 2#define regRDPCSTX1_RDPCSTX_DMCU_DPALT_DIS_BLOCK_REG 0x2a14#define regRDPCSTX1_RDPCSTX_DMCU_DPALT_DIS_BLOCK_REG_BASE_IDX 2 +#define regRDPCSTX1_RDPCSTX_DEBUG_CONFIG 0x2a15 +#define regRDPCSTX1_RDPCSTX_DEBUG_CONFIG_BASE_IDX 2#define regRDPCSTX1_RDPCSTX_PHY_CNTL0 0x2a18#define regRDPCSTX1_RDPCSTX_PHY_CNTL0_BASE_IDX 2#define regRDPCSTX1_RDPCSTX_PHY_CNTL1 0x2a19
@@ -323,6 +327,8 @@#define regRDPCSTX2_RDPCSTX_CNTL2_BASE_IDX 2#define regRDPCSTX2_RDPCSTX_DMCU_DPALT_DIS_BLOCK_REG 0x2aec#define regRDPCSTX2_RDPCSTX_DMCU_DPALT_DIS_BLOCK_REG_BASE_IDX 2 +#define regRDPCSTX2_RDPCSTX_DEBUG_CONFIG 0x2aed +#define regRDPCSTX2_RDPCSTX_DEBUG_CONFIG_BASE_IDX 2#define regRDPCSTX2_RDPCSTX_PHY_CNTL0 0x2af0#define regRDPCSTX2_RDPCSTX_PHY_CNTL0_BASE_IDX 2#define regRDPCSTX2_RDPCSTX_PHY_CNTL1 0x2af1
@@ -407,6 +413,8 @@#define regRDPCSTX3_RDPCSTX_CNTL2_BASE_IDX 2#define regRDPCSTX3_RDPCSTX_DMCU_DPALT_DIS_BLOCK_REG 0x2bc4#define regRDPCSTX3_RDPCSTX_DMCU_DPALT_DIS_BLOCK_REG_BASE_IDX 2 +#define regRDPCSTX3_RDPCSTX_DEBUG_CONFIG 0x2bc5 +#define regRDPCSTX3_RDPCSTX_DEBUG_CONFIG_BASE_IDX 2#define regRDPCSTX3_RDPCSTX_PHY_CNTL0 0x2bc8#define regRDPCSTX3_RDPCSTX_PHY_CNTL0_BASE_IDX 2#define regRDPCSTX3_RDPCSTX_PHY_CNTL1 0x2bc9
@@ -491,6 +499,8 @@#define regRDPCSTX4_RDPCSTX_CNTL2_BASE_IDX 2#define regRDPCSTX4_RDPCSTX_DMCU_DPALT_DIS_BLOCK_REG 0x2c9c#define regRDPCSTX4_RDPCSTX_DMCU_DPALT_DIS_BLOCK_REG_BASE_IDX 2 +#define regRDPCSTX4_RDPCSTX_DEBUG_CONFIG 0x2c9d +#define regRDPCSTX4_RDPCSTX_DEBUG_CONFIG_BASE_IDX 2#define regRDPCSTX4_RDPCSTX_PHY_CNTL0 0x2ca0#define regRDPCSTX4_RDPCSTX_PHY_CNTL0_BASE_IDX 2#define regRDPCSTX4_RDPCSTX_PHY_CNTL1 0x2ca1
Signature · 1 line
2.34.1
PATCH 36/43 drm/amd/display: Add missing SFB and OPP_SF
In reply to [email protected]From: Rodrigo Siqueira <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.h | 1 + drivers/gpu/drm/amd/display/dc/dce/dce_opp.h | 1 + 2 files changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.h +1 -0
@@ -181,6 +181,7 @@ struct dce_mem_input_registers {SFB (blk,GRPH_ENABLE ,GRPH_ENABLE , mask_sh),\SFB (blk,GRPH_CONTROL ,GRPH_DEPTH , mask_sh),\SFB (blk,GRPH_CONTROL ,GRPH_FORMAT , mask_sh),\ +SFB (blk,GRPH_CONTROL ,GRPH_NUM_BANKS , mask_sh),\SFB (blk,GRPH_X_START ,GRPH_X_START , mask_sh),\SFB (blk,GRPH_Y_START ,GRPH_Y_START , mask_sh),\ SFB(blk, GRPH_X_END, GRPH_X_END, mask_sh),\
drivers/gpu/drm/amd/display/dc/dce/dce_opp.h +1 -0
@@ -111,6 +111,7 @@ enum dce110_opp_reg_type {OPP_SF (FMT_DITHER_RAND_R_SEED ,FMT_RAND_R_SEED , mask_sh),\OPP_SF (FMT_DITHER_RAND_G_SEED ,FMT_RAND_G_SEED , mask_sh),\OPP_SF (FMT_DITHER_RAND_B_SEED ,FMT_RAND_B_SEED , mask_sh),\ +OPP_SF (FMT_BIT_DEPTH_CONTROL ,FMT_TEMPORAL_DITHER_EN , mask_sh),\OPP_SF (FMT_BIT_DEPTH_CONTROL ,FMT_TEMPORAL_DITHER_RESET , mask_sh),\OPP_SF (FMT_BIT_DEPTH_CONTROL ,FMT_TEMPORAL_DITHER_OFFSET , mask_sh),\ OPP_SF(FMT_BIT_DEPTH_CONTROL, FMT_TEMPORAL_DITHER_DEPTH, mask_sh),\
Signature · 1 line
2.34.1
PATCH 43/43 drm/amd/display: Enable FGCG for DCN351
In reply to [email protected]From: Rodrigo Siqueira <[email protected]>
--- .../gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c +2 -0
@@ -1893,6 +1893,8 @@ static bool dcn351_resource_construct(if (dc->ctx->dce_environment ==DCE_ENV_PRODUCTION_DRV ) dc->debug = debug_defaults_drv; +/*HW default is to have all the FGCG enabled, SW no need to program them*/ + dc->debug.enable_fine_grain_clock_gating.u32All =0xFFFF ;// Init the vm_helper if (dc->vm_helper)vm_helper_init (dc->vm_helper,16 );
Signature · 1 line
2.34.1
PATCH 31/43 drm/amd/display: Add some missing debug registers
In reply to [email protected]From: Rodrigo Siqueira <[email protected]>
--- .../drm/amd/display/dc/dpp/dcn30/dcn30_dpp.h | 4 ++++ .../include/asic_reg/dcn/dcn_3_0_0_offset.h | 24 +++++++++++++++++++ .../include/asic_reg/dcn/dcn_3_0_0_sh_mask.h | 9 +++++++ .../include/asic_reg/dcn/dcn_3_0_2_offset.h | 20 ++++++++++++++++ .../include/asic_reg/dcn/dcn_3_0_2_sh_mask.h | 8 +++++++ .../include/asic_reg/dcn/dcn_3_0_3_offset.h | 8 +++++++ .../include/asic_reg/dcn/dcn_3_0_3_sh_mask.h | 7 ++++++ .../include/asic_reg/dcn/dcn_3_2_0_sh_mask.h | 5 ++++ 8 files changed, 85 insertions(+)
drivers/gpu/drm/amd/display/dc/dpp/dcn30/dcn30_dpp.h +4 -0
@@ -132,6 +132,8 @@SRI (CM_POST_CSC_B_C33_C34 ,CM , id), \SRI (CM_MEM_PWR_CTRL ,CM , id), \SRI (CM_CONTROL ,CM , id), \ +SRI (CM_TEST_DEBUG_INDEX ,CM , id), \ +SRI (CM_TEST_DEBUG_DATA ,CM , id), \SRI (FORMAT_CONTROL ,CNVC_CFG , id), \SRI (CNVC_SURFACE_PIXEL_FORMAT ,CNVC_CFG , id), \ SRI(CURSOR0_CONTROL, CNVC_CUR, id), \
@@ -294,6 +296,7 @@TF_SF (CM0_CM_POST_CSC_C11_C12 ,CM_POST_CSC_C12 , mask_sh), \TF_SF (CM0_CM_POST_CSC_C33_C34 ,CM_POST_CSC_C33 , mask_sh), \TF_SF (CM0_CM_POST_CSC_C33_C34 ,CM_POST_CSC_C34 , mask_sh), \ +TF_SF (CM0_CM_TEST_DEBUG_INDEX ,CM_TEST_DEBUG_INDEX , mask_sh), \TF_SF (CNVC_CFG0_FORMAT_CONTROL ,CNVC_BYPASS , mask_sh), \TF2_SF (CNVC_CFG0 ,FORMAT_CONTROL__ALPHA_EN , mask_sh), \ TF_SF(CNVC_CFG0_FORMAT_CONTROL, FORMAT_EXPANSION_MODE, mask_sh), \
@@ -426,6 +429,7 @@type CM_GAMCOR_LUT_DATA ; \type CM_GAMCOR_LUT_WRITE_COLOR_MASK ; \type CM_GAMCOR_LUT_READ_COLOR_SEL ; \ +type CM_GAMCOR_LUT_READ_DBG ; \type CM_GAMCOR_LUT_HOST_SEL ; \type CM_GAMCOR_LUT_CONFIG_MODE ; \type CM_GAMCOR_LUT_STATUS ; \
drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_0_0_offset.h +24 -0
@@ -4513,6 +4513,10 @@#define mmCM0_CM_3DLUT_OUT_OFFSET_G_BASE_IDX 2#define mmCM0_CM_3DLUT_OUT_OFFSET_B 0x0e18#define mmCM0_CM_3DLUT_OUT_OFFSET_B_BASE_IDX 2 +#define mmCM0_CM_TEST_DEBUG_INDEX 0x0e19 +#define mmCM0_CM_TEST_DEBUG_INDEX_BASE_IDX 2 +#define mmCM0_CM_TEST_DEBUG_DATA 0x0e1a +#define mmCM0_CM_TEST_DEBUG_DATA_BASE_IDX 2// addressBlock: dce_dc_dpp0_dispdec_dpp_dcperfmon_dc_perfmon_dispdec
@@ -5201,6 +5205,10 @@#define mmCM1_CM_3DLUT_OUT_OFFSET_G_BASE_IDX 2#define mmCM1_CM_3DLUT_OUT_OFFSET_B 0x0f83#define mmCM1_CM_3DLUT_OUT_OFFSET_B_BASE_IDX 2 +#define mmCM1_CM_TEST_DEBUG_INDEX 0x0f84 +#define mmCM1_CM_TEST_DEBUG_INDEX_BASE_IDX 2 +#define mmCM1_CM_TEST_DEBUG_DATA 0x0f85 +#define mmCM1_CM_TEST_DEBUG_DATA_BASE_IDX 2// addressBlock: dce_dc_dpp1_dispdec_dpp_dcperfmon_dc_perfmon_dispdec
@@ -5888,6 +5896,10 @@#define mmCM2_CM_3DLUT_OUT_OFFSET_G_BASE_IDX 2#define mmCM2_CM_3DLUT_OUT_OFFSET_B 0x10ee#define mmCM2_CM_3DLUT_OUT_OFFSET_B_BASE_IDX 2 +#define mmCM2_CM_TEST_DEBUG_INDEX 0x10ef +#define mmCM2_CM_TEST_DEBUG_INDEX_BASE_IDX 2 +#define mmCM2_CM_TEST_DEBUG_DATA 0x10f0 +#define mmCM2_CM_TEST_DEBUG_DATA_BASE_IDX 2// addressBlock: dce_dc_dpp2_dispdec_dpp_dcperfmon_dc_perfmon_dispdec
@@ -6576,6 +6588,10 @@#define mmCM3_CM_3DLUT_OUT_OFFSET_G_BASE_IDX 2#define mmCM3_CM_3DLUT_OUT_OFFSET_B 0x1259#define mmCM3_CM_3DLUT_OUT_OFFSET_B_BASE_IDX 2 +#define mmCM3_CM_TEST_DEBUG_INDEX 0x125a +#define mmCM3_CM_TEST_DEBUG_INDEX_BASE_IDX 2 +#define mmCM3_CM_TEST_DEBUG_DATA 0x125b +#define mmCM3_CM_TEST_DEBUG_DATA_BASE_IDX 2// addressBlock: dce_dc_dpp3_dispdec_dpp_dcperfmon_dc_perfmon_dispdec
@@ -7264,6 +7280,10 @@#define mmCM4_CM_3DLUT_OUT_OFFSET_G_BASE_IDX 2#define mmCM4_CM_3DLUT_OUT_OFFSET_B 0x13c4#define mmCM4_CM_3DLUT_OUT_OFFSET_B_BASE_IDX 2 +#define mmCM4_CM_TEST_DEBUG_INDEX 0x13c5 +#define mmCM4_CM_TEST_DEBUG_INDEX_BASE_IDX 2 +#define mmCM4_CM_TEST_DEBUG_DATA 0x13c6 +#define mmCM4_CM_TEST_DEBUG_DATA_BASE_IDX 2// addressBlock: dce_dc_dpp4_dispdec_dpp_dcperfmon_dc_perfmon_dispdec
@@ -7952,6 +7972,10 @@#define mmCM5_CM_3DLUT_OUT_OFFSET_G_BASE_IDX 2#define mmCM5_CM_3DLUT_OUT_OFFSET_B 0x152f#define mmCM5_CM_3DLUT_OUT_OFFSET_B_BASE_IDX 2 +#define mmCM5_CM_TEST_DEBUG_INDEX 0x1530 +#define mmCM5_CM_TEST_DEBUG_INDEX_BASE_IDX 2 +#define mmCM5_CM_TEST_DEBUG_DATA 0x1531 +#define mmCM5_CM_TEST_DEBUG_DATA_BASE_IDX 2// addressBlock: dce_dc_dpp5_dispdec_dpp_dcperfmon_dc_perfmon_dispdec
drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_0_0_sh_mask.h +9 -0
@@ -16739,6 +16739,15 @@#define CM0_CM_3DLUT_OUT_OFFSET_B__CM_3DLUT_OUT_SCALE_B__SHIFT 0x10#define CM0_CM_3DLUT_OUT_OFFSET_B__CM_3DLUT_OUT_OFFSET_B_MASK 0x0000FFFFL#define CM0_CM_3DLUT_OUT_OFFSET_B__CM_3DLUT_OUT_SCALE_B_MASK 0xFFFF0000L +//CM0_CM_TEST_DEBUG_INDEX +#define CM0_CM_TEST_DEBUG_INDEX__CM_TEST_DEBUG_INDEX__SHIFT 0x0 +#define CM0_CM_TEST_DEBUG_INDEX__CM_TEST_DEBUG_WRITE_EN__SHIFT 0x8 +#define CM0_CM_TEST_DEBUG_INDEX__CM_TEST_DEBUG_INDEX_MASK 0x000000FFL +#define CM0_CM_TEST_DEBUG_INDEX__CM_TEST_DEBUG_WRITE_EN_MASK 0x00000100L +//CM0_CM_TEST_DEBUG_DATA +#define CM0_CM_TEST_DEBUG_DATA__CM_TEST_DEBUG_DATA__SHIFT 0x0 +#define CM0_CM_TEST_DEBUG_DATA__CM_TEST_DEBUG_DATA_MASK 0xFFFFFFFFL +// addressBlock: dce_dc_dpp0_dispdec_dpp_dcperfmon_dc_perfmon_dispdec //DC_PERFMON12_PERFCOUNTER_CNTL
drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_0_2_offset.h +20 -0
@@ -4466,6 +4466,10 @@#define mmCM0_CM_3DLUT_OUT_OFFSET_G_BASE_IDX 2#define mmCM0_CM_3DLUT_OUT_OFFSET_B 0x0e18#define mmCM0_CM_3DLUT_OUT_OFFSET_B_BASE_IDX 2 +#define mmCM0_CM_TEST_DEBUG_INDEX 0x0e19 +#define mmCM0_CM_TEST_DEBUG_INDEX_BASE_IDX 2 +#define mmCM0_CM_TEST_DEBUG_DATA 0x0e1a +#define mmCM0_CM_TEST_DEBUG_DATA_BASE_IDX 2// addressBlock: dce_dc_dpp0_dispdec_dpp_dcperfmon_dc_perfmon_dispdec
@@ -5154,6 +5158,10 @@#define mmCM1_CM_3DLUT_OUT_OFFSET_G_BASE_IDX 2#define mmCM1_CM_3DLUT_OUT_OFFSET_B 0x0f83#define mmCM1_CM_3DLUT_OUT_OFFSET_B_BASE_IDX 2 +#define mmCM1_CM_TEST_DEBUG_INDEX 0x0f84 +#define mmCM1_CM_TEST_DEBUG_INDEX_BASE_IDX 2 +#define mmCM1_CM_TEST_DEBUG_DATA 0x0f85 +#define mmCM1_CM_TEST_DEBUG_DATA_BASE_IDX 2// addressBlock: dce_dc_dpp1_dispdec_dpp_dcperfmon_dc_perfmon_dispdec
@@ -5841,6 +5849,10 @@#define mmCM2_CM_3DLUT_OUT_OFFSET_G_BASE_IDX 2#define mmCM2_CM_3DLUT_OUT_OFFSET_B 0x10ee#define mmCM2_CM_3DLUT_OUT_OFFSET_B_BASE_IDX 2 +#define mmCM2_CM_TEST_DEBUG_INDEX 0x10ef +#define mmCM2_CM_TEST_DEBUG_INDEX_BASE_IDX 2 +#define mmCM2_CM_TEST_DEBUG_DATA 0x10f0 +#define mmCM2_CM_TEST_DEBUG_DATA_BASE_IDX 2// addressBlock: dce_dc_dpp2_dispdec_dpp_dcperfmon_dc_perfmon_dispdec
@@ -6529,6 +6541,10 @@#define mmCM3_CM_3DLUT_OUT_OFFSET_G_BASE_IDX 2#define mmCM3_CM_3DLUT_OUT_OFFSET_B 0x1259#define mmCM3_CM_3DLUT_OUT_OFFSET_B_BASE_IDX 2 +#define mmCM3_CM_TEST_DEBUG_INDEX 0x125a +#define mmCM3_CM_TEST_DEBUG_INDEX_BASE_IDX 2 +#define mmCM3_CM_TEST_DEBUG_DATA 0x125b +#define mmCM3_CM_TEST_DEBUG_DATA_BASE_IDX 2// addressBlock: dce_dc_dpp3_dispdec_dpp_dcperfmon_dc_perfmon_dispdec
@@ -7217,6 +7233,10 @@#define mmCM4_CM_3DLUT_OUT_OFFSET_G_BASE_IDX 2#define mmCM4_CM_3DLUT_OUT_OFFSET_B 0x13c4#define mmCM4_CM_3DLUT_OUT_OFFSET_B_BASE_IDX 2 +#define mmCM4_CM_TEST_DEBUG_INDEX 0x13c5 +#define mmCM4_CM_TEST_DEBUG_INDEX_BASE_IDX 2 +#define mmCM4_CM_TEST_DEBUG_DATA 0x13c6 +#define mmCM4_CM_TEST_DEBUG_DATA_BASE_IDX 2// addressBlock: dce_dc_dpp4_dispdec_dpp_dcperfmon_dc_perfmon_dispdec
drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_0_2_sh_mask.h +8 -0
@@ -15676,6 +15676,14 @@#define CM0_CM_3DLUT_OUT_OFFSET_B__CM_3DLUT_OUT_SCALE_B__SHIFT 0x10#define CM0_CM_3DLUT_OUT_OFFSET_B__CM_3DLUT_OUT_OFFSET_B_MASK 0x0000FFFFL#define CM0_CM_3DLUT_OUT_OFFSET_B__CM_3DLUT_OUT_SCALE_B_MASK 0xFFFF0000L +//CM0_CM_TEST_DEBUG_INDEX +#define CM0_CM_TEST_DEBUG_INDEX__CM_TEST_DEBUG_INDEX__SHIFT 0x0 +#define CM0_CM_TEST_DEBUG_INDEX__CM_TEST_DEBUG_WRITE_EN__SHIFT 0x8 +#define CM0_CM_TEST_DEBUG_INDEX__CM_TEST_DEBUG_INDEX_MASK 0x000000FFL +#define CM0_CM_TEST_DEBUG_INDEX__CM_TEST_DEBUG_WRITE_EN_MASK 0x00000100L +//CM0_CM_TEST_DEBUG_DATA +#define CM0_CM_TEST_DEBUG_DATA__CM_TEST_DEBUG_DATA__SHIFT 0x0 +#define CM0_CM_TEST_DEBUG_DATA__CM_TEST_DEBUG_DATA_MASK 0xFFFFFFFFL// addressBlock: dce_dc_dpp0_dispdec_dpp_dcperfmon_dc_perfmon_dispdec
drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_0_3_offset.h +8 -0
@@ -3110,6 +3110,10 @@#define mmCM0_CM_3DLUT_OUT_OFFSET_G_BASE_IDX 2#define mmCM0_CM_3DLUT_OUT_OFFSET_B 0x0e18#define mmCM0_CM_3DLUT_OUT_OFFSET_B_BASE_IDX 2 +#define mmCM0_CM_TEST_DEBUG_INDEX 0x0e19 +#define mmCM0_CM_TEST_DEBUG_INDEX_BASE_IDX 2 +#define mmCM0_CM_TEST_DEBUG_DATA 0x0e1a +#define mmCM0_CM_TEST_DEBUG_DATA_BASE_IDX 2// addressBlock: dce_dc_dpp0_dispdec_dpp_dcperfmon_dc_perfmon_dispdec
@@ -3798,6 +3802,10 @@#define mmCM1_CM_3DLUT_OUT_OFFSET_G_BASE_IDX 2#define mmCM1_CM_3DLUT_OUT_OFFSET_B 0x0f83#define mmCM1_CM_3DLUT_OUT_OFFSET_B_BASE_IDX 2 +#define mmCM1_CM_TEST_DEBUG_INDEX 0x0f84 +#define mmCM1_CM_TEST_DEBUG_INDEX_BASE_IDX 2 +#define mmCM1_CM_TEST_DEBUG_DATA 0x0f85 +#define mmCM1_CM_TEST_DEBUG_DATA_BASE_IDX 2// addressBlock: dce_dc_dpp1_dispdec_dpp_dcperfmon_dc_perfmon_dispdec
drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_0_3_sh_mask.h +7 -0
@@ -10701,6 +10701,13 @@#define CM0_CM_COEF_FORMAT__CM_BIAS_FORMAT_MASK 0x00000001L#define CM0_CM_COEF_FORMAT__CM_POST_CSC_COEF_FORMAT_MASK 0x00000010L#define CM0_CM_COEF_FORMAT__CM_GAMUT_REMAP_COEF_FORMAT_MASK 0x00000100L + +//CM0_CM_TEST_DEBUG_INDEX +#define CM0_CM_TEST_DEBUG_INDEX__CM_TEST_DEBUG_INDEX__SHIFT 0x0 +#define CM0_CM_TEST_DEBUG_INDEX__CM_TEST_DEBUG_WRITE_EN__SHIFT 0x8 +#define CM0_CM_TEST_DEBUG_INDEX__CM_TEST_DEBUG_INDEX_MASK 0x000000FFL +#define CM0_CM_TEST_DEBUG_INDEX__CM_TEST_DEBUG_WRITE_EN_MASK 0x00000100L +//CM0_CM_SHAPER_CONTROL #define CM0_CM_SHAPER_CONTROL__CM_SHAPER_LUT_MODE__SHIFT 0x0#define CM0_CM_SHAPER_CONTROL__CM_SHAPER_MODE_CURRENT__SHIFT 0x2
drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_2_0_sh_mask.h +5 -0
@@ -11544,6 +11544,11 @@#define CM0_CM_COEF_FORMAT__CM_BIAS_FORMAT_MASK 0x00000001L#define CM0_CM_COEF_FORMAT__CM_POST_CSC_COEF_FORMAT_MASK 0x00000010L#define CM0_CM_COEF_FORMAT__CM_GAMUT_REMAP_COEF_FORMAT_MASK 0x00000100L +//CM0_CM_TEST_DEBUG_INDEX +#define CM0_CM_TEST_DEBUG_INDEX__CM_TEST_DEBUG_INDEX__SHIFT 0x0 +#define CM0_CM_TEST_DEBUG_INDEX__CM_TEST_DEBUG_WRITE_EN__SHIFT 0x8 +#define CM0_CM_TEST_DEBUG_INDEX__CM_TEST_DEBUG_INDEX_MASK 0x000000FFL +#define CM0_CM_TEST_DEBUG_INDEX__CM_TEST_DEBUG_WRITE_EN_MASK 0x00000100L// addressBlock: dcn_dc_dpp0_dispdec_dpp_top_dispdec
Signature · 1 line
2.34.1
PATCH 38/43 drm/amd/display: Fix MPCC DTN logging
In reply to [email protected]From: Eric Bernstein <[email protected]>
[Why]
DTN only logs 'pipe_count' instances of MPCC. However in some cases there are different number of MPCC than DPP (pipe_count).
[How]
Add mpcc_count parameter to resource_pool and set it during pool construction and use it for DTN logging of MPCC state.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer_debug.c +1 -1
@@ -392,7 +392,7 @@ static unsigned int dcn10_get_mpcc_states(struct dc *dc, char *pBuf, unsigned in remaining_buffer -= chars_printed; pBuf += chars_printed; -for (i =0 ; i < pool->pipe_count; i++) { +for (i =0 ; i < pool->mpcc_count; i++) {struct mpcc_state s = {0 }; pool->mpc->funcs->read_mpcc_state (pool->mpc, i, &s);
Signature · 1 line
2.34.1
PATCH 33/43 drm/amd/display: Drop legacy code
In reply to [email protected]From: Rodrigo Siqueira <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 10 ---------- .../amd/display/dc/gpio/dcn21/hw_translate_dcn21.c | 13 ------------- 2 files changed, 23 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_dp_types.h +0 -10
@@ -917,16 +917,6 @@ struct dpcd_usb4_dp_tunneling_info {uint8_t usb4_topology_id[DPCD_USB4_TOPOLOGY_ID_LEN ]; }; -#ifndef DP_DFP_CAPABILITY_EXTENSION_SUPPORT -#define DP_DFP_CAPABILITY_EXTENSION_SUPPORT 0x0A3 -#endif -#ifndef DP_TEST_264BIT_CUSTOM_PATTERN_7_0 -#define DP_TEST_264BIT_CUSTOM_PATTERN_7_0 0X2230 -#endif -#ifndef DP_TEST_264BIT_CUSTOM_PATTERN_263_256 -#define DP_TEST_264BIT_CUSTOM_PATTERN_263_256 0X2250 -#endif -union dp_main_line_channel_coding_cap {struct {uint8_t DP_8b_10b_SUPPORTED :1 ;
drivers/gpu/drm/amd/display/dc/gpio/dcn21/hw_translate_dcn21.c +0 -13
@@ -95,10 +95,6 @@ static bool offset_to_id(return true;default :ASSERT_CRITICAL (false); -#ifdef PALLADIUM_SUPPORTED - *en =GPIO_DDC_LINE_DDC1 ; -return true; -#endif return false; }break ;
@@ -184,11 +180,6 @@ static bool offset_to_id(/* UNEXPECTED */ default :/* case REG(DC_GPIO_SYNCA_A): not exista */ -#ifdef PALLADIUM_SUPPORTED - *id =GPIO_ID_HPD ; - *en =GPIO_DDC_LINE_DDC1 ; -return true; -#endif ASSERT_CRITICAL (false);return false; }
@@ -308,10 +299,6 @@ static bool id_to_offset(break ;default :ASSERT_CRITICAL (false); -#ifdef PALLADIUM_SUPPORTED - info->mask =DC_GPIO_HPD_A__DC_GPIO_HPD1_A_MASK ; - result = true; -#endif result = false; }break ;
Signature · 1 line
2.34.1
PATCH 42/43 drm/amd/display: Add color logs for dcn20
In reply to [email protected]From: Rodrigo Siqueira <[email protected]>
--- drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_init.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_init.c +1 -0
@@ -67,6 +67,7 @@ static const struct hw_sequencer_funcs dcn20_funcs = { .setup_stereo = dcn10_setup_stereo, .set_avmute = dce110_set_avmute, .log_hw_state = dcn10_log_hw_state, + .log_color_state = dcn20_log_color_state, .get_hw_state = dcn10_get_hw_state, .clear_status_bits = dcn10_clear_status_bits, .wait_for_mpcc_disconnect = dcn10_wait_for_mpcc_disconnect,
Signature · 1 line
2.34.1
PATCH 37/43 drm/amd/display: Initialize debug variable data
In reply to [email protected]From: Rodrigo Siqueira <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c +1 -1
@@ -130,7 +130,7 @@ bool hubbub1_verify_allow_pstate_change_high(static unsigned int max_sampled_pstate_wait_us;/* data collection */ static bool forced_pstate_allow;/* help with revert wa */ -unsigned int debug_data; +unsigned int debug_data =0 ;unsigned int i;if (forced_pstate_allow) {
Signature · 1 line
2.34.1
PATCH 39/43 drm/amd/display: Add WBSCL ram coefficient for writeback
In reply to [email protected]From: Rodrigo Siqueira <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dwb.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dwb.c +11 -0
@@ -299,6 +299,17 @@ void dwb2_set_scaler(struct dwbc *dwbc, struct dc_dwb_params *params) } } + +if (dwbc20->dwbc_mask->WBSCL_COEF_RAM_SEL) { +/* Swap double buffered coefficient set */ +uint32_t wbscl_mode =REG_READ (WBSCL_MODE ); +bool coef_ram_current =get_reg_field_value_ex ( + wbscl_mode, dwbc20->dwbc_mask->WBSCL_COEF_RAM_SEL_CURRENT, + dwbc20->dwbc_shift->WBSCL_COEF_RAM_SEL_CURRENT); + +REG_UPDATE (WBSCL_MODE ,WBSCL_COEF_RAM_SEL , !coef_ram_current); + } + }static const struct dwbc_funcs dcn20_dwbc_funcs = {
Signature · 1 line
2.34.1
PATCH 41/43 drm/amd/display: Includes adjustments
In reply to [email protected]From: Rodrigo Siqueira <[email protected]>
This commit clean up some of the includes used by DCN.
--- drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c | 4 ---- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_link_encoder.c | 2 -- .../gpu/drm/amd/display/dc/dcn30/dcn30_dio_stream_encoder.c | 2 -- .../gpu/drm/amd/display/dc/dcn35/dcn35_dio_stream_encoder.h | 1 - drivers/gpu/drm/amd/display/dc/inc/dcn_calcs.h | 2 +- 5 files changed, 1 insertion(+), 10 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c +0 -4
@@ -34,11 +34,7 @@#include "reg_helper.h" #include "fixed31_32.h" -#ifdef _WIN32 -#include "atombios.h" -#else #include "atom.h" -#endif #define TO_DMUB_ABM (abm)\ container_of(abm, struct dce_abm, base)
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_link_encoder.c +0 -2
@@ -30,8 +30,6 @@#include "dcn30_dio_link_encoder.h" #include "stream_encoder.h" #include "dc_bios_types.h" -/* #include "dcn3ag/dcn3ag_phy_fw.h" */ -#include "gpio_service_interface.h" #define CTX \
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_stream_encoder.c +0 -2
@@ -30,8 +30,6 @@#include "hw_shared.h" #include "dc.h" #include "core_types.h" -#include <linux/delay.h> -#define DC_LOGGER \ enc1->base.ctx->logger
drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dio_stream_encoder.h +0 -1
@@ -28,7 +28,6 @@#include "dcn30/dcn30_vpg.h" #include "dcn30/dcn30_afmt.h" #include "stream_encoder.h" -#include "dcn10/dcn10_link_encoder.h" #include "dcn20/dcn20_stream_encoder.h" /* Register bit field name change */
drivers/gpu/drm/amd/display/dc/inc/dcn_calcs.h +1 -1
@@ -31,7 +31,7 @@#define __DCN_CALCS_H__#include "bw_fixed.h" -#include "../dml/display_mode_lib.h" +#include "dml/display_mode_lib.h" struct dc ;
Signature · 1 line
2.34.1
RE: [PATCH 01/43] drm/amd/display: Fix compiler redefinition warnings for certain configs
In reply to [email protected][Public]
Hi all,
This week this patchset was tested on the following systems:
* Lenovo ThinkBook T13s Gen4 with AMD Ryzen 5 6600U
* MSI Gaming X Trio RX 6800
* Gigabyte Gaming OC RX 7900 XTX
These systems were tested on the following display/connection types:
* eDP, (1080p 60hz [5650U]) (1920x1200 60hz [6600U]) (2560x1600 120hz[6600U])
* VGA and DVI (1680x1050 60hz [DP to VGA/DVI, USB-C to VGA/DVI])
* DP/HDMI/USB-C (1440p 170hz, 4k 60hz, 4k 144hz, 4k 240hz [Includes USB-C to DP/HDMI adapters])
* Thunderbolt (LG Ultrafine 5k)
* MST (Startech MST14DP123DP [DP to 3x DP] and 2x 4k 60Hz displays)
* DSC (with Cable Matters 101075 [DP to 3x DP] with 3x 4k60 displays, and HP Hook G2 with 1 4k60 display)
* USB 4 (Kensington SD5700T and 1x 4k 60Hz display)
* PCON (Club3D CAC-1085 and 1x 4k 144Hz display [at 4k 120HZ, as that is the max the adapter supports])
The testing is a mix of automated and manual tests. Manual testing includes (but is not limited to):
* Changing display configurations and settings
* Benchmark testing
* Feature testing (Freesync, etc.)
Automated testing includes (but is not limited to):
* Script testing (scripts to automate some of the manual checks)
* IGT testing
The patchset consists of the amd-staging-drm-next branch (Head commit - a6b494a44fd6 drm/amd/display: Set DCN351 BB and IP the same as DCN35) with new patches added on top of it.
Tested on Ubuntu 22.04.3, on Wayland and X11, using KDE Plasma and Gnome.
Thank you,
Dan Wheeler
Sr. Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
amd.com
-----Original Message-----
From: [email protected] <[email protected]>
Sent: Thursday, March 28, 2024 3:50 PM
To: [email protected]
Cc: Wheeler, Daniel <[email protected]>; 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]>; Chiu, Solomon <[email protected]>; Gutierrez, Agustin <[email protected]>; Mahfooz, Hamza <[email protected]>; Adhuri, Mounika <[email protected]>; Leung, Martin <[email protected]>
Subject: [PATCH 01/43] drm/amd/display: Fix compiler redefinition warnings for certain configs
From: Mounika Adhuri <[email protected]>
[why & how]
Modified definitions of 1 function and 2 structs to remove warnings on certain specific compiler configurations due to redefinition.
--- drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c | 4 ++-- drivers/gpu/drm/amd/display/include/grph_object_id.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +2 -1
@@ -249,7 +249,7 @@ static bool dce110_enable_display_power_gating(return false; } -static void build_prescale_params (struct ipp_prescale_params *prescale_params, +static void dce110_prescale_params (struct ipp_prescale_params +*prescale_params,const struct dc_plane_state *plane_state) { prescale_params->mode = IPP_PRESCALE_MODE_FIXED_UNSIGNED; @@ -291,7 +291,7 @@ dce110_set_input_transfer_func(struct dc *dc, struct pipe_ctx *pipe_ctx,
tf = &plane_state->in_transfer_func;
- build_prescale_params(&prescale_params, plane_state);
+ dce110_prescale_params(&prescale_params, plane_state);
ipp->funcs->ipp_program_prescale(ipp, &prescale_params);
if (!plane_state->gamma_correction.is_identity && diff --git a/drivers/gpu/drm/amd/display/include/grph_object_id.h b/drivers/gpu/drm/amd/display/include/grph_object_id.hindex c6bbd262f1ac..08ee0350b31f 100644
drivers/gpu/drm/amd/display/include/grph_object_id.h +2 -3
@@ -226,8 +226,8 @@ enum dp_alt_mode {struct graphics_object_id {uint32_t id:8 ; -uint32_t enum_id:4 ; -uint32_t type:4 ; +enum object_enum_id enum_id; +enum object_type type;uint32_t reserved:16 ;/* for padding. total size should be u32 */ }; --
2.34.1
[Public]
Sorry about that, meant to respond to this one.
Hi all,
This week this patchset was tested on the following systems:
* Lenovo ThinkBook T13s Gen4 with AMD Ryzen 5 6600U
* MSI Gaming X Trio RX 6800
* Gigabyte Gaming OC RX 7900 XTX
These systems were tested on the following display/connection types:
* eDP, (1080p 60hz [5650U]) (1920x1200 60hz [6600U]) (2560x1600 120hz[6600U])
* VGA and DVI (1680x1050 60hz [DP to VGA/DVI, USB-C to VGA/DVI])
* DP/HDMI/USB-C (1440p 170hz, 4k 60hz, 4k 144hz, 4k 240hz [Includes USB-C to DP/HDMI adapters])
* Thunderbolt (LG Ultrafine 5k)
* MST (Startech MST14DP123DP [DP to 3x DP] and 2x 4k 60Hz displays)
* DSC (with Cable Matters 101075 [DP to 3x DP] with 3x 4k60 displays, and HP Hook G2 with 1 4k60 display)
* USB 4 (Kensington SD5700T and 1x 4k 60Hz display)
* PCON (Club3D CAC-1085 and 1x 4k 144Hz display [at 4k 120HZ, as that is the max the adapter supports])
The testing is a mix of automated and manual tests. Manual testing includes (but is not limited to):
* Changing display configurations and settings
* Benchmark testing
* Feature testing (Freesync, etc.)
Automated testing includes (but is not limited to):
* Script testing (scripts to automate some of the manual checks)
* IGT testing
The patchset consists of the amd-staging-drm-next branch (Head commit - a6b494a44fd6 drm/amd/display: Set DCN351 BB and IP the same as DCN35) with new patches added on top of it.
Tested on Ubuntu 22.04.3, on Wayland and X11, using KDE Plasma and Gnome.
Thank you,
Dan Wheeler
Sr. Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6 amd.com
-----Original Message-----
From: [email protected] <[email protected]>
Sent: Thursday, March 28, 2024 3:50 PM
To: [email protected]
Cc: Wheeler, Daniel <[email protected]>; 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]>; Chiu, Solomon <[email protected]>; Gutierrez, Agustin <[email protected]>; Mahfooz, Hamza <[email protected]>; Li, Roman <[email protected]>
Subject: [PATCH 00/43] DC Patches Apr 1, 2024
From: Roman Li <[email protected]>
This DC patchset brings improvements in multiple areas. In summary, we have:
- Fix underflow in subvp/non-subvp configs
- Fix compiler warnings
- Add handling for DC power mode
- Add extra logging for DMUB, HUBP and OTG
- Add timing pixel encoding for mst mode validation
- Expand supported Replay residency mode
- Allow HPO PG and RCG for DCN35
- Update pipe topology log to support subvp
- Disable Z8 minimum stutter period check for DCN35
- Enable RCO for HDMISTREAMCLK in DCN35
Alex Hung (1):
drm/amd/display: Skip on writeback when it's not applicable
Alvin Lee (2):
drm/amd/display: Add extra logging for HUBP and OTG drm/amd/display: Add extra DMUB logging to track message timeout
Aric Cyr (2):
drm/amd/display: Fix compiler warnings on high compiler warning levels drm/amd/display: 3.2.279
Daniel Miess (2):
drm/amd/display: Toggle additional RCO options in DCN35 drm/amd/display: Enable RCO for HDMISTREAMCLK in DCN35
Dillon Varone (1):
drm/amd/display: Add dmub additional interface support for FAMS
Duncan Ma (1):
drm/amd/display: Allow HPO PG for DCN35
Eric Bernstein (1):
drm/amd/display: Fix MPCC DTN logging
George Shen (1):
drm/amd/display: Add dummy interface for tracing DCN32 SMU messages
Hersen Wu (2):
drm/amd/display: Add timing pixel encoding for mst mode validation drm/amd/display: FEC overhead should be checked once for mst slot nums
Joshua Aberback (3):
drm/amd/display: handle invalid connector indices drm/amd/display: remove context->dml2 dependency from DML21 wrapper drm/amd/display: Add handling for DC power mode
Leo (Hanghong) Ma (1):
drm/amd/display: Add OTG check for set AV mute
Leon Huang (1):
drm/amd/display: Expand supported Replay residency mode
Mounika Adhuri (1):
drm/amd/display: Fix compiler redefinition warnings for certain
configs
Nicholas Kazlauskas (1):
drm/amd/display: Disable Z8 minimum stutter period check for DCN35
Rodrigo Siqueira (15):
drm/amd/display: Initialize DP ref clk with the correct clock drm/amd/display: Set alpha enable to 0 for some specific formats drm/amd/display: Enable cur_rom_en even if cursor degamma is not
enabled
drm/amd/display: Add some missing debug registers drm/amd/display: Update DSC compute parameter calculation drm/amd/display: Drop legacy code
drm/amd/display: Add missing registers drm/amd/display: Remove redundant RESERVE0 and RESERVE1 drm/amd/display: Add missing SFB and OPP_SF drm/amd/display: Initialize debug variable data drm/amd/display: Add WBSCL ram coefficient for writeback drm/amd/display: Add code comments clock and encode code drm/amd/display: Includes adjustments drm/amd/display: Add color logs for dcn20 drm/amd/display: Enable FGCG for DCN351
Roman Li (2):
drm/amd/display: Decouple dcn35 and dcn351 dmub firmware drm/amd/display: Allow RCG for Static Screen + LVP for DCN35
Samson Tam (1):
drm/amd/display: fix underflow in some two display subvp/non-subvp
configs
Sung Joon Kim (1):
drm/amd/display: Enable DTBCLK DTO earlier in the sequence
Wenjing Liu (3):
drm/amd/display: optimize dml2 pipe resource allocation order drm/amd/display: update pipe topology log to support subvp drm/amd/display: move build test pattern params as part of pipe
resource update for odm
Xi (Alex) Liu (1):
drm/amd/display: add root clock control function pointer to fix
display corruption
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 37 ++- .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 66 +++-- .../display/amdgpu_dm/amdgpu_dm_mst_types.h | 3 - .../display/amdgpu_dm/amdgpu_dm_services.c | 8 + .../drm/amd/display/dc/bios/bios_parser2.c | 2 - .../display/dc/clk_mgr/dce100/dce_clk_mgr.c | 4 +- .../display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c | 2 +- .../dc/clk_mgr/dcn201/dcn201_clk_mgr.c | 11 + .../amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c | 5 +- .../display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c | 2 +- .../dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.c | 5 +- .../display/dc/clk_mgr/dcn301/vg_clk_mgr.c | 3 +- .../display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c | 3 +- .../dc/clk_mgr/dcn316/dcn316_clk_mgr.c | 3 +- .../dc/clk_mgr/dcn32/dcn32_clk_mgr_smu_msg.c | 9 + drivers/gpu/drm/amd/display/dc/core/dc.c | 64 +++-- .../drm/amd/display/dc/core/dc_hw_sequencer.c | 2 +- .../gpu/drm/amd/display/dc/core/dc_resource.c | 105 +++++-- .../gpu/drm/amd/display/dc/core/dc_state.c | 29 +- drivers/gpu/drm/amd/display/dc/dc.h | 19 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 12 +- drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 13 +- drivers/gpu/drm/amd/display/dc/dc_state.h | 2 +- drivers/gpu/drm/amd/display/dc/dc_stream.h | 8 - drivers/gpu/drm/amd/display/dc/dc_types.h | 16 ++ .../drm/amd/display/dc/dce/dce_mem_input.h | 1 + drivers/gpu/drm/amd/display/dc/dce/dce_opp.h | 1 + .../drm/amd/display/dc/dce/dce_transform.c | 2 +- .../gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c | 4 - .../drm/amd/display/dc/dcn10/dcn10_hubbub.c | 2 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h | 1 + .../dc/dcn10/dcn10_hw_sequencer_debug.c | 2 +- .../amd/display/dc/dcn10/dcn10_link_encoder.c | 1 - .../gpu/drm/amd/display/dc/dcn20/dcn20_dwb.c | 11 + .../gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c | 6 + .../drm/amd/display/dc/dcn201/dcn201_hubbub.c | 2 +- .../display/dc/dcn30/dcn30_dio_link_encoder.c | 2 - .../dc/dcn30/dcn30_dio_stream_encoder.c | 2 - .../gpu/drm/amd/display/dc/dcn30/dcn30_hubp.c | 3 + .../dc/dcn31/dcn31_hpo_dp_stream_encoder.c | 4 + .../display/dc/dcn32/dcn32_resource_helpers.c | 2 +- .../gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c | 207 +++++++++++++- .../display/dc/dcn35/dcn35_dio_link_encoder.c | 1 - .../dc/dcn35/dcn35_dio_stream_encoder.h | 1 - drivers/gpu/drm/amd/display/dc/dm_services.h | 10 + .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 2 - .../dc/dml/dcn30/display_mode_vba_30.c | 1 - .../dc/dml/dcn31/display_mode_vba_31.c | 1 - .../amd/display/dc/dml/dcn314/dcn314_fpu.c | 2 +- .../dc/dml/dcn314/display_mode_vba_314.c | 1 - .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 267 ++++++++++-------- .../dc/dml/dcn32/display_mode_vba_util_32.c | 14 +- .../drm/amd/display/dc/dml/dcn35/dcn35_fpu.c | 2 +- .../amd/display/dc/dml/dcn351/dcn351_fpu.c | 2 +- .../amd/display/dc/dml2/display_mode_core.c | 12 +- .../display/dc/dml2/dml2_dc_resource_mgmt.c | 132 ++++++--- .../amd/display/dc/dml2/dml2_internal_types.h | 11 + .../gpu/drm/amd/display/dc/dml2/dml2_utils.c | 2 +- .../drm/amd/display/dc/dml2/dml2_wrapper.c | 6 +- .../drm/amd/display/dc/dml2/dml2_wrapper.h | 6 + .../drm/amd/display/dc/dpp/dcn10/dcn10_dpp.h | 3 +- .../drm/amd/display/dc/dpp/dcn30/dcn30_dpp.c | 8 +- .../drm/amd/display/dc/dpp/dcn30/dcn30_dpp.h | 4 + .../drm/amd/display/dc/dpp/dcn35/dcn35_dpp.c | 69 ++++- .../drm/amd/display/dc/dpp/dcn35/dcn35_dpp.h | 9 +- drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 8 +- .../gpu/drm/amd/display/dc/dsc/rc_calc_dpi.c | 7 +- .../dc/gpio/dcn21/hw_translate_dcn21.c | 13 - .../amd/display/dc/hwss/dce110/dce110_hwseq.c | 6 +- .../amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 32 +-- .../amd/display/dc/hwss/dcn20/dcn20_init.c | 1 + .../amd/display/dc/hwss/dcn30/dcn30_hwseq.c | 6 +- .../amd/display/dc/hwss/dcn31/dcn31_hwseq.c | 2 +- .../amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 2 +- .../amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 44 ++- .../amd/display/dc/hwss/dcn35/dcn35_hwseq.h | 2 + .../amd/display/dc/hwss/dcn35/dcn35_init.c | 1 + .../amd/display/dc/hwss/dcn351/dcn351_init.c | 1 + .../drm/amd/display/dc/hwss/hw_sequencer.h | 2 +- .../display/dc/hwss/hw_sequencer_private.h | 4 + .../gpu/drm/amd/display/dc/inc/core_types.h | 3 + .../gpu/drm/amd/display/dc/inc/dcn_calcs.h | 2 +- .../amd/display/dc/inc/hw/clk_mgr_internal.h | 2 +- drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h | 4 + .../gpu/drm/amd/display/dc/inc/hw/hw_shared.h | 1 + drivers/gpu/drm/amd/display/dc/inc/hw/optc.h | 2 + drivers/gpu/drm/amd/display/dc/inc/link.h | 2 +- .../display/dc/link/accessories/link_dp_cts.c | 2 +- .../gpu/drm/amd/display/dc/link/link_dpms.c | 2 +- .../dc/link/protocols/link_dp_dpia_bw.c | 4 +- .../dc/link/protocols/link_dp_training_dpia.c | 4 +- .../link/protocols/link_edp_panel_control.c | 7 +- .../link/protocols/link_edp_panel_control.h | 2 +- .../amd/display/dc/optc/dcn10/dcn10_optc.c | 3 + .../gpu/drm/amd/display/dc/resource/Makefile | 6 - .../dc/resource/dce112/dce112_resource.c | 2 - .../dc/resource/dce120/dce120_resource.c | 2 +- .../dc/resource/dcn30/dcn30_resource.c | 2 +- .../dc/resource/dcn31/dcn31_resource.c | 2 +- .../dc/resource/dcn316/dcn316_resource.c | 2 +- .../dc/resource/dcn32/dcn32_resource.c | 86 +++++- .../dc/resource/dcn321/dcn321_resource.c | 12 +- .../dc/resource/dcn35/dcn35_resource.c | 8 +- .../dc/resource/dcn351/dcn351_resource.c | 6 +- drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 17 +- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 6 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn20.c | 1 + .../gpu/drm/amd/display/dmub/src/dmub_dcn31.c | 1 + .../gpu/drm/amd/display/dmub/src/dmub_dcn32.c | 2 + .../gpu/drm/amd/display/dmub/src/dmub_dcn35.c | 1 + .../drm/amd/display/include/grph_object_id.h | 4 +- .../amd/display/modules/color/color_gamma.c | 2 +- .../display/modules/hdcp/hdcp2_execution.c | 2 +- .../include/asic_reg/dcn/dcn_3_0_0_offset.h | 24 ++ .../include/asic_reg/dcn/dcn_3_0_0_sh_mask.h | 9 + .../include/asic_reg/dcn/dcn_3_0_2_offset.h | 20 ++ .../include/asic_reg/dcn/dcn_3_0_2_sh_mask.h | 8 + .../include/asic_reg/dcn/dcn_3_0_3_offset.h | 28 ++ .../include/asic_reg/dcn/dcn_3_0_3_sh_mask.h | 18 ++ .../include/asic_reg/dcn/dcn_3_1_2_offset.h | 4 + .../include/asic_reg/dcn/dcn_3_1_2_sh_mask.h | 19 ++ .../include/asic_reg/dcn/dcn_3_2_0_offset.h | 60 ++++ .../include/asic_reg/dcn/dcn_3_2_0_sh_mask.h | 27 ++ .../asic_reg/dpcs/dpcs_3_0_3_sh_mask.h | 4 +- .../include/asic_reg/dpcs/dpcs_4_2_0_offset.h | 10 + 125 files changed, 1354 insertions(+), 464 deletions(-)
--
2.34.1
Re: [PATCH 38/43] drm/amd/display: Fix MPCC DTN logging
In reply to [email protected]Quoted 11 lines · On 28/03/2024 16:50, [email protected] wrote:
From: Eric Bernstein <[email protected]>
[Why]
DTN only logs 'pipe_count' instances of MPCC. However in some cases there are different number of MPCC than DPP (pipe_count).[How]
Addmpcc_countparameter toresource_pooland set it during pool construction and use it for DTN logging of MPCC state.
Should we do the same in dcn*_log_color_state() for the loop of pool->mpx->funcs->read_mpcc_state() there?
It affects the following files:drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c
BR,
Melissa
Quoted 21 lines
Signed-off-by Eric Bernstein <[email protected]>Reviewed-by Rodrigo Siqueira <[email protected]>Tested-by Daniel Wheeler <[email protected]>--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer_debug.c +1
-1@@ -392,7 +392,7 @@ static unsigned int dcn10_get_mpcc_states(struct dc *dc, char *pBuf, unsigned in remaining_buffer -= chars_printed; pBuf += chars_printed; -for (i =0 ; i < pool->pipe_count; i++) { +for (i =0 ; i < pool->mpcc_count; i++) {struct mpcc_state s = {0 }; pool->mpc->funcs->read_mpcc_state (pool->mpc, i, &s);
Re: [PATCH 30/43] drm/amd/display: Enable cur_rom_en even if cursor degamma is not enabled
In reply to [email protected]Quoted 13 lines · On 28/03/2024 16:50, [email protected] wrote:
From: Rodrigo Siqueira <[email protected]>
Signed-off-by Rodrigo Siqueira <[email protected]>Tested-by Daniel Wheeler <[email protected]>--- drivers/gpu/drm/amd/display/dc/dpp/dcn30/dcn30_dpp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/gpu/drm/amd/display/dc/dpp/dcn30/dcn30_dpp.c +0
-0
drivers/gpu/drm/amd/display/dc/dpp/dcn30/dcn30_dpp.c void dpp3_set_cursor_attributes( · line 398
Quoted 7 lines
drivers/gpu/drm/amd/display/dc/dpp/dcn30/dcn30_dpp.c +1
-3@@ -395,9 +395,7 @@ void dpp3_set_cursor_attributes(if (color_format ==CURSOR_MODE_COLOR_PRE_MULTIPLIED_ALPHA || color_format ==CURSOR_MODE_COLOR_UN_PRE_MULTIPLIED_ALPHA ) { -if (cursor_attributes->attribute_flags.bits.ENABLE_CURSOR_DEGAMMA) { - cur_rom_en =1 ; - } + cur_rom_en =1 ;
ugh. At first glance, I think it will cause a regression with legacy gamma.
For references:
- https://gitlab.freedesktop.org/drm/amd/-/issues/1513
- https://lore.kernel.org/amd-gfx/[email protected]/
- https://lore.kernel.org/amd-gfx/[email protected]/
BR,
Melissa
Quoted 3 lines
drivers/gpu/drm/amd/display/dc/dpp/dcn30/dcn30_dpp.c +0
-0} REG_UPDATE_3(CURSOR0_CONTROL,
Harry Wentland
maintainerRe: [PATCH 30/43] drm/amd/display: Enable cur_rom_en even if cursor degamma is not enabled
Quoted 4 lines · Melissa Wen
Quoted 1 line · On 28/03/2024 16:50, [email protected] wrote:
From: Rodrigo Siqueira <[email protected]>
Where is the commit description. Why is this needed? What is this fixing?
Like Melissa said, this might cause a regression.
Harry
Quoted 31 lines
Quoted 12 lines
Signed-off-by Rodrigo Siqueira <[email protected]>Tested-by Daniel Wheeler <[email protected]>---
drivers/gpu/drm/amd/display/dc/dpp/dcn30/dcn30_dpp.c| 4 +---1 file changed, 1 insertion(+), 3 deletions(-)drivers/gpu/drm/amd/display/dc/dpp/dcn30/dcn30_dpp.c +0
-0@@ -395,9 +395,7 @@ void dpp3_set_cursor_attributes(Quoted 6 lines
if (
color_format==CURSOR_MODE_COLOR_PRE_MULTIPLIED_ALPHA||color_format==CURSOR_MODE_COLOR_UN_PRE_MULTIPLIED_ALPHA) { - if (cursor_attributes->attribute_flags.bits.ENABLE_CURSOR_DEGAMMA) { -cur_rom_en= 1;
- }
+cur_rom_en= 1;ugh. At first glance, I think it will cause a regression with legacy gamma.
For references:
- https://gitlab.freedesktop.org/drm/amd/-/issues/1513
- https://lore.kernel.org/amd-gfx/[email protected]/
- https://lore.kernel.org/amd-gfx/[email protected]/BR,
Melissa
Quoted 2 lines
}
REG_UPDATE_3(CURSOR0_CONTROL,
Re: [PATCH 08/43] drm/amd/display: FEC overhead should be checked once for mst slot nums
In reply to [email protected]Quoted 11 lines · On 28. 03. 24, 20:50, [email protected] wrote:
From: Hersen Wu <[email protected]>
[Why] Mst slot nums equals to pbn /
pbn_div.Today,
pbn_divrefers todm_mst_get_pbn_divider->dc_link_bandwidth_kbps. Indp_link_bandwidth_kbps, which includes effect of FEC overhead already. As result, we should not include effect of FEC overhead again while calculating pbn bykpbs_to_peak_pbn(stream_kbps).
Quoted 2 lines
[How] Include FEC overhead within
dp_link_bandwidth_kbps. Remove FEC overhead fromkbps_to_peak_pbn.
Hi, this 6.10 commit (8b2cb32cf0c613) causes my secondary monitor not to come up at all.
Reverting this on top of 6.10 makes it work again.
Reported as (more details):
https://gitlab.freedesktop.org/drm/amd/-/issues/3495
https://bugzilla.suse.com/show_bug.cgi?id=1228093
Quoted 8 lines
Reviewed-by Wayne Lin <[email protected]>Acked-by Roman Li <[email protected]>Signed-off-by Hersen Wu <[email protected]>Tested-by Daniel Wheeler <[email protected]>--- .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 37 +++++-------------- .../display/amdgpu_dm/amdgpu_dm_mst_types.h | 3 -- 2 files changed, 10 insertions(+), 30 deletions(-)
thanks,
Signature · 2 lines
js suse labs
RE: [PATCH 08/43] drm/amd/display: FEC overhead should be checked once for mst slot nums
[Public]
Hi,
Thanks for the report!
We're going to revert it and cc to stable.
Regards,
Wayne
Quoted 50 lines
-----Original Message-----
From: Jiri Slaby <[email protected]>
Sent: Thursday, July 18, 2024 3:09 PM
To: Li, Roman <[email protected]>; [email protected]
Cc: Wheeler, Daniel <[email protected]>; Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Pillai, Aurabindo <[email protected]>; Lin, Wayne <[email protected]>; Chiu, Solomon <[email protected]>; Gutierrez, Agustin <[email protected]>; Mahfooz, Hamza <[email protected]>; Wu, Hersen <[email protected]>
Subject: Re: [PATCH 08/43] drm/amd/display: FEC overhead should be checked once for mst slot numsQuoted 4 lines · On 28. 03. 24, 20:50, [email protected] wrote:
From: Hersen Wu <[email protected]>
[Why] Mst slot nums equals to pbn /
pbn_div.Quoted 8 lines
Today,
pbn_divrefers todm_mst_get_pbn_divider->dc_link_bandwidth_kbps. Indp_link_bandwidth_kbps, which includes effect of FEC overhead already. As result, we should not include effect of FEC overhead again while calculating pbn bykpbs_to_peak_pbn(stream_kbps).[How] Include FEC overhead within
dp_link_bandwidth_kbps. Remove FEC overhead fromkbps_to_peak_pbn.Hi, this 6.10 commit (
8b2cb32cf0c613) causes my secondary monitor not to come up at all.Reverting this on top of 6.10 makes it work again.
Reported as (more details):
https://gitlab.freedesktop.org/drm/amd/-/issues/3495
https://bugzilla.suse.com/show_bug.cgi?id=1228093Quoted 8 lines
Reviewed-by Wayne Lin <[email protected]>Acked-by Roman Li <[email protected]>Signed-off-by Hersen Wu <[email protected]>Tested-by Daniel Wheeler <[email protected]>--- .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 37 +++++-------------- .../display/amdgpu_dm/amdgpu_dm_mst_types.h | 3 -- 2 files changed, 10 insertions(+), 30 deletions(-)thanks,
--
js
suse labs
Re: [PATCH 08/43] drm/amd/display: FEC overhead should be checked once for mst slot nums
Quoted 2 lines · Wayne
Thanks for the report!
We're going to revert it and cc to stable.
There is a fix btw:
https://gitlab.freedesktop.org/drm/amd/-/issues/3495#note_2501831
Signature · 2 lines
js suse labs