DC Patches Jun 30, 2022
cover DC Patches Jun 30, 2022
This DC patchset is a large one that brings improvements in multiple areas. In summary, we highlight:
- Program ACP-related registers
- Fixes for DMUB, DPIA, PSR, and others
- Improvements in the pipe split
- Add SubVP code
- Add basic setup for FAMS support
- Improve BB capabilities
Thanks
Siqueira
Alan Liu (1):
drm/amd/display: Program ACP related register
Alvin Lee (5):
drm/amd/display: Add SubVP required code drm/amd/display: Change DET policy for MPO cases drm/amd/display: Make OPTC3 function accessible to other DCN drm/amd/display: Don't set dram clock change requirement for SubVP drm/amd/display: Maintain old audio programming sequence
Aric Cyr (1):
drm/amd/display: 3.2.192
Chris Park (3):
drm/amd/display: Switch to correct DTO on HDMI drm/amd/display: Indicate stream change on ODM change drm/amd/display: OVT Update on InfoFrame and Mode Management
Dmytro Laktyushkin (2):
drm/amd/display: disable timing sync b/w odm halves drm/amd/display: disable otg toggle w/a on boot
Duncan Ma (1):
drm/amd/display: Add flag to modify MST delay
Eric Bernstein (3):
drm/amd/display: Add function to set pixels per cycle drm/amd/display: Update gpuvm_max_page_table_levels IP param drm/amd/display: Fix null timing generator resource
Evgenii Krasnikov (1):
drm/amd/display: add an option to skip wait for HPD when powering on
eDP panel
Fangzhi Zuo (1):
drm/amd/display: Fix dmub soft hang for PSR 1
Hamza Mahfooz (2):
drm/amd/display: enable PCON SST support for newer ASICs drm/amd/display: rename hdmi_frl_pcon_support
Harry Wentland (1):
drm/amd/display: Move all linux includes into OS types
Jimmy Kizito (3):
drm/amd/display: Maintain consistent mode of operation during encoder
assignment
drm/amd/display: Disable TBT3 DSC work around by default. drm/amd/display: Fix uninitialized variable.
Jun Lei (1):
drm/amd/display: Extend soc BB capabilitiy
Martin Leung (2):
drm/amd/display: Prepare for new interfaces drm/amd/display: guard for virtual calling destroy_link_encoders
Meenakshikumar Somasundaram (1):
drm/amd/display: Remove configuration option for dpia hpd delay
Michael Strauss (1):
drm/amd/display: Initialize lt_settings on instantiation
Nicholas Kazlauskas (4):
drm/amd/display: Fix stream->link_enc unassigned during stream removal drm/amd/display: Guard against ddc_pin being NULL for AUX drm/amd/display: Remove incorrect ASSERT check for link_enc drm/amd/display: Guard against NULL link encoder in log hw state
Rodrigo Siqueira (6):
drm/amd/display: Add missing registers for ACP drm/amd/display: Use two pixel per container for k1/k2 div drm/amd/display: Add basic infrastructure for enabling FAMS drm/amd/display: Add SubVP control lock drm/amd/display: Add minimal pipe split transition state drm/amd/display: Fix refresh rate issue on Club 3D
Samson Tam (1):
drm/amd/display: Apply ODM 2:1 policy for single display configuration
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 +- drivers/gpu/drm/amd/display/dc/Makefile | 27 +- .../gpu/drm/amd/display/dc/basics/vector.c | 2 - .../drm/amd/display/dc/bios/bios_parser2.c | 2 - .../gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c | 6 + .../dc/clk_mgr/dcn315/dcn315_clk_mgr.c | 7 +- .../display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 2 + .../dc/clk_mgr/dcn32/dcn32_clk_mgr_smu_msg.c | 5 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 384 +++++++++- .../drm/amd/display/dc/core/dc_hw_sequencer.c | 2 - .../gpu/drm/amd/display/dc/core/dc_link_ddc.c | 2 - .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 9 +- .../drm/amd/display/dc/core/dc_link_dpia.c | 58 +- .../drm/amd/display/dc/core/dc_link_enc_cfg.c | 32 + .../gpu/drm/amd/display/dc/core/dc_resource.c | 32 +- drivers/gpu/drm/amd/display/dc/core/dc_sink.c | 2 - .../gpu/drm/amd/display/dc/core/dc_stream.c | 3 - .../gpu/drm/amd/display/dc/core/dc_surface.c | 2 - drivers/gpu/drm/amd/display/dc/dc.h | 27 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 416 +++++++++++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 4 + drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 2 + drivers/gpu/drm/amd/display/dc/dc_stream.h | 24 +- drivers/gpu/drm/amd/display/dc/dc_types.h | 5 + .../gpu/drm/amd/display/dc/dce/dce_audio.c | 13 +- drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 8 +- .../drm/amd/display/dc/dce/dce_clock_source.c | 2 - drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c | 3 - .../gpu/drm/amd/display/dc/dce/dce_i2c_sw.c | 2 - drivers/gpu/drm/amd/display/dc/dce/dce_ipp.c | 2 - .../drm/amd/display/dc/dce/dce_link_encoder.c | 3 - drivers/gpu/drm/amd/display/dc/dce/dce_opp.c | 2 - .../amd/display/dc/dce/dce_stream_encoder.c | 5 +- .../amd/display/dc/dce/dce_stream_encoder.h | 14 +- .../amd/display/dc/dce100/dce100_resource.c | 2 - .../amd/display/dc/dce110/dce110_compressor.c | 3 - .../display/dc/dce110/dce110_hw_sequencer.c | 10 +- .../display/dc/dce110/dce110_opp_regamma_v.c | 2 - .../amd/display/dc/dce110/dce110_resource.c | 2 - .../display/dc/dce110/dce110_transform_v.c | 2 - .../amd/display/dc/dce112/dce112_compressor.c | 3 - .../amd/display/dc/dce112/dce112_resource.c | 2 - .../amd/display/dc/dce120/dce120_resource.c | 2 - .../drm/amd/display/dc/dce80/dce80_resource.c | 2 - .../drm/amd/display/dc/dcn10/dcn10_hubbub.c | 2 - .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 2 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_ipp.c | 2 - .../amd/display/dc/dcn10/dcn10_link_encoder.c | 3 - .../gpu/drm/amd/display/dc/dcn10/dcn10_opp.c | 2 - .../drm/amd/display/dc/dcn10/dcn10_resource.c | 2 - .../display/dc/dcn10/dcn10_stream_encoder.c | 5 +- .../display/dc/dcn10/dcn10_stream_encoder.h | 17 +- .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 44 +- .../drm/amd/display/dc/dcn20/dcn20_resource.c | 12 +- .../display/dc/dcn20/dcn20_stream_encoder.c | 1 - .../drm/amd/display/dc/dcn21/dcn21_resource.c | 2 +- .../dc/dcn30/dcn30_dio_stream_encoder.c | 4 +- .../dc/dcn30/dcn30_dio_stream_encoder.h | 6 +- .../drm/amd/display/dc/dcn30/dcn30_hwseq.c | 22 +- .../gpu/drm/amd/display/dc/dcn30/dcn30_mpc.h | 106 ++- .../gpu/drm/amd/display/dc/dcn30/dcn30_optc.c | 5 + .../drm/amd/display/dc/dcn30/dcn30_resource.c | 172 ++++- .../drm/amd/display/dc/dcn31/dcn31_resource.c | 2 +- .../amd/display/dc/dcn315/dcn315_resource.c | 1 + .../amd/display/dc/dcn316/dcn316_resource.c | 1 + drivers/gpu/drm/amd/display/dc/dcn32/Makefile | 14 +- .../gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c | 4 + .../dc/dcn32/dcn32_dio_stream_encoder.c | 8 +- .../dc/dcn32/dcn32_dio_stream_encoder.h | 1 + .../drm/amd/display/dc/dcn32/dcn32_hwseq.c | 245 ++++++- .../drm/amd/display/dc/dcn32/dcn32_hwseq.h | 21 + .../gpu/drm/amd/display/dc/dcn32/dcn32_init.c | 12 +- .../gpu/drm/amd/display/dc/dcn32/dcn32_mpc.c | 236 +++++- .../gpu/drm/amd/display/dc/dcn32/dcn32_mpc.h | 117 ++- .../gpu/drm/amd/display/dc/dcn32/dcn32_optc.c | 2 +- .../drm/amd/display/dc/dcn32/dcn32_resource.c | 680 +++++++++++++----- .../drm/amd/display/dc/dcn32/dcn32_resource.h | 20 +- .../display/dc/dcn32/dcn32_resource_helpers.c | 260 +++++++ .../amd/display/dc/dcn321/dcn321_resource.c | 522 ++++++++++---- .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 6 + .../drm/amd/display/dc/dml/dcn30/dcn30_fpu.c | 2 + .../amd/display/dc/dml/display_mode_structs.h | 3 + .../drm/amd/display/dc/dml/display_mode_vba.c | 5 +- .../gpu/drm/amd/display/dc/gpio/gpio_base.c | 2 - .../drm/amd/display/dc/gpio/gpio_service.c | 2 - drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.c | 3 - .../gpu/drm/amd/display/dc/gpio/hw_factory.c | 2 - drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c | 2 - .../gpu/drm/amd/display/dc/inc/core_types.h | 5 +- .../gpu/drm/amd/display/dc/inc/dc_link_dp.h | 6 +- .../amd/display/dc/inc/hw/stream_encoder.h | 1 + .../gpu/drm/amd/display/dc/inc/hw_sequencer.h | 7 + .../amd/display/dc/inc/hw_sequencer_private.h | 2 + .../gpu/drm/amd/display/dc/inc/link_enc_cfg.h | 5 + .../dc/irq/dce110/irq_service_dce110.c | 2 - .../dc/irq/dce120/irq_service_dce120.c | 2 - .../display/dc/irq/dce80/irq_service_dce80.c | 2 - .../display/dc/irq/dcn10/irq_service_dcn10.c | 2 - .../gpu/drm/amd/display/dc/irq/irq_service.c | 2 - drivers/gpu/drm/amd/display/dc/os_types.h | 5 +- .../display/dc/virtual/virtual_link_encoder.c | 2 - .../dc/virtual/virtual_stream_encoder.c | 2 - .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 114 ++- .../amd/display/dmub/inc/dmub_subvp_state.h | 160 +++++ .../drm/amd/display/include/set_mode_types.h | 8 +- .../amd/display/modules/color/color_gamma.c | 3 - .../amd/display/modules/freesync/freesync.c | 2 - .../include/asic_reg/dce/dce_6_0_sh_mask.h | 2 + .../include/asic_reg/dcn/dcn_3_0_0_sh_mask.h | 2 + .../include/asic_reg/dcn/dcn_3_0_1_sh_mask.h | 2 + .../include/asic_reg/dcn/dcn_3_0_2_sh_mask.h | 2 + .../include/asic_reg/dcn/dcn_3_0_3_sh_mask.h | 2 + .../include/asic_reg/dcn/dcn_3_1_2_sh_mask.h | 2 + 113 files changed, 3502 insertions(+), 573 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c create mode 100644 drivers/gpu/drm/amd/display/dmub/inc/dmub_subvp_state.h
Signature · 1 line
2.25.1
PATCH 1/40 drm/amd/display: Add missing registers for ACP
We are missing some ACP registers/mask value for some specific ASICs. This commit includes it to those ASICs that support it.
--- drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_0_0_sh_mask.h | 2 ++ drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_0_1_sh_mask.h | 2 ++ drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_0_2_sh_mask.h | 2 ++ drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_0_3_sh_mask.h | 2 ++ drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_1_2_sh_mask.h | 2 ++ 5 files changed, 10 insertions(+)
drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_0_0_sh_mask.h +2 -0
@@ -38746,12 +38746,14 @@#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_GC_CONT__SHIFT 0x5#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_SEND__SHIFT 0x8#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_CONT__SHIFT 0x9 +#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ACP_SEND__SHIFT 0xc#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_LINE__SHIFT 0x10#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_NULL_SEND_MASK 0x00000001L#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_GC_SEND_MASK 0x00000010L#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_GC_CONT_MASK 0x00000020L#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_SEND_MASK 0x00000100L#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_CONT_MASK 0x00000200L +#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ACP_SEND_MASK 0x00001000L#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_LINE_MASK 0x003F0000L//DIG0_HDMI_INFOFRAME_CONTROL0 #define DIG0_HDMI_INFOFRAME_CONTROL0__HDMI_AUDIO_INFO_SEND__SHIFT 0x4
drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_0_1_sh_mask.h +2 -0
@@ -29361,12 +29361,14 @@#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_GC_CONT__SHIFT 0x5#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_SEND__SHIFT 0x8#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_CONT__SHIFT 0x9 +#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ACP_SEND__SHIFT 0xc#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_LINE__SHIFT 0x10#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_NULL_SEND_MASK 0x00000001L#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_GC_SEND_MASK 0x00000010L#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_GC_CONT_MASK 0x00000020L#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_SEND_MASK 0x00000100L#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_CONT_MASK 0x00000200L +#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ACP_SEND_MASK 0x00001000L#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_LINE_MASK 0x003F0000L//DIG0_HDMI_INFOFRAME_CONTROL0 #define DIG0_HDMI_INFOFRAME_CONTROL0__HDMI_AUDIO_INFO_SEND__SHIFT 0x4
drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_0_2_sh_mask.h +2 -0
@@ -33955,12 +33955,14 @@#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_GC_CONT__SHIFT 0x5#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_SEND__SHIFT 0x8#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_CONT__SHIFT 0x9 +#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ACP_SEND__SHIFT 0xc#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_LINE__SHIFT 0x10#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_NULL_SEND_MASK 0x00000001L#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_GC_SEND_MASK 0x00000010L#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_GC_CONT_MASK 0x00000020L#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_SEND_MASK 0x00000100L#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_CONT_MASK 0x00000200L +#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ACP_SEND_MASK 0x00001000L#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_LINE_MASK 0x003F0000L//DIG0_HDMI_INFOFRAME_CONTROL0 #define DIG0_HDMI_INFOFRAME_CONTROL0__HDMI_AUDIO_INFO_SEND__SHIFT 0x4
drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_0_3_sh_mask.h +2 -0
@@ -18093,12 +18093,14 @@#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_GC_CONT__SHIFT 0x5#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_SEND__SHIFT 0x8#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_CONT__SHIFT 0x9 +#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ACP_SEND__SHIFT 0xc#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_LINE__SHIFT 0x10#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_NULL_SEND_MASK 0x00000001L#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_GC_SEND_MASK 0x00000010L#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_GC_CONT_MASK 0x00000020L#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_SEND_MASK 0x00000100L#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_CONT_MASK 0x00000200L +#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ACP_SEND_MASK 0x00001000L#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_LINE_MASK 0x003F0000L//DIG0_HDMI_INFOFRAME_CONTROL0 #define DIG0_HDMI_INFOFRAME_CONTROL0__HDMI_AUDIO_INFO_SEND__SHIFT 0x4
drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_1_2_sh_mask.h +2 -0
@@ -33961,12 +33961,14 @@#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_GC_CONT__SHIFT 0x5#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_SEND__SHIFT 0x8#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_CONT__SHIFT 0x9 +#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ACP_SEND__SHIFT 0xc#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_LINE__SHIFT 0x10#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_NULL_SEND_MASK 0x00000001L#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_GC_SEND_MASK 0x00000010L#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_GC_CONT_MASK 0x00000020L#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_SEND_MASK 0x00000100L#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_CONT_MASK 0x00000200L +#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ACP_SEND_MASK 0x00001000L#define DIG0_HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_LINE_MASK 0x003F0000L//DIG0_HDMI_INFOFRAME_CONTROL0 #define DIG0_HDMI_INFOFRAME_CONTROL0__HDMI_AUDIO_INFO_SEND__SHIFT 0x4
Signature · 1 line
2.25.1
PATCH 2/40 drm/amd/display: Add SubVP required code
In reply to Rodrigo SiqueiraFrom: Alvin Lee <[email protected]>
This commit enables the SubVP feature. To achieve that, we need to:
- Don't force p-state disallow on SubVP (can't block dummy p-state)
- Send calculated watermark to DMCUB for SubVP
- Adjust CAB mode message to PMFW
- Add a proper locking sequence for SubVP
- Various fixes to SubVP static analysis and determining SubVP config
- Currently SubVP not supported with pipe split so merge all pipes before setting up SubVp
--- drivers/gpu/drm/amd/display/dc/Makefile | 27 +- .../gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c | 6 + .../dc/clk_mgr/dcn32/dcn32_clk_mgr_smu_msg.c | 5 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 65 +++- drivers/gpu/drm/amd/display/dc/dc.h | 2 - drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 329 ++++++++++++++++++ drivers/gpu/drm/amd/display/dc/dc_stream.h | 4 - .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 39 ++- drivers/gpu/drm/amd/display/dc/dcn32/Makefile | 14 +- .../drm/amd/display/dc/dcn32/dcn32_hwseq.c | 73 +++- .../drm/amd/display/dc/dcn32/dcn32_hwseq.h | 7 + .../gpu/drm/amd/display/dc/dcn32/dcn32_init.c | 1 + .../drm/amd/display/dc/dcn32/dcn32_resource.c | 115 +++--- .../drm/amd/display/dc/dcn32/dcn32_resource.h | 20 +- .../display/dc/dcn32/dcn32_resource_helpers.c | 260 ++++++++++++++ .../amd/display/dc/dml/display_mode_structs.h | 1 + .../gpu/drm/amd/display/dc/inc/core_types.h | 5 +- .../gpu/drm/amd/display/dc/inc/hw_sequencer.h | 7 + .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 89 +++++ .../amd/display/dmub/inc/dmub_subvp_state.h | 160 +++++++++ 20 files changed, 1162 insertions(+), 67 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c create mode 100644 drivers/gpu/drm/amd/display/dmub/inc/dmub_subvp_state.h
drivers/gpu/drm/amd/display/dc/Makefile +26 -1
@@ -21,7 +21,31 @@ # # # Makefile for Display Core (dc) component. -# + +ifdef CONFIG_X86 +dmub_ccflags := -mhard-float -msse +endif + +ifdef CONFIG_PPC64 +dmub_ccflags := -mhard-float -maltivec +endif + +ifdef CONFIG_CC_IS_GCC +ifeq ($(call cc-ifversion, -lt, 0701, y), y) +IS_OLD_GCC = 1 +endif +endif + +ifdef CONFIG_X86 +ifdef IS_OLD_GCC +# Stack alignment mismatch, proceed with caution. +# GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3 +# (8B stack alignment). +dmub_ccflags += -mpreferred-stack-boundary=4 +else +dmub_ccflags += -msse2 +endif +endif DC_LIBS = basics bios dml clk_mgr dce gpio irq link virtual
@@ -75,6 +99,7 @@ AMD_DISPLAY_FILES += $(AMD_DISPLAY_CORE) AMD_DISPLAY_FILES += $(AMD_DM_REG_UPDATE) DC_DMUB += dc_dmub_srv.o +CFLAGS_$(AMDDALPATH)/dc/dc_dmub_srv.o := $(dmub_ccflags) DC_EDID += dc_edid_parser.o AMD_DISPLAY_DMUB = $(addprefix $(AMDDALPATH)/dc/,$(DC_DMUB)) AMD_DISPLAY_EDID = $(addprefix $(AMDDALPATH)/dc/,$(DC_EDID))
drivers/gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c +6 -0
@@ -58,6 +58,12 @@ int clk_mgr_helper_get_active_display_cnt(for (i =0 ; i < context->stream_count; i++) {const struct dc_stream_state *stream = context->streams[i]; +/* Don't count SubVP phantom pipes as part of active +* display count +*/ +if (stream->mall_stream_config.type ==SUBVP_PHANTOM ) +continue ; +/* * Only notify active stream or virtual stream. * Need to notify virtual stream to work around
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr_smu_msg.c +3 -2
@@ -100,9 +100,10 @@ void dcn32_smu_send_fclk_pstate_message(struct clk_mgr_internal *clk_mgr, bool evoid dcn32_smu_send_cab_for_uclk_message (struct clk_mgr_internal *clk_mgr,unsigned int num_ways) { -smu_print ("Numways for SubVP : %d\n" , num_ways); +uint32_t param = (num_ways <<1 ) | (num_ways >0 ); -dcn32_smu_send_msg_with_param (clk_mgr, DALSMC_MSG_SetCabForUclkPstate, num_ways,NULL ); +dcn32_smu_send_msg_with_param (clk_mgr, DALSMC_MSG_SetCabForUclkPstate, param,NULL ); +smu_print ("Numways for SubVP : %d\n" , num_ways); }void dcn32_smu_transfer_wm_table_dram_2_smu (struct clk_mgr_internal *clk_mgr)
drivers/gpu/drm/amd/display/dc/core/dc.c +64 -1
110 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dc.h +0 -2
@@ -207,7 +207,6 @@ struct dc_caps {bool vbios_lttpr_aware;bool vbios_lttpr_enable;uint32_t max_otg_num; -#ifdef CONFIG_DRM_AMD_DC_DCN uint32_t max_cab_allocation_bytes;uint32_t cache_line_size;uint32_t cache_num_ways;
@@ -215,7 +214,6 @@ struct dc_caps {uint16_t subvp_prefetch_end_to_mall_start_us;uint16_t subvp_pstate_allow_width_us;uint16_t subvp_vertical_int_margin_us; -#endif bool seamless_odm; };
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +329 -0
335 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dc_stream.h +0 -4
@@ -145,7 +145,6 @@ struct test_pattern {unsigned int cust_pattern_size; }; -#ifdef CONFIG_DRM_AMD_DC_DCN #define SUBVP_DRR_MARGIN_US 500 // 500us for DRR margin (SubVP + DRR)enum mall_stream_type {
@@ -161,7 +160,6 @@ struct mall_stream_config {enum mall_stream_type type;struct dc_stream_state *paired_stream;// master / slave stream }; -#endif struct dc_stream_state {// sink is deprecated, new code should not reference
@@ -277,9 +275,7 @@ struct dc_stream_state {bool has_non_synchronizable_pclk;bool vblank_synchronized; -#ifdef CONFIG_DRM_AMD_DC_DCN struct mall_stream_config mall_stream_config; -#endif };#define ABM_LEVEL_IMMEDIATE_DISABLE 255
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +38 -1
@@ -1308,6 +1308,15 @@ static void dcn20_detect_pipe_changes(struct pipe_ctx *old_pipe, struct pipe_ctx }return ; } + +/* For SubVP we need to unconditionally enable because any phantom pipes are +* always removed then newly added for every full updates whenever SubVP is in use. +* The remove-add sequence of the phantom pipe always results in the pipe +* being blanked in enable_stream_timing (DPG). +*/ +if (new_pipe->stream && new_pipe->stream->mall_stream_config.type ==SUBVP_PHANTOM ) + new_pipe->update_flags.bits.enable =1 ; +if (old_pipe->plane_state && !new_pipe->plane_state) { new_pipe->update_flags.bits.disable =1 ;return ;
@@ -1810,7 +1819,9 @@ void dcn20_post_unlock_program_front_end(*/ for (i =0 ; i < dc->res_pool->pipe_count; i++) {struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i]; -if (pipe->plane_state && !pipe->top_pipe && pipe->update_flags.bits.enable) { +// Don't check flip pending on phantom pipes +if (pipe->plane_state && !pipe->top_pipe && pipe->update_flags.bits.enable && + pipe->stream->mall_stream_config.type !=SUBVP_PHANTOM ) {struct hubp *hubp = pipe->plane_res.hubp;int j =0 ;
@@ -1864,18 +1875,34 @@ void dcn20_prepare_bandwidth( {struct hubbub *hubbub = dc->res_pool->hubbub;unsigned int compbuf_size_kb =0 ; +unsigned int cache_wm_a = context->bw_ctx.bw.dcn.watermarks.a.cstate_pstate.pstate_change_ns; +unsigned int i; dc->clk_mgr->funcs->update_clocks ( dc->clk_mgr, context, false); +for (i =0 ; i < dc->res_pool->pipe_count; i++) { +struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i]; + +// At optimize don't restore the original watermark value +if (pipe->stream && pipe->stream->mall_stream_config.type !=SUBVP_NONE ) { + context->bw_ctx.bw.dcn.watermarks.a.cstate_pstate.pstate_change_ns =4U *1000U *1000U *1000U ; +break ; + } + } +/* program dchubbub watermarks */ dc->wm_optimized_required = hubbub->funcs->program_watermarks (hubbub, &context->bw_ctx.bw.dcn.watermarks, dc->res_pool->ref_clocks.dchub_ref_clock_inKhz /1000 , false); +// Restore the real watermark so we can commit the value to DMCUB +// DMCUB uses the "original" watermark value in SubVP MCLK switch + context->bw_ctx.bw.dcn.watermarks.a.cstate_pstate.pstate_change_ns = cache_wm_a; +/* decrease compbuf size */ if (hubbub->funcs->program_compbuf_size) {if (context->bw_ctx.dml.ip.min_comp_buffer_size_kbytes)
@@ -1894,6 +1921,16 @@ void dcn20_optimize_bandwidth(struct hubbub *hubbub = dc->res_pool->hubbub;int i; +for (i =0 ; i < dc->res_pool->pipe_count; i++) { +struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i]; + +// At optimize don't need to restore the original watermark value +if (pipe->stream && pipe->stream->mall_stream_config.type !=SUBVP_NONE ) { + context->bw_ctx.bw.dcn.watermarks.a.cstate_pstate.pstate_change_ns =4U *1000U *1000U *1000U ; +break ; + } + } +/* program dchubbub watermarks */ hubbub->funcs->program_watermarks(hubbub, &context->bw_ctx.bw.dcn.watermarks,
drivers/gpu/drm/amd/display/dc/dcn32/Makefile +9 -5
@@ -13,20 +13,21 @@ DCN32 = dcn32_resource.o dcn32_hubbub.o dcn32_hwseq.o dcn32_init.o \ dcn32_dccg.o dcn32_optc.o dcn32_mmhubbub.o dcn32_hubp.o dcn32_dpp.o \ dcn32_dio_stream_encoder.o dcn32_dio_link_encoder.o dcn32_hpo_dp_link_encoder.o \ - dcn32_mpc.o + dcn32_resource_helpers.o dcn32_mpc.o ifdef CONFIG_X86 -CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -mhard-float -msse +dcn32_ccflags := -mhard-float -msse endif ifdef CONFIG_PPC64 -CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := -mhard-float -maltivec +dcn32_ccflags := -mhard-float -maltivec endif ifdef CONFIG_CC_IS_GCC ifeq ($(call cc-ifversion, -lt, 0701, y), y) IS_OLD_GCC = 1 endif +dcn32_ccflags += -mhard-float endif ifdef CONFIG_X86
@@ -34,12 +35,15 @@ ifdef IS_OLD_GCC # Stack alignment mismatch, proceed with caution. # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3 # (8B stack alignment). -CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o += -mpreferred-stack-boundary=4 +dcn32_ccflags += -mpreferred-stack-boundary=4 else -CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o += -msse2 +dcn32_ccflags += -msse2 endif endif +CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource_helpers.o := $(dcn32_ccflags) +CFLAGS_$(AMDDALPATH)/dc/dcn32/dcn32_resource.o := $(dcn32_ccflags) + AMD_DAL_DCN32 = $(addprefix $(AMDDALPATH)/dc/dcn32/,$(DCN32)) AMD_DISPLAY_FILES += $(AMD_DAL_DCN32)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +69 -4
98 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.h +7 -0
@@ -63,4 +63,11 @@ void dcn32_update_odm(struct dc *dc, struct dc_state *context, struct pipe_ctx *unsigned int dcn32_calculate_dccg_k1_k2_values (struct pipe_ctx *pipe_ctx,unsigned int *k1_div,unsigned int *k2_div); +void dcn32_subvp_pipe_control_lock (struct dc *dc, +struct dc_state *context, +bool lock, +bool should_lock_all_pipes, +struct pipe_ctx *top_pipe_to_program, +bool subvp_prev_use); +#endif /* __DC_HWSS_DCN32_H__ */
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c +1 -0
@@ -102,6 +102,7 @@ static const struct hw_sequencer_funcs dcn32_funcs = { .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, };
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +72 -43
244 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.h +19 -1
@@ -28,6 +28,8 @@#include "core_types.h" +#define DCN3_2_DET_SEG_SIZE 64 +#define TO_DCN32_RES_POOL (pool)\ container_of(pool, struct dcn32_resource_pool, base)
@@ -61,7 +63,7 @@ bool dcn32_release_post_bldn_3dlut(struct dc_3dlut **lut, struct dc_transfer_func **shaper); -void dcn32_remove_phantom_pipes (struct dc *dc, +bool dcn32_remove_phantom_pipes (struct dc *dc,struct dc_state *context); void dcn32_add_phantom_pipes(struct dc *dc,
@@ -85,4 +87,20 @@ void dcn32_calculate_wm_and_dlg(int pipe_cnt, int vlevel); +uint32_t dcn32_helper_calculate_num_ways_for_subvp + (struct dc *dc, +struct dc_state *context); + +void dcn32_merge_pipes_for_subvp (struct dc *dc, +struct dc_state *context); + +bool dcn32_all_pipes_have_stream_and_plane (struct dc *dc, +struct dc_state *context); + +bool dcn32_subvp_in_use (struct dc *dc, +struct dc_state *context); + +void dcn32_update_det_override_for_mpo (struct dc *dc,struct dc_state *context, +display_e2e_pipe_params_st *pipes); +#endif /* _DCN32_RESOURCE_H_ */
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c new file +260 -0
260 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h +1 -0
@@ -362,6 +362,7 @@ struct _vcs_dpi_display_pipe_source_params_st {unsigned int hostvm_levels_force;int source_scan;int source_rotation;// new in dml32 +unsigned int det_size_override;// use to populate DETSizeOverride in vba struct int sw_mode;int macro_tile_size;unsigned int surface_width_y;
drivers/gpu/drm/amd/display/dc/inc/core_types.h +2 -3
@@ -202,9 +202,8 @@ struct resource_funcs {display_e2e_pipe_params_st *pipes, unsigned int pipe_cnt, unsigned int index); -void (*remove_phantom_pipes)( -struct dc *dc, -struct dc_state *context); + +bool (*remove_phantom_pipes)(struct dc *dc,struct dc_state *context); };struct audio_support {
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +7 -0
@@ -246,6 +246,13 @@ struct hw_sequencer_funcs { int mpcc_id);void (*commit_subvp_config)(struct dc *dc,struct dc_state *context); +void (*subvp_pipe_control_lock)(struct dc *dc, +struct dc_state *context, +bool lock, +bool should_lock_all_pipes, +struct pipe_ctx *top_pipe_to_program, +bool subvp_prev_use); + }; void color_space_to_black_color(
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +89 -0
119 lines not on this page · raw message
drivers/gpu/drm/amd/display/dmub/inc/dmub_subvp_state.h new file +160 -0
160 lines not on this page · raw message
Signature · 1 line
2.25.1
Re: [PATCH 02/40] drm/amd/display: Add SubVP required code
Quoted 12 lines · Rodrigo Siqueira
From: Alvin Lee <[email protected]>
This commit enables the SubVP feature. To achieve that, we need to:
- Don't force p-state disallow on SubVP (can't block dummy p-state)
- Send calculated watermark to DMCUB for SubVP
- Adjust CAB mode message to PMFW
- Add a proper locking sequence for SubVP
- Various fixes to SubVP static analysis and determining SubVP config
- Currently SubVP not supported with pipe split so merge all pipes before setting up SubVp
Quoted 4 lines
Reviewed-by Jun Lei <[email protected]>Acked-by Rodrigo Siqueira <[email protected]>Acked-by Alan Liu <[email protected]>Signed-off-by Alvin Lee <[email protected]>
This patch is now in linux-next as commit 85f4bc0c333c ("drm/amd/display: Add SubVP required code"), where it causes build failures when building for arm64 with both Clang and GCC (see bisect log below).
Clang shows errors during modpost:
ERROR: modpost: "__floatunsidf" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__divdf3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "fma" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__adddf3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__fixdfsi" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__muldf3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__floatsidf" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__fixunsdfsi" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
GCC shows errors along the lines of:
In function 'populate_subvp_cmd_pipe_info',
inlined from 'dc_dmub_setup_subvp_dmub_command' at /home/nathan/cbl/src/linux-next/drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:675:5:/home/nathan/cbl/src/linux-next/drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:603:91: error: '-mgeneral-regs-only' is incompatible with the use of floating-point types
603 | (((double)dc->caps.subvp_prefetch_end_to_mall_start_us / 1000000) *
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
604 | (phantom_timing->pix_clk_100hz * 100) + phantom_timing->h_total - 1) /
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/nathan/cbl/src/linux-next/drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:604:63: error: '-mgeneral-regs-only' is incompatible with the use of floating-point types
603 | (((double)dc->caps.subvp_prefetch_end_to_mall_start_us / 1000000) *
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
604 | (phantom_timing->pix_clk_100hz * 100) + phantom_timing->h_total - 1) /
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/home/nathan/cbl/src/linux-next/drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:602:72: error: '-mgeneral-regs-only' is incompatible with the use of floating-point types
602 | pipe_data->pipe_config.subvp_data.prefetch_to_mall_start_lines =
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
603 | (((double)dc->caps.subvp_prefetch_end_to_mall_start_us / 1000000) *
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
604 | (phantom_timing->pix_clk_100hz * 100) + phantom_timing->h_total - 1) /
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
605 | (double)phantom_timing->h_total;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~I initially reproduced this with Fedora's configuration [1] but it appears that allmodconfig should show it as well. Our CI also shows problems for ARCH=riscv allmodconfig [2].
I am happy to test patches as necessary.
[1]: https://src.fedoraproject.org/rpms/kernel/raw/rawhide/f/kernel-aarch64-fedora.config
[2]: https://builds.tuxbuild.com/2BZS5HPSuDdoMFw6mxjG2ZmT441/build.log
Cheers,
Nathan
# bad: [088b9c375534d905a4d337c78db3b3bfbb52c4a0] Add linux-next specific files for 20220706
# good: [e35e5b6f695d241ffb1d223207da58a1fbcdff4b] Merge tag 'xsa-5.19-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
git bisect start '088b9c375534d905a4d337c78db3b3bfbb52c4a0' 'e35e5b6f695d241ffb1d223207da58a1fbcdff4b'
# good: [1a4255ede07a967e57115b54da5bd4b571d22a8c] Merge branch 'for-linux-next' of git://anongit.freedesktop.org/drm/drm-misc
git bisect good 1a4255ede07a967e57115b54da5bd4b571d22a8c
# bad: [756b44529e2ab179e4dd6f6358b5c351e1bbe5d3] Merge branch 'rcu/next' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
git bisect bad 756b44529e2ab179e4dd6f6358b5c351e1bbe5d3
# bad: [f26873a2fc786251765db3e0ced8e1424b862059] next-20220705/sound-asoc
git bisect bad f26873a2fc786251765db3e0ced8e1424b862059
# good: [fc34ece41f7183d522d15dc4189d8df6e8e23737] ASoC: Refactor non_legacy_dai_naming flag
git bisect good fc34ece41f7183d522d15dc4189d8df6e8e23737
# good: [3d313f09f31490cec9d5251b59adeb6542c944cc] drm/fourcc: fix integer type usage in uapi header
git bisect good 3d313f09f31490cec9d5251b59adeb6542c944cc
# bad: [a41afb357f09cde0714db9d590458c7bb6d90ca2] Merge branch 'for-linux-next' of git://anongit.freedesktop.org/drm-intel
git bisect bad a41afb357f09cde0714db9d590458c7bb6d90ca2
# bad: [88ef4c5bb36bf60b317b74d8652c7766c9272a7e] drm/amd/display: Apply ODM 2:1 policy for single display configuration git bisect bad 88ef4c5bb36bf60b317b74d8652c7766c9272a7e
# good: [ff15cea338d2c78e0086d55c8a9dd637a5dd3ccc] drm/amd/display: expose additional modifier for DCN32/321
git bisect good ff15cea338d2c78e0086d55c8a9dd637a5dd3ccc
# good: [414e9f520e897818302a6b1729aa2dad8cc928ca] drm/amdkfd: Asynchronously free smi_client
git bisect good 414e9f520e897818302a6b1729aa2dad8cc928ca
# good: [4bdb9d6501763e83bacbf26846754c567773a1fb] drm/amdkfd: simplify vm_validate_pt_pd_bos
git bisect good 4bdb9d6501763e83bacbf26846754c567773a1fb
# good: [e72f03f4bdc4f3a251343cf343bce28c28cbac2a] drm/amd/display: Add missing registers for ACP
git bisect good e72f03f4bdc4f3a251343cf343bce28c28cbac2a
# bad: [90f33674a0756a6f0907b8f6350cec3f7be4032c] drm/amd/display: Prepare for new interfaces
git bisect bad 90f33674a0756a6f0907b8f6350cec3f7be4032c
# bad: [85f4bc0c333ceed24cbc9f69a2a77fab1ae3d4d1] drm/amd/display: Add SubVP required code
git bisect bad 85f4bc0c333ceed24cbc9f69a2a77fab1ae3d4d1
# first bad commit: [85f4bc0c333ceed24cbc9f69a2a77fab1ae3d4d1] drm/amd/display: Add SubVP required code
Re: [PATCH 02/40] drm/amd/display: Add SubVP required code
Quoted 26 lines · Nathan Chancellor
Quoted 12 lines · Rodrigo Siqueira
From: Alvin Lee <[email protected]>
This commit enables the SubVP feature. To achieve that, we need to:
- Don't force p-state disallow on SubVP (can't block dummy p-state)
- Send calculated watermark to DMCUB for SubVP
- Adjust CAB mode message to PMFW
- Add a proper locking sequence for SubVP
- Various fixes to SubVP static analysis and determining SubVP config
- Currently SubVP not supported with pipe split so merge all pipes before setting up SubVpQuoted 4 lines
Reviewed-by Jun Lei <[email protected]>Acked-by Rodrigo Siqueira <[email protected]>Acked-by Alan Liu <[email protected]>Signed-off-by Alvin Lee <[email protected]>This patch is now in linux-next as commit
85f4bc0c333c("drm/amd/display: Add SubVP required code"), where it causes build failures when building for arm64 with both Clang and GCC (see bisect log below).Clang shows errors during modpost:
Quoted 9 lines
ERROR: modpost: "
__floatunsidf" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__divdf3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "fma" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__adddf3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__fixdfsi" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__muldf3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__floatsidf" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__fixunsdfsi" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
I think the attached patch may fix this.
Alex
Quoted 65 lines
GCC shows errors along the lines of:
In function '
populate_subvp_cmd_pipe_info',
inlined from 'dc_dmub_setup_subvp_dmub_command' at/home/nathan/cbl/src/linux-next/drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:675:5:/home/nathan/cbl/src/linux-next/drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:603:91: error: '-mgeneral-regs-only' is incompatible with the use of floating-point types603 | (((double)dc->caps.subvp_prefetch_end_to_mall_start_us / 1000000) * | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 604 | (phantom_timing->pix_clk_100hz * 100) + phantom_timing->h_total - 1) / | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/nathan/cbl/src/linux-next/drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:604:63: error: '-mgeneral-regs-only' is incompatible with the use of floating-point types 603 | (((double)dc->caps.subvp_prefetch_end_to_mall_start_us / 1000000) * | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 604 | (phantom_timing->pix_clk_100hz * 100) + phantom_timing->h_total - 1) / | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ /home/nathan/cbl/src/linux-next/drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:602:72: error: '-mgeneral-regs-only' is incompatible with the use of floating-point types 602 | pipe_data->pipe_config.subvp_data.prefetch_to_mall_start_lines = | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 603 | (((double)dc->caps.subvp_prefetch_end_to_mall_start_us / 1000000) * | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 604 | (phantom_timing->pix_clk_100hz * 100) + phantom_timing->h_total - 1) / | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 605 | (double)phantom_timing->h_total; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~I initially reproduced this with Fedora's configuration [1] but it appears that allmodconfig should show it as well. Our CI also shows problems for ARCH=riscv allmodconfig [2].
I am happy to test patches as necessary.
[1]: https://src.fedoraproject.org/rpms/kernel/raw/rawhide/f/kernel-aarch64-fedora.config
[2]: https://builds.tuxbuild.com/2BZS5HPSuDdoMFw6mxjG2ZmT441/build.logCheers,
Nathan# bad: [
088b9c375534d905a4d337c78db3b3bfbb52c4a0] Add linux-next specific files for 20220706
# good: [e35e5b6f695d241ffb1d223207da58a1fbcdff4b] Merge tag 'xsa-5.19-tag' ofgit://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
git bisect start '088b9c375534d905a4d337c78db3b3bfbb52c4a0' 'e35e5b6f695d241ffb1d223207da58a1fbcdff4b'
# good: [1a4255ede07a967e57115b54da5bd4b571d22a8c] Merge branch 'for-linux-next' ofgit://anongit.freedesktop.org/drm/drm-misc
git bisect good1a4255ede07a967e57115b54da5bd4b571d22a8c
# bad: [756b44529e2ab179e4dd6f6358b5c351e1bbe5d3] Merge branch 'rcu/next' ofgit://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
git bisect bad756b44529e2ab179e4dd6f6358b5c351e1bbe5d3
# bad: [f26873a2fc786251765db3e0ced8e1424b862059] next-20220705/sound-asoc
git bisect badf26873a2fc786251765db3e0ced8e1424b862059
# good: [fc34ece41f7183d522d15dc4189d8df6e8e23737] ASoC: Refactornon_legacy_dai_namingflag
git bisect goodfc34ece41f7183d522d15dc4189d8df6e8e23737
# good: [3d313f09f31490cec9d5251b59adeb6542c944cc] drm/fourcc: fix integer type usage in uapi header
git bisect good3d313f09f31490cec9d5251b59adeb6542c944cc
# bad: [a41afb357f09cde0714db9d590458c7bb6d90ca2] Merge branch 'for-linux-next' ofgit://anongit.freedesktop.org/drm-intel
git bisect bada41afb357f09cde0714db9d590458c7bb6d90ca2
# bad: [88ef4c5bb36bf60b317b74d8652c7766c9272a7e] drm/amd/display: Apply ODM 2:1 policy for single display configuration git bisect bad88ef4c5bb36bf60b317b74d8652c7766c9272a7e
# good: [ff15cea338d2c78e0086d55c8a9dd637a5dd3ccc] drm/amd/display: expose additional modifier for DCN32/321
git bisect goodff15cea338d2c78e0086d55c8a9dd637a5dd3ccc
# good: [414e9f520e897818302a6b1729aa2dad8cc928ca] drm/amdkfd: Asynchronously freesmi_client
git bisect good414e9f520e897818302a6b1729aa2dad8cc928ca
# good: [4bdb9d6501763e83bacbf26846754c567773a1fb] drm/amdkfd: simplifyvm_validate_pt_pd_bos
git bisect good4bdb9d6501763e83bacbf26846754c567773a1fb
# good: [e72f03f4bdc4f3a251343cf343bce28c28cbac2a] drm/amd/display: Add missing registers for ACP
git bisect goode72f03f4bdc4f3a251343cf343bce28c28cbac2a
# bad: [90f33674a0756a6f0907b8f6350cec3f7be4032c] drm/amd/display: Prepare for new interfaces
git bisect bad90f33674a0756a6f0907b8f6350cec3f7be4032c
# bad: [85f4bc0c333ceed24cbc9f69a2a77fab1ae3d4d1] drm/amd/display: Add SubVP required code
git bisect bad85f4bc0c333ceed24cbc9f69a2a77fab1ae3d4d1
Quoted 1 line
# first bad commit: [85f4bc0c333ceed24cbc9f69a2a77fab1ae3d4d1] drm/amd/display: Add SubVP required code
From 78730be1522677752ab26f57d6f8c68b96d3966e Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Wed, 6 Jul 2022 15:33:01 -0400
Subject: [PATCH] drm/amd/display: fix non-x86/PPC64 compilation
Need to protect FP DMCUB code with CONFIG_DRM_AMD_DC_DCN.
Fixes build failures like the following on arm64:
ERROR: modpost: "__floatunsidf" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__divdf3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "fma" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__adddf3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__fixdfsi" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__muldf3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__floatsidf" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__fixunsdfsi" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
--- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 2 ++ drivers/gpu/drm/amd/display/dc/dcn32/Makefile | 1 - 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +2 -0
@@ -370,6 +370,7 @@ void dc_dmub_srv_query_caps_cmd(struct dmub_srv *dmub) } } +#ifdef CONFIG_DRM_AMD_DC_DCN /** * *********************************************************************************************** * populate_subvp_cmd_drr_info: Helper to populate DRR pipe info for the DMCUB subvp command
@@ -698,6 +699,7 @@ void dc_dmub_setup_subvp_dmub_command(struct dc *dc,dc_dmub_srv_cmd_execute (dc->ctx->dmub_srv); dc_dmub_srv_wait_idle(dc->ctx->dmub_srv); } +#endif bool dc_dmub_srv_get_diagnostic_data (struct dc_dmub_srv *dc_dmub_srv,struct dmub_diagnostic_data *diag_data) {
drivers/gpu/drm/amd/display/dc/dcn32/Makefile +0 -1
@@ -27,7 +27,6 @@ ifdef CONFIG_CC_IS_GCC ifeq ($(call cc-ifversion, -lt, 0701, y), y) IS_OLD_GCC = 1 endif -dcn32_ccflags += -mhard-float endif ifdef CONFIG_X86
Signature · 1 line
2.35.3
Nathan Chancellor
Tested-byRe: [PATCH 02/40] drm/amd/display: Add SubVP required code
Quoted 37 lines · Alex Deucher
Quoted 26 lines · Nathan Chancellor
Quoted 12 lines · Rodrigo Siqueira
From: Alvin Lee <[email protected]>
This commit enables the SubVP feature. To achieve that, we need to:
- Don't force p-state disallow on SubVP (can't block dummy p-state)
- Send calculated watermark to DMCUB for SubVP
- Adjust CAB mode message to PMFW
- Add a proper locking sequence for SubVP
- Various fixes to SubVP static analysis and determining SubVP config
- Currently SubVP not supported with pipe split so merge all pipes before setting up SubVpQuoted 4 lines
Reviewed-by Jun Lei <[email protected]>Acked-by Rodrigo Siqueira <[email protected]>Acked-by Alan Liu <[email protected]>Signed-off-by Alvin Lee <[email protected]>This patch is now in linux-next as commit
85f4bc0c333c("drm/amd/display: Add SubVP required code"), where it causes build failures when building for arm64 with both Clang and GCC (see bisect log below).Clang shows errors during modpost:
Quoted 9 lines
ERROR: modpost: "
__floatunsidf" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__divdf3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "fma" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__adddf3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__fixdfsi" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__muldf3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__floatsidf" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__fixunsdfsi" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
Quoted 1 line
I think the attached patch may fix this.
Indeed, I tested both arm64 and riscv:
Quoted 126 lines
Quoted 65 lines
GCC shows errors along the lines of:
In function '
populate_subvp_cmd_pipe_info',
inlined from 'dc_dmub_setup_subvp_dmub_command' at/home/nathan/cbl/src/linux-next/drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:675:5:/home/nathan/cbl/src/linux-next/drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:603:91: error: '-mgeneral-regs-only' is incompatible with the use of floating-point types603 | (((double)dc->caps.subvp_prefetch_end_to_mall_start_us / 1000000) * | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 604 | (phantom_timing->pix_clk_100hz * 100) + phantom_timing->h_total - 1) / | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/nathan/cbl/src/linux-next/drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:604:63: error: '-mgeneral-regs-only' is incompatible with the use of floating-point types 603 | (((double)dc->caps.subvp_prefetch_end_to_mall_start_us / 1000000) * | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 604 | (phantom_timing->pix_clk_100hz * 100) + phantom_timing->h_total - 1) / | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ /home/nathan/cbl/src/linux-next/drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:602:72: error: '-mgeneral-regs-only' is incompatible with the use of floating-point types 602 | pipe_data->pipe_config.subvp_data.prefetch_to_mall_start_lines = | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 603 | (((double)dc->caps.subvp_prefetch_end_to_mall_start_us / 1000000) * | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 604 | (phantom_timing->pix_clk_100hz * 100) + phantom_timing->h_total - 1) / | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 605 | (double)phantom_timing->h_total; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~I initially reproduced this with Fedora's configuration [1] but it appears that allmodconfig should show it as well. Our CI also shows problems for ARCH=riscv allmodconfig [2].
I am happy to test patches as necessary.
[1]: https://src.fedoraproject.org/rpms/kernel/raw/rawhide/f/kernel-aarch64-fedora.config
[2]: https://builds.tuxbuild.com/2BZS5HPSuDdoMFw6mxjG2ZmT441/build.logCheers,
Nathan# bad: [
088b9c375534d905a4d337c78db3b3bfbb52c4a0] Add linux-next specific files for 20220706
# good: [e35e5b6f695d241ffb1d223207da58a1fbcdff4b] Merge tag 'xsa-5.19-tag' ofgit://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
git bisect start '088b9c375534d905a4d337c78db3b3bfbb52c4a0' 'e35e5b6f695d241ffb1d223207da58a1fbcdff4b'
# good: [1a4255ede07a967e57115b54da5bd4b571d22a8c] Merge branch 'for-linux-next' ofgit://anongit.freedesktop.org/drm/drm-misc
git bisect good1a4255ede07a967e57115b54da5bd4b571d22a8c
# bad: [756b44529e2ab179e4dd6f6358b5c351e1bbe5d3] Merge branch 'rcu/next' ofgit://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
git bisect bad756b44529e2ab179e4dd6f6358b5c351e1bbe5d3
# bad: [f26873a2fc786251765db3e0ced8e1424b862059] next-20220705/sound-asoc
git bisect badf26873a2fc786251765db3e0ced8e1424b862059
# good: [fc34ece41f7183d522d15dc4189d8df6e8e23737] ASoC: Refactornon_legacy_dai_namingflag
git bisect goodfc34ece41f7183d522d15dc4189d8df6e8e23737
# good: [3d313f09f31490cec9d5251b59adeb6542c944cc] drm/fourcc: fix integer type usage in uapi header
git bisect good3d313f09f31490cec9d5251b59adeb6542c944cc
# bad: [a41afb357f09cde0714db9d590458c7bb6d90ca2] Merge branch 'for-linux-next' ofgit://anongit.freedesktop.org/drm-intel
git bisect bada41afb357f09cde0714db9d590458c7bb6d90ca2
# bad: [88ef4c5bb36bf60b317b74d8652c7766c9272a7e] drm/amd/display: Apply ODM 2:1 policy for single display configuration git bisect bad88ef4c5bb36bf60b317b74d8652c7766c9272a7e
# good: [ff15cea338d2c78e0086d55c8a9dd637a5dd3ccc] drm/amd/display: expose additional modifier for DCN32/321
git bisect goodff15cea338d2c78e0086d55c8a9dd637a5dd3ccc
# good: [414e9f520e897818302a6b1729aa2dad8cc928ca] drm/amdkfd: Asynchronously freesmi_client
git bisect good414e9f520e897818302a6b1729aa2dad8cc928ca
# good: [4bdb9d6501763e83bacbf26846754c567773a1fb] drm/amdkfd: simplifyvm_validate_pt_pd_bos
git bisect good4bdb9d6501763e83bacbf26846754c567773a1fb
# good: [e72f03f4bdc4f3a251343cf343bce28c28cbac2a] drm/amd/display: Add missing registers for ACP
git bisect goode72f03f4bdc4f3a251343cf343bce28c28cbac2a
# bad: [90f33674a0756a6f0907b8f6350cec3f7be4032c] drm/amd/display: Prepare for new interfaces
git bisect bad90f33674a0756a6f0907b8f6350cec3f7be4032c
# bad: [85f4bc0c333ceed24cbc9f69a2a77fab1ae3d4d1] drm/amd/display: Add SubVP required code
git bisect bad85f4bc0c333ceed24cbc9f69a2a77fab1ae3d4d1Quoted 1 line
# first bad commit: [85f4bc0c333ceed24cbc9f69a2a77fab1ae3d4d1] drm/amd/display: Add SubVP required codeFrom
78730be1522677752ab26f57d6f8c68b96d3966eMon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Wed, 6 Jul 2022 15:33:01 -0400
Subject: [PATCH] drm/amd/display: fix non-x86/PPC64 compilationNeed to protect FP DMCUB code with
CONFIG_DRM_AMD_DC_DCN.
Fixes build failures like the following on arm64:
ERROR: modpost: "__floatunsidf" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__divdf3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "fma" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__adddf3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__fixdfsi" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__muldf3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__floatsidf" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__fixunsdfsi" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!Fixes 85f4bc0c333c ("drm/amd/display: Add SubVP required code")Reported-by Nathan Chancellor <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 2 ++ drivers/gpu/drm/amd/display/dc/dcn32/Makefile | 1 - 2 files changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +2
-0@@ -370,6 +370,7 @@ void dc_dmub_srv_query_caps_cmd(struct dmub_srv *dmub) } } +#ifdef CONFIG_DRM_AMD_DC_DCN /** * *********************************************************************************************** * populate_subvp_cmd_drr_info: Helper to populate DRR pipe info for the DMCUB subvp command @@ -698,6 +699,7 @@ void dc_dmub_setup_subvp_dmub_command(struct dc *dc,dc_dmub_srv_cmd_execute (dc->ctx->dmub_srv); dc_dmub_srv_wait_idle(dc->ctx->dmub_srv); } +#endif bool dc_dmub_srv_get_diagnostic_data (struct dc_dmub_srv *dc_dmub_srv,struct dmub_diagnostic_data *diag_data) {drivers/gpu/drm/amd/display/dc/dcn32/Makefile +0
-1@@ -27,7 +27,6 @@ ifdef CONFIG_CC_IS_GCC ifeq ($(call cc-ifversion, -lt, 0701, y), y) IS_OLD_GCC = 1 endif -dcn32_ccflags += -mhard-float endif ifdef CONFIG_X86Signature · 1 line
2.35.3
PATCH 3/40 drm/amd/display: Prepare for new interfaces
In reply to Rodrigo SiqueiraFrom: Martin Leung <[email protected]>
[WHY]:
Lut pipeline will be hooked up differently in some asics need to add new interfaces and missing registers.
[HOW]:
Add missing registers and hook up programming from DPP for pre-blend lut.
--- .../gpu/drm/amd/display/dc/dcn30/dcn30_mpc.h | 106 +++++++- .../drm/amd/display/dc/dcn32/dcn32_hwseq.c | 91 +++++++ .../drm/amd/display/dc/dcn32/dcn32_hwseq.h | 7 + .../gpu/drm/amd/display/dc/dcn32/dcn32_init.c | 5 +- .../gpu/drm/amd/display/dc/dcn32/dcn32_mpc.c | 236 +++++++++++++++++- .../gpu/drm/amd/display/dc/dcn32/dcn32_mpc.h | 117 ++++++++- .../drm/amd/display/dc/dcn32/dcn32_resource.c | 14 +- .../amd/display/dc/dcn321/dcn321_resource.c | 16 +- 8 files changed, 564 insertions(+), 28 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_mpc.h +105 -1
@@ -283,6 +283,7 @@ uint32_t MPC_OUT_CSC_COEF_FORMAT#define MPC_REG_VARIABLE_LIST_DCN32 \ + uint32_t MPCC_MOVABLE_CM_LOCATION_CONTROL[MAX_MPCC]; \ uint32_t MPCC_MCM_SHAPER_CONTROL[MAX_MPCC]; \ uint32_t MPCC_MCM_SHAPER_OFFSET_R[MAX_MPCC]; \ uint32_t MPCC_MCM_SHAPER_OFFSET_G[MAX_MPCC]; \
@@ -347,6 +348,80 @@uint32_t MPCC_MCM_3DLUT_OUT_OFFSET_R [MAX_MPCC ]; \uint32_t MPCC_MCM_3DLUT_OUT_OFFSET_G [MAX_MPCC ]; \uint32_t MPCC_MCM_3DLUT_OUT_OFFSET_B [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_CONTROL [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_LUT_INDEX [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_LUT_DATA [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_LUT_CONTROL [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_START_CNTL_B [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_START_CNTL_G [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_START_CNTL_R [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_START_SLOPE_CNTL_B [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_START_SLOPE_CNTL_G [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_START_SLOPE_CNTL_R [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_START_BASE_CNTL_B [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_START_BASE_CNTL_G [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_START_BASE_CNTL_R [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_END_CNTL1_B [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_END_CNTL2_B [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_END_CNTL1_G [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_END_CNTL2_G [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_END_CNTL1_R [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_END_CNTL2_R [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_OFFSET_B [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_OFFSET_G [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_OFFSET_R [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_REGION_0_1 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_REGION_2_3 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_REGION_4_5 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_REGION_6_7 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_REGION_8_9 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_REGION_10_11 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_REGION_12_13 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_REGION_14_15 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_REGION_16_17 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_REGION_18_19 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_REGION_20_21 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_REGION_22_23 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_REGION_24_25 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_REGION_26_27 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_REGION_28_29 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_REGION_30_31 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMA_REGION_32_33 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_START_CNTL_B [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_START_CNTL_G [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_START_CNTL_R [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_START_SLOPE_CNTL_B [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_START_SLOPE_CNTL_G [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_START_SLOPE_CNTL_R [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_START_BASE_CNTL_B [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_START_BASE_CNTL_G [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_START_BASE_CNTL_R [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_END_CNTL1_B [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_END_CNTL2_B [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_END_CNTL1_G [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_END_CNTL2_G [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_END_CNTL1_R [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_END_CNTL2_R [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_OFFSET_B [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_OFFSET_G [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_OFFSET_R [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_REGION_0_1 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_REGION_2_3 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_REGION_4_5 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_REGION_6_7 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_REGION_8_9 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_REGION_10_11 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_REGION_12_13 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_REGION_14_15 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_REGION_16_17 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_REGION_18_19 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_REGION_20_21 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_REGION_22_23 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_REGION_24_25 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_REGION_26_27 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_REGION_28_29 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_REGION_30_31 [MAX_MPCC ]; \ +uint32_t MPCC_MCM_1DLUT_RAMB_REGION_32_33 [MAX_MPCC ]; \ uint32_t MPCC_MCM_MEM_PWR_CTRL[MAX_MPCC]#define MPC_COMMON_MASK_SH_LIST_DCN3_0 (mask_sh) \
@@ -648,6 +723,8 @@ type MPC_RMU_SHAPER_MODE_CURRENT#define MPC_REG_FIELD_LIST_DCN32 (type) \ + type MPCC_MOVABLE_CM_LOCATION_CNTL;\ + type MPCC_MOVABLE_CM_LOCATION_CNTL_CURRENT;\ type MPCC_MCM_SHAPER_MEM_PWR_FORCE;\ type MPCC_MCM_SHAPER_MEM_PWR_DIS;\ type MPCC_MCM_SHAPER_MEM_LOW_PWR_MODE;\
@@ -692,7 +769,34 @@type MPCC_MCM_SHAPER_RAMA_EXP_REGION0_LUT_OFFSET ;\type MPCC_MCM_SHAPER_RAMA_EXP_REGION0_NUM_SEGMENTS ;\type MPCC_MCM_SHAPER_RAMA_EXP_REGION1_LUT_OFFSET ;\ - type MPCC_MCM_SHAPER_RAMA_EXP_REGION1_NUM_SEGMENTS +type MPCC_MCM_SHAPER_RAMA_EXP_REGION1_NUM_SEGMENTS ; \ +type MPCC_MCM_1DLUT_MODE ;\ +type MPCC_MCM_1DLUT_SELECT ;\ +type MPCC_MCM_1DLUT_PWL_DISABLE ;\ +type MPCC_MCM_1DLUT_MODE_CURRENT ;\ +type MPCC_MCM_1DLUT_SELECT_CURRENT ;\ +type MPCC_MCM_1DLUT_LUT_INDEX ;\ +type MPCC_MCM_1DLUT_LUT_DATA ;\ +type MPCC_MCM_1DLUT_LUT_WRITE_COLOR_MASK ;\ +type MPCC_MCM_1DLUT_LUT_READ_COLOR_SEL ;\ +type MPCC_MCM_1DLUT_LUT_READ_DBG ;\ +type MPCC_MCM_1DLUT_LUT_HOST_SEL ;\ +type MPCC_MCM_1DLUT_LUT_CONFIG_MODE ;\ +type MPCC_MCM_1DLUT_RAMA_EXP_REGION_START_B ;\ +type MPCC_MCM_1DLUT_RAMA_EXP_REGION_START_SEGMENT_B ;\ +type MPCC_MCM_1DLUT_RAMA_EXP_REGION_START_SLOPE_B ;\ +type MPCC_MCM_1DLUT_RAMA_EXP_REGION_START_BASE_B ;\ +type MPCC_MCM_1DLUT_RAMA_EXP_REGION_END_BASE_B ;\ +type MPCC_MCM_1DLUT_RAMA_EXP_REGION_END_B ;\ +type MPCC_MCM_1DLUT_RAMA_EXP_REGION_END_SLOPE_B ;\ +type MPCC_MCM_1DLUT_RAMA_OFFSET_B ;\ +type MPCC_MCM_1DLUT_RAMA_OFFSET_G ;\ +type MPCC_MCM_1DLUT_RAMA_OFFSET_R ;\ +type MPCC_MCM_1DLUT_RAMA_EXP_REGION0_LUT_OFFSET ;\ +type MPCC_MCM_1DLUT_RAMA_EXP_REGION0_NUM_SEGMENTS ;\ +type MPCC_MCM_1DLUT_RAMA_EXP_REGION1_LUT_OFFSET ;\ + type MPCC_MCM_1DLUT_RAMA_EXP_REGION1_NUM_SEGMENTS +#define MPC_COMMON_MASK_SH_LIST_DCN303 (mask_sh) \ MPC_COMMON_MASK_SH_LIST_DCN1_0(mask_sh),\
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +91 -0
97 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.h +7 -0
@@ -47,6 +47,13 @@ void dcn32_cab_for_ss_control(struct dc *dc, bool enable);void dcn32_commit_subvp_config (struct dc *dc,struct dc_state *context); +bool dcn32_set_mcm_luts (struct pipe_ctx *pipe_ctx, +const struct dc_plane_state *plane_state); + +bool dcn32_set_input_transfer_func (struct dc *dc, +struct pipe_ctx *pipe_ctx, +const struct dc_plane_state *plane_state); +bool dcn32_set_output_transfer_func (struct dc *dc,struct pipe_ctx *pipe_ctx,const struct dc_stream_state *stream);
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c +2 -3
@@ -111,7 +111,7 @@ static const struct hwseq_private_funcs dcn32_private_funcs = { .update_plane_addr = dcn20_update_plane_addr, .plane_atomic_disconnect = dcn10_plane_atomic_disconnect, .update_mpcc = dcn20_update_mpcc, - .set_input_transfer_func = dcn30_set_input_transfer_func, + .set_input_transfer_func = dcn32_set_input_transfer_func, .set_output_transfer_func = dcn32_set_output_transfer_func, .power_down = dce110_power_down, .enable_display_power_gating = dcn10_dummy_display_power_gating,
@@ -137,8 +137,7 @@ static const struct hwseq_private_funcs dcn32_private_funcs = { .verify_allow_pstate_change_high = dcn10_verify_allow_pstate_change_high, .wait_for_blank_complete = dcn20_wait_for_blank_complete, .dccg_init = dcn20_dccg_init, - .set_blend_lut = dcn30_set_blend_lut, - .set_shaper_3dlut = dcn20_set_shaper_3dlut, + .set_mcm_luts = dcn32_set_mcm_luts, .program_mall_pipe_config = dcn32_program_mall_pipe_config, .subvp_update_force_pstate = dcn32_subvp_update_force_pstate, .update_mall_sel = dcn32_update_mall_sel,
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_mpc.c +235 -1
260 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_mpc.h +113 -4
156 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +5 -9
@@ -695,18 +695,14 @@ static const struct dcn20_dsc_mask dsc_mask = { };static const struct dcn30_mpc_registers mpc_regs = { -MPC_REG_LIST_DCN3_0 (0 ), -MPC_REG_LIST_DCN3_0 (1 ), -MPC_REG_LIST_DCN3_0 (2 ), -MPC_REG_LIST_DCN3_0 (3 ), +MPC_REG_LIST_DCN3_2 (0 ), +MPC_REG_LIST_DCN3_2 (1 ), +MPC_REG_LIST_DCN3_2 (2 ), +MPC_REG_LIST_DCN3_2 (3 ),MPC_OUT_MUX_REG_LIST_DCN3_0 (0 ),MPC_OUT_MUX_REG_LIST_DCN3_0 (1 ),MPC_OUT_MUX_REG_LIST_DCN3_0 (2 ),MPC_OUT_MUX_REG_LIST_DCN3_0 (3 ), -MPC_MCM_REG_LIST_DCN32 (0 ), -MPC_MCM_REG_LIST_DCN32 (1 ), -MPC_MCM_REG_LIST_DCN32 (2 ), -MPC_MCM_REG_LIST_DCN32 (3 ),MPC_DWB_MUX_REG_LIST_DCN3_0 (0 ), };
@@ -3737,7 +3733,7 @@ static bool dcn32_resource_construct( dc->caps.color.dpp.dgam_rom_for_yuv =0 ; dc->caps.color.dpp.hw_3d_lut =1 ; - dc->caps.color.dpp.ogam_ram =0 ;//Blnd Gam also removed + dc->caps.color.dpp.ogam_ram =0 ;// no OGAM in DPP since DCN1 // no OGAM ROM on DCN2 and later ASICs dc->caps.color.dpp.ogam_rom_caps.srgb =0 ; dc->caps.color.dpp.ogam_rom_caps.bt2020 =0 ;
drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c +6 -10
@@ -697,18 +697,14 @@ static const struct dcn20_dsc_mask dsc_mask = { };static const struct dcn30_mpc_registers mpc_regs = { -MPC_REG_LIST_DCN3_0 (0 ), -MPC_REG_LIST_DCN3_0 (1 ), -MPC_REG_LIST_DCN3_0 (2 ), -MPC_REG_LIST_DCN3_0 (3 ), +MPC_REG_LIST_DCN3_2 (0 ), +MPC_REG_LIST_DCN3_2 (1 ), +MPC_REG_LIST_DCN3_2 (2 ), +MPC_REG_LIST_DCN3_2 (3 ),MPC_OUT_MUX_REG_LIST_DCN3_0 (0 ),MPC_OUT_MUX_REG_LIST_DCN3_0 (1 ),MPC_OUT_MUX_REG_LIST_DCN3_0 (2 ),MPC_OUT_MUX_REG_LIST_DCN3_0 (3 ), -MPC_MCM_REG_LIST_DCN32 (0 ), -MPC_MCM_REG_LIST_DCN32 (1 ), -MPC_MCM_REG_LIST_DCN32 (2 ), -MPC_MCM_REG_LIST_DCN32 (3 ),MPC_DWB_MUX_REG_LIST_DCN3_0 (0 ), };
@@ -2052,8 +2048,8 @@ static bool dcn321_resource_construct( dc->caps.color.dpp.gamma_corr =1 ; dc->caps.color.dpp.dgam_rom_for_yuv =0 ; - dc->caps.color.dpp.hw_3d_lut =0 ;//3DLUT removed from DPP - dc->caps.color.dpp.ogam_ram =0 ;//Blnd Gam also removed + dc->caps.color.dpp.hw_3d_lut =1 ; + dc->caps.color.dpp.ogam_ram =1 ;// no OGAM ROM on DCN2 and later ASICs dc->caps.color.dpp.ogam_rom_caps.srgb =0 ; dc->caps.color.dpp.ogam_rom_caps.bt2020 =0 ;
Signature · 1 line
2.25.1
PATCH 4/40 drm/amd/display: Add function to set pixels per cycle
In reply to Rodrigo SiqueiraFrom: Eric Bernstein <[email protected]>
Add function to set pixels per cycle in DIG stream encoder
--- .../amd/display/dc/dcn10/dcn10_stream_encoder.h | 1 + .../gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 5 ++--- .../display/dc/dcn32/dcn32_dio_stream_encoder.c | 4 ++-- .../display/dc/dcn32/dcn32_dio_stream_encoder.h | 1 + .../gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 17 +++++++++++++++++ .../gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.h | 2 ++ .../gpu/drm/amd/display/dc/dcn32/dcn32_init.c | 1 + .../amd/display/dc/inc/hw_sequencer_private.h | 1 + 8 files changed, 27 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.h +1 -0
@@ -577,6 +577,7 @@ struct dcn10_stream_enc_registers {#define SE_REG_FIELD_LIST_DCN3_2 (type) \ type DIG_FIFO_OUTPUT_PIXEL_MODE;\ + type DP_PIXEL_PER_CYCLE_PROCESSING_MODE;\ type DIG_SYMCLK_FE_ON;\ type DIG_FIFO_READ_START_LEVEL;\ type DIG_FIFO_ENABLE;\
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +2 -3
@@ -2535,9 +2535,8 @@ void dcn20_enable_stream(struct pipe_ctx *pipe_ctx) tg->funcs->set_early_control (tg, early_control); -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, - timing->pixel_encoding ==PIXEL_ENCODING_YCBCR420 ?2 :1 ); +if (dc->hwseq->funcs.set_pixels_per_cycle) + dc->hwseq->funcs.set_pixels_per_cycle (pipe_ctx);/* enable audio only within mode set */ if (pipe_ctx->stream_res.audio !=NULL ) {
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dio_stream_encoder.c +2 -2
@@ -54,9 +54,9 @@ static void enc32_dp_set_odm_combine( struct stream_encoder *enc, bool odm_combine) { -//struct dcn10_stream_encoder *enc1 = DCN10STRENC_FROM_STRENC(enc); +struct dcn10_stream_encoder *enc1 =DCN10STRENC_FROM_STRENC (enc); -//TODO: REG_UPDATE(DP_PIXEL_FORMAT, DP_PIXEL_COMBINE, odm_combine); +REG_UPDATE (DP_PIXEL_FORMAT ,DP_PIXEL_PER_CYCLE_PROCESSING_MODE , odm_combine ?1 :0 ); }/* setup stream encoder in dvi mode */
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dio_stream_encoder.h +1 -0
@@ -96,6 +96,7 @@#define SE_COMMON_MASK_SH_LIST_DCN32_BASE (mask_sh)\ SE_SF(DP0_DP_PIXEL_FORMAT, DP_PIXEL_ENCODING, mask_sh),\ SE_SF(DP0_DP_PIXEL_FORMAT, DP_COMPONENT_DEPTH, mask_sh),\ + SE_SF(DP0_DP_PIXEL_FORMAT, DP_PIXEL_PER_CYCLE_PROCESSING_MODE, mask_sh),\ SE_SF(DIG0_HDMI_CONTROL, HDMI_PACKET_GEN_VERSION, mask_sh),\ SE_SF(DIG0_HDMI_CONTROL, HDMI_KEEPOUT_MODE, mask_sh),\ SE_SF(DIG0_HDMI_CONTROL, HDMI_DEEP_COLOR_ENABLE, mask_sh),\
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +17 -0
@@ -1112,3 +1112,20 @@ unsigned int dcn32_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsignreturn odm_combine_factor; } + +void dcn32_set_pixels_per_cycle (struct pipe_ctx *pipe_ctx) +{ +uint32_t pix_per_cycle =1 ; +uint32_t odm_combine_factor =1 ; + +if (!pipe_ctx || !pipe_ctx->stream || !pipe_ctx->stream_res.stream_enc) +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 ) + 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); +}
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.h +2 -0
@@ -70,6 +70,8 @@ void dcn32_update_odm(struct dc *dc, struct dc_state *context, struct pipe_ctx *unsigned int dcn32_calculate_dccg_k1_k2_values (struct pipe_ctx *pipe_ctx,unsigned int *k1_div,unsigned int *k2_div); +void dcn32_set_pixels_per_cycle (struct pipe_ctx *pipe_ctx); + void dcn32_subvp_pipe_control_lock(struct dc *dc, struct dc_state *context, bool lock,
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c +1 -0
@@ -142,6 +142,7 @@ static const struct hwseq_private_funcs dcn32_private_funcs = { .subvp_update_force_pstate = dcn32_subvp_update_force_pstate, .update_mall_sel = dcn32_update_mall_sel, .calculate_dccg_k1_k2_values = dcn32_calculate_dccg_k1_k2_values, + .set_pixels_per_cycle = dcn32_set_pixels_per_cycle, };void dcn32_hw_sequencer_init_functions (struct dc *dc)
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer_private.h +1 -0
@@ -153,6 +153,7 @@ struct hwseq_private_funcs {unsigned int (*calculate_dccg_k1_k2_values)(struct pipe_ctx *pipe_ctx,unsigned int *k1_div,unsigned int *k2_div); +void (*set_pixels_per_cycle)(struct pipe_ctx *pipe_ctx);#endif };
Signature · 1 line
2.25.1
PATCH 5/40 drm/amd/display: Apply ODM 2:1 policy for single display configuration
In reply to Rodrigo SiqueiraFrom: Samson Tam <[email protected]>
[Why]
Most of the time, a single display uses the ODM combine. When using multi-display, we use ODM combine only if it is necessary. These cases are not flexible enough for us, and we can improve them to take advantage of our hardware. We want to have more control over the ODM policy.
[How]
This commit add a new debug flag named enable_single_display_2to1_odm_policy to control the ODM policy and another flag named enable_dp_dig_pixel_rate_div_policy to fine control the ODM combine. This is possible by adding a new "pipe.dest" parameter that can be set to ODM 2:1 combined if we use a single display. For dynamic ODM combine, when using DP-DIG, DCN applies K2=2 settings for ODM combine. Note that this feature affects the following registers:
- timing.pix_clk_100khz -> DP_VID_M, DP_VID_N
- requested_pix_clk_100hz -> DP_DTOn_PHASE
- OTGn_PIXEL_RATE_DIVK2
- DP_PIXEL_PER_CYCLE_PROCESSING_MODE
- DIG_FIFO_OUTPUT_PIXEL_MODE
- DP_VID_N_MUL
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 + .../drm/amd/display/dc/dcn20/dcn20_resource.c | 7 +++ .../dc/dcn32/dcn32_dio_stream_encoder.c | 4 +- .../drm/amd/display/dc/dcn32/dcn32_hwseq.c | 58 +++++++++++++++++-- .../drm/amd/display/dc/dcn32/dcn32_hwseq.h | 5 ++ .../gpu/drm/amd/display/dc/dcn32/dcn32_init.c | 3 +- .../drm/amd/display/dc/dcn32/dcn32_resource.c | 6 ++ .../amd/display/dc/dml/display_mode_structs.h | 1 + .../drm/amd/display/dc/dml/display_mode_vba.c | 3 +- .../amd/display/dc/inc/hw_sequencer_private.h | 1 + 10 files changed, 83 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +2 -0
@@ -748,6 +748,8 @@ struct dc_debug_options {enum dml_hostvm_override_opts dml_hostvm_override;bool use_legacy_soc_bb_mechanism;bool exit_idle_opt_for_cursor_updates; +bool enable_single_display_2to1_odm_policy; +bool enable_dp_dig_pixel_rate_div_policy; };struct gpu_info_soc_bounding_box_v1_0 ;
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +7 -0
@@ -1237,6 +1237,8 @@ static void get_pixel_clock_parameters(int opp_cnt =1 ;struct dc_link *link = stream->link;struct link_encoder *link_enc =NULL ; +struct dc *dc = pipe_ctx->stream->ctx->dc; +struct dce_hwseq *hws = dc->hwseq;for (odm_pipe = pipe_ctx->next_odm_pipe; odm_pipe; odm_pipe = odm_pipe->next_odm_pipe) opp_cnt++;
@@ -1268,6 +1270,11 @@ static void get_pixel_clock_parameters(else if (optc2_is_two_pixels_per_containter (&stream->timing) || opp_cnt ==2 ) pixel_clk_params->requested_pix_clk_100hz /=2 ; +else if (hws->funcs.is_dp_dig_pixel_rate_div_policy) { +if (hws->funcs.is_dp_dig_pixel_rate_div_policy (pipe_ctx)) + pixel_clk_params->requested_pix_clk_100hz /=2 ; + } +if (stream->timing.timing_3d_format ==TIMING_3D_FORMAT_HW_FRAME_PACKING ) pixel_clk_params->requested_pix_clk_100hz *=2 ;
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dio_stream_encoder.c +3 -1
@@ -249,6 +249,7 @@ static void enc32_stream_encoder_dp_unblank( const struct encoder_unblank_param *param) {struct dcn10_stream_encoder *enc1 =DCN10STRENC_FROM_STRENC (enc); +struct dc *dc = enc->ctx->dc;if (param->link_settings.link_rate !=LINK_RATE_UNKNOWN ) {uint32_t n_vid =0x8000 ;
@@ -257,7 +258,8 @@ static void enc32_stream_encoder_dp_unblank(uint64_t m_vid_l = n_vid;/* YCbCr 4:2:0 : Computed VID_M will be 2X the input rate */ -if (is_two_pixels_per_containter (¶m->timing) || param->opp_cnt >1 ) { +if (is_two_pixels_per_containter (¶m->timing) || param->opp_cnt >1 + || dc->debug.enable_dp_dig_pixel_rate_div_policy) {/*this logic should be the same in get_pixel_clock_parameters() */ n_multiply =1 ; }
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +54 -4
79 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.h +5 -0
@@ -79,4 +79,9 @@ void dcn32_subvp_pipe_control_lock(struct dc *dc,struct pipe_ctx *top_pipe_to_program, bool subvp_prev_use); +void dcn32_unblank_stream (struct pipe_ctx *pipe_ctx, +struct dc_link_settings *link_settings); + +bool dcn32_is_dp_dig_pixel_rate_div_policy (struct pipe_ctx *pipe_ctx); +#endif /* __DC_HWSS_DCN32_H__ */
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c +2 -1
@@ -50,7 +50,7 @@ static const struct hw_sequencer_funcs dcn32_funcs = { .send_immediate_sdp_message = dcn10_send_immediate_sdp_message, .enable_stream = dcn20_enable_stream, .disable_stream = dce110_disable_stream, - .unblank_stream = dcn20_unblank_stream, + .unblank_stream = dcn32_unblank_stream, .blank_stream = dce110_blank_stream, .enable_audio_stream = dce110_enable_audio_stream, .disable_audio_stream = dce110_disable_audio_stream,
@@ -143,6 +143,7 @@ static const struct hwseq_private_funcs dcn32_private_funcs = { .update_mall_sel = dcn32_update_mall_sel, .calculate_dccg_k1_k2_values = dcn32_calculate_dccg_k1_k2_values, .set_pixels_per_cycle = dcn32_set_pixels_per_cycle, + .is_dp_dig_pixel_rate_div_policy = dcn32_is_dp_dig_pixel_rate_div_policy, };void dcn32_hw_sequencer_init_functions (struct dc *dc)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +6 -0
@@ -3036,6 +3036,12 @@ int dcn32_populate_dml_pipes_from_context(break ; } } + + pipes[pipe_cnt].pipe.dest.odm_combine_policy = dm_odm_combine_policy_dal; +if (context->stream_count ==1 ) { +if (dc->debug.enable_single_display_2to1_odm_policy) + pipes[pipe_cnt].pipe.dest.odm_combine_policy = dm_odm_combine_policy_2to1; + } pipe_cnt++; }
drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h +1 -0
@@ -497,6 +497,7 @@ struct _vcs_dpi_display_pipe_dest_params_st {unsigned int vtotal_min;unsigned int refresh_rate;bool synchronize_timings; +unsigned int odm_combine_policy; };struct _vcs_dpi_display_pipe_params_st {
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c +2 -1
@@ -561,7 +561,8 @@ static void fetch_pipe_params(struct display_mode_lib *mode_lib) mode_lib->vba.GPUVMMinPageSizeKBytes[mode_lib->vba.NumberOfActivePlanes] = src->gpuvm_min_page_size_kbytes; mode_lib->vba.RefreshRate[mode_lib->vba.NumberOfActivePlanes] = dst->refresh_rate;//todo remove this mode_lib->vba.OutputLinkDPRate[mode_lib->vba.NumberOfActivePlanes] = dout->dp_rate; - mode_lib->vba.ODMUse[mode_lib->vba.NumberOfActivePlanes] = dst->odm_combine; + + mode_lib->vba.ODMUse[mode_lib->vba.NumberOfActivePlanes] = dst->odm_combine_policy;//TODO: Need to assign correct values to dp_multistream vars mode_lib->vba.OutputMultistreamEn[mode_lib->vba.NumberOfActiveSurfaces] = dout->dp_multistream_en; mode_lib->vba.OutputMultistreamId[mode_lib->vba.NumberOfActiveSurfaces] = dout->dp_multistream_id;
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer_private.h +1 -0
@@ -154,6 +154,7 @@ struct hwseq_private_funcs {unsigned int *k1_div, unsigned int *k2_div);void (*set_pixels_per_cycle)(struct pipe_ctx *pipe_ctx); +bool (*is_dp_dig_pixel_rate_div_policy)(struct pipe_ctx *pipe_ctx);#endif };
Signature · 1 line
2.25.1
PATCH 6/40 drm/amd/display: Use two pixel per container for k1/k2 div
In reply to Rodrigo SiqueiraCurrently, we check if pixel_encoding is equal to PIXEL_ENCODING_YCBCR422 to get the k1/k2 div parameters. This commit changes this logic slightly by checking if two pixels per container are used.
--- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +4 -4
@@ -1082,6 +1082,7 @@ unsigned int dcn32_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsignstruct 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 =optc2_is_two_pixels_per_containter (&stream->timing); odm_combine_factor =get_odm_config (pipe_ctx,NULL );
@@ -1094,13 +1095,12 @@ unsigned int dcn32_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsignelse *k2_div =PIXEL_RATE_DIV_BY_4 ; }else if (dc_is_dp_signal (pipe_ctx->stream->signal)) { -if (stream->timing.pixel_encoding ==PIXEL_ENCODING_YCBCR420 ) { +if (two_pix_per_container) { *k1_div =PIXEL_RATE_DIV_BY_1 ; *k2_div =PIXEL_RATE_DIV_BY_2 ; - }else if (stream->timing.pixel_encoding ==PIXEL_ENCODING_YCBCR422 ) { - *k1_div =PIXEL_RATE_DIV_BY_2 ; - *k2_div =PIXEL_RATE_DIV_BY_2 ; }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) *k2_div =PIXEL_RATE_DIV_BY_2 ; }
Signature · 1 line
2.25.1
PATCH 7/40 drm/amd/display: Change DET policy for MPO cases
In reply to Rodrigo SiqueiraFrom: Alvin Lee <[email protected]>
For MPO we want to allocate less than maximum DET for MPO pipes because we need enogh buffer to move DET back to toher pipes when removing an MPO plane. Also update regular DET allocation to use DET override (DCN32 has an internal policy which driver does not want to use)
--- .../drm/amd/display/dc/dcn32/dcn32_resource.c | 34 ++++++++++++------- .../drm/amd/display/dc/dml/display_mode_vba.c | 2 +- 2 files changed, 22 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +21 -13
@@ -3045,31 +3045,35 @@ int dcn32_populate_dml_pipes_from_context( 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. +*/ switch (pipe_cnt) {case 1 : - context->bw_ctx.dml.ip.det_buffer_size_kbytes =DCN3_2_MAX_DET_SIZE ; + 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)) { - context->bw_ctx.dml.ip.det_buffer_size_kbytes =DCN3_2_DEFAULT_DET_SIZE ; + 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 ) - context->bw_ctx.dml.ip.det_buffer_size_kbytes =320 ;// 5K or higher + pipes[0 ].pipe.src.det_size_override =320 ;// 5K or higher } }break ;case 2 : - context->bw_ctx.dml.ip.det_buffer_size_kbytes =DCN3_2_MAX_DET_SIZE /2 ;// 576 KB (9 segments) -break ;case 3 : - context->bw_ctx.dml.ip.det_buffer_size_kbytes =DCN3_2_MAX_DET_SIZE /3 ;// 384 KB (6 segments) -break ;case 4 : -default : - context->bw_ctx.dml.ip.det_buffer_size_kbytes =DCN3_2_DEFAULT_DET_SIZE ;// 256 KB (4 segments) +// For 2 and 3 pipes, use (MAX_DET_SIZE / pipe_cnt), for 4 pipes use default size for each pipe +for (i =0 ; i < pipe_cnt; i++) { + pipes[i].pipe.src.det_size_override = (pipe_cnt <4 ) ? (DCN3_2_MAX_DET_SIZE / pipe_cnt) :DCN3_2_DEFAULT_DET_SIZE ; + }break ; } +dcn32_update_det_override_for_mpo (dc, context, pipes); +return pipe_cnt; }
@@ -3365,8 +3369,8 @@ void dcn32_calculate_dlg_params(struct dc *dc, struct dc_state *context, display context->res_ctx.pipe_ctx[i].det_buffer_size_kb =0 ; context->res_ctx.pipe_ctx[i].unbounded_req = false; }else { - context->res_ctx.pipe_ctx[i].det_buffer_size_kb = - context->bw_ctx.dml.ip.det_buffer_size_kbytes; + context->res_ctx.pipe_ctx[i].det_buffer_size_kb =get_det_buffer_size_kbytes (&context->bw_ctx.dml, pipes, pipe_cnt, + pipe_idx); context->res_ctx.pipe_ctx[i].unbounded_req = pipes[pipe_idx].pipe.src.unbounded_req_mode; }if (context->bw_ctx.bw.dcn.clk.dppclk_khz < pipes[pipe_idx].clks_cfg.dppclk_mhz *1000 )
@@ -3383,8 +3387,12 @@ void dcn32_calculate_dlg_params(struct dc *dc, struct dc_state *context, display context->bw_ctx.bw.dcn.clk.max_supported_dispclk_khz = context->bw_ctx.dml.soc.clock_limits[vlevel].dispclk_mhz *1000 ; - context->bw_ctx.bw.dcn.compbuf_size_kb = context->bw_ctx.dml.ip.config_return_buffer_size_in_kbytes - - context->bw_ctx.dml.ip.det_buffer_size_kbytes * pipe_idx; + context->bw_ctx.bw.dcn.compbuf_size_kb = context->bw_ctx.dml.ip.config_return_buffer_size_in_kbytes; + +for (i =0 ; i < dc->res_pool->pipe_count; i++) { +if (context->res_ctx.pipe_ctx[i].stream) + context->bw_ctx.bw.dcn.compbuf_size_kb -= context->res_ctx.pipe_ctx[i].det_buffer_size_kb; + }for (i =0 , pipe_idx =0 ; i < dc->res_pool->pipe_count; i++) {
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c +1 -1
@@ -561,8 +561,8 @@ static void fetch_pipe_params(struct display_mode_lib *mode_lib) mode_lib->vba.GPUVMMinPageSizeKBytes[mode_lib->vba.NumberOfActivePlanes] = src->gpuvm_min_page_size_kbytes; mode_lib->vba.RefreshRate[mode_lib->vba.NumberOfActivePlanes] = dst->refresh_rate;//todo remove this mode_lib->vba.OutputLinkDPRate[mode_lib->vba.NumberOfActivePlanes] = dout->dp_rate; - mode_lib->vba.ODMUse[mode_lib->vba.NumberOfActivePlanes] = dst->odm_combine_policy; + mode_lib->vba.DETSizeOverride[mode_lib->vba.NumberOfActivePlanes] = src->det_size_override;//TODO: Need to assign correct values to dp_multistream vars mode_lib->vba.OutputMultistreamEn[mode_lib->vba.NumberOfActiveSurfaces] = dout->dp_multistream_en; mode_lib->vba.OutputMultistreamId[mode_lib->vba.NumberOfActiveSurfaces] = dout->dp_multistream_id;
Signature · 1 line
2.25.1
PATCH 8/40 drm/amd/display: Switch to correct DTO on HDMI
In reply to Rodrigo SiqueiraFrom: Chris Park <[email protected]>
[Why]
For Pixel Rate control, when on HDMI, HDMI DTO should be selected instead of DP DTO.
[How]
Pass HDMI parameter for HDMI stream, and select correct DTO.
--- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 2 ++ drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c | 4 ++++ 2 files changed, 6 insertions(+)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c +2 -0
@@ -318,6 +318,8 @@ static void dcn32_update_clocks_update_dtb_dto(struct clk_mgr_internal *clk_mgr,if (pipe_ctx->stream_res.audio !=NULL ) dto_params.req_audio_dtbclk_khz =24000 ; } +if (dc_is_hdmi_signal (pipe_ctx->stream->signal)) + dto_params.is_hdmi = true; dccg->funcs->set_dtbclk_dto (clk_mgr->dccg, &dto_params);//dccg->funcs->set_audio_dtbclk_dto(clk_mgr->dccg, &dto_params);
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c +4 -0
@@ -171,6 +171,9 @@ void dccg32_set_dtbclk_dto(REG_UPDATE_2 (OTG_PIXEL_RATE_CNTL [params->otg_inst],DTBCLK_DTO_ENABLE [params->otg_inst],0 ,PIPE_DTO_SRC_SEL [params->otg_inst],1 ); +if (params->is_hdmi) +REG_UPDATE (OTG_PIXEL_RATE_CNTL [params->otg_inst], +PIPE_DTO_SRC_SEL [params->otg_inst],0 );REG_WRITE (DTBCLK_DTO_MODULO [params->otg_inst],0 );REG_WRITE (DTBCLK_DTO_PHASE [params->otg_inst],0 );
@@ -188,6 +191,7 @@ static void dccg32_set_valid_pixel_rate( dto_params.ref_dtbclk_khz = ref_dtbclk_khz; dto_params.otg_inst = otg_inst; dto_params.pixclk_khz = pixclk_khz; + dto_params.is_hdmi = true;dccg32_set_dtbclk_dto (dccg, &dto_params); }
Signature · 1 line
2.25.1
PATCH 9/40 drm/amd/display: Update gpuvm_max_page_table_levels IP param
In reply to Rodrigo SiqueiraFrom: Eric Bernstein <[email protected]>
After some experimental tests, we noticed that we need to set gpuvm_max_page_table_levels to '4' to meet the hardware requirements.
--- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +1 -1
@@ -121,7 +121,7 @@ static const struct IP_BASE DCN_BASE = { { { { 0x00000012, 0x000000C0, 0x000034Cstruct _vcs_dpi_ip_params_st dcn3_2_ip = { .gpuvm_enable =1 , - .gpuvm_max_page_table_levels =1 , + .gpuvm_max_page_table_levels =4 , .hostvm_enable =0 , .rob_buffer_size_kbytes =128 , .det_buffer_size_kbytes =DCN3_2_DEFAULT_DET_SIZE ,
drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c +1 -1
@@ -124,7 +124,7 @@ static const struct IP_BASE DCN_BASE = { { { { 0x00000012, 0x000000C0, 0x000034Cstruct _vcs_dpi_ip_params_st dcn3_21_ip = { .gpuvm_enable =1 , - .gpuvm_max_page_table_levels =1 , + .gpuvm_max_page_table_levels =4 , .hostvm_enable =0 , .rob_buffer_size_kbytes =128 , .det_buffer_size_kbytes =DCN3_2_DEFAULT_DET_SIZE ,
Signature · 1 line
2.25.1
PATCH 10/40 drm/amd/display: Make OPTC3 function accessible to other DCN
In reply to Rodrigo SiqueiraFrom: Alvin Lee <[email protected]>
[Why]
Newer DCN should use optc3
[How]
Declare optc3 vmin/vmax function in header.
--- drivers/gpu/drm/amd/display/dc/dc.h | 1 + drivers/gpu/drm/amd/display/dc/dcn30/dcn30_optc.c | 5 +++++ drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_optc.c | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -440,6 +440,7 @@ struct dc_clocks {bool prev_p_state_change_support;bool fclk_prev_p_state_change_support;int num_ways; +bool fw_based_mclk_switching;int prev_num_ways;enum dtm_pstate dtm_level;int max_supported_dppclk_khz;
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_optc.c +5 -0
@@ -293,6 +293,11 @@ static void optc3_set_timing_double_buffer(struct timing_generator *optc, bool e OTG_DRR_TIMING_DBUF_UPDATE_MODE, mode); } +void optc3_set_vtotal_min_max (struct timing_generator *optc,int vtotal_min,int vtotal_max) +{ +optc1_set_vtotal_min_max (optc, vtotal_min, vtotal_max); +} +void optc3_tg_init (struct timing_generator *optc) {optc3_set_timing_double_buffer (optc, true);
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c +1 -1
@@ -58,7 +58,7 @@ static const struct hw_sequencer_funcs dcn32_funcs = { .pipe_control_lock = dcn20_pipe_control_lock, .interdependent_update_lock = dcn10_lock_all_pipes, .cursor_lock = dcn10_cursor_lock, - .prepare_bandwidth = dcn20_prepare_bandwidth, + .prepare_bandwidth = dcn30_prepare_bandwidth, .optimize_bandwidth = dcn20_optimize_bandwidth, .update_bandwidth = dcn20_update_bandwidth, .set_drr = dcn10_set_drr,
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_optc.c +1 -1
@@ -223,7 +223,7 @@ static struct timing_generator_funcs dcn32_tg_funcs = { .set_vrr_m_const = optc3_set_vrr_m_const, .set_drr = optc1_set_drr, .get_last_used_drr_vtotal = optc2_get_last_used_drr_vtotal, - .set_vtotal_min_max = optc1_set_vtotal_min_max, + .set_vtotal_min_max = optc3_set_vtotal_min_max, .set_static_screen_control = optc1_set_static_screen_control, .program_stereo = optc1_program_stereo, .is_stereo_left_eye = optc1_is_stereo_left_eye,
Signature · 1 line
2.25.1
PATCH 11/40 drm/amd/display: Add basic infrastructure for enabling FAMS
In reply to Rodrigo SiqueiraWe want to enable Firmware Assisted Memory (FAMS) Switching, but first, we need to add the required code infrastructure in DC before allowing it in amdgpu_dm.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 8 + drivers/gpu/drm/amd/display/dc/dc.h | 10 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 87 +++++++++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 4 + drivers/gpu/drm/amd/display/dc/dc_types.h | 2 + .../drm/amd/display/dc/dcn30/dcn30_hwseq.c | 22 ++- .../drm/amd/display/dc/dcn30/dcn30_resource.c | 170 ++++++++++++++++++ .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 6 + .../drm/amd/display/dc/dml/dcn30/dcn30_fpu.c | 2 + .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 25 ++- 10 files changed, 328 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +8 -0
@@ -3842,10 +3842,18 @@ bool dc_is_plane_eligible_for_idle_optimizations(struct dc *dc, struct dc_plane_/* cleanup on driver unload */ void dc_hardware_release (struct dc *dc) { +dc_mclk_switch_using_fw_based_vblank_stretch_shut_down (dc); +if (dc->hwss.hardware_release) dc->hwss.hardware_release (dc); } +void dc_mclk_switch_using_fw_based_vblank_stretch_shut_down (struct dc *dc) +{ +if (dc->current_state) + dc->current_state->bw_ctx.bw.dcn.clk.fw_based_mclk_switching_shut_down = true; +} +/* ***************************************************************************** * Function: dc_is_dmub_outbox_supported -
drivers/gpu/drm/amd/display/dc/dc.h +9 -1
@@ -163,7 +163,8 @@ struct dc_color_caps { };struct dc_dmub_caps { -bool psr; +bool psr; +bool mclk_sw; };struct dc_caps {
@@ -359,6 +360,8 @@ enum visual_confirm {VISUAL_CONFIRM_HDR =2 ,VISUAL_CONFIRM_MPCTREE =4 ,VISUAL_CONFIRM_PSR =5 , +VISUAL_CONFIRM_SWAPCHAIN =6 , +VISUAL_CONFIRM_FAMS =7 , VISUAL_CONFIRM_SWIZZLE = 9, };
@@ -441,6 +444,7 @@ struct dc_clocks {bool fclk_prev_p_state_change_support;int num_ways;bool fw_based_mclk_switching; +bool fw_based_mclk_switching_shut_down;int prev_num_ways;enum dtm_pstate dtm_level;int max_supported_dppclk_khz;
@@ -726,6 +730,7 @@ struct dc_debug_options {/* Enable dmub aux for legacy ddc */ bool enable_dmub_aux_for_legacy_ddc; +bool disable_fams;bool optimize_edp_link_rate;/* eDP ILR */ /* FEC/PSR1 sequence enable delay in 100us */ uint8_t fec_enable_delay_in100us;
@@ -1452,6 +1457,9 @@ void dc_enable_dcmode_clk_limit(struct dc *dc, bool enable);/* cleanup on driver unload */ void dc_hardware_release (struct dc *dc); +/* disables fw based mclk switch */ +void dc_mclk_switch_using_fw_based_vblank_stretch_shut_down (struct dc *dc); +bool dc_set_psr_allow_active (struct dc *dc,bool enable);void dc_z10_restore (const struct dc *dc);void dc_z10_save_init (struct dc *dc);
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +87 -0
93 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h +4 -0
@@ -72,6 +72,10 @@ bool dc_dmub_srv_get_dmub_outbox0_msg(const struct dc *dc, struct dmcub_trace_buvoid dc_dmub_trace_event_control (struct dc *dc,bool enable); +void dc_dmub_srv_drr_update_cmd (struct dc *dc,uint32_t tg_inst,uint32_t vtotal_min,uint32_t vtotal_max); + +bool dc_dmub_srv_p_state_delegate (struct dc *dc,bool enable_pstate,struct dc_state *context); +void dc_dmub_srv_query_caps_cmd (struct dmub_srv *dmub);void dc_dmub_srv_clear_inbox0_ack (struct dc_dmub_srv *dmub_srv);void dc_dmub_srv_wait_for_inbox0_ack (struct dc_dmub_srv *dmub_srv);
drivers/gpu/drm/amd/display/dc/dc_types.h +2 -0
@@ -196,6 +196,8 @@ struct dc_panel_patch {unsigned int disable_fec;unsigned int extra_t3_ms;unsigned int max_dsc_target_bpp_limit; +unsigned int embedded_tiled_slave; +unsigned int disable_fams;unsigned int skip_avmute; };
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c +16 -6
@@ -641,6 +641,7 @@ void dcn30_init_hw(struct dc *dc)// Get DMCUB capabilities dc_dmub_srv_query_caps_cmd (dc->ctx->dmub_srv->dmub); dc->caps.dmub_caps.psr = dc->ctx->dmub_srv->dmub->feature_caps.psr; + dc->caps.dmub_caps.mclk_sw = dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch; }void dcn30_set_avmute (struct pipe_ctx *pipe_ctx,bool enable)
@@ -938,11 +939,17 @@ bool dcn30_does_plane_fit_in_mall(struct dc *dc, struct dc_plane_state *plane, svoid dcn30_hardware_release (struct dc *dc) { -/* if pstate unsupported, force it supported */ -if (!dc->clk_mgr->clks.p_state_change_support && - dc->res_pool->hubbub->funcs->force_pstate_change_control) - dc->res_pool->hubbub->funcs->force_pstate_change_control ( - dc->res_pool->hubbub, true, true); +dc_dmub_srv_p_state_delegate (dc, false,NULL ); + +/* 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 || + 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 ( + dc->res_pool->hubbub, true, true); } void dcn30_set_disp_pattern_generator(const struct dc *dc,
@@ -965,6 +972,9 @@ void dcn30_prepare_bandwidth(struct dc *dc, context->bw_ctx.bw.dcn.clk.dramclk_khz > dc->clk_mgr->bw_params->dc_mode_softmax_memclk * 1000) dc->clk_mgr->funcs->set_max_memclk(dc->clk_mgr, dc->clk_mgr->bw_params->clk_table.entries[dc->clk_mgr->bw_params->clk_table.num_entries - 1].memclk_mhz); -dcn20_prepare_bandwidth (dc, context); +dcn20_prepare_bandwidth (dc, context); + +dc_dmub_srv_p_state_delegate (dc, + context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching, context); }
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c +170 -0
176 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c +6 -0
@@ -797,6 +797,12 @@ void dcn20_calculate_dlg_params( context->bw_ctx.bw.dcn.clk.p_state_change_support = context->bw_ctx.dml.vba.DRAMClockChangeSupport[vlevel][context->bw_ctx.dml.vba.maxMpcComb] != dm_dram_clock_change_unsupported; + +/* Pstate change might not be supported by hardware, but it might be +* possible with firmware driven vertical blank stretching. +*/ + context->bw_ctx.bw.dcn.clk.p_state_change_support |= context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching; + context->bw_ctx.bw.dcn.clk.dppclk_khz =0 ; context->bw_ctx.bw.dcn.clk.dtbclk_en =is_dtbclk_required (dc, context);
drivers/gpu/drm/amd/display/dc/dml/dcn30/dcn30_fpu.c +2 -0
@@ -529,6 +529,8 @@ dc_assert_fp_enabled(); context->bw_ctx.dml.soc.dram_clock_change_latency_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A ].dml_input.pstate_latency_us; +if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching) +dcn30_setup_mclk_switch_using_fw_based_vblank_stretch (dc, context); }void dcn30_fpu_update_dram_channel_width_bytes (struct dc *dc)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +24 -1
@@ -242,7 +242,8 @@ struct dmub_feature_caps {* Max PSR version supported by FW. */ uint8_t psr; -uint8_t reserved[7 ]; +uint8_t fw_assisted_mclk_switch; +uint8_t reserved[6 ]; };#if defined(__cplusplus)
@@ -2773,6 +2774,26 @@ struct dmub_rb_cmd_drr_update {struct dmub_optc_state dmub_optc_state_req; }; +struct dmub_cmd_fw_assisted_mclk_switch_pipe_data { +uint32_t pix_clk_100hz; +uint8_t max_ramp_step; +uint8_t pipes; +uint8_t min_refresh_in_hz; +uint8_t padding[1 ]; +}; + +struct dmub_cmd_fw_assisted_mclk_switch_config { +uint8_t fams_enabled; +uint8_t visual_confirm_enabled; +uint8_t padding[2 ]; +struct dmub_cmd_fw_assisted_mclk_switch_pipe_data pipe_data[DMUB_MAX_STREAMS ]; +}; + +struct dmub_rb_cmd_fw_assisted_mclk_switch { +struct dmub_cmd_header header; +struct dmub_cmd_fw_assisted_mclk_switch_config config_data; +}; +/** * enum dmub_cmd_panel_cntl_type - Panel control command. */
@@ -3111,6 +3132,8 @@ union dmub_rb_cmd {*/ struct dmub_rb_cmd_query_feature_caps query_feature_caps;struct dmub_rb_cmd_drr_update drr_update; +struct dmub_rb_cmd_fw_assisted_mclk_switch fw_assisted_mclk_switch; +/** * Definition of a DMUB_CMD__VBIOS_LVTMA_CONTROL command. */
Signature · 1 line
2.25.1
PATCH 12/40 drm/amd/display: Fix stream->link_enc unassigned during stream removal
In reply to Rodrigo SiqueiraFrom: Nicholas Kazlauskas <[email protected]>
[Why]
Found when running igt@kms_atomic.
Userspace attempts to do a TEST_COMMIT when 0 streams which calls dc_remove_stream_from_ctx. This in turn calls link_enc_unassign which ends up modifying stream->link = NULL directly, causing the global link_enc to be removed preventing further link activity and future link validation from passing.
[How]
We take care of link_enc unassignment at the start of link_enc_cfg_link_encs_assign so this call is no longer necessary.
Fixes global state from being modified while unlocked.
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +0 -3
@@ -1994,9 +1994,6 @@ enum dc_status dc_remove_stream_from_ctx( dc->res_pool, del_pipe->stream_res.stream_enc, false); -/* Release link encoder from stream in new dc_state. */ -if (dc->res_pool->funcs->link_enc_unassign) - dc->res_pool->funcs->link_enc_unassign (new_ctx, del_pipe->stream);if (is_dp_128b_132b_signal (del_pipe)) { update_hpo_dp_stream_engine_usage(
Signature · 1 line
2.25.1
PATCH 13/40 drm/amd/display: Add SubVP control lock
In reply to Rodrigo Siqueira--- drivers/gpu/drm/amd/display/dc/core/dc.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +8 -4
@@ -3201,15 +3201,19 @@ static void commit_planes_for_stream(struct dc *dc, } -#ifdef CONFIG_DRM_AMD_DC_DCN if (update_type !=UPDATE_TYPE_FAST )if (dc->hwss.commit_subvp_config) dc->hwss.commit_subvp_config (dc, context); -#endif -if (should_lock_all_pipes && dc->hwss.interdependent_update_lock) + +if (should_lock_all_pipes && dc->hwss.interdependent_update_lock) { dc->hwss.interdependent_update_lock (dc, context, false); -else +if (dc->hwss.subvp_pipe_control_lock) + dc->hwss.subvp_pipe_control_lock (dc, context, false, should_lock_all_pipes,NULL , subvp_prev_use); + }else { dc->hwss.pipe_control_lock (dc, top_pipe_to_program, false); +if (dc->hwss.subvp_pipe_control_lock) + dc->hwss.subvp_pipe_control_lock (dc, context, false, should_lock_all_pipes, top_pipe_to_program, subvp_prev_use); + }if ((update_type !=UPDATE_TYPE_FAST ) && stream->update_flags.bits.dsc_changed)if (top_pipe_to_program->stream_res.tg->funcs->lock_doublebuffer_enable) {
Signature · 1 line
2.25.1
PATCH 14/40 drm/amd/display: Add minimal pipe split transition state
In reply to Rodrigo Siqueira[WHY?]
When adding/removing a plane to some configurations, unsupported pipe programming can occur when moving to a new plane. Such cases include pipe split on multi-display, with MPO, and/or ODM.
[HOW?]
Add a safe transistion state that minimizes pipe usage before programming new configuration. When adding a plane, the current state has the least pipes required so it is applied without splitting. This must be applied prior to updating the plane_state for seamless transition. When removing a plane, the new state has the least pieps required so it is applied without splitting.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 277 +++++++++++++++++++++ drivers/gpu/drm/amd/display/dc/dc_stream.h | 18 ++ 2 files changed, 295 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +277 -0
@@ -2717,6 +2717,137 @@ static void copy_stream_update_to_stream(struct dc *dc, } } +void dc_reset_state (struct dc *dc,struct dc_state *context) +{ +dc_resource_state_destruct (context); + +/* clear the structure, but don't reset the reference count */ +memset (context,0 , offsetof(struct dc_state , refcount)); + +init_state (dc, context); +} + +static bool update_planes_and_stream_state (struct dc *dc, +struct dc_surface_update *srf_updates,int surface_count, +struct dc_stream_state *stream, +struct dc_stream_update *stream_update, +enum surface_update_type *new_update_type, +struct dc_state **new_context) +{ +struct dc_state *context; +int i, j; +enum surface_update_type update_type; +const struct dc_stream_status *stream_status; +struct dc_context *dc_ctx = dc->ctx; + + stream_status =dc_stream_get_status (stream); + +if (!stream_status) { +if (surface_count)/* Only an error condition if surf_count non-zero*/ +ASSERT (false); + +return false;/* Cannot commit surface to stream that is not committed */ + } + + context = dc->current_state; + + update_type =dc_check_update_surfaces_for_stream ( + dc, srf_updates, surface_count, stream_update, stream_status); + +/* update current stream with the new updates */ +copy_stream_update_to_stream (dc, context, stream, stream_update); + +/* do not perform surface update if surface has invalid dimensions +* (all zero) and no scaling_info is provided +*/ +if (surface_count >0 ) { +for (i =0 ; i < surface_count; i++) { +if ((srf_updates[i].surface->src_rect.width ==0 || + srf_updates[i].surface->src_rect.height ==0 || + srf_updates[i].surface->dst_rect.width ==0 || + srf_updates[i].surface->dst_rect.height ==0 ) && + (!srf_updates[i].scaling_info || + srf_updates[i].scaling_info->src_rect.width ==0 || + srf_updates[i].scaling_info->src_rect.height ==0 || + srf_updates[i].scaling_info->dst_rect.width ==0 || + srf_updates[i].scaling_info->dst_rect.height ==0 )) { +DC_ERROR ("Invalid src/dst rects in surface update!\n" ); +return false; + } + } + } + +if (update_type >= update_surface_trace_level) +update_surface_trace (dc, srf_updates, surface_count); + +if (update_type >=UPDATE_TYPE_FULL ) { +struct dc_plane_state *new_planes[MAX_SURFACES ] = {0 }; + +for (i =0 ; i < surface_count; i++) + new_planes[i] = srf_updates[i].surface; + +/* initialize scratch memory for building context */ + context =dc_create_state (dc); +if (context ==NULL ) { +DC_ERROR ("Failed to allocate new validate context!\n" ); +return false; + } + +dc_resource_state_copy_construct ( + dc->current_state, context); + +/*remove old surfaces from context */ +if (!dc_rem_all_planes_for_stream (dc, stream, context)) { + +BREAK_TO_DEBUGGER (); + goto fail; + } + +/* add surface to context */ +if (!dc_add_all_planes_for_stream (dc, stream, new_planes, surface_count, context)) { + +BREAK_TO_DEBUGGER (); + goto fail; + } + } + +/* save update parameters into surface */ +for (i =0 ; i < surface_count; i++) { +struct dc_plane_state *surface = srf_updates[i].surface; + +copy_surface_update_to_plane (surface, &srf_updates[i]); + +if (update_type >=UPDATE_TYPE_MED ) { +for (j =0 ; j < dc->res_pool->pipe_count; j++) { +struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[j]; + +if (pipe_ctx->plane_state != surface) +continue ; + +resource_build_scaling_params (pipe_ctx); + } + } + } + +if (update_type ==UPDATE_TYPE_FULL ) { +if (!dc->res_pool->funcs->validate_bandwidth (dc, context, false)) { +BREAK_TO_DEBUGGER (); + goto fail; + } + } + + *new_context = context; + *new_update_type = update_type; + +return true; + +fail: +dc_release_state (context); + +return false; + +} + static void commit_planes_do_stream_update(struct dc *dc, struct dc_stream_state *stream, struct dc_stream_update *stream_update,
@@ -3264,6 +3395,152 @@ static void commit_planes_for_stream(struct dc *dc, } } +static bool commit_minimal_transition_state (struct dc *dc, +struct dc_state *transition_base_context) +{ +struct dc_state *transition_context =dc_create_state (dc); +enum pipe_split_policy tmp_policy; +enum dc_status ret =DC_ERROR_UNEXPECTED ; +unsigned int i, j; + +if (!transition_context) +return false; + + tmp_policy = dc->debug.pipe_split_policy; + dc->debug.pipe_split_policy =MPC_SPLIT_AVOID ; + +dc_resource_state_copy_construct (transition_base_context, transition_context); + +//commit minimal state +if (dc->res_pool->funcs->validate_bandwidth (dc, transition_context, false)) { +for (i =0 ; i < transition_context->stream_count; i++) { +struct dc_stream_status *stream_status = &transition_context->stream_status[i]; + +for (j =0 ; j < stream_status->plane_count; j++) { +struct dc_plane_state *plane_state = stream_status->plane_states[j]; + +/* force vsync flip when reconfiguring pipes to prevent underflow +* and corruption +*/ + plane_state->flip_immediate = false; + } + } + + ret =dc_commit_state_no_check (dc, transition_context); + } + +//always release as dc_commit_state_no_check retains in good case +dc_release_state (transition_context); + +//restore previous pipe split policy + dc->debug.pipe_split_policy = tmp_policy; + +if (ret !=DC_OK ) { +//this should never happen +BREAK_TO_DEBUGGER (); +return false; + } + +//force full surface update +for (i =0 ; i < dc->current_state->stream_count; i++) { +for (j =0 ; j < dc->current_state->stream_status[i].plane_count; j++) { + dc->current_state->stream_status[i].plane_states[j]->update_flags.raw =0xFFFFFFFF ; + } + } + +return true; +} + +bool dc_update_planes_and_stream (struct dc *dc, +struct dc_surface_update *srf_updates,int surface_count, +struct dc_stream_state *stream, +struct dc_stream_update *stream_update) +{ +struct dc_state *context; +enum surface_update_type update_type; +int i; + +/* In cases where MPO and split or ODM are used transitions can +* cause underflow. Apply stream configuration with minimal pipe +* split first to avoid unsupported transitions for active pipes. +*/ +bool force_minimal_pipe_splitting = false; +bool is_plane_addition = false; + +struct dc_stream_status *cur_stream_status =stream_get_status (dc->current_state, stream); + +if (cur_stream_status && + dc->current_state->stream_count >0 && + dc->debug.pipe_split_policy !=MPC_SPLIT_AVOID ) { +/* determine if minimal transition is required */ +if (cur_stream_status->plane_count > surface_count) { + force_minimal_pipe_splitting = true; + }else if (cur_stream_status->plane_count < surface_count) { + force_minimal_pipe_splitting = true; + is_plane_addition = true; + } + } + +/* on plane addition, minimal state is the current one */ +if (force_minimal_pipe_splitting && is_plane_addition && + !commit_minimal_transition_state (dc, dc->current_state)) +return false; + +if (!update_planes_and_stream_state ( + dc, + srf_updates, + surface_count, + stream, + stream_update, + &update_type, + &context)) +return false; + +/* on plane addition, minimal state is the new one */ +if (force_minimal_pipe_splitting && !is_plane_addition) { +if (!commit_minimal_transition_state (dc, context)) { +dc_release_state (context); +return false; + } + + update_type =UPDATE_TYPE_FULL ; + } + +commit_planes_for_stream ( + dc, + srf_updates, + surface_count, + stream, + stream_update, + update_type, + context); + +if (dc->current_state != context) { + +/* Since memory free requires elevated IRQL, an interrupt +* request is generated by mem free. If this happens +* between freeing and reassigning the context, our vsync +* interrupt will call into dc and cause a memory +* corruption BSOD. Hence, we first reassign the context, +* then free the old context. +*/ + +struct dc_state *old = dc->current_state; + + dc->current_state = context; +dc_release_state (old); + +// clear any forced full updates +for (i =0 ; i < dc->res_pool->pipe_count; i++) { +struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i]; + +if (pipe_ctx->plane_state && pipe_ctx->stream == stream) + pipe_ctx->plane_state->force_full_update = false; + } + } +return true; +} + void dc_commit_updates_for_stream(struct dc *dc, struct dc_surface_update *srf_updates, int surface_count,
drivers/gpu/drm/amd/display/dc/dc_stream.h +18 -0
@@ -324,6 +324,9 @@ bool dc_is_stream_scaling_unchanged( struct dc_stream_state *old_stream, struct dc_stream_state *stream);/* +* Setup stream attributes if no stream updates are provided +* there will be no impact on the stream parameters +* * Set up surface attributes and associate to a stream * The surfaces parameter is an absolute set of all surface active for the stream. * If no surfaces are provided, the stream will be blanked; no memory read.
@@ -332,8 +335,23 @@ bool dc_is_stream_scaling_unchanged(* After this call: * Surfaces attributes are programmed and configured to be composed into stream. * This does not trigger a flip. No surface address is programmed. +* */ +bool dc_update_planes_and_stream (struct dc *dc, +struct dc_surface_update *surface_updates,int surface_count, +struct dc_stream_state *dc_stream, +struct dc_stream_update *stream_update); +/* +* Set up surface attributes and associate to a stream +* The surfaces parameter is an absolute set of all surface active for the stream. +* If no surfaces are provided, the stream will be blanked; no memory read. +* Any flip related attribute changes must be done through this interface. +* +* After this call: +* Surfaces attributes are programmed and configured to be composed into stream. +* This does not trigger a flip. No surface address is programmed. +*/ void dc_commit_updates_for_stream(struct dc *dc, struct dc_surface_update *srf_updates, int surface_count,
Signature · 1 line
2.25.1
PATCH 15/40 drm/amd/display: disable timing sync b/w odm halves
In reply to Rodrigo SiqueiraFrom: Dmytro Laktyushkin <[email protected]>
Fix for a bug where we would try to timing sync 2 odm halves.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -1
@@ -1333,7 +1333,9 @@ static void program_timing_sync(struct pipe_ctx *unsynced_pipes[MAX_PIPES ] = {NULL };for (i =0 ; i < pipe_count; i++) { -if (!ctx->res_ctx.pipe_ctx[i].stream || ctx->res_ctx.pipe_ctx[i].top_pipe) +if (!ctx->res_ctx.pipe_ctx[i].stream + || ctx->res_ctx.pipe_ctx[i].top_pipe + || ctx->res_ctx.pipe_ctx[i].prev_odm_pipe)continue ; unsynced_pipes[i] = &ctx->res_ctx.pipe_ctx[i];
Signature · 1 line
2.25.1
PATCH 16/40 drm/amd/display: guard for virtual calling destroy_link_encoders
In reply to Rodrigo SiqueiraFrom: Martin Leung <[email protected]>
[Why]:
On power down, virtual dal may try to delete link_encoders by referencing uninitialized res_pool.
[How]:
Added guard against empty res_pool.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +8 -2
@@ -347,10 +347,16 @@ static bool create_link_encoders(struct dc *dc)*/ static void destroy_link_encoders (struct dc *dc) { -unsigned int num_usb4_dpia = dc->res_pool->res_cap->num_usb4_dpia; -unsigned int num_dig_link_enc = dc->res_pool->res_cap->num_dig_link_enc; +unsigned int num_usb4_dpia; +unsigned int num_dig_link_enc;int i; +if (!dc->res_pool) +return ; + + num_usb4_dpia = dc->res_pool->res_cap->num_usb4_dpia; + num_dig_link_enc = dc->res_pool->res_cap->num_dig_link_enc; +/* A platform without USB4 DPIA endpoints has a fixed mapping between DIG * link encoders and physical display endpoints and does not require * additional link encoder objects.
Signature · 1 line
2.25.1
PATCH 17/40 drm/amd/display: Maintain consistent mode of operation during encoder assignment
In reply to Rodrigo SiqueiraFrom: Jimmy Kizito <[email protected]>
[Why]
While applying a state to hardware, there is a transition period where the back-end is reset using the old state; then enabled using the new state.
Generally, the link encoder configuration module queries stream-to-encoder assignments in either the new or old state based on a mode variable. During the transition there is a need to query both states, however toggling this mode variable can lead to incorrect programming of encoders.
[How]
- Add new function to explicity query stream-to-encoder assignment in the current state rather than intermittently switch the mode of operation of the link encoder assignment module.
- Add additional checks for encoder assignment defects.
- Explicitly reset the mode of operation if application of state to hardware ends prematurely.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 5 ++- .../drm/amd/display/dc/core/dc_link_enc_cfg.c | 32 +++++++++++++++++++ .../gpu/drm/amd/display/dc/core/dc_resource.c | 7 ++-- .../gpu/drm/amd/display/dc/inc/link_enc_cfg.h | 5 +++ 4 files changed, 44 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +4 -1
@@ -1750,8 +1750,11 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *c result = dc->hwss.apply_ctx_to_hw (dc, context); -if (result !=DC_OK ) +if (result !=DC_OK ) { +/* Application of dc_state to hardware stopped. */ + dc->current_state->res_ctx.link_enc_cfg_ctx.mode =LINK_ENC_CFG_STEADY ;return result; + }dc_trigger_sync (dc, context);
drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c +32 -0
@@ -292,6 +292,7 @@ void link_enc_cfg_link_encs_assign(int j;ASSERT (state->stream_count == stream_count); +ASSERT (dc->current_state->res_ctx.link_enc_cfg_ctx.mode ==LINK_ENC_CFG_STEADY );/* Release DIG link encoder resources before running assignment algorithm. */ for (i =0 ; i < dc->current_state->stream_count; i++)
@@ -561,6 +562,31 @@ struct link_encoder *link_enc_cfg_get_link_enc(return link_enc; } +struct link_encoder *link_enc_cfg_get_link_enc_used_by_stream_current ( +struct dc *dc, +const struct dc_stream_state *stream) +{ +struct link_encoder *link_enc =NULL ; +struct display_endpoint_id ep_id; +int i; + + ep_id = (struct display_endpoint_id ) { + .link_id = stream->link->link_id, + .ep_type = stream->link->ep_type}; + +for (i =0 ; i <MAX_PIPES ; i++) { +struct link_enc_assignment assignment = + dc->current_state->res_ctx.link_enc_cfg_ctx.link_enc_assignments[i]; + +if (assignment.valid == true &&are_ep_ids_equal (&assignment.ep_id, &ep_id)) { + link_enc = stream->link->dc->res_pool->link_encoders[assignment.eng_id -ENGINE_ID_DIGA ]; +break ; + } + } + +return link_enc; +} +bool link_enc_cfg_is_link_enc_avail (struct dc *dc,enum engine_id eng_id,struct dc_link *link) {bool is_avail = true;
@@ -595,6 +621,7 @@ bool link_enc_cfg_validate(struct dc *dc, struct dc_state *state)uint8_t dig_stream_count =0 ;int matching_stream_ptrs =0 ;int eng_ids_per_ep_id[MAX_PIPES ] = {0 }; +int ep_ids_per_eng_id[MAX_PIPES ] = {0 };int valid_bitmap =0 ;/* (1) No. valid entries same as stream count. */
@@ -630,6 +657,7 @@ bool link_enc_cfg_validate(struct dc *dc, struct dc_state *state)struct display_endpoint_id ep_id_i = assignment_i.ep_id; eng_ids_per_ep_id[i]++; + ep_ids_per_eng_id[i]++;for (j =0 ; j <MAX_PIPES ; j++) {struct link_enc_assignment assignment_j = state->res_ctx.link_enc_cfg_ctx.link_enc_assignments[j];
@@ -644,6 +672,10 @@ bool link_enc_cfg_validate(struct dc *dc, struct dc_state *state) assignment_i.eng_id != assignment_j.eng_id) { valid_uniqueness = false; eng_ids_per_ep_id[i]++; + } else if (!are_ep_ids_equal(&ep_id_i, &ep_id_j) && + assignment_i.eng_id == assignment_j.eng_id) { + valid_uniqueness = false; + ep_ids_per_eng_id[i]++; } } }
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +3 -4
@@ -3015,12 +3015,11 @@ bool pipe_need_reprogram(if (pipe_ctx_old->stream->ctx->dc->res_pool->funcs->link_encs_assign) {bool need_reprogram = false;struct dc *dc = pipe_ctx_old->stream->ctx->dc; -enum link_enc_cfg_mode mode = dc->current_state->res_ctx.link_enc_cfg_ctx.mode; +struct link_encoder *link_enc_prev = +link_enc_cfg_get_link_enc_used_by_stream_current (dc, pipe_ctx_old->stream); - dc->current_state->res_ctx.link_enc_cfg_ctx.mode =LINK_ENC_CFG_STEADY ; -if (link_enc_cfg_get_link_enc_used_by_stream (dc, pipe_ctx_old->stream) != pipe_ctx->stream->link_enc) +if (link_enc_prev != pipe_ctx->stream->link_enc) need_reprogram = true; - dc->current_state->res_ctx.link_enc_cfg_ctx.mode = mode;return need_reprogram; }
drivers/gpu/drm/amd/display/dc/inc/link_enc_cfg.h +5 -0
@@ -104,6 +104,11 @@ struct link_encoder *link_enc_cfg_get_link_enc_used_by_stream(/* Return DIG link encoder. NULL if unused. */ struct link_encoder *link_enc_cfg_get_link_enc (const struct dc_link *link); +/* Return DIG link encoder used by stream in current/previous state. NULL if unused. */ +struct link_encoder *link_enc_cfg_get_link_enc_used_by_stream_current ( +struct dc *dc, +const struct dc_stream_state *stream); +/* Return true if encoder available to use. */ bool link_enc_cfg_is_link_enc_avail (struct dc *dc,enum engine_id eng_id,struct dc_link *link);
Signature · 1 line
2.25.1
PATCH 18/40 drm/amd/display: Extend soc BB capabilitiy
In reply to Rodrigo SiqueiraFrom: Jun Lei <[email protected]>
[why]
Some parts are consuming dangerously close to maximum number of states supported when updating the BB (i.e. 8).
[how]
Change maximum stages from 9 to 20.
--- .../drm/amd/display/dc/dcn32/dcn32_resource.c | 508 ++++++++++++++---- .../amd/display/dc/dcn321/dcn321_resource.c | 503 +++++++++++++---- 2 files changed, 784 insertions(+), 227 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +395 -113
@@ -3410,6 +3410,277 @@ void dcn32_calculate_dlg_params(struct dc *dc, struct dc_state *context, display } } +static void get_optimal_ntuple (struct _vcs_dpi_voltage_scaling_st *entry) +{ +if (entry->dcfclk_mhz >0 ) { +float bw_on_sdp = entry->dcfclk_mhz * dcn3_2_soc.return_bus_width_bytes * ((float )dcn3_2_soc.pct_ideal_sdp_bw_after_urgent /100 ); + + entry->fabricclk_mhz = bw_on_sdp / (dcn3_2_soc.return_bus_width_bytes * ((float )dcn3_2_soc.pct_ideal_fabric_bw_after_urgent /100 )); + entry->dram_speed_mts = bw_on_sdp / (dcn3_2_soc.num_chans * + dcn3_2_soc.dram_channel_width_bytes * ((float )dcn3_2_soc.pct_ideal_dram_sdp_bw_after_urgent_pixel_only /100 )); + }else if (entry->fabricclk_mhz >0 ) { +float bw_on_fabric = entry->fabricclk_mhz * dcn3_2_soc.return_bus_width_bytes * ((float )dcn3_2_soc.pct_ideal_fabric_bw_after_urgent /100 ); + + entry->dcfclk_mhz = bw_on_fabric / (dcn3_2_soc.return_bus_width_bytes * ((float )dcn3_2_soc.pct_ideal_sdp_bw_after_urgent /100 )); + entry->dram_speed_mts = bw_on_fabric / (dcn3_2_soc.num_chans * + dcn3_2_soc.dram_channel_width_bytes * ((float )dcn3_2_soc.pct_ideal_dram_sdp_bw_after_urgent_pixel_only /100 )); + }else if (entry->dram_speed_mts >0 ) { +float bw_on_dram = entry->dram_speed_mts * dcn3_2_soc.num_chans * + dcn3_2_soc.dram_channel_width_bytes * ((float )dcn3_2_soc.pct_ideal_dram_sdp_bw_after_urgent_pixel_only /100 ); + + entry->fabricclk_mhz = bw_on_dram / (dcn3_2_soc.return_bus_width_bytes * ((float )dcn3_2_soc.pct_ideal_fabric_bw_after_urgent /100 )); + entry->dcfclk_mhz = bw_on_dram / (dcn3_2_soc.return_bus_width_bytes * ((float )dcn3_2_soc.pct_ideal_sdp_bw_after_urgent /100 )); + } +} + +static float calculate_net_bw_in_kbytes_sec (struct _vcs_dpi_voltage_scaling_st *entry) +{ +float memory_bw_kbytes_sec = entry->dram_speed_mts * dcn3_2_soc.num_chans * + dcn3_2_soc.dram_channel_width_bytes * ((float )dcn3_2_soc.pct_ideal_dram_sdp_bw_after_urgent_pixel_only /100 ); + +float fabric_bw_kbytes_sec = entry->fabricclk_mhz * dcn3_2_soc.return_bus_width_bytes * ((float )dcn3_2_soc.pct_ideal_fabric_bw_after_urgent /100 ); + +float sdp_bw_kbytes_sec = entry->dcfclk_mhz * dcn3_2_soc.return_bus_width_bytes * ((float )dcn3_2_soc.pct_ideal_sdp_bw_after_urgent /100 ); + +float limiting_bw_kbytes_sec = memory_bw_kbytes_sec; + +if (fabric_bw_kbytes_sec < limiting_bw_kbytes_sec) + limiting_bw_kbytes_sec = fabric_bw_kbytes_sec; + +if (sdp_bw_kbytes_sec < limiting_bw_kbytes_sec) + limiting_bw_kbytes_sec = sdp_bw_kbytes_sec; + +return limiting_bw_kbytes_sec; +} + +static void insert_entry_into_table_sorted (struct _vcs_dpi_voltage_scaling_st *table,unsigned int *num_entries, +struct _vcs_dpi_voltage_scaling_st *entry) +{ +int index =0 ; +int i =0 ; +float net_bw_of_new_state =0 ; + +if (*num_entries ==0 ) { + table[0 ] = *entry; + (*num_entries)++; + }else { + net_bw_of_new_state =calculate_net_bw_in_kbytes_sec (entry); +while (net_bw_of_new_state >calculate_net_bw_in_kbytes_sec (&table[index])) { + index++; +if (index >= *num_entries) +break ; + } + +for (i = *num_entries; i > index; i--) { + table[i] = table[i -1 ]; + } + + table[index] = *entry; + (*num_entries)++; + } +} + +static void remove_entry_from_table_at_index (struct _vcs_dpi_voltage_scaling_st *table,unsigned int *num_entries, +unsigned int index) +{ +int i; + +if (*num_entries ==0 ) +return ; + +for (i = index; i < *num_entries -1 ; i++) { + table[i] = table[i +1 ]; + } +memset (&table[--(*num_entries)],0 ,sizeof (struct _vcs_dpi_voltage_scaling_st )); +} + +static int build_synthetic_soc_states (struct clk_bw_params *bw_params, +struct _vcs_dpi_voltage_scaling_st *table,unsigned int *num_entries) +{ +int i, j; +struct _vcs_dpi_voltage_scaling_st entry = {0 }; + +unsigned int max_dcfclk_mhz =0 , max_dispclk_mhz =0 , max_dppclk_mhz =0 , + max_phyclk_mhz =0 , max_dtbclk_mhz =0 , max_fclk_mhz =0 , max_uclk_mhz =0 ; + +unsigned int min_dcfclk_mhz =199 , min_fclk_mhz =299 ; + +static const unsigned int num_dcfclk_stas =5 ; +unsigned int dcfclk_sta_targets[DC__VOLTAGE_STATES ] = {199 ,615 ,906 ,1324 ,1564 }; + +unsigned int num_uclk_dpms =0 ; +unsigned int num_fclk_dpms =0 ; +unsigned int num_dcfclk_dpms =0 ; + +for (i =0 ; i <MAX_NUM_DPM_LVL ; i++) { +if (bw_params->clk_table.entries[i].dcfclk_mhz > max_dcfclk_mhz) + max_dcfclk_mhz = bw_params->clk_table.entries[i].dcfclk_mhz; +if (bw_params->clk_table.entries[i].fclk_mhz > max_fclk_mhz) + max_fclk_mhz = bw_params->clk_table.entries[i].fclk_mhz; +if (bw_params->clk_table.entries[i].memclk_mhz > max_uclk_mhz) + max_uclk_mhz = bw_params->clk_table.entries[i].memclk_mhz; +if (bw_params->clk_table.entries[i].dispclk_mhz > max_dispclk_mhz) + max_dispclk_mhz = bw_params->clk_table.entries[i].dispclk_mhz; +if (bw_params->clk_table.entries[i].dppclk_mhz > max_dppclk_mhz) + max_dppclk_mhz = bw_params->clk_table.entries[i].dppclk_mhz; +if (bw_params->clk_table.entries[i].phyclk_mhz > max_phyclk_mhz) + max_phyclk_mhz = bw_params->clk_table.entries[i].phyclk_mhz; +if (bw_params->clk_table.entries[i].dtbclk_mhz > max_dtbclk_mhz) + max_dtbclk_mhz = bw_params->clk_table.entries[i].dtbclk_mhz; + +if (bw_params->clk_table.entries[i].memclk_mhz >0 ) + num_uclk_dpms++; +if (bw_params->clk_table.entries[i].fclk_mhz >0 ) + num_fclk_dpms++; +if (bw_params->clk_table.entries[i].dcfclk_mhz >0 ) + num_dcfclk_dpms++; + } + +if (!max_dcfclk_mhz || !max_dispclk_mhz || !max_dtbclk_mhz) +return -1 ; + +if (max_dppclk_mhz ==0 ) + max_dppclk_mhz = max_dispclk_mhz; + +if (max_fclk_mhz ==0 ) + max_fclk_mhz = max_dcfclk_mhz * dcn3_2_soc.pct_ideal_sdp_bw_after_urgent / dcn3_2_soc.pct_ideal_fabric_bw_after_urgent; + +if (max_phyclk_mhz ==0 ) + max_phyclk_mhz = dcn3_2_soc.clock_limits[0 ].phyclk_mhz; + + *num_entries =0 ; + entry.dispclk_mhz = max_dispclk_mhz; + entry.dscclk_mhz = max_dispclk_mhz /3 ; + entry.dppclk_mhz = max_dppclk_mhz; + entry.dtbclk_mhz = max_dtbclk_mhz; + entry.phyclk_mhz = max_phyclk_mhz; + entry.phyclk_d18_mhz = dcn3_2_soc.clock_limits[0 ].phyclk_d18_mhz; + entry.phyclk_d32_mhz = dcn3_2_soc.clock_limits[0 ].phyclk_d32_mhz; + +// Insert all the DCFCLK STAs +for (i =0 ; i < num_dcfclk_stas; i++) { + entry.dcfclk_mhz = dcfclk_sta_targets[i]; + entry.fabricclk_mhz =0 ; + entry.dram_speed_mts =0 ; + +get_optimal_ntuple (&entry); +insert_entry_into_table_sorted (table, num_entries, &entry); + } + +// Insert the max DCFCLK + entry.dcfclk_mhz = max_dcfclk_mhz; + entry.fabricclk_mhz =0 ; + entry.dram_speed_mts =0 ; + +get_optimal_ntuple (&entry); +insert_entry_into_table_sorted (table, num_entries, &entry); + +// Insert the UCLK DPMS +for (i =0 ; i < num_uclk_dpms; i++) { + entry.dcfclk_mhz =0 ; + entry.fabricclk_mhz =0 ; + entry.dram_speed_mts = bw_params->clk_table.entries[i].memclk_mhz *16 ; + +get_optimal_ntuple (&entry); +insert_entry_into_table_sorted (table, num_entries, &entry); + } + +// If FCLK is coarse grained, insert individual DPMs. +if (num_fclk_dpms >2 ) { +for (i =0 ; i < num_fclk_dpms; i++) { + entry.dcfclk_mhz =0 ; + entry.fabricclk_mhz = bw_params->clk_table.entries[i].fclk_mhz; + entry.dram_speed_mts =0 ; + +get_optimal_ntuple (&entry); +insert_entry_into_table_sorted (table, num_entries, &entry); + } + } +// If FCLK fine grained, only insert max +else { + entry.dcfclk_mhz =0 ; + entry.fabricclk_mhz = max_fclk_mhz; + entry.dram_speed_mts =0 ; + +get_optimal_ntuple (&entry); +insert_entry_into_table_sorted (table, num_entries, &entry); + } + +// At this point, the table contains all "points of interest" based on +// DPMs from PMFW, and STAs. Table is sorted by BW, and all clock +// ratios (by derate, are exact). + +// Remove states that require higher clocks than are supported +for (i = *num_entries -1 ; i >=0 ; i--) { +if (table[i].dcfclk_mhz > max_dcfclk_mhz || + table[i].fabricclk_mhz > max_fclk_mhz || + table[i].dram_speed_mts > max_uclk_mhz *16 ) +remove_entry_from_table_at_index (table, num_entries, i); + } + +// At this point, the table only contains supported points of interest +// it could be used as is, but some states may be redundant due to +// coarse grained nature of some clocks, so we want to round up to +// coarse grained DPMs and remove duplicates. + +// Round up UCLKs +for (i = *num_entries -1 ; i >=0 ; i--) { +for (j =0 ; j < num_uclk_dpms; j++) { +if (bw_params->clk_table.entries[j].memclk_mhz *16 >= table[i].dram_speed_mts) { + table[i].dram_speed_mts = bw_params->clk_table.entries[j].memclk_mhz *16 ; +break ; + } + } + } + +// If FCLK is coarse grained, round up to next DPMs +if (num_fclk_dpms >2 ) { +for (i = *num_entries -1 ; i >=0 ; i--) { +for (j =0 ; j < num_fclk_dpms; j++) { +if (bw_params->clk_table.entries[j].fclk_mhz >= table[i].fabricclk_mhz) { + table[i].fabricclk_mhz = bw_params->clk_table.entries[j].fclk_mhz; +break ; + } + } + } + } +// Otherwise, round up to minimum. +else { +for (i = *num_entries -1 ; i >=0 ; i--) { +if (table[i].fabricclk_mhz < min_fclk_mhz) { + table[i].fabricclk_mhz = min_fclk_mhz; +break ; + } + } + } + +// Round DCFCLKs up to minimum +for (i = *num_entries -1 ; i >=0 ; i--) { +if (table[i].dcfclk_mhz < min_dcfclk_mhz) { + table[i].dcfclk_mhz = min_dcfclk_mhz; +break ; + } + } + +// Remove duplicate states, note duplicate states are always neighbouring since table is sorted. + i =0 ; +while (i < *num_entries -1 ) { +if (table[i].dcfclk_mhz == table[i +1 ].dcfclk_mhz && + table[i].fabricclk_mhz == table[i +1 ].fabricclk_mhz && + table[i].dram_speed_mts == table[i +1 ].dram_speed_mts) +remove_entry_from_table_at_index (table, num_entries, i +1 ); +else + i++; + } + +// Fix up the state indicies +for (i = *num_entries -1 ; i >=0 ; i--) { + table[i].state = i; + } + +return 0 ; +} +/* dcn32_update_bw_bounding_box * This would override some dcn3_2 ip_or_soc initial parameters hardcoded from spreadsheet * with actual values as per dGPU SKU:
@@ -3491,139 +3762,150 @@ static void dcn32_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw/* Overrides Clock levelsfrom CLK Mgr table entries as reported by PM FW */ if ((!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) && (bw_params->clk_table.entries[0 ].memclk_mhz)) { -unsigned int i =0 , j =0 , num_states =0 ; - -unsigned int dcfclk_mhz[DC__VOLTAGE_STATES ] = {0 }; -unsigned int dram_speed_mts[DC__VOLTAGE_STATES ] = {0 }; -unsigned int optimal_uclk_for_dcfclk_sta_targets[DC__VOLTAGE_STATES ] = {0 }; -unsigned int optimal_dcfclk_for_uclk[DC__VOLTAGE_STATES ] = {0 }; - -unsigned int dcfclk_sta_targets[DC__VOLTAGE_STATES ] = {615 ,906 ,1324 ,1564 }; -unsigned int num_dcfclk_sta_targets =4 , num_uclk_states =0 ; -unsigned int max_dcfclk_mhz =0 , max_dispclk_mhz =0 , max_dppclk_mhz =0 , max_phyclk_mhz =0 ; - -for (i =0 ; i <MAX_NUM_DPM_LVL ; i++) { -if (bw_params->clk_table.entries[i].dcfclk_mhz > max_dcfclk_mhz) - max_dcfclk_mhz = bw_params->clk_table.entries[i].dcfclk_mhz; -if (bw_params->clk_table.entries[i].dispclk_mhz > max_dispclk_mhz) - max_dispclk_mhz = bw_params->clk_table.entries[i].dispclk_mhz; -if (bw_params->clk_table.entries[i].dppclk_mhz > max_dppclk_mhz) - max_dppclk_mhz = bw_params->clk_table.entries[i].dppclk_mhz; -if (bw_params->clk_table.entries[i].phyclk_mhz > max_phyclk_mhz) - max_phyclk_mhz = bw_params->clk_table.entries[i].phyclk_mhz; - } -if (!max_dcfclk_mhz) - max_dcfclk_mhz = dcn3_2_soc.clock_limits[0 ].dcfclk_mhz; -if (!max_dispclk_mhz) - max_dispclk_mhz = dcn3_2_soc.clock_limits[0 ].dispclk_mhz; -if (!max_dppclk_mhz) - max_dppclk_mhz = dcn3_2_soc.clock_limits[0 ].dppclk_mhz; -if (!max_phyclk_mhz) - max_phyclk_mhz = dcn3_2_soc.clock_limits[0 ].phyclk_mhz; - -if (max_dcfclk_mhz > dcfclk_sta_targets[num_dcfclk_sta_targets-1 ]) { -// If max DCFCLK is greater than the max DCFCLK STA target, insert into the DCFCLK STA target array - dcfclk_sta_targets[num_dcfclk_sta_targets] = max_dcfclk_mhz; - num_dcfclk_sta_targets++; - }else if (max_dcfclk_mhz < dcfclk_sta_targets[num_dcfclk_sta_targets-1 ]) { -// If max DCFCLK is less than the max DCFCLK STA target, cap values and remove duplicates -for (i =0 ; i < num_dcfclk_sta_targets; i++) { -if (dcfclk_sta_targets[i] > max_dcfclk_mhz) { - dcfclk_sta_targets[i] = max_dcfclk_mhz; -break ; +if (dc->debug.use_legacy_soc_bb_mechanism) { +unsigned int i =0 , j =0 , num_states =0 ; + +unsigned int dcfclk_mhz[DC__VOLTAGE_STATES ] = {0 }; +unsigned int dram_speed_mts[DC__VOLTAGE_STATES ] = {0 }; +unsigned int optimal_uclk_for_dcfclk_sta_targets[DC__VOLTAGE_STATES ] = {0 }; +unsigned int optimal_dcfclk_for_uclk[DC__VOLTAGE_STATES ] = {0 }; +unsigned int min_dcfclk =UINT_MAX ; +/* Set 199 as first value in STA target array to have a minimum DCFCLK value. +* For DCN32 we set min to 199 so minimum FCLK DPM0 (300Mhz can be achieved) */ +unsigned int dcfclk_sta_targets[DC__VOLTAGE_STATES ] = {199 ,615 ,906 ,1324 ,1564 }; +unsigned int num_dcfclk_sta_targets =4 , num_uclk_states =0 ; +unsigned int max_dcfclk_mhz =0 , max_dispclk_mhz =0 , max_dppclk_mhz =0 , max_phyclk_mhz =0 ; + +for (i =0 ; i <MAX_NUM_DPM_LVL ; i++) { +if (bw_params->clk_table.entries[i].dcfclk_mhz > max_dcfclk_mhz) + max_dcfclk_mhz = bw_params->clk_table.entries[i].dcfclk_mhz; +if (bw_params->clk_table.entries[i].dcfclk_mhz !=0 && + bw_params->clk_table.entries[i].dcfclk_mhz < min_dcfclk) + min_dcfclk = bw_params->clk_table.entries[i].dcfclk_mhz; +if (bw_params->clk_table.entries[i].dispclk_mhz > max_dispclk_mhz) + max_dispclk_mhz = bw_params->clk_table.entries[i].dispclk_mhz; +if (bw_params->clk_table.entries[i].dppclk_mhz > max_dppclk_mhz) + max_dppclk_mhz = bw_params->clk_table.entries[i].dppclk_mhz; +if (bw_params->clk_table.entries[i].phyclk_mhz > max_phyclk_mhz) + max_phyclk_mhz = bw_params->clk_table.entries[i].phyclk_mhz; + } +if (min_dcfclk > dcfclk_sta_targets[0 ]) + dcfclk_sta_targets[0 ] = min_dcfclk; +if (!max_dcfclk_mhz) + max_dcfclk_mhz = dcn3_2_soc.clock_limits[0 ].dcfclk_mhz; +if (!max_dispclk_mhz) + max_dispclk_mhz = dcn3_2_soc.clock_limits[0 ].dispclk_mhz; +if (!max_dppclk_mhz) + max_dppclk_mhz = dcn3_2_soc.clock_limits[0 ].dppclk_mhz; +if (!max_phyclk_mhz) + max_phyclk_mhz = dcn3_2_soc.clock_limits[0 ].phyclk_mhz; + +if (max_dcfclk_mhz > dcfclk_sta_targets[num_dcfclk_sta_targets-1 ]) { +// If max DCFCLK is greater than the max DCFCLK STA target, insert into the DCFCLK STA target array + dcfclk_sta_targets[num_dcfclk_sta_targets] = max_dcfclk_mhz; + num_dcfclk_sta_targets++; + }else if (max_dcfclk_mhz < dcfclk_sta_targets[num_dcfclk_sta_targets-1 ]) { +// If max DCFCLK is less than the max DCFCLK STA target, cap values and remove duplicates +for (i =0 ; i < num_dcfclk_sta_targets; i++) { +if (dcfclk_sta_targets[i] > max_dcfclk_mhz) { + dcfclk_sta_targets[i] = max_dcfclk_mhz; +break ; + } } +// Update size of array since we "removed" duplicates + num_dcfclk_sta_targets = i +1 ; } -// Update size of array since we "removed" duplicates - num_dcfclk_sta_targets = i +1 ; - } - num_uclk_states = bw_params->clk_table.num_entries; + num_uclk_states = bw_params->clk_table.num_entries; -// Calculate optimal dcfclk for each uclk -for (i =0 ; i < num_uclk_states; i++) { -dcn32_get_optimal_dcfclk_fclk_for_uclk (bw_params->clk_table.entries[i].memclk_mhz *16 , - &optimal_dcfclk_for_uclk[i],NULL ); -if (optimal_dcfclk_for_uclk[i] < bw_params->clk_table.entries[0 ].dcfclk_mhz) { - optimal_dcfclk_for_uclk[i] = bw_params->clk_table.entries[0 ].dcfclk_mhz; +// Calculate optimal dcfclk for each uclk +for (i =0 ; i < num_uclk_states; i++) { +dcn32_get_optimal_dcfclk_fclk_for_uclk (bw_params->clk_table.entries[i].memclk_mhz *16 , + &optimal_dcfclk_for_uclk[i],NULL ); +if (optimal_dcfclk_for_uclk[i] < bw_params->clk_table.entries[0 ].dcfclk_mhz) { + optimal_dcfclk_for_uclk[i] = bw_params->clk_table.entries[0 ].dcfclk_mhz; + } } - } -// Calculate optimal uclk for each dcfclk sta target -for (i =0 ; i < num_dcfclk_sta_targets; i++) { -for (j =0 ; j < num_uclk_states; j++) { -if (dcfclk_sta_targets[i] < optimal_dcfclk_for_uclk[j]) { - optimal_uclk_for_dcfclk_sta_targets[i] = - bw_params->clk_table.entries[j].memclk_mhz *16 ; -break ; +// Calculate optimal uclk for each dcfclk sta target +for (i =0 ; i < num_dcfclk_sta_targets; i++) { +for (j =0 ; j < num_uclk_states; j++) { +if (dcfclk_sta_targets[i] < optimal_dcfclk_for_uclk[j]) { + optimal_uclk_for_dcfclk_sta_targets[i] = + bw_params->clk_table.entries[j].memclk_mhz *16 ; +break ; + } } } - } - i =0 ; - j =0 ; -// create the final dcfclk and uclk table -while (i < num_dcfclk_sta_targets && j < num_uclk_states && num_states <DC__VOLTAGE_STATES ) { -if (dcfclk_sta_targets[i] < optimal_dcfclk_for_uclk[j] && i < num_dcfclk_sta_targets) { - dcfclk_mhz[num_states] = dcfclk_sta_targets[i]; - dram_speed_mts[num_states++] = optimal_uclk_for_dcfclk_sta_targets[i++]; - }else { -if (j < num_uclk_states && optimal_dcfclk_for_uclk[j] <= max_dcfclk_mhz) { - dcfclk_mhz[num_states] = optimal_dcfclk_for_uclk[j]; - dram_speed_mts[num_states++] = bw_params->clk_table.entries[j++].memclk_mhz *16 ; + i =0 ; + j =0 ; +// create the final dcfclk and uclk table +while (i < num_dcfclk_sta_targets && j < num_uclk_states && num_states <DC__VOLTAGE_STATES ) { +if (dcfclk_sta_targets[i] < optimal_dcfclk_for_uclk[j] && i < num_dcfclk_sta_targets) { + dcfclk_mhz[num_states] = dcfclk_sta_targets[i]; + dram_speed_mts[num_states++] = optimal_uclk_for_dcfclk_sta_targets[i++]; }else { - j = num_uclk_states; +if (j < num_uclk_states && optimal_dcfclk_for_uclk[j] <= max_dcfclk_mhz) { + dcfclk_mhz[num_states] = optimal_dcfclk_for_uclk[j]; + dram_speed_mts[num_states++] = bw_params->clk_table.entries[j++].memclk_mhz *16 ; + }else { + j = num_uclk_states; + } } } - } -while (i < num_dcfclk_sta_targets && num_states <DC__VOLTAGE_STATES ) { - dcfclk_mhz[num_states] = dcfclk_sta_targets[i]; - dram_speed_mts[num_states++] = optimal_uclk_for_dcfclk_sta_targets[i++]; - } - -while (j < num_uclk_states && num_states <DC__VOLTAGE_STATES && - optimal_dcfclk_for_uclk[j] <= max_dcfclk_mhz) { - dcfclk_mhz[num_states] = optimal_dcfclk_for_uclk[j]; - dram_speed_mts[num_states++] = bw_params->clk_table.entries[j++].memclk_mhz *16 ; - } - - dcn3_2_soc.num_states = num_states; -for (i =0 ; i < dcn3_2_soc.num_states; i++) { - dcn3_2_soc.clock_limits[i].state = i; - dcn3_2_soc.clock_limits[i].dcfclk_mhz = dcfclk_mhz[i]; - dcn3_2_soc.clock_limits[i].fabricclk_mhz = dcfclk_mhz[i]; +while (i < num_dcfclk_sta_targets && num_states <DC__VOLTAGE_STATES ) { + dcfclk_mhz[num_states] = dcfclk_sta_targets[i]; + dram_speed_mts[num_states++] = optimal_uclk_for_dcfclk_sta_targets[i++]; + } -/* Fill all states with max values of all these clocks */ - dcn3_2_soc.clock_limits[i].dispclk_mhz = max_dispclk_mhz; - dcn3_2_soc.clock_limits[i].dppclk_mhz = max_dppclk_mhz; - dcn3_2_soc.clock_limits[i].phyclk_mhz = max_phyclk_mhz; - dcn3_2_soc.clock_limits[i].dscclk_mhz = max_dispclk_mhz /3 ; +while (j < num_uclk_states && num_states <DC__VOLTAGE_STATES && + optimal_dcfclk_for_uclk[j] <= max_dcfclk_mhz) { + dcfclk_mhz[num_states] = optimal_dcfclk_for_uclk[j]; + dram_speed_mts[num_states++] = bw_params->clk_table.entries[j++].memclk_mhz *16 ; + } -/* Populate from bw_params for DTBCLK, SOCCLK */ -if (i >0 ) { -if (!bw_params->clk_table.entries[i].dtbclk_mhz) { - dcn3_2_soc.clock_limits[i].dtbclk_mhz = dcn3_2_soc.clock_limits[i-1 ].dtbclk_mhz; - }else { + dcn3_2_soc.num_states = num_states; +for (i =0 ; i < dcn3_2_soc.num_states; i++) { + dcn3_2_soc.clock_limits[i].state = i; + dcn3_2_soc.clock_limits[i].dcfclk_mhz = dcfclk_mhz[i]; + dcn3_2_soc.clock_limits[i].fabricclk_mhz = dcfclk_mhz[i]; + +/* Fill all states with max values of all these clocks */ + dcn3_2_soc.clock_limits[i].dispclk_mhz = max_dispclk_mhz; + dcn3_2_soc.clock_limits[i].dppclk_mhz = max_dppclk_mhz; + dcn3_2_soc.clock_limits[i].phyclk_mhz = max_phyclk_mhz; + dcn3_2_soc.clock_limits[i].dscclk_mhz = max_dispclk_mhz /3 ; + +/* Populate from bw_params for DTBCLK, SOCCLK */ +if (i >0 ) { +if (!bw_params->clk_table.entries[i].dtbclk_mhz) { + dcn3_2_soc.clock_limits[i].dtbclk_mhz = dcn3_2_soc.clock_limits[i-1 ].dtbclk_mhz; + }else { + dcn3_2_soc.clock_limits[i].dtbclk_mhz = bw_params->clk_table.entries[i].dtbclk_mhz; + } + }else if (bw_params->clk_table.entries[i].dtbclk_mhz) { dcn3_2_soc.clock_limits[i].dtbclk_mhz = bw_params->clk_table.entries[i].dtbclk_mhz; } - }else if (bw_params->clk_table.entries[i].dtbclk_mhz) { - dcn3_2_soc.clock_limits[i].dtbclk_mhz = bw_params->clk_table.entries[i].dtbclk_mhz; - } -if (!bw_params->clk_table.entries[i].socclk_mhz && i >0 ) - dcn3_2_soc.clock_limits[i].socclk_mhz = dcn3_2_soc.clock_limits[i-1 ].socclk_mhz; -else - dcn3_2_soc.clock_limits[i].socclk_mhz = bw_params->clk_table.entries[i].socclk_mhz; +if (!bw_params->clk_table.entries[i].socclk_mhz && i >0 ) + dcn3_2_soc.clock_limits[i].socclk_mhz = dcn3_2_soc.clock_limits[i-1 ].socclk_mhz; +else + dcn3_2_soc.clock_limits[i].socclk_mhz = bw_params->clk_table.entries[i].socclk_mhz; -if (!dram_speed_mts[i] && i >0 ) - dcn3_2_soc.clock_limits[i].dram_speed_mts = dcn3_2_soc.clock_limits[i-1 ].dram_speed_mts; -else - dcn3_2_soc.clock_limits[i].dram_speed_mts = dram_speed_mts[i]; +if (!dram_speed_mts[i] && i >0 ) + dcn3_2_soc.clock_limits[i].dram_speed_mts = dcn3_2_soc.clock_limits[i-1 ].dram_speed_mts; +else + dcn3_2_soc.clock_limits[i].dram_speed_mts = dram_speed_mts[i]; -/* These clocks cannot come from bw_params, always fill from dcn3_2_soc[0] */ -/* PHYCLK_D18, PHYCLK_D32 */ - dcn3_2_soc.clock_limits[i].phyclk_d18_mhz = dcn3_2_soc.clock_limits[0 ].phyclk_d18_mhz; - dcn3_2_soc.clock_limits[i].phyclk_d32_mhz = dcn3_2_soc.clock_limits[0 ].phyclk_d32_mhz; +/* These clocks cannot come from bw_params, always fill from dcn3_2_soc[0] */ +/* PHYCLK_D18, PHYCLK_D32 */ + dcn3_2_soc.clock_limits[i].phyclk_d18_mhz = dcn3_2_soc.clock_limits[0 ].phyclk_d18_mhz; + dcn3_2_soc.clock_limits[i].phyclk_d32_mhz = dcn3_2_soc.clock_limits[0 ].phyclk_d32_mhz; + } + }else { +build_synthetic_soc_states (bw_params, dcn3_2_soc.clock_limits, &dcn3_2_soc.num_states); }/* Re-init DML with updated bb */
drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c +389 -114
534 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH 19/40 drm/amd/display: Don't set dram clock change requirement for SubVP
In reply to Rodrigo SiqueiraFrom: Alvin Lee <[email protected]>
[Description]
In general cases we want to keep the dram clock change requirement (we prefer configs that support MCLK switch). Only override to false for SubVP.
--- drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h | 1 + drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h +1 -0
@@ -184,6 +184,7 @@ struct _vcs_dpi_soc_bounding_box_st {double max_avg_fabric_bw_use_normal_percent;double max_avg_dram_bw_use_normal_strobe_percent;enum dm_prefetch_modes allow_for_pstate_or_stutter_in_vblank_final; +bool dram_clock_change_requirement_final;double writeback_latency_us;double ideal_dram_bw_after_urgent_percent;double pct_ideal_dram_sdp_bw_after_urgent_pixel_only;// PercentOfIdealDRAMFabricAndSDPPortBWReceivedAfterUrgLatencyPixelDataOnly
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c +1 -1
@@ -343,7 +343,7 @@ static void fetch_socbb_params(struct display_mode_lib *mode_lib) mode_lib->vba.MaxAveragePercentOfIdealDRAMBWDisplayCanUseInNormalSystemOperationSTROBE = soc->max_avg_dram_bw_use_normal_strobe_percent; - mode_lib->vba.DRAMClockChangeRequirementFinal =1 ; + mode_lib->vba.DRAMClockChangeRequirementFinal = soc->dram_clock_change_requirement_final; mode_lib->vba.FCLKChangeRequirementFinal =1 ; mode_lib->vba.USRRetrainingRequiredFinal =1 ; mode_lib->vba.ConfigurableDETSizeEnFinal =0 ;
Signature · 1 line
2.25.1
PATCH 20/40 drm/amd/display: add an option to skip wait for HPD when powering on eDP panel
In reply to Rodrigo SiqueiraFrom: Evgenii Krasnikov <[email protected]>
[HOW/WHY]
Add an option to skip edp_wait_for_hpd_ready when necessary
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 5 +++-- drivers/gpu/drm/amd/display/dc/inc/dc_link_dp.h | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +3 -2
@@ -6971,13 +6971,14 @@ bool is_dp_128b_132b_signal(struct pipe_ctx *pipe_ctx) dc_is_dp_signal(pipe_ctx->stream->signal)); } -void edp_panel_backlight_power_on (struct dc_link *link) +void edp_panel_backlight_power_on (struct dc_link *link,bool wait_for_hpd) {if (link->connector_signal !=SIGNAL_TYPE_EDP )return ; link->dc->hwss.edp_power_control (link, true); - link->dc->hwss.edp_wait_for_hpd_ready (link, true); +if (wait_for_hpd) + link->dc->hwss.edp_wait_for_hpd_ready (link, true);if (link->dc->hwss.edp_backlight_control) link->dc->hwss.edp_backlight_control (link, true); }
drivers/gpu/drm/amd/display/dc/inc/dc_link_dp.h +3 -3
@@ -193,6 +193,7 @@ enum dc_status dpcd_configure_lttpr_mode( struct link_training_settings *lt_settings);enum dp_link_encoding dp_get_link_encoding_format (const struct dc_link_settings *link_settings); +bool dp_retrieve_lttpr_cap (struct dc_link *link); bool dpcd_write_128b_132b_sst_payload_allocation_table( const struct dc_stream_state *stream, struct dc_link *link,
@@ -214,11 +215,10 @@ void enable_dp_hpo_output(struct dc_link *link,void disable_dp_hpo_output (struct dc_link *link,const struct link_resource *link_res,enum signal_type signal); +void setup_dp_hpo_stream (struct pipe_ctx *pipe_ctx,bool enable);bool is_dp_128b_132b_signal (struct pipe_ctx *pipe_ctx); - -bool dp_retrieve_lttpr_cap (struct dc_link *link); -void edp_panel_backlight_power_on (struct dc_link *link); +void edp_panel_backlight_power_on (struct dc_link *link,bool wait_for_hpd);void dp_receiver_power_ctrl (struct dc_link *link,bool on);void dp_source_sequence_trace (struct dc_link *link,uint8_t dp_test_mode); void dp_enable_link_phy(
Signature · 1 line
2.25.1
PATCH 21/40 drm/amd/display: Program ACP related register
In reply to Rodrigo SiqueiraFrom: Alan Liu <[email protected]>
- Setup the shift and mask of HDMI_ACP_SEND register
- Program the register in hdmi stream encoder
- Also update ACP register in azalia configuration
--- drivers/gpu/drm/amd/display/dc/dce/dce_audio.c | 11 +++++++++++ .../drm/amd/display/dc/dce/dce_stream_encoder.c | 3 ++- .../drm/amd/display/dc/dce/dce_stream_encoder.h | 14 ++++++-------- .../amd/display/dc/dcn10/dcn10_stream_encoder.c | 3 ++- .../amd/display/dc/dcn10/dcn10_stream_encoder.h | 16 ++-------------- .../amd/display/dc/dcn20/dcn20_stream_encoder.c | 1 - .../display/dc/dcn30/dcn30_dio_stream_encoder.c | 4 +++- .../display/dc/dcn30/dcn30_dio_stream_encoder.h | 6 ++---- .../drm/amd/display/dc/inc/hw/stream_encoder.h | 1 + .../amd/include/asic_reg/dce/dce_6_0_sh_mask.h | 2 ++ 10 files changed, 31 insertions(+), 30 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_audio.c +11 -0
@@ -486,6 +486,17 @@ void dce_aud_az_configure(AZ_REG_WRITE (AZALIA_F0_CODEC_PIN_CONTROL_CHANNEL_SPEAKER , value); +/* ACP Data - Supports AI */ + value =AZ_REG_READ (AZALIA_F0_CODEC_PIN_CONTROL_ACP_DATA ); + +set_reg_field_value ( + value, + audio_info->flags.info.SUPPORT_AI, +AZALIA_F0_CODEC_PIN_CONTROL_ACP_DATA , +SUPPORTS_AI ); + +AZ_REG_WRITE (AZALIA_F0_CODEC_PIN_CONTROL_ACP_DATA , value); +/* Audio Descriptors */ /* pass through all formats */ for (format_index = 0; format_index < AUDIO_FORMAT_CODE_COUNT;
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +2 -1
@@ -33,7 +33,6 @@#define DC_LOGGER \ enc110->base.ctx->logger -#define REG (reg)\ (enc110->regs->reg)
@@ -635,6 +634,8 @@ static void dce110_stream_encoder_hdmi_set_stream_attribute(HDMI_GC_SEND ,1 , HDMI_NULL_SEND, 1); +REG_UPDATE (HDMI_VBI_PACKET_CONTROL ,HDMI_ACP_SEND ,0 ); +/* following belongs to audio */ REG_UPDATE (HDMI_INFOFRAME_CONTROL0 ,HDMI_AUDIO_INFO_SEND ,1 );
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.h +6 -8
@@ -115,7 +115,7 @@#define SE_SF (reg_name, field_name, post_fix)\ .field_name = reg_name ## __ ## field_name ## post_fix -#define SE_COMMON_MASK_SH_LIST_DCE_COMMON_BASE (mask_sh)\ +#define SE_COMMON_MASK_SH_LIST_DCE_COMMON (mask_sh)\ SE_SF(AFMT_VBI_PACKET_CONTROL, AFMT_GENERIC_INDEX, mask_sh),\ SE_SF(AFMT_VBI_PACKET_CONTROL, AFMT_GENERIC0_UPDATE, mask_sh),\ SE_SF(AFMT_VBI_PACKET_CONTROL, AFMT_GENERIC2_UPDATE, mask_sh),\
@@ -140,6 +140,7 @@SE_SF (HDMI_VBI_PACKET_CONTROL ,HDMI_GC_CONT , mask_sh),\SE_SF (HDMI_VBI_PACKET_CONTROL ,HDMI_GC_SEND , mask_sh),\SE_SF (HDMI_VBI_PACKET_CONTROL ,HDMI_NULL_SEND , mask_sh),\ +SE_SF (HDMI_VBI_PACKET_CONTROL ,HDMI_ACP_SEND , mask_sh),\SE_SF (HDMI_INFOFRAME_CONTROL0 ,HDMI_AUDIO_INFO_SEND , mask_sh),\SE_SF (AFMT_INFOFRAME_CONTROL0 ,AFMT_AUDIO_INFO_UPDATE , mask_sh),\ SE_SF(HDMI_INFOFRAME_CONTROL1, HDMI_AUDIO_INFO_LINE, mask_sh),\
@@ -202,10 +203,7 @@SE_SF (AFMT_AUDIO_PACKET_CONTROL ,AFMT_AUDIO_SAMPLE_SEND , mask_sh),\ SE_SF(DIG_FE_CNTL, DIG_SOURCE_SELECT, mask_sh) -#define SE_COMMON_MASK_SH_LIST_DCE_COMMON (mask_sh)\ - SE_COMMON_MASK_SH_LIST_DCE_COMMON_BASE(mask_sh) - -#define SE_COMMON_MASK_SH_LIST_SOC_BASE (mask_sh)\ +#define SE_COMMON_MASK_SH_LIST_SOC (mask_sh)\ SE_SF(DIG0_AFMT_VBI_PACKET_CONTROL, AFMT_GENERIC_INDEX, mask_sh),\ SE_SF(DIG0_AFMT_GENERIC_HDR, AFMT_GENERIC_HB0, mask_sh),\ SE_SF(DIG0_AFMT_GENERIC_HDR, AFMT_GENERIC_HB1, mask_sh),\
@@ -227,6 +225,7 @@SE_SF (DIG0_HDMI_VBI_PACKET_CONTROL ,HDMI_GC_CONT , mask_sh),\SE_SF (DIG0_HDMI_VBI_PACKET_CONTROL ,HDMI_GC_SEND , mask_sh),\SE_SF (DIG0_HDMI_VBI_PACKET_CONTROL ,HDMI_NULL_SEND , mask_sh),\ +SE_SF (DIG0_HDMI_VBI_PACKET_CONTROL ,HDMI_ACP_SEND , mask_sh),\SE_SF (DIG0_HDMI_INFOFRAME_CONTROL0 ,HDMI_AUDIO_INFO_SEND , mask_sh),\SE_SF (DIG0_AFMT_INFOFRAME_CONTROL0 ,AFMT_AUDIO_INFO_UPDATE , mask_sh),\ SE_SF(DIG0_HDMI_INFOFRAME_CONTROL1, HDMI_AUDIO_INFO_LINE, mask_sh),\
@@ -288,9 +287,6 @@SE_SF (DIG0_DIG_FE_CNTL ,DIG_STEREOSYNC_GATE_EN , mask_sh),\ SE_SF(DIG0_DIG_FE_CNTL, DIG_SOURCE_SELECT, mask_sh) -#define SE_COMMON_MASK_SH_LIST_SOC (mask_sh)\ - SE_COMMON_MASK_SH_LIST_SOC_BASE(mask_sh) -#define SE_COMMON_MASK_SH_LIST_DCE80_100 (mask_sh)\ SE_COMMON_MASK_SH_LIST_DCE_COMMON(mask_sh),\ SE_SF(TMDS_CNTL, TMDS_PIXEL_ENCODING, mask_sh),\
@@ -414,6 +410,7 @@ struct dce_stream_encoder_shift {uint8_t HDMI_GC_SEND ;uint8_t HDMI_NULL_SEND ;uint8_t HDMI_DATA_SCRAMBLE_EN ; +uint8_t HDMI_ACP_SEND ;uint8_t HDMI_AUDIO_INFO_SEND ;uint8_t AFMT_AUDIO_INFO_UPDATE ;uint8_t HDMI_AUDIO_INFO_LINE ;
@@ -545,6 +542,7 @@ struct dce_stream_encoder_mask {uint32_t HDMI_GC_SEND ;uint32_t HDMI_NULL_SEND ;uint32_t HDMI_DATA_SCRAMBLE_EN ; +uint32_t HDMI_ACP_SEND ;uint32_t HDMI_AUDIO_INFO_SEND ;uint32_t AFMT_AUDIO_INFO_UPDATE ;uint32_t HDMI_AUDIO_INFO_LINE ;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c +2 -1
@@ -37,7 +37,6 @@#define DC_LOGGER \ enc1->base.ctx->logger -#define REG (reg)\ (enc1->regs->reg)
@@ -597,6 +596,8 @@ void enc1_stream_encoder_hdmi_set_stream_attribute(HDMI_GC_SEND ,1 , HDMI_NULL_SEND, 1); +REG_UPDATE (HDMI_VBI_PACKET_CONTROL ,HDMI_ACP_SEND ,0 ); +/* following belongs to audio */ REG_UPDATE (HDMI_INFOFRAME_CONTROL0 ,HDMI_AUDIO_INFO_SEND ,1 );
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.h +2 -14
@@ -194,7 +194,7 @@ struct dcn10_stream_enc_registers {#define SE_SF (reg_name, field_name, post_fix)\ .field_name = reg_name ## __ ## field_name ## post_fix -#define SE_COMMON_MASK_SH_LIST_SOC_BASE (mask_sh)\ +#define SE_COMMON_MASK_SH_LIST_SOC (mask_sh)\ SE_SF(DIG0_AFMT_VBI_PACKET_CONTROL, AFMT_GENERIC_INDEX, mask_sh),\ SE_SF(DIG0_AFMT_GENERIC_HDR, AFMT_GENERIC_HB0, mask_sh),\ SE_SF(DIG0_AFMT_GENERIC_HDR, AFMT_GENERIC_HB1, mask_sh),\
@@ -211,6 +211,7 @@ struct dcn10_stream_enc_registers {SE_SF (DIG0_HDMI_VBI_PACKET_CONTROL ,HDMI_GC_CONT , mask_sh),\SE_SF (DIG0_HDMI_VBI_PACKET_CONTROL ,HDMI_GC_SEND , mask_sh),\SE_SF (DIG0_HDMI_VBI_PACKET_CONTROL ,HDMI_NULL_SEND , mask_sh),\ +SE_SF (DIG0_HDMI_VBI_PACKET_CONTROL ,HDMI_ACP_SEND , mask_sh),\SE_SF (DIG0_HDMI_INFOFRAME_CONTROL0 ,HDMI_AUDIO_INFO_SEND , mask_sh),\SE_SF (DIG0_AFMT_INFOFRAME_CONTROL0 ,AFMT_AUDIO_INFO_UPDATE , mask_sh),\ SE_SF(DIG0_HDMI_INFOFRAME_CONTROL1, HDMI_AUDIO_INFO_LINE, mask_sh),\
@@ -339,15 +340,6 @@ struct dcn10_stream_enc_registers {SE_SF (DIG0_DIG_FE_CNTL ,DIG_SOURCE_SELECT , mask_sh),\ SE_SF(DIG0_DIG_CLOCK_PATTERN, DIG_CLOCK_PATTERN, mask_sh) -#if defined(CONFIG_DRM_AMD_DC_HDCP ) -#define SE_COMMON_MASK_SH_LIST_SOC (mask_sh)\ - SE_COMMON_MASK_SH_LIST_SOC_BASE(mask_sh),\ - SE_SF(DIG0_HDMI_VBI_PACKET_CONTROL, HDMI_ACP_SEND, mask_sh) -#else -#define SE_COMMON_MASK_SH_LIST_SOC (mask_sh)\ - SE_COMMON_MASK_SH_LIST_SOC_BASE(mask_sh) -#endif -#define SE_COMMON_MASK_SH_LIST_DCN10 (mask_sh)\ SE_COMMON_MASK_SH_LIST_SOC(mask_sh),\ SE_SF(DIG0_HDMI_GENERIC_PACKET_CONTROL0, HDMI_GENERIC0_CONT, mask_sh),\
@@ -586,9 +578,7 @@ struct dcn10_stream_enc_registers {struct dcn10_stream_encoder_shift {SE_REG_FIELD_LIST_DCN1_0 (uint8_t ); -#if defined(CONFIG_DRM_AMD_DC_HDCP )uint8_t HDMI_ACP_SEND; -#endif SE_REG_FIELD_LIST_DCN2_0 (uint8_t );SE_REG_FIELD_LIST_DCN3_0 (uint8_t );SE_REG_FIELD_LIST_DCN3_2 (uint8_t );
@@ -597,9 +587,7 @@ struct dcn10_stream_encoder_shift {struct dcn10_stream_encoder_mask {SE_REG_FIELD_LIST_DCN1_0 (uint32_t ); -#if defined(CONFIG_DRM_AMD_DC_HDCP )uint32_t HDMI_ACP_SEND; -#endif SE_REG_FIELD_LIST_DCN2_0 (uint32_t );SE_REG_FIELD_LIST_DCN3_0 (uint32_t );SE_REG_FIELD_LIST_DCN3_2 (uint32_t );
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_stream_encoder.c +0 -1
@@ -35,7 +35,6 @@#define DC_LOGGER \ enc1->base.ctx->logger -#define REG (reg)\ (enc1->regs->reg)
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_stream_encoder.c +3 -1
@@ -35,7 +35,6 @@#define DC_LOGGER \ enc1->base.ctx->logger -#define REG (reg)\ (enc1->regs->reg)
@@ -652,6 +651,9 @@ static void enc3_stream_encoder_hdmi_set_stream_attribute(HDMI_GC_SEND ,1 , HDMI_NULL_SEND, 1); +/* Disable Audio Content Protection packet transmission */ +REG_UPDATE (HDMI_VBI_PACKET_CONTROL ,HDMI_ACP_SEND ,0 ); +/* following belongs to audio */ /* Enable Audio InfoFrame packet transmission. */ REG_UPDATE (HDMI_INFOFRAME_CONTROL0 ,HDMI_AUDIO_INFO_SEND ,1 );
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_stream_encoder.h +2 -4
@@ -112,7 +112,7 @@ SRI(DIG_CLOCK_PATTERN, DIG, id) -#define SE_COMMON_MASK_SH_LIST_DCN30_BASE (mask_sh)\ +#define SE_COMMON_MASK_SH_LIST_DCN30 (mask_sh)\ SE_SF(DP0_DP_PIXEL_FORMAT, DP_PIXEL_ENCODING, mask_sh),\ SE_SF(DP0_DP_PIXEL_FORMAT, DP_COMPONENT_DEPTH, mask_sh),\ SE_SF(DIG0_HDMI_CONTROL, HDMI_PACKET_GEN_VERSION, mask_sh),\
@@ -124,6 +124,7 @@SE_SF (DIG0_HDMI_VBI_PACKET_CONTROL ,HDMI_GC_CONT , mask_sh),\SE_SF (DIG0_HDMI_VBI_PACKET_CONTROL ,HDMI_GC_SEND , mask_sh),\SE_SF (DIG0_HDMI_VBI_PACKET_CONTROL ,HDMI_NULL_SEND , mask_sh),\ +SE_SF (DIG0_HDMI_VBI_PACKET_CONTROL ,HDMI_ACP_SEND , mask_sh),\SE_SF (DIG0_HDMI_INFOFRAME_CONTROL0 ,HDMI_AUDIO_INFO_SEND , mask_sh),\SE_SF (DIG0_HDMI_INFOFRAME_CONTROL1 ,HDMI_AUDIO_INFO_LINE , mask_sh),\ SE_SF(DIG0_HDMI_GC, HDMI_GC_AVMUTE, mask_sh),\
@@ -273,9 +274,6 @@SE_SF (DP0_DP_SEC_FRAMING4 ,DP_SST_SDP_SPLITTING , mask_sh),\ SE_SF(DIG0_DIG_CLOCK_PATTERN, DIG_CLOCK_PATTERN, mask_sh) -#define SE_COMMON_MASK_SH_LIST_DCN30 (mask_sh)\ - SE_COMMON_MASK_SH_LIST_DCN30_BASE(mask_sh) - void dcn30_dio_stream_encoder_construct( struct dcn10_stream_encoder *enc1, struct dc_context *ctx,
drivers/gpu/drm/amd/display/dc/inc/hw/stream_encoder.h +1 -0
@@ -30,6 +30,7 @@#include "audio_types.h" #include "hw_shared.h" +#include "dc_link.h" struct dc_bios ;struct dc_context ;
drivers/gpu/drm/amd/include/asic_reg/dce/dce_6_0_sh_mask.h +2 -0
@@ -7486,6 +7486,8 @@#define HDMI_VBI_PACKET_CONTROL__HDMI_GC_SEND__SHIFT 0x00000004#define HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_CONT_MASK 0x00000200L#define HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_CONT__SHIFT 0x00000009 +#define HDMI_VBI_PACKET_CONTROL__HDMI_ACP_SEND_MASK 0x1000 +#define HDMI_VBI_PACKET_CONTROL__HDMI_ACP_SEND__SHIFT 0xc#define HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_LINE_MASK 0x003f0000L#define HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_LINE__SHIFT 0x00000010#define HDMI_VBI_PACKET_CONTROL__HDMI_ISRC_SEND_MASK 0x00000100L
Signature · 1 line
2.25.1
PATCH 22/40 drm/amd/display: Guard against ddc_pin being NULL for AUX
In reply to Rodrigo SiqueiraFrom: Nicholas Kazlauskas <[email protected]>
[Why]
In the case where we don't support DMUB aux but we have DPIA links in the configuration we might try to message AUX using the legacy path - where DDC pin is NULL. This causes a NULL pointer dereference.
[How]
Guard against NULL DDC pin, return a failure for aux engine acquire.
--- drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/dce/dce_aux.c +5 -0
@@ -572,6 +572,11 @@ int dce_aux_transfer_raw(struct ddc_service *ddc,memset (&aux_req,0 ,sizeof (aux_req)); +if (ddc_pin ==NULL ) { + *operation_result =AUX_RET_ERROR_ENGINE_ACQUIRE ; +return -1 ; + } + aux_engine = ddc->ctx->dc->res_pool->engines[ddc_pin->pin_data->en];if (!acquire (aux_engine, ddc_pin)) { *operation_result =AUX_RET_ERROR_ENGINE_ACQUIRE ;
Signature · 1 line
2.25.1
PATCH 23/40 drm/amd/display: Remove incorrect ASSERT check for link_enc
In reply to Rodrigo SiqueiraFrom: Nicholas Kazlauskas <[email protected]>
[Why]
It's possible that we don't have a link encoder assignment if the context is NULL but we're calling dc_add_stream_to_ctx from DM directly.
Link encoder assignment will happen later after global validation runs with fast_validate = false.
[How]
Remove the ASSERTION. We already guard against NULL link_enc.
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +1 -2
@@ -1246,10 +1246,9 @@ static void get_pixel_clock_parameters( pixel_clk_params->requested_pix_clk_100hz = stream->timing.pix_clk_100hz; link_enc =link_enc_cfg_get_link_enc (link); -ASSERT (link_enc); -if (link_enc) pixel_clk_params->encoder_object_id = link_enc->id; + pixel_clk_params->signal_type = pipe_ctx->stream->signal; pixel_clk_params->controller_id = pipe_ctx->stream_res.tg->inst +1 ;/* TODO: un-hardcode*/
Signature · 1 line
2.25.1
PATCH 24/40 drm/amd/display: Guard against NULL link encoder in log hw state
In reply to Rodrigo SiqueiraFrom: Nicholas Kazlauskas <[email protected]>
[Why & How]
Check lenc is not NULL since dynamic link encoder assignment could end up assigning a NULL link encoder.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +1 -1
@@ -444,7 +444,7 @@ void dcn10_log_hw_state(struct dc *dc,struct link_enc_state s = {0 }; -if (lenc->funcs->read_state) { +if (lenc && lenc->funcs->read_state) { lenc->funcs->read_state (lenc, &s); DTN_INFO("[%-3d]: %-12d %-22d %-22d %-25d\n", i,
Signature · 1 line
2.25.1
PATCH 25/40 drm/amd/display: Fix dmub soft hang for PSR 1
In reply to Rodrigo SiqueiraFrom: Fangzhi Zuo <[email protected]>
[Why]
Unexpected change of aux hw mapping causes dmub soft hang when initiate aux transation at wrong aux channel.
ddc_channel stands for hw dp aux index which is from vbios,
but link_index is pure software concept for link count depending on which link is probed first. They are not interchangeable.
dmub aux transaction could pass if happens eDP link_index gets the same value as vbios ddc_channel, e.g., ddc_channel = 1, link_index = 1 if they gets different, e.g., ddc_channel = 2, link_index = 0, overwrite ddc_channel with link_index will have wrong ddc channel being used for aux transaction in dmub PSR, cause aux transaction soft hang.
[How]ddc_channel mapping to each link is determined by vbios and further parsed in dc. Such info. should not be touched in any kind, otherwise the mapping is screwed up leading to aux transaction timeout.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -3
@@ -8639,7 +8639,7 @@ static int amdgpu_dm_i2c_xfer(struct i2c_adapter *i2c_adap,if (dc_submit_i2c ( ddc_service->ctx->dc, - ddc_service->ddc_pin->hw_info.ddc_channel, + ddc_service->link->link_index, &cmd)) result = num;
@@ -8675,8 +8675,6 @@ create_i2c(struct ddc_service *ddc_service,snprintf (i2c->base.name,sizeof (i2c->base.name),"AMDGPU DM i2c hw bus %d" , link_index);i2c_set_adapdata (&i2c->base, i2c); i2c->ddc_service = ddc_service; -if (i2c->ddc_service->ddc_pin) - i2c->ddc_service->ddc_pin->hw_info.ddc_channel = link_index;return i2c; }
Signature · 1 line
2.25.1
PATCH 26/40 drm/amd/display: disable otg toggle w/a on boot
In reply to Rodrigo SiqueiraFrom: Dmytro Laktyushkin <[email protected]>
This w/a has a bad interaction with seamless boot toggling an active stream. Most panels recover, however some fail leading to display corruption.
--- .../gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c +5 -2
@@ -173,11 +173,14 @@ 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)) { -dcn315_disable_otg_wa (clk_mgr_base, true); +/* 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); clk_mgr_base->clks.dispclk_khz = new_clocks->dispclk_khz;dcn315_smu_set_dispclk (clk_mgr, clk_mgr_base->clks.dispclk_khz); -dcn315_disable_otg_wa (clk_mgr_base, false); +if (clk_mgr_base->clks.dispclk_khz) +dcn315_disable_otg_wa (clk_mgr_base, false); update_dispclk = true; }
Signature · 1 line
2.25.1
PATCH 27/40 drm/amd/display: Indicate stream change on ODM change
In reply to Rodrigo SiqueiraFrom: Chris Park <[email protected]>
[Why]
With ODM policy 2 to 1, there exists a new use case scenario where stream content is unchanged, but ODM may be used. When this happens, the stream needs to be committed with a new pipe setting. This did not happen due to stream change detection logic not accounting for ODM.
[How]
Set ODM flag in stream and commit stream when change in ODM has been detected due to policy change.
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 3 +++ drivers/gpu/drm/amd/display/dc/dc_stream.h | 2 ++ 2 files changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +3 -0
@@ -1702,6 +1702,9 @@ bool dc_is_stream_unchanged(if (memcmp (&old_stream->audio_info, &stream->audio_info,sizeof (stream->audio_info)) !=0 )return false; +if (old_stream->odm_2to1_policy_applied != stream->odm_2to1_policy_applied) +return false; +return true; }
drivers/gpu/drm/amd/display/dc/dc_stream.h +2 -0
@@ -276,6 +276,8 @@ struct dc_stream_state {bool has_non_synchronizable_pclk;bool vblank_synchronized;struct mall_stream_config mall_stream_config; + +bool odm_2to1_policy_applied; };#define ABM_LEVEL_IMMEDIATE_DISABLE 255
Signature · 1 line
2.25.1
PATCH 28/40 drm/amd/display: Remove configuration option for dpia hpd delay
In reply to Rodrigo SiqueiraFrom: Meenakshikumar Somasundaram <[email protected]>
[Why]
DC debug option to configure dpia hpd processing delay is not required.
[How]
Remove dc debug option for dpia hpd delay and also added log for querying dpia hpd state.
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dpia.c | 7 +++++++ drivers/gpu/drm/amd/display/dc/dc.h | 5 ++--- 2 files changed, 9 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dpia.c +7 -0
@@ -85,6 +85,13 @@ bool dc_link_dpia_query_hpd_status(struct dc_link *link)if (dc_dmub_srv_cmd_with_reply_data (dmub_srv, &cmd) && cmd.query_hpd.data.status ==AUX_RET_SUCCESS ) is_hpd_high = cmd.query_hpd.data.result; +DC_LOG_DEBUG ("%s: link(%d) dpia(%d) cmd_status(%d) result(%d)\n" , + __func__, + link->link_index, + link->link_id.enum_id -ENUM_ID_1 , + cmd.query_hpd.data.status, + cmd.query_hpd.data.result); +return is_hpd_high; }
drivers/gpu/drm/amd/display/dc/dc.h +2 -3
@@ -542,9 +542,8 @@ union dpia_debug_options { uint32_t force_non_lttpr:1; /* bit 1 */ uint32_t extend_aux_rd_interval:1; /* bit 2 */ uint32_t disable_mst_dsc_work_around:1; /* bit 3 */ - uint32_t hpd_delay_in_ms:12; /* bits 4-15 */ - uint32_t disable_force_tbt3_work_around:1; /* bit 16 */ - uint32_t reserved:15; + uint32_t disable_force_tbt3_work_around:1; /* bit 4 */ + uint32_t reserved:27; } bits;uint32_t raw; };
Signature · 1 line
2.25.1
PATCH 29/40 drm/amd/display: Fix refresh rate issue on Club 3D
In reply to Rodrigo SiqueiraRecently we introduced a patch for fixing an MST issue, but it caused a regression on Club 3D since we could not set a refresh rate higher than 60Hz. This commit fixes this issue by adding a proper check after validating the stream.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -4
@@ -7210,12 +7210,10 @@ create_validate_stream_for_sink(struct amdgpu_dm_connector *aconnector,break ; } -if (stream->signal ==SIGNAL_TYPE_DISPLAY_PORT_MST ) + dc_result =dc_validate_stream (adev->dm.dc, stream); +if (dc_result ==DC_OK && stream->signal ==SIGNAL_TYPE_DISPLAY_PORT_MST ) dc_result =dm_dp_mst_is_port_support_mode (aconnector, stream); -if (dc_result ==DC_OK ) - dc_result =dc_validate_stream (adev->dm.dc, stream); -if (dc_result !=DC_OK ) { DRM_DEBUG_KMS("Mode %dx%d (clk %d) failed DC validation with error %d (%s)\n", drm_mode->hdisplay,
Signature · 1 line
2.25.1
PATCH 30/40 drm/amd/display: Disable TBT3 DSC work around by default.
In reply to Rodrigo SiqueiraFrom: Jimmy Kizito <[email protected]>
[Why]
Some TBT3 docks have DPOAs which report USB4 capability and are expected to support USB4 DPOA features such as FEC/DSC.
[How]
By default, do not override FEC/DSC capabilities reported by TBT3 docks.
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 2 +- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +1 -1
@@ -5553,7 +5553,7 @@ static bool retrieve_link_cap(struct dc_link *link)* only if required. */ if (link->ep_type == DISPLAY_ENDPOINT_USB4_DPIA && - !link->dc->debug.dpia_debug.bits.disable_force_tbt3_work_around && + link->dc->debug.dpia_debug.bits.enable_force_tbt3_work_around && link->dpcd_caps.is_branch_dev && link->dpcd_caps.branch_dev_id == DP_BRANCH_DEVICE_ID_90CC24 && link->dpcd_caps.branch_hw_revision == DP_BRANCH_HW_REV_10 &&
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -542,7 +542,7 @@ union dpia_debug_options { uint32_t force_non_lttpr:1; /* bit 1 */ uint32_t extend_aux_rd_interval:1; /* bit 2 */ uint32_t disable_mst_dsc_work_around:1; /* bit 3 */ - uint32_t disable_force_tbt3_work_around:1; /* bit 4 */ + uint32_t enable_force_tbt3_work_around:1; /* bit 4 */ uint32_t reserved:27; } bits;uint32_t raw;
Signature · 1 line
2.25.1
PATCH 31/40 drm/amd/display: Add flag to modify MST delay
In reply to Rodrigo SiqueiraFrom: Duncan Ma <[email protected]>
[Why]
Some panels may require more MST delay on discovery
[How]
Add panel patch and debug mst delay flag
--- drivers/gpu/drm/amd/display/dc/dc.h | 3 ++- drivers/gpu/drm/amd/display/dc/dc_types.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +2 -1
@@ -741,14 +741,15 @@ struct dc_debug_options {bool enable_sw_cntl_psr;union dpia_debug_options dpia_debug;bool disable_fixed_vs_aux_timeout_wa; -uint32_t fixed_vs_aux_delay_config_wa;bool force_disable_subvp;bool force_subvp_mclk_switch;bool force_usr_allow;/* uses value at boot and disables switch */ bool disable_dtb_ref_clk_switch; +uint32_t fixed_vs_aux_delay_config_wa;bool extended_blank_optimization;union aux_wake_wa_options aux_wake_wa; +uint32_t mst_start_top_delay;uint8_t psr_power_use_phy_fsm;enum dml_hostvm_override_opts dml_hostvm_override;bool use_legacy_soc_bb_mechanism;
drivers/gpu/drm/amd/display/dc/dc_types.h +1 -0
@@ -199,6 +199,7 @@ struct dc_panel_patch {unsigned int embedded_tiled_slave;unsigned int disable_fams;unsigned int skip_avmute; +unsigned int mst_start_top_delay; };struct dc_edid_caps {
Signature · 1 line
2.25.1
PATCH 32/40 drm/amd/display: Fix null timing generator resource
In reply to Rodrigo SiqueiraFrom: Eric Bernstein <[email protected]>
[Why]
For some customer blending transition cases, the available pipe for second stream is a pipe index that is greater than the number of timing generators, which can cause a problem in acquire_first_free_pipe since it assumes same index for pipe and timing generator
[How]
Added logic to use last timing generator index
if the pipe index is greater than number of timing generators.
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +6 -0
@@ -1885,6 +1885,12 @@ static int acquire_first_free_pipe( pipe_ctx->plane_res.mpcc_inst = pool->dpps[i]->inst; pipe_ctx->pipe_idx = i; +if (i >= pool->timing_generator_count) { +int tg_inst = pool->timing_generator_count -1 ; + + pipe_ctx->stream_res.tg = pool->timing_generators[tg_inst]; + pipe_ctx->stream_res.opp = pool->opps[tg_inst]; + } pipe_ctx->stream = stream;return i;
Signature · 1 line
2.25.1
PATCH 33/40 drm/amd/display: Move all linux includes into OS types
In reply to Rodrigo SiqueiraFrom: Harry Wentland <[email protected]>
Move all linux includes into OS types.
--- drivers/gpu/drm/amd/display/dc/basics/vector.c | 2 -- drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c | 2 -- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 --- drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c | 2 -- drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c | 2 -- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 2 -- drivers/gpu/drm/amd/display/dc/core/dc_sink.c | 2 -- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 3 --- drivers/gpu/drm/amd/display/dc/core/dc_surface.c | 2 -- drivers/gpu/drm/amd/display/dc/dce/dce_audio.c | 2 -- drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 3 --- drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c | 2 -- drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c | 3 --- drivers/gpu/drm/amd/display/dc/dce/dce_i2c_sw.c | 2 -- drivers/gpu/drm/amd/display/dc/dce/dce_ipp.c | 2 -- drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 3 --- drivers/gpu/drm/amd/display/dc/dce/dce_opp.c | 2 -- drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c | 2 -- drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c | 2 -- drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c | 3 --- drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 2 -- drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_regamma_v.c | 2 -- drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c | 2 -- drivers/gpu/drm/amd/display/dc/dce110/dce110_transform_v.c | 2 -- drivers/gpu/drm/amd/display/dc/dce112/dce112_compressor.c | 3 --- drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c | 2 -- drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c | 2 -- drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c | 2 -- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 2 -- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_ipp.c | 2 -- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c | 3 --- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_opp.c | 2 -- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 2 -- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c | 2 -- drivers/gpu/drm/amd/display/dc/gpio/gpio_base.c | 2 -- drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c | 2 -- drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.c | 3 --- drivers/gpu/drm/amd/display/dc/gpio/hw_factory.c | 2 -- drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c | 2 -- .../gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c | 2 -- .../gpu/drm/amd/display/dc/irq/dce120/irq_service_dce120.c | 2 -- drivers/gpu/drm/amd/display/dc/irq/dce80/irq_service_dce80.c | 2 -- drivers/gpu/drm/amd/display/dc/irq/dcn10/irq_service_dcn10.c | 2 -- drivers/gpu/drm/amd/display/dc/irq/irq_service.c | 2 -- drivers/gpu/drm/amd/display/dc/os_types.h | 5 ++++- .../gpu/drm/amd/display/dc/virtual/virtual_link_encoder.c | 2 -- .../gpu/drm/amd/display/dc/virtual/virtual_stream_encoder.c | 2 -- drivers/gpu/drm/amd/display/modules/color/color_gamma.c | 3 --- drivers/gpu/drm/amd/display/modules/freesync/freesync.c | 2 -- 49 files changed, 4 insertions(+), 107 deletions(-)
drivers/gpu/drm/amd/display/dc/basics/vector.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "dm_services.h" #include "include/vector.h"
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "dm_services.h" #include "ObjectID.h"
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -3
@@ -22,9 +22,6 @@* Authors: AMD */ -#include <linux/slab.h> -#include <linux/mm.h> -#include "dm_services.h" #include "dc.h"
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/delay.h> -#include "dm_services.h" #include "core_types.h" #include "timing_generator.h"
drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "dm_services.h" #include "dm_helpers.h" #include "gpio_service_interface.h"
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "dm_services.h" #include "resource.h"
drivers/gpu/drm/amd/display/dc/core/dc_sink.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "dm_services.h" #include "dm_helpers.h" #include "core_types.h"
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +0 -3
@@ -23,9 +23,6 @@* */ -#include <linux/delay.h> -#include <linux/slab.h> -#include "dm_services.h" #include "basics/dc_common.h" #include "dc.h"
drivers/gpu/drm/amd/display/dc/core/dc_surface.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/mm.h> -/* DC interface (public) */ #include "dm_services.h" #include "dc.h"
drivers/gpu/drm/amd/display/dc/dce/dce_audio.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "reg_helper.h" #include "dce_audio.h" #include "dce/dce_11_0_d.h"
drivers/gpu/drm/amd/display/dc/dce/dce_aux.c +0 -3
@@ -23,9 +23,6 @@* */ -#include <linux/delay.h> -#include <linux/slab.h> -#include "dm_services.h" #include "core_types.h" #include "dce_aux.h"
drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "dm_services.h"
drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c +0 -3
@@ -23,9 +23,6 @@* */ -#include <linux/delay.h> -#include <linux/slab.h> -#include "core_types.h" #include "link_encoder.h" #include "dce_dmcu.h"
drivers/gpu/drm/amd/display/dc/dce/dce_i2c_sw.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/delay.h> -#include "dce_i2c.h" #include "dce_i2c_sw.h" #include "include/gpio_service_interface.h"
drivers/gpu/drm/amd/display/dc/dce/dce_ipp.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "dce_ipp.h" #include "reg_helper.h" #include "dm_services.h"
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +0 -3
@@ -23,9 +23,6 @@* */ -#include <linux/delay.h> -#include <linux/slab.h> -#include "reg_helper.h" #include "core_types.h"
drivers/gpu/drm/amd/display/dc/dce/dce_opp.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "dm_services.h" #include "basics/conversion.h"
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/delay.h> -#include "dc_bios_types.h" #include "dce_stream_encoder.h" #include "reg_helper.h"
drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "dm_services.h" #include "link_encoder.h"
drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c +0 -3
@@ -23,9 +23,6 @@* */ -#include <linux/delay.h> -#include <linux/slab.h> -#include "dm_services.h" #include "dce/dce_11_0_d.h"
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/delay.h> -#include "dm_services.h" #include "dc.h" #include "dc_bios_types.h"
drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_regamma_v.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/delay.h> -#include "dm_services.h" /* include DCE11 register header files */
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "dm_services.h" #include "link_encoder.h"
drivers/gpu/drm/amd/display/dc/dce110/dce110_transform_v.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/delay.h> -#include "dce110_transform_v.h" #include "dm_services.h" #include "dc.h"
drivers/gpu/drm/amd/display/dc/dce112/dce112_compressor.c +0 -3
@@ -23,9 +23,6 @@* */ -#include <linux/delay.h> -#include <linux/slab.h> -#include "dm_services.h" #include "dce/dce_11_2_d.h"
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "dm_services.h" #include "link_encoder.h"
drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c +0 -2
@@ -24,8 +24,6 @@* */ -#include <linux/slab.h> -#include "dm_services.h"
drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "dce/dce_8_0_d.h" #include "dce/dce_8_0_sh_mask.h"
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/delay.h> -#include "dm_services.h" #include "dcn10_hubp.h" #include "dcn10_hubbub.h"
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_ipp.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "dm_services.h" #include "dcn10_ipp.h" #include "reg_helper.h"
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c +0 -3
@@ -23,9 +23,6 @@* */ -#include <linux/delay.h> -#include <linux/slab.h> -#include "reg_helper.h" #include "core_types.h"
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_opp.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "dm_services.h" #include "dcn10_opp.h" #include "reg_helper.h"
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "dm_services.h" #include "dc.h"
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/delay.h> -#include "dm_services.h" #include "dc_bios_types.h" #include "dcn10_stream_encoder.h"
drivers/gpu/drm/amd/display/dc/gpio/gpio_base.c +0 -2
@@ -27,8 +27,6 @@* Pre-requisites: headers required by header of this unit */ -#include <linux/slab.h> -#include "dm_services.h" #include "include/gpio_interface.h"
drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c +0 -2
@@ -27,8 +27,6 @@* Pre-requisites: headers required by header of this unit */ -#include <linux/slab.h> -#include "dm_services.h" #include "include/gpio_interface.h" #include "include/gpio_service_interface.h"
drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.c +0 -3
@@ -23,9 +23,6 @@* */ -#include <linux/delay.h> -#include <linux/slab.h> -#include "dm_services.h" #include "include/gpio_interface.h"
drivers/gpu/drm/amd/display/dc/gpio/hw_factory.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "dm_services.h" /*
drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "dm_services.h" #include "include/gpio_interface.h"
drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "dm_services.h" #include "include/logger_interface.h"
drivers/gpu/drm/amd/display/dc/irq/dce120/irq_service_dce120.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "dm_services.h" #include "include/logger_interface.h"
drivers/gpu/drm/amd/display/dc/irq/dce80/irq_service_dce80.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "dm_services.h" #include "include/logger_interface.h"
drivers/gpu/drm/amd/display/dc/irq/dcn10/irq_service_dcn10.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "dm_services.h" #include "include/logger_interface.h"
drivers/gpu/drm/amd/display/dc/irq/irq_service.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "dm_services.h" #include "include/irq_service_interface.h"
drivers/gpu/drm/amd/display/dc/os_types.h +4 -1
@@ -27,17 +27,20 @@#ifndef _OS_TYPES_H_#define _OS_TYPES_H_ +#include <linux/slab.h> #include <linux/kgdb.h> #include <linux/kref.h> #include <linux/types.h> -#include <linux/slab.h> #include <linux/delay.h> +#include <linux/mm.h> #include <asm/byteorder.h> #include <drm/drm_print.h> #include <drm/drm_dp_helper.h> +#include <drm/drm_print.h> +#include "cgs_common.h" #if defined(__BIG_ENDIAN) && !defined(BIGENDIAN_CPU )
drivers/gpu/drm/amd/display/dc/virtual/virtual_link_encoder.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "dm_services.h" #include "dm_services_types.h"
drivers/gpu/drm/amd/display/dc/virtual/virtual_stream_encoder.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "dm_services.h" #include "virtual_stream_encoder.h"
drivers/gpu/drm/amd/display/modules/color/color_gamma.c +0 -3
@@ -23,9 +23,6 @@* */ -#include <linux/mm.h> -#include <linux/slab.h> -#include "dc.h" #include "opp.h" #include "color_gamma.h"
drivers/gpu/drm/amd/display/modules/freesync/freesync.c +0 -2
@@ -23,8 +23,6 @@* */ -#include <linux/slab.h> -#include "dm_services.h" #include "dc.h" #include "mod_freesync.h"
Signature · 1 line
2.25.1
PATCH 34/40 drm/amd/display: Fix uninitialized variable.
In reply to Rodrigo SiqueiraFrom: Jimmy Kizito <[email protected]>
[Why]
Uninitialized variable causes diag compilation build failure.
[How]
- Ensure that variable in question is always initialized before being used.
- The variable in question is the USB4 DP training pattern. In case an unsupported training pattern has been requested, update status accordingly and abort current link training attempt.
--- .../drm/amd/display/dc/core/dc_link_dpia.c | 49 +++++++++++-------- 1 file changed, 28 insertions(+), 21 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dpia.c +28 -21
@@ -202,30 +202,34 @@ static uint8_t dpia_build_set_config_data(enum dpia_set_config_type type, }/* Convert DC training pattern to DPIA training stage. */ -static enum dpia_set_config_ts convert_trng_ptn_to_trng_stg (enum dc_dp_training_pattern tps) +static enum dc_status convert_trng_ptn_to_trng_stg (enum dc_dp_training_pattern tps,enum dpia_set_config_ts *ts) { -enum dpia_set_config_ts ts; +enum dc_status status =DC_OK ;switch (tps) {case DP_TRAINING_PATTERN_SEQUENCE_1 : - ts =DPIA_TS_TPS1 ; + *ts =DPIA_TS_TPS1 ;break ;case DP_TRAINING_PATTERN_SEQUENCE_2 : - ts =DPIA_TS_TPS2 ; + *ts =DPIA_TS_TPS2 ;break ;case DP_TRAINING_PATTERN_SEQUENCE_3 : - ts =DPIA_TS_TPS3 ; + *ts =DPIA_TS_TPS3 ;break ;case DP_TRAINING_PATTERN_SEQUENCE_4 : - ts =DPIA_TS_TPS4 ; + *ts =DPIA_TS_TPS4 ;break ; -default : - ts =DPIA_TS_DPRX_DONE ; -ASSERT (false);/* TPS not supported by helper function. */ +case DP_TRAINING_PATTERN_VIDEOIDLE : + *ts =DPIA_TS_DPRX_DONE ; +break ; +default :/* TPS not supported by helper function. */ +ASSERT (false); + *ts =DPIA_TS_DPRX_DONE ; + status =DC_UNSUPPORTED_VALUE ;break ; } -return ts; +return status; }/* Write training pattern to DPCD. */
@@ -336,10 +340,7 @@ static enum link_training_result dpia_training_cr_non_transparent(/* DPOA-to-x */ /* Instruct DPOA to transmit TPS1 then update DPCD. */ if (retry_count ==0 ) { - ts =convert_trng_ptn_to_trng_stg (lt_settings->pattern_for_cr); - status =core_link_send_set_config (link, -DPIA_SET_CFG_SET_TRAINING , - ts); + status =convert_trng_ptn_to_trng_stg (lt_settings->pattern_for_cr, &ts);if (status !=DC_OK ) { result =LINK_TRAINING_ABORT ;break ;
@@ -421,13 +422,14 @@ static enum link_training_result dpia_training_cr_non_transparent(if (link->is_hpd_pending) result =LINK_TRAINING_ABORT ; -DC_LOG_HW_LINK_TRAINING ("%s\n DPIA(%d) clock recovery\n" -" -hop(%d)\n - result(%d)\n - retries(%d)\n" , +DC_LOG_HW_LINK_TRAINING ( +"%s\n DPIA(%d) clock recovery\n -hop(%d)\n - result(%d)\n - retries(%d)\n - status(%d)\n" , __func__, link->link_id.enum_id -ENUM_ID_1 , hop, result, - retry_count); + retry_count, + status);return result; }
@@ -631,7 +633,11 @@ static enum link_training_result dpia_training_eq_non_transparent(/* Instruct DPOA to transmit TPSn then update DPCD. */ if (retries_eq ==0 ) { - ts =convert_trng_ptn_to_trng_stg (tr_pattern); + status =convert_trng_ptn_to_trng_stg (tr_pattern, &ts); +if (status !=DC_OK ) { + result =LINK_TRAINING_ABORT ; +break ; + } status =core_link_send_set_config (link,DPIA_SET_CFG_SET_TRAINING , ts);
@@ -712,13 +718,14 @@ static enum link_training_result dpia_training_eq_non_transparent(if (link->is_hpd_pending) result =LINK_TRAINING_ABORT ; -DC_LOG_HW_LINK_TRAINING ("%s\n DPIA(%d) equalization\n" -" - hop(%d)\n - result(%d)\n - retries(%d)\n" , +DC_LOG_HW_LINK_TRAINING ( +"%s\n DPIA(%d) equalization\n - hop(%d)\n - result(%d)\n - retries(%d)\n - status(%d)\n" , __func__, link->link_id.enum_id -ENUM_ID_1 , hop, result, - retries_eq); + retries_eq, + status);return result; }
Signature · 1 line
2.25.1
PATCH 35/40 drm/amd/display: Initialize lt_settings on instantiation
In reply to Rodrigo SiqueiraFrom: Michael Strauss <[email protected]>
[WHY]lt_settings' pointers remain uninitialized but nonzero if display fails to light up with no DPCD/EDID info populated, leading to a hang on access
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dpia.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dpia.c +1 -1
@@ -960,7 +960,7 @@ enum link_training_result dc_link_dpia_perform_link_training( bool skip_video_pattern) {enum link_training_result result; -struct link_training_settings lt_settings; +struct link_training_settings lt_settings = {0 };uint8_t repeater_cnt =0 ;/* Number of hops/repeaters in display path. */ int8_t repeater_id;/* Current hop. */
Signature · 1 line
2.25.1
PATCH 36/40 drm/amd/display: OVT Update on InfoFrame and Mode Management
In reply to Rodrigo SiqueiraFrom: Chris Park <[email protected]>
[Why]
Integrate OVT timing from DM to DC logic to update info frame and mode management to report the resolution to the OS.
[How]
Reflect RID and Frame Rate to AVI InfoFrame Version 5. Define new Timing Standard for OVT timing.
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 11 +++++++++++ drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 2 ++ drivers/gpu/drm/amd/display/dc/dc_types.h | 2 ++ drivers/gpu/drm/amd/display/include/set_mode_types.h | 8 ++++++-- 4 files changed, 21 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +11 -0
@@ -2514,6 +2514,8 @@ static void set_avi_info_frame(union hdmi_info_packet hdmi_info;union display_content_support support = {0 };unsigned int vic = pipe_ctx->stream->timing.vic; +unsigned int rid = pipe_ctx->stream->timing.rid; +unsigned int fr_ind = pipe_ctx->stream->timing.fr_index;enum dc_timing_3d_format format;memset (&hdmi_info,0 ,sizeof (union hdmi_info_packet ));
@@ -2706,6 +2708,15 @@ static void set_avi_info_frame( hdmi_info.bits.header.length =14 ; } +if (rid !=0 && fr_ind !=0 ) { + hdmi_info.bits.header.version =5 ; + hdmi_info.bits.header.length =15 ; + + hdmi_info.bits.FR0_FR3 = fr_ind &0xF ; + hdmi_info.bits.FR4 = (fr_ind >>4 ) &0x1 ; + hdmi_info.bits.RID0_RID5 = rid; + } +/* pixel repetition * PR0 - PR3 start from 0 whereas pHwPathMode->mode.timing.flags.pixel * repetition start from 1 */
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +2 -0
@@ -784,6 +784,8 @@ struct dc_crtc_timing {uint32_t vic;uint32_t hdmi_vic; +uint32_t rid; +uint32_t fr_index;enum dc_timing_3d_format timing_3d_format;enum dc_color_depth display_color_depth;enum dc_pixel_encoding pixel_encoding;
drivers/gpu/drm/amd/display/dc/dc_types.h +2 -0
@@ -280,6 +280,8 @@ enum dc_timing_source {TIMING_SOURCE_EDID_CEA_SVD ,TIMING_SOURCE_EDID_CVT_3BYTE ,TIMING_SOURCE_EDID_4BYTE , +TIMING_SOURCE_EDID_CEA_DISPLAYID_VTDB , +TIMING_SOURCE_EDID_CEA_RID ,TIMING_SOURCE_VBIOS ,TIMING_SOURCE_CV , TIMING_SOURCE_TV,
drivers/gpu/drm/amd/display/include/set_mode_types.h +6 -2
@@ -84,10 +84,14 @@ union hdmi_info_packet {uint16_t bar_left;uint16_t bar_right; - uint8_t F140_F143:4; + uint8_t FR0_FR3:4; uint8_t ACE0_ACE3:4; -uint8_t reserved[13 ]; + uint8_t RID0_RID5:6; + uint8_t FR4:1; + uint8_t F157:1; + +uint8_t reserved[12 ]; } bits;struct info_packet_raw_data packet_raw_data;
Signature · 1 line
2.25.1
PATCH 37/40 drm/amd/display: enable PCON SST support for newer ASICs
In reply to Rodrigo SiqueiraFrom: Hamza Mahfooz <[email protected]>
Generic PCON SST support already exists and works for newer ASICs. So, enable it by default.
--- drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.c | 1 + drivers/gpu/drm/amd/display/dc/dcn316/dcn316_resource.c | 1 + drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c | 1 + drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c | 1 + 4 files changed, 4 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.c +1 -0
@@ -1768,6 +1768,7 @@ static bool dcn315_resource_construct( dc->caps.post_blend_color_processing = true; dc->caps.force_dp_tps4_for_cp2520 = true; dc->caps.dp_hpo = true; + dc->caps.hdmi_frl_pcon_support = true; dc->caps.edp_dsc_support = true; dc->caps.extended_aux_timeout_support = true; dc->caps.dmcub_support = true;
drivers/gpu/drm/amd/display/dc/dcn316/dcn316_resource.c +1 -0
@@ -1770,6 +1770,7 @@ static bool dcn316_resource_construct( dc->caps.post_blend_color_processing = true; dc->caps.force_dp_tps4_for_cp2520 = true; dc->caps.dp_hpo = true; + dc->caps.hdmi_frl_pcon_support = true; dc->caps.edp_dsc_support = true; dc->caps.extended_aux_timeout_support = true; dc->caps.dmcub_support = true;
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +1 -0
@@ -4010,6 +4010,7 @@ static bool dcn32_resource_construct( dc->caps.post_blend_color_processing = true; dc->caps.force_dp_tps4_for_cp2520 = true; dc->caps.dp_hpo = true; + dc->caps.hdmi_frl_pcon_support = true; dc->caps.edp_dsc_support = true; dc->caps.extended_aux_timeout_support = true; dc->caps.dmcub_support = true;
drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c +1 -0
@@ -2305,6 +2305,7 @@ static bool dcn321_resource_construct( dc->caps.post_blend_color_processing = true; dc->caps.force_dp_tps4_for_cp2520 = true; dc->caps.dp_hpo = true; + dc->caps.hdmi_frl_pcon_support = true; dc->caps.edp_dsc_support = true; dc->caps.extended_aux_timeout_support = true; dc->caps.dmcub_support = true;
Signature · 1 line
2.25.1
PATCH 38/40 drm/amd/display: rename hdmi_frl_pcon_support
In reply to Rodrigo SiqueiraFrom: Hamza Mahfooz <[email protected]>
hdmi_frl_pcon_support has been the source of confusion. So, rename it to dp_hdmi21_pcon_support.
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 2 +- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn316/dcn316_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +1 -1
@@ -4890,7 +4890,7 @@ static void get_active_converter_info( hdmi_color_caps.bits.MAX_BITS_PER_COLOR_COMPONENT);#if defined(CONFIG_DRM_AMD_DC_DCN ) -if (link->dc->caps.hdmi_frl_pcon_support) { +if (link->dc->caps.dp_hdmi21_pcon_support) {union hdmi_encoded_link_bw hdmi_encoded_link_bw; link->dpcd_caps.dongle_caps.dp_hdmi_frl_max_link_bw_in_kbps =
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -203,7 +203,7 @@ struct dc_caps {struct dc_color_caps color;struct dc_dmub_caps dmub_caps;bool dp_hpo; -bool hdmi_frl_pcon_support; +bool dp_hdmi21_pcon_support;bool edp_dsc_support;bool vbios_lttpr_aware;bool vbios_lttpr_enable;
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +1 -1
@@ -2463,7 +2463,7 @@ static bool dcn20_resource_construct( dc->caps.color.mpc.ogam_rom_caps.hlg =0 ; dc->caps.color.mpc.ocsc =1 ; - dc->caps.hdmi_frl_pcon_support = true; + dc->caps.dp_hdmi21_pcon_support = true;if (dc->ctx->dce_environment ==DCE_ENV_PRODUCTION_DRV ) { dc->debug = debug_defaults_drv;
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +1 -1
@@ -1490,7 +1490,7 @@ static bool dcn21_resource_construct( dc->caps.color.mpc.ogam_rom_caps.hlg =0 ; dc->caps.color.mpc.ocsc =1 ; - dc->caps.hdmi_frl_pcon_support = true; + dc->caps.dp_hdmi21_pcon_support = true;if (dc->ctx->dce_environment ==DCE_ENV_PRODUCTION_DRV ) dc->debug = debug_defaults_drv;
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c +1 -1
@@ -2379,7 +2379,7 @@ static bool dcn30_resource_construct( dc->caps.color.mpc.ogam_rom_caps.hlg =0 ; dc->caps.color.mpc.ocsc =1 ; - dc->caps.hdmi_frl_pcon_support = true; + dc->caps.dp_hdmi21_pcon_support = true;/* read VBIOS LTTPR caps */ {
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c +1 -1
@@ -1898,7 +1898,7 @@ static bool dcn31_resource_construct( dc->caps.post_blend_color_processing = true; dc->caps.force_dp_tps4_for_cp2520 = true; dc->caps.dp_hpo = true; - dc->caps.hdmi_frl_pcon_support = true; + dc->caps.dp_hdmi21_pcon_support = true; dc->caps.edp_dsc_support = true; dc->caps.extended_aux_timeout_support = true; dc->caps.dmcub_support = true;
drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.c +1 -1
@@ -1768,7 +1768,7 @@ static bool dcn315_resource_construct( dc->caps.post_blend_color_processing = true; dc->caps.force_dp_tps4_for_cp2520 = true; dc->caps.dp_hpo = true; - dc->caps.hdmi_frl_pcon_support = true; + dc->caps.dp_hdmi21_pcon_support = true; dc->caps.edp_dsc_support = true; dc->caps.extended_aux_timeout_support = true; dc->caps.dmcub_support = true;
drivers/gpu/drm/amd/display/dc/dcn316/dcn316_resource.c +1 -1
@@ -1770,7 +1770,7 @@ static bool dcn316_resource_construct( dc->caps.post_blend_color_processing = true; dc->caps.force_dp_tps4_for_cp2520 = true; dc->caps.dp_hpo = true; - dc->caps.hdmi_frl_pcon_support = true; + dc->caps.dp_hdmi21_pcon_support = true; dc->caps.edp_dsc_support = true; dc->caps.extended_aux_timeout_support = true; dc->caps.dmcub_support = true;
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +1 -1
@@ -4010,7 +4010,7 @@ static bool dcn32_resource_construct( dc->caps.post_blend_color_processing = true; dc->caps.force_dp_tps4_for_cp2520 = true; dc->caps.dp_hpo = true; - dc->caps.hdmi_frl_pcon_support = true; + dc->caps.dp_hdmi21_pcon_support = true; dc->caps.edp_dsc_support = true; dc->caps.extended_aux_timeout_support = true; dc->caps.dmcub_support = true;
drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c +1 -1
@@ -2305,7 +2305,7 @@ static bool dcn321_resource_construct( dc->caps.post_blend_color_processing = true; dc->caps.force_dp_tps4_for_cp2520 = true; dc->caps.dp_hpo = true; - dc->caps.hdmi_frl_pcon_support = true; + dc->caps.dp_hdmi21_pcon_support = true; dc->caps.edp_dsc_support = true; dc->caps.extended_aux_timeout_support = true; dc->caps.dmcub_support = true;
Signature · 1 line
2.25.1
PATCH 39/40 drm/amd/display: Maintain old audio programming sequence
In reply to Rodrigo SiqueiraFrom: Alvin Lee <[email protected]>
[Description]
Program audio DTO before wall dto for audio
--- .../gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +3 -5
@@ -2171,16 +2171,14 @@ static void dce110_setup_audio_dto(if (dc->res_pool->dccg && dc->res_pool->dccg->funcs->set_audio_dtbclk_dto) {struct dtbclk_dto_params dto_params = {0 }; + dc->res_pool->dccg->funcs->set_audio_dtbclk_dto ( + dc->res_pool->dccg, &dto_params); + pipe_ctx->stream_res.audio->funcs->wall_dto_setup ( pipe_ctx->stream_res.audio, pipe_ctx->stream->signal, &audio_output.crtc_info, &audio_output.pll_info); - -/* disable audio DTBCLK DTO */ - dc->res_pool->dccg->funcs->set_audio_dtbclk_dto ( - dc->res_pool->dccg, &dto_params); - }else pipe_ctx->stream_res.audio->funcs->wall_dto_setup( pipe_ctx->stream_res.audio,
Signature · 1 line
2.25.1
PATCH 40/40 drm/amd/display: 3.2.192
In reply to Rodrigo SiqueiraFrom: Aric Cyr <[email protected]>
This DC patchset brings improvements in multiple areas. In summary, we highlight:
- Program ACP-related registers
- Fixes for DMUB, DPIA, PSR, and others
- Improvements in the pipe split
- Add SubVP code
- Add basic setup for FAMS support
- Improve BB capabilities
--- 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.191" +#define DC_VER "3.2.192"#define MAX_SURFACES 3#define MAX_PLANES 6
Signature · 1 line
2.25.1
[Public]
Hi all,
This week this patchset was tested on the following systems:
HP Envy 360, with Ryzen 5 4500U
Lenovo Thinkpad T14s Gen2, with AMD Ryzen 5 5650U
Sapphire Pulse RX5700XT
Reference AMD RX6800
Engineering board with Ryzen 9 5900H
These systems were tested on the following display types:
eDP, (1080p 60hz [4500U, 5650U, 5900H])
VGA and DVI (1680x1050 60HZ [DP to VGA/DVI, USB-C to DVI/VGA]) DP/HDMI/USB-C (1440p 170hz, 4k 60hz, 4k 144hz [Includes USB-C to DP/HDMI adapters])
MST tested with Startech MST14DP123DP and 2x 4k 60Hz displays
DSC tested with Cable Matters 101075 (DP to 3x DP), and 201375 (USB-C to 3x DP) with 3x 4k60 displays
The testing is a mix of automated and manual tests. Manual testing includes (but is not limited to):
Changing display configurations and settings
Benchmark testing
Feature testing (Freesync, etc.)
Automated testing includes (but is not limited to):
Script testing (scripts to automate some of the manual checks) IGT testing
The patchset consists of the amd-staging-drm-next branch (Head commit - 14ce34dd0d7dc6fe5b030405bac074acf402e2e1) with new patches added on top of it. This branch is used for both Ubuntu and Chrome OS testing (ChromeOS on a bi-weekly basis).
Tested on Ubuntu 22.04 and Chrome OS
Thank you,
Dan Wheeler
Sr. Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
amd.com
-----Original Message-----
From: Siqueira, Rodrigo <[email protected]>
Sent: June 30, 2022 3:13 PM
To: [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Siqueira, Rodrigo <[email protected]>; Pillai, Aurabindo <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; Li, Roman <[email protected]>; Lin, Wayne <[email protected]>; Wang, Chao-kai (Stylon) <[email protected]>; Chiu, Solomon <[email protected]>; Kotarac, Pavle <[email protected]>; Gutierrez, Agustin <[email protected]>; Zuo, Jerry <[email protected]>; Mahfooz, Hamza <[email protected]>; Wheeler, Daniel <[email protected]>
Subject: [PATCH 00/40] DC Patches Jun 30, 2022
This DC patchset is a large one that brings improvements in multiple areas. In summary, we highlight:
- Program ACP-related registers
- Fixes for DMUB, DPIA, PSR, and others
- Improvements in the pipe split
- Add SubVP code
- Add basic setup for FAMS support
- Improve BB capabilities
Thanks
Siqueira
Alan Liu (1):
drm/amd/display: Program ACP related register
Alvin Lee (5):
drm/amd/display: Add SubVP required code drm/amd/display: Change DET policy for MPO cases drm/amd/display: Make OPTC3 function accessible to other DCN drm/amd/display: Don't set dram clock change requirement for SubVP drm/amd/display: Maintain old audio programming sequence
Aric Cyr (1):
drm/amd/display: 3.2.192
Chris Park (3):
drm/amd/display: Switch to correct DTO on HDMI drm/amd/display: Indicate stream change on ODM change drm/amd/display: OVT Update on InfoFrame and Mode Management
Dmytro Laktyushkin (2):
drm/amd/display: disable timing sync b/w odm halves drm/amd/display: disable otg toggle w/a on boot
Duncan Ma (1):
drm/amd/display: Add flag to modify MST delay
Eric Bernstein (3):
drm/amd/display: Add function to set pixels per cycle drm/amd/display: Update gpuvm_max_page_table_levels IP param drm/amd/display: Fix null timing generator resource
Evgenii Krasnikov (1):
drm/amd/display: add an option to skip wait for HPD when powering on
eDP panel
Fangzhi Zuo (1):
drm/amd/display: Fix dmub soft hang for PSR 1
Hamza Mahfooz (2):
drm/amd/display: enable PCON SST support for newer ASICs drm/amd/display: rename hdmi_frl_pcon_support
Harry Wentland (1):
drm/amd/display: Move all linux includes into OS types
Jimmy Kizito (3):
drm/amd/display: Maintain consistent mode of operation during encoder
assignment
drm/amd/display: Disable TBT3 DSC work around by default. drm/amd/display: Fix uninitialized variable.
Jun Lei (1):
drm/amd/display: Extend soc BB capabilitiy
Martin Leung (2):
drm/amd/display: Prepare for new interfaces drm/amd/display: guard for virtual calling destroy_link_encoders
Meenakshikumar Somasundaram (1):
drm/amd/display: Remove configuration option for dpia hpd delay
Michael Strauss (1):
drm/amd/display: Initialize lt_settings on instantiation
Nicholas Kazlauskas (4):
drm/amd/display: Fix stream->link_enc unassigned during stream removal drm/amd/display: Guard against ddc_pin being NULL for AUX drm/amd/display: Remove incorrect ASSERT check for link_enc drm/amd/display: Guard against NULL link encoder in log hw state
Rodrigo Siqueira (6):
drm/amd/display: Add missing registers for ACP drm/amd/display: Use two pixel per container for k1/k2 div drm/amd/display: Add basic infrastructure for enabling FAMS drm/amd/display: Add SubVP control lock drm/amd/display: Add minimal pipe split transition state drm/amd/display: Fix refresh rate issue on Club 3D
Samson Tam (1):
drm/amd/display: Apply ODM 2:1 policy for single display configuration
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 +- drivers/gpu/drm/amd/display/dc/Makefile | 27 +- .../gpu/drm/amd/display/dc/basics/vector.c | 2 - .../drm/amd/display/dc/bios/bios_parser2.c | 2 - .../gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c | 6 + .../dc/clk_mgr/dcn315/dcn315_clk_mgr.c | 7 +- .../display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 2 + .../dc/clk_mgr/dcn32/dcn32_clk_mgr_smu_msg.c | 5 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 384 +++++++++- .../drm/amd/display/dc/core/dc_hw_sequencer.c | 2 - .../gpu/drm/amd/display/dc/core/dc_link_ddc.c | 2 - .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 9 +- .../drm/amd/display/dc/core/dc_link_dpia.c | 58 +- .../drm/amd/display/dc/core/dc_link_enc_cfg.c | 32 + .../gpu/drm/amd/display/dc/core/dc_resource.c | 32 +- drivers/gpu/drm/amd/display/dc/core/dc_sink.c | 2 - .../gpu/drm/amd/display/dc/core/dc_stream.c | 3 - .../gpu/drm/amd/display/dc/core/dc_surface.c | 2 - drivers/gpu/drm/amd/display/dc/dc.h | 27 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 416 +++++++++++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 4 + drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 2 + drivers/gpu/drm/amd/display/dc/dc_stream.h | 24 +- drivers/gpu/drm/amd/display/dc/dc_types.h | 5 + .../gpu/drm/amd/display/dc/dce/dce_audio.c | 13 +- drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 8 +- .../drm/amd/display/dc/dce/dce_clock_source.c | 2 - drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c | 3 - .../gpu/drm/amd/display/dc/dce/dce_i2c_sw.c | 2 - drivers/gpu/drm/amd/display/dc/dce/dce_ipp.c | 2 - .../drm/amd/display/dc/dce/dce_link_encoder.c | 3 - drivers/gpu/drm/amd/display/dc/dce/dce_opp.c | 2 - .../amd/display/dc/dce/dce_stream_encoder.c | 5 +- .../amd/display/dc/dce/dce_stream_encoder.h | 14 +- .../amd/display/dc/dce100/dce100_resource.c | 2 - .../amd/display/dc/dce110/dce110_compressor.c | 3 - .../display/dc/dce110/dce110_hw_sequencer.c | 10 +- .../display/dc/dce110/dce110_opp_regamma_v.c | 2 - .../amd/display/dc/dce110/dce110_resource.c | 2 - .../display/dc/dce110/dce110_transform_v.c | 2 - .../amd/display/dc/dce112/dce112_compressor.c | 3 - .../amd/display/dc/dce112/dce112_resource.c | 2 - .../amd/display/dc/dce120/dce120_resource.c | 2 - .../drm/amd/display/dc/dce80/dce80_resource.c | 2 - .../drm/amd/display/dc/dcn10/dcn10_hubbub.c | 2 - .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 2 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_ipp.c | 2 - .../amd/display/dc/dcn10/dcn10_link_encoder.c | 3 - .../gpu/drm/amd/display/dc/dcn10/dcn10_opp.c | 2 - .../drm/amd/display/dc/dcn10/dcn10_resource.c | 2 - .../display/dc/dcn10/dcn10_stream_encoder.c | 5 +- .../display/dc/dcn10/dcn10_stream_encoder.h | 17 +- .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 44 +- .../drm/amd/display/dc/dcn20/dcn20_resource.c | 12 +- .../display/dc/dcn20/dcn20_stream_encoder.c | 1 - .../drm/amd/display/dc/dcn21/dcn21_resource.c | 2 +- .../dc/dcn30/dcn30_dio_stream_encoder.c | 4 +- .../dc/dcn30/dcn30_dio_stream_encoder.h | 6 +- .../drm/amd/display/dc/dcn30/dcn30_hwseq.c | 22 +- .../gpu/drm/amd/display/dc/dcn30/dcn30_mpc.h | 106 ++- .../gpu/drm/amd/display/dc/dcn30/dcn30_optc.c | 5 + .../drm/amd/display/dc/dcn30/dcn30_resource.c | 172 ++++- .../drm/amd/display/dc/dcn31/dcn31_resource.c | 2 +- .../amd/display/dc/dcn315/dcn315_resource.c | 1 + .../amd/display/dc/dcn316/dcn316_resource.c | 1 + drivers/gpu/drm/amd/display/dc/dcn32/Makefile | 14 +- .../gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c | 4 + .../dc/dcn32/dcn32_dio_stream_encoder.c | 8 +- .../dc/dcn32/dcn32_dio_stream_encoder.h | 1 + .../drm/amd/display/dc/dcn32/dcn32_hwseq.c | 245 ++++++- .../drm/amd/display/dc/dcn32/dcn32_hwseq.h | 21 + .../gpu/drm/amd/display/dc/dcn32/dcn32_init.c | 12 +- .../gpu/drm/amd/display/dc/dcn32/dcn32_mpc.c | 236 +++++- .../gpu/drm/amd/display/dc/dcn32/dcn32_mpc.h | 117 ++- .../gpu/drm/amd/display/dc/dcn32/dcn32_optc.c | 2 +- .../drm/amd/display/dc/dcn32/dcn32_resource.c | 680 +++++++++++++----- .../drm/amd/display/dc/dcn32/dcn32_resource.h | 20 +- .../display/dc/dcn32/dcn32_resource_helpers.c | 260 +++++++ .../amd/display/dc/dcn321/dcn321_resource.c | 522 ++++++++++---- .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 6 + .../drm/amd/display/dc/dml/dcn30/dcn30_fpu.c | 2 + .../amd/display/dc/dml/display_mode_structs.h | 3 + .../drm/amd/display/dc/dml/display_mode_vba.c | 5 +- .../gpu/drm/amd/display/dc/gpio/gpio_base.c | 2 - .../drm/amd/display/dc/gpio/gpio_service.c | 2 - drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.c | 3 - .../gpu/drm/amd/display/dc/gpio/hw_factory.c | 2 - drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c | 2 - .../gpu/drm/amd/display/dc/inc/core_types.h | 5 +- .../gpu/drm/amd/display/dc/inc/dc_link_dp.h | 6 +- .../amd/display/dc/inc/hw/stream_encoder.h | 1 + .../gpu/drm/amd/display/dc/inc/hw_sequencer.h | 7 + .../amd/display/dc/inc/hw_sequencer_private.h | 2 + .../gpu/drm/amd/display/dc/inc/link_enc_cfg.h | 5 + .../dc/irq/dce110/irq_service_dce110.c | 2 - .../dc/irq/dce120/irq_service_dce120.c | 2 - .../display/dc/irq/dce80/irq_service_dce80.c | 2 - .../display/dc/irq/dcn10/irq_service_dcn10.c | 2 - .../gpu/drm/amd/display/dc/irq/irq_service.c | 2 - drivers/gpu/drm/amd/display/dc/os_types.h | 5 +- .../display/dc/virtual/virtual_link_encoder.c | 2 - .../dc/virtual/virtual_stream_encoder.c | 2 - .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 114 ++- .../amd/display/dmub/inc/dmub_subvp_state.h | 160 +++++ .../drm/amd/display/include/set_mode_types.h | 8 +- .../amd/display/modules/color/color_gamma.c | 3 - .../amd/display/modules/freesync/freesync.c | 2 - .../include/asic_reg/dce/dce_6_0_sh_mask.h | 2 + .../include/asic_reg/dcn/dcn_3_0_0_sh_mask.h | 2 + .../include/asic_reg/dcn/dcn_3_0_1_sh_mask.h | 2 + .../include/asic_reg/dcn/dcn_3_0_2_sh_mask.h | 2 + .../include/asic_reg/dcn/dcn_3_0_3_sh_mask.h | 2 + .../include/asic_reg/dcn/dcn_3_1_2_sh_mask.h | 2 + 113 files changed, 3502 insertions(+), 573 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c create mode 100644 drivers/gpu/drm/amd/display/dmub/inc/dmub_subvp_state.h
--
2.25.1