DC Patches June 2nd, 2025
Subsystems (5)
cover DC Patches June 2nd, 2025
This DC patchset brings improvements in multiple areas. In summary, we highlight:
- Fixes for DML21
- Support OLED SDR with AMD ABC
- Indirect buffer transport for FAMS2 commands
- Correct stream attributes setup timing
- Correct non-OLED pre_T11_delay
- Optime boot-up consuming time
- Add support for 2nd sharpening range
- Fix on chroma planes scaling
- Fix brightness relevant settings
- Fix calling blanking stream twice
- Extend dc mode validation types to support more scenarios
- Update DMCUB loading sequence for DCN3.5
---
Alvin Lee (1):
drm/amd/display: Re-order FAMS2 sub commands
Austin Zheng (1):
drm/amd/display: DML21 Fixes
Camille Cho (1):
drm/amd/display: Support OLED SDR with AMD ABC
Cruise Hung (1):
drm/amd/display: Use DC log instead of using DM error msg
Jingwen Zhu (1):
drm/amd/display: Add disconnect case on dongle check
Mario Limonciello (3):
drm/amd/display: Drop unnecessary amdgpu prefix drm/amd/display: Add debugging message for brightness caps drm/amd/display: Fix default DC and AC levels
Michael Strauss (1):
drm/amd/display: Call setup_stream_attribute after stream enc clk is
ungated
Navid Assadian (1):
drm/amd/display: Do not bypass chroma scaling in 1:1 case
Nicholas Kazlauskas (1):
drm/amd/display: Update DMCUB loading sequence for DCN3.5
Oleh Kuzhylnyi (2):
drm/amd/display: Indirect buffer transport for FAMS2 commands drm/amd/display: Add DML path for FAMS methods
Ray Wu (1):
drm/amd/display: Move vmalloc include to header file
Samson Tam (1):
drm/amd/display: Add support for 2nd sharpening range
Taimur Hassan (4):
drm/amd/display: [FW Promotion] Release 0.1.11.0 drm/amd/display: [FW Promotion] Release 0.1.12.0 drm/amd/display: Promote DAL to 3.2.335 drm/amd/display: Promote DAL to 3.2.336
Wayne Lin (1):
drm/amd/display: Avoid trying AUX transactions on disconnected ports
Yan Li (1):
drm/amd/display: replace fast_validate with enum dc_validate_mode
Yihan Zhu (1):
drm/amd/display: move RMCM programming
Zhongwei Zhang (2):
drm/amd/display: Correct non-OLED pre_T11_delay. drm/amd/display: Avoid calling blank_stream() twice
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 48 +-- .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 6 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 12 +- .../gpu/drm/amd/display/dc/core/dc_resource.c | 12 +- drivers/gpu/drm/amd/display/dc/dc.h | 47 ++- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 59 +++- .../gpu/drm/amd/display/dc/dc_spl_translate.c | 19 +- drivers/gpu/drm/amd/display/dc/dc_types.h | 10 +- .../drm/amd/display/dc/dml/calcs/dcn_calcs.c | 6 +- .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 45 ++- .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.h | 12 +- .../drm/amd/display/dc/dml/dcn30/dcn30_fpu.c | 6 +- .../drm/amd/display/dc/dml/dcn31/dcn31_fpu.h | 2 +- .../amd/display/dc/dml/dcn314/dcn314_fpu.c | 4 +- .../amd/display/dc/dml/dcn314/dcn314_fpu.h | 2 +- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 30 +- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.h | 2 +- .../drm/amd/display/dc/dml/dcn35/dcn35_fpu.c | 4 +- .../drm/amd/display/dc/dml/dcn35/dcn35_fpu.h | 2 +- .../amd/display/dc/dml/dcn351/dcn351_fpu.c | 4 +- .../amd/display/dc/dml/dcn351/dcn351_fpu.h | 2 +- .../dc/dml2/dml21/dml21_translation_helper.c | 4 +- .../amd/display/dc/dml2/dml21/dml21_utils.c | 14 +- .../amd/display/dc/dml2/dml21/dml21_wrapper.c | 9 +- .../amd/display/dc/dml2/dml21/dml21_wrapper.h | 11 +- .../amd/display/dc/dml2/dml21/inc/dml_top.h | 1 - .../display/dc/dml2/dml21/inc/dml_top_types.h | 10 +- .../src/dml2_core/dml2_core_dcn4_calcs.c | 7 +- .../src/dml2_core/dml2_core_shared_types.h | 82 ++++- .../dml2/dml21/src/dml2_dpmm/dml2_dpmm_dcn4.c | 3 - .../src/inc/dml2_internal_shared_types.h | 10 +- .../amd/display/dc/dml2/dml2_mall_phantom.c | 2 +- .../drm/amd/display/dc/dml2/dml2_wrapper.c | 11 +- .../drm/amd/display/dc/dml2/dml2_wrapper.h | 4 +- .../amd/display/dc/hwss/dce110/dce110_hwseq.c | 11 +- .../amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 12 +- .../amd/display/dc/hwss/dcn31/dcn31_hwseq.c | 11 +- .../amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 292 +----------------- .../amd/display/dc/hwss/dcn401/dcn401_hwseq.h | 8 - .../display/dc/hwss/hw_sequencer_private.h | 1 + .../gpu/drm/amd/display/dc/inc/core_types.h | 9 +- .../gpu/drm/amd/display/dc/inc/dcn_calcs.h | 2 +- .../gpu/drm/amd/display/dc/link/link_dpms.c | 6 +- .../drm/amd/display/dc/link/link_validation.c | 8 + .../dc/link/protocols/link_dp_capability.c | 2 +- .../link/protocols/link_edp_panel_control.c | 21 ++ .../drm/amd/display/dc/mpc/dcn32/dcn32_mpc.c | 3 - drivers/gpu/drm/amd/display/dc/os_types.h | 1 + .../dc/resource/dce100/dce100_resource.c | 2 +- .../dc/resource/dce110/dce110_resource.c | 2 +- .../dc/resource/dce112/dce112_resource.c | 2 +- .../dc/resource/dce112/dce112_resource.h | 2 +- .../dc/resource/dce60/dce60_resource.c | 2 +- .../dc/resource/dce80/dce80_resource.c | 2 +- .../dc/resource/dcn10/dcn10_resource.c | 4 +- .../dc/resource/dcn20/dcn20_resource.c | 8 +- .../dc/resource/dcn20/dcn20_resource.h | 4 +- .../dc/resource/dcn21/dcn21_resource.c | 8 +- .../dc/resource/dcn21/dcn21_resource.h | 2 +- .../dc/resource/dcn30/dcn30_resource.c | 22 +- .../dc/resource/dcn30/dcn30_resource.h | 6 +- .../dc/resource/dcn31/dcn31_resource.c | 18 +- .../dc/resource/dcn31/dcn31_resource.h | 4 +- .../dc/resource/dcn314/dcn314_resource.c | 14 +- .../dc/resource/dcn314/dcn314_resource.h | 2 +- .../dc/resource/dcn315/dcn315_resource.c | 4 +- .../dc/resource/dcn316/dcn316_resource.c | 4 +- .../dc/resource/dcn32/dcn32_resource.c | 26 +- .../dc/resource/dcn32/dcn32_resource.h | 4 +- .../dc/resource/dcn35/dcn35_resource.c | 6 +- .../dc/resource/dcn351/dcn351_resource.c | 6 +- .../dc/resource/dcn36/dcn36_resource.c | 6 +- .../dc/resource/dcn401/dcn401_resource.c | 31 +- .../dc/resource/dcn401/dcn401_resource.h | 2 +- drivers/gpu/drm/amd/display/dc/sspl/dc_spl.c | 28 +- .../dc/virtual/virtual_stream_encoder.c | 7 + drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 2 + .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 204 +++++++++++- .../gpu/drm/amd/display/dmub/src/dmub_dcn35.c | 16 +- .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 9 +- 80 files changed, 771 insertions(+), 577 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/24 drm/amd/display: [FW Promotion] Release 0.1.11.0
From: Taimur Hassan <[email protected]>
Refactoring some DMUB related structs and enum.
--- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +32 -2
@@ -2139,6 +2139,11 @@ union dmub_cmd_fams2_config { } stream_v1;//v1 }; +struct dmub_fams2_config_v2 { +struct dmub_cmd_fams2_global_config global; +struct dmub_fams2_stream_static_state_v1 stream_v1[DMUB_MAX_STREAMS ];//v1 +}; +/** * DMUB rb command definition for FAMS2 (merged SubVP, FPO, Legacy) */
@@ -2147,6 +2152,22 @@ struct dmub_rb_cmd_fams2 {union dmub_cmd_fams2_config config; }; +/** +* Indirect buffer descriptor +*/ +struct dmub_ib_data { +union dmub_addr src;// location of indirect buffer in memory +uint16_t size;// indirect buffer size in bytes +}; + +/** +* DMUB rb command definition for commands passed over indirect buffer +*/ +struct dmub_rb_cmd_ib { +struct dmub_cmd_header header; +struct dmub_ib_data ib_data; +}; +/** * enum dmub_cmd_idle_opt_type - Idle optimization command type. */
@@ -2170,6 +2191,11 @@ enum dmub_cmd_idle_opt_type {* DCN hardware notify power state. */ DMUB_CMD__IDLE_OPT_SET_DC_POWER_STATE =3 , + +/** +* DCN notify to release HW. +*/ + DMUB_CMD__IDLE_OPT_RELEASE_HW = 4, };/**
@@ -2931,8 +2957,9 @@ enum dmub_cmd_fams_type {*/ DMUB_CMD__FAMS_SET_MANUAL_TRIGGER =3 ,DMUB_CMD__FAMS2_CONFIG =4 , -DMUB_CMD__FAMS2_DRR_UPDATE =5 , - DMUB_CMD__FAMS2_FLIP = 6, +DMUB_CMD__FAMS2_IB_CONFIG =5 , +DMUB_CMD__FAMS2_DRR_UPDATE =6 , + DMUB_CMD__FAMS2_FLIP = 7, };/**
@@ -5926,8 +5953,11 @@ union dmub_rb_cmd {* Definition of a DMUB_CMD__PSP_ASSR_ENABLE command. */ struct dmub_rb_cmd_assr_enable assr_enable; +struct dmub_rb_cmd_fams2 fams2_config; +struct dmub_rb_cmd_ib ib_fams2_config; +struct dmub_rb_cmd_fams2_drr_update fams2_drr_update;struct dmub_rb_cmd_fams2_flip fams2_flip;
Signature · 1 line
2.43.0
PATCH 2/24 drm/amd/display: Re-order FAMS2 sub commands
In reply to Wayne LinFrom: Alvin Lee <[email protected]>
[Why & How]
New enums need to be added to the end to avoid
back compat issues.
--- drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +3 -3
@@ -2957,9 +2957,9 @@ enum dmub_cmd_fams_type {*/ DMUB_CMD__FAMS_SET_MANUAL_TRIGGER =3 ,DMUB_CMD__FAMS2_CONFIG =4 , -DMUB_CMD__FAMS2_IB_CONFIG =5 , -DMUB_CMD__FAMS2_DRR_UPDATE =6 , - DMUB_CMD__FAMS2_FLIP = 7, +DMUB_CMD__FAMS2_DRR_UPDATE =5 , +DMUB_CMD__FAMS2_FLIP =6 , + DMUB_CMD__FAMS2_IB_CONFIG = 7, };/**
Signature · 1 line
2.43.0
PATCH 3/24 drm/amd/display: DML21 Fixes
In reply to Wayne LinFrom: Austin Zheng <[email protected]>
- Store state related info inside mode_lib.
- Fix bad DCFCLK deep sleep
- Update FAMS structure in DMUB header
--- .../amd/display/dc/dml2/dml21/inc/dml_top.h | 1 - .../display/dc/dml2/dml21/inc/dml_top_types.h | 10 ++- .../src/dml2_core/dml2_core_dcn4_calcs.c | 7 +- .../src/dml2_core/dml2_core_shared_types.h | 82 ++++++++++++++++++- .../dml2/dml21/src/dml2_dpmm/dml2_dpmm_dcn4.c | 3 - .../src/inc/dml2_internal_shared_types.h | 10 ++- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 18 +++- 7 files changed, 116 insertions(+), 15 deletions(-)
drivers/gpu/drm/amd/display/dc/dml2/dml21/inc/dml_top.h +0 -1
@@ -43,5 +43,4 @@ bool dml2_build_mode_programming(struct dml2_build_mode_programming_in_out *in_o*/ bool dml2_build_mcache_programming (struct dml2_build_mcache_programming_in_out *in_out); -#endif
drivers/gpu/drm/amd/display/dc/dml2/dml21/inc/dml_top_types.h +9 -1
@@ -279,7 +279,10 @@ struct dml2_per_stream_programming { } phantom_stream;union dmub_cmd_fams2_config fams2_base_params; -union dmub_cmd_fams2_config fams2_sub_params; +union { +union dmub_cmd_fams2_config fams2_sub_params; +union dmub_fams2_stream_static_sub_state_v2 fams2_sub_params_v2; + }; };//-----------------
@@ -674,9 +677,14 @@ struct dml2_display_cfg_programming {// unlimited # of mcache struct dml2_mcache_surface_allocation non_optimized_mcache_allocation[DML2_MAX_PLANES ]; +bool failed_prefetch; +bool failed_uclk_pstate;bool failed_mcache_validation;bool failed_dpmm;bool failed_mode_programming; +bool failed_mode_programming_dcfclk; +bool failed_mode_programming_prefetch; +bool failed_mode_programming_flip;bool failed_map_watermarks; } informative; };
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.c +4 -3
@@ -7905,6 +7905,7 @@ static noinline_for_stack void dml_core_ms_prefetch_check(struct dml2_core_inter } +static bool dml_core_mode_support (struct dml2_core_calcs_mode_support_ex *in_out_params) {struct dml2_core_internal_display_mode_lib *mode_lib = in_out_params->mode_lib;
@@ -11880,7 +11881,7 @@ static bool dml_core_mode_programming(struct dml2_core_calcs_mode_programming_ex }//Maximum Bandwidth Used - s->TotalWRBandwidth =0 ; + mode_lib->mp.TotalWRBandwidth =0 ;for (k =0 ; k < display_cfg->num_streams; ++k) { s->WRBandwidth =0 ;if (display_cfg->stream_descriptors[k].writeback.active_writebacks_per_stream >0 ) {
@@ -11889,7 +11890,7 @@ static bool dml_core_mode_programming(struct dml2_core_calcs_mode_programming_ex (display_cfg->stream_descriptors[k].timing.h_total * display_cfg->stream_descriptors[k].writeback.writeback_stream[0 ].input_height / ((double )display_cfg->stream_descriptors[k].timing.pixel_clock_khz /1000 )) * (display_cfg->stream_descriptors[k].writeback.writeback_stream[0 ].pixel_format == dml2_444_32 ?4.0 :8.0 ); - s->TotalWRBandwidth = s->TotalWRBandwidth + s->WRBandwidth; + mode_lib->mp.TotalWRBandwidth = mode_lib->mp.TotalWRBandwidth + s->WRBandwidth; } }
@@ -13243,7 +13244,7 @@ void dml2_core_calcs_get_informative(const struct dml2_core_internal_display_mod out->informative.misc.DisplayPipeLineDeliveryTimeLumaPrefetch[k] = mode_lib->mp.DisplayPipeLineDeliveryTimeLumaPrefetch[k]; out->informative.misc.DisplayPipeLineDeliveryTimeChromaPrefetch[k] = mode_lib->mp.DisplayPipeLineDeliveryTimeChromaPrefetch[k]; - out->informative.misc.WritebackRequiredBandwidth = mode_lib->scratch.dml_core_mode_programming_locals.TotalWRBandwidth /1000.0 ; + out->informative.misc.WritebackRequiredBandwidth = mode_lib->mp.TotalWRBandwidth /1000.0 ; out->informative.misc.WritebackAllowDRAMClockChangeEndPosition[k] = mode_lib->mp.WritebackAllowDRAMClockChangeEndPosition[k]; out->informative.misc.WritebackAllowFCLKChangeEndPosition[k] = mode_lib->mp.WritebackAllowFCLKChangeEndPosition[k]; out->informative.misc.DSCCLK_calculated[k] = mode_lib->mp.DSCCLK[k];
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_shared_types.h +81 -1
137 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_dpmm/dml2_dpmm_dcn4.c +0 -3
@@ -389,9 +389,6 @@ static bool map_min_clocks_to_dpm(const struct dml2_core_mode_support_result *moif (result) result =round_up_to_next_dpm (&display_cfg->min_clocks.dcn4x.dispclk_khz, &state_table->dispclk); -if (result) - result =round_up_to_next_dpm (&display_cfg->min_clocks.dcn4x.deepsleep_dcfclk_khz, &state_table->dcfclk); -for (i =0 ; i <DML2_MAX_DCN_PIPES ; i++) {if (result) result =round_up_to_next_dpm (&display_cfg->plane_programming[i].min_clocks.dcn4x.dppclk_khz, &state_table->dppclk);
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/inc/dml2_internal_shared_types.h +8 -2
@@ -202,6 +202,8 @@ struct dml2_core_mode_support_result { } active;unsigned int dispclk_khz; +unsigned int dpprefclk_khz; +unsigned int dtbrefclk_khz;unsigned int dcfclk_deepsleep_khz;unsigned int socclk_khz;
@@ -446,13 +448,17 @@ struct dml2_core_internal_state_intermediates { };struct dml2_core_mode_support_locals { -struct dml2_core_calcs_mode_support_ex mode_support_ex_params; +union { +struct dml2_core_calcs_mode_support_ex mode_support_ex_params; + };struct dml2_display_cfg svp_expanded_display_cfg;struct dml2_calculate_mcache_allocation_in_out calc_mcache_allocation_params; };struct dml2_core_mode_programming_locals { -struct dml2_core_calcs_mode_programming_ex mode_programming_ex_params; +union { +struct dml2_core_calcs_mode_programming_ex mode_programming_ex_params; + };struct dml2_display_cfg svp_expanded_display_cfg; };
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +14 -4
@@ -104,6 +104,14 @@*/ #define DMUB_MAX_FPO_STREAMS 4 +/* Define to ensure that the "common" members always appear in the same +* order in different structs for back compat purposes +*/ +#define COMMON_STREAM_STATIC_SUB_STATE \ + struct dmub_fams2_cmd_legacy_stream_static_state legacy; \ + struct dmub_fams2_cmd_subvp_stream_static_state subvp; \ + struct dmub_fams2_cmd_drr_stream_static_state drr; +/* Maximum number of streams on any ASIC. */ #define DMUB_MAX_STREAMS 6
@@ -2021,11 +2029,13 @@ union dmub_fams2_stream_static_sub_state { };//v0 union dmub_fams2_cmd_stream_static_sub_state { -struct dmub_fams2_cmd_legacy_stream_static_state legacy; -struct dmub_fams2_cmd_subvp_stream_static_state subvp; -struct dmub_fams2_cmd_drr_stream_static_state drr; + COMMON_STREAM_STATIC_SUB_STATE }; //v1 +union dmub_fams2_stream_static_sub_state_v2 { + COMMON_STREAM_STATIC_SUB_STATE +}; //v2 + struct dmub_fams2_stream_static_state { enum fams2_stream_type type; uint32_t otg_vline_time_ns;
@@ -2091,7 +2101,7 @@ struct dmub_fams2_cmd_stream_static_base_state {struct dmub_fams2_stream_static_state_v1 {struct dmub_fams2_cmd_stream_static_base_state base; -union dmub_fams2_cmd_stream_static_sub_state sub_state; +union dmub_fams2_stream_static_sub_state_v2 sub_state; };//v1 /**
Signature · 1 line
2.43.0
PATCH 4/24 drm/amd/display: Support OLED SDR with AMD ABC
In reply to Wayne LinFrom: Camille Cho <[email protected]>
[Why]
Nits programming for SDR panel is only supported by VESA ABC.
[How]
1. Loose nits programming for OLED SDR panel with AMD ABC.
2. We support two ABC methods. Disable one before we program the other in case panel freaks out.
3. Update HDR judgement in setBR with a solider condition.
--- .../link/protocols/link_edp_panel_control.c | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+)
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c +21 -0
@@ -173,6 +173,15 @@ bool edp_set_backlight_level_nits(struct dc_link *link, target_luminance = (struct target_luminance_value *)&backlight_millinits; +//make sure we disable AMD ABC first. +core_link_read_dpcd (link,DP_SOURCE_BACKLIGHT_CONTROL , + &backlight_enable,sizeof (uint8_t )); +if (backlight_enable) { + backlight_enable =0 ; +core_link_write_dpcd (link,DP_SOURCE_BACKLIGHT_CONTROL , + &backlight_enable,1 ); + } +core_link_read_dpcd (link,DP_EDP_BACKLIGHT_MODE_SET_REGISTER , &backlight_enable,sizeof (uint8_t ));
@@ -193,10 +202,22 @@ bool edp_set_backlight_level_nits(struct dc_link *link, *(uint16_t *)&dpcd_backlight_set.backlight_transition_time_ms = (uint16_t )transition_time_in_ms;uint8_t backlight_control = isHDR ?1 :0 ; +uint8_t backlight_enable =0 ; +// OLEDs have no PWM, they can only use AUX if (link->dpcd_sink_ext_caps.bits.oled ==1 ) backlight_control =1 ; +//make sure we disable VESA ABC first. +core_link_read_dpcd (link,DP_EDP_BACKLIGHT_MODE_SET_REGISTER , + &backlight_enable,sizeof (uint8_t )); + +if (backlight_enable &DP_EDP_PANEL_LUMINANCE_CONTROL_ENABLE ) { + backlight_enable &= ~DP_EDP_PANEL_LUMINANCE_CONTROL_ENABLE ; +core_link_write_dpcd (link,DP_EDP_BACKLIGHT_MODE_SET_REGISTER , + &backlight_enable,sizeof (backlight_enable)); + } +if (core_link_write_dpcd (link,DP_SOURCE_BACKLIGHT_LEVEL , (uint8_t *)(&dpcd_backlight_set),sizeof (dpcd_backlight_set)) !=DC_OK )
Signature · 1 line
2.43.0
PATCH 5/24 drm/amd/display: move RMCM programming
In reply to Wayne LinFrom: Yihan Zhu <[email protected]>
[WHY & HOW]
Move only RMCM programming outside of dcn401. Extended HW definition in dc for memory layout to extend support.
--- drivers/gpu/drm/amd/display/dc/dc.h | 31 ++ drivers/gpu/drm/amd/display/dc/dc_types.h | 2 - .../dc/dml2/dml21/dml21_translation_helper.c | 4 +- .../amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 8 - .../amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 288 +----------------- .../amd/display/dc/hwss/dcn401/dcn401_hwseq.h | 8 - .../drm/amd/display/dc/mpc/dcn32/dcn32_mpc.c | 3 - 7 files changed, 42 insertions(+), 302 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +31 -0
@@ -67,6 +67,7 @@ struct dmub_notification;#define MIN_VIEWPORT_SIZE 12#define MAX_NUM_EDP 2#define MAX_HOST_ROUTERS_NUM 2 +#define MAX_SUPPORTED_FORMATS 7/* Display Core Interfaces */ struct dc_versions {
@@ -192,6 +193,34 @@ struct dpp_color_caps {struct rom_curve_caps ogam_rom_caps; }; +/* Below structure is to describe the HW support for mem layout, extend support +range to match what OS could handle in the roadmap */ +struct lut3d_caps { +uint32_t dma_3d_lut :1 ;/*< DMA mode support for 3D LUT */ +struct { +uint32_t swizzle_3d_rgb :1 ; +uint32_t swizzle_3d_bgr :1 ; +uint32_t linear_1d :1 ; + } mem_layout_support; +struct { +uint32_t unorm_12msb :1 ; +uint32_t unorm_12lsb :1 ; +uint32_t float_fp1_5_10 :1 ; + } mem_format_support; +struct { +uint32_t order_rgba :1 ; +uint32_t order_bgra :1 ; + } mem_pixel_order_support; +/*< size options are 9, 17, 33, 45, 65 */ +struct { +uint32_t dim_9 :1 ;/* 3D LUT support for 9x9x9 */ +uint32_t dim_17 :1 ;/* 3D LUT support for 17x17x17 */ +uint32_t dim_33 :1 ;/* 3D LUT support for 33x33x33 */ +uint32_t dim_45 :1 ;/* 3D LUT support for 45x45x45 */ +uint32_t dim_65 :1 ;/* 3D LUT support for 65x65x65 */ + } lut_dim_caps; +}; +/** * struct mpc_color_caps - color pipeline capabilities for multiple pipe and * plane combined blocks
@@ -211,6 +240,8 @@ struct mpc_color_caps { uint16_t num_3dluts : 3; uint16_t shared_3d_lut:1;struct rom_curve_caps ogam_rom_caps; +struct lut3d_caps mcm_3d_lut_caps; +struct lut3d_caps rmcm_3d_lut_caps; };/**
drivers/gpu/drm/amd/display/dc/dc_types.h +0 -2
@@ -1255,7 +1255,6 @@ enum dc_cm2_gpu_mem_layout {enum dc_cm2_gpu_mem_pixel_component_order {DC_CM2_GPU_MEM_PIXEL_COMPONENT_ORDER_RGBA , -DC_CM2_GPU_MEM_PIXEL_COMPONENT_ORDER_BGRA };enum dc_cm2_gpu_mem_format {
@@ -1277,7 +1276,6 @@ struct dc_cm2_gpu_mem_format_parameters {enum dc_cm2_gpu_mem_size {DC_CM2_GPU_MEM_SIZE_171717 , -DC_CM2_GPU_MEM_SIZE_333333 ,DC_CM2_GPU_MEM_SIZE_TRANSFORMED , };
drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c +1 -3
@@ -888,10 +888,8 @@ static void populate_dml21_plane_config_from_plane_state(struct dml2_context *dmcase DC_CM2_GPU_MEM_SIZE_171717 : plane->tdlut.tdlut_width_mode = dml2_tdlut_width_17_cube;break ; -case DC_CM2_GPU_MEM_SIZE_333333 : - plane->tdlut.tdlut_width_mode = dml2_tdlut_width_33_cube; -break ;case DC_CM2_GPU_MEM_SIZE_TRANSFORMED : +default ://plane->tdlut.tdlut_width_mode = dml2_tdlut_width_flatten; // dml2_tdlut_width_flatten undefined break ; }
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c +0 -8
@@ -1971,14 +1971,6 @@ static void dcn20_program_pipe( pipe_ctx->plane_state->update_flags.bits.hdr_mult)) hws->funcs.set_hdr_multiplier(pipe_ctx); -if (hws->funcs.populate_mcm_luts) { -if (pipe_ctx->plane_state) { - hws->funcs.populate_mcm_luts (dc, pipe_ctx, pipe_ctx->plane_state->mcm_luts, - pipe_ctx->plane_state->lut_bank_a); - pipe_ctx->plane_state->lut_bank_a = !pipe_ctx->plane_state->lut_bank_a; - } - } - if (pipe_ctx->plane_state && (pipe_ctx->plane_state->update_flags.bits.in_transfer_func_change || pipe_ctx->plane_state->update_flags.bits.gamma_change ||
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c +10 -278
324 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.h +0 -8
@@ -109,12 +109,4 @@ void dcn401_detect_pipe_changes(void dcn401_plane_atomic_power_down (struct dc *dc,struct dpp *dpp,struct hubp *hubp); -bool dcn401_program_rmcm_luts ( -struct hubp *hubp, -struct pipe_ctx *pipe_ctx, -enum dc_cm2_transfer_func_source lut3d_src, -struct dc_cm2_func_luts *mcm_luts, -struct mpc *mpc, -bool lut_bank_a, -int mpcc_id);#endif /* __DC_HWSS_DCN401_H__ */
drivers/gpu/drm/amd/display/dc/mpc/dcn32/dcn32_mpc.c +0 -3
@@ -30,7 +30,6 @@#include "basics/conversion.h" #include "dcn10/dcn10_cm_common.h" #include "dc.h" -#include "dcn401/dcn401_mpc.h" #define REG (reg)\ mpc30->mpc_regs->reg
@@ -1022,8 +1021,6 @@ static const struct mpc_funcs dcn32_mpc_funcs = { .power_on_mpc_mem_pwr = mpc3_power_on_ogam_lut, .get_mpc_out_mux = mpc1_get_mpc_out_mux, .set_bg_color = mpc1_set_bg_color, - .set_movable_cm_location = mpc401_set_movable_cm_location, - .populate_lut = mpc401_populate_lut, };
Signature · 1 line
2.43.0
PATCH 6/24 drm/amd/display: Indirect buffer transport for FAMS2 commands
In reply to Wayne LinFrom: Oleh Kuzhylnyi <[email protected]>
[Why]
The quantity and duration of FAMS2 commands are set to increase in future products. This necessitates the implementation of a new mechanism for chaining commands together, allowing all commands to be processed within a single transaction.
[How]
The indirect buffer acts as a shared buffer on the driver side, mapped to DMUB's internal CW7 address. Its source address and size are sent through mailbox command to DMUB, triggering the transaction.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 + drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 59 ++++++++++++++++++- drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 2 + .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 9 ++- 4 files changed, 69 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
@@ -2404,6 +2404,7 @@ static int dm_dmub_sw_init(struct amdgpu_device *adev)DMUB_WINDOW_MEMORY_TYPE_FB ,//DMUB_WINDOW_5_TRACEBUFF DMUB_WINDOW_MEMORY_TYPE_FB ,//DMUB_WINDOW_6_FW_STATE DMUB_WINDOW_MEMORY_TYPE_FB ,//DMUB_WINDOW_7_SCRATCH_MEM +DMUB_WINDOW_MEMORY_TYPE_FB ,//DMUB_WINDOW_IB_MEM DMUB_WINDOW_MEMORY_TYPE_FB, //DMUB_WINDOW_SHARED_STATE };int r;
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +58 -1
71 lines not on this page · raw message
drivers/gpu/drm/amd/display/dmub/dmub_srv.h +2 -0
@@ -129,6 +129,7 @@ enum dmub_window_id {DMUB_WINDOW_5_TRACEBUFF ,DMUB_WINDOW_6_FW_STATE ,DMUB_WINDOW_7_SCRATCH_MEM , +DMUB_WINDOW_IB_MEM ,DMUB_WINDOW_SHARED_STATE , DMUB_WINDOW_TOTAL, };
@@ -539,6 +540,7 @@ struct dmub_srv {uint32_t fw_version;bool is_virtual;struct dmub_fb scratch_mem_fb; +struct dmub_fb ib_mem_gart;volatile struct dmub_shared_state_feature_block *shared_state;volatile const struct dmub_fw_state *fw_state;
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +8 -1
@@ -65,6 +65,9 @@/* Default scratch mem size. */ #define DMUB_SCRATCH_MEM_SIZE (1024) +/* Default indirect buffer size. */ +#define DMUB_IB_MEM_SIZE (1280) +/* Number of windows in use. */ #define DMUB_NUM_WINDOWS (DMUB_WINDOW_TOTAL)/* Base addresses. */
@@ -559,6 +562,7 @@ enum dmub_status window_sizes[DMUB_WINDOW_5_TRACEBUFF ] = trace_buffer_size; window_sizes[DMUB_WINDOW_6_FW_STATE ] = fw_state_size; window_sizes[DMUB_WINDOW_7_SCRATCH_MEM ] =DMUB_SCRATCH_MEM_SIZE ; + window_sizes[DMUB_WINDOW_IB_MEM ] =DMUB_IB_MEM_SIZE ; window_sizes[DMUB_WINDOW_SHARED_STATE ] =max (DMUB_FW_HEADER_SHARED_STATE_SIZE , shared_state_size); out->fb_size =
@@ -645,6 +649,7 @@ enum dmub_status dmub_srv_hw_init(struct dmub_srv *dmub,struct dmub_fb *tracebuff_fb = params->fb[DMUB_WINDOW_5_TRACEBUFF ];struct dmub_fb *fw_state_fb = params->fb[DMUB_WINDOW_6_FW_STATE ];struct dmub_fb *scratch_mem_fb = params->fb[DMUB_WINDOW_7_SCRATCH_MEM ]; +struct dmub_fb *ib_mem_gart = params->fb[DMUB_WINDOW_IB_MEM ];struct dmub_fb *shared_state_fb = params->fb[DMUB_WINDOW_SHARED_STATE ];struct dmub_rb_init_params rb_params, outbox0_rb_params;
@@ -655,7 +660,7 @@ enum dmub_status dmub_srv_hw_init(struct dmub_srv *dmub,return DMUB_STATUS_INVALID ;if (!inst_fb || !stack_fb || !data_fb || !bios_fb || !mail_fb || - !tracebuff_fb || !fw_state_fb || !scratch_mem_fb) { + !tracebuff_fb || !fw_state_fb || !scratch_mem_fb || !ib_mem_gart) {ASSERT (0 );return DMUB_STATUS_INVALID ; }
@@ -741,6 +746,8 @@ enum dmub_status dmub_srv_hw_init(struct dmub_srv *dmub, dmub->scratch_mem_fb = *scratch_mem_fb; + dmub->ib_mem_gart = *ib_mem_gart; +if (dmub->hw_funcs.setup_windows) dmub->hw_funcs.setup_windows (dmub, &cw2, &cw3, &cw4, &cw5, &cw6, ®ion6);
Signature · 1 line
2.43.0
PATCH 7/24 drm/amd/display: Drop unnecessary `amdgpu` prefix
In reply to Wayne LinFrom: Mario Limonciello <[email protected]>
[Why]
The drm_*() print macros will handle including the driver in the print already. The extra print of the word amdgpu is unnecessary.
[How]
Modify all prints to drop amdgpu: .
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 32 +++++++++---------- .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 6 ++-- 2 files changed, 19 insertions(+), 19 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +16 -16
@@ -1847,7 +1847,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)mutex_init (&adev->dm.audio_lock);if (amdgpu_dm_irq_init (adev)) { -drm_err (adev_to_drm (adev),"amdgpu: failed to initialize DM IRQ support.\n" ); +drm_err (adev_to_drm (adev),"failed to initialize DM IRQ support.\n" ); goto error; }
@@ -2037,7 +2037,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) adev->dm.hpd_rx_offload_wq =hpd_rx_irq_create_workqueue (adev);if (!adev->dm.hpd_rx_offload_wq) { -drm_err (adev_to_drm (adev),"amdgpu: failed to create hpd rx offload workqueue.\n" ); +drm_err (adev_to_drm (adev),"failed to create hpd rx offload workqueue.\n" ); goto error; }
@@ -2053,7 +2053,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) adev->dm.freesync_module =mod_freesync_create (adev->dm.dc);if (!adev->dm.freesync_module) {drm_err (adev_to_drm (adev), -"amdgpu: failed to initialize freesync_module.\n" ); +"failed to initialize freesync_module.\n" ); }else drm_dbg_driver (adev_to_drm (adev),"amdgpu: freesync_module init done %p.\n" , adev->dm.freesync_module);
@@ -2064,7 +2064,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) adev->dm.vblank_control_workqueue =create_singlethread_workqueue ("dm_vblank_control_workqueue" );if (!adev->dm.vblank_control_workqueue) -drm_err (adev_to_drm (adev),"amdgpu: failed to initialize vblank_workqueue.\n" ); +drm_err (adev_to_drm (adev),"failed to initialize vblank_workqueue.\n" ); } if (adev->dm.dc->caps.ips_support &&
@@ -2075,7 +2075,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) adev->dm.hdcp_workqueue =hdcp_create_workqueue (adev, &init_params.cp_psp, adev->dm.dc);if (!adev->dm.hdcp_workqueue) -drm_err (adev_to_drm (adev),"amdgpu: failed to initialize hdcp_workqueue.\n" ); +drm_err (adev_to_drm (adev),"failed to initialize hdcp_workqueue.\n" );else drm_dbg_driver (adev_to_drm (adev),"amdgpu: hdcp_workqueue init done %p.\n" , adev->dm.hdcp_workqueue);
@@ -2085,20 +2085,20 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)init_completion (&adev->dm.dmub_aux_transfer_done); adev->dm.dmub_notify =kzalloc (sizeof (struct dmub_notification ),GFP_KERNEL );if (!adev->dm.dmub_notify) { -drm_info (adev_to_drm (adev),"amdgpu: fail to allocate adev->dm.dmub_notify" ); +drm_info (adev_to_drm (adev),"fail to allocate adev->dm.dmub_notify" ); goto error; } adev->dm.delayed_hpd_wq =create_singlethread_workqueue ("amdgpu_dm_hpd_wq" );if (!adev->dm.delayed_hpd_wq) { -drm_err (adev_to_drm (adev),"amdgpu: failed to create hpd offload workqueue.\n" ); +drm_err (adev_to_drm (adev),"failed to create hpd offload workqueue.\n" ); goto error; }amdgpu_dm_outbox_init (adev);if (!register_dmub_notify_callback (adev,DMUB_NOTIFICATION_AUX_REPLY , dmub_aux_setconfig_callback, false)) { -drm_err (adev_to_drm (adev),"amdgpu: fail to register dmub aux callback" ); +drm_err (adev_to_drm (adev),"fail to register dmub aux callback" ); goto error; }
@@ -2107,7 +2107,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)if (!register_dmub_notify_callback (adev,DMUB_NOTIFICATION_FUSED_IO , dmub_aux_fused_io_callback, false)) { -drm_err (adev_to_drm (adev),"amdgpu: fail to register dmub fused io callback" ); +drm_err (adev_to_drm (adev),"fail to register dmub fused io callback" ); goto error; }/* Enable outbox notification only after IRQ handlers are registered and DMUB is alive.
@@ -2125,7 +2125,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)if (amdgpu_dm_initialize_drm_device (adev)) {drm_err (adev_to_drm (adev), -"amdgpu: failed to initialize sw for display support.\n" ); +"failed to initialize sw for display support.\n" ); goto error; }
@@ -2140,14 +2140,14 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)if (drm_vblank_init (adev_to_drm (adev), adev->dm.display_indexes_num)) {drm_err (adev_to_drm (adev), -"amdgpu: failed to initialize sw for display support.\n" ); +"failed to initialize sw for display support.\n" ); goto error; }#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY )amdgpu_dm_crtc_secure_display_create_contexts (adev);if (!adev->dm.secure_display_ctx.crtc_ctx) -drm_err (adev_to_drm (adev),"amdgpu: failed to initialize secure display contexts.\n" ); +drm_err (adev_to_drm (adev),"failed to initialize secure display contexts.\n" );if (amdgpu_ip_version (adev,DCE_HWIP ,0 ) >=IP_VERSION (4 ,0 ,1 )) adev->dm.secure_display_ctx.support_mul_roi = true;
@@ -2571,7 +2571,7 @@ static int dm_sw_init(struct amdgpu_ip_block *ip_block) adev->dm.cgs_device =amdgpu_cgs_create_device (adev);if (!adev->dm.cgs_device) { -drm_err (adev_to_drm (adev),"amdgpu: failed to create cgs device.\n" ); +drm_err (adev_to_drm (adev),"failed to create cgs device.\n" );return -EINVAL ; }
@@ -4002,19 +4002,19 @@ static int register_hpd_handlers(struct amdgpu_device *adev)if (dc_is_dmub_outbox_supported (adev->dm.dc)) {if (!register_dmub_notify_callback (adev,DMUB_NOTIFICATION_HPD , dmub_hpd_callback, true)) { -drm_err (adev_to_drm (adev),"amdgpu: fail to register dmub hpd callback" ); +drm_err (adev_to_drm (adev),"fail to register dmub hpd callback" );return -EINVAL ; }if (!register_dmub_notify_callback (adev,DMUB_NOTIFICATION_HPD_IRQ , dmub_hpd_callback, true)) { -drm_err (adev_to_drm (adev),"amdgpu: fail to register dmub hpd callback" ); +drm_err (adev_to_drm (adev),"fail to register dmub hpd callback" );return -EINVAL ; }if (!register_dmub_notify_callback (adev,DMUB_NOTIFICATION_HPD_SENSE_NOTIFY , dmub_hpd_sense_callback, true)) { -drm_err (adev_to_drm (adev),"amdgpu: fail to register dmub hpd sense callback" ); +drm_err (adev_to_drm (adev),"fail to register dmub hpd sense callback" );return -EINVAL ; } }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +3 -3
@@ -107,7 +107,7 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,if (payload.write && result >=0 ) {if (result) {/*one byte indicating partially written bytes*/ -drm_dbg_dp (adev_to_drm (adev),"amdgpu: AUX partially written\n" ); +drm_dbg_dp (adev_to_drm (adev),"AUX partially written\n" ); result = payload.data[0 ]; }else if (!payload.reply[0 ])/*I2C_ACK|AUX_ACK*/
@@ -133,11 +133,11 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,break ; } -drm_dbg_dp (adev_to_drm (adev),"amdgpu: DP AUX transfer fail:%d\n" , operation_result); +drm_dbg_dp (adev_to_drm (adev),"DP AUX transfer fail:%d\n" , operation_result); }if (payload.reply[0 ]) -drm_dbg_dp (adev_to_drm (adev),"amdgpu: AUX reply command not ACK: 0x%02x." , +drm_dbg_dp (adev_to_drm (adev),"AUX reply command not ACK: 0x%02x." , payload.reply[0 ]);return result;
Signature · 1 line
2.43.0
PATCH 8/24 drm/amd/display: Call setup_stream_attribute after stream enc clk is ungated
In reply to Wayne LinFrom: Michael Strauss <[email protected]>
[WHY]
If symclk RCO is enabled, stream encoder may not be receiving an ungated clock by the time we attempt to set stream attributes when setting dpms on. Since the clock is gated, register writes to the stream encoder fail.
[HOW]
Move set_stream_attribute call into enable_stream, just after the point where symclk32_se is ungated. Logically there is no need to set stream attributes as early as is currently done in link_set_dpms_on, so this should have no impact beyond the RCO fix.
--- drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c | 1 + drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 2 ++ drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 2 ++ drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 3 --- .../drm/amd/display/dc/virtual/virtual_stream_encoder.c | 7 +++++++ 5 files changed, 12 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +1 -0
@@ -671,6 +671,7 @@ void dce110_enable_stream(struct pipe_ctx *pipe_ctx)uint32_t early_control =0 ;struct timing_generator *tg = pipe_ctx->stream_res.tg; + link_hwss->setup_stream_attribute (pipe_ctx); link_hwss->setup_stream_encoder (pipe_ctx); dc->hwss.update_info_frame (pipe_ctx);
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c +2 -0
@@ -3046,6 +3046,8 @@ void dcn20_enable_stream(struct pipe_ctx *pipe_ctx) link_enc->transmitter - TRANSMITTER_UNIPHY_A); } + link_hwss->setup_stream_attribute (pipe_ctx); +if (dc->res_pool->dccg->funcs->set_pixel_rate_div) dc->res_pool->dccg->funcs->set_pixel_rate_div( dc->res_pool->dccg,
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c +2 -0
@@ -967,6 +967,8 @@ void dcn401_enable_stream(struct pipe_ctx *pipe_ctx) } } + link_hwss->setup_stream_attribute (pipe_ctx); +if (dc->res_pool->dccg->funcs->set_pixel_rate_div) { dc->res_pool->dccg->funcs->set_pixel_rate_div( dc->res_pool->dccg,
drivers/gpu/drm/amd/display/dc/link/link_dpms.c +0 -3
@@ -2458,7 +2458,6 @@ void link_set_dpms_on(struct link_encoder *link_enc = pipe_ctx->link_res.dio_link_enc;enum otg_out_mux_dest otg_out_dest =OUT_MUX_DIO ;struct vpg *vpg = pipe_ctx->stream_res.stream_enc->vpg; -const struct link_hwss *link_hwss =get_link_hwss (link, &pipe_ctx->link_res);bool apply_edp_fast_boot_optimization = pipe_ctx->stream->apply_edp_fast_boot_optimization;
@@ -2502,8 +2501,6 @@ void link_set_dpms_on( pipe_ctx->stream_res.tg->funcs->set_out_mux (pipe_ctx->stream_res.tg, otg_out_dest); } - link_hwss->setup_stream_attribute (pipe_ctx); - pipe_ctx->stream->apply_edp_fast_boot_optimization = false;// Enable VPG before building infoframe
drivers/gpu/drm/amd/display/dc/virtual/virtual_stream_encoder.c +7 -0
@@ -44,6 +44,11 @@ static void virtual_stream_encoder_dvi_set_stream_attribute( struct dc_crtc_timing *crtc_timing, bool is_dual_link) {} +static void virtual_stream_encoder_lvds_set_stream_attribute ( +struct stream_encoder *enc, +struct dc_crtc_timing *crtc_timing) +{} +static void virtual_stream_encoder_set_throttled_vcp_size (struct stream_encoder *enc,struct fixed31_32 avg_time_slots_per_mtp)
@@ -115,6 +120,8 @@ static const struct stream_encoder_funcs virtual_str_enc_funcs = { virtual_stream_encoder_hdmi_set_stream_attribute, .dvi_set_stream_attribute = virtual_stream_encoder_dvi_set_stream_attribute, + .lvds_set_stream_attribute = + virtual_stream_encoder_lvds_set_stream_attribute, .set_throttled_vcp_size = virtual_stream_encoder_set_throttled_vcp_size, .update_hdmi_info_packets =
Signature · 1 line
2.43.0
PATCH 9/24 drm/amd/display: Correct non-OLED pre_T11_delay.
In reply to Wayne LinFrom: Zhongwei Zhang <[email protected]>
[Why]
Only OLED panels require non-zero pre_T11_delay defaultly. Others should be controlled by power sequence.
[How]
For non OLED, pre_T11_delay delay in code should be zero. Also post_T7_delay.
--- drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +4 -3
@@ -953,8 +953,8 @@ void dce110_edp_backlight_control(struct dc_context *ctx = link->ctx;struct bp_transmitter_control cntl = {0 };uint8_t pwrseq_instance =0 ; -unsigned int pre_T11_delay =OLED_PRE_T11_DELAY ; -unsigned int post_T7_delay =OLED_POST_T7_DELAY ; +unsigned int pre_T11_delay = (link->dpcd_sink_ext_caps.bits.oled ?OLED_PRE_T11_DELAY :0 ); +unsigned int post_T7_delay = (link->dpcd_sink_ext_caps.bits.oled ?OLED_POST_T7_DELAY :0 );if (dal_graphics_object_id_get_connector_id (link->link_enc->connector) !=CONNECTOR_ID_EDP ) {
@@ -1070,7 +1070,8 @@ void dce110_edp_backlight_control(if (!enable) {/*follow oem panel config's requirement*/ pre_T11_delay += link->panel_config.pps.extra_pre_t11_ms; -msleep (pre_T11_delay); +if (pre_T11_delay) +msleep (pre_T11_delay); } }
Signature · 1 line
2.43.0
PATCH 10/24 drm/amd/display: Avoid trying AUX transactions on disconnected ports
In reply to Wayne Lin[Why & How]
Observe that we try to access DPCD 0x600h of disconnected DP ports. In order not to wasting time on retrying these ports, call dpcd_write_rx_power_ctrl() after checking its connection status.
--- drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/link/link_dpms.c +2 -1
@@ -140,7 +140,8 @@ void link_blank_dp_stream(struct dc_link *link, bool hw_init) } } -if ((!link->wa_flags.dp_keep_receiver_powered) || hw_init) +if (((!link->wa_flags.dp_keep_receiver_powered) || hw_init) && + (link->type != dc_connection_none))dpcd_write_rx_power_ctrl (link, false); } }
Signature · 1 line
2.43.0
PATCH 11/24 drm/amd/display: Add disconnect case on dongle check
In reply to Wayne LinFrom: Jingwen Zhu <[email protected]>
[why]
In the case of an external monitor disconnection, the kernel mode will attempt to post new timing validation with two path counts (eDP + external monitor removed to virtual).
[how]
Skip validating color depth and pixel encoding in the scenario involving a DP to HDMI active converter dongle.
--- drivers/gpu/drm/amd/display/dc/link/link_validation.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/display/dc/link/link_validation.c +8 -0
@@ -86,6 +86,10 @@ static bool dp_active_dongle_validate_timing(if (!dongle_caps->is_dp_hdmi_ycbcr420_pass_through)return false;break ; +case PIXEL_ENCODING_UNDEFINED : +/* These color depths are currently not supported */ +ASSERT (false); +break ;default :/* Invalid Pixel Encoding*/ return false;
@@ -104,6 +108,10 @@ static bool dp_active_dongle_validate_timing(if (dongle_caps->dp_hdmi_max_bpc <12 )return false;break ; +case COLOR_DEPTH_UNDEFINED : +/* These color depths are currently not supported */ +ASSERT (false); +break ;case COLOR_DEPTH_141414 :case COLOR_DEPTH_161616 :default :
Signature · 1 line
2.43.0
PATCH 12/24 drm/amd/display: Add DML path for FAMS methods
In reply to Wayne LinFrom: Oleh Kuzhylnyi <[email protected]>
[Why]
DML needs a path for FAMS methods.
[How]
Apply instance of fams2_stream_sub_params_v2 structure with a FAMS placeholder for DML.
--- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 2 +- .../drm/amd/display/dc/dml2/dml21/dml21_utils.c | 14 +++++++++++--- drivers/gpu/drm/amd/display/dc/inc/core_types.h | 5 ++++- 3 files changed, 16 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +1 -1
@@ -1758,7 +1758,7 @@ static void dc_dmub_srv_ib_based_fams2_update_config(struct dc *dc,/* copy stream static sub-state */ memcpy (&config->stream_v1[i].sub_state, - &context->bw_ctx.bw.dcn.fams2_stream_sub_params[i], + &context->bw_ctx.bw.dcn.fams2_stream_sub_params_v2[i],sizeof (config->stream_v1[i].sub_state)); } }
drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_utils.c +11 -3
@@ -384,6 +384,7 @@ void dml21_build_fams2_programming(const struct dc *dc,/* reset fams2 data */ memset (&context->bw_ctx.bw.dcn.fams2_stream_base_params,0 ,sizeof (union dmub_cmd_fams2_config ) *DML2_MAX_PLANES );memset (&context->bw_ctx.bw.dcn.fams2_stream_sub_params,0 ,sizeof (union dmub_cmd_fams2_config ) *DML2_MAX_PLANES ); +memset (&context->bw_ctx.bw.dcn.fams2_stream_sub_params_v2,0 ,sizeof (union dmub_fams2_stream_static_sub_state_v2 ) *DML2_MAX_PLANES );memset (&context->bw_ctx.bw.dcn.fams2_global_config,0 ,sizeof (struct dmub_cmd_fams2_global_config ));if (dml_ctx->v21.mode_programming.programming->fams2_required) {
@@ -414,9 +415,16 @@ void dml21_build_fams2_programming(const struct dc *dc,memcpy (static_base_state, &dml_ctx->v21.mode_programming.programming->stream_programming[dml_stream_idx].fams2_base_params,sizeof (union dmub_cmd_fams2_config )); -memcpy (static_sub_state, - &dml_ctx->v21.mode_programming.programming->stream_programming[dml_stream_idx].fams2_sub_params, -sizeof (union dmub_cmd_fams2_config )); + +if (dc->debug.fams_version.major ==3 ) { +memcpy (&context->bw_ctx.bw.dcn.fams2_stream_sub_params_v2[num_fams2_streams], + &dml_ctx->v21.mode_programming.programming->stream_programming[dml_stream_idx].fams2_sub_params_v2, +sizeof (union dmub_fams2_stream_static_sub_state_v2 )); + }else { +memcpy (static_sub_state, + &dml_ctx->v21.mode_programming.programming->stream_programming[dml_stream_idx].fams2_sub_params, +sizeof (union dmub_cmd_fams2_config )); + }switch (dc->debug.fams_version.minor) {case 1 :
drivers/gpu/drm/amd/display/dc/inc/core_types.h +4 -1
@@ -556,7 +556,10 @@ struct dcn_bw_output {struct dml2_mcache_surface_allocation mcache_allocations[DML2_MAX_PLANES ];struct dmub_cmd_fams2_global_config fams2_global_config;union dmub_cmd_fams2_config fams2_stream_base_params[DML2_MAX_PLANES ]; -union dmub_cmd_fams2_config fams2_stream_sub_params[DML2_MAX_PLANES ]; +union { +union dmub_cmd_fams2_config fams2_stream_sub_params[DML2_MAX_PLANES ]; +union dmub_fams2_stream_static_sub_state_v2 fams2_stream_sub_params_v2[DML2_MAX_PLANES ]; + };struct dml2_display_arb_regs arb_regs; };
Signature · 1 line
2.43.0
PATCH 13/24 drm/amd/display: Do not bypass chroma scaling in 1:1 case
In reply to Wayne LinFrom: Navid Assadian <[email protected]>
[Why]
When doing 2:1 downscaling on a YUV sub-sampled format, the chroma scaling ratio is 1:1. Since chroma has cositing, it is needed to do scaling on the chroma plane(s) and not to bypass chroma scaling.
[How]
Do not set the chroma taps to one when the chroma ratio is identity and the input format is a sub-sampled YUV format.
--- drivers/gpu/drm/amd/display/dc/sspl/dc_spl.c | 28 +++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/display/dc/sspl/dc_spl.c +15 -13
@@ -884,7 +884,9 @@ static bool spl_get_isharp_en(struct spl_in *spl_in,/* Calculate number of tap with adaptive scaling off */ static void spl_get_taps_non_adaptive_scaler ( -struct spl_scratch *spl_scratch,const struct spl_taps *in_taps,bool always_scale) +struct spl_scratch *spl_scratch, +const struct spl_taps *in_taps, +bool is_subsampled) {bool check_max_downscale = false;
@@ -945,14 +947,15 @@ static void spl_get_taps_non_adaptive_scaler(SPL_ASSERT (check_max_downscale); -if (IDENTITY_RATIO (spl_scratch->scl_data.ratios.horz) && !always_scale) +if (IDENTITY_RATIO (spl_scratch->scl_data.ratios.horz)) spl_scratch->scl_data.taps.h_taps =1 ; -if (IDENTITY_RATIO (spl_scratch->scl_data.ratios.vert) && !always_scale) +if (IDENTITY_RATIO (spl_scratch->scl_data.ratios.vert)) spl_scratch->scl_data.taps.v_taps =1 ; -if (IDENTITY_RATIO (spl_scratch->scl_data.ratios.horz_c) && !always_scale) +if (IDENTITY_RATIO (spl_scratch->scl_data.ratios.horz_c) && !is_subsampled) spl_scratch->scl_data.taps.h_taps_c =1 ; -if (IDENTITY_RATIO (spl_scratch->scl_data.ratios.vert_c) && !always_scale) +if (IDENTITY_RATIO (spl_scratch->scl_data.ratios.vert_c) && !is_subsampled) spl_scratch->scl_data.taps.v_taps_c =1 ; + }/* Calculate optimal number of taps */
@@ -965,15 +968,13 @@ static bool spl_get_optimal_number_of_taps(unsigned int max_taps_y, max_taps_c;unsigned int min_taps_y, min_taps_c;enum lb_memory_config lb_config; -bool skip_easf = false; -bool always_scale = spl_in->basic_out.always_scale; +bool skip_easf = false;bool is_subsampled =spl_is_subsampled_format (spl_in->basic_in.format); -if (spl_scratch->scl_data.viewport.width > spl_scratch->scl_data.h_active && max_downscale_src_width !=0 && spl_scratch->scl_data.viewport.width > max_downscale_src_width) { -spl_get_taps_non_adaptive_scaler (spl_scratch, in_taps, always_scale); +spl_get_taps_non_adaptive_scaler (spl_scratch, in_taps, is_subsampled); *enable_easf_v = false; *enable_easf_h = false; *enable_isharp = false;
@@ -982,7 +983,7 @@ static bool spl_get_optimal_number_of_taps(/* Disable adaptive scaler and sharpener when integer scaling is enabled */ if (spl_in->scaling_quality.integer_scaling) { -spl_get_taps_non_adaptive_scaler (spl_scratch, in_taps, always_scale); +spl_get_taps_non_adaptive_scaler (spl_scratch, in_taps, is_subsampled); *enable_easf_v = false; *enable_easf_h = false; *enable_isharp = false;
@@ -997,8 +998,9 @@ static bool spl_get_optimal_number_of_taps(* From programming guide: taps = min{ ceil(2*H_RATIO,1), 8} for downscaling * taps = 4 for upscaling */ -if (skip_easf) -spl_get_taps_non_adaptive_scaler (spl_scratch, in_taps, always_scale); +if (skip_easf) { +spl_get_taps_non_adaptive_scaler (spl_scratch, in_taps, is_subsampled); + }else {if (spl_is_video_format (spl_in->basic_in.format)) { spl_scratch->scl_data.taps.h_taps =6 ;
@@ -1124,7 +1126,6 @@ static bool spl_get_optimal_number_of_taps( (IDENTITY_RATIO(spl_scratch->scl_data.ratios.vert))) { spl_scratch->scl_data.taps.h_taps =1 ; spl_scratch->scl_data.taps.v_taps =1 ; -if (IDENTITY_RATIO (spl_scratch->scl_data.ratios.horz_c) && !is_subsampled) spl_scratch->scl_data.taps.h_taps_c =1 ;
@@ -1149,6 +1150,7 @@ static bool spl_get_optimal_number_of_taps(if ((!*enable_easf_v) && !is_subsampled && (IDENTITY_RATIO (spl_scratch->scl_data.ratios.vert_c))) spl_scratch->scl_data.taps.v_taps_c =1 ; + } }return true;
Signature · 1 line
2.43.0
PATCH 14/24 drm/amd/display: Add support for 2nd sharpening range
In reply to Wayne LinFrom: Samson Tam <[email protected]>
[Why & How]
Add support for 2nd sharpening range for cases where we want override existing DCN sharpening range
--- drivers/gpu/drm/amd/display/dc/dc.h | 6 ++++++ .../gpu/drm/amd/display/dc/dc_spl_translate.c | 19 +++++++++-------- .../dc/resource/dcn401/dcn401_resource.c | 21 +++++++++++++++++++ 3 files changed, 37 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +6 -0
@@ -46,6 +46,8 @@#include "dmub/inc/dmub_cmd.h" +#include "sspl/dc_spl_types.h" +struct abm_save_restore ;/* forward declaration */
@@ -512,6 +514,8 @@ struct dc_config {bool set_pipe_unlock_order;bool enable_dpia_pre_training;bool unify_link_enc_assignment; +struct spl_sharpness_range dcn_sharpness_range; +struct spl_sharpness_range dcn_override_sharpness_range; };enum visual_confirm {
@@ -1420,6 +1424,8 @@ struct dc_plane_state {int sharpness_level;enum linear_light_scaling linear_light_scaling;unsigned int sdr_white_level_nits; +struct spl_sharpness_range sharpness_range; +enum sharpness_range_source sharpness_source; };struct dc_plane_info {
drivers/gpu/drm/amd/display/dc/dc_spl_translate.c +10 -9
@@ -156,15 +156,16 @@ void translate_SPL_in_params_from_pipe_ctx(struct pipe_ctx *pipe_ctx, struct spl spl_in->adaptive_sharpness.enable = true; spl_in->adaptive_sharpness.sharpness_level =0 ; }else if (sharpness_setting ==SHARPNESS_CUSTOM ) { - spl_in->adaptive_sharpness.sharpness_range.sdr_rgb_min =0 ; - spl_in->adaptive_sharpness.sharpness_range.sdr_rgb_max =1750 ; - spl_in->adaptive_sharpness.sharpness_range.sdr_rgb_mid =750 ; - spl_in->adaptive_sharpness.sharpness_range.sdr_yuv_min =0 ; - spl_in->adaptive_sharpness.sharpness_range.sdr_yuv_max =3500 ; - spl_in->adaptive_sharpness.sharpness_range.sdr_yuv_mid =1500 ; - spl_in->adaptive_sharpness.sharpness_range.hdr_rgb_min =0 ; - spl_in->adaptive_sharpness.sharpness_range.hdr_rgb_max =2750 ; - spl_in->adaptive_sharpness.sharpness_range.hdr_rgb_mid =1500 ; +/* SAT: read harpness_range from dc_plane_state */ + spl_in->adaptive_sharpness.sharpness_range.sdr_rgb_min = plane_state->sharpness_range.sdr_rgb_min; + spl_in->adaptive_sharpness.sharpness_range.sdr_rgb_max = plane_state->sharpness_range.sdr_rgb_max; + spl_in->adaptive_sharpness.sharpness_range.sdr_rgb_mid = plane_state->sharpness_range.sdr_rgb_mid; + spl_in->adaptive_sharpness.sharpness_range.sdr_yuv_min = plane_state->sharpness_range.sdr_yuv_min; + spl_in->adaptive_sharpness.sharpness_range.sdr_yuv_max = plane_state->sharpness_range.sdr_yuv_max; + spl_in->adaptive_sharpness.sharpness_range.sdr_yuv_mid = plane_state->sharpness_range.sdr_yuv_mid; + spl_in->adaptive_sharpness.sharpness_range.hdr_rgb_min = plane_state->sharpness_range.hdr_rgb_min; + spl_in->adaptive_sharpness.sharpness_range.hdr_rgb_max = plane_state->sharpness_range.hdr_rgb_max; + spl_in->adaptive_sharpness.sharpness_range.hdr_rgb_mid = plane_state->sharpness_range.hdr_rgb_mid;if (force_sharpness_level >0 ) {if (force_sharpness_level >10 )
drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c +21 -0
@@ -1959,6 +1959,27 @@ static bool dcn401_resource_construct( dc->caps.color.mpc.ocsc =1 ; dc->config.use_spl = true; dc->config.prefer_easf = true; + + dc->config.dcn_sharpness_range.sdr_rgb_min =0 ; + dc->config.dcn_sharpness_range.sdr_rgb_max =1750 ; + dc->config.dcn_sharpness_range.sdr_rgb_mid =750 ; + dc->config.dcn_sharpness_range.sdr_yuv_min =0 ; + dc->config.dcn_sharpness_range.sdr_yuv_max =3500 ; + dc->config.dcn_sharpness_range.sdr_yuv_mid =1500 ; + dc->config.dcn_sharpness_range.hdr_rgb_min =0 ; + dc->config.dcn_sharpness_range.hdr_rgb_max =2750 ; + dc->config.dcn_sharpness_range.hdr_rgb_mid =1500 ; + + dc->config.dcn_override_sharpness_range.sdr_rgb_min =0 ; + dc->config.dcn_override_sharpness_range.sdr_rgb_max =3250 ; + dc->config.dcn_override_sharpness_range.sdr_rgb_mid =1250 ; + dc->config.dcn_override_sharpness_range.sdr_yuv_min =0 ; + dc->config.dcn_override_sharpness_range.sdr_yuv_max =3500 ; + dc->config.dcn_override_sharpness_range.sdr_yuv_mid =1500 ; + dc->config.dcn_override_sharpness_range.hdr_rgb_min =0 ; + dc->config.dcn_override_sharpness_range.hdr_rgb_max =2750 ; + dc->config.dcn_override_sharpness_range.hdr_rgb_mid =1500 ; + dc->config.dc_mode_clk_limit_support = true; dc->config.enable_windowed_mpo_odm = true; dc->config.set_pipe_unlock_order = true;/* Need to ensure DET gets freed before allocating */
Signature · 1 line
2.43.0
PATCH 15/24 drm/amd/display: Move vmalloc include to header file
In reply to Wayne LinFrom: Ray Wu <[email protected]>
[Why & How]
Move vmalloc.h include code to header file.
--- drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_wrapper.c | 2 -- drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.c | 2 -- drivers/gpu/drm/amd/display/dc/os_types.h | 1 + 3 files changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_wrapper.c +0 -2
@@ -2,8 +2,6 @@// // Copyright 2024 Advanced Micro Devices, Inc. -#include <linux/vmalloc.h> -#include "dml2_internal_types.h" #include "dml_top.h" #include "dml2_core_dcn4_calcs.h"
drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.c +0 -2
@@ -24,8 +24,6 @@* */ -#include <linux/vmalloc.h> -#include "display_mode_core.h" #include "dml2_internal_types.h" #include "dml2_utils.h"
drivers/gpu/drm/amd/display/dc/os_types.h +1 -0
@@ -31,6 +31,7 @@#include <linux/kgdb.h> #include <linux/delay.h> #include <linux/mm.h> +#include <linux/vmalloc.h> #include <asm/byteorder.h>
Signature · 1 line
2.43.0
PATCH 16/24 drm/amd/display: [FW Promotion] Release 0.1.12.0
In reply to Wayne LinFrom: Taimur Hassan <[email protected]>
Add dmub command to support LSDMA
--- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 156 ++++++++++++++++++ 1 file changed, 156 insertions(+)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +156 -0
@@ -1516,6 +1516,11 @@ enum dmub_cmd_type {*/ DMUB_CMD__FUSED_IO =89 , +/** +* Command type used for all LSDMA commands. +*/ +DMUB_CMD__LSDMA =90 , + DMUB_CMD__VBIOS = 128, };
@@ -1926,6 +1931,121 @@ struct dmub_rb_cmd_fams2_flip {struct dmub_fams2_flip_info flip_info; }; +struct dmub_cmd_lsdma_data { +union { +struct lsdma_init_data { +union dmub_addr gpu_addr_base; +uint32_t ring_size; + } init_data; +struct lsdma_tiled_copy_data { +uint32_t src_addr_lo; +uint32_t src_addr_hi; +uint32_t dst_addr_lo; +uint32_t dst_addr_hi; + +uint32_t src_x :16 ; +uint32_t src_y :16 ; + +uint32_t src_width :16 ; +uint32_t src_height :16 ; + +uint32_t dst_x :16 ; +uint32_t dst_y :16 ; + +uint32_t dst_width :16 ; +uint32_t dst_height :16 ; + +uint32_t rect_x :16 ; +uint32_t rect_y :16 ; + +uint32_t src_swizzle_mode :5 ; +uint32_t src_mip_max :5 ; +uint32_t src_mip_id :5 ; +uint32_t dst_mip_max :5 ; +uint32_t dst_swizzle_mode :5 ; +uint32_t dst_mip_id :5 ; +uint32_t tmz :1 ; +uint32_t dcc :1 ; + +uint32_t data_format :6 ; +uint32_t padding1 :4 ; +uint32_t dst_element_size :3 ; +uint32_t num_type :3 ; +uint32_t src_element_size :3 ; +uint32_t write_compress :2 ; +uint32_t cache_policy_dst :2 ; +uint32_t cache_policy_src :2 ; +uint32_t read_compress :2 ; +uint32_t src_dim :2 ; +uint32_t dst_dim :2 ; +uint32_t max_uncom :1 ; + +uint32_t max_com :2 ; +uint32_t padding :30 ; + } tiled_copy_data; +struct lsdma_linear_copy_data { +uint32_t count :30 ; +uint32_t cache_policy_dst :2 ; + +uint32_t tmz :1 ; +uint32_t cache_policy_src :2 ; +uint32_t padding :29 ; + +uint32_t src_lo; +uint32_t src_hi; +uint32_t dst_lo; +uint32_t dst_hi; + } linear_copy_data; +struct lsdma_reg_write_data { +uint32_t reg_addr; +uint32_t reg_data; + } reg_write_data; +struct lsdma_pio_copy_data { +union { +struct { +uint32_t byte_count :26 ; +uint32_t src_loc :1 ; +uint32_t dst_loc :1 ; +uint32_t src_addr_inc :1 ; +uint32_t dst_addr_inc :1 ; +uint32_t overlap_disable :1 ; +uint32_t constant_fill :1 ; + } fields; +uint32_t raw; + } packet; +uint32_t src_lo; +uint32_t src_hi; +uint32_t dst_lo; +uint32_t dst_hi; + } pio_copy_data; +struct lsdma_pio_constfill_data { +union { +struct { +uint32_t byte_count :26 ; +uint32_t src_loc :1 ; +uint32_t dst_loc :1 ; +uint32_t src_addr_inc :1 ; +uint32_t dst_addr_inc :1 ; +uint32_t overlap_disable :1 ; +uint32_t constant_fill :1 ; + } fields; +uint32_t raw; + } packet; +uint32_t dst_lo; +uint32_t dst_hi; +uint32_t data; + } pio_constfill_data; + +uint32_t all[14 ]; + } u; + +}; + +struct dmub_rb_cmd_lsdma { +struct dmub_cmd_header header; +struct dmub_cmd_lsdma_data lsdma_data; +}; +struct dmub_optc_state_v2 {uint32_t v_total_min;uint32_t v_total_max;
@@ -4453,6 +4573,37 @@ enum dmub_cmd_abm_type { DMUB_CMD__ABM_GET_HISTOGRAM_DATA = 11, }; +/** +* LSDMA command sub-types. +*/ +enum dmub_cmd_lsdma_type { +/** +* Initialize parameters for LSDMA. +* Ring buffer is mapped to the ring buffer +*/ +DMUB_CMD__LSDMA_INIT_CONFIG =0 , +/** +* LSDMA copies data from source to destination linearly +*/ +DMUB_CMD__LSDMA_LINEAR_COPY =1 , +/** +* Send the tiled-to-tiled copy command +*/ +DMUB_CMD__LSDMA_TILED_TO_TILED_COPY =2 , +/** +* Send the poll reg write command +*/ +DMUB_CMD__LSDMA_POLL_REG_WRITE =3 , +/** +* Send the pio copy command +*/ +DMUB_CMD__LSDMA_PIO_COPY =4 , +/** +* Send the pio constfill command +*/ +DMUB_CMD__LSDMA_PIO_CONSTFILL =5 , +}; +struct abm_ace_curve {/** * @offsets: ACE curve offsets.
@@ -5973,6 +6124,11 @@ union dmub_rb_cmd {struct dmub_rb_cmd_fams2_flip fams2_flip;struct dmub_rb_cmd_fused_io fused_io; + +/** +* Definition of a DMUB_CMD__LSDMA command. +*/ +struct dmub_rb_cmd_lsdma lsdma; };/**
Signature · 1 line
2.43.0
PATCH 17/24 drm/amd/display: Promote DAL to 3.2.335
In reply to Wayne LinFrom: Taimur Hassan <[email protected]>
This version brings along following fixes:
- Fixes for DML21
- Support OLED SDR with AMD ABC
- Indirect buffer transport for FAMS2 commands
- Correct stream attributes setup timing
- Correct non-OLED pre_T11_delay
- Optime boot-up consuming time
- Add support for 2nd sharpening range
- Fix on chroma planes scaling
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -55,7 +55,7 @@ struct aux_payload;struct set_config_cmd_payload ;struct dmub_notification ; -#define DC_VER "3.2.334" +#define DC_VER "3.2.335"/** * MAX_SURFACES - representative of the upper bound of surfaces that can be piped to a single CRTC
Signature · 1 line
2.43.0
PATCH 18/24 drm/amd/display: Update DMCUB loading sequence for DCN3.5
In reply to Wayne LinFrom: Nicholas Kazlauskas <[email protected]>
[Why]
New sequence from HW for reset and firmware reloading has been provided that aims to stabilize the reload sequence in the case the firmware is hung or has outstanding requests.
[How]
Update the sequence to remove the DMUIF reset and the redundant writes in the release.
--- .../gpu/drm/amd/display/dmub/src/dmub_dcn35.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn35.c +3 -13
@@ -92,19 +92,15 @@ void dmub_dcn35_reset(struct dmub_srv *dmub)uint32_t in_reset, is_enabled, scratch, i, pwait_mode;REG_GET (DMCUB_CNTL2 ,DMCUB_SOFT_RESET , &in_reset); +REG_GET (DMCUB_CNTL ,DMCUB_ENABLE , &is_enabled); -if (in_reset ==0 ) { +if (in_reset ==0 && is_enabled !=0 ) { cmd.bits.status =1 ; cmd.bits.command_code =DMUB_GPINT__STOP_FW ; cmd.bits.param =0 ; dmub->hw_funcs.set_gpint (dmub, cmd); -/** -* Timeout covers both the ACK and the wait -* for remaining work to finish. -*/ -for (i =0 ; i < timeout; ++i) {if (dmub->hw_funcs.is_gpint_acked (dmub, cmd))break ;
@@ -130,11 +126,9 @@ void dmub_dcn35_reset(struct dmub_srv *dmub)/* Force reset in case we timed out, DMCUB is likely hung. */ } -REG_GET (DMCUB_CNTL ,DMCUB_ENABLE , &is_enabled); -if (is_enabled) {REG_UPDATE (DMCUB_CNTL2 ,DMCUB_SOFT_RESET ,1 ); -REG_UPDATE (MMHUBBUB_SOFT_RESET ,DMUIF_SOFT_RESET ,1 ); +udelay (1 );REG_UPDATE (DMCUB_CNTL ,DMCUB_ENABLE ,0 ); }
@@ -160,11 +154,7 @@ void dmub_dcn35_reset_release(struct dmub_srv *dmub)LONO_SOCCLK_GATE_DISABLE ,1 , LONO_DMCUBCLK_GATE_DISABLE, 1); -REG_UPDATE (MMHUBBUB_SOFT_RESET ,DMUIF_SOFT_RESET ,1 ); -udelay (1 );REG_UPDATE_2 (DMCUB_CNTL ,DMCUB_ENABLE ,1 ,DMCUB_TRACEPORT_EN ,1 ); -REG_UPDATE (DMCUB_CNTL2 ,DMCUB_SOFT_RESET ,1 ); -udelay (1 );REG_UPDATE (MMHUBBUB_SOFT_RESET ,DMUIF_SOFT_RESET ,0 );REG_UPDATE (DMCUB_CNTL2 ,DMCUB_SOFT_RESET ,0 ); }
Signature · 1 line
2.43.0
PATCH 19/24 drm/amd/display: replace fast_validate with enum dc_validate_mode
In reply to Wayne LinFrom: Yan Li <[email protected]>
[Why]
The boolean fast_validate is used as an
input parameter in multiple functions. To
support more scenarios, we are
replacing it with enum dc_validate_mode.
[How]
The enum dc_validate_mode introduces three
possible values:
1) DC_VALIDATE_MODE_AND_PROGRAMMING:
Apply the mode to hardware
2) DC_VALIDATE_MODE_ONLY:
Check whether the mode can be supported
3) DC_VALIDATE_MODE_AND_STATE_INDEX:
Check if the mode can be supported, and
determine the optimal voltage level
needed to support it.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 12 ++--- .../gpu/drm/amd/display/dc/core/dc_resource.c | 12 ++--- drivers/gpu/drm/amd/display/dc/dc.h | 8 +--- drivers/gpu/drm/amd/display/dc/dc_types.h | 8 ++++ .../drm/amd/display/dc/dml/calcs/dcn_calcs.c | 6 +-- .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 45 +++++++++---------- .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.h | 12 ++--- .../drm/amd/display/dc/dml/dcn30/dcn30_fpu.c | 6 ++- .../drm/amd/display/dc/dml/dcn31/dcn31_fpu.h | 2 +- .../amd/display/dc/dml/dcn314/dcn314_fpu.c | 4 +- .../amd/display/dc/dml/dcn314/dcn314_fpu.h | 2 +- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 30 +++++++------ .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.h | 2 +- .../drm/amd/display/dc/dml/dcn35/dcn35_fpu.c | 4 +- .../drm/amd/display/dc/dml/dcn35/dcn35_fpu.h | 2 +- .../amd/display/dc/dml/dcn351/dcn351_fpu.c | 4 +- .../amd/display/dc/dml/dcn351/dcn351_fpu.h | 2 +- .../amd/display/dc/dml2/dml21/dml21_wrapper.c | 7 +-- .../amd/display/dc/dml2/dml21/dml21_wrapper.h | 11 +++-- .../amd/display/dc/dml2/dml2_mall_phantom.c | 2 +- .../drm/amd/display/dc/dml2/dml2_wrapper.c | 9 ++-- .../drm/amd/display/dc/dml2/dml2_wrapper.h | 4 +- .../amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 2 +- .../amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 2 +- .../gpu/drm/amd/display/dc/inc/core_types.h | 4 +- .../gpu/drm/amd/display/dc/inc/dcn_calcs.h | 2 +- .../dc/resource/dce100/dce100_resource.c | 2 +- .../dc/resource/dce110/dce110_resource.c | 2 +- .../dc/resource/dce112/dce112_resource.c | 2 +- .../dc/resource/dce112/dce112_resource.h | 2 +- .../dc/resource/dce60/dce60_resource.c | 2 +- .../dc/resource/dce80/dce80_resource.c | 2 +- .../dc/resource/dcn10/dcn10_resource.c | 4 +- .../dc/resource/dcn20/dcn20_resource.c | 8 ++-- .../dc/resource/dcn20/dcn20_resource.h | 4 +- .../dc/resource/dcn21/dcn21_resource.c | 8 ++-- .../dc/resource/dcn21/dcn21_resource.h | 2 +- .../dc/resource/dcn30/dcn30_resource.c | 22 ++++----- .../dc/resource/dcn30/dcn30_resource.h | 6 +-- .../dc/resource/dcn31/dcn31_resource.c | 18 ++++---- .../dc/resource/dcn31/dcn31_resource.h | 4 +- .../dc/resource/dcn314/dcn314_resource.c | 14 +++--- .../dc/resource/dcn314/dcn314_resource.h | 2 +- .../dc/resource/dcn315/dcn315_resource.c | 4 +- .../dc/resource/dcn316/dcn316_resource.c | 4 +- .../dc/resource/dcn32/dcn32_resource.c | 26 +++++------ .../dc/resource/dcn32/dcn32_resource.h | 4 +- .../dc/resource/dcn35/dcn35_resource.c | 6 +-- .../dc/resource/dcn351/dcn351_resource.c | 6 +-- .../dc/resource/dcn36/dcn36_resource.c | 6 +-- .../dc/resource/dcn401/dcn401_resource.c | 10 ++--- .../dc/resource/dcn401/dcn401_resource.h | 2 +- 53 files changed, 198 insertions(+), 182 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -2
@@ -7515,7 +7515,7 @@ static enum dc_status dm_validate_stream_and_context(struct dc *dc, dc_result =DC_FAIL_ATTACH_SURFACES ;if (dc_result ==DC_OK ) - dc_result =dc_validate_global_state (dc, dc_state, true); + dc_result =dc_validate_global_state (dc, dc_state,DC_VALIDATE_MODE_ONLY ); cleanup:if (dc_state)
@@ -12137,7 +12137,7 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,drm_dbg_atomic (dev,"MST drm_dp_mst_atomic_check() failed\n" ); goto fail; } - status =dc_validate_global_state (dc, dm_state->context, true); + status =dc_validate_global_state (dc, dm_state->context,DC_VALIDATE_MODE_ONLY );if (status !=DC_OK ) {drm_dbg_atomic (dev,"DC global validation failure: %s (%d)" ,dc_status_to_str (status), status);
drivers/gpu/drm/amd/display/dc/core/dc.c +7 -5
@@ -2377,7 +2377,7 @@ enum dc_status dc_commit_streams(struct dc *dc, struct dc_commit_streams_params context->power_source = params->power_source; - res =dc_validate_with_context (dc, set, params->stream_count, context, false); + res =dc_validate_with_context (dc, set, params->stream_count, context,DC_VALIDATE_MODE_AND_PROGRAMMING );/* * Only update link encoder to stream assignment after bandwidth validation passed.
@@ -3300,7 +3300,8 @@ static void copy_stream_update_to_stream(struct dc *dc,if (dsc_validate_context) { stream->timing.dsc_cfg = *update->dsc_config; stream->timing.flags.DSC = enable_dsc; -if (dc->res_pool->funcs->validate_bandwidth (dc, dsc_validate_context, true) !=DC_OK ) { +if (dc->res_pool->funcs->validate_bandwidth (dc, dsc_validate_context, +DC_VALIDATE_MODE_ONLY ) !=DC_OK ) { stream->timing.dsc_cfg = old_dsc_cfg; stream->timing.flags.DSC = old_dsc_enabled; update->dsc_config =NULL ;
@@ -3522,7 +3523,7 @@ static bool update_planes_and_stream_state(struct dc *dc, }if (update_type ==UPDATE_TYPE_FULL ) { -if (dc->res_pool->funcs->validate_bandwidth (dc, context, false) !=DC_OK ) { +if (dc->res_pool->funcs->validate_bandwidth (dc, context,DC_VALIDATE_MODE_AND_PROGRAMMING ) !=DC_OK ) {BREAK_TO_DEBUGGER (); goto fail; }
@@ -4628,7 +4629,8 @@ static struct dc_state *create_minimal_transition_state(struct dc *dc,backup_and_set_minimal_pipe_split_policy (dc, base_context, policy);/* commit minimal state */ -if (dc->res_pool->funcs->validate_bandwidth (dc, minimal_transition_context, false) ==DC_OK ) { +if (dc->res_pool->funcs->validate_bandwidth (dc, minimal_transition_context, +DC_VALIDATE_MODE_AND_PROGRAMMING ) ==DC_OK ) {/* prevent underflow and corruption when reconfiguring pipes */ force_vsync_flip_in_minimal_transition_context (minimal_transition_context); }else {
@@ -5151,7 +5153,7 @@ static bool update_planes_and_stream_v1(struct dc *dc,copy_stream_update_to_stream (dc, context, stream, stream_update);if (update_type >=UPDATE_TYPE_FULL ) { -if (dc->res_pool->funcs->validate_bandwidth (dc, context, false) !=DC_OK ) { +if (dc->res_pool->funcs->validate_bandwidth (dc, context,DC_VALIDATE_MODE_AND_PROGRAMMING ) !=DC_OK ) {DC_ERROR ("Mode validation failed for stream update!\n" );dc_state_release (context);return false;
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +6 -6
@@ -4053,7 +4053,7 @@ static bool add_all_planes_for_stream(* @set: An array of dc_validation_set with all the current streams reference * @set_count: Total of streams * @context: New context -* @fast_validate: Enable or disable fast validation +* @validate_mode: identify the validation mode * * This function updates the potential new stream in the context object. It * creates multiple lists for the add, remove, and unchanged streams. In
@@ -4068,7 +4068,7 @@ enum dc_status dc_validate_with_context(struct dc *dc,const struct dc_validation_set set[], int set_count, struct dc_state *context, - bool fast_validate) + enum dc_validate_mode validate_mode) { struct dc_stream_state *unchanged_streams[MAX_PIPES] = { 0 };struct dc_stream_state *del_streams[MAX_PIPES ] = {0 };
@@ -4242,7 +4242,7 @@ enum dc_status dc_validate_with_context(struct dc *dc,dc_state_set_stream_subvp_cursor_limit (context->streams[i], context, false); } - res =dc_validate_global_state (dc, context, fast_validate); + res =dc_validate_global_state (dc, context, validate_mode);/* calculate pixel rate divider after deciding pxiel clock & odm combine */ if ((dc->hwss.calculate_pix_rate_divider) && (res ==DC_OK )) {
@@ -4299,7 +4299,7 @@ static void decide_hblank_borrow(struct pipe_ctx *pipe_ctx)* * @dc: dc struct for this driver * @new_ctx: state to be validated -* @fast_validate: set to true if only yes/no to support matters +* @validate_mode: identify the validation mode * * Checks hardware resource availability and bandwidth requirement. *
@@ -4309,7 +4309,7 @@ static void decide_hblank_borrow(struct pipe_ctx *pipe_ctx)enum dc_status dc_validate_global_state (struct dc *dc,struct dc_state *new_ctx, -bool fast_validate) +enum dc_validate_mode validate_mode) {enum dc_status result =DC_ERROR_UNEXPECTED ;int i, j;
@@ -4368,7 +4368,7 @@ enum dc_status dc_validate_global_state( result =resource_build_scaling_params_for_context (dc, new_ctx);if (result ==DC_OK ) - result = dc->res_pool->funcs->validate_bandwidth (dc, new_ctx, fast_validate); + result = dc->res_pool->funcs->validate_bandwidth (dc, new_ctx, validate_mode);return result; }
drivers/gpu/drm/amd/display/dc/dc.h +2 -6
@@ -1804,19 +1804,15 @@ enum dc_status dc_validate_with_context(struct dc *dc,const struct dc_validation_set set[], int set_count, struct dc_state *context, - bool fast_validate); + enum dc_validate_mode validate_mode);bool dc_set_generic_gpio_for_stereo (bool enable,struct gpio_service *gpio_service); -/* -* fast_validate: we return after determining if we can support the new state, -* but before we populate the programming info -*/ enum dc_status dc_validate_global_state (struct dc *dc,struct dc_state *new_ctx, -bool fast_validate); +enum dc_validate_mode validate_mode); bool dc_acquire_release_mpc_3dlut( struct dc *dc, bool acquire,
drivers/gpu/drm/amd/display/dc/dc_types.h +8 -0
@@ -1370,4 +1370,12 @@ struct set_backlight_level_params { uint8_t aux_inst; }; +enum dc_validate_mode { +/* validate the mode and program HW */ +DC_VALIDATE_MODE_AND_PROGRAMMING =0 , +/* only validate the mode */ +DC_VALIDATE_MODE_ONLY =1 , +/* validate the mode and get the max state (voltage level) */ +DC_VALIDATE_MODE_AND_STATE_INDEX =2 , +};#endif /* DC_TYPES_H_ */
drivers/gpu/drm/amd/display/dc/dml/calcs/dcn_calcs.c +3 -3
@@ -748,7 +748,7 @@ static unsigned int get_highest_allowed_voltage_level(bool is_vmin_only_asic)bool dcn_validate_bandwidth (struct dc *dc,struct dc_state *context, -bool fast_validate) +enum dc_validate_mode validate_mode) {/* * we want a breakdown of the various stages of validation, which the
@@ -1119,7 +1119,7 @@ bool dcn_validate_bandwidth(BW_VAL_TRACE_END_VOLTAGE_LEVEL (); -if (v->voltage_level != number_of_states_plus_one && !fast_validate) { +if (v->voltage_level != number_of_states_plus_one && validate_mode ==DC_VALIDATE_MODE_AND_PROGRAMMING ) {float bw_consumed = v->total_bandwidth_consumed_gbyte_per_second;if (bw_consumed < v->fabric_and_dram_bandwidth_vmin0p65)
@@ -1286,7 +1286,7 @@ bool dcn_validate_bandwidth( } }else if (v->voltage_level == number_of_states_plus_one) {BW_VAL_TRACE_SKIP (fail); - }else if (fast_validate) { + }else if (validate_mode !=DC_VALIDATE_MODE_AND_PROGRAMMING ) {BW_VAL_TRACE_SKIP (fast); }
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c +22 -23
155 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.h +6 -6
@@ -44,14 +44,14 @@ void dcn20_calculate_dlg_params(struct dc *dc,int dcn20_populate_dml_pipes_from_context (struct dc *dc,struct dc_state *context,display_e2e_pipe_params_st *pipes, -bool fast_validate); +enum dc_validate_mode validate_mode);void dcn20_calculate_wm (struct dc *dc,struct dc_state *context,display_e2e_pipe_params_st *pipes,int *out_pipe_cnt,int *pipe_split_from,int vlevel, -bool fast_validate); +enum dc_validate_mode validate_mode);void dcn20_cap_soc_clocks (struct _vcs_dpi_soc_bounding_box_st *bb,struct pp_smu_nv_clock_table max_clocks); void dcn20_update_bounding_box(struct dc *dc,
@@ -62,7 +62,7 @@ void dcn20_update_bounding_box(struct dc *dc,void dcn20_patch_bounding_box (struct dc *dc,struct _vcs_dpi_soc_bounding_box_st *bb);bool dcn20_validate_bandwidth_fp (struct dc *dc,struct dc_state *context, -bool fast_validate,display_e2e_pipe_params_st *pipes); +enum dc_validate_mode validate_mode,display_e2e_pipe_params_st *pipes);void dcn20_fpu_set_wm_ranges (int i,struct pp_smu_wm_range_sets *ranges,struct _vcs_dpi_soc_bounding_box_st *loaded_bb);
@@ -75,9 +75,9 @@ void dcn20_fpu_adjust_dppclk(struct vba_vars_st *v,int dcn21_populate_dml_pipes_from_context (struct dc *dc,struct dc_state *context,display_e2e_pipe_params_st *pipes, -bool fast_validate); -bool dcn21_validate_bandwidth_fp (struct dc *dc,struct dc_state *context,bool - fast_validate,display_e2e_pipe_params_st *pipes); +enum dc_validate_mode validate_mode); +bool dcn21_validate_bandwidth_fp (struct dc *dc,struct dc_state *context,enum +dc_validate_mode ,display_e2e_pipe_params_st *pipes);void dcn21_update_bw_bounding_box (struct dc *dc,struct clk_bw_params *bw_params);void dcn21_clk_mgr_set_bw_params_wm_table (struct clk_bw_params *bw_params);
drivers/gpu/drm/amd/display/dc/dml/dcn30/dcn30_fpu.c +4 -2
@@ -339,7 +339,8 @@ void dcn30_fpu_calculate_wm_and_dlg(* newly found dummy_latency_index */ context->bw_ctx.dml.soc.dram_clock_change_latency_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A ].dml_input.pstate_latency_us; -dcn30_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, false, true); +dcn30_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, +DC_VALIDATE_MODE_AND_PROGRAMMING , true); maxMpcComb = context->bw_ctx.dml.vba.maxMpcComb; dcfclk = context->bw_ctx.dml.vba.DCFCLKState[vlevel][context->bw_ctx.dml.vba.maxMpcComb]; pstate_en = context->bw_ctx.dml.vba.DRAMClockChangeSupport[vlevel][maxMpcComb] != dm_dram_clock_change_unsupported;
@@ -630,7 +631,8 @@ int dcn30_find_dummy_latency_index_for_fw_based_mclk_switch(struct dc *dc,while (dummy_latency_index < max_latency_table_entries) { context->bw_ctx.dml.soc.dram_clock_change_latency_us = dc->clk_mgr->bw_params->dummy_pstate_table[dummy_latency_index].dummy_pstate_latency_us; -dcn30_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, false, true); +dcn30_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, +DC_VALIDATE_MODE_AND_PROGRAMMING , true);if (context->bw_ctx.dml.soc.allow_dram_self_refresh_or_dram_clock_change_in_vblank == dm_allow_self_refresh_and_mclk_switch)
drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.h +1 -1
@@ -55,5 +55,5 @@ int dcn_get_approx_det_segs_required_for_pstate(int dcn31x_populate_dml_pipes_from_context (struct dc *dc,struct dc_state *context,display_e2e_pipe_params_st *pipes, -bool fast_validate); +enum dc_validate_mode validate_mode);#endif /* __DCN31_FPU_H__*/
drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c +2 -2
@@ -306,7 +306,7 @@ static unsigned int get_vertical_back_porch(struct dc_crtc_timing *timing)int dcn314_populate_dml_pipes_from_context_fpu (struct dc *dc,struct dc_state *context,display_e2e_pipe_params_st *pipes, -bool fast_validate) +enum dc_validate_mode validate_mode) {int i, pipe_cnt;struct resource_context *res_ctx = &context->res_ctx;
@@ -316,7 +316,7 @@ int dcn314_populate_dml_pipes_from_context_fpu(struct dc *dc, struct dc_state *cdc_assert_fp_enabled (); -dcn31x_populate_dml_pipes_from_context (dc, context, pipes, fast_validate); +dcn31x_populate_dml_pipes_from_context (dc, context, pipes, validate_mode);for (i =0 , pipe_cnt =0 ; i < dc->res_pool->pipe_count; i++) {struct dc_crtc_timing *timing;
drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.h +1 -1
@@ -35,6 +35,6 @@void dcn314_update_bw_bounding_box_fpu (struct dc *dc,struct clk_bw_params *bw_params);int dcn314_populate_dml_pipes_from_context_fpu (struct dc *dc,struct dc_state *context,display_e2e_pipe_params_st *pipes, -bool fast_validate); +enum dc_validate_mode validate_mode);#endif
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +17 -13
@@ -290,7 +290,7 @@ int dcn32_find_dummy_latency_index_for_fw_based_mclk_switch(struct dc *dc, vba->DRAMClockChangeSupport[vlevel][context->bw_ctx.dml.vba.maxMpcComb] = temp_clock_change_support; context->bw_ctx.dml.soc.dram_clock_change_latency_us = dc->clk_mgr->bw_params->dummy_pstate_table[dummy_latency_index].dummy_pstate_latency_us; -dcn32_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, false); +dcn32_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel,DC_VALIDATE_MODE_AND_PROGRAMMING );/* for subvp + DRR case, if subvp pipes are still present we support pstate */ if (vba->DRAMClockChangeSupport[vlevel][vba->maxMpcComb] == dm_dram_clock_change_unsupported &&
@@ -1479,7 +1479,7 @@ static bool dcn32_full_validate_bw_helper(struct dc *dc,/* Conditions for setting up phantom pipes for SubVP: * 1. Not force disable SubVP -* 2. Full update (i.e. !fast_validate) +* 2. Full update (i.e. DC_VALIDATE_MODE_AND_PROGRAMMING) * 3. Enough pipes are available to support SubVP (TODO: Which pipes will use VACTIVE / VBLANK / SUBVP?) * 4. Display configuration passes validation * 5. (Config doesn't support MCLK in VACTIVE/VBLANK || dc->debug.force_subvp_mclk_switch)
@@ -1517,7 +1517,8 @@ static bool dcn32_full_validate_bw_helper(struct dc *dc, dc->res_pool->funcs->add_phantom_pipes (dc, context, pipes, *pipe_cnt, dc_pipe_idx); - *pipe_cnt = dc->res_pool->funcs->populate_dml_pipes (dc, context, pipes, false); + *pipe_cnt = dc->res_pool->funcs->populate_dml_pipes (dc, context, pipes, +DC_VALIDATE_MODE_AND_PROGRAMMING );// Populate dppclk to trigger a recalculate in dml_get_voltage_level // so the phantom pipe DLG params can be assigned correctly. pipes[0 ].clks_cfg.dppclk_mhz =get_dppclk_calculated (&context->bw_ctx.dml, pipes, *pipe_cnt,0 );
@@ -1560,7 +1561,8 @@ static bool dcn32_full_validate_bw_helper(struct dc *dc,dc_state_remove_phantom_streams_and_planes (dc, context);dc_state_release_phantom_streams_and_planes (dc, context); vba->DRAMClockChangeSupport[*vlevel][vba->maxMpcComb] = dm_dram_clock_change_unsupported; - *pipe_cnt = dc->res_pool->funcs->populate_dml_pipes (dc, context, pipes, false); + *pipe_cnt = dc->res_pool->funcs->populate_dml_pipes (dc, context, pipes, +DC_VALIDATE_MODE_AND_PROGRAMMING ); *vlevel =dml_get_voltage_level (&context->bw_ctx.dml, pipes, *pipe_cnt);/* This may adjust vlevel and maxMpcComb */
@@ -2138,7 +2140,7 @@ bool dcn32_internal_validate_bw(struct dc *dc, display_e2e_pipe_params_st *pipes, int *pipe_cnt_out, int *vlevel_out, - bool fast_validate) + enum dc_validate_mode validate_mode) {bool out = false;bool repopulate_pipes = false;
@@ -2162,7 +2164,7 @@ bool dcn32_internal_validate_bw(struct dc *dc,for (i =0 ; i < context->stream_count; i++)resource_update_pipes_for_stream_with_slice_count (context, dc->current_state, dc->res_pool, context->streams[i],1 ); - pipe_cnt = dc->res_pool->funcs->populate_dml_pipes (dc, context, pipes, fast_validate); + pipe_cnt = dc->res_pool->funcs->populate_dml_pipes (dc, context, pipes, validate_mode);if (!pipe_cnt) { out = true;
@@ -2172,13 +2174,13 @@ bool dcn32_internal_validate_bw(struct dc *dc,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 (validate_mode ==DC_VALIDATE_MODE_AND_PROGRAMMING ) {if (!dcn32_full_validate_bw_helper (dc, context, pipes, &vlevel, split, merge, &pipe_cnt, &repopulate_pipes)) goto validate_fail; } -if (fast_validate || +if (validate_mode !=DC_VALIDATE_MODE_AND_PROGRAMMING || (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))) {
@@ -2195,7 +2197,7 @@ bool dcn32_internal_validate_bw(struct dc *dc, 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; + context->bw_ctx.dml.validate_max_state = (validate_mode !=DC_VALIDATE_MODE_AND_PROGRAMMING ); vlevel =dml_get_voltage_level (&context->bw_ctx.dml, pipes, pipe_cnt); context->bw_ctx.dml.validate_max_state = false;
@@ -2247,7 +2249,7 @@ bool dcn32_internal_validate_bw(struct dc *dc,int flag_vlevel = vlevel;int i; - pipe_cnt = dc->res_pool->funcs->populate_dml_pipes (dc, context, pipes, fast_validate); + pipe_cnt = dc->res_pool->funcs->populate_dml_pipes (dc, context, pipes, validate_mode);if (!dc->config.enable_windowed_mpo_odm)dcn32_update_dml_pipes_odm_policy_based_on_context (dc, context, pipes);
@@ -2343,7 +2345,7 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context, } context->bw_ctx.dml.soc.dram_clock_change_latency_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A ].dml_input.pstate_latency_us; -dcn32_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, false); +dcn32_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel,DC_VALIDATE_MODE_AND_PROGRAMMING ); maxMpcComb = context->bw_ctx.dml.vba.maxMpcComb;if (is_subvp_p_drr) { context->bw_ctx.dml.vba.DRAMClockChangeSupport[vlevel][maxMpcComb] = dm_dram_clock_change_vblank_w_mall_sub_vp;
@@ -2389,7 +2391,8 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context, context->bw_ctx.dml.soc.fclk_change_latency_us = dc->clk_mgr->bw_params->dummy_pstate_table[dummy_latency_index].dummy_pstate_latency_us; } -dcn32_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel_temp, false); +dcn32_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel_temp, +DC_VALIDATE_MODE_AND_PROGRAMMING );if (vlevel_temp < vlevel) { vlevel = vlevel_temp; maxMpcComb = context->bw_ctx.dml.vba.maxMpcComb;
@@ -2410,7 +2413,8 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context, stream_status->fpo_in_use = false; } context->bw_ctx.dml.soc.fclk_change_latency_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A ].dml_input.fclk_change_latency_us; -dcn32_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, false); +dcn32_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, +DC_VALIDATE_MODE_AND_PROGRAMMING ); } } }
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.h +1 -1
@@ -49,7 +49,7 @@ bool dcn32_internal_validate_bw(struct dc *dc, display_e2e_pipe_params_st *pipes, int *pipe_cnt_out, int *vlevel_out, - bool fast_validate); + enum dc_validate_mode validate_mode); void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context, display_e2e_pipe_params_st *pipes,
drivers/gpu/drm/amd/display/dc/dml/dcn35/dcn35_fpu.c +2 -2
@@ -437,7 +437,7 @@ static unsigned int get_vertical_back_porch(struct dc_crtc_timing *timing)int dcn35_populate_dml_pipes_from_context_fpu (struct dc *dc,struct dc_state *context,display_e2e_pipe_params_st *pipes, -bool fast_validate) +enum dc_validate_mode validate_mode) {int i, pipe_cnt;struct resource_context *res_ctx = &context->res_ctx;
@@ -446,7 +446,7 @@ int dcn35_populate_dml_pipes_from_context_fpu(struct dc *dc,const unsigned int max_allowed_vblank_nom =1023 ;dcn31_populate_dml_pipes_from_context (dc, context, pipes, - fast_validate); + validate_mode);for (i =0 , pipe_cnt =0 ; i < dc->res_pool->pipe_count; i++) {struct dc_crtc_timing *timing;
drivers/gpu/drm/amd/display/dc/dml/dcn35/dcn35_fpu.h +1 -1
@@ -37,7 +37,7 @@ void dcn35_update_bw_bounding_box_fpu(struct dc *dc,int dcn35_populate_dml_pipes_from_context_fpu (struct dc *dc,struct dc_state *context,display_e2e_pipe_params_st *pipes, -bool fast_validate); +enum dc_validate_mode validate_mode);void dcn35_decide_zstate_support (struct dc *dc,struct dc_state *context);
drivers/gpu/drm/amd/display/dc/dml/dcn351/dcn351_fpu.c +2 -2
@@ -470,7 +470,7 @@ static unsigned int get_vertical_back_porch(struct dc_crtc_timing *timing)int dcn351_populate_dml_pipes_from_context_fpu (struct dc *dc,struct dc_state *context,display_e2e_pipe_params_st *pipes, -bool fast_validate) +enum dc_validate_mode validate_mode) {int i, pipe_cnt;struct resource_context *res_ctx = &context->res_ctx;
@@ -479,7 +479,7 @@ int dcn351_populate_dml_pipes_from_context_fpu(struct dc *dc,const unsigned int max_allowed_vblank_nom =1023 ;dcn31_populate_dml_pipes_from_context (dc, context, pipes, - fast_validate); + validate_mode);for (i =0 , pipe_cnt =0 ; i < dc->res_pool->pipe_count; i++) {struct dc_crtc_timing *timing;
drivers/gpu/drm/amd/display/dc/dml/dcn351/dcn351_fpu.h +1 -1
@@ -12,7 +12,7 @@ void dcn351_update_bw_bounding_box_fpu(struct dc *dc,int dcn351_populate_dml_pipes_from_context_fpu (struct dc *dc,struct dc_state *context,display_e2e_pipe_params_st *pipes, -bool fast_validate); +enum dc_validate_mode validate_mode);void dcn351_decide_zstate_support (struct dc *dc,struct dc_state *context);
drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_wrapper.c +4 -3
@@ -326,12 +326,13 @@ static bool dml21_check_mode_support(const struct dc *in_dc, struct dc_state *coreturn true; } -bool dml21_validate (const struct dc *in_dc,struct dc_state *context,struct dml2_context *dml_ctx,bool fast_validate) +bool dml21_validate (const struct dc *in_dc,struct dc_state *context,struct dml2_context *dml_ctx, +enum dc_validate_mode validate_mode) {bool out = false; -/* Use dml_validate_only for fast_validate path */ -if (fast_validate) +/* Use dml21_check_mode_support for DC_VALIDATE_MODE_ONLY and DC_VALIDATE_MODE_AND_STATE_INDEX path */ +if (validate_mode !=DC_VALIDATE_MODE_AND_PROGRAMMING ) out =dml21_check_mode_support (in_dc, context, dml_ctx);else out =dml21_mode_check_and_programming (in_dc, context, dml_ctx);
drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_wrapper.h +7 -4
@@ -14,6 +14,7 @@ struct dc;struct dc_state ;struct dml2_configuration_options ;struct dml2_context ; +enum dc_validate_mode ;/** * dml2_create - Creates dml21_context.
@@ -39,16 +40,17 @@ void dml21_reinit(const struct dc *in_dc, struct dml2_context **dml_ctx, const s* dml21_validate - Determines if a display configuration is supported or not. * @in_dc: dc. * @context: dc_state to be validated. -* @fast_validate: Fast validate will not populate context.res_ctx. +* @validate_mode: DC_VALIDATE_MODE_ONLY and DC_VALIDATE_MODE_AND_STATE_INDEX +* will not populate context.res_ctx. * * Based on fast_validate option internally would call: * -* -dml21_mode_check_and_programming - for non fast_validate option +* -dml21_mode_check_and_programming - for DC_VALIDATE_MODE_AND_PROGRAMMING option * Calculates if dc_state can be supported on the input display * configuration. If supported, generates the necessary HW * programming for the new dc_state. * -* -dml21_check_mode_support - for fast_validate option +* -dml21_check_mode_support - for DC_VALIDATE_MODE_ONLY and DC_VALIDATE_MODE_AND_STATE_INDEX option * Calculates if dc_state can be supported for the input display * config.
@@ -56,7 +58,8 @@ void dml21_reinit(const struct dc *in_dc, struct dml2_context **dml_ctx, const s* separate dc_states for validation. * Return: True if mode is supported, false otherwise. */ -bool dml21_validate (const struct dc *in_dc,struct dc_state *context,struct dml2_context *dml_ctx,bool fast_validate); +bool dml21_validate (const struct dc *in_dc,struct dc_state *context,struct dml2_context *dml_ctx, +enum dc_validate_mode validate_mode);/* Prepare hubp mcache_regs for hubp mcache ID and split coordinate programming */ void dml21_prepare_mcache_programming (struct dc *in_dc,struct dc_state *context,struct dml2_context *dml_ctx);
drivers/gpu/drm/amd/display/dc/dml2/dml2_mall_phantom.c +1 -1
@@ -868,7 +868,7 @@ bool dml2_svp_remove_all_phantom_pipes(struct dml2_context *ctx, struct dc_state/* Conditions for setting up phantom pipes for SubVP: * 1. Not force disable SubVP -* 2. Full update (i.e. !fast_validate) +* 2. Full update (i.e. DC_VALIDATE_MODE_AND_PROGRAMMING) * 3. Enough pipes are available to support SubVP (TODO: Which pipes will use VACTIVE / VBLANK / SUBVP?) * 4. Display configuration passes validation * 5. (Config doesn't support MCLK in VACTIVE/VBLANK || dc->debug.force_subvp_mclk_switch)
drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.c +5 -4
@@ -721,7 +721,8 @@ 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,struct dml2_context *dml2,bool fast_validate) +bool dml2_validate (const struct dc *in_dc,struct dc_state *context,struct dml2_context *dml2, +enum dc_validate_mode validate_mode) {bool out = false;
@@ -731,14 +732,14 @@ bool dml2_validate(const struct dc *in_dc, struct dc_state *context, struct dml2/* DML2.1 validation path */ if (dml2->architecture == dml2_architecture_21) { - out =dml21_validate (in_dc, context, dml2, fast_validate); + out =dml21_validate (in_dc, context, dml2, validate_mode);return out; }DC_FP_START (); -/* Use dml_validate_only for fast_validate path */ -if (fast_validate) +/* Use dml_validate_only for DC_VALIDATE_MODE_ONLY and DC_VALIDATE_MODE_AND_STATE_INDEX path */ +if (validate_mode !=DC_VALIDATE_MODE_AND_PROGRAMMING ) out =dml2_validate_only (context);else out =dml2_validate_and_build_resource (in_dc, context);
drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h +2 -2
@@ -272,7 +272,7 @@ void dml2_reinit(const struct dc *in_dc,* dml2_validate - Determines if a display configuration is supported or not. * @in_dc: dc. * @context: dc_state to be validated. -* @fast_validate: Fast validate will not populate context.res_ctx. +* @validate_mode: DC_VALIDATE_MODE_ONLY and DC_VALIDATE_MODE_AND_STATE_INDEX will not populate context.res_ctx. * * DML1.0 compatible interface for validation. *
@@ -295,7 +295,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); +enum dc_validate_mode validate_mode);/* * dml2_extract_dram_and_fclk_change_support - Extracts the FCLK and UCLK change support info.
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c +1 -1
@@ -2484,7 +2484,7 @@ bool dcn20_update_bandwidth(struct dce_hwseq *hws = dc->hwseq;/* recalculate DML parameters */ -if (dc->res_pool->funcs->validate_bandwidth (dc, context, false) !=DC_OK ) +if (dc->res_pool->funcs->validate_bandwidth (dc, context,DC_VALIDATE_MODE_AND_PROGRAMMING ) !=DC_OK )return false;/* apply updated bandwidth parameters */
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c +1 -1
@@ -2385,7 +2385,7 @@ bool dcn401_update_bandwidth(struct dce_hwseq *hws = dc->hwseq;/* recalculate DML parameters */ -if (dc->res_pool->funcs->validate_bandwidth (dc, context, false) !=DC_OK ) +if (dc->res_pool->funcs->validate_bandwidth (dc, context,DC_VALIDATE_MODE_AND_PROGRAMMING ) !=DC_OK )return false;/* apply updated bandwidth parameters */
drivers/gpu/drm/amd/display/dc/inc/core_types.h +2 -2
@@ -82,7 +82,7 @@ struct resource_funcs {enum dc_status (*validate_bandwidth)(struct dc *dc,struct dc_state *context, -bool fast_validate); +enum dc_validate_mode validate_mode); void (*calculate_wm_and_dlg)( struct dc *dc, struct dc_state *context, display_e2e_pipe_params_st *pipes,
@@ -107,7 +107,7 @@ struct resource_funcs {struct dc *dc, struct dc_state *context, display_e2e_pipe_params_st *pipes, - bool fast_validate); + enum dc_validate_mode validate_mode);/* * Algorithm for assigning available link encoders to links.
drivers/gpu/drm/amd/display/dc/inc/dcn_calcs.h +1 -1
@@ -622,7 +622,7 @@ extern const struct dcn_ip_params dcn10_ip_defaults;bool dcn_validate_bandwidth (struct dc *dc,struct dc_state *context, -bool fast_validate); +enum dc_validate_mode validate_mode); void dcn_get_soc_clks( struct dc *dc,
drivers/gpu/drm/amd/display/dc/resource/dce100/dce100_resource.c +1 -1
@@ -839,7 +839,7 @@ static enum dc_status build_mapped_resource(static enum dc_status dce100_validate_bandwidth (struct dc *dc,struct dc_state *context, -bool fast_validate) +enum dc_validate_mode validate_mode) {int i;bool at_least_one_pipe = false;
drivers/gpu/drm/amd/display/dc/resource/dce110/dce110_resource.c +1 -1
@@ -963,7 +963,7 @@ static enum dc_status build_mapped_resource(static enum dc_status dce110_validate_bandwidth (struct dc *dc,struct dc_state *context, -bool fast_validate) +enum dc_validate_mode validate_mode) {bool result = false;
drivers/gpu/drm/amd/display/dc/resource/dce112/dce112_resource.c +1 -1
@@ -886,7 +886,7 @@ static enum dc_status build_mapped_resource(enum dc_status dce112_validate_bandwidth (struct dc *dc,struct dc_state *context, -bool fast_validate) +enum dc_validate_mode validate_mode) {bool result = false;
drivers/gpu/drm/amd/display/dc/resource/dce112/dce112_resource.h +1 -1
@@ -45,7 +45,7 @@ enum dc_status dce112_validate_with_context(enum dc_status dce112_validate_bandwidth (struct dc *dc,struct dc_state *context, -bool fast_validate); +enum dc_validate_mode validate_mode); enum dc_status dce112_add_stream_to_ctx( struct dc *dc,
drivers/gpu/drm/amd/display/dc/resource/dce60/dce60_resource.c +1 -1
@@ -866,7 +866,7 @@ static void dce60_resource_destruct(struct dce110_resource_pool *pool)static enum dc_status dce60_validate_bandwidth (struct dc *dc,struct dc_state *context, -bool fast_validate) +enum dc_validate_mode validate_mode) {int i;bool at_least_one_pipe = false;
drivers/gpu/drm/amd/display/dc/resource/dce80/dce80_resource.c +1 -1
@@ -872,7 +872,7 @@ static void dce80_resource_destruct(struct dce110_resource_pool *pool)static enum dc_status dce80_validate_bandwidth (struct dc *dc,struct dc_state *context, -bool fast_validate) +enum dc_validate_mode validate_mode) {int i;bool at_least_one_pipe = false;
drivers/gpu/drm/amd/display/dc/resource/dcn10/dcn10_resource.c +2 -2
@@ -1129,12 +1129,12 @@ static void dcn10_destroy_resource_pool(struct resource_pool **pool)static enum dc_status dcn10_validate_bandwidth (struct dc *dc,struct dc_state *context, -bool fast_validate) +enum dc_validate_mode validate_mode) {bool voltage_supported;DC_FP_START (); - voltage_supported =dcn_validate_bandwidth (dc, context, fast_validate); + voltage_supported =dcn_validate_bandwidth (dc, context, validate_mode);DC_FP_END ();return voltage_supported ?DC_OK :DC_FAIL_BANDWIDTH_VALIDATE ;
drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c +4 -4
@@ -2007,7 +2007,7 @@ bool dcn20_fast_validate_bw(int *pipe_cnt_out, int *pipe_split_from, int *vlevel_out, - bool fast_validate) + enum dc_validate_mode validate_mode) { bool out = false;int split[MAX_PIPES ] = {0 };
@@ -2021,7 +2021,7 @@ bool dcn20_fast_validate_bw(dcn20_merge_pipes_for_validate (dc, context);DC_FP_START (); - pipe_cnt = dc->res_pool->funcs->populate_dml_pipes (dc, context, pipes, fast_validate); + pipe_cnt = dc->res_pool->funcs->populate_dml_pipes (dc, context, pipes, validate_mode);DC_FP_END (); *pipe_cnt_out = pipe_cnt;
@@ -2125,7 +2125,7 @@ bool dcn20_fast_validate_bw( }enum dc_status dcn20_validate_bandwidth (struct dc *dc,struct dc_state *context, -bool fast_validate) +enum dc_validate_mode validate_mode) {bool voltage_supported;display_e2e_pipe_params_st *pipes;
@@ -2135,7 +2135,7 @@ enum dc_status dcn20_validate_bandwidth(struct dc *dc, struct dc_state *context,return DC_FAIL_BANDWIDTH_VALIDATE ;DC_FP_START (); - voltage_supported =dcn20_validate_bandwidth_fp (dc, context, fast_validate, pipes); + voltage_supported =dcn20_validate_bandwidth_fp (dc, context, validate_mode, pipes);DC_FP_END ();kfree (pipes);
drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.h +2 -2
@@ -119,7 +119,7 @@ void dcn20_set_mcif_arb_params(struct dc_state *context, display_e2e_pipe_params_st *pipes, int pipe_cnt); -enum dc_status dcn20_validate_bandwidth (struct dc *dc,struct dc_state *context,bool fast_validate); +enum dc_status dcn20_validate_bandwidth (struct dc *dc,struct dc_state *context,enum dc_validate_mode validate_mode);void dcn20_merge_pipes_for_validate (struct dc *dc,struct dc_state *context);
@@ -158,7 +158,7 @@ bool dcn20_fast_validate_bw(int *pipe_cnt_out, int *pipe_split_from, int *vlevel_out, - bool fast_validate); + enum dc_validate_mode validate_mode);enum dc_status dcn20_build_mapped_resource (const struct dc *dc,struct dc_state *context,struct dc_stream_state *stream);enum dc_status dcn20_add_stream_to_ctx (struct dc *dc,struct dc_state *new_ctx,struct dc_stream_state *dc_stream);
drivers/gpu/drm/amd/display/dc/resource/dcn21/dcn21_resource.c +4 -4
@@ -769,7 +769,7 @@ bool dcn21_fast_validate_bw(struct dc *dc,int *pipe_cnt_out, int *pipe_split_from, int *vlevel_out, - bool fast_validate) + enum dc_validate_mode validate_mode) { bool out = false;int split[MAX_PIPES ] = {0 };
@@ -783,7 +783,7 @@ bool dcn21_fast_validate_bw(struct dc *dc,dcn20_merge_pipes_for_validate (dc, context);DC_FP_START (); - pipe_cnt = dc->res_pool->funcs->populate_dml_pipes (dc, context, pipes, fast_validate); + pipe_cnt = dc->res_pool->funcs->populate_dml_pipes (dc, context, pipes, validate_mode);DC_FP_END (); *pipe_cnt_out = pipe_cnt;
@@ -924,7 +924,7 @@ bool dcn21_fast_validate_bw(struct dc *dc,* dcn20_validate_bandwidth in dcn20_resource.c. */ static enum dc_status dcn21_validate_bandwidth (struct dc *dc,struct dc_state *context, -bool fast_validate) +enum dc_validate_mode validate_mode) {bool voltage_supported;display_e2e_pipe_params_st *pipes;
@@ -934,7 +934,7 @@ static enum dc_status dcn21_validate_bandwidth(struct dc *dc, struct dc_state *creturn DC_FAIL_BANDWIDTH_VALIDATE ;DC_FP_START (); - voltage_supported =dcn21_validate_bandwidth_fp (dc, context, fast_validate, pipes); + voltage_supported =dcn21_validate_bandwidth_fp (dc, context, validate_mode, pipes);DC_FP_END ();kfree (pipes);
drivers/gpu/drm/amd/display/dc/resource/dcn21/dcn21_resource.h +1 -1
@@ -51,6 +51,6 @@ bool dcn21_fast_validate_bw(int *pipe_cnt_out, int *pipe_split_from, int *vlevel_out, - bool fast_validate); + enum dc_validate_mode validate_mode);#endif /* _DCN21_RESOURCE_H_ */
drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c +11 -11
@@ -1319,13 +1319,13 @@ static struct clock_source *dcn30_clock_source_create(int dcn30_populate_dml_pipes_from_context (struct dc *dc,struct dc_state *context,display_e2e_pipe_params_st *pipes, -bool fast_validate) +enum dc_validate_mode validate_mode) {int i, pipe_cnt;struct resource_context *res_ctx = &context->res_ctx;DC_FP_START (); -dcn20_populate_dml_pipes_from_context (dc, context, pipes, fast_validate); +dcn20_populate_dml_pipes_from_context (dc, context, pipes, validate_mode);DC_FP_END ();for (i =0 , pipe_cnt =0 ; i < dc->res_pool->pipe_count; i++) {
@@ -1627,7 +1627,7 @@ noinline bool dcn30_internal_validate_bw( display_e2e_pipe_params_st *pipes, int *pipe_cnt_out, int *vlevel_out, - bool fast_validate, + enum dc_validate_mode validate_mode, bool allow_self_refresh_only) {bool out = false;
@@ -1646,7 +1646,7 @@ noinline bool dcn30_internal_validate_bw( context->bw_ctx.dml.vba.VoltageLevel =0 ; context->bw_ctx.dml.vba.DRAMClockChangeSupport[0 ][0 ] = dm_dram_clock_change_vactive; 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); + pipe_cnt = dc->res_pool->funcs->populate_dml_pipes (dc, context, pipes, validate_mode);if (!pipe_cnt) { out = true;
@@ -1655,7 +1655,7 @@ noinline bool dcn30_internal_validate_bw(dml_log_pipe_params (&context->bw_ctx.dml, pipes, pipe_cnt); -if (!fast_validate || !allow_self_refresh_only) { +if (validate_mode ==DC_VALIDATE_MODE_AND_PROGRAMMING || !allow_self_refresh_only) {/* * DML favors voltage over p-state, but we're more interested in * supporting p-state over voltage. We can't support p-state in
@@ -1669,7 +1669,7 @@ noinline bool dcn30_internal_validate_bw( vlevel =dcn20_validate_apply_pipe_split_flags (dc, context, vlevel, split, merge); }if (allow_self_refresh_only && - (fast_validate || vlevel == context->bw_ctx.dml.soc.num_states || + (validate_mode !=DC_VALIDATE_MODE_AND_PROGRAMMING || vlevel == context->bw_ctx.dml.soc.num_states || vba->DRAMClockChangeSupport[vlevel][vba->maxMpcComb] == dm_dram_clock_change_unsupported)) {/* * If mode is unsupported or there's still no p-state support
@@ -1678,7 +1678,7 @@ noinline bool dcn30_internal_validate_bw(* We don't actually support prefetch mode 2, so require that we * at least support prefetch mode 1. */ - context->bw_ctx.dml.validate_max_state = fast_validate; + context->bw_ctx.dml.validate_max_state = (validate_mode !=DC_VALIDATE_MODE_AND_PROGRAMMING ); context->bw_ctx.dml.soc.allow_dram_self_refresh_or_dram_clock_change_in_vblank = dm_allow_self_refresh;
@@ -1865,7 +1865,7 @@ noinline bool dcn30_internal_validate_bw( }if (repopulate_pipes) - pipe_cnt = dc->res_pool->funcs->populate_dml_pipes (dc, context, pipes, fast_validate); + pipe_cnt = dc->res_pool->funcs->populate_dml_pipes (dc, context, pipes, validate_mode); context->bw_ctx.dml.vba.VoltageLevel = vlevel; *vlevel_out = vlevel; *pipe_cnt_out = pipe_cnt;
@@ -2037,7 +2037,7 @@ void dcn30_calculate_wm_and_dlg(enum dc_status dcn30_validate_bandwidth (struct dc *dc,struct dc_state *context, -bool fast_validate) +enum dc_validate_mode validate_mode) {bool out = false;
@@ -2055,7 +2055,7 @@ enum dc_status dcn30_validate_bandwidth(struct dc *dc, goto validate_fail;DC_FP_START (); - out =dcn30_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, fast_validate, true); + out =dcn30_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, validate_mode, true);DC_FP_END ();if (pipe_cnt ==0 )
@@ -2066,7 +2066,7 @@ enum dc_status dcn30_validate_bandwidth(struct dc *dc,BW_VAL_TRACE_END_VOLTAGE_LEVEL (); -if (fast_validate) { +if (validate_mode !=DC_VALIDATE_MODE_AND_PROGRAMMING ) {BW_VAL_TRACE_SKIP (fast); goto validate_out; }
drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.h +3 -3
@@ -57,14 +57,14 @@ unsigned int dcn30_calc_max_scaled_time( unsigned int urgent_watermark);enum dc_status dcn30_validate_bandwidth (struct dc *dc,struct dc_state *context, -bool fast_validate); +enum dc_validate_mode validate_mode);bool dcn30_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, +enum dc_validate_mode validate_mode,bool allow_self_refresh_only); void dcn30_calculate_wm_and_dlg( struct dc *dc, struct dc_state *context,
@@ -78,7 +78,7 @@ void dcn30_populate_dml_writeback_from_context(int dcn30_populate_dml_pipes_from_context (struct dc *dc,struct dc_state *context,display_e2e_pipe_params_st *pipes, -bool fast_validate); +enum dc_validate_mode validate_mode); bool dcn30_acquire_post_bldn_3dlut( struct resource_context *res_ctx,
drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c +9 -9
@@ -1616,14 +1616,14 @@ static bool is_dual_plane(enum surface_pixel_format format)int dcn31x_populate_dml_pipes_from_context (struct dc *dc,struct dc_state *context,display_e2e_pipe_params_st *pipes, -bool fast_validate) +enum dc_validate_mode validate_mode) {uint32_t pipe_cnt;int i;dc_assert_fp_enabled (); - pipe_cnt =dcn20_populate_dml_pipes_from_context (dc, context, pipes, fast_validate); + pipe_cnt =dcn20_populate_dml_pipes_from_context (dc, context, pipes, validate_mode);for (i =0 ; i < pipe_cnt; i++) { pipes[i].pipe.src.gpuvm =1 ;
@@ -1641,7 +1641,7 @@ int dcn31x_populate_dml_pipes_from_context(struct dc *dc,int dcn31_populate_dml_pipes_from_context (struct dc *dc,struct dc_state *context,display_e2e_pipe_params_st *pipes, -bool fast_validate) +enum dc_validate_mode validate_mode) {int i, pipe_cnt;struct resource_context *res_ctx = &context->res_ctx;
@@ -1649,7 +1649,7 @@ int dcn31_populate_dml_pipes_from_context(bool upscaled = false;DC_FP_START (); -dcn31x_populate_dml_pipes_from_context (dc, context, pipes, fast_validate); +dcn31x_populate_dml_pipes_from_context (dc, context, pipes, validate_mode);DC_FP_END ();for (i =0 , pipe_cnt =0 ; i < dc->res_pool->pipe_count; i++) {
@@ -1760,7 +1760,7 @@ dcn31_set_mcif_arb_params(struct dc *dc,enum dc_status dcn31_validate_bandwidth (struct dc *dc,struct dc_state *context, -bool fast_validate) +enum dc_validate_mode validate_mode) {bool out = false;
@@ -1778,19 +1778,19 @@ enum dc_status dcn31_validate_bandwidth(struct dc *dc, goto validate_fail;DC_FP_START (); - out =dcn30_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, fast_validate, true); + out =dcn30_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, validate_mode, true);DC_FP_END (); -// Disable fast_validate to set min dcfclk in calculate_wm_and_dlg +// Disable DC_VALIDATE_MODE_ONLY and DC_VALIDATE_MODE_AND_STATE_INDEX to set min dcfclk in calculate_wm_and_dlg if (pipe_cnt ==0 ) - fast_validate = false; + validate_mode =DC_VALIDATE_MODE_AND_PROGRAMMING ;if (!out) goto validate_fail;BW_VAL_TRACE_END_VOLTAGE_LEVEL (); -if (fast_validate) { +if (validate_mode !=DC_VALIDATE_MODE_AND_PROGRAMMING ) {BW_VAL_TRACE_SKIP (fast); goto validate_out; }
drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.h +2 -2
@@ -39,7 +39,7 @@ struct dcn31_resource_pool {enum dc_status dcn31_validate_bandwidth (struct dc *dc,struct dc_state *context, -bool fast_validate); +enum dc_validate_mode validate_mode); void dcn31_calculate_wm_and_dlg( struct dc *dc, struct dc_state *context, display_e2e_pipe_params_st *pipes,
@@ -48,7 +48,7 @@ void dcn31_calculate_wm_and_dlg(int dcn31_populate_dml_pipes_from_context (struct dc *dc,struct dc_state *context,display_e2e_pipe_params_st *pipes, -bool fast_validate); +enum dc_validate_mode validate_mode); void dcn31_populate_dml_writeback_from_context(struct dc *dc, struct resource_context *res_ctx,
drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.c +7 -7
@@ -1667,12 +1667,12 @@ static struct clock_source *dcn31_clock_source_create(static int dcn314_populate_dml_pipes_from_context (struct dc *dc,struct dc_state *context,display_e2e_pipe_params_st *pipes, -bool fast_validate) +enum dc_validate_mode validate_mode) {int pipe_cnt;DC_FP_START (); - pipe_cnt =dcn314_populate_dml_pipes_from_context_fpu (dc, context, pipes, fast_validate); + pipe_cnt =dcn314_populate_dml_pipes_from_context_fpu (dc, context, pipes, validate_mode);DC_FP_END ();return pipe_cnt;
@@ -1696,7 +1696,7 @@ static void dcn314_get_panel_config_defaults(struct dc_panel_config *panel_confienum dc_status dcn314_validate_bandwidth (struct dc *dc,struct dc_state *context, -bool fast_validate) +enum dc_validate_mode validate_mode) {bool out = false;
@@ -1715,19 +1715,19 @@ enum dc_status dcn314_validate_bandwidth(struct dc *dc,DC_FP_START ();// do not support self refresh only - out =dcn30_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, fast_validate, false); + out =dcn30_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, validate_mode, false);DC_FP_END (); -// Disable fast_validate to set min dcfclk in calculate_wm_and_dlg +// Disable DC_VALIDATE_MODE_ONLY and DC_VALIDATE_MODE_AND_STATE_INDEX to set min dcfclk in calculate_wm_and_dlg if (pipe_cnt ==0 ) - fast_validate = false; + validate_mode =DC_VALIDATE_MODE_AND_PROGRAMMING ;if (!out) goto validate_fail;BW_VAL_TRACE_END_VOLTAGE_LEVEL (); -if (fast_validate) { +if (validate_mode !=DC_VALIDATE_MODE_AND_PROGRAMMING ) {BW_VAL_TRACE_SKIP (fast); goto validate_out; }
drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.h +1 -1
@@ -41,7 +41,7 @@ struct dcn314_resource_pool {enum dc_status dcn314_validate_bandwidth (struct dc *dc,struct dc_state *context, -bool fast_validate); +enum dc_validate_mode validate_mode); struct resource_pool *dcn314_create_resource_pool( const struct dc_init_data *init_data,
drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c +2 -2
@@ -1664,7 +1664,7 @@ static bool allow_pixel_rate_crb(struct dc *dc, struct dc_state *context)static int dcn315_populate_dml_pipes_from_context (struct dc *dc,struct dc_state *context,display_e2e_pipe_params_st *pipes, -bool fast_validate) +enum dc_validate_mode validate_mode) {int i, pipe_cnt, crb_idx, crb_pipes;struct resource_context *res_ctx = &context->res_ctx;
@@ -1674,7 +1674,7 @@ static int dcn315_populate_dml_pipes_from_context(bool pixel_rate_crb =allow_pixel_rate_crb (dc, context);DC_FP_START (); -dcn31x_populate_dml_pipes_from_context (dc, context, pipes, fast_validate); +dcn31x_populate_dml_pipes_from_context (dc, context, pipes, validate_mode);DC_FP_END ();for (i =0 , pipe_cnt =0 , crb_pipes =0 ; i < dc->res_pool->pipe_count; i++) {
drivers/gpu/drm/amd/display/dc/resource/dcn316/dcn316_resource.c +2 -2
@@ -1610,7 +1610,7 @@ static bool is_dual_plane(enum surface_pixel_format format)static int dcn316_populate_dml_pipes_from_context (struct dc *dc,struct dc_state *context,display_e2e_pipe_params_st *pipes, -bool fast_validate) +enum dc_validate_mode validate_mode) {int i, pipe_cnt;struct resource_context *res_ctx = &context->res_ctx;
@@ -1618,7 +1618,7 @@ static int dcn316_populate_dml_pipes_from_context(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 (); -dcn31x_populate_dml_pipes_from_context (dc, context, pipes, fast_validate); +dcn31x_populate_dml_pipes_from_context (dc, context, pipes, validate_mode);DC_FP_END ();for (i =0 , pipe_cnt =0 ; i < dc->res_pool->pipe_count; i++) {
drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c +13 -13
@@ -1742,7 +1742,7 @@ void dcn32_add_phantom_pipes(struct dc *dc, struct dc_state *context, } } -static bool dml1_validate (struct dc *dc,struct dc_state *context,bool fast_validate) +static bool dml1_validate (struct dc *dc,struct dc_state *context,enum dc_validate_mode validate_mode) {bool out = false;
@@ -1767,7 +1767,7 @@ static bool dml1_validate(struct dc *dc, struct dc_state *context, bool fast_val goto validate_fail;DC_FP_START (); - out =dcn32_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, fast_validate); + out =dcn32_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, validate_mode);DC_FP_END ();if (pipe_cnt ==0 )
@@ -1778,7 +1778,7 @@ static bool dml1_validate(struct dc *dc, struct dc_state *context, bool fast_valBW_VAL_TRACE_END_VOLTAGE_LEVEL (); -if (fast_validate) { +if (validate_mode !=DC_VALIDATE_MODE_AND_PROGRAMMING ) {BW_VAL_TRACE_SKIP (fast); goto validate_out; }
@@ -1809,7 +1809,7 @@ static bool dml1_validate(struct dc *dc, struct dc_state *context, bool fast_valenum dc_status dcn32_validate_bandwidth (struct dc *dc,struct dc_state *context, -bool fast_validate) +enum dc_validate_mode validate_mode) {unsigned int i;enum dc_status status;
@@ -1827,11 +1827,11 @@ enum dc_status dcn32_validate_bandwidth(struct dc *dc,if (dc->debug.using_dml2) status =dml2_validate (dc, context, context->power_source ==DC_POWER_SOURCE_DC ? context->bw_ctx.dml2_dc_power_source : context->bw_ctx.dml2, - fast_validate) ?DC_OK :DC_FAIL_BANDWIDTH_VALIDATE ; + validate_mode) ?DC_OK :DC_FAIL_BANDWIDTH_VALIDATE ;else - status =dml1_validate (dc, context, fast_validate) ?DC_OK :DC_FAIL_BANDWIDTH_VALIDATE ; + status =dml1_validate (dc, context, validate_mode) ?DC_OK :DC_FAIL_BANDWIDTH_VALIDATE ; -if (!fast_validate && status ==DC_OK &&dc_state_is_subvp_in_use (context)) { +if (validate_mode ==DC_VALIDATE_MODE_AND_PROGRAMMING && status ==DC_OK &&dc_state_is_subvp_in_use (context)) {/* check new stream configuration still supports cursor if subvp used */ for (i =0 ; i < context->stream_count; i++) { stream = context->streams[i];
@@ -1846,14 +1846,14 @@ enum dc_status dcn32_validate_bandwidth(struct dc *dc, }; } -if (!fast_validate && status ==DC_FAIL_HW_CURSOR_SUPPORT ) { +if (validate_mode ==DC_VALIDATE_MODE_AND_PROGRAMMING && status ==DC_FAIL_HW_CURSOR_SUPPORT ) {/* attempt to validate again with subvp disabled due to cursor */ if (dc->debug.using_dml2) status =dml2_validate (dc, context, context->power_source ==DC_POWER_SOURCE_DC ? context->bw_ctx.dml2_dc_power_source : context->bw_ctx.dml2, - fast_validate) ?DC_OK :DC_FAIL_BANDWIDTH_VALIDATE ; + validate_mode) ?DC_OK :DC_FAIL_BANDWIDTH_VALIDATE ;else - status =dml1_validate (dc, context, fast_validate) ?DC_OK :DC_FAIL_BANDWIDTH_VALIDATE ; + status =dml1_validate (dc, context, validate_mode) ?DC_OK :DC_FAIL_BANDWIDTH_VALIDATE ; }return status;
@@ -1862,7 +1862,7 @@ enum dc_status dcn32_validate_bandwidth(struct dc *dc,int dcn32_populate_dml_pipes_from_context (struct dc *dc,struct dc_state *context,display_e2e_pipe_params_st *pipes, -bool fast_validate) +enum dc_validate_mode validate_mode) {int i, pipe_cnt;struct resource_context *res_ctx = &context->res_ctx;
@@ -1878,7 +1878,7 @@ int dcn32_populate_dml_pipes_from_context(int num_subvp_none =0 ;int odm_slice_count; -dcn20_populate_dml_pipes_from_context (dc, context, pipes, fast_validate); +dcn20_populate_dml_pipes_from_context (dc, context, pipes, validate_mode);/* For single display subvp, look for subvp main so if we have phantom * pipe, we can set odm policy to match main pipe
@@ -1960,7 +1960,7 @@ int dcn32_populate_dml_pipes_from_context(/* Only populate DML input with subvp info for full updates. * This is just a workaround -- needs a proper fix. */ -if (!fast_validate) { +if (validate_mode ==DC_VALIDATE_MODE_AND_PROGRAMMING ) {switch (dc_state_get_pipe_subvp_type (context, pipe)) {case SUBVP_MAIN : pipes[pipe_cnt].pipe.src.use_mall_for_pstate_change = dm_use_mall_pstate_change_sub_viewport;
drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.h +2 -2
@@ -100,12 +100,12 @@ void dcn32_add_phantom_pipes(struct dc *dc,enum dc_status dcn32_validate_bandwidth (struct dc *dc,struct dc_state *context, -bool fast_validate); +enum dc_validate_mode validate_mode);int dcn32_populate_dml_pipes_from_context (struct dc *dc,struct dc_state *context,display_e2e_pipe_params_st *pipes, -bool fast_validate); +enum dc_validate_mode validate_mode); void dcn32_calculate_wm_and_dlg( struct dc *dc, struct dc_state *context,
drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c +3 -3
@@ -1734,15 +1734,15 @@ static void dcn35_get_panel_config_defaults(struct dc_panel_config *panel_configstatic enum dc_status dcn35_validate_bandwidth (struct dc *dc,struct dc_state *context, -bool fast_validate) +enum dc_validate_mode validate_mode) {bool out = false; 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); + validate_mode); -if (fast_validate) +if (validate_mode !=DC_VALIDATE_MODE_AND_PROGRAMMING )return out ?DC_OK :DC_FAIL_BANDWIDTH_VALIDATE ;DC_FP_START ();
drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c +3 -3
@@ -1714,15 +1714,15 @@ static void dcn35_get_panel_config_defaults(struct dc_panel_config *panel_configstatic enum dc_status dcn351_validate_bandwidth (struct dc *dc,struct dc_state *context, -bool fast_validate) +enum dc_validate_mode validate_mode) {bool out = false; 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); + validate_mode); -if (fast_validate) +if (validate_mode !=DC_VALIDATE_MODE_AND_PROGRAMMING )return out ?DC_OK :DC_FAIL_BANDWIDTH_VALIDATE ;DC_FP_START ();
drivers/gpu/drm/amd/display/dc/resource/dcn36/dcn36_resource.c +3 -3
@@ -1715,15 +1715,15 @@ static void dcn35_get_panel_config_defaults(struct dc_panel_config *panel_configstatic enum dc_status dcn35_validate_bandwidth (struct dc *dc,struct dc_state *context, -bool fast_validate) +enum dc_validate_mode validate_mode) {bool out = false; 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); + validate_mode); -if (fast_validate) +if (validate_mode !=DC_VALIDATE_MODE_AND_PROGRAMMING )return out ?DC_OK :DC_FAIL_BANDWIDTH_VALIDATE ;DC_FP_START ();
drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c +5 -5
@@ -1644,7 +1644,7 @@ enum dc_status dcn401_patch_unknown_plane_state(struct dc_plane_state *plane_staenum dc_status dcn401_validate_bandwidth (struct dc *dc,struct dc_state *context, -bool fast_validate) +enum dc_validate_mode validate_mode) {unsigned int i;enum dc_status status =DC_OK ;
@@ -1662,9 +1662,9 @@ enum dc_status dcn401_validate_bandwidth(struct dc *dc,if (dc->debug.using_dml2) status =dml2_validate (dc, context, context->power_source ==DC_POWER_SOURCE_DC ? context->bw_ctx.dml2_dc_power_source : context->bw_ctx.dml2, - fast_validate) ?DC_OK :DC_FAIL_BANDWIDTH_VALIDATE ; + validate_mode) ?DC_OK :DC_FAIL_BANDWIDTH_VALIDATE ; -if (!fast_validate && status ==DC_OK &&dc_state_is_subvp_in_use (context)) { +if (validate_mode ==DC_VALIDATE_MODE_AND_PROGRAMMING && status ==DC_OK &&dc_state_is_subvp_in_use (context)) {/* check new stream configuration still supports cursor if subvp used */ for (i =0 ; i < context->stream_count; i++) { stream = context->streams[i];
@@ -1679,12 +1679,12 @@ enum dc_status dcn401_validate_bandwidth(struct dc *dc, }; } -if (!fast_validate && status ==DC_FAIL_HW_CURSOR_SUPPORT ) { +if (validate_mode ==DC_VALIDATE_MODE_AND_PROGRAMMING && status ==DC_FAIL_HW_CURSOR_SUPPORT ) {/* attempt to validate again with subvp disabled due to cursor */ if (dc->debug.using_dml2) status =dml2_validate (dc, context, context->power_source ==DC_POWER_SOURCE_DC ? context->bw_ctx.dml2_dc_power_source : context->bw_ctx.dml2, - fast_validate) ?DC_OK :DC_FAIL_BANDWIDTH_VALIDATE ; + validate_mode) ?DC_OK :DC_FAIL_BANDWIDTH_VALIDATE ; }return status;
drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.h +1 -1
@@ -24,7 +24,7 @@ enum dc_status dcn401_patch_unknown_plane_state(struct dc_plane_state *plane_staenum dc_status dcn401_validate_bandwidth (struct dc *dc,struct dc_state *context, -bool fast_validate); +enum dc_validate_mode validate_mode);void dcn401_prepare_mcache_programming (struct dc *dc,struct dc_state *context);
Signature · 1 line
2.43.0
PATCH 20/24 drm/amd/display: Avoid calling blank_stream() twice
In reply to Wayne LinFrom: Zhongwei Zhang <[email protected]>
[Why]
We've made fix for garbage in dcn31_reset_back_end_for_pipe(), adding blank_stream() before disable_crtc(). And set_dpms_off() will call blank_stream() again.
[How]
Add flag to avoid calling blank_stream() twice.
--- .../gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c | 3 +++ .../gpu/drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.c | 11 +++++++++-- .../drm/amd/display/dc/hwss/hw_sequencer_private.h | 1 + 3 files changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +3 -0
@@ -1222,6 +1222,9 @@ void dce110_blank_stream(struct pipe_ctx *pipe_ctx)struct dc_link *link = stream->link;struct dce_hwseq *hws = link->dc->hwseq; +if (hws && hws->wa_state.skip_blank_stream) +return ; +if (link->local_sink && link->local_sink->sink_signal ==SIGNAL_TYPE_EDP ) {if (!link->skip_implict_edp_power_control) hws->funcs.edp_backlight_control (link, false);
drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.c +9 -2
@@ -526,9 +526,15 @@ static void dcn31_reset_back_end_for_pipe( link = pipe_ctx->stream->link; +if (dc->hwseq) + dc->hwseq->wa_state.skip_blank_stream = false; +if ((!pipe_ctx->stream->dpms_off || link->link_status.link_active) && - (link->connector_signal ==SIGNAL_TYPE_EDP )) + (link->connector_signal ==SIGNAL_TYPE_EDP )) { dc->hwss.blank_stream (pipe_ctx); +if (dc->hwseq) + dc->hwseq->wa_state.skip_blank_stream = true; + } pipe_ctx->stream_res.tg->funcs->set_dsc_config( pipe_ctx->stream_res.tg,
@@ -570,7 +576,8 @@ static void dcn31_reset_back_end_for_pipe( pipe_ctx->stream_res.audio =NULL ; } } - +if (dc->hwseq) + dc->hwseq->wa_state.skip_blank_stream = false; pipe_ctx->stream =NULL ;DC_LOG_DEBUG ("Reset back end for pipe %d, tg:%d\n" , pipe_ctx->pipe_idx, pipe_ctx->stream_res.tg->inst);
drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer_private.h +1 -0
@@ -49,6 +49,7 @@ struct hwseq_wa_state {bool DEGVIDCN10_253_applied;bool disallow_self_refresh_during_multi_plane_transition_applied;unsigned int disallow_self_refresh_during_multi_plane_transition_applied_on_frame; +bool skip_blank_stream; };struct pipe_ctx ;
Signature · 1 line
2.43.0
PATCH 21/24 drm/amd/display: Use DC log instead of using DM error msg
In reply to Wayne LinFrom: Cruise Hung <[email protected]>
[Why & How]
It sent an error msg when it failed to read the DP tunneling DPCD field. This should just be a warning msg. Use a DC log instead of a DM error msg.
--- .../gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c +1 -1
@@ -2023,7 +2023,7 @@ static bool retrieve_link_cap(struct dc_link *link)/* Read DP tunneling information. */ status =dpcd_get_tunneling_device_data (link);if (status !=DC_OK ) -dm_error ("%s: Read DP tunneling device data failed.\n" , __func__); +DC_LOG_DP2 ("%s: Read DP tunneling device data failed.\n" , __func__);retrieve_cable_id (link);dpcd_write_cable_id_to_dprx (link);
Signature · 1 line
2.43.0
PATCH 22/24 drm/amd/display: Add debugging message for brightness caps
In reply to Wayne LinFrom: Mario Limonciello <[email protected]>
[Why]
Default BIOS brightness caps are buried in ACPI.
[How]
Add extra dynamic debug that can show default brightness caps.
--- 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
@@ -4911,6 +4911,7 @@ amdgpu_dm_register_backlight_device(struct amdgpu_dm_connector *aconnector)struct backlight_properties props = {0 };struct amdgpu_dm_backlight_caps caps = {0 };char bl_name[16 ]; +int min, max;if (aconnector->bl_idx ==-1 )return ;
@@ -4923,11 +4924,15 @@ amdgpu_dm_register_backlight_device(struct amdgpu_dm_connector *aconnector) }amdgpu_acpi_get_backlight_caps (&caps); -if (caps.caps_valid) { +if (caps.caps_valid &&get_brightness_range (&caps, &min, &max)) {if (power_supply_is_system_supplied () >0 ) props.brightness = caps.ac_level;else props.brightness = caps.dc_level; +/* min is zero, so max needs to be adjusted */ + props.max_brightness = max - min; +drm_dbg (drm,"Backlight caps: min: %d, max: %d, ac %d, dc %d\n" , min, max, + caps.ac_level, caps.dc_level); }else props.brightness =AMDGPU_MAX_BL_LEVEL ;
Signature · 1 line
2.43.0
PATCH 23/24 drm/amd/display: Fix default DC and AC levels
In reply to Wayne LinFrom: Mario Limonciello <[email protected]>
[Why]
DC and AC levels are advertised in a percentage, not a luminance.
[How]
Scale DC and AC levels to supported values.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -2
@@ -4926,9 +4926,9 @@ amdgpu_dm_register_backlight_device(struct amdgpu_dm_connector *aconnector)amdgpu_acpi_get_backlight_caps (&caps);if (caps.caps_valid &&get_brightness_range (&caps, &min, &max)) {if (power_supply_is_system_supplied () >0 ) - props.brightness = caps.ac_level; + props.brightness = (max - min) *DIV_ROUND_CLOSEST (caps.ac_level,100 );else - props.brightness = caps.dc_level; + props.brightness = (max - min) *DIV_ROUND_CLOSEST (caps.dc_level,100 );/* min is zero, so max needs to be adjusted */ props.max_brightness = max - min; drm_dbg(drm, "Backlight caps: min: %d, max: %d, ac %d, dc %d\n", min, max,
Signature · 1 line
2.43.0
PATCH 24/24 drm/amd/display: Promote DAL to 3.2.336
In reply to Wayne LinFrom: Taimur Hassan <[email protected]>
This version brings along following fixes:
- Fix brightness relevant settings
- Fix calling blanking stream twice
- Extend dc mode validation types to support more scenarios
- Update DMCUB loading sequence for DCN3.5
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -55,7 +55,7 @@ struct aux_payload;struct set_config_cmd_payload ;struct dmub_notification ; -#define DC_VER "3.2.335" +#define DC_VER "3.2.336"/** * MAX_SURFACES - representative of the upper bound of surfaces that can be piped to a single CRTC
Signature · 1 line
2.43.0
[Public]
Hi all,
This week this patchset was tested on 4 systems, two dGPU and two APU based, and tested across multiple display and connection types.
APU
* Single Display eDP -> 1080p 60hz, 1920x1200 165hz
* Single Display DP (SST DSC) -> 4k144hz, 4k240hz
* Multi display -> eDP + DP/HDMI/USB-C -> 1080p 60hz eDP + 4k 144hz, 4k 240hz (Includes USB-C to DP/HDMI adapters)
* Thunderbolt -> LG Ultrafine 5k
* MST DSC -> Cable Matters 101075 (DP to 3x DP) with 3x 4k60hz displays, HP Hook G2 with 2x 4k60hz displays
* USB 4 -> HP Hook G4, Lenovo Thunderbolt Dock, both with 2x 4k60hz DP and 1x 4k60hz HDMI displays
* SST PCON -> Club3D CAC-1085 + 1x 4k 144hz, FRL3, at a max resolution supported by the dongle of 4k 120hz YUV420 12bpc.
* MST PCON -> 1x 4k 144hz, FRL3, at a max resolution supported by the adapter of 4k 120hz RGB 8bpc.
DGPU
* Single Display DP (SST DSC) -> 4k144hz, 4k240hz
* Multiple Display DP -> 4k240hz + 4k144hz
* MST (Startech MST14DP123DP [DP to 3x DP] and 2x 4k 60hz displays)
* MST DSC (with Cable Matters 101075 [DP to 3x DP] with 3x 4k60hz displays)
The testing is a mix of automated and manual tests. Manual testing includes (but is not limited to)
* Changing display configurations and settings
* Video/Audio playback
* Benchmark testing
* Suspend/Resume testing
* Feature testing (Freesync, HDCP, etc.)
Automated testing includes (but is not limited to)
* Script testing (scripts to automate some of the manual checks)
* IGT testing
The testing is mainly tested on the following displays, but occasionally there are tests with other displays
* Samsung G8 Neo 4k240hz
* Samsung QN55QN95B 4k 120hz
* Acer XV322QKKV 4k144hz
* HP U27 4k Wireless 4k60hz
* LG 27UD58B 4k60hz
* LG 32UN650WA 4k60hz
* LG Ultrafine 5k 5k60hz
* AU Optronics B140HAN01.1 1080p 60hz eDP
* AU Optronics B160UAN01.J 1920x1200 165hz eDP
The patchset consists of the amd-staging-drm-next branch (Head commit - b693472094cd4b6cc96715df2e1a17d1ebf85313 drm/amd/display: [FW Promotion] Release 0.1.11.0) with new patches added on top of it.
Tested on Ubuntu 24.04.1, on Wayland and X11, using KDE Plasma and Gnome.
Thank you,
Dan Wheeler
Sr. Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
Facebook | Twitter | amd.com
-----Original Message-----
From: Wayne Lin <[email protected]>
Sent: Tuesday, May 27, 2025 10:49 PM
To: [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Pillai, Aurabindo <[email protected]>; Li, Roman <[email protected]>; Lin, Wayne <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; Zuo, Jerry <[email protected]>; Wheeler, Daniel <[email protected]>; Wu, Ray <[email protected]>; Hung, Alex <[email protected]>; Lin, Wayne <[email protected]>
Subject: [PATCH 00/24] DC Patches June 2nd, 2025
This DC patchset brings improvements in multiple areas. In summary, we highlight:
- Fixes for DML21
- Support OLED SDR with AMD ABC
- Indirect buffer transport for FAMS2 commands
- Correct stream attributes setup timing
- Correct non-OLED pre_T11_delay
- Optime boot-up consuming time
- Add support for 2nd sharpening range
- Fix on chroma planes scaling
- Fix brightness relevant settings
- Fix calling blanking stream twice
- Extend dc mode validation types to support more scenarios
- Update DMCUB loading sequence for DCN3.5
---
Alvin Lee (1):
drm/amd/display: Re-order FAMS2 sub commands
Austin Zheng (1):
drm/amd/display: DML21 Fixes
Camille Cho (1):
drm/amd/display: Support OLED SDR with AMD ABC
Cruise Hung (1):
drm/amd/display: Use DC log instead of using DM error msg
Jingwen Zhu (1):
drm/amd/display: Add disconnect case on dongle check
Mario Limonciello (3):
drm/amd/display: Drop unnecessary amdgpu prefix drm/amd/display: Add debugging message for brightness caps drm/amd/display: Fix default DC and AC levels
Michael Strauss (1):
drm/amd/display: Call setup_stream_attribute after stream enc clk is
ungated
Navid Assadian (1):
drm/amd/display: Do not bypass chroma scaling in 1:1 case
Nicholas Kazlauskas (1):
drm/amd/display: Update DMCUB loading sequence for DCN3.5
Oleh Kuzhylnyi (2):
drm/amd/display: Indirect buffer transport for FAMS2 commands drm/amd/display: Add DML path for FAMS methods
Ray Wu (1):
drm/amd/display: Move vmalloc include to header file
Samson Tam (1):
drm/amd/display: Add support for 2nd sharpening range
Taimur Hassan (4):
drm/amd/display: [FW Promotion] Release 0.1.11.0 drm/amd/display: [FW Promotion] Release 0.1.12.0 drm/amd/display: Promote DAL to 3.2.335 drm/amd/display: Promote DAL to 3.2.336
Wayne Lin (1):
drm/amd/display: Avoid trying AUX transactions on disconnected ports
Yan Li (1):
drm/amd/display: replace fast_validate with enum dc_validate_mode
Yihan Zhu (1):
drm/amd/display: move RMCM programming
Zhongwei Zhang (2):
drm/amd/display: Correct non-OLED pre_T11_delay. drm/amd/display: Avoid calling blank_stream() twice
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 48 +-- .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 6 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 12 +- .../gpu/drm/amd/display/dc/core/dc_resource.c | 12 +- drivers/gpu/drm/amd/display/dc/dc.h | 47 ++- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 59 +++- .../gpu/drm/amd/display/dc/dc_spl_translate.c | 19 +- drivers/gpu/drm/amd/display/dc/dc_types.h | 10 +- .../drm/amd/display/dc/dml/calcs/dcn_calcs.c | 6 +- .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 45 ++- .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.h | 12 +- .../drm/amd/display/dc/dml/dcn30/dcn30_fpu.c | 6 +- .../drm/amd/display/dc/dml/dcn31/dcn31_fpu.h | 2 +- .../amd/display/dc/dml/dcn314/dcn314_fpu.c | 4 +- .../amd/display/dc/dml/dcn314/dcn314_fpu.h | 2 +- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 30 +- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.h | 2 +- .../drm/amd/display/dc/dml/dcn35/dcn35_fpu.c | 4 +- .../drm/amd/display/dc/dml/dcn35/dcn35_fpu.h | 2 +- .../amd/display/dc/dml/dcn351/dcn351_fpu.c | 4 +- .../amd/display/dc/dml/dcn351/dcn351_fpu.h | 2 +- .../dc/dml2/dml21/dml21_translation_helper.c | 4 +- .../amd/display/dc/dml2/dml21/dml21_utils.c | 14 +- .../amd/display/dc/dml2/dml21/dml21_wrapper.c | 9 +- .../amd/display/dc/dml2/dml21/dml21_wrapper.h | 11 +- .../amd/display/dc/dml2/dml21/inc/dml_top.h | 1 - .../display/dc/dml2/dml21/inc/dml_top_types.h | 10 +- .../src/dml2_core/dml2_core_dcn4_calcs.c | 7 +- .../src/dml2_core/dml2_core_shared_types.h | 82 ++++- .../dml2/dml21/src/dml2_dpmm/dml2_dpmm_dcn4.c | 3 - .../src/inc/dml2_internal_shared_types.h | 10 +- .../amd/display/dc/dml2/dml2_mall_phantom.c | 2 +- .../drm/amd/display/dc/dml2/dml2_wrapper.c | 11 +- .../drm/amd/display/dc/dml2/dml2_wrapper.h | 4 +- .../amd/display/dc/hwss/dce110/dce110_hwseq.c | 11 +- .../amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 12 +- .../amd/display/dc/hwss/dcn31/dcn31_hwseq.c | 11 +- .../amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 292 +----------------- .../amd/display/dc/hwss/dcn401/dcn401_hwseq.h | 8 - .../display/dc/hwss/hw_sequencer_private.h | 1 + .../gpu/drm/amd/display/dc/inc/core_types.h | 9 +- .../gpu/drm/amd/display/dc/inc/dcn_calcs.h | 2 +- .../gpu/drm/amd/display/dc/link/link_dpms.c | 6 +- .../drm/amd/display/dc/link/link_validation.c | 8 + .../dc/link/protocols/link_dp_capability.c | 2 +- .../link/protocols/link_edp_panel_control.c | 21 ++ .../drm/amd/display/dc/mpc/dcn32/dcn32_mpc.c | 3 - drivers/gpu/drm/amd/display/dc/os_types.h | 1 + .../dc/resource/dce100/dce100_resource.c | 2 +- .../dc/resource/dce110/dce110_resource.c | 2 +- .../dc/resource/dce112/dce112_resource.c | 2 +- .../dc/resource/dce112/dce112_resource.h | 2 +- .../dc/resource/dce60/dce60_resource.c | 2 +- .../dc/resource/dce80/dce80_resource.c | 2 +- .../dc/resource/dcn10/dcn10_resource.c | 4 +- .../dc/resource/dcn20/dcn20_resource.c | 8 +- .../dc/resource/dcn20/dcn20_resource.h | 4 +- .../dc/resource/dcn21/dcn21_resource.c | 8 +- .../dc/resource/dcn21/dcn21_resource.h | 2 +- .../dc/resource/dcn30/dcn30_resource.c | 22 +- .../dc/resource/dcn30/dcn30_resource.h | 6 +- .../dc/resource/dcn31/dcn31_resource.c | 18 +- .../dc/resource/dcn31/dcn31_resource.h | 4 +- .../dc/resource/dcn314/dcn314_resource.c | 14 +- .../dc/resource/dcn314/dcn314_resource.h | 2 +- .../dc/resource/dcn315/dcn315_resource.c | 4 +- .../dc/resource/dcn316/dcn316_resource.c | 4 +- .../dc/resource/dcn32/dcn32_resource.c | 26 +- .../dc/resource/dcn32/dcn32_resource.h | 4 +- .../dc/resource/dcn35/dcn35_resource.c | 6 +- .../dc/resource/dcn351/dcn351_resource.c | 6 +- .../dc/resource/dcn36/dcn36_resource.c | 6 +- .../dc/resource/dcn401/dcn401_resource.c | 31 +- .../dc/resource/dcn401/dcn401_resource.h | 2 +- drivers/gpu/drm/amd/display/dc/sspl/dc_spl.c | 28 +- .../dc/virtual/virtual_stream_encoder.c | 7 + drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 2 + .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 204 +++++++++++- .../gpu/drm/amd/display/dmub/src/dmub_dcn35.c | 16 +- .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 9 +- 80 files changed, 771 insertions(+), 577 deletions(-)
--
2.43.0