DC Patches September 14, 2022
v2 cover DC Patches September 14, 2022
Resend due to connection time out.
This DC patchset brings improvements in multiple areas. In summary, we highlight:
For DC version 3.2.203
- Port DCN30 420 logic to DCN32
- Remove some unused definitions from DCN32/321
- Remove dp dig pixle rate div policy from dcn314
- Fix dcn315 reading of memory channel count and width
- Fix SubVP and ODM relevant issues
- Fix pipe split, MPO and ODM relevant issues
- Support proper mst payload removal when link is not in mst mode in dc
- Assume an LTTPR is always present on fixed_vs links
- Rework recent update PHY state commit
- Add debug option and logs
For DC version 3.2.204
- Fix urgent latency override for DCN32/DCN321
- Correct hostvm flag in DCN31
- Added new Asic Id for DCN301
- Adjust to 2 phys in DCN301
- Update dummy P-state search to use DCN32 DML
- Increase dcn315 pstate change latency
- Disable OTG WA for the plane_state NULL case on DCN314
- Update dccg based on HW delta
- Correct num_dsc for DCN314
- Fix DP DSC compliance failure with DCN314
- Refactor edp power sequencer codes
- update gamut remap if plane has changed
- Skip audio setup when audio stream is enabled
- Display distortion after hotplug LG Ultrafine 5K tiled display
- Fix DP MST timeslot issue when fallback happened
- Uncomment SubVP pipe split assignment in driver
- Enable committing subvp config
- Do second pass through DML for DET calculation
- Don't allocate DET for phantom pipes
- Modify DML to adjust Vstartup Position
- Ignore k1/k2 values for virtual signal to avoid assert
- Fix failures of disabling primary planes
- Do not compare integers of different widths
- Fix empty slot problem of EDID management
- Revise Sink device string ID width in dmub psr
- Log vertical interrupt 1 for debug
---
Alex Hung (1):
drm/amd/display: Fix failures of disabling primary plans
Alvin Lee (10):
drm/amd/display: Fix pipe split prediction drm/amd/display: Only consider pixle rate div policy for DCN32+ drm/amd/display: For ODM seamless transition require AUTO mode drm/amd/display: Add debug option for allocating extra way for cursor drm/amd/display: SubVP pipe split case
drm/amd/display: Disable SubVP on driver disable drm/amd/display: Fix SubVP way calculation drm/amd/display: Uncomment SubVP pipe split assignment in driver drm/amd/display: Don't allocate DET for phantom pipes drm/amd/display: Do second pass through DML for DET calculation
Anthony Koo (1):
drm/amd/display: [FW Promotion] Release 0.0.134.0
Aric Cyr (2):
drm/amd/display: 3.2.203
drm/amd/display: 3.2.204
Aurabindo Pillai (2):
drm/amd/display: Remove some unused definitions from DCN32/321 drm/amd/display: Enable committing subvp config
Charlene Liu (4):
drm/amd/display: add debug option for dramclk_change_latency in apu drm/amd/display: Expose few dchubbub functions drm/amd/display: update dccg based on HW delta drm/amd/display: correct num_dsc based on HW cap
Chris Park (1):
drm/amd/display: Port DCN30 420 logic to DCN32
Cruise Hung (1):
drm/amd/display: Fix DP MST timeslot issue when fallback happened
Daniel Miess (1):
drm/amd/display: Add shift and mask for ICH_RESET_AT_END_OF_LINE
Dmytro Laktyushkin (2):
drm/amd/display: fix dcn315 memory channel count and width read drm/amd/display: increase dcn315 pstate change latency
George Shen (2):
drm/amd/display: Fix urgent latency override for DCN32/DCN321 drm/amd/display: Update dummy P-state search to use DCN32 DML
Hugo Hu (1):
drm/amd/display: update gamut remap if plane has changed
Ian Chen (1):
drm/amd/display: Refactor edp panel power sequencer(PPS) codes
Jaehyun Chung (1):
drm/amd/display: Assume connectors are on single slot
Josip Pavic (2):
drm/amd/display: do not compare integers of different widths drm/amd/display: log vertical interrupt 1 for debug
Leo Chen (1):
drm/amd/display: Various logs added
Leo Li (1):
drm/amd/display: Fix double cursor on non-video RGB MPO
Meenakshikumar Somasundaram (1):
drm/amd/display: Display distortion after hotplug 5K tiled display
Michael Strauss (1):
drm/amd/display: Assume an LTTPR is always present on fixed_vs links
Nicholas Kazlauskas (1):
drm/amd/display: Disable OTG WA for the plane_state NULL case on
DCN314
Pavle Kotarac (2):
drm/amd/display: Added new DCN301 Asic Id
drm/amd/display: Removing 2 phys
Robin Chen (1):
drm/amd/display: Revise Sink device string ID
Rodrigo Siqueira (1):
drm/amd/display: Ignore k1/k2 values for virtual signal
Sherry Wang (1):
drm/amd/display: correct hostvm flag
Wenjing Liu (3):
drm/amd/display: rework recent update PHY state commit drm/amd/display: support proper mst payload removal when link is not
in mst mode in dc
drm/amd/display: solve regression in update phy state refactor
muansari (1):
drm/amd/display: Modify DML to adjust Vstartup Position
zhikzhai (1):
drm/amd/display: skip audio setup when audio stream is enabled
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 +- .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 12 - .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 11 +- .../drm/amd/display/dc/bios/bios_parser2.c | 63 +++-- .../display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c | 11 +- .../dc/clk_mgr/dcn314/dcn314_clk_mgr.c | 14 +- .../dc/clk_mgr/dcn315/dcn315_clk_mgr.c | 36 +-- .../dc/clk_mgr/dcn316/dcn316_clk_mgr.c | 11 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 19 +- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 98 +++++--- .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 119 +++------- .../gpu/drm/amd/display/dc/core/dc_resource.c | 39 ++++ drivers/gpu/drm/amd/display/dc/dc.h | 3 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 25 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 1 + drivers/gpu/drm/amd/display/dc/dc_link.h | 12 +- drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 7 +- .../display/dc/dce110/dce110_hw_sequencer.c | 170 ++++++++++++-- .../display/dc/dce110/dce110_hw_sequencer.h | 20 +- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 9 + .../gpu/drm/amd/display/dc/dcn10/dcn10_init.c | 4 + .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 6 + .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.h | 2 + .../gpu/drm/amd/display/dc/dcn20/dcn20_dccg.h | 1 + .../gpu/drm/amd/display/dc/dcn20/dcn20_dsc.h | 220 ------------------ .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 44 +++- .../gpu/drm/amd/display/dc/dcn20/dcn20_init.c | 4 + .../drm/amd/display/dc/dcn201/dcn201_hwseq.c | 3 +- .../drm/amd/display/dc/dcn201/dcn201_init.c | 4 + .../gpu/drm/amd/display/dc/dcn21/dcn21_init.c | 4 + .../drm/amd/display/dc/dcn30/dcn30_hwseq.c | 21 +- .../gpu/drm/amd/display/dc/dcn30/dcn30_init.c | 4 + .../drm/amd/display/dc/dcn301/dcn301_init.c | 4 + .../amd/display/dc/dcn301/dcn301_resource.c | 4 +- .../drm/amd/display/dc/dcn31/dcn31_hubbub.c | 2 +- .../drm/amd/display/dc/dcn31/dcn31_hubbub.h | 2 + .../drm/amd/display/dc/dcn31/dcn31_hwseq.c | 11 +- .../gpu/drm/amd/display/dc/dcn31/dcn31_init.c | 4 + .../drm/amd/display/dc/dcn31/dcn31_resource.c | 2 +- .../drm/amd/display/dc/dcn314/dcn314_dccg.h | 70 ++++-- .../drm/amd/display/dc/dcn314/dcn314_hwseq.c | 19 +- .../drm/amd/display/dc/dcn314/dcn314_hwseq.h | 2 - .../drm/amd/display/dc/dcn314/dcn314_init.c | 5 +- .../amd/display/dc/dcn314/dcn314_resource.c | 11 +- .../drm/amd/display/dc/dcn32/dcn32_hubbub.c | 10 +- .../drm/amd/display/dc/dcn32/dcn32_hubbub.h | 29 +++ .../drm/amd/display/dc/dcn32/dcn32_hwseq.c | 100 +++++--- .../drm/amd/display/dc/dcn32/dcn32_hwseq.h | 5 +- .../gpu/drm/amd/display/dc/dcn32/dcn32_init.c | 5 +- .../drm/amd/display/dc/dcn32/dcn32_resource.c | 95 +++----- .../drm/amd/display/dc/dcn32/dcn32_resource.h | 11 +- .../display/dc/dcn32/dcn32_resource_helpers.c | 153 ++++++++++-- .../amd/display/dc/dcn321/dcn321_resource.c | 26 +-- drivers/gpu/drm/amd/display/dc/dm_helpers.h | 3 +- .../amd/display/dc/dml/dcn301/dcn301_fpu.c | 5 + .../drm/amd/display/dc/dml/dcn31/dcn31_fpu.c | 24 +- .../amd/display/dc/dml/dcn314/dcn314_fpu.c | 7 + .../dc/dml/dcn314/display_mode_vba_314.c | 2 +- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 172 +++++++++++--- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.h | 16 +- .../dc/dml/dcn32/display_mode_vba_32.c | 2 + .../dc/dml/dcn32/display_mode_vba_util_32.c | 26 +++ .../dc/dml/dcn32/display_mode_vba_util_32.h | 1 + .../amd/display/dc/dml/dcn321/dcn321_fpu.c | 1 + .../amd/display/dc/dml/display_mode_structs.h | 1 + .../drm/amd/display/dc/dml/display_mode_vba.c | 1 + .../gpu/drm/amd/display/dc/inc/hw/hw_shared.h | 16 +- .../gpu/drm/amd/display/dc/inc/hw_sequencer.h | 23 +- .../gpu/drm/amd/display/dc/inc/link_hwss.h | 6 +- drivers/gpu/drm/amd/display/dc/inc/resource.h | 6 + .../drm/amd/display/dc/link/link_hwss_dio.c | 4 +- .../drm/amd/display/dc/link/link_hwss_dio.h | 2 +- .../drm/amd/display/dc/link/link_hwss_dpia.c | 2 +- .../amd/display/dc/link/link_hwss_hpo_dp.c | 2 +- .../display/dc/virtual/virtual_link_hwss.c | 8 + .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 3 +- .../gpu/drm/amd/display/include/dal_asic_id.h | 1 + .../amd/display/include/ddc_service_types.h | 4 +- 78 files changed, 1191 insertions(+), 726 deletions(-)
Signature · 1 line
2.37.3
PATCH v2 1/47 drm/amd/display: Port DCN30 420 logic to DCN32
From: Chris Park <[email protected]>
[Why]
420 modes are limited by FMT buffer width of 4096 which requires multi-pipe support in form of ODM combine. If 420 modes have greater HActive than 4096, the DML logic should accomodate whether it should be rejected, or ODM combine 2:1 or 4:1 is triggered accordingly.
[How]
FMT Buffer limit of 4096 in DCN32. Force ODM combine depending on HActive and FMT Buffer limit. Reject modes if TMDS 420 and above 4096.
--- .../dc/dml/dcn32/display_mode_vba_32.c | 2 ++ .../dc/dml/dcn32/display_mode_vba_util_32.c | 26 +++++++++++++++++++ .../dc/dml/dcn32/display_mode_vba_util_32.h | 1 + 3 files changed, 29 insertions(+)
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c +2 -0
@@ -1992,6 +1992,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l dml32_CalculateODMMode( mode_lib->vba.MaximumPixelsPerLinePerDSCUnit, mode_lib->vba.HActive[k], + mode_lib->vba.OutputFormat[k], mode_lib->vba.Output[k], mode_lib->vba.ODMUse[k], mode_lib->vba.MaxDispclk[i],
@@ -2014,6 +2015,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l dml32_CalculateODMMode( mode_lib->vba.MaximumPixelsPerLinePerDSCUnit, mode_lib->vba.HActive[k], + mode_lib->vba.OutputFormat[k], mode_lib->vba.Output[k], mode_lib->vba.ODMUse[k], mode_lib->vba.MaxDispclk[i],
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c +26 -0
@@ -27,6 +27,8 @@#include "display_mode_vba_32.h" #include "../display_mode_lib.h" +#define DCN32_MAX_FMT_420_BUFFER_WIDTH 4096 + unsigned int dml32_dscceComputeDelay( unsigned int bpc, double BPP,
@@ -1179,6 +1181,7 @@ void dml32_CalculateDETBufferSize( void dml32_CalculateODMMode( unsigned int MaximumPixelsPerLinePerDSCUnit, unsigned int HActive, + enum output_format_class OutFormat, enum output_encoder_class Output, enum odm_combine_policy ODMUse, double StateDispclk,
@@ -1253,6 +1256,29 @@ void dml32_CalculateODMMode(else *TotalAvailablePipesSupport = false; } +if (OutFormat == dm_420 && HActive >DCN32_MAX_FMT_420_BUFFER_WIDTH && + ODMUse != dm_odm_combine_policy_4to1) { +if (HActive >DCN32_MAX_FMT_420_BUFFER_WIDTH *4 ) { + *ODMMode = dm_odm_combine_mode_disabled; + *NumberOfDPP =0 ; + *TotalAvailablePipesSupport = false; + }else if (HActive >DCN32_MAX_FMT_420_BUFFER_WIDTH *2 || + *ODMMode == dm_odm_combine_mode_4to1) { + *ODMMode = dm_odm_combine_mode_4to1; + *RequiredDISPCLKPerSurface = SurfaceRequiredDISPCLKWithODMCombineFourToOne; + *NumberOfDPP =4 ; + }else { + *ODMMode = dm_odm_combine_mode_2to1; + *RequiredDISPCLKPerSurface = SurfaceRequiredDISPCLKWithODMCombineTwoToOne; + *NumberOfDPP =2 ; + } + } +if (Output == dm_hdmi && OutFormat == dm_420 && + HActive >DCN32_MAX_FMT_420_BUFFER_WIDTH ) { + *ODMMode = dm_odm_combine_mode_disabled; + *NumberOfDPP =0 ; + *TotalAvailablePipesSupport = false; + } } double dml32_CalculateRequiredDispclk(
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.h +1 -0
@@ -216,6 +216,7 @@ void dml32_CalculateDETBufferSize( void dml32_CalculateODMMode( unsigned int MaximumPixelsPerLinePerDSCUnit, unsigned int HActive, + enum output_format_class OutFormat, enum output_encoder_class Output, enum odm_combine_policy ODMUse, double StateDispclk,
Signature · 1 line
2.37.3
PATCH v2 2/47 drm/amd/display: Remove some unused definitions from DCN32/321
In reply to Wayne LinFrom: Aurabindo Pillai <[email protected]>
[Why&How]
After reg offset initialization was switched to runtime rather than compile time, some of the defintions are not needed anymore and can be removed.
--- .../drm/amd/display/dc/dcn32/dcn32_resource.c | 23 ----------------- .../amd/display/dc/dcn321/dcn321_resource.c | 25 ------------------- 2 files changed, 48 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +0 -23
@@ -90,29 +90,6 @@#include "dcn20/dcn20_vmid.h" #include "dml/dcn32/dcn32_fpu.h" -#define DCN_BASE__INST0_SEG1 0x000000C0 -#define DCN_BASE__INST0_SEG2 0x000034C0 -#define DCN_BASE__INST0_SEG3 0x00009000 -#define NBIO_BASE__INST0_SEG1 0x00000014 - -#define MAX_INSTANCE 6 -#define MAX_SEGMENT 6 - -struct IP_BASE_INSTANCE { -unsigned int segment[MAX_SEGMENT ]; -}; - -struct IP_BASE { -struct IP_BASE_INSTANCE instance[MAX_INSTANCE ]; -}; - -static const struct IP_BASE DCN_BASE = { { { {0x00000012 ,0x000000C0 ,0x000034C0 ,0x00009000 ,0x02403C00 ,0 } }, - { {0 ,0 ,0 ,0 ,0 ,0 } }, - { {0 ,0 ,0 ,0 ,0 ,0 } }, - { {0 ,0 ,0 ,0 ,0 ,0 } }, - { {0 ,0 ,0 ,0 ,0 ,0 } }, - { {0 ,0 ,0 ,0 ,0 ,0 } } } }; -#define DC_LOGGER_INIT (logger)enum dcn32_clk_src_array_id {
drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c +0 -25
@@ -93,31 +93,6 @@#include "vm_helper.h" #include "dcn20/dcn20_vmid.h" -#define DCN_BASE__INST0_SEG1 0x000000C0 -#define DCN_BASE__INST0_SEG2 0x000034C0 -#define DCN_BASE__INST0_SEG3 0x00009000 -#define NBIO_BASE__INST0_SEG1 0x00000014 - -#define MAX_INSTANCE 8 -#define MAX_SEGMENT 6 - -struct IP_BASE_INSTANCE { -unsigned int segment[MAX_SEGMENT ]; -}; - -struct IP_BASE { -struct IP_BASE_INSTANCE instance[MAX_INSTANCE ]; -}; - -static const struct IP_BASE DCN_BASE = { { { {0x00000012 ,0x000000C0 ,0x000034C0 ,0x00009000 ,0x02403C00 ,0 } }, - { {0 ,0 ,0 ,0 ,0 ,0 } }, - { {0 ,0 ,0 ,0 ,0 ,0 } }, - { {0 ,0 ,0 ,0 ,0 ,0 } }, - { {0 ,0 ,0 ,0 ,0 ,0 } }, - { {0 ,0 ,0 ,0 ,0 ,0 } }, - { {0 ,0 ,0 ,0 ,0 ,0 } }, - { {0 ,0 ,0 ,0 ,0 ,0 } } } }; -#define DC_LOGGER_INIT (logger)#define fixed16_to_double (x) (((double)x) / ((double) (1 << 16)))#define fixed16_to_double_to_cpu (x) fixed16_to_double(le32_to_cpu(x))
Signature · 1 line
2.37.3
PATCH v2 3/47 drm/amd/display: Fix pipe split prediction
In reply to Wayne LinFrom: Alvin Lee <[email protected]>
[Why & How]
- Pipe split prediction previously only took into account MPC split. We must also consider when ODM combine is required, and when we apply ODM combine by policy.
- Also re-work DET allocation function as it wasn't properly splitting the DET per stream, per plane.
--- .../drm/amd/display/dc/dcn32/dcn32_resource.c | 50 ++++---- .../drm/amd/display/dc/dcn32/dcn32_resource.h | 6 +- .../display/dc/dcn32/dcn32_resource_helpers.c | 108 +++++++++++++++--- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 93 +++++++++++---- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.h | 5 +- 5 files changed, 194 insertions(+), 68 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +27 -23
@@ -1850,12 +1850,36 @@ int dcn32_populate_dml_pipes_from_context(int i, pipe_cnt;struct resource_context *res_ctx = &context->res_ctx;struct pipe_ctx *pipe; -bool subvp_in_use = false, is_pipe_split_expected[MAX_PIPES ]; +bool subvp_in_use = false; +uint8_t is_pipe_split_expected[MAX_PIPES ] = {0 };int plane_count =0 ;struct dc_crtc_timing *timing;dcn20_populate_dml_pipes_from_context (dc, context, pipes, fast_validate); +/* Determine whether we will apply ODM 2to1 policy: +* Applies to single display and where the number of planes is less than 3. +* For 3 plane case ( 2 MPO planes ), we will not set the policy for the MPO pipes. +* +* Apply pipe split policy first so we can predict the pipe split correctly +* (dcn32_predict_pipe_split). +*/ +for (i =0 , pipe_cnt =0 ; i < dc->res_pool->pipe_count; i++) { +if (!res_ctx->pipe_ctx[i].stream) +continue ; + pipe = &res_ctx->pipe_ctx[i]; + timing = &pipe->stream->timing; + + pipes[pipe_cnt].pipe.dest.odm_combine_policy = dm_odm_combine_policy_dal; +if (context->stream_count ==1 && !dc_is_hdmi_signal (res_ctx->pipe_ctx[i].stream->signal)) { +if (dc->debug.enable_single_display_2to1_odm_policy) { +if (!((plane_count >2 ) && pipe->top_pipe)) + pipes[pipe_cnt].pipe.dest.odm_combine_policy = dm_odm_combine_policy_2to1; + } + } + pipe_cnt++; + } +for (i =0 , pipe_cnt =0 ; i < dc->res_pool->pipe_count; i++) {if (!res_ctx->pipe_ctx[i].stream)
@@ -1916,32 +1940,12 @@ int dcn32_populate_dml_pipes_from_context( ++plane_count;DC_FP_START (); - is_pipe_split_expected[i] =dcn32_predict_pipe_split (context, pipes[i].pipe, i); + is_pipe_split_expected[i] =dcn32_predict_pipe_split (context, &pipes[pipe_cnt]);DC_FP_END (); pipe_cnt++; } -/* Determine whether we will apply ODM 2to1 policy -* Applies to single display and where the number of planes is less than 3 -* For 3 plane case ( 2 MPO planes ), we will not set the policy for the MPO pipes -*/ -for (i =0 , pipe_cnt =0 ; i < dc->res_pool->pipe_count; i++) { -if (!res_ctx->pipe_ctx[i].stream) -continue ; - pipe = &res_ctx->pipe_ctx[i]; - timing = &pipe->stream->timing; - - pipes[pipe_cnt].pipe.dest.odm_combine_policy = dm_odm_combine_policy_dal; -if (context->stream_count ==1 && !dc_is_hdmi_signal (res_ctx->pipe_ctx[i].stream->signal)) { -if (dc->debug.enable_single_display_2to1_odm_policy) { -if (!((plane_count >2 ) && pipe->top_pipe)) - pipes[pipe_cnt].pipe.dest.odm_combine_policy = dm_odm_combine_policy_2to1; - } - } - pipe_cnt++; - } -/* For DET allocation, we don't want to use DML policy (not optimal for utilizing all * the DET available for each pipe). Use the DET override input to maintain our driver * policy.
@@ -1958,7 +1962,7 @@ int dcn32_populate_dml_pipes_from_context( } } }else -dcn32_determine_det_override (context, pipes, is_pipe_split_expected, dc->res_pool->pipe_count); +dcn32_determine_det_override (dc, context, pipes, is_pipe_split_expected);// In general cases we want to keep the dram clock change requirement // (prefer configs that support MCLK switch). Only override to false
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.h +4 -2
@@ -109,8 +109,10 @@ struct pipe_ctx *dcn32_acquire_idle_pipe_for_head_pipe_in_layer(struct dc_stream_state *stream, struct pipe_ctx *head_pipe); -void dcn32_determine_det_override (struct dc_state *context,display_e2e_pipe_params_st *pipes, -bool *is_pipe_split_expected,int pipe_cnt); +void dcn32_determine_det_override (struct dc *dc, +struct dc_state *context, +display_e2e_pipe_params_st *pipes, +uint8_t *is_pipe_split_expected);/* definitions for run time init of reg offsets */
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c +89 -19
125 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +72 -21
113 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.h +2 -3
@@ -41,9 +41,8 @@ void dcn32_helper_populate_phantom_dlg_params(struct dc *dc,display_e2e_pipe_params_st *pipes, int pipe_cnt); -bool dcn32_predict_pipe_split (struct dc_state *context, -display_pipe_params_st pipe, -int index); +uint8_t dcn32_predict_pipe_split (struct dc_state *context, +display_e2e_pipe_params_st *pipe_e2e); void insert_entry_into_table_sorted(struct _vcs_dpi_voltage_scaling_st *table, unsigned int *num_entries,
Signature · 1 line
2.37.3
PATCH v2 4/47 drm/amd/display: add debug option for dramclk_change_latency in apu
In reply to Wayne LinFrom: Charlene Liu <[email protected]>
[Why & How]
Support dramclk change latency change via debug option and add some code isolation.
--- .../drm/amd/display/dc/dml/dcn301/dcn301_fpu.c | 5 +++++ .../drm/amd/display/dc/dml/dcn31/dcn31_fpu.c | 17 +++++++++++++++++ .../drm/amd/display/dc/dml/dcn314/dcn314_fpu.c | 5 +++++ 3 files changed, 27 insertions(+)
drivers/gpu/drm/amd/display/dc/dml/dcn301/dcn301_fpu.c +5 -0
@@ -379,6 +379,11 @@ void dcn301_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param dcn3_01_soc.dispclk_dppclk_vco_speed_mhz = dc->clk_mgr->dentist_vco_freq_khz /1000.0 ; dc->dml.soc.dispclk_dppclk_vco_speed_mhz = dc->clk_mgr->dentist_vco_freq_khz /1000.0 ; +if ((int )(dcn3_01_soc.dram_clock_change_latency_us *1000 ) + != dc->debug.dram_clock_change_latency_ns + && dc->debug.dram_clock_change_latency_ns) { + dcn3_01_soc.dram_clock_change_latency_us = dc->debug.dram_clock_change_latency_ns /1000.0 ; + }dml_init_instance (&dc->dml, &dcn3_01_soc, &dcn3_01_ip,DML_PROJECT_DCN30 ); }
drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c +17 -0
@@ -667,6 +667,12 @@ void dcn31_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_params dcn3_1_soc.dispclk_dppclk_vco_speed_mhz = dc->clk_mgr->dentist_vco_freq_khz /1000.0 ; dc->dml.soc.dispclk_dppclk_vco_speed_mhz = dc->clk_mgr->dentist_vco_freq_khz /1000.0 ; +if ((int )(dcn3_1_soc.dram_clock_change_latency_us *1000 ) + != dc->debug.dram_clock_change_latency_ns + && dc->debug.dram_clock_change_latency_ns) { + dcn3_1_soc.dram_clock_change_latency_us = dc->debug.dram_clock_change_latency_ns /1000 ; + } +if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment))dml_init_instance (&dc->dml, &dcn3_1_soc, &dcn3_1_ip,DML_PROJECT_DCN31 );else
@@ -721,6 +727,12 @@ void dcn315_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param*/ dcn3_15_soc.dispclk_dppclk_vco_speed_mhz = max_dispclk_mhz *2 ; +if ((int )(dcn3_15_soc.dram_clock_change_latency_us *1000 ) + != dc->debug.dram_clock_change_latency_ns + && dc->debug.dram_clock_change_latency_ns) { + dcn3_15_soc.dram_clock_change_latency_us = dc->debug.dram_clock_change_latency_ns /1000 ; + } +if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment))dml_init_instance (&dc->dml, &dcn3_15_soc, &dcn3_15_ip,DML_PROJECT_DCN31 );else
@@ -813,6 +825,11 @@ void dcn316_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param dcn3_16_soc.dispclk_dppclk_vco_speed_mhz = max_dispclk_mhz *2 ; dc->dml.soc.dispclk_dppclk_vco_speed_mhz = max_dispclk_mhz *2 ; } +if ((int )(dcn3_16_soc.dram_clock_change_latency_us *1000 ) + != dc->debug.dram_clock_change_latency_ns + && dc->debug.dram_clock_change_latency_ns) { + dcn3_16_soc.dram_clock_change_latency_us = dc->debug.dram_clock_change_latency_ns /1000 ; + }if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment))dml_init_instance (&dc->dml, &dcn3_16_soc, &dcn3_16_ip,DML_PROJECT_DCN31 );
drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c +5 -0
@@ -264,6 +264,11 @@ void dcn314_update_bw_bounding_box_fpu(struct dc *dc, struct clk_bw_params *bw_p dc->dml.soc.dispclk_dppclk_vco_speed_mhz = max_dispclk_mhz *2 ; } +if ((int )(dcn3_14_soc.dram_clock_change_latency_us *1000 ) + != dc->debug.dram_clock_change_latency_ns + && dc->debug.dram_clock_change_latency_ns) { + dcn3_14_soc.dram_clock_change_latency_us = dc->debug.dram_clock_change_latency_ns /1000 ; + }if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment))dml_init_instance (&dc->dml, &dcn3_14_soc, &dcn3_14_ip,DML_PROJECT_DCN314 );else
Signature · 1 line
2.37.3
PATCH v2 5/47 drm/amd/display: Various logs added
In reply to Wayne LinFrom: Leo Chen <[email protected]>
[Why & How]
Added logs for panel delays, spread_spectrum_percentage, and gpuclk_ss_percentage to facilitate debugging.
--- .../drm/amd/display/dc/bios/bios_parser2.c | 54 ++++++++++++++----- 1 file changed, 40 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +40 -14
@@ -850,7 +850,7 @@ static enum bp_result get_ss_info_v4_1(if (disp_cntl_tbl->dvi_ss_mode &ATOM_SS_CENTRE_SPREAD_MODE ) ss_info->type.CENTER_MODE = true; -DC_LOG_BIOS ("AS_SIGNAL_TYPE_DVI: %d\n" , ss_info->spread_spectrum_percentage); +DC_LOG_BIOS ("AS_SIGNAL_TYPE_DVI ss_percentage: %d\n" , ss_info->spread_spectrum_percentage);break ;case AS_SIGNAL_TYPE_HDMI : ss_info->spread_spectrum_percentage =
@@ -860,7 +860,7 @@ static enum bp_result get_ss_info_v4_1(if (disp_cntl_tbl->hdmi_ss_mode &ATOM_SS_CENTRE_SPREAD_MODE ) ss_info->type.CENTER_MODE = true; -DC_LOG_BIOS ("AS_SIGNAL_TYPE_HDMI: %d\n" , ss_info->spread_spectrum_percentage); +DC_LOG_BIOS ("AS_SIGNAL_TYPE_HDMI ss_percentage: %d\n" , ss_info->spread_spectrum_percentage);break ;/* TODO LVDS not support anymore? */ case AS_SIGNAL_TYPE_DISPLAY_PORT :
@@ -871,7 +871,7 @@ static enum bp_result get_ss_info_v4_1(if (disp_cntl_tbl->dp_ss_mode &ATOM_SS_CENTRE_SPREAD_MODE ) ss_info->type.CENTER_MODE = true; -DC_LOG_BIOS ("AS_SIGNAL_TYPE_DISPLAY_PORT: %d\n" , ss_info->spread_spectrum_percentage); +DC_LOG_BIOS ("AS_SIGNAL_TYPE_DISPLAY_PORT ss_percentage: %d\n" , ss_info->spread_spectrum_percentage);break ;case AS_SIGNAL_TYPE_GPU_PLL :/* atom_firmware: DAL only get data from dce_info table.
@@ -885,7 +885,7 @@ static enum bp_result get_ss_info_v4_1( DATA_TABLES(smu_info));if (!smu_info)return BP_RESULT_BADBIOSTABLE ; - +DC_LOG_BIOS ("gpuclk_ss_percentage (unit of 0.001 percent): %d\n" , smu_info->gpuclk_ss_percentage); ss_info->spread_spectrum_percentage = smu_info->waflclk_ss_percentage; ss_info->spread_spectrum_range =
@@ -893,7 +893,7 @@ static enum bp_result get_ss_info_v4_1(if (smu_info->waflclk_ss_mode &ATOM_SS_CENTRE_SPREAD_MODE ) ss_info->type.CENTER_MODE = true; -DC_LOG_BIOS ("AS_SIGNAL_TYPE_XGMI: %d\n" , ss_info->spread_spectrum_percentage); +DC_LOG_BIOS ("AS_SIGNAL_TYPE_XGMI ss_percentage: %d\n" , ss_info->spread_spectrum_percentage);break ;default : result =BP_RESULT_UNSUPPORTED ;
@@ -930,6 +930,7 @@ static enum bp_result get_ss_info_v4_2(if (!smu_info)return BP_RESULT_BADBIOSTABLE ; +DC_LOG_BIOS ("gpuclk_ss_percentage (unit of 0.001 percent): %d\n" , smu_info->gpuclk_ss_percentage); ss_info->type.STEP_AND_DELAY_INFO = false; ss_info->spread_percentage_divider =1000 ;/* BIOS no longer uses target clock. Always enable for now */
@@ -944,7 +945,7 @@ static enum bp_result get_ss_info_v4_2(if (disp_cntl_tbl->dvi_ss_mode &ATOM_SS_CENTRE_SPREAD_MODE ) ss_info->type.CENTER_MODE = true; -DC_LOG_BIOS ("AS_SIGNAL_TYPE_DVI: %d\n" , ss_info->spread_spectrum_percentage); +DC_LOG_BIOS ("AS_SIGNAL_TYPE_DVI ss_percentage: %d\n" , ss_info->spread_spectrum_percentage);break ;case AS_SIGNAL_TYPE_HDMI : ss_info->spread_spectrum_percentage =
@@ -954,7 +955,7 @@ static enum bp_result get_ss_info_v4_2(if (disp_cntl_tbl->hdmi_ss_mode &ATOM_SS_CENTRE_SPREAD_MODE ) ss_info->type.CENTER_MODE = true; -DC_LOG_BIOS ("AS_SIGNAL_TYPE_HDMI: %d\n" , ss_info->spread_spectrum_percentage); +DC_LOG_BIOS ("AS_SIGNAL_TYPE_HDMI ss_percentage: %d\n" , ss_info->spread_spectrum_percentage);break ;/* TODO LVDS not support anymore? */ case AS_SIGNAL_TYPE_DISPLAY_PORT :
@@ -965,7 +966,7 @@ static enum bp_result get_ss_info_v4_2(if (smu_info->gpuclk_ss_mode &ATOM_SS_CENTRE_SPREAD_MODE ) ss_info->type.CENTER_MODE = true; -DC_LOG_BIOS ("AS_SIGNAL_TYPE_DISPLAY_PORT: %d\n" , ss_info->spread_spectrum_percentage); +DC_LOG_BIOS ("AS_SIGNAL_TYPE_DISPLAY_PORT ss_percentage: %d\n" , ss_info->spread_spectrum_percentage);break ;case AS_SIGNAL_TYPE_GPU_PLL :/* atom_firmware: DAL only get data from dce_info table.
@@ -1015,7 +1016,7 @@ static enum bp_result get_ss_info_v4_5(if (disp_cntl_tbl->dvi_ss_mode &ATOM_SS_CENTRE_SPREAD_MODE ) ss_info->type.CENTER_MODE = true; -DC_LOG_BIOS ("AS_SIGNAL_TYPE_DVI: %d\n" , ss_info->spread_spectrum_percentage); +DC_LOG_BIOS ("AS_SIGNAL_TYPE_DVI ss_percentage: %d\n" , ss_info->spread_spectrum_percentage);break ;case AS_SIGNAL_TYPE_HDMI : ss_info->spread_spectrum_percentage =
@@ -1025,7 +1026,7 @@ static enum bp_result get_ss_info_v4_5(if (disp_cntl_tbl->hdmi_ss_mode &ATOM_SS_CENTRE_SPREAD_MODE ) ss_info->type.CENTER_MODE = true; -DC_LOG_BIOS ("AS_SIGNAL_TYPE_HDMI: %d\n" , ss_info->spread_spectrum_percentage); +DC_LOG_BIOS ("AS_SIGNAL_TYPE_HDMI ss_percentage: %d\n" , ss_info->spread_spectrum_percentage);break ;case AS_SIGNAL_TYPE_DISPLAY_PORT : ss_info->spread_spectrum_percentage =
@@ -1035,7 +1036,7 @@ static enum bp_result get_ss_info_v4_5(if (disp_cntl_tbl->dp_ss_mode &ATOM_SS_CENTRE_SPREAD_MODE ) ss_info->type.CENTER_MODE = true; -DC_LOG_BIOS ("AS_SIGNAL_TYPE_DISPLAY_PORT: %d\n" , ss_info->spread_spectrum_percentage); +DC_LOG_BIOS ("AS_SIGNAL_TYPE_DISPLAY_PORT ss_percentage: %d\n" , ss_info->spread_spectrum_percentage);break ;case AS_SIGNAL_TYPE_GPU_PLL :/* atom_smu_info_v4_0 does not have fields for SS for SMU Display PLL anymore.
@@ -1860,7 +1861,7 @@ static enum bp_result get_firmware_info_v3_2(/* Vega12 */ smu_info_v3_2 = GET_IMAGE(struct atom_smu_info_v3_2,DATA_TABLES (smu_info)); - +DC_LOG_BIOS ("gpuclk_ss_percentage (unit of 0.001 percent): %d\n" , smu_info_v3_2->gpuclk_ss_percentage);if (!smu_info_v3_2)return BP_RESULT_BADBIOSTABLE ;
@@ -1869,7 +1870,7 @@ static enum bp_result get_firmware_info_v3_2(/* Vega20 */ smu_info_v3_3 = GET_IMAGE(struct atom_smu_info_v3_3,DATA_TABLES (smu_info)); - +DC_LOG_BIOS ("gpuclk_ss_percentage (unit of 0.001 percent): %d\n" , smu_info_v3_3->gpuclk_ss_percentage);if (!smu_info_v3_3)return BP_RESULT_BADBIOSTABLE ;
@@ -2011,7 +2012,7 @@ static enum bp_result get_firmware_info_v3_4(if (!smu_info_v3_5)return BP_RESULT_BADBIOSTABLE ; - +DC_LOG_BIOS ("gpuclk_ss_percentage (unit of 0.001 percent): %d\n" , smu_info_v3_5->gpuclk_ss_percentage); info->default_engine_clk = smu_info_v3_5->bootup_dcefclk_10khz *10 ;break ;
@@ -2417,6 +2418,7 @@ static enum bp_result get_integrated_info_v11( info_v11 = GET_IMAGE(struct atom_integrated_system_info_v1_11,DATA_TABLES (integratedsysteminfo)); +DC_LOG_BIOS ("gpuclk_ss_percentage (unit of 0.001 percent): %d\n" , info_v11->gpuclk_ss_percentage);if (info_v11 ==NULL )return BP_RESULT_BADBIOSTABLE ;
@@ -2631,6 +2633,7 @@ static enum bp_result get_integrated_info_v2_1( info_v2_1 = GET_IMAGE(struct atom_integrated_system_info_v2_1,DATA_TABLES (integratedsysteminfo)); +DC_LOG_BIOS ("gpuclk_ss_percentage (unit of 0.001 percent): %d\n" , info_v2_1->gpuclk_ss_percentage);if (info_v2_1 ==NULL )return BP_RESULT_BADBIOSTABLE ;
@@ -2792,6 +2795,8 @@ static enum bp_result get_integrated_info_v2_2( info_v2_2 = GET_IMAGE(struct atom_integrated_system_info_v2_2,DATA_TABLES (integratedsysteminfo)); +DC_LOG_BIOS ("gpuclk_ss_percentage (unit of 0.001 percent): %d\n" , info_v2_2->gpuclk_ss_percentage); +if (info_v2_2 ==NULL )return BP_RESULT_BADBIOSTABLE ;
@@ -2943,6 +2948,27 @@ static enum bp_result construct_integrated_info(default :return result; } +if (result ==BP_RESULT_OK ) { + +DC_LOG_BIOS ("edp1:\n" +"\tedp_pwr_on_off_delay = %d\n" +"\tedp_pwr_on_vary_bl_to_blon = %d\n" +"\tedp_pwr_down_bloff_to_vary_bloff = %d\n" +"\tedp_bootup_bl_level = %d\n" , + info->edp1_info.edp_pwr_on_off_delay, + info->edp1_info.edp_pwr_on_vary_bl_to_blon, + info->edp1_info.edp_pwr_down_bloff_to_vary_bloff, + info->edp1_info.edp_bootup_bl_level); +DC_LOG_BIOS ("edp2:\n" +"\tedp_pwr_on_off_delayv = %d\n" +"\tedp_pwr_on_vary_bl_to_blon = %d\n" +"\tedp_pwr_down_bloff_to_vary_bloff = %d\n" +"\tedp_bootup_bl_level = %d\n" , + info->edp2_info.edp_pwr_on_off_delay, + info->edp2_info.edp_pwr_on_vary_bl_to_blon, + info->edp2_info.edp_pwr_down_bloff_to_vary_bloff, + info->edp2_info.edp_bootup_bl_level); + } }if (result !=BP_RESULT_OK )
Signature · 1 line
2.37.3
PATCH v2 6/47 drm/amd/display: Only consider pixle rate div policy for DCN32+
In reply to Wayne LinFrom: Alvin Lee <[email protected]>
[Why and How]
- Only consider pixel rate div policy for DCN32+
--- .../gpu/drm/amd/display/dc/dcn314/dcn314_hwseq.c | 16 ++-------------- .../gpu/drm/amd/display/dc/dcn314/dcn314_hwseq.h | 2 -- .../gpu/drm/amd/display/dc/dcn314/dcn314_init.c | 1 - 3 files changed, 2 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_hwseq.c +2 -14
@@ -343,7 +343,6 @@ unsigned int dcn314_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsig {struct dc_stream_state *stream = pipe_ctx->stream;unsigned int odm_combine_factor =0 ; -struct dc *dc = pipe_ctx->stream->ctx->dc;bool two_pix_per_container = false; two_pix_per_container =optc2_is_two_pixels_per_containter (&stream->timing);
@@ -364,7 +363,7 @@ unsigned int dcn314_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsig }else { *k1_div =PIXEL_RATE_DIV_BY_1 ; *k2_div =PIXEL_RATE_DIV_BY_4 ; -if ((odm_combine_factor ==2 ) || dc->debug.enable_dp_dig_pixel_rate_div_policy) +if (odm_combine_factor ==2 ) *k2_div =PIXEL_RATE_DIV_BY_2 ; } }
@@ -384,21 +383,10 @@ void dcn314_set_pixels_per_cycle(struct pipe_ctx *pipe_ctx)return ; odm_combine_factor =get_odm_config (pipe_ctx,NULL ); -if (optc2_is_two_pixels_per_containter (&pipe_ctx->stream->timing) || odm_combine_factor >1 - ||dcn314_is_dp_dig_pixel_rate_div_policy (pipe_ctx)) +if (optc2_is_two_pixels_per_containter (&pipe_ctx->stream->timing) || odm_combine_factor >1 ) pix_per_cycle =2 ;if (pipe_ctx->stream_res.stream_enc->funcs->set_input_mode) pipe_ctx->stream_res.stream_enc->funcs->set_input_mode (pipe_ctx->stream_res.stream_enc, pix_per_cycle); } - -bool dcn314_is_dp_dig_pixel_rate_div_policy (struct pipe_ctx *pipe_ctx) -{ -struct dc *dc = pipe_ctx->stream->ctx->dc; - -if (dc_is_dp_signal (pipe_ctx->stream->signal) && !is_dp_128b_132b_signal (pipe_ctx) && - dc->debug.enable_dp_dig_pixel_rate_div_policy) -return true; -return false; -}
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_hwseq.h +0 -2
@@ -41,6 +41,4 @@ unsigned int dcn314_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsigvoid dcn314_set_pixels_per_cycle (struct pipe_ctx *pipe_ctx); -bool dcn314_is_dp_dig_pixel_rate_div_policy (struct pipe_ctx *pipe_ctx); -#endif /* __DC_HWSS_DCN314_H__ */
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_init.c +0 -1
@@ -146,7 +146,6 @@ static const struct hwseq_private_funcs dcn314_private_funcs = { .setup_hpo_hw_control = dcn31_setup_hpo_hw_control, .calculate_dccg_k1_k2_values = dcn314_calculate_dccg_k1_k2_values, .set_pixels_per_cycle = dcn314_set_pixels_per_cycle, - .is_dp_dig_pixel_rate_div_policy = dcn314_is_dp_dig_pixel_rate_div_policy, };void dcn314_hw_sequencer_construct (struct dc *dc)
Signature · 1 line
2.37.3
PATCH v2 8/47 drm/amd/display: fix dcn315 memory channel count and width read
In reply to Wayne LinFrom: Dmytro Laktyushkin <[email protected]>
[Why & How]
Correctly set ddr5 channel width to 8 bytes
--- .../gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c | 3 +-- drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c | 7 ++++++- 2 files changed, 7 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c +1 -2
@@ -561,8 +561,7 @@ static void dcn315_clk_mgr_helper_populate_bw_params(ASSERT (bw_params->clk_table.entries[i-1 ].dcfclk_mhz); bw_params->vram_type = bios_info->memory_type; bw_params->num_channels = bios_info->ma_channel_number; -if (!bw_params->num_channels) - bw_params->num_channels =2 ; + bw_params->dram_channel_width_bytes = bios_info->memory_type ==0x22 ?8 :4 ;for (i =0 ; i <WM_SET_COUNT ; i++) { bw_params->wm_table.entries[i].wm_inst = i;
drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c +6 -1
@@ -291,6 +291,7 @@ static struct _vcs_dpi_soc_bounding_box_st dcn3_15_soc = { .do_urgent_latency_adjustment = false, .urgent_latency_adjustment_fabric_clock_component_us = 0, .urgent_latency_adjustment_fabric_clock_reference_mhz = 0, + .num_chans = 4, };struct _vcs_dpi_ip_params_st dcn3_16_ip = {
@@ -688,7 +689,11 @@ void dcn315_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param dcn3_15_ip.max_num_otg = dc->res_pool->res_cap->num_timing_generator; dcn3_15_ip.max_num_dpp = dc->res_pool->pipe_count; - dcn3_15_soc.num_chans = bw_params->num_channels; + +if (bw_params->num_channels >0 ) + dcn3_15_soc.num_chans = bw_params->num_channels; +if (bw_params->dram_channel_width_bytes >0 ) + dcn3_15_soc.dram_channel_width_bytes = bw_params->dram_channel_width_bytes;ASSERT (clk_table->num_entries);
Signature · 1 line
2.37.3
PATCH v2 10/47 drm/amd/display: rework recent update PHY state commit
In reply to Wayne LinFrom: Wenjing Liu <[email protected]>
[why]
Original change 8da78e248069 "drm/amd/display: Add
interface to track PHY state" was implemented by assuming stream's dpms off is equivalent to PHY power off.
This assumption doesn't hold in following situations:
1. MST multiple stream scenario, where multiple streams are sharing the same PHY output. Toggle dpms off for one of the stream doesn't power off the PHY due to the presence of other streams.
2. enable stream failure scenario, where enable stream fails due to failure of link training. This will cause DPMS off is set to false, while the actual PHY power state is off in certain cases.
Due to the problematic assumption, the logic will skip disabling other streams for MST multiple stream scenario, therefore PHY is not actually powered off.
[how]
1. Rework this refactor by moving PHY state update down to hardware level, where we update PHY state in place when hardware sequencer is actually changing the power state of the PHY hardware.
2. Reimplement symclk on TX off workaround in place when we are actually calling transmitter control to power off PHY in dcn32. Note the workaround is added due to the lack of proper software interface to set TX while keeping symclk on. We plan to address this interface problem so we can set TX off only without affecting symclk in future dcn versions.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 19 +-- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 20 +-- .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 96 +----------- drivers/gpu/drm/amd/display/dc/dc_link.h | 2 +- .../display/dc/dce110/dce110_hw_sequencer.c | 137 +++++++++++++++++- .../display/dc/dce110/dce110_hw_sequencer.h | 20 ++- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 9 ++ .../gpu/drm/amd/display/dc/dcn10/dcn10_init.c | 4 + .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 32 +++- .../gpu/drm/amd/display/dc/dcn20/dcn20_init.c | 4 + .../drm/amd/display/dc/dcn201/dcn201_init.c | 4 + .../gpu/drm/amd/display/dc/dcn21/dcn21_init.c | 4 + .../gpu/drm/amd/display/dc/dcn30/dcn30_init.c | 4 + .../drm/amd/display/dc/dcn301/dcn301_init.c | 4 + .../drm/amd/display/dc/dcn31/dcn31_hwseq.c | 11 +- .../gpu/drm/amd/display/dc/dcn31/dcn31_init.c | 4 + .../drm/amd/display/dc/dcn314/dcn314_init.c | 4 + .../drm/amd/display/dc/dcn32/dcn32_hwseq.c | 83 ++++++++--- .../drm/amd/display/dc/dcn32/dcn32_hwseq.h | 5 +- .../gpu/drm/amd/display/dc/dcn32/dcn32_init.c | 5 +- .../gpu/drm/amd/display/dc/inc/hw/hw_shared.h | 16 +- .../gpu/drm/amd/display/dc/inc/hw_sequencer.h | 23 ++- .../gpu/drm/amd/display/dc/inc/link_hwss.h | 6 +- .../drm/amd/display/dc/link/link_hwss_dio.c | 4 +- .../drm/amd/display/dc/link/link_hwss_dio.h | 2 +- .../drm/amd/display/dc/link/link_hwss_dpia.c | 2 +- .../amd/display/dc/link/link_hwss_hpo_dp.c | 2 +- .../display/dc/virtual/virtual_link_hwss.c | 8 + 28 files changed, 357 insertions(+), 177 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -16
@@ -1184,11 +1184,7 @@ static void disable_vbios_mode_if_required( pipe->stream_res.pix_clk_params.requested_pix_clk_100hz;if (pix_clk_100hz != requested_pix_clk_100hz) { -if (dc->hwss.update_phy_state) - dc->hwss.update_phy_state (dc->current_state, - pipe,TX_OFF_SYMCLK_OFF ); -else -core_link_disable_stream (pipe); +core_link_disable_stream (pipe); pipe->stream->dpms_off = false; } }
@@ -3071,11 +3067,7 @@ static void commit_planes_do_stream_update(struct dc *dc,if (stream_update->dpms_off) {if (*stream_update->dpms_off) { -if (dc->hwss.update_phy_state) - dc->hwss.update_phy_state (dc->current_state, - pipe_ctx,TX_OFF_SYMCLK_ON ); -else -core_link_disable_stream (pipe_ctx); +core_link_disable_stream (pipe_ctx);/* for dpms, keep acquired resources*/ if (pipe_ctx->stream_res.audio && !dc->debug.az_endpoint_mute_only) pipe_ctx->stream_res.audio->funcs->az_disable (pipe_ctx->stream_res.audio);
@@ -3085,12 +3077,7 @@ static void commit_planes_do_stream_update(struct dc *dc, }else {if (get_seamless_boot_stream_count (context) ==0 ) dc->hwss.prepare_bandwidth (dc, dc->current_state); - -if (dc->hwss.update_phy_state) - dc->hwss.update_phy_state (dc->current_state, - pipe_ctx,TX_ON_SYMCLK_ON ); -else -core_link_enable_stream (dc->current_state, pipe_ctx); +core_link_enable_stream (dc->current_state, pipe_ctx); } }
drivers/gpu/drm/amd/display/dc/core/dc_link.c +11 -9
@@ -2644,9 +2644,8 @@ static void disable_link(struct dc_link *link, const struct link_resource *link_dp_set_fec_ready (link, link_res, false); } } - }else { -if (signal !=SIGNAL_TYPE_VIRTUAL ) - link->link_enc->funcs->disable_output (link->link_enc, signal); + }else if (signal !=SIGNAL_TYPE_VIRTUAL ) { + link->dc->hwss.disable_link_output (link, link_res, signal); }if (signal ==SIGNAL_TYPE_DISPLAY_PORT_MST ) {
@@ -2668,6 +2667,7 @@ static void enable_link_hdmi(struct pipe_ctx *pipe_ctx)bool is_over_340mhz = false;bool is_vga_mode = (stream->timing.h_addressable ==640 ) && (stream->timing.v_addressable ==480 ); +struct dc *dc = pipe_ctx->stream->ctx->dc;if (stream->phy_pix_clk ==0 ) stream->phy_pix_clk = stream->timing.pix_clk_100hz /10 ;
@@ -2707,11 +2707,12 @@ static void enable_link_hdmi(struct pipe_ctx *pipe_ctx)if (stream->timing.pixel_encoding ==PIXEL_ENCODING_YCBCR422 ) display_color_depth =COLOR_DEPTH_888 ; - link->link_enc->funcs->enable_tmds_output ( - link->link_enc, + dc->hwss.enable_tmds_link_output ( + link, + &pipe_ctx->link_res, + pipe_ctx->stream->signal, pipe_ctx->clock_source->id, display_color_depth, - pipe_ctx->stream->signal, stream->phy_pix_clk);if (dc_is_hdmi_signal (pipe_ctx->stream->signal))
@@ -2722,15 +2723,16 @@ static void enable_link_lvds(struct pipe_ctx *pipe_ctx) {struct dc_stream_state *stream = pipe_ctx->stream;struct dc_link *link = stream->link; +struct dc *dc = stream->ctx->dc;if (stream->phy_pix_clk ==0 ) stream->phy_pix_clk = stream->timing.pix_clk_100hz /10 ;memset (&stream->link->cur_link_settings,0 ,sizeof (struct dc_link_settings )); - - link->link_enc->funcs->enable_lvds_output ( - link->link_enc, + dc->hwss.enable_lvds_link_output ( + link, + &pipe_ctx->link_res, pipe_ctx->clock_source->id, stream->phy_pix_clk);
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +7 -89
121 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dc_link.h +1 -1
@@ -244,7 +244,7 @@ struct dc_link {struct gpio *hpd_gpio;enum dc_link_fec_state fec_state;struct dc_panel_config panel_config; -enum phy_state phy_state; +struct phy_state phy_state; };const struct dc_link_status *dc_link_get_status (const struct dc_link *dc_link);
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +131 -6
167 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.h +19 -1
@@ -90,6 +90,24 @@ bool dce110_set_backlight_level(struct pipe_ctx *pipe_ctx, uint32_t frame_ramp);void dce110_set_abm_immediate_disable (struct pipe_ctx *pipe_ctx);void dce110_set_pipe (struct pipe_ctx *pipe_ctx); - +void dce110_disable_link_output (struct dc_link *link, +const struct link_resource *link_res, +enum signal_type signal); +void dce110_enable_lvds_link_output (struct dc_link *link, +const struct link_resource *link_res, +enum clock_source_id clock_source, +uint32_t pixel_clock); +void dce110_enable_tmds_link_output (struct dc_link *link, +const struct link_resource *link_res, +enum signal_type signal, +enum clock_source_id clock_source, +enum dc_color_depth color_depth, +uint32_t pixel_clock); +void dce110_enable_dp_link_output ( +struct dc_link *link, +const struct link_resource *link_res, +enum signal_type signal, +enum clock_source_id clock_source, +const struct dc_link_settings *link_settings);#endif /* __DC_HWSS_DCE110_H__ */
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +9 -0
@@ -899,6 +899,14 @@ enum dc_status dcn10_enable_stream_timing(return DC_ERROR_UNEXPECTED ; } +if (dc_is_hdmi_tmds_signal (stream->signal)) { + stream->link->phy_state.symclk_ref_cnts.otg =1 ; +if (stream->link->phy_state.symclk_state ==SYMCLK_OFF_TX_OFF ) + stream->link->phy_state.symclk_state =SYMCLK_ON_TX_OFF ; +else + stream->link->phy_state.symclk_state =SYMCLK_ON_TX_ON ; + } + pipe_ctx->stream_res.tg->funcs->program_timing( pipe_ctx->stream_res.tg, &stream->timing,
@@ -1017,6 +1025,7 @@ static void dcn10_reset_back_end_for_pipe(if (pipe_ctx->stream_res.tg->funcs->set_drr) pipe_ctx->stream_res.tg->funcs->set_drr ( pipe_ctx->stream_res.tg,NULL ); + pipe_ctx->stream->link->phy_state.symclk_ref_cnts.otg =0 ; }for (i =0 ; i < dc->res_pool->pipe_count; i++)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_init.c +4 -0
@@ -82,6 +82,10 @@ static const struct hw_sequencer_funcs dcn10_funcs = { .set_backlight_level = dce110_set_backlight_level, .set_abm_immediate_disable = dce110_set_abm_immediate_disable, .set_pipe = dce110_set_pipe, + .enable_lvds_link_output = dce110_enable_lvds_link_output, + .enable_tmds_link_output = dce110_enable_tmds_link_output, + .enable_dp_link_output = dce110_enable_dp_link_output, + .disable_link_output = dce110_disable_link_output, .get_dcc_en_bits = dcn10_get_dcc_en_bits, .update_visual_confirm_color = dcn10_update_visual_confirm_color, };
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +24 -8
@@ -706,6 +706,14 @@ enum dc_status dcn20_enable_stream_timing(return DC_ERROR_UNEXPECTED ; } +if (dc_is_hdmi_tmds_signal (stream->signal)) { + stream->link->phy_state.symclk_ref_cnts.otg =1 ; +if (stream->link->phy_state.symclk_state ==SYMCLK_OFF_TX_OFF ) + stream->link->phy_state.symclk_state =SYMCLK_ON_TX_OFF ; +else + stream->link->phy_state.symclk_state =SYMCLK_ON_TX_ON ; + } +if (dc->hwseq->funcs.PLAT_58856_wa && (!dc_is_dp_signal (stream->signal))) dc->hwseq->funcs.PLAT_58856_wa (context, pipe_ctx);
@@ -2349,7 +2357,9 @@ static void dcn20_reset_back_end_for_pipe( struct dc_state *context) {int i; -struct dc_link *link; +struct dc_link *link = pipe_ctx->stream->link; +const struct link_hwss *link_hwss =get_link_hwss (link, &pipe_ctx->link_res); +DC_LOGGER_INIT (dc->ctx->logger);if (pipe_ctx->stream_res.stream_enc ==NULL ) { pipe_ctx->stream =NULL ;
@@ -2357,19 +2367,15 @@ static void dcn20_reset_back_end_for_pipe( }if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { - link = pipe_ctx->stream->link;/* DPMS may already disable or */ /* dpms_off status is incorrect due to fastboot * feature. When system resume from S4 with second * screen only, the dpms_off would be true but * VBIOS lit up eDP, so check link status too. */ -if (!pipe_ctx->stream->dpms_off || link->link_status.link_active) { -if (dc->hwss.update_phy_state) - dc->hwss.update_phy_state (dc->current_state, pipe_ctx,TX_OFF_SYMCLK_OFF ); -else -core_link_disable_stream (pipe_ctx); - }else if (pipe_ctx->stream_res.audio) +if (!pipe_ctx->stream->dpms_off || link->link_status.link_active) +core_link_disable_stream (pipe_ctx); +else if (pipe_ctx->stream_res.audio) dc->hwss.disable_audio_stream (pipe_ctx);/* free acquired resources */
@@ -2409,6 +2415,16 @@ static void dcn20_reset_back_end_for_pipe(if (pipe_ctx->stream_res.tg->funcs->set_drr) pipe_ctx->stream_res.tg->funcs->set_drr ( pipe_ctx->stream_res.tg,NULL ); +/* TODO - convert symclk_ref_cnts for otg to a bit map to solve +* the case where the same symclk is shared across multiple otg +* instances +*/ + link->phy_state.symclk_ref_cnts.otg =0 ; +if (link->phy_state.symclk_state ==SYMCLK_ON_TX_OFF ) { + link_hwss->disable_link_output (link, + &pipe_ctx->link_res, pipe_ctx->stream->signal); + link->phy_state.symclk_state =SYMCLK_OFF_TX_OFF ; + } }for (i =0 ; i < dc->res_pool->pipe_count; i++)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_init.c +4 -0
@@ -96,6 +96,10 @@ static const struct hw_sequencer_funcs dcn20_funcs = {#ifndef TRIM_FSFT .optimize_timing_for_fsft = dcn20_optimize_timing_for_fsft, #endif + .enable_lvds_link_output = dce110_enable_lvds_link_output, + .enable_tmds_link_output = dce110_enable_tmds_link_output, + .enable_dp_link_output = dce110_enable_dp_link_output, + .disable_link_output = dce110_disable_link_output, .set_disp_pattern_generator = dcn20_set_disp_pattern_generator, .get_dcc_en_bits = dcn10_get_dcc_en_bits, .update_visual_confirm_color = dcn20_update_visual_confirm_color
drivers/gpu/drm/amd/display/dc/dcn201/dcn201_init.c +4 -0
@@ -86,6 +86,10 @@ static const struct hw_sequencer_funcs dcn201_funcs = { .set_backlight_level = dce110_set_backlight_level, .set_abm_immediate_disable = dce110_set_abm_immediate_disable, .set_pipe = dce110_set_pipe, + .enable_lvds_link_output = dce110_enable_lvds_link_output, + .enable_tmds_link_output = dce110_enable_tmds_link_output, + .enable_dp_link_output = dce110_enable_dp_link_output, + .disable_link_output = dce110_disable_link_output, .set_disp_pattern_generator = dcn20_set_disp_pattern_generator, .update_visual_confirm_color = dcn20_update_visual_confirm_color, };
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_init.c +4 -0
@@ -99,6 +99,10 @@ static const struct hw_sequencer_funcs dcn21_funcs = { #ifndef TRIM_FSFT .optimize_timing_for_fsft = dcn20_optimize_timing_for_fsft, #endif + .enable_lvds_link_output = dce110_enable_lvds_link_output, + .enable_tmds_link_output = dce110_enable_tmds_link_output, + .enable_dp_link_output = dce110_enable_dp_link_output, + .disable_link_output = dce110_disable_link_output, .is_abm_supported = dcn21_is_abm_supported, .set_disp_pattern_generator = dcn20_set_disp_pattern_generator, .get_dcc_en_bits = dcn10_get_dcc_en_bits,
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_init.c +4 -0
@@ -100,6 +100,10 @@ static const struct hw_sequencer_funcs dcn30_funcs = { .set_abm_immediate_disable = dcn21_set_abm_immediate_disable, .hardware_release = dcn30_hardware_release, .set_pipe = dcn21_set_pipe, + .enable_lvds_link_output = dce110_enable_lvds_link_output, + .enable_tmds_link_output = dce110_enable_tmds_link_output, + .enable_dp_link_output = dce110_enable_dp_link_output, + .disable_link_output = dce110_disable_link_output, .set_disp_pattern_generator = dcn30_set_disp_pattern_generator, .get_dcc_en_bits = dcn10_get_dcc_en_bits, .update_visual_confirm_color = dcn20_update_visual_confirm_color,
drivers/gpu/drm/amd/display/dc/dcn301/dcn301_init.c +4 -0
@@ -99,6 +99,10 @@ static const struct hw_sequencer_funcs dcn301_funcs = { .set_backlight_level = dcn21_set_backlight_level, .set_abm_immediate_disable = dcn21_set_abm_immediate_disable, .set_pipe = dcn21_set_pipe, + .enable_lvds_link_output = dce110_enable_lvds_link_output, + .enable_tmds_link_output = dce110_enable_tmds_link_output, + .enable_dp_link_output = dce110_enable_dp_link_output, + .disable_link_output = dce110_disable_link_output, .set_disp_pattern_generator = dcn30_set_disp_pattern_generator, .get_dcc_en_bits = dcn10_get_dcc_en_bits, .optimize_pwr_state = dcn21_optimize_pwr_state,
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c +4 -7
@@ -535,11 +535,11 @@ static void dcn31_reset_back_end_for_pipe( pipe_ctx->stream_res.tg, OPTC_DSC_DISABLED, 0, 0); pipe_ctx->stream_res.tg->funcs->disable_crtc (pipe_ctx->stream_res.tg); - pipe_ctx->stream_res.tg->funcs->enable_optc_clock (pipe_ctx->stream_res.tg, false);if (pipe_ctx->stream_res.tg->funcs->set_odm_bypass) pipe_ctx->stream_res.tg->funcs->set_odm_bypass ( pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing); + pipe_ctx->stream->link->phy_state.symclk_ref_cnts.otg =0 ;if (pipe_ctx->stream_res.tg->funcs->set_drr) pipe_ctx->stream_res.tg->funcs->set_drr(
@@ -553,12 +553,9 @@ static void dcn31_reset_back_end_for_pipe(* screen only, the dpms_off would be true but * VBIOS lit up eDP, so check link status too. */ -if (!pipe_ctx->stream->dpms_off || link->link_status.link_active) { -if (dc->hwss.update_phy_state) - dc->hwss.update_phy_state (dc->current_state, pipe_ctx,TX_OFF_SYMCLK_OFF ); -else -core_link_disable_stream (pipe_ctx); - }else if (pipe_ctx->stream_res.audio) +if (!pipe_ctx->stream->dpms_off || link->link_status.link_active) +core_link_disable_stream (pipe_ctx); +else if (pipe_ctx->stream_res.audio) dc->hwss.disable_audio_stream (pipe_ctx);/* free acquired resources */
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_init.c +4 -0
@@ -100,6 +100,10 @@ static const struct hw_sequencer_funcs dcn31_funcs = { .set_backlight_level = dcn21_set_backlight_level, .set_abm_immediate_disable = dcn21_set_abm_immediate_disable, .set_pipe = dcn21_set_pipe, + .enable_lvds_link_output = dce110_enable_lvds_link_output, + .enable_tmds_link_output = dce110_enable_tmds_link_output, + .enable_dp_link_output = dce110_enable_dp_link_output, + .disable_link_output = dce110_disable_link_output, .z10_restore = dcn31_z10_restore, .z10_save_init = dcn31_z10_save_init, .set_disp_pattern_generator = dcn30_set_disp_pattern_generator,
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_init.c +4 -0
@@ -102,6 +102,10 @@ static const struct hw_sequencer_funcs dcn314_funcs = { .set_backlight_level = dcn21_set_backlight_level, .set_abm_immediate_disable = dcn21_set_abm_immediate_disable, .set_pipe = dcn21_set_pipe, + .enable_lvds_link_output = dce110_enable_lvds_link_output, + .enable_tmds_link_output = dce110_enable_tmds_link_output, + .enable_dp_link_output = dce110_enable_dp_link_output, + .disable_link_output = dce110_disable_link_output, .z10_restore = dcn31_z10_restore, .z10_save_init = dcn31_z10_save_init, .set_disp_pattern_generator = dcn30_set_disp_pattern_generator,
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +61 -22
98 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.h +3 -2
@@ -84,8 +84,9 @@ void dcn32_unblank_stream(struct pipe_ctx *pipe_ctx,bool dcn32_is_dp_dig_pixel_rate_div_policy (struct pipe_ctx *pipe_ctx); -void dcn32_update_phy_state (struct dc_state *state,struct pipe_ctx *pipe_ctx, -enum phy_state target_state); +void dcn32_disable_link_output (struct dc_link *link, +const struct link_resource *link_res, +enum signal_type signal); void dcn32_update_phantom_vp_position(struct dc *dc, struct dc_state *context,
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c +4 -1
@@ -99,12 +99,15 @@ static const struct hw_sequencer_funcs dcn32_funcs = { .set_abm_immediate_disable = dcn21_set_abm_immediate_disable, .hardware_release = dcn30_hardware_release, .set_pipe = dcn21_set_pipe, + .enable_lvds_link_output = dce110_enable_lvds_link_output, + .enable_tmds_link_output = dce110_enable_tmds_link_output, + .enable_dp_link_output = dce110_enable_dp_link_output, + .disable_link_output = dcn32_disable_link_output, .set_disp_pattern_generator = dcn30_set_disp_pattern_generator, .get_dcc_en_bits = dcn10_get_dcc_en_bits, .commit_subvp_config = dcn32_commit_subvp_config, .subvp_pipe_control_lock = dcn32_subvp_pipe_control_lock, .update_visual_confirm_color = dcn20_update_visual_confirm_color, - .update_phy_state = dcn32_update_phy_state, .update_phantom_vp_position = dcn32_update_phantom_vp_position, };
drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h +12 -4
@@ -268,10 +268,18 @@ enum dc_lut_mode { LUT_RAM_B }; -enum phy_state { -TX_OFF_SYMCLK_OFF , -TX_ON_SYMCLK_ON , -TX_OFF_SYMCLK_ON +enum symclk_state { +SYMCLK_OFF_TX_OFF , +SYMCLK_ON_TX_ON , +SYMCLK_ON_TX_OFF , +}; + +struct phy_state { +struct { +uint8_t otg :1 ; +uint8_t reserved :7 ; + } symclk_ref_cnts; +enum symclk_state symclk_state; };/**
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +20 -3
@@ -48,6 +48,7 @@ struct dc_phy_addr_space_config;struct dc_virtual_addr_space_config ;struct dpp ;struct dce_hwseq ; +struct link_resource ;struct hw_sequencer_funcs {void (*hardware_release)(struct dc *dc);
@@ -218,6 +219,25 @@ struct hw_sequencer_funcs {void (*set_pipe)(struct pipe_ctx *pipe_ctx); +void (*enable_dp_link_output)(struct dc_link *link, +const struct link_resource *link_res, +enum signal_type signal, +enum clock_source_id clock_source, +const struct dc_link_settings *link_settings); +void (*enable_tmds_link_output)(struct dc_link *link, +const struct link_resource *link_res, +enum signal_type signal, +enum clock_source_id clock_source, +enum dc_color_depth color_depth, +uint32_t pixel_clock); +void (*enable_lvds_link_output)(struct dc_link *link, +const struct link_resource *link_res, +enum clock_source_id clock_source, +uint32_t pixel_clock); +void (*disable_link_output)(struct dc_link *link, +const struct link_resource *link_res, +enum signal_type signal); +void (*get_dcc_en_bits)(struct dc *dc,int *dcc_en_bits);/* Idle Optimization Related */
@@ -245,9 +265,6 @@ struct hw_sequencer_funcs {struct tg_color *color, int mpcc_id); -void (*update_phy_state)(struct dc_state *state,struct pipe_ctx *pipe_ctx,enum phy_state target_state); - -void (*update_phantom_vp_position)(struct dc *dc,struct dc_state *context,struct pipe_ctx *phantom_pipe);
drivers/gpu/drm/amd/display/dc/inc/link_hwss.h +3 -3
@@ -55,9 +55,6 @@ struct link_hwss_ext {enum signal_type signal, enum clock_source_id clock_source, const struct dc_link_settings *link_settings); -void (*disable_dp_link_output)(struct dc_link *link, -const struct link_resource *link_res, -enum signal_type signal);void (*set_dp_link_test_pattern)(struct dc_link *link,const struct link_resource *link_res,struct encoder_set_dp_phy_pattern_param *tp_params);
@@ -79,6 +76,9 @@ struct link_hwss {void (*setup_stream_encoder)(struct pipe_ctx *pipe_ctx);void (*reset_stream_encoder)(struct pipe_ctx *pipe_ctx);void (*setup_stream_attribute)(struct pipe_ctx *pipe_ctx); +void (*disable_link_output)(struct dc_link *link, +const struct link_resource *link_res, + enum signal_type signal); };#endif /* __DC_LINK_HWSS_H__ */
drivers/gpu/drm/amd/display/dc/link/link_hwss_dio.c +2 -2
@@ -130,7 +130,7 @@ void enable_dio_dp_link_output(struct dc_link *link,dp_source_sequence_trace (link,DPCD_SOURCE_SEQ_AFTER_ENABLE_LINK_PHY ); } -void disable_dio_dp_link_output (struct dc_link *link, +void disable_dio_link_output (struct dc_link *link,const struct link_resource *link_res,enum signal_type signal) {
@@ -174,10 +174,10 @@ static const struct link_hwss dio_link_hwss = { .setup_stream_encoder = setup_dio_stream_encoder, .reset_stream_encoder = reset_dio_stream_encoder, .setup_stream_attribute = setup_dio_stream_attribute, + .disable_link_output = disable_dio_link_output, .ext = { .set_throttled_vcp_size = set_dio_throttled_vcp_size, .enable_dp_link_output = enable_dio_dp_link_output, - .disable_dp_link_output = disable_dio_dp_link_output, .set_dp_link_test_pattern = set_dio_dp_link_test_pattern, .set_dp_lane_settings = set_dio_dp_lane_settings, .update_stream_allocation_table = update_dio_stream_allocation_table,
drivers/gpu/drm/amd/display/dc/link/link_hwss_dio.h +1 -1
@@ -40,7 +40,7 @@ void enable_dio_dp_link_output(struct dc_link *link,enum signal_type signal, enum clock_source_id clock_source, const struct dc_link_settings *link_settings); -void disable_dio_dp_link_output (struct dc_link *link, +void disable_dio_link_output (struct dc_link *link,const struct link_resource *link_res,enum signal_type signal); void set_dio_dp_link_test_pattern(struct dc_link *link,
drivers/gpu/drm/amd/display/dc/link/link_hwss_dpia.c +1 -1
@@ -56,10 +56,10 @@ static const struct link_hwss dpia_link_hwss = { .setup_stream_encoder = setup_dio_stream_encoder, .reset_stream_encoder = reset_dio_stream_encoder, .setup_stream_attribute = setup_dio_stream_attribute, + .disable_link_output = disable_dio_link_output, .ext = { .set_throttled_vcp_size = set_dio_throttled_vcp_size, .enable_dp_link_output = enable_dio_dp_link_output, - .disable_dp_link_output = disable_dio_dp_link_output, .set_dp_link_test_pattern = set_dio_dp_link_test_pattern, .set_dp_lane_settings = set_dio_dp_lane_settings, .update_stream_allocation_table = update_dpia_stream_allocation_table,
drivers/gpu/drm/amd/display/dc/link/link_hwss_hpo_dp.c +1 -1
@@ -266,11 +266,11 @@ static const struct link_hwss hpo_dp_link_hwss = { .setup_stream_encoder = setup_hpo_dp_stream_encoder, .reset_stream_encoder = reset_hpo_dp_stream_encoder, .setup_stream_attribute = setup_hpo_dp_stream_attribute, + .disable_link_output = disable_hpo_dp_link_output, .ext = { .set_throttled_vcp_size = set_hpo_dp_throttled_vcp_size, .set_hblank_min_symbol_width = set_hpo_dp_hblank_min_symbol_width, .enable_dp_link_output = enable_hpo_dp_link_output, - .disable_dp_link_output = disable_hpo_dp_link_output, .set_dp_link_test_pattern = set_hpo_dp_link_test_pattern, .set_dp_lane_settings = set_hpo_dp_lane_settings, .update_stream_allocation_table = update_hpo_dp_stream_allocation_table,
drivers/gpu/drm/amd/display/dc/virtual/virtual_link_hwss.c +8 -0
@@ -36,10 +36,18 @@ void virtual_setup_stream_attribute(struct pipe_ctx *pipe_ctx)void virtual_reset_stream_encoder (struct pipe_ctx *pipe_ctx) { } + +void virtual_disable_link_output (struct dc_link *link, +const struct link_resource *link_res, +enum signal_type signal) +{ +} +static const struct link_hwss virtual_link_hwss = { .setup_stream_encoder = virtual_setup_stream_encoder, .reset_stream_encoder = virtual_reset_stream_encoder, .setup_stream_attribute = virtual_setup_stream_attribute, + .disable_link_output = virtual_disable_link_output, };const struct link_hwss *get_virtual_link_hwss (void )
Signature · 1 line
2.37.3
PATCH v2 9/47 drm/amd/display: Assume an LTTPR is always present on fixed_vs links
In reply to Wayne LinFrom: Michael Strauss <[email protected]>
[WHY]
LTTPRs can in very rare instsances fail to increment DPCD LTTPR count. This results in aux-i LTTPR requests to be sent to the wrong DPCD address, which causes link training failure.
[HOW]
Override internal repeater count if fixed_vs flag is set for a given link
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +8 -0
@@ -5133,6 +5133,14 @@ bool dp_retrieve_lttpr_cap(struct dc_link *link) lttpr_dpcd_data[DP_PHY_REPEATER_128B132B_RATES -DP_LT_TUNABLE_PHY_REPEATER_FIELD_DATA_STRUCTURE_REV ]; +/* If this chip cap is set, at least one retimer must exist in the chain +* Override count to 1 if we receive a known bad count (0 or an invalid value) */ +if (link->chip_caps &EXT_DISPLAY_PATH_CAPS__DP_FIXED_VS_EN && + (dp_convert_to_count (link->dpcd_caps.lttpr_caps.phy_repeater_cnt) ==0 )) { +ASSERT (0 ); + link->dpcd_caps.lttpr_caps.phy_repeater_cnt =0x80 ; + } +/* Attempt to train in LTTPR transparent mode if repeater count exceeds 8. */ is_lttpr_present = (link->dpcd_caps.lttpr_caps.max_lane_count > 0 && link->dpcd_caps.lttpr_caps.max_lane_count <= 4 &&
Signature · 1 line
2.37.3
PATCH v2 7/47 drm/amd/display: Fix double cursor on non-video RGB MPO
In reply to Wayne LinFrom: Leo Li <[email protected]>
[Why]
DC makes use of layer_index (zpos) when picking the HW plane to enable HW cursor on. However, some compositors will not attach zpos information to each DRM plane. Consequently, in amdgpu, we default layer_index to 0 and do not update it.
This causes said DC logic to enable HW cursor on all planes of the same layer_index, which manifests as a double cursor issue if one of the planes is scaled (and hence scaling the cursor as well).
[How]
Use DRM core helpers to calculate a normalized_zpos value for each drm_plane_state under each crtc, within the atomic state.
This helper will first consider existing zpos values, and if identical/unset, fallback to plane ID ordering.
The normalized_zpos is then passed to dc_plane_info during atomic check for later use by the cursor logic.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +10 -2
@@ -4756,7 +4756,7 @@ fill_dc_plane_info_and_addr(struct amdgpu_device *adev, plane_info->visible = true; plane_info->stereo_format =PLANE_STEREO_FORMAT_NONE ; - plane_info->layer_index =0 ; + plane_info->layer_index = plane_state->normalized_zpos; ret =fill_plane_color_attributes (plane_state, plane_info->format, &plane_info->color_space);
@@ -4824,7 +4824,7 @@ static int fill_dc_plane_attributes(struct amdgpu_device *adev, dc_plane_state->global_alpha = plane_info.global_alpha; dc_plane_state->global_alpha_value = plane_info.global_alpha_value; dc_plane_state->dcc = plane_info.dcc; - dc_plane_state->layer_index = plane_info.layer_index;// Always returns 0 + dc_plane_state->layer_index = plane_info.layer_index; dc_plane_state->flip_int_enabled = true;/*
@@ -9481,6 +9481,14 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, } } +/* +* DC consults the zpos (layer_index in DC terminology) to determine the +* hw plane on which to enable the hw cursor (see +* `dcn10_can_pipe_disable_cursor`). By now, all modified planes are in +* atomic state, so call drm helper to normalize zpos. +*/ +drm_atomic_normalize_zpos (dev, state); +/* Remove exiting planes if they are modified */ for_each_oldnew_plane_in_state_reverse (state, plane, old_plane_state, new_plane_state, i) { ret = dm_update_plane_state(dc, state, plane,
Signature · 1 line
2.37.3
PATCH v2 11/47 drm/amd/display: support proper mst payload removal when link is not in mst mode in dc
In reply to Wayne LinFrom: Wenjing Liu <[email protected]>
[why]
When user unplugs mst hubs, the current code will forcefully zero entire mst payload allocation table structure stored in link before we deallocate actual payload when disabling stream.
During the first disable stream sequence, we will use current mst payload allocation table to determine if link should be turned off. Because we zero out it before we are disabling stream, the payload allocation table stored in link doesn't represent the actual allocation status, so we turn off link at the first disable stream without waiting until all streams' payloads have been deallocated. This avoilates the designed deallocation sequence and caused system hang in DP2 scenario.
[how]
Remove payload during deallocation and never zero payload allocation structure without actually deallocating payload.
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 70 +++++++++++++------ 1 file changed, 49 insertions(+), 21 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +49 -21
@@ -848,20 +848,13 @@ static bool discover_dp_mst_topology(struct dc_link *link, enum dc_detect_reasonbool reset_cur_dp_mst_topology (struct dc_link *link) { -bool result = false;DC_LOGGER_INIT (link->ctx->logger);LINK_INFO ("link=%d, mst branch is now Disconnected\n" , link->link_index);revert_dpia_mst_dsc_always_on_wa (link); - result =dm_helpers_dp_mst_stop_top_mgr (link->ctx, link); - - link->mst_stream_alloc_table.stream_count =0 ; -memset (link->mst_stream_alloc_table.stream_allocations, -0 , -sizeof (link->mst_stream_alloc_table.stream_allocations)); -return result; +return dm_helpers_dp_mst_stop_top_mgr (link->ctx, link); } static bool should_prepare_phy_clocks_for_link_verification(const struct dc *dc,
@@ -3570,6 +3563,35 @@ static void update_mst_stream_alloc_table( work_table[i]; } +static void remove_stream_from_alloc_table ( +struct dc_link *link, +struct stream_encoder *dio_stream_enc, +struct hpo_dp_stream_encoder *hpo_dp_stream_enc) +{ +int i =0 ; +struct link_mst_stream_allocation_table *table = + &link->mst_stream_alloc_table; + +if (hpo_dp_stream_enc) { +for (; i < table->stream_count; i++) +if (hpo_dp_stream_enc == table->stream_allocations[i].hpo_dp_stream_enc) +break ; + }else { +for (; i < table->stream_count; i++) +if (dio_stream_enc == table->stream_allocations[i].stream_enc) +break ; + } + +if (i < table->stream_count) { + i++; +for (; i < table->stream_count; i++) + table->stream_allocations[i-1 ] = table->stream_allocations[i]; +memset (&table->stream_allocations[table->stream_count-1 ],0 , +sizeof (struct link_mst_stream_allocation )); + table->stream_count--; + } +} +static void dc_log_vcp_x_y (const struct dc_link *link,struct fixed31_32 avg_time_slots_per_mtp) {const uint32_t VCP_Y_PRECISION =1000 ;
@@ -3987,26 +4009,32 @@ static enum dc_status deallocate_mst_payload(struct pipe_ctx *pipe_ctx) &empty_link_settings, avg_time_slots_per_mtp); -/* TODO: which component is responsible for remove payload table? */ if (mst_mode) { +/* when link is in mst mode, reply on mst manager to remove +* payload +*/ if (dm_helpers_dp_mst_write_payload_allocation_table ( stream->ctx, stream, &proposed_table, - false)) { + false))update_mst_stream_alloc_table ( - link, - pipe_ctx->stream_res.stream_enc, - pipe_ctx->stream_res.hpo_dp_stream_enc, - &proposed_table); - } -else { -DC_LOG_WARNING ("Failed to update" -"MST allocation table for" -"pipe idx:%d\n" , - pipe_ctx->pipe_idx); - } + link, + pipe_ctx->stream_res.stream_enc, + pipe_ctx->stream_res.hpo_dp_stream_enc, + &proposed_table); +else +DC_LOG_WARNING ("Failed to update" +"MST allocation table for" +"pipe idx:%d\n" , + pipe_ctx->pipe_idx); + }else { +/* when link is no longer in mst mode (mst hub unplugged), +* remove payload with default dc logic +*/ +remove_stream_from_alloc_table (link, pipe_ctx->stream_res.stream_enc, + pipe_ctx->stream_res.hpo_dp_stream_enc); } DC_LOG_MST("%s"
Signature · 1 line
2.37.3
PATCH v2 12/47 drm/amd/display: For ODM seamless transition require AUTO mode
In reply to Wayne LinFrom: Alvin Lee <[email protected]>
[Why & How]
ODM seamless transitions require DIV_MODE_AUTO. However, DIV_MODE_AUTO only works when all the horizontal timing params are divisible by the ODM combine factor. Therefore, disable the ODM 2:1 policy when the horizontal timing params are not divisible by 2.
--- .../gpu/drm/amd/display/dc/core/dc_resource.c | 22 +++++++++++++++++++ .../drm/amd/display/dc/dcn32/dcn32_resource.c | 3 ++- drivers/gpu/drm/amd/display/dc/inc/resource.h | 2 ++ 3 files changed, 26 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +22 -0
@@ -3645,3 +3645,25 @@ const struct link_hwss *get_link_hwss(const struct dc_link *link,else return get_virtual_link_hwss (); } + +bool is_h_timing_divisible_by_2 (struct dc_stream_state *stream) +{ +bool divisible = false; +uint16_t h_blank_start =0 ; +uint16_t h_blank_end =0 ; + +if (stream) { + h_blank_start = stream->timing.h_total - stream->timing.h_front_porch; + h_blank_end = h_blank_start - stream->timing.h_addressable; + +/* HTOTAL, Hblank start/end, and Hsync start/end all must be +* divisible by 2 in order for the horizontal timing params +* to be considered divisible by 2. Hsync start is always 0. +*/ + divisible = (stream->timing.h_total %2 ==0 ) && + (h_blank_start %2 ==0 ) && + (h_blank_end %2 ==0 ) && + (stream->timing.h_sync_width %2 ==0 ); + } +return divisible; +}
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +2 -1
@@ -1871,7 +1871,8 @@ int dcn32_populate_dml_pipes_from_context( timing = &pipe->stream->timing; pipes[pipe_cnt].pipe.dest.odm_combine_policy = dm_odm_combine_policy_dal; -if (context->stream_count ==1 && !dc_is_hdmi_signal (res_ctx->pipe_ctx[i].stream->signal)) { +if (context->stream_count ==1 && !dc_is_hdmi_signal (res_ctx->pipe_ctx[i].stream->signal) && +is_h_timing_divisible_by_2 (res_ctx->pipe_ctx[i].stream)) {if (dc->debug.enable_single_display_2to1_odm_policy) {if (!((plane_count >2 ) && pipe->top_pipe)) pipes[pipe_cnt].pipe.dest.odm_combine_policy = dm_odm_combine_policy_2to1;
drivers/gpu/drm/amd/display/dc/inc/resource.h +2 -0
@@ -224,4 +224,6 @@ uint8_t resource_transmitter_to_phy_idx(const struct dc *dc, enum transmitter trconst struct link_hwss *get_link_hwss (const struct dc_link *link,const struct link_resource *link_res); +bool is_h_timing_divisible_by_2 (struct dc_stream_state *stream); +#endif /* DRIVERS_GPU_DRM_AMD_DC_DEV_DC_INC_RESOURCE_H_ */
Signature · 1 line
2.37.3
PATCH v2 13/47 drm/amd/display: Add debug option for allocating extra way for cursor
In reply to Wayne LinFrom: Alvin Lee <[email protected]>
[Why and How]
- Add a debug option for allocating extra way for cursor
- Remove usage of cache_cursor_addr since it's not gaurenteed to be populated
- Include cursor size in MALL calculation if it exceeds the DCN cursor buffer size (and don't need extra way for cursor)
--- drivers/gpu/drm/amd/display/dc/dc.h | 1 + drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 10 ++++++---- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c | 1 + .../gpu/drm/amd/display/dc/dcn321/dcn321_resource.c | 1 + 4 files changed, 9 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -832,6 +832,7 @@ struct dc_debug_options {bool force_subvp_mclk_switch;bool allow_sw_cursor_fallback;unsigned int force_subvp_num_ways; +bool alloc_extra_way_for_cursor;bool force_usr_allow;/* uses value at boot and disables switch */ bool disable_dtb_ref_clk_switch;
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +6 -4
@@ -304,7 +304,8 @@ static uint32_t dcn32_calculate_cab_allocation(struct dc *dc, struct dc_state *c* using the max for calculation */ if (hubp->curs_attr.width >0 ) { - cursor_size = hubp->curs_attr.width * hubp->curs_attr.height; +// Round cursor width to next multiple of 64 + cursor_size = (((hubp->curs_attr.width +63 ) /64 ) *64 ) * hubp->curs_attr.height;break ; } }
@@ -325,7 +326,8 @@ static uint32_t dcn32_calculate_cab_allocation(struct dc *dc, struct dc_state *cbreak ; } -if (stream->cursor_position.enable && plane->address.grph.cursor_cache_addr.quad_part) { +if (stream->cursor_position.enable && !dc->debug.alloc_extra_way_for_cursor && + cursor_size >16384 ) { cache_lines_used +=dcn32_cache_lines_for_surface (dc, cursor_size, plane->address.grph.cursor_cache_addr.quad_part); }
@@ -345,8 +347,8 @@ static uint32_t dcn32_calculate_cab_allocation(struct dc *dc, struct dc_state *c plane = ctx->stream_status[i].plane_states[j];if (stream->cursor_position.enable && plane && - !plane->address.grph.cursor_cache_addr.quad_part && - cursor_size >16384 ) { + dc->debug.alloc_extra_way_for_cursor && + cursor_size >16384 ) {/* Cursor caching is not supported since it won't be on the same line. * So we need an extra line to accommodate it. With large cursors and a single 4k monitor * this case triggers corruption. If we're at the edge, then dont trigger display refresh
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +1 -0
@@ -720,6 +720,7 @@ static const struct dc_debug_options debug_defaults_drv = { .enable_single_display_2to1_odm_policy = true, .enable_dp_dig_pixel_rate_div_policy = 1, .allow_sw_cursor_fallback = false, + .alloc_extra_way_for_cursor = true, };static const struct dc_debug_options debug_defaults_diags = {
drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c +1 -0
@@ -720,6 +720,7 @@ static const struct dc_debug_options debug_defaults_drv = { .enable_single_display_2to1_odm_policy = true, .enable_dp_dig_pixel_rate_div_policy = 1, .allow_sw_cursor_fallback = false, + .alloc_extra_way_for_cursor = true, };static const struct dc_debug_options debug_defaults_diags = {
Signature · 1 line
2.37.3
PATCH v2 14/47 drm/amd/display: SubVP pipe split case
In reply to Wayne LinFrom: Alvin Lee <[email protected]>
[Why and How]
For SubVP pipe split case, pass in split index for main and phantom pipes to ensure that the P-State sequence will force P-State for all required pipes.
--- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 29 ++++++++++++++++++- .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 11 ++++--- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 18 ++++++++---- 3 files changed, 47 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +28 -1
@@ -674,12 +674,32 @@ static void populate_subvp_cmd_pipe_info(struct dc *dc, pipe_data->pipe_config.subvp_data.processing_delay_lines =div64_u64 (((uint64_t )(dc->caps.subvp_fw_processing_delay_us) * ((uint64_t )phantom_timing->pix_clk_100hz *100 ) + ((uint64_t )phantom_timing->h_total *1000000 -1 )), ((uint64_t )phantom_timing->h_total *1000000 )); + +/* TODO: Uncomment once FW headers are promoted +if (subvp_pipe->bottom_pipe) { +pipe_data->pipe_config.subvp_data.main_split_pipe_index = subvp_pipe->bottom_pipe->pipe_idx; +} else if (subvp_pipe->next_odm_pipe) { +pipe_data->pipe_config.subvp_data.main_split_pipe_index = subvp_pipe->next_odm_pipe->pipe_idx; +} else { +pipe_data->pipe_config.subvp_data.main_split_pipe_index = 0; +} +*/ +// Find phantom pipe index based on phantom stream for (j =0 ; j < dc->res_pool->pipe_count; j++) {struct pipe_ctx *phantom_pipe = &context->res_ctx.pipe_ctx[j];if (phantom_pipe->stream == subvp_pipe->stream->mall_stream_config.paired_stream) { pipe_data->pipe_config.subvp_data.phantom_pipe_index = phantom_pipe->pipe_idx; +/* TODO: Uncomment once FW headers are promoted +if (phantom_pipe->bottom_pipe) { +pipe_data->pipe_config.subvp_data.phantom_split_pipe_index = phantom_pipe->bottom_pipe->pipe_idx; +} else if (phantom_pipe->next_odm_pipe) { +pipe_data->pipe_config.subvp_data.phantom_split_pipe_index = phantom_pipe->next_odm_pipe->pipe_idx; +} else { +pipe_data->pipe_config.subvp_data.phantom_split_pipe_index = 0; +} +*/ break ; } }
@@ -724,7 +744,9 @@ void dc_dmub_setup_subvp_dmub_command(struct dc *dc,if (!pipe->stream)continue ; -if (pipe->plane_state && !pipe->top_pipe && +/* For SubVP pipe count, only count the top most (ODM / MPC) pipe +*/ +if (pipe->plane_state && !pipe->top_pipe && !pipe->prev_odm_pipe && pipe->stream->mall_stream_config.type ==SUBVP_MAIN ) subvp_pipes[subvp_count++] = pipe; }
@@ -737,7 +759,12 @@ void dc_dmub_setup_subvp_dmub_command(struct dc *dc,if (!pipe->stream)continue ; +/* When populating subvp cmd info, only pass in the top most (ODM / MPC) pipe. +* Any ODM or MPC splits being used in SubVP will be handled internally in +* populate_subvp_cmd_pipe_info +*/ if (pipe->plane_state && pipe->stream->mall_stream_config.paired_stream && + !pipe->top_pipe && !pipe->prev_odm_pipe && pipe->stream->mall_stream_config.type ==SUBVP_MAIN ) {populate_subvp_cmd_pipe_info (dc, context, &cmd, pipe, cmd_pipe_index++); }else if (pipe->plane_state && pipe->stream->mall_stream_config.type ==SUBVP_NONE ) {
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +7 -4
@@ -1906,10 +1906,13 @@ void dcn20_post_unlock_program_front_end(* can underflow due to HUBP_VTG_SEL programming if done in the regular front end * programming sequence). */ -if (pipe->stream && pipe->stream->mall_stream_config.type ==SUBVP_PHANTOM ) { -if (dc->hwss.update_phantom_vp_position) - dc->hwss.update_phantom_vp_position (dc, context, pipe); -dcn20_program_pipe (dc, pipe, context); +while (pipe) { +if (pipe->stream && pipe->stream->mall_stream_config.type ==SUBVP_PHANTOM ) { +if (dc->hwss.update_phantom_vp_position) + dc->hwss.update_phantom_vp_position (dc, context, pipe); +dcn20_program_pipe (dc, pipe, context); + } + pipe = pipe->bottom_pipe; } } }
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +12 -6
@@ -1160,17 +1160,23 @@ static void dcn32_full_validate_bw_helper(struct dc *dc, vba->VoltageLevel = *vlevel; } }else { -// only call dcn20_validate_apply_pipe_split_flags if we found a supported config -memset (split,0 ,MAX_PIPES *sizeof (int )); -memset (merge,0 ,MAX_PIPES *sizeof (bool )); - *vlevel =dcn20_validate_apply_pipe_split_flags (dc, context, *vlevel, split, merge); - vba->VoltageLevel = *vlevel; -// Most populate phantom DLG params before programming hardware / timing for phantom pipe DC_FP_START ();dcn32_helper_populate_phantom_dlg_params (dc, context, pipes, *pipe_cnt);DC_FP_END (); +/* Call validate_apply_pipe_split flags after calling DML getters for +* phantom dlg params, or some of the VBA params indicating pipe split +* can be overwritten by the getters. +* +* When setting up SubVP config, all pipes are merged before attempting to +* add phantom pipes. If pipe split (ODM / MPC) is required, both the main +* and phantom pipes will be split in the regular pipe splitting sequence. +*/ +memset (split,0 ,MAX_PIPES *sizeof (int )); +memset (merge,0 ,MAX_PIPES *sizeof (bool )); + *vlevel =dcn20_validate_apply_pipe_split_flags (dc, context, *vlevel, split, merge); + vba->VoltageLevel = *vlevel;// Note: We can't apply the phantom pipes to hardware at this time. We have to wait // until driver has acquired the DMCUB lock to do it safely. }
Signature · 1 line
2.37.3
PATCH v2 15/47 drm/amd/display: Disable SubVP on driver disable
In reply to Wayne LinFrom: Alvin Lee <[email protected]>
[Why and How]
- For driver disable cases in current implementation, if P-State is unsupported or still supported by firmware, we force it supported by DCN.
- SubVP now needs to be included in this case along with FPO.
--- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 1 + .../drm/amd/display/dc/dcn30/dcn30_hwseq.c | 21 ++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h +1 -0
@@ -85,6 +85,7 @@ void dc_dmub_srv_send_inbox0_cmd(struct dc_dmub_srv *dmub_srv, union dmub_inbox0bool dc_dmub_srv_get_diagnostic_data (struct dc_dmub_srv *dc_dmub_srv,struct dmub_diagnostic_data *dmub_oca); +void dc_dmub_setup_subvp_dmub_command (struct dc *dc,struct dc_state *context,bool enable);void dc_dmub_srv_log_diagnostic_data (struct dc_dmub_srv *dc_dmub_srv);#endif /* _DMUB_DC_SRV_H_ */
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c +20 -1
@@ -939,13 +939,32 @@ bool dcn30_does_plane_fit_in_mall(struct dc *dc, struct dc_plane_state *plane, svoid dcn30_hardware_release (struct dc *dc) { +bool subvp_in_use = false; +uint8_t i; +dc_dmub_srv_p_state_delegate (dc, false,NULL ); +dc_dmub_setup_subvp_dmub_command (dc, dc->current_state, false); + +/* SubVP treated the same way as FPO. If driver disable and +* we are using a SubVP config, disable and force on DCN side +* to prevent P-State hang on driver enable. +*/ +for (i =0 ; i < dc->res_pool->pipe_count; i++) { +struct pipe_ctx *pipe = &dc->current_state->res_ctx.pipe_ctx[i]; +if (!pipe->stream) +continue ; + +if (pipe->stream->mall_stream_config.type ==SUBVP_MAIN ) { + subvp_in_use = true; +break ; + } + }/* If pstate unsupported, or still supported * by firmware, force it supported by dcn */ if (dc->current_state) -if ((!dc->clk_mgr->clks.p_state_change_support || +if ((!dc->clk_mgr->clks.p_state_change_support || subvp_in_use || dc->current_state->bw_ctx.bw.dcn.clk.fw_based_mclk_switching) && dc->res_pool->hubbub->funcs->force_pstate_change_control) dc->res_pool->hubbub->funcs->force_pstate_change_control(
Signature · 1 line
2.37.3
PATCH v2 16/47 drm/amd/display: Fix SubVP way calculation
In reply to Wayne LinFrom: Alvin Lee <[email protected]>
[Why and How]
- Don't skip bottom and next odm pipe when calculating num ways for subvp
- Don't need to double cache lines for DCC (divide by 256)
--- .../drm/amd/display/dc/dcn32/dcn32_resource_helpers.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c +7 -4
@@ -66,8 +66,11 @@ uint32_t dcn32_helper_calculate_num_ways_for_subvp(struct dc *dc, struct dc_statfor (i =0 ; i < dc->res_pool->pipe_count; i++) {struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i]; -// Find the phantom pipes -if (pipe->stream && pipe->plane_state && !pipe->top_pipe && !pipe->prev_odm_pipe && +/* Find the phantom pipes. +* - For pipe split case we need to loop through the bottom and next ODM +* pipes or only half the viewport size is counted +*/ +if (pipe->stream && pipe->plane_state && pipe->stream->mall_stream_config.type ==SUBVP_PHANTOM ) {struct pipe_ctx *main_pipe =NULL ;
@@ -118,9 +121,9 @@ uint32_t dcn32_helper_calculate_num_ways_for_subvp(struct dc *dc, struct dc_stat// (MALL is 64-byte aligned) cache_lines_per_plane = bytes_in_mall / dc->caps.cache_line_size +2 ; -// For DCC we must cache the meat surface, so double cache lines required +/* For DCC divide by 256 */ if (pipe->plane_state->dcc.enable) - cache_lines_per_plane *=2 ; + cache_lines_per_plane = cache_lines_per_plane + (cache_lines_per_plane /256 ) +1 ; cache_lines_used += cache_lines_per_plane; } }
Signature · 1 line
2.37.3
PATCH v2 17/47 drm/amd/display: [FW Promotion] Release 0.0.134.0
In reply to Wayne LinFrom: Anthony Koo <[email protected]>
- Handle pipe split case for SubVP:
Pass in pipe split index for main and phantom pipes
--- drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +2 -1
@@ -998,7 +998,8 @@ struct dmub_cmd_fw_assisted_mclk_switch_pipe_data_v2 {uint8_t scale_factor_numerator;uint8_t scale_factor_denominator;uint8_t is_drr; -uint8_t pad[2 ]; +uint8_t main_split_pipe_index; +uint8_t phantom_split_pipe_index; } subvp_data;struct {
Signature · 1 line
2.37.3
PATCH v2 18/47 drm/amd/display: 3.2.203
In reply to Wayne LinFrom: Aric Cyr <[email protected]>
This version brings along following fixes:
- Port DCN30 420 logic to DCN32
- Remove some unused definitions from DCN32/321
- Remove dp dig pixle rate div policy from dcn314
- Fix dcn315 reading of memory channel count and width
- Fix SubVP and ODM relevant issues
- Fix pipe split, MPO and ODM relevant issues
- Support proper mst payload removal when link is not in mst mode in dc
- Assume an LTTPR is always present on fixed_vs links
- Rework recent update PHY state commit
- Add debug option and logs
--- 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
@@ -47,7 +47,7 @@ struct aux_payload;struct set_config_cmd_payload ;struct dmub_notification ; -#define DC_VER "3.2.202" +#define DC_VER "3.2.203"#define MAX_SURFACES 3#define MAX_PLANES 6
Signature · 1 line
2.37.3
PATCH v2 19/47 drm/amd/display: Refactor edp panel power sequencer(PPS) codes
In reply to Wayne LinFrom: Ian Chen <[email protected]>
[Why & How]
Move extra panel power sequencer settings into panel_cofig struct.
--- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 11 +++++++- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 8 +++--- .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 10 +++----- drivers/gpu/drm/amd/display/dc/dc_link.h | 10 ++++++++ .../display/dc/dce110/dce110_hw_sequencer.c | 25 +++++++++++-------- drivers/gpu/drm/amd/display/dc/dm_helpers.h | 3 ++- 6 files changed, 46 insertions(+), 21 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +10 -1
@@ -918,8 +918,17 @@ void dm_helpers_smu_timeout(struct dc_context *ctx, unsigned int msg_id, unsignevoid dm_helpers_init_panel_settings (struct dc_context *ctx, -struct dc_panel_config *panel_config) +struct dc_panel_config *panel_config, +struct dc_sink *sink) { +// Extra Panel Power Sequence + panel_config->pps.extra_t3_ms = sink->edid_caps.panel_patch.extra_t3_ms; + panel_config->pps.extra_t7_ms = sink->edid_caps.panel_patch.extra_t7_ms; + panel_config->pps.extra_delay_backlight_off = sink->edid_caps.panel_patch.extra_delay_backlight_off; + panel_config->pps.extra_post_t7_ms =0 ; + panel_config->pps.extra_pre_t11_ms =0 ; + panel_config->pps.extra_t12_ms = sink->edid_caps.panel_patch.extra_t12_ms; + panel_config->pps.extra_post_OUI_ms =0 ;// Feature DSC panel_config->dsc.disable_dsc_edp = false; panel_config->dsc.force_dsc_edp_policy =0 ;
drivers/gpu/drm/amd/display/dc/core/dc_link.c +5 -3
@@ -1308,7 +1308,7 @@ static bool detect_link_and_local_sink(struct dc_link *link,if (link->connector_signal ==SIGNAL_TYPE_EDP ) {// Init dc_panel_config -dm_helpers_init_panel_settings (dc_ctx, &link->panel_config); +dm_helpers_init_panel_settings (dc_ctx, &link->panel_config, sink);// Override dc_panel_config if system has specific settings dm_helpers_override_panel_settings (dc_ctx, &link->panel_config); }
@@ -1977,7 +1977,7 @@ static enum dc_status enable_link_dp(struct dc_state *state,int i;bool apply_seamless_boot_optimization = false;uint32_t bl_oled_enable_delay =50 ;// in ms -const uint32_t post_oui_delay =30 ;// 30ms +uint32_t post_oui_delay =30 ;// 30ms /* Reduce link bandwidth between failed link training attempts. */ bool do_fallback = false;
@@ -2024,8 +2024,10 @@ static enum dc_status enable_link_dp(struct dc_state *state,// during mode switch we do DP_SET_POWER off then on, and OUI is lost dpcd_set_source_specific_data (link); -if (link->dpcd_sink_ext_caps.raw !=0 ) +if (link->dpcd_sink_ext_caps.raw !=0 ) { + post_oui_delay += link->panel_config.pps.extra_post_OUI_ms;msleep (post_oui_delay); + }// similarly, mode switch can cause loss of cable ID dpcd_write_cable_id_to_dprx (link);
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +4 -6
@@ -7075,9 +7075,8 @@ void dp_enable_link_phy(void edp_add_delay_for_T9 (struct dc_link *link) { -if (link->local_sink && - link->local_sink->edid_caps.panel_patch.extra_delay_backlight_off >0 ) -udelay (link->local_sink->edid_caps.panel_patch.extra_delay_backlight_off *1000 ); +if (link && link->panel_config.pps.extra_delay_backlight_off >0 ) +udelay (link->panel_config.pps.extra_delay_backlight_off *1000 ); }bool edp_receiver_ready_T9 (struct dc_link *link)
@@ -7133,9 +7132,8 @@ bool edp_receiver_ready_T7(struct dc_link *link) }while (time_taken_in_ns <50 *1000000 );//MAx T7 is 50ms } -if (link->local_sink && - link->local_sink->edid_caps.panel_patch.extra_t7_ms >0 ) -udelay (link->local_sink->edid_caps.panel_patch.extra_t7_ms *1000 ); +if (link && link->panel_config.pps.extra_t7_ms >0 ) +udelay (link->panel_config.pps.extra_t7_ms *1000 );return result; }
drivers/gpu/drm/amd/display/dc/dc_link.h +10 -0
@@ -117,6 +117,16 @@ struct psr_settings {* Add a struct dc_panel_config under dc_link */ struct dc_panel_config { +// extra panel power sequence parameters +struct pps { +unsigned int extra_t3_ms; +unsigned int extra_t7_ms; +unsigned int extra_delay_backlight_off; +unsigned int extra_post_t7_ms; +unsigned int extra_pre_t11_ms; +unsigned int extra_t12_ms; +unsigned int extra_post_OUI_ms; + } pps;// edp DSC struct dsc {bool disable_dsc_edp;
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +15 -10
@@ -722,7 +722,6 @@ void dce110_edp_wait_for_hpd_ready(struct dc_context *ctx = link->ctx;struct graphics_object_id connector = link->link_enc->connector;struct gpio *hpd; -struct dc_sink *sink = link->local_sink;bool edp_hpd_high = false;uint32_t time_elapsed =0 ; uint32_t timeout = power_up ?
@@ -755,9 +754,9 @@ void dce110_edp_wait_for_hpd_ready(return ; } -if (sink !=NULL ) { -if (sink->edid_caps.panel_patch.extra_t3_ms >0 ) { -int extra_t3_in_ms = sink->edid_caps.panel_patch.extra_t3_ms; +if (link !=NULL ) { +if (link->panel_config.pps.extra_t3_ms >0 ) { +int extra_t3_in_ms = link->panel_config.pps.extra_t3_ms;msleep (extra_t3_in_ms); }
@@ -842,7 +841,7 @@ void dce110_edp_power_control(/* add time defined by a patch, if any (usually patch extra_t12_ms is 0) */ if (link->local_sink !=NULL ) remaining_min_edp_poweroff_time_ms += - link->local_sink->edid_caps.panel_patch.extra_t12_ms; + link->panel_config.pps.extra_t12_ms;/* Adjust remaining_min_edp_poweroff_time_ms if this is not the first time. */ if (dp_trace_get_edp_poweroff_timestamp (link) !=0 ) {
@@ -946,7 +945,7 @@ void dce110_edp_wait_for_T12( current_ts, dp_trace_get_edp_poweroff_timestamp(link)), 1000000); - t12_duration += link->local_sink->edid_caps.panel_patch.extra_t12_ms;// Add extra T12 + t12_duration += link->panel_config.pps.extra_t12_ms;// Add extra T12 if (time_since_edp_poweroff_ms < t12_duration)msleep (t12_duration - time_since_edp_poweroff_ms);
@@ -965,6 +964,8 @@ void dce110_edp_backlight_control(struct dc_context *ctx = link->ctx;struct bp_transmitter_control cntl = {0 };uint8_t panel_instance; +unsigned int pre_T11_delay =OLED_PRE_T11_DELAY ; +unsigned int post_T7_delay =OLED_POST_T7_DELAY ;if (dal_graphics_object_id_get_connector_id (link->link_enc->connector) !=CONNECTOR_ID_EDP ) {
@@ -1043,8 +1044,10 @@ void dce110_edp_backlight_control(link_transmitter_control (ctx->dc_bios, &cntl); -if (enable && link->dpcd_sink_ext_caps.bits.oled) -msleep (OLED_POST_T7_DELAY ); +if (enable && link->dpcd_sink_ext_caps.bits.oled) { + post_T7_delay += link->panel_config.pps.extra_post_t7_ms; +msleep (post_T7_delay); + } if (link->dpcd_sink_ext_caps.bits.oled || link->dpcd_sink_ext_caps.bits.hdr_aux_backlight_control == 1 ||
@@ -1066,8 +1069,10 @@ void dce110_edp_backlight_control(DC_LOG_DC ("edp_receiver_ready_T9 skipped\n" ); } -if (!enable && link->dpcd_sink_ext_caps.bits.oled) -msleep (OLED_PRE_T11_DELAY ); +if (!enable && link->dpcd_sink_ext_caps.bits.oled) { + pre_T11_delay += link->panel_config.pps.extra_pre_t11_ms; +msleep (pre_T11_delay); + } }void dce110_enable_audio_stream (struct pipe_ctx *pipe_ctx)
drivers/gpu/drm/amd/display/dc/dm_helpers.h +2 -1
@@ -173,7 +173,8 @@ void dm_helpers_smu_timeout(struct dc_context *ctx, unsigned int msg_id, unsigne (result == 0x0)void dm_helpers_init_panel_settings (struct dc_context *ctx, -struct dc_panel_config *config); +struct dc_panel_config *config, +struct dc_sink *sink);void dm_helpers_override_panel_settings (struct dc_context *ctx,struct dc_panel_config *config);
Signature · 1 line
2.37.3
PATCH v2 20/47 drm/amd/display: update gamut remap if plane has changed
In reply to Wayne LinFrom: Hugo Hu <[email protected]>
[Why]
The desktop plane and full-screen game plane may have different gamut remap coefficients, if switching between desktop and full-screen game without updating the gamut remap will cause incorrect color.
[How]
Update gamut remap if planes change.
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +1 -0
@@ -1573,6 +1573,7 @@ static void dcn20_update_dchubp_dpp(/* Any updates are handled in dc interface, just need * to apply existing for plane enable / opp change */ if (pipe_ctx->update_flags.bits.enable || pipe_ctx->update_flags.bits.opp_changed + || pipe_ctx->update_flags.bits.plane_changed || pipe_ctx->stream->update_flags.bits.gamut_remap || pipe_ctx->stream->update_flags.bits.out_csc) {/* dpp/cm gamut remap*/
Signature · 1 line
2.37.3
PATCH v2 21/47 drm/amd/display: skip audio setup when audio stream is enabled
In reply to Wayne LinFrom: zhikzhai <[email protected]>
[why]
We have minimal pipe split transition method to avoid pipe allocation outage.However, this method will invoke audio setup which cause audio output stuck once pipe reallocate.
[how]
skip audio setup for pipelines which audio stream has been enabled
--- drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +4 -2
@@ -2178,7 +2178,8 @@ static void dce110_setup_audio_dto(continue ;if (pipe_ctx->stream->signal !=SIGNAL_TYPE_HDMI_TYPE_A )continue ; -if (pipe_ctx->stream_res.audio !=NULL ) { +if (pipe_ctx->stream_res.audio !=NULL && + pipe_ctx->stream_res.audio->enabled == false) {struct audio_output audio_output;build_audio_output (context, pipe_ctx, &audio_output);
@@ -2218,7 +2219,8 @@ static void dce110_setup_audio_dto(if (!dc_is_dp_signal (pipe_ctx->stream->signal))continue ; -if (pipe_ctx->stream_res.audio !=NULL ) { +if (pipe_ctx->stream_res.audio !=NULL && + pipe_ctx->stream_res.audio->enabled == false) {struct audio_output audio_output;build_audio_output (context, pipe_ctx, &audio_output);
Signature · 1 line
2.37.3
PATCH v2 22/47 drm/amd/display: Uncomment SubVP pipe split assignment in driver
In reply to Wayne LinFrom: Alvin Lee <[email protected]>
[Why & How]
Uncomment SubVP pipe split assignment in driver since FW headers are now promoted
--- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +0 -4
@@ -675,7 +675,6 @@ static void populate_subvp_cmd_pipe_info(struct dc *dc,div64_u64 (((uint64_t )(dc->caps.subvp_fw_processing_delay_us) * ((uint64_t )phantom_timing->pix_clk_100hz *100 ) + ((uint64_t )phantom_timing->h_total *1000000 -1 )), ((uint64_t )phantom_timing->h_total *1000000 )); -/* TODO: Uncomment once FW headers are promoted if (subvp_pipe->bottom_pipe) { pipe_data->pipe_config.subvp_data.main_split_pipe_index = subvp_pipe->bottom_pipe->pipe_idx; }else if (subvp_pipe->next_odm_pipe) {
@@ -683,7 +682,6 @@ static void populate_subvp_cmd_pipe_info(struct dc *dc, }else { pipe_data->pipe_config.subvp_data.main_split_pipe_index =0 ; } -*/ // Find phantom pipe index based on phantom stream for (j =0 ; j < dc->res_pool->pipe_count; j++) {
@@ -691,7 +689,6 @@ static void populate_subvp_cmd_pipe_info(struct dc *dc,if (phantom_pipe->stream == subvp_pipe->stream->mall_stream_config.paired_stream) { pipe_data->pipe_config.subvp_data.phantom_pipe_index = phantom_pipe->pipe_idx; -/* TODO: Uncomment once FW headers are promoted if (phantom_pipe->bottom_pipe) { pipe_data->pipe_config.subvp_data.phantom_split_pipe_index = phantom_pipe->bottom_pipe->pipe_idx; }else if (phantom_pipe->next_odm_pipe) {
@@ -699,7 +696,6 @@ static void populate_subvp_cmd_pipe_info(struct dc *dc, }else { pipe_data->pipe_config.subvp_data.phantom_split_pipe_index =0 ; } -*/ break ; } }
Signature · 1 line
2.37.3
PATCH v2 23/47 drm/amd/display: Fix urgent latency override for DCN32/DCN321
In reply to Wayne LinFrom: George Shen <[email protected]>
[Why]
The urgent latency override is useful when debugging issues relating to underflow.
Current overridden variable is not correct and has no effect on DCN3.2 and DCN3.21 DML calculations.
[How]
For DCN3.2 and DCN3.21, override the correct urgent latency variable when bounding box override is present.
--- drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 1 + drivers/gpu/drm/amd/display/dc/dml/dcn321/dcn321_fpu.c | 1 + 2 files changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +1 -0
@@ -2197,6 +2197,7 @@ void dcn32_update_bw_bounding_box_fpu(struct dc *dc, struct clk_bw_params *bw_paif ((int )(dcn3_2_soc.urgent_latency_us *1000 ) != dc->bb_overrides.urgent_latency_ns && dc->bb_overrides.urgent_latency_ns) { dcn3_2_soc.urgent_latency_us = dc->bb_overrides.urgent_latency_ns /1000.0 ; + dcn3_2_soc.urgent_latency_pixel_data_only_us = dc->bb_overrides.urgent_latency_ns /1000.0 ; } if ((int)(dcn3_2_soc.dram_clock_change_latency_us * 1000)
drivers/gpu/drm/amd/display/dc/dml/dcn321/dcn321_fpu.c +1 -0
@@ -489,6 +489,7 @@ void dcn321_update_bw_bounding_box_fpu(struct dc *dc, struct clk_bw_params *bw_pif ((int )(dcn3_21_soc.urgent_latency_us *1000 ) != dc->bb_overrides.urgent_latency_ns && dc->bb_overrides.urgent_latency_ns) { dcn3_21_soc.urgent_latency_us = dc->bb_overrides.urgent_latency_ns /1000.0 ; + dcn3_21_soc.urgent_latency_pixel_data_only_us = dc->bb_overrides.urgent_latency_ns /1000.0 ; } if ((int)(dcn3_21_soc.dram_clock_change_latency_us * 1000)
Signature · 1 line
2.37.3
PATCH v2 24/47 drm/amd/display: correct hostvm flag
In reply to Wayne LinFrom: Sherry Wang <[email protected]>
[Why]
Hostvm should be enabled/disabled accordding to the status of riommu_active, but hostvm always be disabled on DCN31 which causes underflow
[How]
Set correct hostvm flag on DCN31
--- drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c +1 -1
@@ -890,7 +890,7 @@ static const struct dc_debug_options debug_defaults_drv = { .disable_z10 = true, .optimize_edp_link_rate = true, .enable_z9_disable_interface = true, /* Allow support for the PMFW interface for disable Z9*/ - .dml_hostvm_override = DML_HOSTVM_OVERRIDE_FALSE, + .dml_hostvm_override = DML_HOSTVM_NO_OVERRIDE, };static const struct dc_debug_options debug_defaults_diags = {
Signature · 1 line
2.37.3
PATCH v2 25/47 drm/amd/display: Added new DCN301 Asic Id
In reply to Wayne LinFrom: Pavle Kotarac <[email protected]>
[WHY]
Adding new asic id for dcn301
--- drivers/gpu/drm/amd/display/include/dal_asic_id.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/include/dal_asic_id.h +1 -0
@@ -215,6 +215,7 @@ enum {#define DEVICE_ID_NV_143F 0x143F#define FAMILY_VGH 144#define DEVICE_ID_VGH_163F 0x163F +#define DEVICE_ID_VGH_1435 0x1435#define VANGOGH_A0 0x01#define VANGOGH_UNKNOWN 0xFF
Signature · 1 line
2.37.3
PATCH v2 27/47 drm/amd/display: Expose few dchubbub functions
In reply to Wayne LinFrom: Charlene Liu <[email protected]>
[why]
Expose few dchubbun functions in dcn31 and dcn32 to leverage.
--- .../drm/amd/display/dc/dcn31/dcn31_hubbub.c | 2 +- .../drm/amd/display/dc/dcn31/dcn31_hubbub.h | 2 ++ .../drm/amd/display/dc/dcn32/dcn32_hubbub.c | 10 +++---- .../drm/amd/display/dc/dcn32/dcn32_hubbub.h | 29 +++++++++++++++++++ 4 files changed, 37 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.c +1 -1
@@ -876,7 +876,7 @@ static bool hubbub31_get_dcc_compression_cap(struct hubbub *hubbub,return true; } -static int hubbub31_init_dchub_sys_ctx (struct hubbub *hubbub, +int hubbub31_init_dchub_sys_ctx (struct hubbub *hubbub,struct dcn_hubbub_phys_addr_config *pa_config) {struct dcn20_hubbub *hubbub2 =TO_DCN20_HUBBUB (hubbub);
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.h +2 -0
@@ -122,6 +122,8 @@HUBBUB_SF (DCN_VM_FAULT_STATUS ,DCN_VM_ERROR_PIPE , mask_sh), \ HUBBUB_SF(DCN_VM_FAULT_STATUS, DCN_VM_ERROR_INTERRUPT_STATUS, mask_sh) +int hubbub31_init_dchub_sys_ctx (struct hubbub *hubbub, +struct dcn_hubbub_phys_addr_config *pa_config); void hubbub31_construct(struct dcn20_hubbub *hubbub3, struct dc_context *ctx,
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubbub.c +5 -5
@@ -68,7 +68,7 @@ static void dcn32_init_crb(struct hubbub *hubbub)REG_UPDATE (DCHUBBUB_DEBUG_CTRL_0 ,DET_DEPTH ,0x47F ); } -static void dcn32_program_det_size (struct hubbub *hubbub,int hubp_inst,unsigned int det_buffer_size_in_kbyte) +void dcn32_program_det_size (struct hubbub *hubbub,int hubp_inst,unsigned int det_buffer_size_in_kbyte) {struct dcn20_hubbub *hubbub2 =TO_DCN20_HUBBUB (hubbub);
@@ -140,7 +140,7 @@ static uint32_t convert_and_clamp(return ret_val; } -static bool hubbub32_program_urgent_watermarks( +bool hubbub32_program_urgent_watermarks( struct hubbub *hubbub, struct dcn_watermark_set *watermarks, unsigned int refclk_mhz,
@@ -330,7 +330,7 @@ static bool hubbub32_program_urgent_watermarks(return wm_pending; } -static bool hubbub32_program_stutter_watermarks( +bool hubbub32_program_stutter_watermarks( struct hubbub *hubbub, struct dcn_watermark_set *watermarks, unsigned int refclk_mhz,
@@ -476,7 +476,7 @@ static bool hubbub32_program_stutter_watermarks( } -static bool hubbub32_program_pstate_watermarks( +bool hubbub32_program_pstate_watermarks( struct hubbub *hubbub, struct dcn_watermark_set *watermarks, unsigned int refclk_mhz,
@@ -629,7 +629,7 @@ static bool hubbub32_program_pstate_watermarks( } -static bool hubbub32_program_usr_watermarks( +bool hubbub32_program_usr_watermarks( struct hubbub *hubbub, struct dcn_watermark_set *watermarks, unsigned int refclk_mhz,
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubbub.h +29 -0
@@ -161,6 +161,35 @@HUBBUB_SF (DCN_VM_FAULT_STATUS ,DCN_VM_ERROR_PIPE , mask_sh), \ HUBBUB_SF(DCN_VM_FAULT_STATUS, DCN_VM_ERROR_INTERRUPT_STATUS, mask_sh) +bool hubbub32_program_urgent_watermarks ( +struct hubbub *hubbub, +struct dcn_watermark_set *watermarks, +unsigned int refclk_mhz, +bool safe_to_lower); + +bool hubbub32_program_stutter_watermarks ( +struct hubbub *hubbub, +struct dcn_watermark_set *watermarks, +unsigned int refclk_mhz, +bool safe_to_lower); + +bool hubbub32_program_pstate_watermarks ( +struct hubbub *hubbub, +struct dcn_watermark_set *watermarks, +unsigned int refclk_mhz, +bool safe_to_lower); + +bool hubbub32_program_usr_watermarks ( +struct hubbub *hubbub, +struct dcn_watermark_set *watermarks, +unsigned int refclk_mhz, +bool safe_to_lower); + +void hubbub32_force_usr_retraining_allow (struct hubbub *hubbub,bool allow); + +void hubbub32_force_wm_propagate_to_pipes (struct hubbub *hubbub); + +void dcn32_program_det_size (struct hubbub *hubbub,int hubp_inst,unsigned int det_buffer_size_in_kbyte); void hubbub32_construct(struct dcn20_hubbub *hubbub2, struct dc_context *ctx,
Signature · 1 line
2.37.3
PATCH v2 26/47 drm/amd/display: Removing 2 phys
In reply to Wayne LinFrom: Pavle Kotarac <[email protected]>
[WHY]
New dcn301 has 2 less phys
--- drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c +3 -1
@@ -634,7 +634,7 @@ static const struct dcn20_vmid_mask vmid_masks = {DCN20_VMID_MASK_SH_LIST (_MASK) }; -static const struct resource_caps res_cap_dcn301 = { +static struct resource_caps res_cap_dcn301 = { .num_timing_generator =4 , .num_opp =4 , .num_video_plane =4 ,
@@ -1429,6 +1429,8 @@ static bool dcn301_resource_construct( ctx->dc_bios->regs = &bios_regs; +if (dc->ctx->asic_id.chip_id ==DEVICE_ID_VGH_1435 ) + res_cap_dcn301.num_pll =2 ; pool->base.res_cap = &res_cap_dcn301; pool->base.funcs = &dcn301_res_pool_funcs;
Signature · 1 line
2.37.3
PATCH v2 28/47 drm/amd/display: Update dummy P-state search to use DCN32 DML
In reply to Wayne LinFrom: George Shen <[email protected]>
[Why]
Current DCN3.2 logic for finding the dummy P-state index uses the DCN3.0 DML validation function instead of DCN3.2 DML.
This can result in either unexpected DML VBA values, or unexpected dummy P-state index to be used.
[How]
Update the dummy P-state logic to use DCN3.2 DML validation function.
--- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 46 ++++++++++++++++++- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.h | 6 +++ 2 files changed, 51 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +45 -1
@@ -243,6 +243,50 @@ void dcn32_build_wm_range_table_fpu(struct clk_mgr_internal *clk_mgr) clk_mgr->base.bw_params->wm_table.nv_entries[WM_D ].pmfw_breakdown.max_uclk =0xFFFF ; } +/** +* Finds dummy_latency_index when MCLK switching using firmware based +* vblank stretch is enabled. This function will iterate through the +* table of dummy pstate latencies until the lowest value that allows +* dm_allow_self_refresh_and_mclk_switch to happen is found +*/ +int dcn32_find_dummy_latency_index_for_fw_based_mclk_switch (struct dc *dc, +struct dc_state *context, +display_e2e_pipe_params_st *pipes, +int pipe_cnt, +int vlevel) +{ +const int max_latency_table_entries =4 ; +const struct vba_vars_st *vba = &context->bw_ctx.dml.vba; +int dummy_latency_index =0 ; + +dc_assert_fp_enabled (); + +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; +dcn32_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, false); + +if (vlevel < context->bw_ctx.dml.vba.soc.num_states && + vba->DRAMClockChangeSupport[vlevel][vba->maxMpcComb] != dm_dram_clock_change_unsupported) +break ; + + dummy_latency_index++; + } + +if (dummy_latency_index == max_latency_table_entries) { +ASSERT (dummy_latency_index != max_latency_table_entries); +/* If the execution gets here, it means dummy p_states are +* not possible. This should never happen and would mean +* something is severely wrong. +* Here we reset dummy_latency_index to 3, because it is +* better to have underflows than system crashes. +*/ + dummy_latency_index = max_latency_table_entries -1 ; + } + +return dummy_latency_index; +} +/** * dcn32_helper_populate_phantom_dlg_params - Get DLG params for phantom pipes * and populate pipe_ctx with those params.
@@ -1723,7 +1767,7 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context,dcn30_can_support_mclk_switch_using_fw_based_vblank_stretch (dc, context);if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching) { - dummy_latency_index =dcn30_find_dummy_latency_index_for_fw_based_mclk_switch (dc, + dummy_latency_index =dcn32_find_dummy_latency_index_for_fw_based_mclk_switch (dc, context, pipes, pipe_cnt, vlevel);/* After calling dcn30_find_dummy_latency_index_for_fw_based_mclk_switch
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.h +6 -0
@@ -70,4 +70,10 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context,void dcn32_update_bw_bounding_box_fpu (struct dc *dc,struct clk_bw_params *bw_params); +int dcn32_find_dummy_latency_index_for_fw_based_mclk_switch (struct dc *dc, +struct dc_state *context, +display_e2e_pipe_params_st *pipes, +int pipe_cnt, +int vlevel); +#endif
Signature · 1 line
2.37.3
PATCH v2 29/47 drm/amd/display: Display distortion after hotplug 5K tiled display
In reply to Wayne LinFrom: Meenakshikumar Somasundaram <[email protected]>
[Why]
During hot plug of specific 5K tiled display, sometimes both the tiles are not synchronized resulting in distortion. The reason is that otgs of both the tiles goes out of sync when otg workaround (dcnxxx_disable_otg_wa) is applied for bandwidth optimization. The otg workaround reenables otg but otg synchronization context is not reset and hence dc_trigger_sync() does not resynchronize otg again.
[How]
Implement reset_sync_context_for_pipe() to reset the otg synchronization context for the disabled pipe and its slave pipes when otg workaround is applied.
--- .../display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c | 11 ++++++----- .../display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c | 11 ++++++----- .../display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c | 11 ++++++----- .../display/dc/clk_mgr/dcn316/dcn316_clk_mgr.c | 11 ++++++----- .../gpu/drm/amd/display/dc/core/dc_resource.c | 17 +++++++++++++++++ drivers/gpu/drm/amd/display/dc/inc/resource.h | 4 ++++ 6 files changed, 45 insertions(+), 20 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c +6 -5
@@ -104,7 +104,7 @@ static int dcn31_get_active_display_cnt_wa(return display_count; } -static void dcn31_disable_otg_wa (struct clk_mgr *clk_mgr_base,bool disable) +static void dcn31_disable_otg_wa (struct clk_mgr *clk_mgr_base,struct dc_state *context,bool disable) {struct dc *dc = clk_mgr_base->ctx->dc;int i;
@@ -115,9 +115,10 @@ static void dcn31_disable_otg_wa(struct clk_mgr *clk_mgr_base, bool disable)if (pipe->top_pipe || pipe->prev_odm_pipe)continue ;if (pipe->stream && (pipe->stream->dpms_off ||dc_is_virtual_signal (pipe->stream->signal))) { -if (disable) +if (disable) { pipe->stream_res.tg->funcs->immediate_disable_crtc (pipe->stream_res.tg); -else +reset_sync_context_for_pipe (dc, context, i); + }else pipe->stream_res.tg->funcs->enable_crtc (pipe->stream_res.tg); } }
@@ -216,11 +217,11 @@ void dcn31_update_clocks(struct clk_mgr *clk_mgr_base, }if (should_set_clock (safe_to_lower, new_clocks->dispclk_khz, clk_mgr_base->clks.dispclk_khz)) { -dcn31_disable_otg_wa (clk_mgr_base, true); +dcn31_disable_otg_wa (clk_mgr_base, context, true); clk_mgr_base->clks.dispclk_khz = new_clocks->dispclk_khz;dcn31_smu_set_dispclk (clk_mgr, clk_mgr_base->clks.dispclk_khz); -dcn31_disable_otg_wa (clk_mgr_base, false); +dcn31_disable_otg_wa (clk_mgr_base, context, false); update_dispclk = true; }
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c +6 -5
@@ -126,7 +126,7 @@ static int dcn314_get_active_display_cnt_wa(return display_count; } -static void dcn314_disable_otg_wa (struct clk_mgr *clk_mgr_base,bool disable) +static void dcn314_disable_otg_wa (struct clk_mgr *clk_mgr_base,struct dc_state *context,bool disable) {struct dc *dc = clk_mgr_base->ctx->dc;int i;
@@ -138,9 +138,10 @@ static void dcn314_disable_otg_wa(struct clk_mgr *clk_mgr_base, bool disable)continue ;if (pipe->stream && (pipe->stream->dpms_off || pipe->plane_state ==NULL ||dc_is_virtual_signal (pipe->stream->signal))) { -if (disable) +if (disable) { pipe->stream_res.tg->funcs->immediate_disable_crtc (pipe->stream_res.tg); -else +reset_sync_context_for_pipe (dc, context, i); + }else pipe->stream_res.tg->funcs->enable_crtc (pipe->stream_res.tg); } }
@@ -240,11 +241,11 @@ void dcn314_update_clocks(struct clk_mgr *clk_mgr_base, }if (should_set_clock (safe_to_lower, new_clocks->dispclk_khz, clk_mgr_base->clks.dispclk_khz)) { -dcn314_disable_otg_wa (clk_mgr_base, true); +dcn314_disable_otg_wa (clk_mgr_base, context, true); clk_mgr_base->clks.dispclk_khz = new_clocks->dispclk_khz;dcn314_smu_set_dispclk (clk_mgr, clk_mgr_base->clks.dispclk_khz); -dcn314_disable_otg_wa (clk_mgr_base, false); +dcn314_disable_otg_wa (clk_mgr_base, context, false); update_dispclk = true; }
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c +6 -5
@@ -84,7 +84,7 @@ static int dcn315_get_active_display_cnt_wa(return display_count; } -static void dcn315_disable_otg_wa (struct clk_mgr *clk_mgr_base,bool disable) +static void dcn315_disable_otg_wa (struct clk_mgr *clk_mgr_base,struct dc_state *context,bool disable) {struct dc *dc = clk_mgr_base->ctx->dc;int i;
@@ -96,9 +96,10 @@ static void dcn315_disable_otg_wa(struct clk_mgr *clk_mgr_base, bool disable)continue ;if (pipe->stream && (pipe->stream->dpms_off || pipe->plane_state ==NULL ||dc_is_virtual_signal (pipe->stream->signal))) { -if (disable) +if (disable) { pipe->stream_res.tg->funcs->immediate_disable_crtc (pipe->stream_res.tg); -else +reset_sync_context_for_pipe (dc, context, i); + }else pipe->stream_res.tg->funcs->enable_crtc (pipe->stream_res.tg); } }
@@ -180,12 +181,12 @@ static void dcn315_update_clocks(struct clk_mgr *clk_mgr_base,if (should_set_clock (safe_to_lower, new_clocks->dispclk_khz, clk_mgr_base->clks.dispclk_khz)) {/* No need to apply the w/a if we haven't taken over from bios yet */ if (clk_mgr_base->clks.dispclk_khz) -dcn315_disable_otg_wa (clk_mgr_base, true); +dcn315_disable_otg_wa (clk_mgr_base, context, true); clk_mgr_base->clks.dispclk_khz = new_clocks->dispclk_khz;dcn315_smu_set_dispclk (clk_mgr, clk_mgr_base->clks.dispclk_khz);if (clk_mgr_base->clks.dispclk_khz) -dcn315_disable_otg_wa (clk_mgr_base, false); +dcn315_disable_otg_wa (clk_mgr_base, context, false); update_dispclk = true; }
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn316/dcn316_clk_mgr.c +6 -5
@@ -112,7 +112,7 @@ static int dcn316_get_active_display_cnt_wa(return display_count; } -static void dcn316_disable_otg_wa (struct clk_mgr *clk_mgr_base,bool disable) +static void dcn316_disable_otg_wa (struct clk_mgr *clk_mgr_base,struct dc_state *context,bool disable) {struct dc *dc = clk_mgr_base->ctx->dc;int i;
@@ -124,9 +124,10 @@ static void dcn316_disable_otg_wa(struct clk_mgr *clk_mgr_base, bool disable)continue ;if (pipe->stream && (pipe->stream->dpms_off || pipe->plane_state ==NULL ||dc_is_virtual_signal (pipe->stream->signal))) { -if (disable) +if (disable) { pipe->stream_res.tg->funcs->immediate_disable_crtc (pipe->stream_res.tg); -else +reset_sync_context_for_pipe (dc, context, i); + }else pipe->stream_res.tg->funcs->enable_crtc (pipe->stream_res.tg); } }
@@ -221,11 +222,11 @@ static void dcn316_update_clocks(struct clk_mgr *clk_mgr_base, }if (should_set_clock (safe_to_lower, new_clocks->dispclk_khz, clk_mgr_base->clks.dispclk_khz)) { -dcn316_disable_otg_wa (clk_mgr_base, true); +dcn316_disable_otg_wa (clk_mgr_base, context, true); clk_mgr_base->clks.dispclk_khz = new_clocks->dispclk_khz;dcn316_smu_set_dispclk (clk_mgr, clk_mgr_base->clks.dispclk_khz); -dcn316_disable_otg_wa (clk_mgr_base, false); +dcn316_disable_otg_wa (clk_mgr_base, context, false); update_dispclk = true; }
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +17 -0
@@ -3581,6 +3581,23 @@ void check_syncd_pipes_for_disabled_master_pipe(struct dc *dc, } } +void reset_sync_context_for_pipe (const struct dc *dc, +struct dc_state *context, +uint8_t pipe_idx) +{ +int i; +struct pipe_ctx *pipe_ctx_reset; + +/* reset the otg sync context for the pipe and its slave pipes if any */ +for (i =0 ; i < dc->res_pool->pipe_count; i++) { + pipe_ctx_reset = &context->res_ctx.pipe_ctx[i]; + +if (((GET_PIPE_SYNCD_FROM_PIPE (pipe_ctx_reset) == pipe_idx) && +IS_PIPE_SYNCD_VALID (pipe_ctx_reset)) || (i == pipe_idx)) +SET_PIPE_SYNCD_TO_PIPE (pipe_ctx_reset, i); + } +} +uint8_t resource_transmitter_to_phy_idx (const struct dc *dc,enum transmitter transmitter) {/* TODO - get transmitter to phy idx mapping from DMUB */
drivers/gpu/drm/amd/display/dc/inc/resource.h +4 -0
@@ -219,6 +219,10 @@ void check_syncd_pipes_for_disabled_master_pipe(struct dc *dc,struct dc_state *context, uint8_t disabled_master_pipe_idx); +void reset_sync_context_for_pipe (const struct dc *dc, +struct dc_state *context, +uint8_t pipe_idx); +uint8_t resource_transmitter_to_phy_idx (const struct dc *dc,enum transmitter transmitter); const struct link_hwss *get_link_hwss(const struct dc_link *link,
Signature · 1 line
2.37.3
PATCH v2 34/47 drm/amd/display: do not compare integers of different widths
In reply to Wayne LinFrom: Josip Pavic <[email protected]>
[Why & How]
Increase width of some variables to avoid comparing integers of different widths
--- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c +1 -1
@@ -940,7 +940,7 @@ bool dcn30_does_plane_fit_in_mall(struct dc *dc, struct dc_plane_state *plane, svoid dcn30_hardware_release (struct dc *dc) {bool subvp_in_use = false; -uint8_t i; +uint32_t i;dc_dmub_srv_p_state_delegate (dc, false,NULL );dc_dmub_setup_subvp_dmub_command (dc, dc->current_state, false);
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +1 -1
@@ -1354,7 +1354,7 @@ void dcn32_update_phantom_vp_position(struct dc *dc,struct dc_state *context, struct pipe_ctx *phantom_pipe) { - uint8_t i; + uint32_t i;struct dc_plane_state *phantom_plane = phantom_pipe->plane_state;for (i =0 ; i < dc->res_pool->pipe_count; i++) {
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c +2 -1
@@ -265,7 +265,8 @@ void dcn32_determine_det_override(struct dc *dc, display_e2e_pipe_params_st *pipes, uint8_t *is_pipe_split_expected) { -uint8_t i, j, pipe_plane_count, stream_segments, plane_segments, pipe_segments[MAX_PIPES ] = {0 }; +uint32_t i, j; +uint8_t pipe_plane_count, stream_segments, plane_segments, pipe_segments[MAX_PIPES ] = {0 };uint8_t pipe_counted[MAX_PIPES ] = {0 };uint8_t pipe_cnt =0 ;struct dc_plane_state *current_plane =NULL ;
Signature · 1 line
2.37.3
PATCH v2 33/47 drm/amd/display: increase dcn315 pstate change latency
In reply to Wayne LinFrom: Dmytro Laktyushkin <[email protected]>
[Why & How]
Update after new measurment came in
--- .../dc/clk_mgr/dcn315/dcn315_clk_mgr.c | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c +14 -8
@@ -51,6 +51,9 @@#define TO_CLK_MGR_DCN315 (clk_mgr)\ container_of(clk_mgr, struct clk_mgr_dcn315, base) +#define UNSUPPORTED_DCFCLK 10000000 +#define MIN_DPP_DISP_CLK 100000 +static int dcn315_get_active_display_cnt_wa (struct dc *dc,struct dc_state *context)
@@ -152,6 +155,9 @@ static void dcn315_update_clocks(struct clk_mgr *clk_mgr_base, } } +/* Lock pstate by requesting unsupported dcfclk if change is unsupported */ +if (!new_clocks->p_state_change_support) + new_clocks->dcfclk_khz =UNSUPPORTED_DCFCLK ;if (should_set_clock (safe_to_lower, new_clocks->dcfclk_khz, clk_mgr_base->clks.dcfclk_khz)) { clk_mgr_base->clks.dcfclk_khz = new_clocks->dcfclk_khz;dcn315_smu_set_hard_min_dcfclk (clk_mgr, clk_mgr_base->clks.dcfclk_khz);
@@ -165,10 +171,10 @@ static void dcn315_update_clocks(struct clk_mgr *clk_mgr_base,// workaround: Limit dppclk to 100Mhz to avoid lower eDP panel switch to plus 4K monitor underflow. if (!IS_DIAG_DC (dc->ctx->dce_environment)) { -if (new_clocks->dppclk_khz <100000 ) - new_clocks->dppclk_khz =100000 ; -if (new_clocks->dispclk_khz <100000 ) - new_clocks->dispclk_khz =100000 ; +if (new_clocks->dppclk_khz <MIN_DPP_DISP_CLK ) + new_clocks->dppclk_khz =MIN_DPP_DISP_CLK ; +if (new_clocks->dispclk_khz <MIN_DPP_DISP_CLK ) + new_clocks->dispclk_khz =MIN_DPP_DISP_CLK ; }if (should_set_clock (safe_to_lower, new_clocks->dppclk_khz, clk_mgr->base.clks.dppclk_khz)) {
@@ -281,7 +287,7 @@ static struct wm_table ddr5_wm_table = { { .wm_inst = WM_A, .wm_type = WM_TYPE_PSTATE_CHG, - .pstate_latency_us = 64.0, + .pstate_latency_us = 129.0, .sr_exit_time_us = 11.5, .sr_enter_plus_exit_time_us = 14.5, .valid = true,
@@ -289,7 +295,7 @@ static struct wm_table ddr5_wm_table = { { .wm_inst = WM_B, .wm_type = WM_TYPE_PSTATE_CHG, - .pstate_latency_us = 64.0, + .pstate_latency_us = 129.0, .sr_exit_time_us = 11.5, .sr_enter_plus_exit_time_us = 14.5, .valid = true,
@@ -297,7 +303,7 @@ static struct wm_table ddr5_wm_table = { { .wm_inst = WM_C, .wm_type = WM_TYPE_PSTATE_CHG, - .pstate_latency_us = 64.0, + .pstate_latency_us = 129.0, .sr_exit_time_us = 11.5, .sr_enter_plus_exit_time_us = 14.5, .valid = true,
@@ -305,7 +311,7 @@ static struct wm_table ddr5_wm_table = { { .wm_inst = WM_D, .wm_type = WM_TYPE_PSTATE_CHG, - .pstate_latency_us = 64.0, + .pstate_latency_us = 129.0, .sr_exit_time_us = 11.5, .sr_enter_plus_exit_time_us = 14.5, .valid = true,
Signature · 1 line
2.37.3
PATCH v2 30/47 drm/amd/display: Fix DP MST timeslot issue when fallback happened
In reply to Wayne LinFrom: Cruise Hung <[email protected]>
[Why]
When USB4 DP link training failed and fell back to lower link rate, the time slot calculation uses the verified_link_cap. And the verified_link_cap was not updated to the new one. It caused the wrong VC payload time-slot was allocated.
[How]
Updated verified_link_cap with the new one from cur_link_settings after the LT completes successfully.
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +7 -1
@@ -2758,8 +2758,14 @@ bool perform_link_training_with_retries( skip_video_pattern);/* Transmit idle pattern once training successful. */ -if (status ==LINK_TRAINING_SUCCESS && !is_link_bw_low) +if (status ==LINK_TRAINING_SUCCESS && !is_link_bw_low) {dp_set_hw_test_pattern (link, &pipe_ctx->link_res,DP_TEST_PATTERN_VIDEO_MODE ,NULL ,0 ); +/* Update verified link settings to current one +* Because DPIA LT might fallback to lower link setting. +*/ + link->verified_link_cap.link_rate = link->cur_link_settings.link_rate; + link->verified_link_cap.lane_count = link->cur_link_settings.lane_count; + } }else { status = dc_link_dp_perform_link_training(link, &pipe_ctx->link_res,
Signature · 1 line
2.37.3
PATCH v2 31/47 drm/amd/display: Don't allocate DET for phantom pipes
In reply to Wayne LinFrom: Alvin Lee <[email protected]>
[Why & How]
We should not allocate any DET for the phantom pipes.
--- .../amd/display/dc/dcn32/dcn32_resource_helpers.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c +11 -1
@@ -271,10 +271,20 @@ void dcn32_determine_det_override(struct dc *dc,struct dc_plane_state *current_plane =NULL ;struct pipe_ctx *next_odm_pipe =NULL ;struct pipe_ctx *bottom_pipe =NULL ; +uint8_t stream_count =0 ; + +for (i =0 ; i < context->stream_count; i++) { +/* Don't count SubVP streams for DET allocation */ +if (context->streams[i]->mall_stream_config.type !=SUBVP_PHANTOM ) { + stream_count++; + } + }if (context->stream_count >0 ) { - stream_segments =18 / context->stream_count; + stream_segments =18 / stream_count;for (i =0 ; i < context->stream_count; i++) { +if (context->streams[i]->mall_stream_config.type ==SUBVP_PHANTOM ) +continue ;if (context->stream_status[i].plane_count >0 ) plane_segments = stream_segments / context->stream_status[i].plane_count;else
Signature · 1 line
2.37.3
PATCH v2 32/47 drm/amd/display: Ignore k1/k2 values for virtual signal
In reply to Wayne LinFrom: Rodrigo Siqueira <[email protected]>
[Why and How]
We are hitting k1/k2 assert when we are using a virtual signal in the test; as a result, we are failing some automated tests with a false positive. This commit addresses this issue by ignoring the assert condition if we use SIGNAL_TYPE_VIRTUAL.
--- drivers/gpu/drm/amd/display/dc/dcn314/dcn314_hwseq.c | 3 +++ drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 3 +++ 2 files changed, 6 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_hwseq.c +3 -0
@@ -348,6 +348,9 @@ unsigned int dcn314_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsig two_pix_per_container =optc2_is_two_pixels_per_containter (&stream->timing); odm_combine_factor =get_odm_config (pipe_ctx,NULL ); +if (pipe_ctx->stream->signal ==SIGNAL_TYPE_VIRTUAL ) +return odm_combine_factor; +if (is_dp_128b_132b_signal (pipe_ctx)) { *k2_div =PIXEL_RATE_DIV_BY_1 ; }else if (dc_is_hdmi_tmds_signal (pipe_ctx->stream->signal) ||dc_is_dvi_signal (pipe_ctx->stream->signal)) {
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +3 -0
@@ -1184,6 +1184,9 @@ unsigned int dcn32_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsign two_pix_per_container =optc2_is_two_pixels_per_containter (&stream->timing); odm_combine_factor =get_odm_config (pipe_ctx,NULL ); +if (pipe_ctx->stream->signal ==SIGNAL_TYPE_VIRTUAL ) +return odm_combine_factor; +if (is_dp_128b_132b_signal (pipe_ctx)) { *k2_div =PIXEL_RATE_DIV_BY_1 ; }else if (dc_is_hdmi_tmds_signal (pipe_ctx->stream->signal) ||dc_is_dvi_signal (pipe_ctx->stream->signal)) {
Signature · 1 line
2.37.3
PATCH v2 36/47 drm/amd/display: Enable committing subvp config
In reply to Wayne LinFrom: Aurabindo Pillai <[email protected]>
[Why and How]
Enable committing subvp config through DMCUB for DCN32
--- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +0 -2
@@ -453,7 +453,6 @@ bool dcn32_apply_idle_power_optimizations(struct dc *dc, bool enable)*/ void dcn32_commit_subvp_config (struct dc *dc,struct dc_state *context) { -/* int i;bool enable_subvp = false;
@@ -471,7 +470,6 @@ void dcn32_commit_subvp_config(struct dc *dc, struct dc_state *context) } }dc_dmub_setup_subvp_dmub_command (dc, context, enable_subvp); -*/ }/* Sub-Viewport DMUB lock needs to be acquired by driver whenever SubVP is active and:
Signature · 1 line
2.37.3
PATCH v2 38/47 drm/amd/display: Disable OTG WA for the plane_state NULL case on DCN314
In reply to Wayne LinFrom: Nicholas Kazlauskas <[email protected]>
[Why]
This shouldn't trigger during tiled display hotplug/unplug but it does because one of the tiles can end up with a NULL plane state.
This also doesn't guard against the hang that it was originally trying to resolve, and can instead cause DIO corruption due to OTG sync being lost.
[How]
This was reverted at one point out of DCN31 so revert it here too.
--- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c +1 -2
@@ -136,8 +136,7 @@ static void dcn314_disable_otg_wa(struct clk_mgr *clk_mgr_base, struct dc_stateif (pipe->top_pipe || pipe->prev_odm_pipe)continue ; -if (pipe->stream && (pipe->stream->dpms_off || pipe->plane_state ==NULL || -dc_is_virtual_signal (pipe->stream->signal))) { +if (pipe->stream && (pipe->stream->dpms_off ||dc_is_virtual_signal (pipe->stream->signal))) {if (disable) { pipe->stream_res.tg->funcs->immediate_disable_crtc (pipe->stream_res.tg);reset_sync_context_for_pipe (dc, context, i);
Signature · 1 line
2.37.3
PATCH v2 35/47 drm/amd/display: Assume connectors are on single slot
In reply to Wayne LinFrom: Jaehyun Chung <[email protected]>
[Why]v1_5 display object table has no way for connectors to indicate which slot they are a part of, resulting in additional empty slots to appear in EDID management UI.
[How]
Assume that all connectors belong to the same slot.
--- drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +8 -1
@@ -3346,6 +3346,7 @@ static enum bp_result bios_get_board_layout_info(struct bios_parser *bp;static enum bp_result record_result; +unsigned int max_slots;const unsigned int slot_index_to_vbios_id[MAX_BOARD_SLOTS ] = {GENERICOBJECT_BRACKET_LAYOUT_ENUM_ID1 ,
@@ -3362,8 +3363,14 @@ static enum bp_result bios_get_board_layout_info( } board_layout_info->num_of_slots =0 ; + max_slots =MAX_BOARD_SLOTS ; -for (i =0 ; i <MAX_BOARD_SLOTS ; ++i) { +// Assume single slot on v1_5 +if (bp->object_info_tbl.revision.minor ==5 ) { + max_slots =1 ; + } + +for (i =0 ; i < max_slots; ++i) { record_result =get_bracket_layout_record (dcb, slot_index_to_vbios_id[i], &board_layout_info->slots[i]);
Signature · 1 line
2.37.3
PATCH v2 37/47 drm/amd/display: Add shift and mask for ICH_RESET_AT_END_OF_LINE
In reply to Wayne LinFrom: Daniel Miess <[email protected]>
[Why]
DP DSC compliance failing for dcn314 due to ICH_RESET_AT_END_OF_LINE shift and mask being missing
[How]
Add in shift and mask for ICH_RESET_AT_END_OF_LINE
--- .../gpu/drm/amd/display/dc/dcn20/dcn20_dsc.h | 220 ------------------ .../amd/display/dc/dcn314/dcn314_resource.c | 9 +- 2 files changed, 6 insertions(+), 223 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.h +0 -220
@@ -445,226 +445,6 @@type DSCRM_DSC_FORWARD_EN ; \ type DSCRM_DSC_OPP_PIPE_SOURCE -#define DSC_REG_LIST_DCN314 (id) \ - SRI(DSC_TOP_CONTROL, DSC_TOP, id),\ - SRI(DSC_DEBUG_CONTROL, DSC_TOP, id),\ - SRI(DSCC_CONFIG0, DSCC, id),\ - SRI(DSCC_CONFIG1, DSCC, id),\ - SRI(DSCC_STATUS, DSCC, id),\ - SRI(DSCC_INTERRUPT_CONTROL_STATUS, DSCC, id),\ - SRI(DSCC_PPS_CONFIG0, DSCC, id),\ - SRI(DSCC_PPS_CONFIG1, DSCC, id),\ - SRI(DSCC_PPS_CONFIG2, DSCC, id),\ - SRI(DSCC_PPS_CONFIG3, DSCC, id),\ - SRI(DSCC_PPS_CONFIG4, DSCC, id),\ - SRI(DSCC_PPS_CONFIG5, DSCC, id),\ - SRI(DSCC_PPS_CONFIG6, DSCC, id),\ - SRI(DSCC_PPS_CONFIG7, DSCC, id),\ - SRI(DSCC_PPS_CONFIG8, DSCC, id),\ - SRI(DSCC_PPS_CONFIG9, DSCC, id),\ - SRI(DSCC_PPS_CONFIG10, DSCC, id),\ - SRI(DSCC_PPS_CONFIG11, DSCC, id),\ - SRI(DSCC_PPS_CONFIG12, DSCC, id),\ - SRI(DSCC_PPS_CONFIG13, DSCC, id),\ - SRI(DSCC_PPS_CONFIG14, DSCC, id),\ - SRI(DSCC_PPS_CONFIG15, DSCC, id),\ - SRI(DSCC_PPS_CONFIG16, DSCC, id),\ - SRI(DSCC_PPS_CONFIG17, DSCC, id),\ - SRI(DSCC_PPS_CONFIG18, DSCC, id),\ - SRI(DSCC_PPS_CONFIG19, DSCC, id),\ - SRI(DSCC_PPS_CONFIG20, DSCC, id),\ - SRI(DSCC_PPS_CONFIG21, DSCC, id),\ - SRI(DSCC_PPS_CONFIG22, DSCC, id),\ - SRI(DSCC_MEM_POWER_CONTROL, DSCC, id),\ - SRI(DSCC_R_Y_SQUARED_ERROR_LOWER, DSCC, id),\ - SRI(DSCC_R_Y_SQUARED_ERROR_UPPER, DSCC, id),\ - SRI(DSCC_G_CB_SQUARED_ERROR_LOWER, DSCC, id),\ - SRI(DSCC_G_CB_SQUARED_ERROR_UPPER, DSCC, id),\ - SRI(DSCC_B_CR_SQUARED_ERROR_LOWER, DSCC, id),\ - SRI(DSCC_B_CR_SQUARED_ERROR_UPPER, DSCC, id),\ - SRI(DSCC_MAX_ABS_ERROR0, DSCC, id),\ - SRI(DSCC_MAX_ABS_ERROR1, DSCC, id),\ - SRI(DSCC_RATE_BUFFER0_MAX_FULLNESS_LEVEL, DSCC, id),\ - SRI(DSCC_RATE_BUFFER1_MAX_FULLNESS_LEVEL, DSCC, id),\ - SRI(DSCC_RATE_BUFFER2_MAX_FULLNESS_LEVEL, DSCC, id),\ - SRI(DSCC_RATE_BUFFER3_MAX_FULLNESS_LEVEL, DSCC, id),\ - SRI(DSCC_RATE_CONTROL_BUFFER0_MAX_FULLNESS_LEVEL, DSCC, id),\ - SRI(DSCC_RATE_CONTROL_BUFFER1_MAX_FULLNESS_LEVEL, DSCC, id),\ - SRI(DSCC_RATE_CONTROL_BUFFER2_MAX_FULLNESS_LEVEL, DSCC, id),\ - SRI(DSCC_RATE_CONTROL_BUFFER3_MAX_FULLNESS_LEVEL, DSCC, id),\ - SRI(DSCCIF_CONFIG0, DSCCIF, id),\ - SRI(DSCCIF_CONFIG1, DSCCIF, id),\ - SRI(DSCRM_DSC_FORWARD_CONFIG, DSCRM, id) - -#define DSC_REG_LIST_SH_MASK_DCN314 (mask_sh)\ - DSC_SF(DSC_TOP0_DSC_TOP_CONTROL, DSC_CLOCK_EN, mask_sh), \ - DSC_SF(DSC_TOP0_DSC_TOP_CONTROL, DSC_DISPCLK_R_GATE_DIS, mask_sh), \ - DSC_SF(DSC_TOP0_DSC_TOP_CONTROL, DSC_DSCCLK_R_GATE_DIS, mask_sh), \ - DSC_SF(DSC_TOP0_DSC_DEBUG_CONTROL, DSC_DBG_EN, mask_sh), \ - DSC_SF(DSC_TOP0_DSC_DEBUG_CONTROL, DSC_TEST_CLOCK_MUX_SEL, mask_sh), \ - DSC_SF(DSCC0_DSCC_CONFIG0, NUMBER_OF_SLICES_PER_LINE, mask_sh), \ - DSC_SF(DSCC0_DSCC_CONFIG0, ALTERNATE_ICH_ENCODING_EN, mask_sh), \ - DSC_SF(DSCC0_DSCC_CONFIG0, NUMBER_OF_SLICES_IN_VERTICAL_DIRECTION, mask_sh), \ - DSC_SF(DSCC0_DSCC_CONFIG1, DSCC_RATE_CONTROL_BUFFER_MODEL_SIZE, mask_sh), \ -/*DSC_SF(DSCC0_DSCC_CONFIG1, DSCC_DISABLE_ICH, mask_sh),*/ \ -DSC_SF (DSCC0_DSCC_STATUS ,DSCC_DOUBLE_BUFFER_REG_UPDATE_PENDING , mask_sh), \ -DSC_SF (DSCC0_DSCC_INTERRUPT_CONTROL_STATUS ,DSCC_RATE_BUFFER0_OVERFLOW_OCCURRED , mask_sh), \ -DSC_SF (DSCC0_DSCC_INTERRUPT_CONTROL_STATUS ,DSCC_RATE_BUFFER1_OVERFLOW_OCCURRED , mask_sh), \ -DSC_SF (DSCC0_DSCC_INTERRUPT_CONTROL_STATUS ,DSCC_RATE_BUFFER2_OVERFLOW_OCCURRED , mask_sh), \ -DSC_SF (DSCC0_DSCC_INTERRUPT_CONTROL_STATUS ,DSCC_RATE_BUFFER3_OVERFLOW_OCCURRED , mask_sh), \ -DSC_SF (DSCC0_DSCC_INTERRUPT_CONTROL_STATUS ,DSCC_RATE_BUFFER0_UNDERFLOW_OCCURRED , mask_sh), \ -DSC_SF (DSCC0_DSCC_INTERRUPT_CONTROL_STATUS ,DSCC_RATE_BUFFER1_UNDERFLOW_OCCURRED , mask_sh), \ -DSC_SF (DSCC0_DSCC_INTERRUPT_CONTROL_STATUS ,DSCC_RATE_BUFFER2_UNDERFLOW_OCCURRED , mask_sh), \ -DSC_SF (DSCC0_DSCC_INTERRUPT_CONTROL_STATUS ,DSCC_RATE_BUFFER3_UNDERFLOW_OCCURRED , mask_sh), \ -DSC_SF (DSCC0_DSCC_INTERRUPT_CONTROL_STATUS ,DSCC_RATE_CONTROL_BUFFER_MODEL0_OVERFLOW_OCCURRED , mask_sh), \ -DSC_SF (DSCC0_DSCC_INTERRUPT_CONTROL_STATUS ,DSCC_RATE_CONTROL_BUFFER_MODEL1_OVERFLOW_OCCURRED , mask_sh), \ -DSC_SF (DSCC0_DSCC_INTERRUPT_CONTROL_STATUS ,DSCC_RATE_CONTROL_BUFFER_MODEL2_OVERFLOW_OCCURRED , mask_sh), \ -DSC_SF (DSCC0_DSCC_INTERRUPT_CONTROL_STATUS ,DSCC_RATE_CONTROL_BUFFER_MODEL3_OVERFLOW_OCCURRED , mask_sh), \ -DSC_SF (DSCC0_DSCC_INTERRUPT_CONTROL_STATUS ,DSCC_RATE_BUFFER0_OVERFLOW_OCCURRED_INT_EN , mask_sh), \ -DSC_SF (DSCC0_DSCC_INTERRUPT_CONTROL_STATUS ,DSCC_RATE_BUFFER1_OVERFLOW_OCCURRED_INT_EN , mask_sh), \ -DSC_SF (DSCC0_DSCC_INTERRUPT_CONTROL_STATUS ,DSCC_RATE_BUFFER2_OVERFLOW_OCCURRED_INT_EN , mask_sh), \ -DSC_SF (DSCC0_DSCC_INTERRUPT_CONTROL_STATUS ,DSCC_RATE_BUFFER3_OVERFLOW_OCCURRED_INT_EN , mask_sh), \ -DSC_SF (DSCC0_DSCC_INTERRUPT_CONTROL_STATUS ,DSCC_RATE_BUFFER0_UNDERFLOW_OCCURRED_INT_EN , mask_sh), \ -DSC_SF (DSCC0_DSCC_INTERRUPT_CONTROL_STATUS ,DSCC_RATE_BUFFER1_UNDERFLOW_OCCURRED_INT_EN , mask_sh), \ -DSC_SF (DSCC0_DSCC_INTERRUPT_CONTROL_STATUS ,DSCC_RATE_BUFFER2_UNDERFLOW_OCCURRED_INT_EN , mask_sh), \ -DSC_SF (DSCC0_DSCC_INTERRUPT_CONTROL_STATUS ,DSCC_RATE_BUFFER3_UNDERFLOW_OCCURRED_INT_EN , mask_sh), \ -DSC_SF (DSCC0_DSCC_INTERRUPT_CONTROL_STATUS ,DSCC_RATE_CONTROL_BUFFER_MODEL0_OVERFLOW_OCCURRED_INT_EN , mask_sh), \ -DSC_SF (DSCC0_DSCC_INTERRUPT_CONTROL_STATUS ,DSCC_RATE_CONTROL_BUFFER_MODEL1_OVERFLOW_OCCURRED_INT_EN , mask_sh), \ -DSC_SF (DSCC0_DSCC_INTERRUPT_CONTROL_STATUS ,DSCC_RATE_CONTROL_BUFFER_MODEL2_OVERFLOW_OCCURRED_INT_EN , mask_sh), \ -DSC_SF (DSCC0_DSCC_INTERRUPT_CONTROL_STATUS ,DSCC_RATE_CONTROL_BUFFER_MODEL3_OVERFLOW_OCCURRED_INT_EN , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG0 ,DSC_VERSION_MINOR , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG0 ,DSC_VERSION_MAJOR , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG0 ,PPS_IDENTIFIER , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG0 ,LINEBUF_DEPTH , mask_sh), \ -DSC2_SF (DSCC0 ,DSCC_PPS_CONFIG0__BITS_PER_COMPONENT , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG1 ,BITS_PER_PIXEL , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG1 ,VBR_ENABLE , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG1 ,SIMPLE_422 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG1 ,CONVERT_RGB , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG1 ,BLOCK_PRED_ENABLE , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG1 ,NATIVE_422 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG1 ,NATIVE_420 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG1 ,CHUNK_SIZE , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG2 ,PIC_WIDTH , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG2 ,PIC_HEIGHT , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG3 ,SLICE_WIDTH , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG3 ,SLICE_HEIGHT , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG4 ,INITIAL_XMIT_DELAY , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG4 ,INITIAL_DEC_DELAY , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG5 ,INITIAL_SCALE_VALUE , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG5 ,SCALE_INCREMENT_INTERVAL , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG6 ,SCALE_DECREMENT_INTERVAL , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG6 ,FIRST_LINE_BPG_OFFSET , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG6 ,SECOND_LINE_BPG_OFFSET , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG7 ,NFL_BPG_OFFSET , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG7 ,SLICE_BPG_OFFSET , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG8 ,NSL_BPG_OFFSET , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG8 ,SECOND_LINE_OFFSET_ADJ , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG9 ,INITIAL_OFFSET , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG9 ,FINAL_OFFSET , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG10 ,FLATNESS_MIN_QP , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG10 ,FLATNESS_MAX_QP , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG10 ,RC_MODEL_SIZE , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG11 ,RC_EDGE_FACTOR , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG11 ,RC_QUANT_INCR_LIMIT0 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG11 ,RC_QUANT_INCR_LIMIT1 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG11 ,RC_TGT_OFFSET_LO , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG11 ,RC_TGT_OFFSET_HI , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG12 ,RC_BUF_THRESH0 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG12 ,RC_BUF_THRESH1 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG12 ,RC_BUF_THRESH2 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG12 ,RC_BUF_THRESH3 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG13 ,RC_BUF_THRESH4 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG13 ,RC_BUF_THRESH5 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG13 ,RC_BUF_THRESH6 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG13 ,RC_BUF_THRESH7 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG14 ,RC_BUF_THRESH8 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG14 ,RC_BUF_THRESH9 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG14 ,RC_BUF_THRESH10 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG14 ,RC_BUF_THRESH11 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG15 ,RC_BUF_THRESH12 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG15 ,RC_BUF_THRESH13 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG15 ,RANGE_MIN_QP0 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG15 ,RANGE_MAX_QP0 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG15 ,RANGE_BPG_OFFSET0 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG16 ,RANGE_MIN_QP1 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG16 ,RANGE_MAX_QP1 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG16 ,RANGE_BPG_OFFSET1 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG16 ,RANGE_MIN_QP2 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG16 ,RANGE_MAX_QP2 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG16 ,RANGE_BPG_OFFSET2 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG17 ,RANGE_MIN_QP3 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG17 ,RANGE_MAX_QP3 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG17 ,RANGE_BPG_OFFSET3 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG17 ,RANGE_MIN_QP4 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG17 ,RANGE_MAX_QP4 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG17 ,RANGE_BPG_OFFSET4 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG18 ,RANGE_MIN_QP5 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG18 ,RANGE_MAX_QP5 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG18 ,RANGE_BPG_OFFSET5 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG18 ,RANGE_MIN_QP6 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG18 ,RANGE_MAX_QP6 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG18 ,RANGE_BPG_OFFSET6 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG19 ,RANGE_MIN_QP7 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG19 ,RANGE_MAX_QP7 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG19 ,RANGE_BPG_OFFSET7 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG19 ,RANGE_MIN_QP8 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG19 ,RANGE_MAX_QP8 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG19 ,RANGE_BPG_OFFSET8 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG20 ,RANGE_MIN_QP9 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG20 ,RANGE_MAX_QP9 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG20 ,RANGE_BPG_OFFSET9 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG20 ,RANGE_MIN_QP10 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG20 ,RANGE_MAX_QP10 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG20 ,RANGE_BPG_OFFSET10 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG21 ,RANGE_MIN_QP11 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG21 ,RANGE_MAX_QP11 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG21 ,RANGE_BPG_OFFSET11 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG21 ,RANGE_MIN_QP12 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG21 ,RANGE_MAX_QP12 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG21 ,RANGE_BPG_OFFSET12 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG22 ,RANGE_MIN_QP13 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG22 ,RANGE_MAX_QP13 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG22 ,RANGE_BPG_OFFSET13 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG22 ,RANGE_MIN_QP14 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG22 ,RANGE_MAX_QP14 , mask_sh), \ -DSC_SF (DSCC0_DSCC_PPS_CONFIG22 ,RANGE_BPG_OFFSET14 , mask_sh), \ -DSC_SF (DSCC0_DSCC_MEM_POWER_CONTROL ,DSCC_DEFAULT_MEM_LOW_POWER_STATE , mask_sh), \ -DSC_SF (DSCC0_DSCC_MEM_POWER_CONTROL ,DSCC_MEM_PWR_FORCE , mask_sh), \ -DSC_SF (DSCC0_DSCC_MEM_POWER_CONTROL ,DSCC_MEM_PWR_DIS , mask_sh), \ -DSC_SF (DSCC0_DSCC_MEM_POWER_CONTROL ,DSCC_MEM_PWR_STATE , mask_sh), \ -DSC_SF (DSCC0_DSCC_MEM_POWER_CONTROL ,DSCC_NATIVE_422_MEM_PWR_FORCE , mask_sh), \ -DSC_SF (DSCC0_DSCC_MEM_POWER_CONTROL ,DSCC_NATIVE_422_MEM_PWR_DIS , mask_sh), \ -DSC_SF (DSCC0_DSCC_MEM_POWER_CONTROL ,DSCC_NATIVE_422_MEM_PWR_STATE , mask_sh), \ -DSC_SF (DSCC0_DSCC_R_Y_SQUARED_ERROR_LOWER ,DSCC_R_Y_SQUARED_ERROR_LOWER , mask_sh), \ -DSC_SF (DSCC0_DSCC_R_Y_SQUARED_ERROR_UPPER ,DSCC_R_Y_SQUARED_ERROR_UPPER , mask_sh), \ -DSC_SF (DSCC0_DSCC_G_CB_SQUARED_ERROR_LOWER ,DSCC_G_CB_SQUARED_ERROR_LOWER , mask_sh), \ -DSC_SF (DSCC0_DSCC_G_CB_SQUARED_ERROR_UPPER ,DSCC_G_CB_SQUARED_ERROR_UPPER , mask_sh), \ -DSC_SF (DSCC0_DSCC_B_CR_SQUARED_ERROR_LOWER ,DSCC_B_CR_SQUARED_ERROR_LOWER , mask_sh), \ -DSC_SF (DSCC0_DSCC_B_CR_SQUARED_ERROR_UPPER ,DSCC_B_CR_SQUARED_ERROR_UPPER , mask_sh), \ -DSC_SF (DSCC0_DSCC_MAX_ABS_ERROR0 ,DSCC_R_Y_MAX_ABS_ERROR , mask_sh), \ -DSC_SF (DSCC0_DSCC_MAX_ABS_ERROR0 ,DSCC_G_CB_MAX_ABS_ERROR , mask_sh), \ -DSC_SF (DSCC0_DSCC_MAX_ABS_ERROR1 ,DSCC_B_CR_MAX_ABS_ERROR , mask_sh), \ -DSC_SF (DSCC0_DSCC_RATE_BUFFER0_MAX_FULLNESS_LEVEL ,DSCC_RATE_BUFFER0_MAX_FULLNESS_LEVEL , mask_sh), \ -DSC_SF (DSCC0_DSCC_RATE_BUFFER1_MAX_FULLNESS_LEVEL ,DSCC_RATE_BUFFER1_MAX_FULLNESS_LEVEL , mask_sh), \ -DSC_SF (DSCC0_DSCC_RATE_BUFFER2_MAX_FULLNESS_LEVEL ,DSCC_RATE_BUFFER2_MAX_FULLNESS_LEVEL , mask_sh), \ -DSC_SF (DSCC0_DSCC_RATE_BUFFER3_MAX_FULLNESS_LEVEL ,DSCC_RATE_BUFFER3_MAX_FULLNESS_LEVEL , mask_sh), \ -DSC_SF (DSCC0_DSCC_RATE_CONTROL_BUFFER0_MAX_FULLNESS_LEVEL ,DSCC_RATE_CONTROL_BUFFER0_MAX_FULLNESS_LEVEL , mask_sh), \ -DSC_SF (DSCC0_DSCC_RATE_CONTROL_BUFFER1_MAX_FULLNESS_LEVEL ,DSCC_RATE_CONTROL_BUFFER1_MAX_FULLNESS_LEVEL , mask_sh), \ -DSC_SF (DSCC0_DSCC_RATE_CONTROL_BUFFER2_MAX_FULLNESS_LEVEL ,DSCC_RATE_CONTROL_BUFFER2_MAX_FULLNESS_LEVEL , mask_sh), \ -DSC_SF (DSCC0_DSCC_RATE_CONTROL_BUFFER3_MAX_FULLNESS_LEVEL ,DSCC_RATE_CONTROL_BUFFER3_MAX_FULLNESS_LEVEL , mask_sh), \ -DSC_SF (DSCCIF0_DSCCIF_CONFIG0 ,INPUT_INTERFACE_UNDERFLOW_RECOVERY_EN , mask_sh), \ -DSC_SF (DSCCIF0_DSCCIF_CONFIG0 ,INPUT_INTERFACE_UNDERFLOW_OCCURRED_INT_EN , mask_sh), \ -DSC_SF (DSCCIF0_DSCCIF_CONFIG0 ,INPUT_INTERFACE_UNDERFLOW_OCCURRED_STATUS , mask_sh), \ -DSC_SF (DSCCIF0_DSCCIF_CONFIG0 ,INPUT_PIXEL_FORMAT , mask_sh), \ -DSC2_SF (DSCCIF0 ,DSCCIF_CONFIG0__BITS_PER_COMPONENT , mask_sh), \ -DSC_SF (DSCCIF0_DSCCIF_CONFIG0 ,DOUBLE_BUFFER_REG_UPDATE_PENDING , mask_sh), \ -DSC_SF (DSCCIF0_DSCCIF_CONFIG1 ,PIC_WIDTH , mask_sh), \ -DSC_SF (DSCCIF0_DSCCIF_CONFIG1 ,PIC_HEIGHT , mask_sh), \ -DSC_SF (DSCRM0_DSCRM_DSC_FORWARD_CONFIG ,DSCRM_DSC_FORWARD_EN , mask_sh), \ - DSC_SF(DSCRM0_DSCRM_DSC_FORWARD_CONFIG, DSCRM_DSC_OPP_PIPE_SOURCE, mask_sh) - -struct dcn20_dsc_registers {uint32_t DSC_TOP_CONTROL;uint32_t DSC_DEBUG_CONTROL;
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +6 -3
@@ -87,6 +87,9 @@#define DCHUBBUB_DEBUG_CTRL_0__DET_DEPTH__SHIFT 0x10#define DCHUBBUB_DEBUG_CTRL_0__DET_DEPTH_MASK 0x01FF0000L +#define DSCC0_DSCC_CONFIG0__ICH_RESET_AT_END_OF_LINE__SHIFT 0x0 +#define DSCC0_DSCC_CONFIG0__ICH_RESET_AT_END_OF_LINE_MASK 0x0000000FL +#include "reg_helper.h" #include "dce/dmub_abm.h" #include "dce/dmub_psr.h"
@@ -579,7 +582,7 @@ static const struct dcn30_mmhubbub_mask mcif_wb30_mask = {#define dsc_regsDCN314 (id)\ [id] = {\ - DSC_REG_LIST_DCN314(id)\ + DSC_REG_LIST_DCN20(id)\ }static const struct dcn20_dsc_registers dsc_regs[] = {
@@ -590,11 +593,11 @@ static const struct dcn20_dsc_registers dsc_regs[] = { };static const struct dcn20_dsc_shift dsc_shift = { -DSC_REG_LIST_SH_MASK_DCN314 (__SHIFT) +DSC_REG_LIST_SH_MASK_DCN20 (__SHIFT) };static const struct dcn20_dsc_mask dsc_mask = { -DSC_REG_LIST_SH_MASK_DCN314 (_MASK) +DSC_REG_LIST_SH_MASK_DCN20 (_MASK) };static const struct dcn30_mpc_registers mpc_regs = {
Signature · 1 line
2.37.3
PATCH v2 39/47 drm/amd/display: Modify DML to adjust Vstartup Position
In reply to Wayne LinFrom: muansari <[email protected]>
[WHY]
The Vstartup position should be as late as possible to maximize power saving with the current. Calculation of Vstartup in DML does not take into account as SDP signal.
[HOW]
Made necessary changes to calculate the correct Vstartup position in DML to account for AS SDP
* Overriding the VBlankNom value in certain cases otherwise it will use the default value
* Bypassing the condition for adjust_sync_Vstartup
* Overriding vblank_nom_input with VBlankNom that is set in the SW Layer
--- drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c | 2 ++ .../gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c | 2 +- drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h | 1 + drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c | 1 + 4 files changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c +2 -0
@@ -323,6 +323,8 @@ int dcn314_populate_dml_pipes_from_context_fpu(struct dc *dc, struct dc_state *c pipes[pipe_cnt].pipe.src.dcc_fraction_of_zs_req_luma =0 ; pipes[pipe_cnt].pipe.src.dcc_fraction_of_zs_req_chroma =0 ; pipes[pipe_cnt].pipe.dest.vfront_porch = timing->v_front_porch; + pipes[pipe_cnt].pipe.dest.vblank_nom = + dcn3_14_ip.VBlankNomDefaultUS / (timing->h_total / (timing->pix_clk_100hz /10000.0 )); pipes[pipe_cnt].pipe.src.dcc_rate =3 ; pipes[pipe_cnt].dout.dsc_input_bpc =0 ;
drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c +1 -1
@@ -7407,7 +7407,7 @@ static unsigned int CalculateMaxVStartup(double line_time_us = HTotal / PixelClock;unsigned int vblank_actual = VTotal - VActive;unsigned int vblank_nom_default_in_line =dml_floor (VBlankNomDefaultUS / line_time_us,1.0 ); -unsigned int vblank_nom_input =dml_min (VBlankNom, vblank_nom_default_in_line); +unsigned int vblank_nom_input = VBlankNom;//dml_min(VBlankNom, vblank_nom_default_in_line); unsigned int vblank_avail = vblank_nom_input ==0 ? vblank_nom_default_in_line : vblank_nom_input; vblank_size = (unsigned int )dml_min (vblank_actual, vblank_avail);
drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h +1 -0
@@ -510,6 +510,7 @@ struct _vcs_dpi_display_pipe_dest_params_st {unsigned int htotal;unsigned int vtotal;unsigned int vfront_porch; +unsigned int vblank_nom;unsigned int vactive;unsigned int hactive;unsigned int vstartup_start;
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c +1 -0
@@ -597,6 +597,7 @@ static void fetch_pipe_params(struct display_mode_lib *mode_lib) mode_lib->vba.HTotal[mode_lib->vba.NumberOfActivePlanes] = dst->htotal; mode_lib->vba.VTotal[mode_lib->vba.NumberOfActivePlanes] = dst->vtotal; mode_lib->vba.VFrontPorch[mode_lib->vba.NumberOfActivePlanes] = dst->vfront_porch; + mode_lib->vba.VBlankNom[mode_lib->vba.NumberOfActivePlanes] = dst->vblank_nom; mode_lib->vba.DCCFractionOfZeroSizeRequestsLuma[mode_lib->vba.NumberOfActivePlanes] = src->dcc_fraction_of_zs_req_luma; mode_lib->vba.DCCFractionOfZeroSizeRequestsChroma[mode_lib->vba.NumberOfActivePlanes] = src->dcc_fraction_of_zs_req_chroma; mode_lib->vba.DCCEnable[mode_lib->vba.NumberOfActivePlanes] =
Signature · 1 line
2.37.3
PATCH v2 41/47 drm/amd/display: log vertical interrupt 1 for debug
In reply to Wayne LinFrom: Josip Pavic <[email protected]>
[Why & How]
Extend existing OTG state collection function to include the vertical interrupt 1 state.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 6 ++++++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h | 2 ++ 2 files changed, 8 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c +6 -0
@@ -1393,6 +1393,12 @@ void optc1_read_otg_state(struct optc *optc1,REG_GET (OPTC_INPUT_GLOBAL_CONTROL ,OPTC_UNDERFLOW_OCCURRED_STATUS , &s->underflow_occurred_status); +REG_GET (OTG_VERTICAL_INTERRUPT1_CONTROL , +OTG_VERTICAL_INTERRUPT1_INT_ENABLE , &s->vertical_interrupt1_en); + +REG_GET (OTG_VERTICAL_INTERRUPT1_POSITION , +OTG_VERTICAL_INTERRUPT1_LINE_START , &s->vertical_interrupt1_line); +REG_GET (OTG_VERTICAL_INTERRUPT2_CONTROL ,OTG_VERTICAL_INTERRUPT2_INT_ENABLE , &s->vertical_interrupt2_en);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h +2 -0
@@ -583,6 +583,8 @@ struct dcn_otg_state {uint32_t underflow_occurred_status;uint32_t otg_enabled;uint32_t blank_enabled; +uint32_t vertical_interrupt1_en; +uint32_t vertical_interrupt1_line;uint32_t vertical_interrupt2_en;uint32_t vertical_interrupt2_line; };
Signature · 1 line
2.37.3
PATCH v2 43/47 drm/amd/display: update dccg based on HW delta
In reply to Wayne LinFrom: Charlene Liu <[email protected]>
[why]
update hw dccg based on HW delta, and reuse common src code
--- .../gpu/drm/amd/display/dc/dcn20/dcn20_dccg.h | 1 + .../drm/amd/display/dc/dcn201/dcn201_hwseq.c | 3 +- .../drm/amd/display/dc/dcn314/dcn314_dccg.h | 70 ++++++++++++++----- 3 files changed, 55 insertions(+), 19 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dccg.h +1 -0
@@ -274,6 +274,7 @@ struct dccg_registers {uint32_t DSCCLK2_DTO_PARAM ;uint32_t DPSTREAMCLK_ROOT_GATE_DISABLE ;uint32_t DPSTREAMCLK_GATE_DISABLE ; +uint32_t DCCG_GATE_DISABLE_CNTL ;uint32_t DCCG_GATE_DISABLE_CNTL2 ;uint32_t DCCG_GATE_DISABLE_CNTL3 ;uint32_t HDMISTREAMCLK0_DTO_PARAM ;
drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c +2 -1
@@ -82,7 +82,7 @@ static bool patch_address_for_sbs_tb_stereo(return false; } -static void gpu_addr_to_uma (struct dce_hwseq *hwseq, +static bool gpu_addr_to_uma (struct dce_hwseq *hwseq,PHYSICAL_ADDRESS_LOC *addr) {bool is_in_uma;
@@ -98,6 +98,7 @@ static void gpu_addr_to_uma(struct dce_hwseq *hwseq, }else { is_in_uma = false; } +return is_in_uma; } static void plane_address_in_gpu_space_to_uma(struct dce_hwseq *hwseq,
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.h +52 -18
100 lines not on this page · raw message
Signature · 1 line
2.37.3
PATCH v2 42/47 drm/amd/display: Do second pass through DML for DET calculation
In reply to Wayne LinFrom: Alvin Lee <[email protected]>
[Why & How]
If we find that DML requires pipe split, run through DML again because the DET allocation per pipe must be re-assigned.
--- .../drm/amd/display/dc/dcn32/dcn32_resource.c | 26 +----- .../drm/amd/display/dc/dcn32/dcn32_resource.h | 9 +- .../display/dc/dcn32/dcn32_resource_helpers.c | 89 ++++++++++++------- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 14 ++- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.h | 5 -- 5 files changed, 76 insertions(+), 67 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +1 -25
@@ -1837,12 +1837,6 @@ bool dcn32_validate_bandwidth(struct dc *dc,return out; } - -static bool is_dual_plane (enum surface_pixel_format format) -{ -return format >=SURFACE_PIXEL_FORMAT_VIDEO_BEGIN || format ==SURFACE_PIXEL_FORMAT_GRPH_RGBE_ALPHA ; -} - int dcn32_populate_dml_pipes_from_context( struct dc *dc, struct dc_state *context, display_e2e_pipe_params_st *pipes,
@@ -1852,7 +1846,6 @@ int dcn32_populate_dml_pipes_from_context(struct resource_context *res_ctx = &context->res_ctx;struct pipe_ctx *pipe;bool subvp_in_use = false; -uint8_t is_pipe_split_expected[MAX_PIPES ] = {0 };int plane_count =0 ;struct dc_crtc_timing *timing;
@@ -1940,11 +1933,6 @@ int dcn32_populate_dml_pipes_from_context(if (pipe->stream && !pipe->prev_odm_pipe && (!pipe->top_pipe || pipe->top_pipe->plane_state != pipe->plane_state)) ++plane_count; - -DC_FP_START (); - is_pipe_split_expected[i] =dcn32_predict_pipe_split (context, &pipes[pipe_cnt]); -DC_FP_END (); - pipe_cnt++; }
@@ -1952,19 +1940,7 @@ int dcn32_populate_dml_pipes_from_context(* the DET available for each pipe). Use the DET override input to maintain our driver * policy. */ -if (pipe_cnt ==1 && !is_pipe_split_expected[0 ]) { - pipes[0 ].pipe.src.det_size_override =DCN3_2_MAX_DET_SIZE ; -if (pipe->plane_state && !dc->debug.disable_z9_mpc) { -if (!is_dual_plane (pipe->plane_state->format)) { - pipes[0 ].pipe.src.det_size_override =DCN3_2_DEFAULT_DET_SIZE ; - pipes[0 ].pipe.src.unbounded_req_mode = true; -if (pipe->plane_state->src_rect.width >=5120 && - pipe->plane_state->src_rect.height >=2880 ) - pipes[0 ].pipe.src.det_size_override =320 ;// 5K or higher - } - } - }else -dcn32_determine_det_override (dc, context, pipes, is_pipe_split_expected); +dcn32_set_det_allocations (dc, context, pipes);// In general cases we want to keep the dram clock change requirement // (prefer configs that support MCLK switch). Only override to false
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.h +7 -2
@@ -28,6 +28,10 @@#include "core_types.h" +#define DCN3_2_DEFAULT_DET_SIZE 256 +#define DCN3_2_MAX_DET_SIZE 1152 +#define DCN3_2_MIN_DET_SIZE 128 +#define DCN3_2_MIN_COMPBUF_SIZE_KB 128#define DCN3_2_DET_SEG_SIZE 64#define DCN3_2_MALL_MBLK_SIZE_BYTES 65536 // 64 * 1024#define DCN3_2_MBLK_WIDTH 128
@@ -111,9 +115,10 @@ struct pipe_ctx *dcn32_acquire_idle_pipe_for_head_pipe_in_layer(void dcn32_determine_det_override (struct dc *dc,struct dc_state *context, -display_e2e_pipe_params_st *pipes, -uint8_t *is_pipe_split_expected); +display_e2e_pipe_params_st *pipes); +void dcn32_set_det_allocations (struct dc *dc,struct dc_state *context, +display_e2e_pipe_params_st *pipes);/* definitions for run time init of reg offsets */ /* CLK SRC */
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c +55 -34
134 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +13 -1
@@ -1720,8 +1720,20 @@ bool dcn32_internal_validate_bw(struct dc *dc, goto validate_fail; } -if (repopulate_pipes) +if (repopulate_pipes) { pipe_cnt = dc->res_pool->funcs->populate_dml_pipes (dc, context, pipes, fast_validate); + +/* repopulate_pipes = 1 means the pipes were either split or merged. In this case +* we have to re-calculate the DET allocation and run through DML once more to +* ensure all the params are calculated correctly. We do not need to run the +* pipe split check again after this call (pipes are already split / merged). +* */ +if (!fast_validate) { + context->bw_ctx.dml.soc.allow_for_pstate_or_stutter_in_vblank_final = + dm_prefetch_support_uclk_fclk_and_stutter_if_possible; + vlevel =dml_get_voltage_level (&context->bw_ctx.dml, pipes, pipe_cnt); + } + } *vlevel_out = vlevel; *pipe_cnt_out = pipe_cnt;
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.h +0 -5
@@ -29,11 +29,6 @@#include "clk_mgr_internal.h" -#define DCN3_2_DEFAULT_DET_SIZE 256 -#define DCN3_2_MAX_DET_SIZE 1152 -#define DCN3_2_MIN_DET_SIZE 128 -#define DCN3_2_MIN_COMPBUF_SIZE_KB 128 -void dcn32_build_wm_range_table_fpu (struct clk_mgr_internal *clk_mgr); void dcn32_helper_populate_phantom_dlg_params(struct dc *dc,
Signature · 1 line
2.37.3
PATCH v2 40/47 drm/amd/display: Revise Sink device string ID
In reply to Wayne LinFrom: Robin Chen <[email protected]>
[Why]
The Sink device string ID1/ID2 use 5 bytes instead of 6 bytes, so the driver should compare the first 5 bytes only.
--- drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 7 ++++--- drivers/gpu/drm/amd/display/include/ddc_service_types.h | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c +4 -3
@@ -393,17 +393,18 @@ static bool dmub_psr_copy_settings(struct dmub_psr *dmub,if (copy_settings_data->dsc_enable_status && link->dpcd_caps.sink_dev_id ==DP_DEVICE_ID_38EC11 && !memcmp (link->dpcd_caps.sink_dev_id_str,DP_SINK_DEVICE_STR_ID_1 , -sizeof (link->dpcd_caps.sink_dev_id_str))) +sizeof (DP_SINK_DEVICE_STR_ID_1 ))) link->psr_settings.force_ffu_mode =1 ;else link->psr_settings.force_ffu_mode =0 ; copy_settings_data->force_ffu_mode = link->psr_settings.force_ffu_mode;if (link->fec_state == dc_link_fec_enabled && + link->dpcd_caps.sink_dev_id ==DP_DEVICE_ID_38EC11 && (!memcmp (link->dpcd_caps.sink_dev_id_str,DP_SINK_DEVICE_STR_ID_1 , -sizeof (link->dpcd_caps.sink_dev_id_str)) || +sizeof (DP_SINK_DEVICE_STR_ID_1 )) || !memcmp (link->dpcd_caps.sink_dev_id_str,DP_SINK_DEVICE_STR_ID_2 , -sizeof (link->dpcd_caps.sink_dev_id_str)))) +sizeof (DP_SINK_DEVICE_STR_ID_2 )))) copy_settings_data->debug.bitfields.force_wakeup_by_tps3 =1 ;else copy_settings_data->debug.bitfields.force_wakeup_by_tps3 =0 ;
drivers/gpu/drm/amd/display/include/ddc_service_types.h +2 -2
@@ -128,8 +128,8 @@ struct av_sync_data {uint8_t aud_del_ins3;/* DPCD 0002Dh */ }; -static const uint8_t DP_SINK_DEVICE_STR_ID_1 [] = {7 ,1 ,8 ,7 ,3 ,0 }; -static const uint8_t DP_SINK_DEVICE_STR_ID_2 [] = {7 ,1 ,8 ,7 ,5 ,0 }; +static const uint8_t DP_SINK_DEVICE_STR_ID_1 [] = {7 ,1 ,8 ,7 ,3 }; +static const uint8_t DP_SINK_DEVICE_STR_ID_2 [] = {7 ,1 ,8 ,7 ,5 };static const u8 DP_SINK_BRANCH_DEV_NAME_7580 [] ="7580\x80u" ;
Signature · 1 line
2.37.3
PATCH v2 44/47 drm/amd/display: solve regression in update phy state refactor
In reply to Wayne LinFrom: Wenjing Liu <[email protected]>
[Why]
There is a coding error when moving dp disable link phy to hw sequencer, where the receiver power control is missed during this refactor.
[how]
1. Add back missing receiver power control in disable link phy.
2. minor modifications to ensure there is no undesired sequence changes in dp link enable/disable.
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 5 ++++- drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +4 -1
@@ -7073,9 +7073,9 @@ void dp_enable_link_phy(enum clock_source_id clock_source, const struct dc_link_settings *link_settings) { + link->cur_link_settings = *link_settings; link->dc->hwss.enable_dp_link_output (link, link_res, signal, clock_source, link_settings); - link->cur_link_settings = *link_settings;dp_receiver_power_ctrl (link, true); }
@@ -7149,6 +7149,9 @@ void dp_disable_link_phy(struct dc_link *link, const struct link_resource *link_ {struct dc *dc = link->ctx->dc; +if (!link->wa_flags.dp_keep_receiver_powered) +dp_receiver_power_ctrl (link, false); + dc->hwss.disable_link_output (link, link_res, signal);/* Clear current link setting.*/ memset(&link->cur_link_settings, 0,
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +4 -2
@@ -3098,6 +3098,7 @@ void dce110_enable_dp_link_output(if (dmcu !=NULL && dmcu->funcs->unlock_phy) dmcu->funcs->unlock_phy (dmcu); +dp_source_sequence_trace (link,DPCD_SOURCE_SEQ_AFTER_ENABLE_LINK_PHY ); } void dce110_disable_link_output(struct dc_link *link,
@@ -3111,7 +3112,7 @@ void dce110_disable_link_output(struct dc_link *link,if (signal ==SIGNAL_TYPE_EDP && link->dc->hwss.edp_backlight_control) link->dc->hwss.edp_backlight_control (link, false); -else if (dc_is_dp_signal (signal) && dmcu !=NULL && dmcu->funcs->lock_phy) +else if (dmcu !=NULL && dmcu->funcs->lock_phy) dmcu->funcs->lock_phy (dmcu); link_hwss->disable_link_output (link, link_res, signal);
@@ -3120,8 +3121,9 @@ void dce110_disable_link_output(struct dc_link *link,if (signal ==SIGNAL_TYPE_EDP && link->dc->hwss.edp_backlight_control) link->dc->hwss.edp_power_control (link, false); -else if (dc_is_dp_signal (signal) && dmcu !=NULL && dmcu->funcs->lock_phy) +else if (dmcu !=NULL && dmcu->funcs->lock_phy) dmcu->funcs->unlock_phy (dmcu); +dp_source_sequence_trace (link,DPCD_SOURCE_SEQ_AFTER_DISABLE_LINK_PHY ); }static const struct hw_sequencer_funcs dce110_funcs = {
Signature · 1 line
2.37.3
PATCH v2 45/47 drm/amd/display: correct num_dsc based on HW cap
In reply to Wayne LinFrom: Charlene Liu <[email protected]>
[why]num_dsc is 3 for dcn314 based on HW capablity.
--- drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +1 -1
@@ -847,7 +847,7 @@ static const struct resource_caps res_cap_dcn314 = { .num_ddc = 5, .num_vmid = 16, .num_mpc_3dlut = 2, - .num_dsc = 4, + .num_dsc = 3, };static const struct dc_plane_cap plane_cap = {
Signature · 1 line
2.37.3
PATCH v2 46/47 drm/amd/display: Fix failures of disabling primary plans
In reply to Wayne LinFrom: Alex Hung <[email protected]>
[Why & How]
This fixes kernel errors when IGT disables primary planes during the tests kms_universal_plane::functional_test_pipe/pageflip_test_pipe.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 12 ------------ 1 file changed, 12 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +0 -12
@@ -376,18 +376,6 @@ static int dm_crtc_helper_atomic_check(struct drm_crtc *crtc,return ret; } -/* -* We require the primary plane to be enabled whenever the CRTC is, otherwise -* drm_mode_cursor_universal may end up trying to enable the cursor plane while all other -* planes are disabled, which is not supported by the hardware. And there is legacy -* userspace which stops using the HW cursor altogether in response to the resulting EINVAL. -*/ -if (crtc_state->enable && - !(crtc_state->plane_mask &drm_plane_mask (crtc->primary))) { -DRM_DEBUG_ATOMIC ("Can't enable a CRTC without enabling the primary plane\n" ); -return -EINVAL ; - } -/* In some use cases, like reset, no stream is attached */ if (!dm_crtc_state->stream)return 0 ;
Signature · 1 line
2.37.3