DC Patches April 29, 2024
Subsystems (5)
cover DC Patches April 29, 2024
This DC patchset brings improvements in multiple areas. In summary, we highlight:
- Disable seamless boot on 128b/132b encoding
- Change ASSR disable sequence to avoid corruption
- Fix few IPS problems
- Enable Replay for DCN315
- Fix few ODM problems
- Fix FEC_READY write timing
- Fix few FPO problems
- Adjust DML21 gpuvm_enable assignment
- Fix divide by 0 error in VM environment
- Fix few DCN35 problems
- Fix flickering on DCN321
- Fix mst resume problem
- Fix multi-disp FAMS problem
- Refactor Replay
- Update some of the dcn303 parameters
- Enable legacy fast update for dcn301
- Add VCO parameter for DCN31 FPU
- Have cursor and surface updates together
- Fix problems reported by Coverity
---
Alex Hung (9):
drm/amd/display: Check index msg_id before read or write drm/amd/display: Check pipe offset before setting vblank drm/amd/display: Skip finding free audio for unknown engine_id drm/amd/display: Do not return negative stream id for array drm/amd/display: ASSERT when failing to find index by plane/stream id drm/amd/display: Remove redundant include file drm/amd/display: Fix uninitialized variables in DM drm/amd/display: Fix uninitialized variables in DC drm/amd/display: Fix uninitialized variables in DC
Alvin Lee (3):
drm/amd/display: Only program P-State force if pipe config changed drm/amd/display: Assign linear_pitch_alignment even for VM drm/amd/display: For FPO + Vactive check that all pipes support VA
Aric Cyr (1):
drm/amd/display: 3.2.283
Daniel Miess (1):
drm/amd/display: Enable RCO for PHYSYMCLK in DCN35
Dennis Chan (1):
drm/amd/display: Refactor for Replay Link off frame count
Harry Wentland (2):
drm/amd/display: Do cursor programming with rest of pipe drm/amd/display: Always use legacy way of setting cursor on DCE
Hersen Wu (2):
drm/amd/display: Add NULL pointer check for kzalloc drm/amd/display: Fix overlapping copy within dml_core_mode_programming
Ilya Bakoulin (1):
drm/amd/display: Fix FEC_READY write on DP LT
Iswara Nagulendran (1):
drm/amd/display: Restrict multi-disp support for in-game FAMS
Joan Lee (1):
drm/amd/display: Enable Replay for DCN315
Leo Ma (1):
drm/amd/display: Fix DC mode screen flickering on DCN321
Nevenko Stupar (1):
drm/amd/display: gpuvm handling in DML21
Nicholas Kazlauskas (2):
drm/amd/display: Add trigger FIFO resync path for DCN35 drm/amd/display: Notify idle link detection through shared state
Revalla Hari Krishna (1):
drm/amd/display: Refactor HUBBUB into component folder
Rodrigo Siqueira (10):
drm/amd/display: Improve registers write drm/amd/display: Add missing SMU version drm/amd/display: Adjust codestyle for dcn31 and hdcp_msg drm/amd/display: Add VCO speed parameter for DCN31 FPU drm/amd/display: Adjust functions prefix for some of the dcn301 fpu
functions
drm/amd/display: Enable legacy fast update for dcn301 drm/amd/display: Update some of the dcn303 parameters drm/amd/display: Remove legacy code in DC drm/amd/display: Add log_color_state callback to multiple DCNs drm/amd/display: Handle the case which quad_part is equal 0
Roman Li (2):
drm/amd/display: Re-enable IPS2 for static screen drm/amd/display: Add periodic detection for IPS
Sung Joon Kim (1):
drm/amd/display: Disable seamless boot on 128b/132b encoding
Swapnil Patel (1):
drm/amd/display: Change ASSR disable sequence
Wayne Lin (2):
drm/amd/display: Remove unnecessary files drm/amd/display: Defer handling mst up request in resume
Webb Chen (1):
drm/amd/display: Revert "dc: Keep VBios pixel rate div setting util
next mode set"
Wenjing Liu (2):
drm/amd/display: take ODM slice count into account when deciding DSC
slice
drm/amd/display: use even ODM slice width for two pixels per container
drivers/gpu/drm/amd/display/Makefile | 1 +
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 105 ++++++++++++++++--
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 9 ++
.../amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 59 +++++++++-
.../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 4 +-
.../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 5 +-
.../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 4 +-
.../amd/display/amdgpu_dm/amdgpu_dm_plane.h | 3 +
.../drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 28 +++++
.../drm/amd/display/amdgpu_dm/amdgpu_dm_psr.h | 1 +
drivers/gpu/drm/amd/display/dc/Makefile | 2 +-
.../drm/amd/display/dc/bios/command_table.c | 2 +-
.../drm/amd/display/dc/bios/command_table2.c | 2 +-
.../display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c | 8 ++
.../display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 23 +++-
drivers/gpu/drm/amd/display/dc/core/dc.c | 13 ++-
.../gpu/drm/amd/display/dc/core/dc_resource.c | 24 +++-
.../gpu/drm/amd/display/dc/core/dc_stream.c | 14 +--
.../drm/amd/display/dc/core/dc_vm_helper.c | 1 +
drivers/gpu/drm/amd/display/dc/dc.h | 11 +-
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 30 +++++
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 10 ++
drivers/gpu/drm/amd/display/dc/dc_stream.h | 12 ++
drivers/gpu/drm/amd/display/dc/dc_types.h | 2 +-
.../dc/dce110/dce110_timing_generator.c | 18 +++
.../dc/dce110/dce110_timing_generator.h | 2 +
.../dc/dce110/dce110_timing_generator_v.c | 3 +-
.../dc/dce120/dce120_timing_generator.c | 1 +
.../display/dc/dce80/dce80_timing_generator.c | 1 +
drivers/gpu/drm/amd/display/dc/dcn10/Makefile | 2 +-
.../dc/dcn10/dcn10_hw_sequencer_debug.c | 2 +-
drivers/gpu/drm/amd/display/dc/dcn20/Makefile | 2 +-
.../gpu/drm/amd/display/dc/dcn201/Makefile | 3 +-
drivers/gpu/drm/amd/display/dc/dcn21/Makefile | 2 +-
drivers/gpu/drm/amd/display/dc/dcn30/Makefile | 3 +-
.../gpu/drm/amd/display/dc/dcn30/dcn30_mpc.c | 2 +-
.../gpu/drm/amd/display/dc/dcn301/Makefile | 2 +-
drivers/gpu/drm/amd/display/dc/dcn31/Makefile | 2 +-
.../drm/amd/display/dc/dcn314/dcn314_dccg.c | 12 +-
drivers/gpu/drm/amd/display/dc/dcn32/Makefile | 2 +-
.../gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c | 12 +-
.../dc/dcn32/dcn32_dio_stream_encoder.c | 40 ++++++-
.../display/dc/dcn32/dcn32_resource_helpers.c | 6 +-
drivers/gpu/drm/amd/display/dc/dcn35/Makefile | 2 +-
.../gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c | 63 +++--------
.../dc/dcn35/dcn35_dio_stream_encoder.c | 36 +++++-
drivers/gpu/drm/amd/display/dc/dm_pp_smu.h | 3 +-
.../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 4 +-
.../drm/amd/display/dc/dml/dcn30/dcn30_fpu.c | 2 +-
.../amd/display/dc/dml/dcn301/dcn301_fpu.c | 4 +-
.../amd/display/dc/dml/dcn301/dcn301_fpu.h | 7 +-
.../drm/amd/display/dc/dml/dcn31/dcn31_fpu.c | 22 +---
.../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 22 +++-
.../drm/amd/display/dc/dml/dcn32/dcn32_fpu.h | 2 +-
.../dc/dml/dcn32/display_mode_vba_util_32.c | 4 +-
.../amd/display/dc/dml2/display_mode_core.c | 4 +-
.../dc/dml2/dml21/dml21_translation_helper.c | 2 +-
.../display/dc/dml2/dml2_dc_resource_mgmt.c | 8 +-
.../display/dc/dml2/dml2_translation_helper.c | 6 +-
.../drm/amd/display/dc/dml2/dml2_wrapper.h | 1 +
.../amd/display/dc/dpp/dcn10/CMakeLists.txt | 6 -
.../amd/display/dc/dpp/dcn10/dcn10_dpp_cm.c | 5 +-
.../amd/display/dc/dpp/dcn20/CMakeLists.txt | 5 -
.../amd/display/dc/dpp/dcn20/dcn20_dpp_cm.c | 2 +-
.../amd/display/dc/dpp/dcn201/CMakeLists.txt | 4 -
.../amd/display/dc/dpp/dcn30/CMakeLists.txt | 5 -
.../amd/display/dc/dpp/dcn30/dcn30_dpp_cm.c | 2 +-
.../amd/display/dc/dpp/dcn32/CMakeLists.txt | 4 -
.../amd/display/dc/dpp/dcn35/CMakeLists.txt | 4 -
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 30 +++--
.../drm/amd/display/dc/gpio/gpio_service.c | 6 +-
.../gpu/drm/amd/display/dc/hdcp/hdcp_msg.c | 2 +-
.../gpu/drm/amd/display/dc/hubbub/Makefile | 100 +++++++++++++++++
.../dc/{ => hubbub}/dcn10/dcn10_hubbub.c | 2 +-
.../dc/{ => hubbub}/dcn10/dcn10_hubbub.h | 0
.../dc/{ => hubbub}/dcn20/dcn20_hubbub.c | 0
.../dc/{ => hubbub}/dcn20/dcn20_hubbub.h | 2 +-
.../dc/{ => hubbub}/dcn201/dcn201_hubbub.c | 0
.../dc/{ => hubbub}/dcn201/dcn201_hubbub.h | 0
.../dc/{ => hubbub}/dcn21/dcn21_hubbub.c | 0
.../dc/{ => hubbub}/dcn21/dcn21_hubbub.h | 0
.../dc/{ => hubbub}/dcn30/dcn30_hubbub.c | 0
.../dc/{ => hubbub}/dcn30/dcn30_hubbub.h | 0
.../dc/{ => hubbub}/dcn301/dcn301_hubbub.c | 0
.../dc/{ => hubbub}/dcn301/dcn301_hubbub.h | 0
.../dc/{ => hubbub}/dcn31/dcn31_hubbub.c | 0
.../dc/{ => hubbub}/dcn31/dcn31_hubbub.h | 0
.../dc/{ => hubbub}/dcn32/dcn32_hubbub.c | 0
.../dc/{ => hubbub}/dcn32/dcn32_hubbub.h | 0
.../dc/{ => hubbub}/dcn35/dcn35_hubbub.c | 0
.../dc/{ => hubbub}/dcn35/dcn35_hubbub.h | 0
drivers/gpu/drm/amd/display/dc/hwss/Makefile | 6 -
.../amd/display/dc/hwss/dce110/dce110_hwseq.c | 28 +----
.../amd/display/dc/hwss/dcn10/dcn10_hwseq.c | 6 +-
.../amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 42 ++++---
.../amd/display/dc/hwss/dcn201/dcn201_hwseq.c | 7 +-
.../amd/display/dc/hwss/dcn21/dcn21_hwseq.c | 2 +-
.../amd/display/dc/hwss/dcn21/dcn21_init.c | 1 +
.../amd/display/dc/hwss/dcn30/dcn30_hwseq.h | 2 +-
.../amd/display/dc/hwss/dcn30/dcn30_init.c | 1 +
.../amd/display/dc/hwss/dcn301/dcn301_init.c | 4 +-
.../amd/display/dc/hwss/dcn31/dcn31_hwseq.c | 2 +-
.../amd/display/dc/hwss/dcn31/dcn31_init.c | 1 +
.../amd/display/dc/hwss/dcn314/dcn314_hwseq.c | 29 +----
.../amd/display/dc/hwss/dcn314/dcn314_hwseq.h | 4 -
.../amd/display/dc/hwss/dcn314/dcn314_init.c | 2 +-
.../amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 68 +++++-------
.../amd/display/dc/hwss/dcn32/dcn32_hwseq.h | 4 -
.../amd/display/dc/hwss/dcn32/dcn32_init.c | 1 -
.../amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 34 +++++-
.../amd/display/dc/hwss/dcn35/dcn35_hwseq.h | 2 +
.../amd/display/dc/hwss/dcn35/dcn35_init.c | 4 +-
.../amd/display/dc/hwss/dcn351/dcn351_init.c | 2 +-
.../display/dc/hwss/hw_sequencer_private.h | 7 +-
.../gpu/drm/amd/display/dc/inc/core_types.h | 7 --
drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h | 5 -
drivers/gpu/drm/amd/display/dc/inc/hw/optc.h | 4 +-
.../amd/display/dc/inc/hw/stream_encoder.h | 1 -
.../amd/display/dc/inc/hw/timing_generator.h | 1 +
.../dc/irq/dce110/irq_service_dce110.c | 8 +-
.../drm/amd/display/dc/link/link_detection.c | 4 +-
.../gpu/drm/amd/display/dc/link/link_dpms.c | 11 +-
.../dc/link/protocols/link_dp_capability.c | 16 +--
.../dc/link/protocols/link_dp_irq_handler.c | 10 +-
.../display/dc/link/protocols/link_dp_phy.c | 14 +--
.../dc/link/protocols/link_dp_training.c | 2 +-
.../link/protocols/link_edp_panel_control.c | 4 +-
.../amd/display/dc/link/protocols/link_hpd.c | 2 +-
.../amd/display/dc/optc/dcn10/dcn10_optc.c | 46 ++++----
.../amd/display/dc/optc/dcn20/dcn20_optc.c | 10 +-
.../amd/display/dc/optc/dcn20/dcn20_optc.h | 1 -
.../amd/display/dc/optc/dcn201/dcn201_optc.c | 7 +-
.../amd/display/dc/optc/dcn201/dcn201_optc.h | 3 -
.../amd/display/dc/optc/dcn30/dcn30_optc.c | 3 +-
.../amd/display/dc/optc/dcn301/dcn301_optc.c | 1 +
.../amd/display/dc/optc/dcn31/dcn31_optc.c | 1 +
.../amd/display/dc/optc/dcn314/dcn314_optc.c | 3 +-
.../amd/display/dc/optc/dcn32/dcn32_optc.c | 3 +-
.../amd/display/dc/optc/dcn35/dcn35_optc.c | 1 +
.../amd/display/dc/optc/dcn401/dcn401_optc.c | 15 ++-
drivers/gpu/drm/amd/display/dc/os_types.h | 2 -
.../display/dc/resource/dce80/CMakeLists.txt | 4 -
.../dc/resource/dcn20/dcn20_resource.c | 2 +-
.../dc/resource/dcn30/dcn30_resource.c | 5 +-
.../dc/resource/dcn301/dcn301_resource.c | 20 +++-
.../dc/resource/dcn303/dcn303_resource.c | 13 ++-
.../dc/resource/dcn31/dcn31_resource.c | 5 +
.../dc/resource/dcn314/dcn314_resource.c | 5 +
.../dc/resource/dcn315/dcn315_resource.c | 14 +++
.../dc/resource/dcn316/dcn316_resource.c | 2 +
.../dc/resource/dcn32/dcn32_resource.c | 5 +
.../dc/resource/dcn321/dcn321_resource.c | 2 +
.../dc/resource/dcn35/dcn35_resource.c | 2 +
.../dc/resource/dcn351/dcn351_resource.c | 2 +
drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 1 +
.../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 15 ++-
.../gpu/drm/amd/display/dmub/src/dmub_srv.c | 2 +
.../gpu/drm/amd/display/include/dal_types.h | 1 -
.../drm/amd/display/modules/hdcp/hdcp_ddc.c | 8 ++
.../amd/display/modules/power/power_helpers.c | 8 +-
160 files changed, 952 insertions(+), 469 deletions(-)
delete mode 100644 drivers/gpu/drm/amd/display/dc/dpp/dcn10/CMakeLists.txt
delete mode 100644 drivers/gpu/drm/amd/display/dc/dpp/dcn20/CMakeLists.txt
delete mode 100644 drivers/gpu/drm/amd/display/dc/dpp/dcn201/CMakeLists.txt
delete mode 100644 drivers/gpu/drm/amd/display/dc/dpp/dcn30/CMakeLists.txt
delete mode 100644 drivers/gpu/drm/amd/display/dc/dpp/dcn32/CMakeLists.txt
delete mode 100644 drivers/gpu/drm/amd/display/dc/dpp/dcn35/CMakeLists.txt
create mode 100644 drivers/gpu/drm/amd/display/dc/hubbub/Makefile
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn10/dcn10_hubbub.c (99%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn10/dcn10_hubbub.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn20/dcn20_hubbub.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn20/dcn20_hubbub.h (99%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn201/dcn201_hubbub.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn201/dcn201_hubbub.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn21/dcn21_hubbub.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn21/dcn21_hubbub.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn30/dcn30_hubbub.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn30/dcn30_hubbub.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn301/dcn301_hubbub.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn301/dcn301_hubbub.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn31/dcn31_hubbub.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn31/dcn31_hubbub.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn32/dcn32_hubbub.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn32/dcn32_hubbub.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn35/dcn35_hubbub.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn35/dcn35_hubbub.h (100%)
delete mode 100644 drivers/gpu/drm/amd/display/dc/resource/dce80/CMakeLists.txtSignature · 1 line
2.37.3
PATCH 1/46 drm/amd/display: Do cursor programming with rest of pipe
From: Harry Wentland <[email protected]>
Cursors are always programmed independently of updates on other planes. When atomic commits program cursor and surface updates together the cursor update might be locked out by the surface update and not take effect.
To combat this program cursor and surface updates together via dc_update_planes_and_stream to ensure they can be applied atomically.
When cursor updates come on their own use the old method to program the cursor as dc_update_planes_and_stream isn't handling this case correctly (yet), leading to a flickering screen.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 79 ++++++++++++++++++- .../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 4 +- .../amd/display/amdgpu_dm/amdgpu_dm_plane.h | 3 + drivers/gpu/drm/amd/display/dc/core/dc.c | 5 ++ .../gpu/drm/amd/display/dc/core/dc_stream.c | 14 ++-- drivers/gpu/drm/amd/display/dc/dc_stream.h | 12 +++ 6 files changed, 105 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +77 -2
@@ -8365,6 +8365,77 @@ static inline uint32_t get_mem_type(struct drm_framebuffer *fb)return abo->tbo.resource ? abo->tbo.resource->mem_type :0 ; } +static void amdgpu_dm_update_cursor (struct drm_plane *plane, +struct drm_plane_state *old_plane_state, +struct dc_stream_update *update) +{ +struct amdgpu_device *adev =drm_to_adev (plane->dev); +struct amdgpu_framebuffer *afb =to_amdgpu_framebuffer (plane->state->fb); +struct drm_crtc *crtc = afb ? plane->state->crtc : old_plane_state->crtc; +struct dm_crtc_state *crtc_state = crtc ?to_dm_crtc_state (crtc->state) :NULL ; +struct amdgpu_crtc *amdgpu_crtc =to_amdgpu_crtc (crtc); +uint64_t address = afb ? afb->address :0 ; +struct dc_cursor_position position = {0 }; +struct dc_cursor_attributes attributes; +int ret; + +if (!plane->state->fb && !old_plane_state->fb) +return ; + +drm_dbg_atomic (plane->dev,"crtc_id=%d with size %d to %d\n" , + amdgpu_crtc->crtc_id, plane->state->crtc_w, + plane->state->crtc_h); + + ret =amdgpu_dm_plane_get_cursor_position (plane, crtc, &position); +if (ret) +return ; + +if (!position.enable) { +/* turn off cursor */ +if (crtc_state && crtc_state->stream) { +dc_stream_set_cursor_position (crtc_state->stream, + &position); + update->cursor_position = &crtc_state->stream->cursor_position; + } +return ; + } + + amdgpu_crtc->cursor_width = plane->state->crtc_w; + amdgpu_crtc->cursor_height = plane->state->crtc_h; + +memset (&attributes,0 ,sizeof (attributes)); + attributes.address.high_part =upper_32_bits (address); + attributes.address.low_part =lower_32_bits (address); + attributes.width = plane->state->crtc_w; + attributes.height = plane->state->crtc_h; + attributes.color_format =CURSOR_MODE_COLOR_PRE_MULTIPLIED_ALPHA ; + attributes.rotation_angle =0 ; + attributes.attribute_flags.value =0 ; + +/* Enable cursor degamma ROM on DCN3+ for implicit sRGB degamma in DRM +* legacy gamma setup. +*/ +if (crtc_state->cm_is_degamma_srgb && + adev->dm.dc->caps.color.dpp.gamma_corr) + attributes.attribute_flags.bits.ENABLE_CURSOR_DEGAMMA =1 ; + + attributes.pitch = afb->base.pitches[0 ] / afb->base.format->cpp[0 ]; + +if (crtc_state->stream) { +if (!dc_stream_set_cursor_attributes (crtc_state->stream, + &attributes)) +DRM_ERROR ("DC failed to set cursor attributes\n" ); + + update->cursor_attributes = &crtc_state->stream->cursor_attributes; + +if (!dc_stream_set_cursor_position (crtc_state->stream, + &position)) +DRM_ERROR ("DC failed to set cursor position\n" ); + + update->cursor_position = &crtc_state->stream->cursor_position; + } +} + static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, struct drm_device *dev, struct amdgpu_display_manager *dm,
@@ -8388,6 +8459,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,bool cursor_update = false;bool pflip_present = false;bool dirty_rects_changed = false; +bool updated_planes_and_streams = false;struct {struct dc_surface_update surface_updates[MAX_SURFACES ];struct dc_plane_info plane_infos[MAX_SURFACES ];
@@ -8424,8 +8496,10 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,/* Cursor plane is handled after stream updates */ if (plane->type ==DRM_PLANE_TYPE_CURSOR ) {if ((fb && crtc == pcrtc) || - (old_plane_state->fb && old_plane_state->crtc == pcrtc)) + (old_plane_state->fb && old_plane_state->crtc == pcrtc)) { cursor_update = true; +amdgpu_dm_update_cursor (plane, old_plane_state, &bundle->stream_update); + }continue ; }
@@ -8698,6 +8772,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, acrtc_state->stream, &bundle->stream_update, bundle->surface_updates); + updated_planes_and_streams = true;/** * Enable or disable the interrupts on the backend.
@@ -8775,7 +8850,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,* This avoids redundant programming in the case where we're going * to be disabling a single plane - those pipes are being disabled. */ -if (acrtc_state->active_planes) +if (acrtc_state->active_planes && !updated_planes_and_streams)amdgpu_dm_commit_cursors (state); cleanup:
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +2 -2
@@ -1197,8 +1197,8 @@ static int amdgpu_dm_plane_atomic_async_check(struct drm_plane *plane,return 0 ; } -static int amdgpu_dm_plane_get_cursor_position (struct drm_plane *plane,struct drm_crtc *crtc, -struct dc_cursor_position *position) +int amdgpu_dm_plane_get_cursor_position (struct drm_plane *plane,struct drm_crtc *crtc, +struct dc_cursor_position *position) {struct amdgpu_crtc *amdgpu_crtc =to_amdgpu_crtc (crtc);int x, y;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.h +3 -0
@@ -29,6 +29,9 @@#include "dc.h" +int amdgpu_dm_plane_get_cursor_position (struct drm_plane *plane,struct drm_crtc *crtc, +struct dc_cursor_position *position); +void amdgpu_dm_plane_handle_cursor_update (struct drm_plane *plane,struct drm_plane_state *old_plane_state);
drivers/gpu/drm/amd/display/dc/core/dc.c +5 -0
@@ -3340,6 +3340,11 @@ static void commit_planes_do_stream_update(struct dc *dc, } } +if (stream_update->cursor_attributes) +program_cursor_attributes (dc, stream); + +if (stream_update->cursor_position) +program_cursor_position (dc, stream);/* Full fe update*/ if (update_type ==UPDATE_TYPE_FAST )
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +6 -8
@@ -219,10 +219,9 @@ struct dc_stream_status *dc_stream_get_status(return dc_state_get_stream_status (dc->current_state, stream); } -static void program_cursor_attributes ( +void program_cursor_attributes (struct dc *dc, -struct dc_stream_state *stream, -const struct dc_cursor_attributes *attributes) +struct dc_stream_state *stream) {int i;struct resource_context *res_ctx;
@@ -318,7 +317,7 @@ bool dc_stream_program_cursor_attributes( reset_idle_optimizations = true; } -program_cursor_attributes (dc, stream, attributes); +program_cursor_attributes (dc, stream);/* re-enable idle optimizations if necessary */ if (reset_idle_optimizations && !dc->debug.disable_dmub_reallow_idle)
@@ -330,10 +329,9 @@ bool dc_stream_program_cursor_attributes(return false; } -static void program_cursor_position ( +void program_cursor_position (struct dc *dc, -struct dc_stream_state *stream, -const struct dc_cursor_position *position) +struct dc_stream_state *stream) {int i;struct resource_context *res_ctx;
@@ -410,7 +408,7 @@ bool dc_stream_program_cursor_position( reset_idle_optimizations = true; } -program_cursor_position (dc, stream, position); +program_cursor_position (dc, stream);/* re-enable idle optimizations if necessary */ if (reset_idle_optimizations && !dc->debug.disable_dmub_reallow_idle)dc_allow_idle_optimizations (dc, true);
drivers/gpu/drm/amd/display/dc/dc_stream.h +12 -0
@@ -341,6 +341,9 @@ struct dc_stream_update {struct test_pattern *pending_test_pattern;struct dc_crtc_timing_adjust *crtc_timing_adjust; + +struct dc_cursor_attributes *cursor_attributes; +struct dc_cursor_position *cursor_position; }; bool dc_is_stream_unchanged(
@@ -480,6 +483,15 @@ struct dc_stream_status *dc_stream_get_status(* Cursor interfaces - To manages the cursor within a stream ******************************************************************************/ /* TODO: Deprecated once we switch to dc_set_cursor_position */ + +void program_cursor_attributes ( +struct dc *dc, +struct dc_stream_state *stream); + +void program_cursor_position ( +struct dc *dc, +struct dc_stream_state *stream); +bool dc_stream_set_cursor_attributes (struct dc_stream_state *stream,const struct dc_cursor_attributes *attributes);
Signature · 1 line
2.37.3
PATCH 2/46 drm/amd/display: Always use legacy way of setting cursor on DCE
In reply to Wayne LinFrom: Harry Wentland <[email protected]>
Some IGT tests fail with the new atomic cursor updates when running on older DCE-based ASICs. To work around these issues keep calling the amdgpu_dm_commit_cursors for each cursor update on DCE, even if those cursor updates coincide with other plane updates.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -2
@@ -8498,7 +8498,8 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,if ((fb && crtc == pcrtc) || (old_plane_state->fb && old_plane_state->crtc == pcrtc)) { cursor_update = true; -amdgpu_dm_update_cursor (plane, old_plane_state, &bundle->stream_update); +if (amdgpu_ip_version (dm->adev,DCE_HWIP ,0 ) !=0 ) +amdgpu_dm_update_cursor (plane, old_plane_state, &bundle->stream_update); }continue ;
@@ -8850,7 +8851,8 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,* This avoids redundant programming in the case where we're going * to be disabling a single plane - those pipes are being disabled. */ -if (acrtc_state->active_planes && !updated_planes_and_streams) +if (acrtc_state->active_planes && + (!updated_planes_and_streams ||amdgpu_ip_version (dm->adev,DCE_HWIP ,0 ) ==0 ))amdgpu_dm_commit_cursors (state); cleanup:
Signature · 1 line
2.37.3
PATCH 3/46 drm/amd/display: Add NULL pointer check for kzalloc
In reply to Wayne LinFrom: Hersen Wu <[email protected]>
[Why & How]
Check return pointer of kzalloc before using it.
--- .../gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c | 8 ++++++++ .../gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 8 ++++++++ .../drm/amd/display/dc/resource/dcn30/dcn30_resource.c | 3 +++ .../drm/amd/display/dc/resource/dcn31/dcn31_resource.c | 5 +++++ .../drm/amd/display/dc/resource/dcn314/dcn314_resource.c | 5 +++++ .../drm/amd/display/dc/resource/dcn315/dcn315_resource.c | 2 ++ .../drm/amd/display/dc/resource/dcn316/dcn316_resource.c | 2 ++ .../drm/amd/display/dc/resource/dcn32/dcn32_resource.c | 5 +++++ .../drm/amd/display/dc/resource/dcn321/dcn321_resource.c | 2 ++ .../drm/amd/display/dc/resource/dcn35/dcn35_resource.c | 2 ++ .../drm/amd/display/dc/resource/dcn351/dcn351_resource.c | 2 ++ 11 files changed, 44 insertions(+)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c +8 -0
@@ -560,11 +560,19 @@ void dcn3_clk_mgr_construct(dce_clock_read_ss_info (clk_mgr); clk_mgr->base.bw_params =kzalloc (sizeof (*clk_mgr->base.bw_params),GFP_KERNEL ); +if (!clk_mgr->base.bw_params) { +BREAK_TO_DEBUGGER (); +return ; + }/* need physical address of table to give to PMFW */ clk_mgr->wm_range_table =dm_helpers_allocate_gpu_mem (clk_mgr->base.ctx,DC_MEM_ALLOC_TYPE_GART ,sizeof (WatermarksExternal_t), &clk_mgr->wm_range_table_addr); +if (!clk_mgr->wm_range_table) { +BREAK_TO_DEBUGGER (); +return ; + } }void dcn3_clk_mgr_destroy (struct clk_mgr_internal *clk_mgr)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c +8 -0
@@ -1199,11 +1199,19 @@ void dcn32_clk_mgr_construct( clk_mgr->smu_present = false; clk_mgr->base.bw_params =kzalloc (sizeof (*clk_mgr->base.bw_params),GFP_KERNEL ); +if (!clk_mgr->base.bw_params) { +BREAK_TO_DEBUGGER (); +return ; + }/* need physical address of table to give to PMFW */ clk_mgr->wm_range_table =dm_helpers_allocate_gpu_mem (clk_mgr->base.ctx,DC_MEM_ALLOC_TYPE_GART ,sizeof (WatermarksExternal_t), &clk_mgr->wm_range_table_addr); +if (!clk_mgr->wm_range_table) { +BREAK_TO_DEBUGGER (); +return ; + } }void dcn32_clk_mgr_destroy (struct clk_mgr_internal *clk_mgr)
drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c +3 -0
@@ -2050,6 +2050,9 @@ bool dcn30_validate_bandwidth(struct dc *dc,BW_VAL_TRACE_COUNT (); +if (!pipes) + goto validate_fail; +DC_FP_START (); out =dcn30_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, fast_validate, true);DC_FP_END ();
drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c +5 -0
@@ -1310,6 +1310,8 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create(/* allocate HPO link encoder */ hpo_dp_enc31 =kzalloc (sizeof (struct dcn31_hpo_dp_link_encoder ),GFP_KERNEL ); +if (!hpo_dp_enc31) +return NULL ;/* out of memory */ hpo_dp_link_encoder31_construct(hpo_dp_enc31, ctx, inst, &hpo_dp_link_enc_regs[inst],
@@ -1766,6 +1768,9 @@ bool dcn31_validate_bandwidth(struct dc *dc,BW_VAL_TRACE_COUNT (); +if (!pipes) + goto validate_fail; +DC_FP_START (); out =dcn30_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, fast_validate, true);DC_FP_END ();
drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.c +5 -0
@@ -1367,6 +1367,8 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create(/* allocate HPO link encoder */ hpo_dp_enc31 =kzalloc (sizeof (struct dcn31_hpo_dp_link_encoder ),GFP_KERNEL ); +if (!hpo_dp_enc31) +return NULL ;/* out of memory */ hpo_dp_link_encoder31_construct(hpo_dp_enc31, ctx, inst, &hpo_dp_link_enc_regs[inst],
@@ -1727,6 +1729,9 @@ bool dcn314_validate_bandwidth(struct dc *dc,BW_VAL_TRACE_COUNT (); +if (!pipes) + goto validate_fail; +if (filter_modes_for_single_channel_workaround (dc, context)) goto validate_fail;
drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c +2 -0
@@ -1309,6 +1309,8 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create(/* allocate HPO link encoder */ hpo_dp_enc31 =kzalloc (sizeof (struct dcn31_hpo_dp_link_encoder ),GFP_KERNEL ); +if (!hpo_dp_enc31) +return NULL ;/* out of memory */ hpo_dp_link_encoder31_construct(hpo_dp_enc31, ctx, inst, &hpo_dp_link_enc_regs[inst],
drivers/gpu/drm/amd/display/dc/resource/dcn316/dcn316_resource.c +2 -0
@@ -1305,6 +1305,8 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create(/* allocate HPO link encoder */ hpo_dp_enc31 =kzalloc (sizeof (struct dcn31_hpo_dp_link_encoder ),GFP_KERNEL ); +if (!hpo_dp_enc31) +return NULL ;/* out of memory */ hpo_dp_link_encoder31_construct(hpo_dp_enc31, ctx, inst, &hpo_dp_link_enc_regs[inst],
drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c +5 -0
@@ -1305,6 +1305,8 @@ static struct hpo_dp_link_encoder *dcn32_hpo_dp_link_encoder_create(/* allocate HPO link encoder */ hpo_dp_enc31 =kzalloc (sizeof (struct dcn31_hpo_dp_link_encoder ),GFP_KERNEL ); +if (!hpo_dp_enc31) +return NULL ;/* out of memory */ #undef REG_STRUCT#define REG_STRUCT hpo_dp_link_enc_regs
@@ -1752,6 +1754,9 @@ static bool dml1_validate(struct dc *dc, struct dc_state *context, bool fast_valBW_VAL_TRACE_COUNT (); +if (!pipes) + goto validate_fail; +DC_FP_START (); out =dcn32_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, fast_validate);DC_FP_END ();
drivers/gpu/drm/amd/display/dc/resource/dcn321/dcn321_resource.c +2 -0
@@ -1288,6 +1288,8 @@ static struct hpo_dp_link_encoder *dcn321_hpo_dp_link_encoder_create(/* allocate HPO link encoder */ hpo_dp_enc31 =kzalloc (sizeof (struct dcn31_hpo_dp_link_encoder ),GFP_KERNEL ); +if (!hpo_dp_enc31) +return NULL ;/* out of memory */ #undef REG_STRUCT#define REG_STRUCT hpo_dp_link_enc_regs
drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c +2 -0
@@ -1368,6 +1368,8 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create(/* allocate HPO link encoder */ hpo_dp_enc31 =kzalloc (sizeof (struct dcn31_hpo_dp_link_encoder ),GFP_KERNEL ); +if (!hpo_dp_enc31) +return NULL ;/* out of memory */ #undef REG_STRUCT#define REG_STRUCT hpo_dp_link_enc_regs
drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c +2 -0
@@ -1348,6 +1348,8 @@ static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create(/* allocate HPO link encoder */ hpo_dp_enc31 =kzalloc (sizeof (struct dcn31_hpo_dp_link_encoder ),GFP_KERNEL ); +if (!hpo_dp_enc31) +return NULL ;/* out of memory */ #undef REG_STRUCT#define REG_STRUCT hpo_dp_link_enc_regs
Signature · 1 line
2.37.3
PATCH 4/46 drm/amd/display: Check index msg_id before read or write
In reply to Wayne LinFrom: Alex Hung <[email protected]>
[WHAT]msg_id is used as an array index and it cannot be a negative value, and therefore cannot be equal to MOD_HDCP_MESSAGE_ID_INVALID (-1).
[HOW]
Check whether msg_id is valid before reading and setting.
This fixes 4 OVERRUN issues reported by Coverity.
--- drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c +8 -0
@@ -156,6 +156,10 @@ static enum mod_hdcp_status read(struct mod_hdcp *hdcp,uint32_t cur_size =0 ;uint32_t data_offset =0 ; +if (msg_id ==MOD_HDCP_MESSAGE_ID_INVALID ) { +return MOD_HDCP_STATUS_DDC_FAILURE ; + } +if (is_dp_hdcp (hdcp)) {while (buf_len >0 ) { cur_size =MIN (buf_len,HDCP_MAX_AUX_TRANSACTION_SIZE );
@@ -215,6 +219,10 @@ static enum mod_hdcp_status write(struct mod_hdcp *hdcp,uint32_t cur_size =0 ;uint32_t data_offset =0 ; +if (msg_id ==MOD_HDCP_MESSAGE_ID_INVALID ) { +return MOD_HDCP_STATUS_DDC_FAILURE ; + } +if (is_dp_hdcp (hdcp)) {while (buf_len >0 ) { cur_size =MIN (buf_len,HDCP_MAX_AUX_TRANSACTION_SIZE );
Signature · 1 line
2.37.3
PATCH 5/46 drm/amd/display: Check pipe offset before setting vblank
In reply to Wayne LinFrom: Alex Hung <[email protected]>
pipe_ctx has a size of MAX_PIPES so checking its index before accessing the array.
This fixes an OVERRUN issue reported by Coverity.
--- .../drm/amd/display/dc/irq/dce110/irq_service_dce110.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c +6 -2
@@ -211,8 +211,12 @@ bool dce110_vblank_set(struct irq_service *irq_service, info->ext_id);uint8_t pipe_offset = dal_irq_src -IRQ_TYPE_VBLANK ; -struct timing_generator *tg = - dc->current_state->res_ctx.pipe_ctx[pipe_offset].stream_res.tg; +struct timing_generator *tg; + +if (pipe_offset >=MAX_PIPES ) +return false; + + tg = dc->current_state->res_ctx.pipe_ctx[pipe_offset].stream_res.tg;if (enable) {if (!tg || !tg->funcs->arm_vert_intr (tg,2 )) {
Signature · 1 line
2.37.3
PATCH 6/46 drm/amd/display: Skip finding free audio for unknown engine_id
In reply to Wayne LinFrom: Alex Hung <[email protected]>
[WHY]ENGINE_ID_UNKNOWN = -1 and can not be used as an array index. Plus, it also means it is uninitialized and does not need free audio.
[HOW]
Skip and return NULL.
This fixes 2 OVERRUN issues reported by Coverity.
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +3 -0
@@ -3230,6 +3230,9 @@ static struct audio *find_first_free_audio( {int i, available_audio_count; +if (id ==ENGINE_ID_UNKNOWN ) +return NULL ; + available_audio_count = pool->audio_count;for (i =0 ; i < available_audio_count; i++) {
Signature · 1 line
2.37.3
PATCH 7/46 drm/amd/display: Fix overlapping copy within dml_core_mode_programming
In reply to Wayne LinFrom: Hersen Wu <[email protected]>
[WHY]&mode_lib->mp.Watermark and &locals->Watermark are the same address. memcpy may lead to unexpected behavior.
[HOW]
memmove should be used.
--- drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c +3 -1
@@ -9460,8 +9460,10 @@ void dml_core_mode_programming(struct display_mode_lib_st *mode_lib, const struc/* Copy the calculated watermarks to mp.Watermark as the getter functions are * implemented by the DML team to copy the calculated values from the mp.Watermark interface. +* &mode_lib->mp.Watermark and &locals->Watermark are the same address, memcpy may lead to +* unexpected behavior. memmove should be used. */ -memcpy (&mode_lib->mp.Watermark, CalculateWatermarks_params->Watermark,sizeof (struct Watermarks )); +memmove (&mode_lib->mp.Watermark, CalculateWatermarks_params->Watermark,sizeof (struct Watermarks ));for (k =0 ; k < mode_lib->ms.num_active_planes; ++k) {if (mode_lib->ms.cache_display_cfg.writeback.WritebackEnable[k] == true) {
Signature · 1 line
2.37.3
PATCH 8/46 drm/amd/display: Do not return negative stream id for array
In reply to Wayne LinFrom: Alex Hung <[email protected]>
[WHY]resource_stream_to_stream_idx returns an array index and it return -1 when not found; however, -1 is not a valid array index number.
[HOW]
When this happens, call ASSERT(), and return a zero instead.
This fixes an OVERRUN and an NEGATIVE_RETURNS issues reported by Coverity.
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +7 -0
@@ -2282,6 +2282,13 @@ static int resource_stream_to_stream_idx(struct dc_state *state, stream_idx = i;break ; } + +/* never return negative array index */ +if (stream_idx ==-1 ) { +ASSERT (0 ); +return 0 ; + } +return stream_idx; }
Signature · 1 line
2.37.3
PATCH 9/46 drm/amd/display: ASSERT when failing to find index by plane/stream id
In reply to Wayne LinFrom: Alex Hung <[email protected]>
[WHY]find_disp_cfg_idx_by_plane_id and find_disp_cfg_idx_by_stream_id returns an array index and they return -1 when not found; however, -1 is not a valid index number.
[HOW]
When this happens, call ASSERT(), and return a positive number (which is fewer than callers' array size) instead.
This fixes 4 OVERRUN and 2 NEGATIVE_RETURNS issues reported by Coverity.
--- drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c +4 -2
@@ -88,7 +88,8 @@ static int find_disp_cfg_idx_by_plane_id(struct dml2_dml_to_dc_pipe_mapping *mapreturn i; } -return -1 ; +ASSERT (false); +return __DML2_WRAPPER_MAX_STREAMS_PLANES__; }static int find_disp_cfg_idx_by_stream_id (struct dml2_dml_to_dc_pipe_mapping *mapping,unsigned int stream_id)
@@ -100,7 +101,8 @@ static int find_disp_cfg_idx_by_stream_id(struct dml2_dml_to_dc_pipe_mapping *mareturn i; } -return -1 ; +ASSERT (false); +return __DML2_WRAPPER_MAX_STREAMS_PLANES__; }// The master pipe of a stream is defined as the top pipe in odm slice 0
Signature · 1 line
2.37.3
PATCH 10/46 drm/amd/display: Remove unnecessary files
In reply to Wayne Lin[Why & How]
We accidentally upstream unnecessary files. Remove them.
--- drivers/gpu/drm/amd/display/dc/dpp/dcn10/CMakeLists.txt | 6 ------ drivers/gpu/drm/amd/display/dc/dpp/dcn20/CMakeLists.txt | 5 ----- drivers/gpu/drm/amd/display/dc/dpp/dcn201/CMakeLists.txt | 4 ---- drivers/gpu/drm/amd/display/dc/dpp/dcn30/CMakeLists.txt | 5 ----- drivers/gpu/drm/amd/display/dc/dpp/dcn32/CMakeLists.txt | 4 ---- drivers/gpu/drm/amd/display/dc/dpp/dcn35/CMakeLists.txt | 4 ---- .../gpu/drm/amd/display/dc/resource/dce80/CMakeLists.txt | 4 ---- 7 files changed, 32 deletions(-) delete mode 100644 drivers/gpu/drm/amd/display/dc/dpp/dcn10/CMakeLists.txt delete mode 100644 drivers/gpu/drm/amd/display/dc/dpp/dcn20/CMakeLists.txt delete mode 100644 drivers/gpu/drm/amd/display/dc/dpp/dcn201/CMakeLists.txt delete mode 100644 drivers/gpu/drm/amd/display/dc/dpp/dcn30/CMakeLists.txt delete mode 100644 drivers/gpu/drm/amd/display/dc/dpp/dcn32/CMakeLists.txt delete mode 100644 drivers/gpu/drm/amd/display/dc/dpp/dcn35/CMakeLists.txt delete mode 100644 drivers/gpu/drm/amd/display/dc/resource/dce80/CMakeLists.txt
drivers/gpu/drm/amd/display/dc/dpp/dcn10/CMakeLists.txt deleted +0 -6
@@ -1,6 +0,0 @@ -dal3_subdirectory_sources( - dcn10_dpp.c - dcn10_dpp_cm.c - dcn10_dpp_dscl.c - dcn10_dpp.h -)
drivers/gpu/drm/amd/display/dc/dpp/dcn20/CMakeLists.txt deleted +0 -5
@@ -1,5 +0,0 @@ -dal3_subdirectory_sources( - dcn20_dpp.c - dcn20_dpp_cm.c - dcn20_dpp.h -)
drivers/gpu/drm/amd/display/dc/dpp/dcn201/CMakeLists.txt deleted +0 -4
@@ -1,4 +0,0 @@ -dal3_subdirectory_sources( - dcn201_dpp.c - dcn201_dpp.h -)
drivers/gpu/drm/amd/display/dc/dpp/dcn30/CMakeLists.txt deleted +0 -5
@@ -1,5 +0,0 @@ -dal3_subdirectory_sources( - dcn30_dpp.c - dcn30_dpp_cm.c - dcn30_dpp.h -)
drivers/gpu/drm/amd/display/dc/dpp/dcn32/CMakeLists.txt deleted +0 -4
@@ -1,4 +0,0 @@ -dal3_subdirectory_sources( - dcn32_dpp.c - dcn32_dpp.h -)
drivers/gpu/drm/amd/display/dc/dpp/dcn35/CMakeLists.txt deleted +0 -4
@@ -1,4 +0,0 @@ -dal3_subdirectory_sources( - dcn35_dpp.c - dcn35_dpp.h -)
drivers/gpu/drm/amd/display/dc/resource/dce80/CMakeLists.txt deleted +0 -4
@@ -1,4 +0,0 @@ -dal3_subdirectory_sources( - dce80_resource.c - dce80_resource.h - )
Signature · 1 line
2.37.3
PATCH 11/46 drm/amd/display: Improve registers write
In reply to Wayne LinFrom: Rodrigo Siqueira <[email protected]>
Add REG_SEQ_SUBMIT and REG_SEQ_WAIT_DONE to optimize the burst write for the regama lut.
--- drivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp_cm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp_cm.c +2 -1
@@ -410,9 +410,10 @@ void dpp1_cm_program_regamma_lut(struct dpp *dpp_base,REG_SET (CM_RGAM_LUT_DATA ,0 ,CM_RGAM_LUT_DATA , rgb[i].delta_red_reg);REG_SET (CM_RGAM_LUT_DATA ,0 ,CM_RGAM_LUT_DATA , rgb[i].delta_green_reg);REG_SET (CM_RGAM_LUT_DATA ,0 ,CM_RGAM_LUT_DATA , rgb[i].delta_blue_reg); - } +REG_SEQ_SUBMIT (); +REG_SEQ_WAIT_DONE (); } void dpp1_cm_configure_regamma_lut(
Signature · 1 line
2.37.3
PATCH 12/46 drm/amd/display: Add missing SMU version
In reply to Wayne LinFrom: Rodrigo Siqueira <[email protected]>
This commit add PP_SMU_VER_VG to the pp_smu_ver list.
--- drivers/gpu/drm/amd/display/dc/dm_pp_smu.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dm_pp_smu.h +2 -1
@@ -40,8 +40,9 @@ enum pp_smu_ver {PP_SMU_UNSUPPORTED ,PP_SMU_VER_RV ,PP_SMU_VER_NV , -PP_SMU_VER_RN , +PP_SMU_VER_RN , +PP_SMU_VER_VG , PP_SMU_VER_MAX };
Signature · 1 line
2.37.3
PATCH 13/46 drm/amd/display: Adjust codestyle for dcn31 and hdcp_msg
In reply to Wayne LinFrom: Rodrigo Siqueira <[email protected]>
This commit just update the code style in two if conditions and in an static array.
--- drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c | 8 ++++---- drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c +4 -4
@@ -645,9 +645,9 @@ void dcn31_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_params dcn3_1_soc.clock_limits[closest_clk_lvl].phyclk_d18_mhz; s[i].phyclk_mhz = dcn3_1_soc.clock_limits[closest_clk_lvl].phyclk_mhz; } -if (clk_table->num_entries) { + +if (clk_table->num_entries) dcn3_1_soc.num_states = clk_table->num_entries; - }memcpy (dcn3_1_soc.clock_limits, s,sizeof (dcn3_1_soc.clock_limits));
@@ -797,9 +797,9 @@ void dcn316_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param dcn3_16_soc.clock_limits[closest_clk_lvl].phyclk_d18_mhz; s[i].phyclk_mhz = dcn3_16_soc.clock_limits[closest_clk_lvl].phyclk_mhz; } -if (clk_table->num_entries) { + +if (clk_table->num_entries) dcn3_16_soc.num_states = clk_table->num_entries; - }memcpy (dcn3_16_soc.clock_limits, s,sizeof (dcn3_16_soc.clock_limits));
drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c +1 -1
@@ -70,7 +70,7 @@ static const bool hdcp_cmd_is_read[HDCP_MESSAGE_ID_MAX] = { [HDCP_MESSAGE_ID_WRITE_REPEATER_AUTH_STREAM_MANAGE] = false, [HDCP_MESSAGE_ID_READ_REPEATER_AUTH_STREAM_READY] = true, [HDCP_MESSAGE_ID_READ_RXSTATUS] = true, - [HDCP_MESSAGE_ID_WRITE_CONTENT_STREAM_TYPE ] = false + [HDCP_MESSAGE_ID_WRITE_CONTENT_STREAM_TYPE] = false, };static const uint8_t hdcp_i2c_offsets[HDCP_MESSAGE_ID_MAX ] = {
Signature · 1 line
2.37.3
PATCH 14/46 drm/amd/display: Add VCO speed parameter for DCN31 FPU
In reply to Wayne LinFrom: Rodrigo Siqueira <[email protected]>
Add VCO speed parameters in the bounding box array.
--- drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c +2 -0
@@ -291,6 +291,7 @@ static struct _vcs_dpi_soc_bounding_box_st dcn3_15_soc = { .do_urgent_latency_adjustment = false, .urgent_latency_adjustment_fabric_clock_component_us = 0, .urgent_latency_adjustment_fabric_clock_reference_mhz = 0, + .dispclk_dppclk_vco_speed_mhz = 2400.0, .num_chans = 4, .dummy_pstate_latency_us = 10.0 };
@@ -438,6 +439,7 @@ static struct _vcs_dpi_soc_bounding_box_st dcn3_16_soc = { .do_urgent_latency_adjustment = false, .urgent_latency_adjustment_fabric_clock_component_us = 0, .urgent_latency_adjustment_fabric_clock_reference_mhz = 0, + .dispclk_dppclk_vco_speed_mhz = 2500.0, }; void dcn31_zero_pipe_dcc_fraction(display_e2e_pipe_params_st *pipes,
Signature · 1 line
2.37.3
PATCH 15/46 drm/amd/display: Adjust functions prefix for some of the dcn301 fpu functions
In reply to Wayne LinFrom: Rodrigo Siqueira <[email protected]>
Add dcn301_fpu prefix to some of the FPU function with the required adjustments.
--- .../amd/display/dc/dml/dcn301/dcn301_fpu.c | 4 ++-- .../amd/display/dc/dml/dcn301/dcn301_fpu.h | 7 +++---- .../dc/resource/dcn301/dcn301_resource.c | 19 +++++++++++++------ 3 files changed, 18 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn301/dcn301_fpu.c +2 -2
@@ -320,7 +320,7 @@ static void calculate_wm_set_for_vlevel(int vlevel, } -void dcn301_update_bw_bounding_box (struct dc *dc,struct clk_bw_params *bw_params) +void dcn301_fpu_update_bw_bounding_box (struct dc *dc,struct clk_bw_params *bw_params) {struct _vcs_dpi_voltage_scaling_st *s = dc->scratch.update_bw_bounding_box.clock_limits;struct dcn301_resource_pool *pool =TO_DCN301_RES_POOL (dc->res_pool);
@@ -409,7 +409,7 @@ void dcn301_fpu_init_soc_bounding_box(struct bp_soc_bb_info bb_info) dcn3_01_soc.sr_exit_time_us = bb_info.dram_sr_exit_latency_100ns *10 ; } -void dcn301_calculate_wm_and_dlg_fp(struct dc *dc, +void dcn301_fpu_calculate_wm_and_dlg(struct dc *dc, struct dc_state *context, display_e2e_pipe_params_st *pipes, int pipe_cnt,
drivers/gpu/drm/amd/display/dc/dml/dcn301/dcn301_fpu.h +3 -4
@@ -26,15 +26,14 @@#ifndef __DCN301_FPU_H__#define __DCN301_FPU_H__ -void dcn301_update_bw_bounding_box (struct dc *dc,struct clk_bw_params *bw_params); +void dcn301_fpu_init_soc_bounding_box (struct bp_soc_bb_info bb_info); +void dcn301_fpu_update_bw_bounding_box (struct dc *dc,struct clk_bw_params *bw_params);void dcn301_fpu_set_wm_ranges (int i,struct pp_smu_wm_range_sets *ranges,struct _vcs_dpi_soc_bounding_box_st *loaded_bb); -void dcn301_fpu_init_soc_bounding_box (struct bp_soc_bb_info bb_info); - -void dcn301_calculate_wm_and_dlg_fp(struct dc *dc, +void dcn301_fpu_calculate_wm_and_dlg(struct dc *dc, struct dc_state *context, display_e2e_pipe_params_st *pipes, int pipe_cnt,
drivers/gpu/drm/amd/display/dc/resource/dcn301/dcn301_resource.c +13 -6
@@ -1363,14 +1363,21 @@ static void set_wm_ranges( pp_smu->nv_funcs.set_wm_ranges (&pp_smu->nv_funcs.pp_smu, &ranges); } -static void dcn301_calculate_wm_and_dlg ( -struct dc *dc,struct dc_state *context, -display_e2e_pipe_params_st *pipes, -int pipe_cnt, -int vlevel) +static void dcn301_update_bw_bounding_box (struct dc *dc,struct clk_bw_params *bw_params) {DC_FP_START (); -dcn301_calculate_wm_and_dlg_fp (dc, context, pipes, pipe_cnt, vlevel); +dcn301_fpu_update_bw_bounding_box (dc, bw_params); +DC_FP_END (); +} + +static void dcn301_calculate_wm_and_dlg (struct dc *dc, +struct dc_state *context, +display_e2e_pipe_params_st *pipes, +int pipe_cnt, +int vlevel_req) +{ +DC_FP_START (); +dcn301_fpu_calculate_wm_and_dlg (dc, context, pipes, pipe_cnt, vlevel_req);DC_FP_END (); }
Signature · 1 line
2.37.3
PATCH 16/46 drm/amd/display: Enable legacy fast update for dcn301
In reply to Wayne LinFrom: Rodrigo Siqueira <[email protected]>
Set up to enable legacy fast update.
--- drivers/gpu/drm/amd/display/dc/resource/dcn301/dcn301_resource.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/resource/dcn301/dcn301_resource.c +1 -0
@@ -702,6 +702,7 @@ static const struct dc_debug_options debug_defaults_drv = { .dmub_command_table = true, .use_max_lb = false, .exit_idle_opt_for_cursor_updates = true, + .enable_legacy_fast_update = true, .using_dml2 = false, };
Signature · 1 line
2.37.3
PATCH 17/46 drm/amd/display: Update some of the dcn303 parameters
In reply to Wayne LinFrom: Rodrigo Siqueira <[email protected]>
Adjust to update some of the dcn303 parameters.
--- .../amd/display/dc/resource/dcn303/dcn303_resource.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/resource/dcn303/dcn303_resource.c +7 -4
@@ -97,8 +97,9 @@ static const struct dc_debug_options debug_defaults_drv = { .underflow_assert_delay_us = 0xFFFFFFFF, .dwb_fi_phase = -1, // -1 = disable, .dmub_command_table = true, + .use_max_lb = true, .exit_idle_opt_for_cursor_updates = true, - .disable_idle_power_optimizations = false, + .enable_legacy_fast_update = false, .using_dml2 = false, };
@@ -145,9 +146,9 @@ static const struct dc_plane_cap plane_cap = { .fp16 = 16000 }, .max_downscale_factor = { - .argb8888 = 600, - .nv12 = 600, - .fp16 =600 + .argb8888 = 167, + .nv12 = 167, + .fp16 =167 },16 ,16
@@ -1171,6 +1172,8 @@ static bool dcn303_resource_construct( dc->caps.cursor_cache_size = dc->caps.max_cursor_size * dc->caps.max_cursor_size *8 ; dc->caps.max_slave_planes =1 ; + dc->caps.max_slave_yuv_planes =1 ; + dc->caps.max_slave_rgb_planes =1 ; dc->caps.post_blend_color_processing = true; dc->caps.force_dp_tps4_for_cp2520 = true; dc->caps.extended_aux_timeout_support = true;
Signature · 1 line
2.37.3
PATCH 18/46 drm/amd/display: Remove legacy code in DC
In reply to Wayne LinFrom: Rodrigo Siqueira <[email protected]>
This commit just remove some trivial legacy code in some of the DC files.
--- drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c | 12 ------------ drivers/gpu/drm/amd/display/dc/hwss/Makefile | 6 ------ .../gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.h | 2 +- .../gpu/drm/amd/display/dc/hwss/dcn301/dcn301_init.c | 3 --- drivers/gpu/drm/amd/display/dc/os_types.h | 2 -- 5 files changed, 1 insertion(+), 24 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c +0 -12
@@ -762,23 +762,11 @@ void dcn316_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_parambreak ; } } -// Ported from DCN315 -if (clk_table->num_entries ==1 ) { -/*smu gives one DPM level, let's take the highest one*/ - closest_clk_lvl = dcn3_16_soc.num_states -1 ; - } s[i].state = i;/* Clocks dependent on voltage level. */ s[i].dcfclk_mhz = clk_table->entries[i].dcfclk_mhz; -if (clk_table->num_entries ==1 && - s[i].dcfclk_mhz < - dcn3_16_soc.clock_limits[closest_clk_lvl].dcfclk_mhz) { -/*SMU fix not released yet*/ - s[i].dcfclk_mhz = - dcn3_16_soc.clock_limits[closest_clk_lvl].dcfclk_mhz; - } s[i].fabricclk_mhz = clk_table->entries[i].fclk_mhz; s[i].socclk_mhz = clk_table->entries[i].socclk_mhz; s[i].dram_speed_mts = clk_table->entries[i].memclk_mhz *
drivers/gpu/drm/amd/display/dc/hwss/Makefile +0 -6
@@ -110,10 +110,6 @@ AMD_DISPLAY_FILES += $(AMD_DAL_HWSS_DCN21) ############################################################################### -############################################################################### - -############################################################################### - HWSS_DCN30 = dcn30_hwseq.o dcn30_init.o AMD_DAL_HWSS_DCN30 = $(addprefix $(AMDDALPATH)/dc/hwss/dcn30/,$(HWSS_DCN30))
@@ -188,8 +184,6 @@ AMD_DISPLAY_FILES += $(AMD_DAL_HWSS_DCN351) ############################################################################### -############################################################################### - HWSS_DCN401 = dcn401_hwseq.o dcn401_init.o AMD_DAL_HWSS_DCN401 = $(addprefix $(AMDDALPATH)/dc/hwss/dcn401/,$(HWSS_DCN401))
drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.h +1 -1
@@ -27,7 +27,7 @@#define __DC_HWSS_DCN30_H__#include "hw_sequencer_private.h" -#include "dcn20/dcn20_hwseq.h" +struct dc ;void dcn30_init_hw (struct dc *dc);
drivers/gpu/drm/amd/display/dc/hwss/dcn301/dcn301_init.c +0 -3
@@ -53,9 +53,6 @@ static const struct hw_sequencer_funcs dcn301_funcs = { .enable_stream = dcn20_enable_stream, .disable_stream = dce110_disable_stream, .unblank_stream = dcn20_unblank_stream, -#ifdef FREESYNC_POWER_OPTIMIZE - .are_streams_coarse_grain_aligned = dcn20_are_streams_coarse_grain_aligned, -#endif .blank_stream = dce110_blank_stream, .enable_audio_stream = dce110_enable_audio_stream, .disable_audio_stream = dce110_disable_audio_stream,
drivers/gpu/drm/amd/display/dc/os_types.h +0 -2
@@ -29,8 +29,6 @@#include <linux/slab.h> #include <linux/kgdb.h> -#include <linux/kref.h> -#include <linux/types.h> #include <linux/delay.h> #include <linux/mm.h>
Signature · 1 line
2.37.3
PATCH 19/46 drm/amd/display: Add log_color_state callback to multiple DCNs
In reply to Wayne LinFrom: Rodrigo Siqueira <[email protected]>
Set up to enable log color state for multiple DCNs.
--- drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_init.c | 1 + drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_init.c | 1 + drivers/gpu/drm/amd/display/dc/hwss/dcn301/dcn301_init.c | 1 + drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_init.c | 1 + drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_init.c | 1 + 5 files changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_init.c +1 -0
@@ -68,6 +68,7 @@ static const struct hw_sequencer_funcs dcn21_funcs = { .set_avmute = dce110_set_avmute, .log_hw_state = dcn10_log_hw_state, .get_hw_state = dcn10_get_hw_state, + .log_color_state = dcn20_log_color_state, .clear_status_bits = dcn10_clear_status_bits, .wait_for_mpcc_disconnect = dcn10_wait_for_mpcc_disconnect, .edp_backlight_control = dce110_edp_backlight_control,
drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_init.c +1 -0
@@ -68,6 +68,7 @@ static const struct hw_sequencer_funcs dcn30_funcs = { .setup_stereo = dcn10_setup_stereo, .set_avmute = dcn30_set_avmute, .log_hw_state = dcn10_log_hw_state, + .log_color_state = dcn30_log_color_state, .get_hw_state = dcn10_get_hw_state, .clear_status_bits = dcn10_clear_status_bits, .wait_for_mpcc_disconnect = dcn10_wait_for_mpcc_disconnect,
drivers/gpu/drm/amd/display/dc/hwss/dcn301/dcn301_init.c +1 -0
@@ -69,6 +69,7 @@ static const struct hw_sequencer_funcs dcn301_funcs = { .setup_stereo = dcn10_setup_stereo, .set_avmute = dcn30_set_avmute, .log_hw_state = dcn10_log_hw_state, + .log_color_state = dcn30_log_color_state, .get_hw_state = dcn10_get_hw_state, .clear_status_bits = dcn10_clear_status_bits, .wait_for_mpcc_disconnect = dcn10_wait_for_mpcc_disconnect,
drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_init.c +1 -0
@@ -71,6 +71,7 @@ static const struct hw_sequencer_funcs dcn31_funcs = { .setup_stereo = dcn10_setup_stereo, .set_avmute = dcn30_set_avmute, .log_hw_state = dcn10_log_hw_state, + .log_color_state = dcn30_log_color_state, .get_hw_state = dcn10_get_hw_state, .clear_status_bits = dcn10_clear_status_bits, .wait_for_mpcc_disconnect = dcn10_wait_for_mpcc_disconnect,
drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_init.c +1 -0
@@ -74,6 +74,7 @@ static const struct hw_sequencer_funcs dcn314_funcs = { .set_avmute = dcn30_set_avmute, .log_hw_state = dcn10_log_hw_state, .get_hw_state = dcn10_get_hw_state, + .log_color_state = dcn30_log_color_state, .clear_status_bits = dcn10_clear_status_bits, .wait_for_mpcc_disconnect = dcn10_wait_for_mpcc_disconnect, .edp_backlight_control = dce110_edp_backlight_control,
Signature · 1 line
2.37.3
PATCH 20/46 drm/amd/display: Handle the case which quad_part is equal 0
In reply to Wayne LinFrom: Rodrigo Siqueira <[email protected]>
Add code to handle case when quad_part is 0 in gpu_addr_to_uma().
--- drivers/gpu/drm/amd/display/dc/hwss/dcn201/dcn201_hwseq.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/hwss/dcn201/dcn201_hwseq.c +3 -0
@@ -95,8 +95,11 @@ static bool gpu_addr_to_uma(struct dce_hwseq *hwseq, }else if (hwseq->fb_offset.quad_part <= addr->quad_part && addr->quad_part <= hwseq->uma_top.quad_part) { is_in_uma = true; + }else if (addr->quad_part ==0 ) { + is_in_uma = false; }else { is_in_uma = false; +BREAK_TO_DEBUGGER (); }return is_in_uma; }
Signature · 1 line
2.37.3
PATCH 21/46 drm/amd/display: Refactor for Replay Link off frame count
In reply to Wayne LinFrom: Dennis Chan <[email protected]>
[why]
To refine for link off frame count in diagnose tool,
the driver show the link off frame count number instead of showing link off frame count level.
--- drivers/gpu/drm/amd/display/dc/dc_types.h | 2 +- drivers/gpu/drm/amd/display/modules/power/power_helpers.c | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_types.h +1 -1
@@ -1092,7 +1092,7 @@ struct replay_settings {/* Coasting vtotal table */ uint32_t coasting_vtotal_table[PR_COASTING_TYPE_NUM ];/* Maximum link off frame count */ -enum replay_link_off_frame_count_level link_off_frame_count_level; +uint32_t link_off_frame_count;/* Replay pseudo vtotal for abm + ips on full screen video which can improve ips residency */ uint16_t abm_with_ips_on_full_screen_video_pseudo_vtotal;/* Replay last pseudo vtotal set to DMUB */
drivers/gpu/drm/amd/display/modules/power/power_helpers.c +2 -6
@@ -994,16 +994,12 @@ void calculate_replay_link_off_frame_count(struct dc_link *link, max_deviation_line = link->dpcd_caps.pr_info.max_deviation_line; pixel_deviation_per_line = link->dpcd_caps.pr_info.pixel_deviation_per_line; -if (htotal !=0 && vtotal !=0 ) +if (htotal !=0 && vtotal !=0 && pixel_deviation_per_line !=0 ) max_link_off_frame_count = htotal * max_deviation_line / (pixel_deviation_per_line * vtotal);else ASSERT (0 ); - link->replay_settings.link_off_frame_count_level = - max_link_off_frame_count >=PR_LINK_OFF_FRAME_COUNT_BEST ?PR_LINK_OFF_FRAME_COUNT_BEST : - max_link_off_frame_count >=PR_LINK_OFF_FRAME_COUNT_GOOD ?PR_LINK_OFF_FRAME_COUNT_GOOD : -PR_LINK_OFF_FRAME_COUNT_FAIL ; - + link->replay_settings.link_off_frame_count = max_link_off_frame_count; }bool fill_custom_backlight_caps (unsigned int config_no,struct dm_acpi_atif_backlight_caps *caps)
Signature · 1 line
2.37.3
PATCH 22/46 drm/amd/display: Restrict multi-disp support for in-game FAMS
In reply to Wayne LinFrom: Iswara Nagulendran <[email protected]>
[HOW&WHY]
In multi-monitor cases the VBLANK stretch that is required to align both monitors may be so large that it may create issues for gaming performance.
Use debug value to restrict in-game FAMS support for multi-disp use case.
--- drivers/gpu/drm/amd/display/dc/dc.h | 8 +++++++- .../gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c | 4 +++- .../drm/amd/display/dc/resource/dcn30/dcn30_resource.c | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +7 -1
@@ -499,6 +499,12 @@ enum dcc_option { DCC_HALF_REQ_DISALBE = 2, }; +enum in_game_fams_config { +INGAME_FAMS_SINGLE_DISP_ENABLE ,// enable in-game fams +INGAME_FAMS_DISABLE ,// disable in-game fams +INGAME_FAMS_MULTI_DISP_ENABLE ,//enable in-game fams for multi-display +}; +/** * enum pipe_split_policy - Pipe split strategy supported by DCN *
@@ -951,7 +957,7 @@ struct dc_debug_options {/* Enable dmub aux for legacy ddc */ bool enable_dmub_aux_for_legacy_ddc;bool disable_fams; -bool disable_fams_gaming; +enum in_game_fams_config disable_fams_gaming;/* FEC/PSR1 sequence enable delay in 100us */ uint8_t fec_enable_delay_in100us;bool enable_driver_sequence_debug;
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c +3 -1
@@ -580,7 +580,9 @@ struct dc_stream_state *dcn32_can_support_mclk_switch_using_fw_based_vblank_streif (!fpo_candidate_stream->allow_freesync)return NULL ; -if (fpo_candidate_stream->vrr_active_variable && dc->debug.disable_fams_gaming) +if (fpo_candidate_stream->vrr_active_variable && + ((dc->debug.disable_fams_gaming ==INGAME_FAMS_DISABLE ) || + (context->stream_count >1 && !(dc->debug.disable_fams_gaming ==INGAME_FAMS_MULTI_DISP_ENABLE ))))return NULL ;return fpo_candidate_stream;
drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c +1 -1
@@ -1996,7 +1996,7 @@ bool dcn30_can_support_mclk_switch_using_fw_based_vblank_stretch(struct dc *dc,if (!context->streams[0 ]->allow_freesync)return false; -if (context->streams[0 ]->vrr_active_variable && dc->debug.disable_fams_gaming) +if (context->streams[0 ]->vrr_active_variable && (dc->debug.disable_fams_gaming ==INGAME_FAMS_DISABLE ))return false; context->streams[0 ]->fpo_in_use = true;
Signature · 1 line
2.37.3
PATCH 23/46 drm/amd/display: Defer handling mst up request in resume
In reply to Wayne LinFrom: Wayne Lin <[email protected]>
[Why]
Like commit ec5fa9fcdeca ("drm/amd/display: Adjust the MST resume flow"), we want to avoid handling mst topology changes before restoring the old state. If we enable DP_UP_REQ_EN before calling drm_atomic_helper_resume(), have changce to handle CSN event first and fire hotplug event before restoring the cached state.
[How]
Disable mst branch sending up request event before we restoring the cached state. DP_UP_REQ_EN will be set later when we call drm_dp_mst_topology_mgr_resume().
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -1
@@ -2429,7 +2429,6 @@ static void resume_mst_branch_status(struct drm_dp_mst_topology_mgr *mgr) ret =drm_dp_dpcd_writeb (mgr->aux,DP_MSTM_CTRL ,DP_MST_EN | -DP_UP_REQ_EN |DP_UPSTREAM_IS_SRC );if (ret <0 ) {drm_dbg_kms (mgr->dev,"mst write failed - undocked during suspend?\n" );
Signature · 1 line
2.37.3
PATCH 24/46 drm/amd/display: Fix DC mode screen flickering on DCN321
In reply to Wayne LinFrom: Leo Ma <[email protected]>
[Why && How]
Screen flickering saw on 4K@60 eDP with high refresh rate external monitor when booting up in DC mode. DC Mode Capping is disabled which caused wrong UCLK being used.
--- .../amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c +12 -3
@@ -712,8 +712,12 @@ static void dcn32_update_clocks(struct clk_mgr *clk_mgr_base,* since we calculate mode support based on softmax being the max UCLK * frequency. */ -dcn32_smu_set_hard_min_by_freq (clk_mgr,PPCLK_UCLK , - dc->clk_mgr->bw_params->dc_mode_softmax_memclk); +if (dc->debug.disable_dc_mode_overwrite) { +dcn30_smu_set_hard_max_by_freq (clk_mgr,PPCLK_UCLK , dc->clk_mgr->bw_params->max_memclk_mhz); +dcn32_smu_set_hard_min_by_freq (clk_mgr,PPCLK_UCLK , dc->clk_mgr->bw_params->max_memclk_mhz); + }else +dcn32_smu_set_hard_min_by_freq (clk_mgr,PPCLK_UCLK , + dc->clk_mgr->bw_params->dc_mode_softmax_memclk); }else {dcn32_smu_set_hard_min_by_freq (clk_mgr,PPCLK_UCLK , dc->clk_mgr->bw_params->max_memclk_mhz); }
@@ -746,8 +750,13 @@ static void dcn32_update_clocks(struct clk_mgr *clk_mgr_base,/* set UCLK to requested value if P-State switching is supported, or to re-enable P-State switching */ if (clk_mgr_base->clks.p_state_change_support && (update_uclk || !clk_mgr_base->clks.prev_p_state_change_support) && - !dc->work_arounds.clock_update_disable_mask.uclk) + !dc->work_arounds.clock_update_disable_mask.uclk) { +if (dc->clk_mgr->dc_mode_softmax_enabled && dc->debug.disable_dc_mode_overwrite) +dcn30_smu_set_hard_max_by_freq (clk_mgr,PPCLK_UCLK , +max ((int )dc->clk_mgr->bw_params->dc_mode_softmax_memclk,khz_to_mhz_ceil (clk_mgr_base->clks.dramclk_khz))); +dcn32_smu_set_hard_min_by_freq (clk_mgr,PPCLK_UCLK ,khz_to_mhz_ceil (clk_mgr_base->clks.dramclk_khz)); + }if (clk_mgr_base->clks.num_ways != new_clocks->num_ways && clk_mgr_base->clks.num_ways > new_clocks->num_ways) {
Signature · 1 line
2.37.3
PATCH 25/46 drm/amd/display: take ODM slice count into account when deciding DSC slice
In reply to Wayne LinFrom: Wenjing Liu <[email protected]>
[why]
DSC slice must be divisible by ODM slice count.
[how]
If DSC slice count is not a multiple of ODM slice count, increase DSC slice until it is. Otherwise fail to compute DSC configuration.
--- drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 30 ++++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c +23 -7
@@ -922,14 +922,30 @@ static bool setup_dsc_config(else is_dsc_possible = false; } -// When we force 2:1 ODM, we can't have 1 slice to divide amongst 2 separate DSC instances -// need to enforce at minimum 2 horizontal slices -if (options->dsc_force_odm_hslice_override) { - num_slices_h =fit_num_slices_up (dsc_common_caps.slice_caps,2 ); -if (num_slices_h ==0 ) - is_dsc_possible = false; +// When we force ODM, num dsc h slices must be divisible by num odm h slices +switch (options->dsc_force_odm_hslice_override) { +case 0 : +case 1 : +break ; +case 2 : +if (num_slices_h <2 ) + num_slices_h =fit_num_slices_up (dsc_common_caps.slice_caps,2 ); +break ; +case 3 : +if (dsc_common_caps.slice_caps.bits.NUM_SLICES_12) + num_slices_h =12 ; +else + num_slices_h =0 ; +break ; +case 4 : +if (num_slices_h <4 ) + num_slices_h =fit_num_slices_up (dsc_common_caps.slice_caps,4 ); +break ; +default : +break ; } - +if (num_slices_h ==0 ) + is_dsc_possible = false;if (!is_dsc_possible) goto done;
Signature · 1 line
2.37.3
PATCH 26/46 drm/amd/display: Re-enable IPS2 for static screen
In reply to Wayne LinFrom: Roman Li <[email protected]>
[Why]
IPS stability was fixed in bios.
[How]
Set disable_ips init flag to DMUB_IPS_ENABLE.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
@@ -1740,7 +1740,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)if (amdgpu_dc_debug_mask &DC_DISABLE_IPS ) init_data.flags.disable_ips =DMUB_IPS_DISABLE_ALL ;else - init_data.flags.disable_ips =DMUB_IPS_RCG_IN_ACTIVE_IPS2_IN_OFF ; + init_data.flags.disable_ips =DMUB_IPS_ENABLE ; init_data.flags.disable_ips_in_vpb =0 ;
Signature · 1 line
2.37.3
PATCH 27/46 drm/amd/display: Add trigger FIFO resync path for DCN35
In reply to Wayne LinFrom: Nicholas Kazlauskas <[email protected]>
[Why]
FIFO error can occur if we don't trigger a DISPCLK change after touching K1/K2 dividers. For 4k144 eDP + hotplug of USB-C DP display we see FIFO underflow.
[How]
We have the path to trigger the resync as the workaround in DCN314/DCN32, it just needs to be ported over to DCN35.
--- drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c | 10 ++++++++++ drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c | 2 ++ 2 files changed, 12 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c +10 -0
@@ -41,6 +41,15 @@#define DC_LOGGER \ dccg->ctx->logger +static void dccg35_trigger_dio_fifo_resync (struct dccg *dccg) +{ +struct dcn_dccg *dccg_dcn =TO_DCN_DCCG (dccg); +uint32_t dispclk_rdivider_value =0 ; + +REG_GET (DENTIST_DISPCLK_CNTL ,DENTIST_DISPCLK_RDIVIDER , &dispclk_rdivider_value); +REG_UPDATE (DENTIST_DISPCLK_CNTL ,DENTIST_DISPCLK_WDIVIDER , dispclk_rdivider_value); +} +static void dcn35_set_dppclk_enable (struct dccg *dccg,uint32_t dpp_inst,uint32_t enable) {
@@ -1056,6 +1065,7 @@ static const struct dccg_funcs dccg35_funcs = { .enable_dsc = dccg35_enable_dscclk, .set_pixel_rate_div = dccg35_set_pixel_rate_div, .get_pixel_rate_div = dccg35_get_pixel_rate_div, + .trigger_dio_fifo_resync = dccg35_trigger_dio_fifo_resync, .set_valid_pixel_rate = dccg35_set_valid_pixel_rate, .enable_symclk_se = dccg35_enable_symclk_se, .disable_symclk_se = dccg35_disable_symclk_se,
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c +2 -0
@@ -31,6 +31,7 @@#include "dcn30/dcn30_hwseq.h" #include "dcn301/dcn301_hwseq.h" #include "dcn31/dcn31_hwseq.h" +#include "dcn314/dcn314_hwseq.h" #include "dcn32/dcn32_hwseq.h" #include "dcn35/dcn35_hwseq.h"
@@ -158,6 +159,7 @@ static const struct hwseq_private_funcs dcn35_private_funcs = { .setup_hpo_hw_control = dcn35_setup_hpo_hw_control, .calculate_dccg_k1_k2_values = dcn32_calculate_dccg_k1_k2_values, .set_pixels_per_cycle = dcn32_set_pixels_per_cycle, + .resync_fifo_dccg_dio = dcn314_resync_fifo_dccg_dio, .is_dp_dig_pixel_rate_div_policy = dcn32_is_dp_dig_pixel_rate_div_policy, .calculate_pix_rate_divider = dcn32_calculate_pix_rate_divider, .dsc_pg_control = dcn35_dsc_pg_control,
Signature · 1 line
2.37.3
PATCH 28/46 drm/amd/display: Enable RCO for PHYSYMCLK in DCN35
In reply to Wayne LinFrom: Daniel Miess <[email protected]>
[Why & How]
Enable root clock optimization for PHYSYMCLK and only disable it when it's actively being used
--- drivers/gpu/drm/amd/display/dc/dc.h | 1 + .../gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c | 45 ------------------- .../amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 32 +++++++++++++ .../amd/display/dc/hwss/dcn35/dcn35_hwseq.h | 2 + .../amd/display/dc/hwss/dcn35/dcn35_init.c | 1 + .../amd/display/dc/hwss/dcn351/dcn351_init.c | 1 + .../display/dc/hwss/hw_sequencer_private.h | 4 ++ 7 files changed, 41 insertions(+), 45 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -724,6 +724,7 @@ enum pg_hw_pipe_resources {PG_OPTC ,PG_DPSTREAM ,PG_HDMISTREAM , +PG_PHYSYMCLK , PG_HW_PIPE_RESOURCES_NUM_ELEMENT };
drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c +0 -45
123 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +32 -0
@@ -506,6 +506,17 @@ void dcn35_dpstream_root_clock_control(struct dce_hwseq *hws, unsigned int dp_hp } } +void dcn35_physymclk_root_clock_control (struct dce_hwseq *hws,unsigned int phy_inst,bool clock_on) +{ +if (!hws->ctx->dc->debug.root_clock_optimization.bits.physymclk) +return ; + +if (hws->ctx->dc->res_pool->dccg->funcs->set_physymclk_root_clock_gating) { + hws->ctx->dc->res_pool->dccg->funcs->set_physymclk_root_clock_gating ( + hws->ctx->dc->res_pool->dccg, phy_inst, clock_on); + } +} + void dcn35_dsc_pg_control( struct dce_hwseq *hws, unsigned int dsc_inst,
@@ -1020,6 +1031,13 @@ void dcn35_calc_blocks_to_gate(struct dc *dc, struct dc_state *context,if (pipe_ctx->stream_res.hpo_dp_stream_enc) update_state->pg_pipe_res_update[PG_DPSTREAM ][pipe_ctx->stream_res.hpo_dp_stream_enc->inst] = false; } + +for (i =0 ; i < dc->link_count; i++) { + update_state->pg_pipe_res_update[PG_PHYSYMCLK ][i] = true; +if (dc->links[i]->type != dc_connection_none) + update_state->pg_pipe_res_update[PG_PHYSYMCLK ][dc->links[i]->link_enc_hw_inst] = false; + } +/*domain24 controls all the otg, mpc, opp, as long as one otg is still up, avoid enabling OTG PG*/ for (i =0 ; i < dc->res_pool->timing_generator_count; i++) {struct timing_generator *tg = dc->res_pool->timing_generators[i];
@@ -1117,6 +1135,10 @@ void dcn35_calc_blocks_to_ungate(struct dc *dc, struct dc_state *context, } } +for (i =0 ; i < dc->link_count; i++) +if (dc->links[i]->type != dc_connection_none) + update_state->pg_pipe_res_update[PG_PHYSYMCLK ][dc->links[i]->link_enc_hw_inst] = true; +for (i =0 ; i < dc->res_pool->hpo_dp_stream_enc_count; i++) {if (context->res_ctx.is_hpo_dp_stream_enc_acquired[i] && dc->res_pool->hpo_dp_stream_enc[i]) {
@@ -1267,6 +1289,11 @@ void dcn35_root_clock_control(struct dc *dc, dc->hwseq->funcs.dpstream_root_clock_control (dc->hwseq, i, power_on); } +for (i =0 ; i < dc->res_pool->dig_link_enc_count; i++) +if (update_state->pg_pipe_res_update[PG_PHYSYMCLK ][i]) +if (dc->hwseq->funcs.physymclk_root_clock_control) + dc->hwseq->funcs.physymclk_root_clock_control (dc->hwseq, i, power_on); + }for (i =0 ; i < dc->res_pool->res_cap->num_dsc; i++) {if (update_state->pg_pipe_res_update[PG_DSC ][i]) {
@@ -1292,6 +1319,11 @@ void dcn35_root_clock_control(struct dc *dc, dc->hwseq->funcs.dpstream_root_clock_control (dc->hwseq, i, power_on); } +for (i =0 ; i < dc->res_pool->dig_link_enc_count; i++) +if (update_state->pg_pipe_res_update[PG_PHYSYMCLK ][i]) +if (dc->hwseq->funcs.physymclk_root_clock_control) + dc->hwseq->funcs.physymclk_root_clock_control (dc->hwseq, i, power_on); + } }
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h +2 -0
@@ -39,6 +39,8 @@ void dcn35_dpp_root_clock_control(struct dce_hwseq *hws, unsigned int dpp_inst,void dcn35_dpstream_root_clock_control (struct dce_hwseq *hws,unsigned int dp_hpo_inst,bool clock_on); +void dcn35_physymclk_root_clock_control (struct dce_hwseq *hws,unsigned int phy_inst,bool clock_on); +void dcn35_enable_power_gating_plane (struct dce_hwseq *hws,bool enable);void dcn35_set_dmu_fgcg (struct dce_hwseq *hws,bool enable);
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c +1 -0
@@ -149,6 +149,7 @@ static const struct hwseq_private_funcs dcn35_private_funcs = { .enable_power_gating_plane = dcn35_enable_power_gating_plane, .dpp_root_clock_control = dcn35_dpp_root_clock_control, .dpstream_root_clock_control = dcn35_dpstream_root_clock_control, + .physymclk_root_clock_control = dcn35_physymclk_root_clock_control, .program_all_writeback_pipes_in_tree = dcn30_program_all_writeback_pipes_in_tree, .update_odm = dcn35_update_odm, .set_hdr_multiplier = dcn10_set_hdr_multiplier,
drivers/gpu/drm/amd/display/dc/hwss/dcn351/dcn351_init.c +1 -0
@@ -148,6 +148,7 @@ static const struct hwseq_private_funcs dcn351_private_funcs = { .enable_power_gating_plane = dcn35_enable_power_gating_plane, .dpp_root_clock_control = dcn35_dpp_root_clock_control, .dpstream_root_clock_control = dcn35_dpstream_root_clock_control, + .physymclk_root_clock_control = dcn35_physymclk_root_clock_control, .program_all_writeback_pipes_in_tree = dcn30_program_all_writeback_pipes_in_tree, .update_odm = dcn35_update_odm, .set_hdr_multiplier = dcn10_set_hdr_multiplier,
drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer_private.h +4 -0
@@ -124,6 +124,10 @@ struct hwseq_private_funcs {struct dce_hwseq *hws, unsigned int dpp_inst, bool clock_on); +void (*physymclk_root_clock_control)( +struct dce_hwseq *hws, +unsigned int phy_inst, +bool clock_on);void (*dpp_pg_control)(struct dce_hwseq *hws,unsigned int dpp_inst,bool power_on);
Signature · 1 line
2.37.3
PATCH 30/46 drm/amd/display: Only program P-State force if pipe config changed
In reply to Wayne LinFrom: Alvin Lee <[email protected]>
[Description]
Today for MED update type we do not call update clocks. However, for FPO the assumption is that update clocks should be called to disable P-State switch before any HW programming since FPO in FW and driver are not synchronized. This causes an issue where on a MED update, an FPO P-State switch could be taking place, then driver forces P-State disallow in the below code and prevents FPO from completing the sequence. In this case we add a check to avoid re-programming (and thus re-setting) the P-State force register by only reprogramming if the pipe was not previously Subvp or FPO. The assumption is that the P-State force register should be programmed correctly the first time SubVP / FPO was enabled, so there's no need to update / reset it if the pipe config has never exited SubVP / FPO.
--- .../amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c +17 -1
@@ -614,10 +614,26 @@ void dcn32_update_force_pstate(struct dc *dc, struct dc_state *context)*/ for (i =0 ; i < dc->res_pool->pipe_count; i++) {struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i]; +struct pipe_ctx *old_pipe = &dc->current_state->res_ctx.pipe_ctx[i];struct hubp *hubp = pipe->plane_res.hubp; +/* Today for MED update type we do not call update clocks. However, for FPO +* the assumption is that update clocks should be called to disable P-State +* switch before any HW programming since FPO in FW and driver are not +* synchronized. This causes an issue where on a MED update, an FPO P-State +* switch could be taking place, then driver forces P-State disallow in the below +* code and prevents FPO from completing the sequence. In this case we add a check +* to avoid re-programming (and thus re-setting) the P-State force register by +* only reprogramming if the pipe was not previously Subvp or FPO. The assumption +* is that the P-State force register should be programmed correctly the first +* time SubVP / FPO was enabled, so there's no need to update / reset it if the +* pipe config has never exited SubVP / FPO. +*/ if (pipe->stream && (dc_state_get_pipe_subvp_type (context, pipe) ==SUBVP_MAIN || - pipe->stream->fpo_in_use)) { + pipe->stream->fpo_in_use) && + (!old_pipe->stream || + (dc_state_get_pipe_subvp_type (context, old_pipe) !=SUBVP_MAIN && + !old_pipe->stream->fpo_in_use))) {if (hubp && hubp->funcs->hubp_update_force_pstate_disallow) hubp->funcs->hubp_update_force_pstate_disallow (hubp, true);if (hubp && hubp->funcs->hubp_update_force_cursor_pstate_disallow)
Signature · 1 line
2.37.3
PATCH 29/46 drm/amd/display: Revert "dc: Keep VBios pixel rate div setting util next mode set"
In reply to Wayne LinFrom: Webb Chen <[email protected]>
This reverts commit f7131558f362 ("drm/amd/display: Keep VBios pixel rate div setting util next mode set") which causes issue.
--- .../gpu/drm/amd/display/dc/core/dc_resource.c | 4 -- .../drm/amd/display/dc/dcn314/dcn314_dccg.c | 12 +++-- .../gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c | 12 +++-- .../dc/dcn32/dcn32_dio_stream_encoder.c | 40 +++++++++++++++-- .../gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c | 8 ++-- .../dc/dcn35/dcn35_dio_stream_encoder.c | 36 ++++++++++++++- .../amd/display/dc/hwss/dce110/dce110_hwseq.c | 24 ++-------- .../amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 21 ++++++--- .../amd/display/dc/hwss/dcn314/dcn314_hwseq.c | 23 ---------- .../amd/display/dc/hwss/dcn314/dcn314_hwseq.h | 4 -- .../amd/display/dc/hwss/dcn314/dcn314_init.c | 1 - .../amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 44 ++++--------------- .../amd/display/dc/hwss/dcn32/dcn32_hwseq.h | 4 -- .../amd/display/dc/hwss/dcn32/dcn32_init.c | 1 - .../amd/display/dc/hwss/dcn35/dcn35_init.c | 1 - .../amd/display/dc/hwss/dcn351/dcn351_init.c | 1 - .../display/dc/hwss/hw_sequencer_private.h | 3 -- .../gpu/drm/amd/display/dc/inc/core_types.h | 7 --- drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h | 5 --- .../amd/display/dc/inc/hw/stream_encoder.h | 1 - 20 files changed, 111 insertions(+), 141 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +0 -4
@@ -49,7 +49,6 @@#include "link/hwss/link_hwss_hpo_dp.h" #include "link/hwss/link_hwss_dio_fixed_vs_pe_retimer.h" #include "link/hwss/link_hwss_hpo_fixed_vs_pe_retimer_dp.h" -#include "hw_sequencer_private.h" #if defined(CONFIG_DRM_AMD_DC_SI )#include "dce60/dce60_resource.h"
@@ -3903,9 +3902,6 @@ enum dc_status dc_validate_with_context(struct dc *dc,if (res !=DC_OK ) goto fail; -if (dc->hwseq->funcs.calculate_pix_rate_divider) - dc->hwseq->funcs.calculate_pix_rate_divider (dc, context, add_streams[i]); -if (!add_all_planes_for_stream (dc, add_streams[i], set, set_count, context)) { res =DC_FAIL_ATTACH_SURFACES ; goto fail;
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c +5 -7
@@ -58,8 +58,8 @@ static void dccg314_trigger_dio_fifo_resync(static void dccg314_get_pixel_rate_div (struct dccg *dccg,uint32_t otg_inst, -uint32_t *k1, -uint32_t *k2) +enum pixel_rate_div *k1, +enum pixel_rate_div *k2) {struct dcn_dccg *dccg_dcn =TO_DCN_DCCG (dccg);uint32_t val_k1 =PIXEL_RATE_DIV_NA , val_k2 =PIXEL_RATE_DIV_NA ;
@@ -93,8 +93,8 @@ static void dccg314_get_pixel_rate_div(return ; } - *k1 = val_k1; - *k2 = val_k2; + *k1 = (enum pixel_rate_div )val_k1; + *k2 = (enum pixel_rate_div )val_k2; } static void dccg314_set_pixel_rate_div(
@@ -104,8 +104,7 @@ static void dccg314_set_pixel_rate_div( enum pixel_rate_div k2) {struct dcn_dccg *dccg_dcn =TO_DCN_DCCG (dccg); -uint32_t cur_k1 =PIXEL_RATE_DIV_NA ; -uint32_t cur_k2 =PIXEL_RATE_DIV_NA ; +enum pixel_rate_div cur_k1 =PIXEL_RATE_DIV_NA , cur_k2 =PIXEL_RATE_DIV_NA ;// Don't program 0xF into the register field. Not valid since // K1 / K2 field is only 1 / 2 bits wide
@@ -374,7 +373,6 @@ static const struct dccg_funcs dccg314_funcs = { .disable_dsc = dccg31_disable_dscclk, .enable_dsc = dccg31_enable_dscclk, .set_pixel_rate_div = dccg314_set_pixel_rate_div, - .get_pixel_rate_div = dccg314_get_pixel_rate_div, .trigger_dio_fifo_resync = dccg314_trigger_dio_fifo_resync, .set_valid_pixel_rate = dccg314_set_valid_pixel_rate, .set_dtbclk_p_src = dccg314_set_dtbclk_p_src
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c +5 -7
@@ -58,8 +58,8 @@ static void dccg32_trigger_dio_fifo_resync(static void dccg32_get_pixel_rate_div (struct dccg *dccg,uint32_t otg_inst, -uint32_t *k1, -uint32_t *k2) +enum pixel_rate_div *k1, +enum pixel_rate_div *k2) {struct dcn_dccg *dccg_dcn =TO_DCN_DCCG (dccg);uint32_t val_k1 =PIXEL_RATE_DIV_NA , val_k2 =PIXEL_RATE_DIV_NA ;
@@ -93,8 +93,8 @@ static void dccg32_get_pixel_rate_div(return ; } - *k1 = val_k1; - *k2 = val_k2; + *k1 = (enum pixel_rate_div )val_k1; + *k2 = (enum pixel_rate_div )val_k2; } static void dccg32_set_pixel_rate_div(
@@ -104,8 +104,7 @@ static void dccg32_set_pixel_rate_div( enum pixel_rate_div k2) {struct dcn_dccg *dccg_dcn =TO_DCN_DCCG (dccg); -uint32_t cur_k1 =PIXEL_RATE_DIV_NA ; -uint32_t cur_k2 =PIXEL_RATE_DIV_NA ; +enum pixel_rate_div cur_k1 =PIXEL_RATE_DIV_NA , cur_k2 =PIXEL_RATE_DIV_NA ;// Don't program 0xF into the register field. Not valid since // K1 / K2 field is only 1 / 2 bits wide
@@ -344,7 +343,6 @@ static const struct dccg_funcs dccg32_funcs = { .otg_add_pixel = dccg32_otg_add_pixel, .otg_drop_pixel = dccg32_otg_drop_pixel, .set_pixel_rate_div = dccg32_set_pixel_rate_div, - .get_pixel_rate_div = dccg32_get_pixel_rate_div, .trigger_dio_fifo_resync = dccg32_trigger_dio_fifo_resync, .set_dtbclk_p_src = dccg32_set_dtbclk_p_src, };
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dio_stream_encoder.c +37 -3
@@ -52,11 +52,11 @@static void enc32_dp_set_odm_combine (struct stream_encoder *enc, -bool two_pixel_per_cyle) +bool odm_combine) {struct dcn10_stream_encoder *enc1 =DCN10STRENC_FROM_STRENC (enc); -REG_UPDATE (DP_PIXEL_FORMAT ,DP_PIXEL_PER_CYCLE_PROCESSING_MODE , two_pixel_per_cyle ?1 :0 ); +REG_UPDATE (DP_PIXEL_FORMAT ,DP_PIXEL_PER_CYCLE_PROCESSING_MODE , odm_combine ?1 :0 ); }/* setup stream encoder in dvi mode */
@@ -241,12 +241,46 @@ static bool is_two_pixels_per_containter(const struct dc_crtc_timing *timing)return two_pix; } +static bool is_h_timing_divisible_by_2 (const struct dc_crtc_timing *timing) +{ +/* math borrowed from function of same name in inc/resource +* checks if h_timing is divisible by 2 +*/ + +bool divisible = false; +uint16_t h_blank_start =0 ; +uint16_t h_blank_end =0 ; + +if (timing) { + h_blank_start = timing->h_total - timing->h_front_porch; + h_blank_end = h_blank_start - timing->h_addressable; + +/* HTOTAL, Hblank start/end, and Hsync start/end all must be +* divisible by 2 in order for the horizontal timing params +* to be considered divisible by 2. Hsync start is always 0. +*/ + divisible = (timing->h_total %2 ==0 ) && + (h_blank_start %2 ==0 ) && + (h_blank_end %2 ==0 ) && + (timing->h_sync_width %2 ==0 ); + } +return divisible; +} + +static bool is_dp_dig_pixel_rate_div_policy (struct dc *dc,const struct dc_crtc_timing *timing) +{ +/* should be functionally the same as dcn32_is_dp_dig_pixel_rate_div_policy for DP encoders*/ +return is_h_timing_divisible_by_2 (timing) && + dc->debug.enable_dp_dig_pixel_rate_div_policy; +} +void enc32_stream_encoder_dp_unblank (struct dc_link *link,struct stream_encoder *enc,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 +291,7 @@ void enc32_stream_encoder_dp_unblank(/* 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 - || param->pix_per_cycle >1 ) { + ||is_dp_dig_pixel_rate_div_policy (dc, ¶m->timing)) {/*this logic should be the same in get_pixel_clock_parameters() */ n_multiply =1 ; pix_per_cycle =1 ;
drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c +3 -5
@@ -146,8 +146,8 @@ static void dccg35_set_dppclk_root_clock_gating(struct dccg *dccg,static void dccg35_get_pixel_rate_div (struct dccg *dccg,uint32_t otg_inst, -uint32_t *k1, -uint32_t *k2) +enum pixel_rate_div *k1, +enum pixel_rate_div *k2) {struct dcn_dccg *dccg_dcn =TO_DCN_DCCG (dccg);uint32_t val_k1 =PIXEL_RATE_DIV_NA , val_k2 =PIXEL_RATE_DIV_NA ;
@@ -192,8 +192,7 @@ static void dccg35_set_pixel_rate_div( enum pixel_rate_div k2) {struct dcn_dccg *dccg_dcn =TO_DCN_DCCG (dccg); -uint32_t cur_k1 =PIXEL_RATE_DIV_NA ; -uint32_t cur_k2 =PIXEL_RATE_DIV_NA ; +enum pixel_rate_div cur_k1 =PIXEL_RATE_DIV_NA , cur_k2 =PIXEL_RATE_DIV_NA ;// Don't program 0xF into the register field. Not valid since // K1 / K2 field is only 1 / 2 bits wide
@@ -1019,7 +1018,6 @@ static const struct dccg_funcs dccg35_funcs = { .disable_dsc = dccg35_disable_dscclk, .enable_dsc = dccg35_enable_dscclk, .set_pixel_rate_div = dccg35_set_pixel_rate_div, - .get_pixel_rate_div = dccg35_get_pixel_rate_div, .trigger_dio_fifo_resync = dccg35_trigger_dio_fifo_resync, .set_valid_pixel_rate = dccg35_set_valid_pixel_rate, .enable_symclk_se = dccg35_enable_symclk_se,
drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dio_stream_encoder.c +35 -1
@@ -273,12 +273,46 @@ static bool is_two_pixels_per_containter(const struct dc_crtc_timing *timing)return two_pix; } +static bool is_h_timing_divisible_by_2 (const struct dc_crtc_timing *timing) +{ +/* math borrowed from function of same name in inc/resource +* checks if h_timing is divisible by 2 +*/ + +bool divisible = false; +uint16_t h_blank_start =0 ; +uint16_t h_blank_end =0 ; + +if (timing) { + h_blank_start = timing->h_total - timing->h_front_porch; + h_blank_end = h_blank_start - timing->h_addressable; + +/* HTOTAL, Hblank start/end, and Hsync start/end all must be +* divisible by 2 in order for the horizontal timing params +* to be considered divisible by 2. Hsync start is always 0. +*/ + divisible = (timing->h_total %2 ==0 ) && + (h_blank_start %2 ==0 ) && + (h_blank_end %2 ==0 ) && + (timing->h_sync_width %2 ==0 ); + } +return divisible; +} + +static bool is_dp_dig_pixel_rate_div_policy (struct dc *dc,const struct dc_crtc_timing *timing) +{ +/* should be functionally the same as dcn32_is_dp_dig_pixel_rate_div_policy for DP encoders*/ +return is_h_timing_divisible_by_2 (timing) && + dc->debug.enable_dp_dig_pixel_rate_div_policy; +} +static void enc35_stream_encoder_dp_unblank (struct dc_link *link,struct stream_encoder *enc,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 ;
@@ -289,7 +323,7 @@ static void enc35_stream_encoder_dp_unblank(/* 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 - || param->pix_per_cycle >1 ) { + ||is_dp_dig_pixel_rate_div_policy (dc, ¶m->timing)) {/*this logic should be the same in get_pixel_clock_parameters() */ n_multiply =1 ; pix_per_cycle =1 ;
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +3 -21
@@ -1782,7 +1782,6 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context)struct dc_stream_state *edp_streams[MAX_NUM_EDP ];struct dc_link *edp_link_with_sink =NULL ;struct dc_link *edp_link =NULL ; -struct pipe_ctx *pipe_ctx =NULL ;struct dce_hwseq *hws = dc->hwseq;int edp_with_sink_num;int edp_num;
@@ -1819,26 +1818,9 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context) can_apply_edp_fast_boot =dc_validate_boot_timing (dc, edp_stream->sink, &edp_stream->timing); edp_stream->apply_edp_fast_boot_optimization = can_apply_edp_fast_boot; -if (can_apply_edp_fast_boot) { -DC_LOG_EVENT_LINK_TRAINING ("eDP fast boot Enable\n" ); - -// Vbios & Driver support different pixel rate div policy. - pipe_ctx =resource_get_otg_master_for_stream (&context->res_ctx, edp_stream); -if (pipe_ctx && - hws->funcs.is_dp_dig_pixel_rate_div_policy && - hws->funcs.is_dp_dig_pixel_rate_div_policy (pipe_ctx)) { -// Get Vbios div factor from register - dc->res_pool->dccg->funcs->get_pixel_rate_div ( - dc->res_pool->dccg, - pipe_ctx->stream_res.tg->inst, - &pipe_ctx->pixel_rate_divider.div_factor1, - &pipe_ctx->pixel_rate_divider.div_factor2); - -// VBios doesn't support pixel rate div, so force it. -// If VBios supports it, we check it from reigster or other flags. - pipe_ctx->pixel_per_cycle =1 ; - } - } +if (can_apply_edp_fast_boot) +DC_LOG_EVENT_LINK_TRAINING ("eDP fast boot disabled to optimize link rate\n" ); +break ; } }
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c +14 -7
@@ -828,14 +828,17 @@ enum dc_status dcn20_enable_stream_timing(struct mpc_dwb_flow_control flow_control;struct mpc *mpc = dc->res_pool->mpc;bool rate_control_2x_pclk = (interlace ||optc2_is_two_pixels_per_containter (&stream->timing)); +unsigned int k1_div =PIXEL_RATE_DIV_NA ; +unsigned int k2_div =PIXEL_RATE_DIV_NA ; + +if (hws->funcs.calculate_dccg_k1_k2_values && dc->res_pool->dccg->funcs->set_pixel_rate_div) { + hws->funcs.calculate_dccg_k1_k2_values (pipe_ctx, &k1_div, &k2_div); -if (dc->res_pool->dccg->funcs->set_pixel_rate_div) dc->res_pool->dccg->funcs->set_pixel_rate_div ( dc->res_pool->dccg, pipe_ctx->stream_res.tg->inst, - pipe_ctx->pixel_rate_divider.div_factor1, - pipe_ctx->pixel_rate_divider.div_factor2); - + k1_div, k2_div); + }/* by upper caller loop, pipe0 is parent pipe and be called first. * back end is set up by for pipe0. Other children pipe share back end * with pipe 0. No program is needed.
@@ -2896,6 +2899,9 @@ void dcn20_enable_stream(struct pipe_ctx *pipe_ctx)struct dccg *dccg = dc->res_pool->dccg;enum phyd32clk_clock_source phyd32clk;int dp_hpo_inst; +struct dce_hwseq *hws = dc->hwseq; +unsigned int k1_div =PIXEL_RATE_DIV_NA ; +unsigned int k2_div =PIXEL_RATE_DIV_NA ;struct link_encoder *link_enc =link_enc_cfg_get_link_enc (pipe_ctx->stream->link);struct stream_encoder *stream_enc = pipe_ctx->stream_res.stream_enc;
@@ -2916,13 +2922,14 @@ void dcn20_enable_stream(struct pipe_ctx *pipe_ctx) dccg->funcs->enable_symclk_se (dccg, stream_enc->stream_enc_inst, link_enc->transmitter -TRANSMITTER_UNIPHY_A ); } +if (hws->funcs.calculate_dccg_k1_k2_values && dc->res_pool->dccg->funcs->set_pixel_rate_div) { + hws->funcs.calculate_dccg_k1_k2_values (pipe_ctx, &k1_div, &k2_div); -if (dc->res_pool->dccg->funcs->set_pixel_rate_div) dc->res_pool->dccg->funcs->set_pixel_rate_div ( dc->res_pool->dccg, pipe_ctx->stream_res.tg->inst, - pipe_ctx->pixel_rate_divider.div_factor1, - pipe_ctx->pixel_rate_divider.div_factor2); + k1_div, k2_div); + } link_hwss->setup_stream_encoder (pipe_ctx);
drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.c +0 -23
@@ -332,29 +332,6 @@ unsigned int dcn314_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsigreturn odm_combine_factor; } -void dcn314_calculate_pix_rate_divider ( -struct dc *dc, -struct dc_state *context, -const struct dc_stream_state *stream) -{ -struct dce_hwseq *hws = dc->hwseq; -struct pipe_ctx *pipe_ctx =NULL ; -unsigned int k1_div =PIXEL_RATE_DIV_NA ; -unsigned int k2_div =PIXEL_RATE_DIV_NA ; - - pipe_ctx =resource_get_otg_master_for_stream (&context->res_ctx, stream); - -if (pipe_ctx) { - pipe_ctx->pixel_per_cycle =1 ; - -if (hws->funcs.calculate_dccg_k1_k2_values) - hws->funcs.calculate_dccg_k1_k2_values (pipe_ctx, &k1_div, &k2_div); - - pipe_ctx->pixel_rate_divider.div_factor1 = k1_div; - pipe_ctx->pixel_rate_divider.div_factor2 = k2_div; - } -} -void dcn314_set_pixels_per_cycle (struct pipe_ctx *pipe_ctx) {uint32_t pix_per_cycle =1 ;
drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.h +0 -4
@@ -39,10 +39,6 @@ void dcn314_enable_power_gating_plane(struct dce_hwseq *hws, bool enable);unsigned int dcn314_calculate_dccg_k1_k2_values (struct pipe_ctx *pipe_ctx,unsigned int *k1_div,unsigned int *k2_div); -void dcn314_calculate_pix_rate_divider (struct dc *dc, -struct dc_state *context, -const struct dc_stream_state *stream); -void dcn314_set_pixels_per_cycle (struct pipe_ctx *pipe_ctx);void dcn314_resync_fifo_dccg_dio (struct dce_hwseq *hws,struct dc *dc,struct dc_state *context);
drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_init.c +0 -1
@@ -152,7 +152,6 @@ static const struct hwseq_private_funcs dcn314_private_funcs = { .set_shaper_3dlut = dcn20_set_shaper_3dlut, .setup_hpo_hw_control = dcn31_setup_hpo_hw_control, .calculate_dccg_k1_k2_values = dcn314_calculate_dccg_k1_k2_values, - .calculate_pix_rate_divider = dcn314_calculate_pix_rate_divider, .set_pixels_per_cycle = dcn314_set_pixels_per_cycle, .resync_fifo_dccg_dio = dcn314_resync_fifo_dccg_dio, };
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c +9 -35
77 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.h +0 -4
@@ -91,10 +91,6 @@ void dcn32_unblank_stream(struct pipe_ctx *pipe_ctx,bool dcn32_is_dp_dig_pixel_rate_div_policy (struct pipe_ctx *pipe_ctx); -void dcn32_calculate_pix_rate_divider (struct dc *dc, -struct dc_state *context, -const struct dc_stream_state *stream); -void dcn32_disable_link_output (struct dc_link *link,const struct link_resource *link_res,enum signal_type signal);
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_init.c +0 -1
@@ -161,7 +161,6 @@ static const struct hwseq_private_funcs dcn32_private_funcs = { .set_pixels_per_cycle = dcn32_set_pixels_per_cycle, .resync_fifo_dccg_dio = dcn32_resync_fifo_dccg_dio, .is_dp_dig_pixel_rate_div_policy = dcn32_is_dp_dig_pixel_rate_div_policy, - .calculate_pix_rate_divider = dcn32_calculate_pix_rate_divider, .apply_single_controller_ctx_to_hw = dce110_apply_single_controller_ctx_to_hw, .reset_back_end_for_pipe = dcn20_reset_back_end_for_pipe, .populate_mcm_luts = dcn401_populate_mcm_luts,
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c +0 -1
@@ -162,7 +162,6 @@ static const struct hwseq_private_funcs dcn35_private_funcs = { .set_pixels_per_cycle = dcn32_set_pixels_per_cycle, .resync_fifo_dccg_dio = dcn314_resync_fifo_dccg_dio, .is_dp_dig_pixel_rate_div_policy = dcn32_is_dp_dig_pixel_rate_div_policy, - .calculate_pix_rate_divider = dcn32_calculate_pix_rate_divider, .dsc_pg_control = dcn35_dsc_pg_control, .dsc_pg_status = dcn32_dsc_pg_status, .enable_plane = dcn35_enable_plane,
drivers/gpu/drm/amd/display/dc/hwss/dcn351/dcn351_init.c +0 -1
@@ -160,7 +160,6 @@ static const struct hwseq_private_funcs dcn351_private_funcs = { .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, - .calculate_pix_rate_divider = dcn32_calculate_pix_rate_divider, .dsc_pg_control = dcn35_dsc_pg_control, .dsc_pg_status = dcn32_dsc_pg_status, .enable_plane = dcn35_enable_plane,
drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer_private.h +0 -3
@@ -177,9 +177,6 @@ struct hwseq_private_funcs {struct dc_state *context, struct dc *dc);bool (*is_dp_dig_pixel_rate_div_policy)(struct pipe_ctx *pipe_ctx); -void (*calculate_pix_rate_divider)(struct dc *dc, -struct dc_state *context, -const struct dc_stream_state *stream);void (*reset_back_end_for_pipe)(struct dc *dc,struct pipe_ctx *pipe_ctx,struct dc_state *context);
drivers/gpu/drm/amd/display/dc/inc/core_types.h +0 -7
@@ -399,11 +399,6 @@ union pipe_update_flags {uint32_t raw; }; -struct pixel_rate_divider { -uint32_t div_factor1; -uint32_t div_factor2; -}; -enum p_state_switch_method {P_STATE_UNKNOWN =0 ,P_STATE_V_BLANK =1 ,
@@ -469,8 +464,6 @@ struct pipe_ctx {bool has_vactive_margin;/* subvp_index: only valid if the pipe is a SUBVP_MAIN*/ uint8_t subvp_index; -uint32_t pixel_per_cycle; -struct pixel_rate_divider pixel_rate_divider; };/* Data used for dynamic link encoder assignment.
drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h +0 -5
@@ -176,11 +176,6 @@ struct dccg_funcs {enum pixel_rate_div k1, enum pixel_rate_div k2); -void (*get_pixel_rate_div)(struct dccg *dccg, -uint32_t otg_inst, -uint32_t *div_factor1, -uint32_t *div_factor2); - void (*set_valid_pixel_rate)( struct dccg *dccg, int ref_dtbclk_khz,
drivers/gpu/drm/amd/display/dc/inc/hw/stream_encoder.h +0 -1
@@ -99,7 +99,6 @@ struct encoder_unblank_param {struct dc_link_settings link_settings;struct dc_crtc_timing timing;int opp_cnt; -uint32_t pix_per_cycle; };struct encoder_set_dp_phy_pattern_param {
Signature · 1 line
2.37.3
PATCH 31/46 drm/amd/display: Remove redundant include file
In reply to Wayne LinFrom: Alex Hung <[email protected]>
This fixes 1 PW.INCLUDE_RECURSION reported by Coverity.
"./drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h" includes itself: dc_types.h -> dal_types.h -> dc_types.h
--- drivers/gpu/drm/amd/display/include/dal_types.h | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/display/include/dal_types.h +0 -1
@@ -27,7 +27,6 @@#define __DAL_TYPES_H__#include "signal_types.h" -#include "dc_types.h" struct dal_logger ;struct dc_bios ;
Signature · 1 line
2.37.3
PATCH 32/46 drm/amd/display: Refactor HUBBUB into component folder
In reply to Wayne LinFrom: Revalla Hari Krishna <[email protected]>
[why]
cleaning up the code refactor requires hubbub to be in its own component.
[how]
Move all files under newly created hubbub folder and fix the makefiles.
---
drivers/gpu/drm/amd/display/Makefile | 1 +
drivers/gpu/drm/amd/display/dc/Makefile | 2 +-
drivers/gpu/drm/amd/display/dc/dcn10/Makefile | 2 +-
.../dc/dcn10/dcn10_hw_sequencer_debug.c | 2 +-
drivers/gpu/drm/amd/display/dc/dcn20/Makefile | 2 +-
.../gpu/drm/amd/display/dc/dcn201/Makefile | 3 +-
drivers/gpu/drm/amd/display/dc/dcn21/Makefile | 2 +-
drivers/gpu/drm/amd/display/dc/dcn30/Makefile | 3 +-
.../gpu/drm/amd/display/dc/dcn301/Makefile | 2 +-
drivers/gpu/drm/amd/display/dc/dcn31/Makefile | 2 +-
drivers/gpu/drm/amd/display/dc/dcn32/Makefile | 2 +-
drivers/gpu/drm/amd/display/dc/dcn35/Makefile | 2 +-
.../gpu/drm/amd/display/dc/hubbub/Makefile | 100 ++++++++++++++++++
.../dc/{ => hubbub}/dcn10/dcn10_hubbub.c | 2 +-
.../dc/{ => hubbub}/dcn10/dcn10_hubbub.h | 0
.../dc/{ => hubbub}/dcn20/dcn20_hubbub.c | 0
.../dc/{ => hubbub}/dcn20/dcn20_hubbub.h | 2 +-
.../dc/{ => hubbub}/dcn201/dcn201_hubbub.c | 0
.../dc/{ => hubbub}/dcn201/dcn201_hubbub.h | 0
.../dc/{ => hubbub}/dcn21/dcn21_hubbub.c | 0
.../dc/{ => hubbub}/dcn21/dcn21_hubbub.h | 0
.../dc/{ => hubbub}/dcn30/dcn30_hubbub.c | 0
.../dc/{ => hubbub}/dcn30/dcn30_hubbub.h | 0
.../dc/{ => hubbub}/dcn301/dcn301_hubbub.c | 0
.../dc/{ => hubbub}/dcn301/dcn301_hubbub.h | 0
.../dc/{ => hubbub}/dcn31/dcn31_hubbub.c | 0
.../dc/{ => hubbub}/dcn31/dcn31_hubbub.h | 0
.../dc/{ => hubbub}/dcn32/dcn32_hubbub.c | 0
.../dc/{ => hubbub}/dcn32/dcn32_hubbub.h | 0
.../dc/{ => hubbub}/dcn35/dcn35_hubbub.c | 0
.../dc/{ => hubbub}/dcn35/dcn35_hubbub.h | 0
31 files changed, 114 insertions(+), 15 deletions(-)
create mode 100644 drivers/gpu/drm/amd/display/dc/hubbub/Makefile
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn10/dcn10_hubbub.c (99%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn10/dcn10_hubbub.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn20/dcn20_hubbub.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn20/dcn20_hubbub.h (99%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn201/dcn201_hubbub.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn201/dcn201_hubbub.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn21/dcn21_hubbub.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn21/dcn21_hubbub.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn30/dcn30_hubbub.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn30/dcn30_hubbub.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn301/dcn301_hubbub.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn301/dcn301_hubbub.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn31/dcn31_hubbub.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn31/dcn31_hubbub.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn32/dcn32_hubbub.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn32/dcn32_hubbub.h (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn35/dcn35_hubbub.c (100%)
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn35/dcn35_hubbub.h (100%)drivers/gpu/drm/amd/display/Makefile +1 -0
@@ -34,6 +34,7 @@ subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dc/resource subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dc/dsc subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dc/optc subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dc/dpp +subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dc/hubbub subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/modules/inc subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/modules/freesync subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/modules/color
drivers/gpu/drm/amd/display/dc/Makefile +1 -1
@@ -22,7 +22,7 @@ # # Makefile for Display Core (dc) component. -DC_LIBS = basics bios dml clk_mgr dce gpio hwss irq link virtual dsc resource optc dpp +DC_LIBS = basics bios dml clk_mgr dce gpio hwss irq link virtual dsc resource optc dpp hubbub ifdef CONFIG_DRM_AMD_DC_FP
drivers/gpu/drm/amd/display/dc/dcn10/Makefile +1 -1
@@ -27,7 +27,7 @@ DCN10 = dcn10_ipp.o \ dcn10_opp.o \ dcn10_hubp.o dcn10_mpc.o \ dcn10_cm_common.o \ - dcn10_hubbub.o dcn10_stream_encoder.o dcn10_link_encoder.o + dcn10_stream_encoder.o dcn10_link_encoder.o AMD_DAL_DCN10 = $(addprefix $(AMDDALPATH)/dc/dcn10/,$(DCN10))
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer_debug.c +1 -1
@@ -41,7 +41,7 @@#include "mpc.h" #include "reg_helper.h" #include "dcn10_hubp.h" -#include "dcn10_hubbub.h" +#include "dcn10/dcn10_hubbub.h" #include "dcn10_cm_common.h" #include "clk_mgr.h"
drivers/gpu/drm/amd/display/dc/dcn20/Makefile +1 -1
@@ -3,7 +3,7 @@ # Makefile for DCN. DCN20 = dcn20_hubp.o \ - dcn20_mpc.o dcn20_opp.o dcn20_hubbub.o dcn20_mmhubbub.o \ + dcn20_mpc.o dcn20_opp.o dcn20_mmhubbub.o \ dcn20_stream_encoder.o dcn20_link_encoder.o dcn20_dccg.o \ dcn20_vmid.o dcn20_dwb.o dcn20_dwb_scl.o
drivers/gpu/drm/amd/display/dc/dcn201/Makefile +1 -2
@@ -1,8 +1,7 @@ # SPDX-License-Identifier: MIT # # Makefile for DCN. -DCN201 = dcn201_hubbub.o\ - dcn201_mpc.o dcn201_hubp.o dcn201_opp.o \ +DCN201 = dcn201_mpc.o dcn201_hubp.o dcn201_opp.o \ dcn201_dccg.o dcn201_link_encoder.o AMD_DAL_DCN201 = $(addprefix $(AMDDALPATH)/dc/dcn201/,$(DCN201))
drivers/gpu/drm/amd/display/dc/dcn21/Makefile +1 -1
@@ -2,7 +2,7 @@ # # Makefile for DCN21. -DCN21 = dcn21_hubp.o dcn21_hubbub.o \ +DCN21 = dcn21_hubp.o \ dcn21_link_encoder.o dcn21_dccg.o AMD_DAL_DCN21 = $(addprefix $(AMDDALPATH)/dc/dcn21/,$(DCN21))
drivers/gpu/drm/amd/display/dc/dcn30/Makefile +1 -2
@@ -23,8 +23,7 @@ # # -DCN30 := dcn30_hubbub.o \ - dcn30_hubp.o \ +DCN30 := dcn30_hubp.o \ dcn30_dccg.o \ dcn30_mpc.o dcn30_vpg.o \ dcn30_afmt.o \
drivers/gpu/drm/amd/display/dc/dcn301/Makefile +1 -1
@@ -11,7 +11,7 @@ # Makefile for dcn30. DCN301 = dcn301_dccg.o \ - dcn301_dio_link_encoder.o dcn301_panel_cntl.o dcn301_hubbub.o + dcn301_dio_link_encoder.o dcn301_panel_cntl.o AMD_DAL_DCN301 = $(addprefix $(AMDDALPATH)/dc/dcn301/,$(DCN301))
drivers/gpu/drm/amd/display/dc/dcn31/Makefile +1 -1
@@ -10,7 +10,7 @@ # # Makefile for dcn31. -DCN31 = dcn31_hubbub.o dcn31_hubp.o \ +DCN31 = dcn31_hubp.o \ dcn31_dccg.o dcn31_dio_link_encoder.o dcn31_panel_cntl.o \ dcn31_apg.o dcn31_hpo_dp_stream_encoder.o dcn31_hpo_dp_link_encoder.o \ dcn31_afmt.o dcn31_vpg.o
drivers/gpu/drm/amd/display/dc/dcn32/Makefile +1 -1
@@ -10,7 +10,7 @@ # # Makefile for dcn32. -DCN32 = dcn32_hubbub.o dcn32_dccg.o \ +DCN32 = dcn32_dccg.o \ dcn32_mmhubbub.o dcn32_hubp.o dcn32_mpc.o \ dcn32_dio_stream_encoder.o dcn32_dio_link_encoder.o dcn32_resource_helpers.o \ dcn32_hpo_dp_link_encoder.o
drivers/gpu/drm/amd/display/dc/dcn35/Makefile +1 -1
@@ -12,7 +12,7 @@ DCN35 = dcn35_dio_stream_encoder.o \ dcn35_dio_link_encoder.o dcn35_dccg.o \ - dcn35_hubp.o dcn35_hubbub.o \ + dcn35_hubp.o \ dcn35_mmhubbub.o dcn35_opp.o dcn35_pg_cntl.o dcn35_dwb.o AMD_DAL_DCN35 = $(addprefix $(AMDDALPATH)/dc/dcn35/,$(DCN35))
drivers/gpu/drm/amd/display/dc/hubbub/Makefile new file +100 -0
101 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/hubbub/dcn10/dcn10_hubbub.c renamed from drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c +1 -1
@@ -24,7 +24,7 @@*/ #include "dm_services.h" -#include "dcn10_hubp.h" +#include "dcn10/dcn10_hubp.h" #include "dcn10_hubbub.h" #include "reg_helper.h"
drivers/gpu/drm/amd/display/dc/hubbub/dcn10/dcn10_hubbub.h renamed from drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.h +0 -0
drivers/gpu/drm/amd/display/dc/hubbub/dcn20/dcn20_hubbub.c renamed from drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubbub.c +0 -0
drivers/gpu/drm/amd/display/dc/hubbub/dcn20/dcn20_hubbub.h renamed from drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubbub.h +1 -1
@@ -27,7 +27,7 @@#define __DC_HUBBUB_DCN20_H__#include "dcn10/dcn10_hubbub.h" -#include "dcn20_vmid.h" +#include "dcn20/dcn20_vmid.h" #define TO_DCN20_HUBBUB (hubbub)\ container_of(hubbub, struct dcn20_hubbub, base)
drivers/gpu/drm/amd/display/dc/hubbub/dcn201/dcn201_hubbub.c renamed from drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hubbub.c +0 -0
drivers/gpu/drm/amd/display/dc/hubbub/dcn201/dcn201_hubbub.h renamed from drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hubbub.h +0 -0
drivers/gpu/drm/amd/display/dc/hubbub/dcn21/dcn21_hubbub.c renamed from drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubbub.c +0 -0
drivers/gpu/drm/amd/display/dc/hubbub/dcn21/dcn21_hubbub.h renamed from drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubbub.h +0 -0
drivers/gpu/drm/amd/display/dc/hubbub/dcn30/dcn30_hubbub.c renamed from drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubbub.c +0 -0
drivers/gpu/drm/amd/display/dc/hubbub/dcn30/dcn30_hubbub.h renamed from drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubbub.h +0 -0
drivers/gpu/drm/amd/display/dc/hubbub/dcn301/dcn301_hubbub.c renamed from drivers/gpu/drm/amd/display/dc/dcn301/dcn301_hubbub.c +0 -0
drivers/gpu/drm/amd/display/dc/hubbub/dcn301/dcn301_hubbub.h renamed from drivers/gpu/drm/amd/display/dc/dcn301/dcn301_hubbub.h +0 -0
drivers/gpu/drm/amd/display/dc/hubbub/dcn31/dcn31_hubbub.c renamed from drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.c +0 -0
drivers/gpu/drm/amd/display/dc/hubbub/dcn31/dcn31_hubbub.h renamed from drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.h +0 -0
drivers/gpu/drm/amd/display/dc/hubbub/dcn32/dcn32_hubbub.c renamed from drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubbub.c +0 -0
drivers/gpu/drm/amd/display/dc/hubbub/dcn32/dcn32_hubbub.h renamed from drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubbub.h +0 -0
drivers/gpu/drm/amd/display/dc/hubbub/dcn35/dcn35_hubbub.c renamed from drivers/gpu/drm/amd/display/dc/dcn35/dcn35_hubbub.c +0 -0
drivers/gpu/drm/amd/display/dc/hubbub/dcn35/dcn35_hubbub.h renamed from drivers/gpu/drm/amd/display/dc/dcn35/dcn35_hubbub.h +0 -0
Signature · 1 line
2.37.3
PATCH 33/46 drm/amd/display: Assign linear_pitch_alignment even for VM
In reply to Wayne LinFrom: Alvin Lee <[email protected]>
[Description]
Assign linear_pitch_alignment so we don't cause a divide by 0 error in VM environments
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -0
@@ -1425,6 +1425,7 @@ struct dc *dc_create(const struct dc_init_data *init_params)return NULL ;if (init_params->dce_environment ==DCE_ENV_VIRTUAL_HW ) { + dc->caps.linear_pitch_alignment =64 ;if (!dc_construct_ctx (dc, init_params)) goto destruct_dc; }else {
Signature · 1 line
2.37.3
PATCH 34/46 drm/amd/display: gpuvm handling in DML21
In reply to Wayne LinFrom: Nevenko Stupar <[email protected]>
[Why & How]
Currently in DML2.1 gpuvm_enable was hardcoded.
Use passed info from DC for DML21 to be in sync with what is used in DC.
--- drivers/gpu/drm/amd/display/dc/core/dc_vm_helper.c | 1 + .../drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c | 2 +- drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_vm_helper.c +1 -0
@@ -47,6 +47,7 @@ int dc_setup_system_context(struct dc *dc, struct dc_phy_addr_space_config *pa_c*/ memcpy (&dc->vm_pa_config, pa_config,sizeof (struct dc_phy_addr_space_config )); dc->vm_pa_config.valid = true; + dc->dml2_options.gpuvm_enable = true;dc_z10_save_init (dc); }
drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c +1 -1
@@ -943,7 +943,7 @@ bool dml21_map_dc_state_into_dml_display_cfg(const struct dc *in_dc, struct dc_smemset (&dml_ctx->v21.dml_to_dc_pipe_mapping,0 ,sizeof (struct dml2_dml_to_dc_pipe_mapping )); - dml_dispcfg->gpuvm_enable = true; + dml_dispcfg->gpuvm_enable = dml_ctx->config.gpuvm_enable; dml_dispcfg->gpuvm_max_page_table_levels =4 ; dml_dispcfg->hostvm_enable = false; dml_dispcfg->minimize_det_reallocation = true;
drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h +1 -0
@@ -232,6 +232,7 @@ struct dml2_configuration_options {bool map_dc_pipes_with_callbacks;bool use_clock_dc_limits; +bool gpuvm_enable; };/*
Signature · 1 line
2.37.3
PATCH 35/46 drm/amd/display: For FPO + Vactive check that all pipes support VA
In reply to Wayne LinFrom: Alvin Lee <[email protected]>
[Description]
For FPO + Vactive scenarios we must check that all non-FPO pipes have VACTIVE margin to allow it. The previous check only confirmed that there is at least one pipe that has vactive margin, but this is incorrect as the vactive display could be using two pipes (MPO) where the desktop plane has vactive margin, and the video plane does not.
--- .../display/dc/dcn32/dcn32_resource_helpers.c | 2 +- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 20 ++++++++++++++----- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.h | 2 +- 3 files changed, 17 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c +1 -1
@@ -545,7 +545,7 @@ struct dc_stream_state *dcn32_can_support_mclk_switch_using_fw_based_vblank_streif (fpo_candidate_stream) fpo_stream_status =dc_state_get_stream_status (context, fpo_candidate_stream);DC_FP_START (); - is_fpo_vactive =dcn32_find_vactive_pipe (dc, context, dc->debug.fpo_vactive_min_active_margin_us); + is_fpo_vactive =dcn32_find_vactive_pipe (dc, context, fpo_candidate_stream, dc->debug.fpo_vactive_min_active_margin_us);DC_FP_END ();if (!is_fpo_vactive || dc->debug.disable_fpo_vactive)return NULL ;
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +15 -5
@@ -3521,15 +3521,16 @@ void dcn32_assign_fpo_vactive_candidate(struct dc *dc, const struct dc_state *co* * @dc: current dc state * @context: new dc state +* @fpo_candidate_stream: candidate stream to be chosen for FPO * @vactive_margin_req_us: The vactive marign required for a vactive pipe to be considered "found" * * Return: True if VACTIVE display is found, false otherwise */ -bool dcn32_find_vactive_pipe (struct dc *dc,const struct dc_state *context,uint32_t vactive_margin_req_us) +bool dcn32_find_vactive_pipe (struct dc *dc,const struct dc_state *context,struct dc_stream_state *fpo_candidate_stream,uint32_t vactive_margin_req_us) {unsigned int i, pipe_idx;const struct vba_vars_st *vba = &context->bw_ctx.dml.vba; -bool vactive_found = false; +bool vactive_found = true;unsigned int blank_us =0 ;for (i =0 , pipe_idx =0 ; i < dc->res_pool->pipe_count; i++) {
@@ -3538,11 +3539,20 @@ bool dcn32_find_vactive_pipe(struct dc *dc, const struct dc_state *context, uintif (!pipe->stream)continue ; +/* Don't need to check for vactive margin on the FPO candidate stream */ +if (fpo_candidate_stream && pipe->stream == fpo_candidate_stream) { + pipe_idx++; +continue ; + } + +/* Every plane (apart from the ones driven by the FPO pipes) needs to have active margin +* in order for us to have found a valid "vactive" config for FPO + Vactive +*/ blank_us = ((pipe->stream->timing.v_total - pipe->stream->timing.v_addressable) * pipe->stream->timing.h_total / (double )(pipe->stream->timing.pix_clk_100hz *100 )) *1000000 ; -if (vba->ActiveDRAMClockChangeLatencyMarginPerState[vba->VoltageLevel][vba->maxMpcComb][vba->pipe_plane[pipe_idx]] >= vactive_margin_req_us && - !(pipe->stream->vrr_active_variable || pipe->stream->vrr_active_fixed) && blank_us < dc->debug.fpo_vactive_max_blank_us) { - vactive_found = true; +if (vba->ActiveDRAMClockChangeLatencyMarginPerState[vba->VoltageLevel][vba->maxMpcComb][vba->pipe_plane[pipe_idx]] < vactive_margin_req_us || + pipe->stream->vrr_active_variable || pipe->stream->vrr_active_fixed || blank_us >= dc->debug.fpo_vactive_max_blank_us) { + vactive_found = false;break ; } pipe_idx++;
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.h +1 -1
@@ -71,7 +71,7 @@ void dcn32_zero_pipe_dcc_fraction(display_e2e_pipe_params_st *pipes,void dcn32_assign_fpo_vactive_candidate (struct dc *dc,const struct dc_state *context,struct dc_stream_state **fpo_candidate_stream); -bool dcn32_find_vactive_pipe (struct dc *dc,const struct dc_state *context,uint32_t vactive_margin_req); +bool dcn32_find_vactive_pipe (struct dc *dc,const struct dc_state *context,struct dc_stream_state *fpo_candidate_stream,uint32_t vactive_margin_req);void dcn32_override_min_req_memclk (struct dc *dc,struct dc_state *context);
Signature · 1 line
2.37.3
PATCH 36/46 drm/amd/display: Fix uninitialized variables in DM
In reply to Wayne LinFrom: Alex Hung <[email protected]>
This fixes 11 UNINIT issues reported by Coverity.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8 ++++---- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -4
@@ -277,7 +277,7 @@ static u32 dm_vblank_get_counter(struct amdgpu_device *adev, int crtc)static int dm_crtc_get_scanoutpos (struct amdgpu_device *adev,int crtc,u32 *vbl,u32 *position) { -u32 v_blank_start, v_blank_end, h_position, v_position; +u32 v_blank_start =0 , v_blank_end =0 , h_position =0 , v_position =0 ;struct amdgpu_crtc *acrtc =NULL ;struct dc *dc = adev->dm.dc;
@@ -851,7 +851,7 @@ static void dm_handle_hpd_work(struct work_struct *work)*/ static void dm_dmub_outbox1_low_irq (void *interrupt_params) { -struct dmub_notification notify; +struct dmub_notification notify = {0 };struct common_irq_params *irq_params = interrupt_params;struct amdgpu_device *adev = irq_params->adev;struct amdgpu_display_manager *dm = &adev->dm;
@@ -7228,7 +7228,7 @@ static int dm_update_mst_vcpi_slots_for_dsc(struct drm_atomic_state *state,struct amdgpu_dm_connector *aconnector;struct dm_connector_state *dm_conn_state;int i, j, ret; -int vcpi, pbn_div, pbn, slot_num =0 ; +int vcpi, pbn_div, pbn =0 , slot_num =0 ;for_each_new_connector_in_state (state, connector, new_con_state, i) {
@@ -10713,7 +10713,7 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,struct dm_crtc_state *dm_old_crtc_state, *dm_new_crtc_state;struct drm_dp_mst_topology_mgr *mgr;struct drm_dp_mst_topology_state *mst_state; -struct dsc_mst_fairness_vars vars[MAX_PIPES ]; +struct dsc_mst_fairness_vars vars[MAX_PIPES ] = {0 };trace_amdgpu_dm_atomic_check_begin (state);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +2 -2
@@ -1249,7 +1249,7 @@ static ssize_t dp_sdp_message_debugfs_write(struct file *f, const char __user *b size_t size, loff_t *pos) { int r; -uint8_t data[36 ]; +uint8_t data[36 ] = {0 };struct amdgpu_dm_connector *connector =file_inode (f)->i_private;struct dm_crtc_state *acrtc_state;uint32_t write_size =36 ;
@@ -2960,7 +2960,7 @@ static int psr_read_residency(void *data, u64 *val) {struct amdgpu_dm_connector *connector = data;struct dc_link *link = connector->dc_link; -u32 residency; +u32 residency =0 ; link->dc->link_srv->edp_get_psr_residency (link, &residency);
Signature · 1 line
2.37.3
PATCH 37/46 drm/amd/display: Fix uninitialized variables in DC
In reply to Wayne LinFrom: Alex Hung <[email protected]>
This fixes 49 UNINIT issues reported by Coverity.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 4 ++-- .../gpu/drm/amd/display/dc/core/dc_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_mpc.c | 2 +- .../amd/display/dc/dml2/dml2_dc_resource_mgmt.c | 2 +- .../drm/amd/display/dc/dpp/dcn10/dcn10_dpp_cm.c | 2 +- .../drm/amd/display/dc/dpp/dcn20/dcn20_dpp_cm.c | 2 +- .../drm/amd/display/dc/dpp/dcn30/dcn30_dpp_cm.c | 2 +- .../gpu/drm/amd/display/dc/gpio/gpio_service.c | 6 +++--- .../amd/display/dc/hwss/dce110/dce110_hwseq.c | 4 ++-- .../drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c | 6 +++--- .../amd/display/dc/hwss/dcn201/dcn201_hwseq.c | 2 +- .../drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.c | 2 +- .../drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.c | 2 +- drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 8 ++++---- .../dc/link/protocols/link_dp_capability.c | 16 ++++++++-------- .../dc/link/protocols/link_dp_irq_handler.c | 10 +++++----- .../dc/link/protocols/link_edp_panel_control.c | 4 ++-- .../drm/amd/display/dc/link/protocols/link_hpd.c | 2 +- 18 files changed, 39 insertions(+), 39 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -2
@@ -1310,7 +1310,7 @@ static void disable_vbios_mode_if_required(if (link !=NULL && link->link_enc->funcs->is_dig_enabled (link->link_enc)) {unsigned int enc_inst, tg_inst =0 ; -unsigned int pix_clk_100hz; +unsigned int pix_clk_100hz =0 ; enc_inst = link->link_enc->funcs->get_dig_frontend (link->link_enc);if (enc_inst !=ENGINE_ID_UNKNOWN ) {
@@ -1796,7 +1796,7 @@ bool dc_validate_boot_timing(const struct dc *dc,return false;if (dc_is_dp_signal (link->connector_signal)) { -unsigned int pix_clk_100hz; +unsigned int pix_clk_100hz =0 ;uint32_t numOdmPipes =1 ;uint32_t id_src[4 ] = {0 };
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1 -1
@@ -3084,7 +3084,7 @@ bool resource_update_pipes_for_plane_with_slice_count(int i;int dpp_pipe_count;int cur_slice_count; -struct pipe_ctx *dpp_pipes[MAX_PIPES ]; +struct pipe_ctx *dpp_pipes[MAX_PIPES ] = {0 };bool result = true; dpp_pipe_count = resource_get_dpp_pipes_for_plane(plane,
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_mpc.c +1 -1
@@ -1183,7 +1183,7 @@ void mpc3_get_gamut_remap(struct mpc *mpc, struct mpc_grph_gamut_adjustment *adjust) {struct dcn30_mpc *mpc30 =TO_DCN30_MPC (mpc); -uint16_t arr_reg_val[12 ]; +uint16_t arr_reg_val[12 ] = {0 };int select;read_gamut_remap (mpc30, mpcc_id, arr_reg_val, &select);
drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c +1 -1
@@ -901,7 +901,7 @@ static unsigned int get_source_mpc_factor(const struct dml2_context *ctx,struct dc_state *state, const struct dc_plane_state *plane) { - struct pipe_ctx *dpp_pipes[MAX_PIPES]; + struct pipe_ctx *dpp_pipes[MAX_PIPES] = {0};int dpp_pipe_count = ctx->config.callbacks.get_dpp_pipes_for_plane (plane, &state->res_ctx, dpp_pipes);
drivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp_cm.c +1 -1
@@ -234,7 +234,7 @@ void dpp1_cm_get_gamut_remap(struct dpp *dpp_base, struct dpp_grph_csc_adjustment *adjust) {struct dcn10_dpp *dpp =TO_DCN10_DPP (dpp_base); -uint16_t arr_reg_val[12 ]; +uint16_t arr_reg_val[12 ] = {0 };enum gamut_remap_select select;read_gamut_remap (dpp, arr_reg_val, &select);
drivers/gpu/drm/amd/display/dc/dpp/dcn20/dcn20_dpp_cm.c +1 -1
@@ -274,7 +274,7 @@ void dpp2_cm_get_gamut_remap(struct dpp *dpp_base, struct dpp_grph_csc_adjustment *adjust) {struct dcn20_dpp *dpp =TO_DCN20_DPP (dpp_base); -uint16_t arr_reg_val[12 ]; +uint16_t arr_reg_val[12 ] = {0 };enum dcn20_gamut_remap_select select;read_gamut_remap (dpp, arr_reg_val, &select);
drivers/gpu/drm/amd/display/dc/dpp/dcn30/dcn30_dpp_cm.c +1 -1
@@ -445,7 +445,7 @@ void dpp3_cm_get_gamut_remap(struct dpp *dpp_base, struct dpp_grph_csc_adjustment *adjust) {struct dcn3_dpp *dpp =TO_DCN30_DPP (dpp_base); -uint16_t arr_reg_val[12 ]; +uint16_t arr_reg_val[12 ] = {0 };int select;read_gamut_remap (dpp, arr_reg_val, &select);
drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c +3 -3
@@ -128,7 +128,7 @@ struct gpio *dal_gpio_service_create_irq( uint32_t offset, uint32_t mask) { -enum gpio_id id; +enum gpio_id id =0 ;uint32_t en;if (!service->translate.funcs->offset_to_id (offset, mask, &id, &en)) {
@@ -144,7 +144,7 @@ struct gpio *dal_gpio_service_create_generic_mux( uint32_t offset, uint32_t mask) { -enum gpio_id id; +enum gpio_id id =0 ;uint32_t en;struct gpio *generic;
@@ -178,7 +178,7 @@ struct gpio_pin_info dal_gpio_get_generic_pin_info( enum gpio_id id, uint32_t en) { -struct gpio_pin_info pin; +struct gpio_pin_info pin = {0 };if (service->translate.funcs->id_to_offset) { service->translate.funcs->id_to_offset (id, en, &pin);
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +2 -2
@@ -1537,7 +1537,7 @@ enum dc_status dce110_apply_single_controller_ctx_to_hw( }if (pipe_ctx->stream_res.audio !=NULL ) { -struct audio_output audio_output; +struct audio_output audio_output = {0 };build_audio_output (context, pipe_ctx, &audio_output);
@@ -2260,7 +2260,7 @@ static void dce110_setup_audio_dto(continue ;if (pipe_ctx->stream_res.audio !=NULL ) { -struct audio_output audio_output; +struct audio_output audio_output = {0 };build_audio_output (context, pipe_ctx, &audio_output);
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +3 -3
@@ -2186,7 +2186,7 @@ static int dcn10_align_pixel_clocks(struct dc *dc, int group_size,struct dc_crtc_timing *hw_crtc_timing;uint64_t phase[MAX_PIPES ];uint64_t modulo[MAX_PIPES ]; -unsigned int pclk; +unsigned int pclk =0 ;uint32_t embedded_pix_clk_100hz;uint16_t embedded_h_total;
@@ -2277,7 +2277,7 @@ void dcn10_enable_vblanks_synchronization(struct dc_context *dc_ctx = dc->ctx;struct output_pixel_processor *opp;struct timing_generator *tg; -int i, width, height, master; +int i, width =0 , height =0 , master;DC_LOGGER_INIT (dc_ctx->logger);
@@ -2343,7 +2343,7 @@ void dcn10_enable_timing_synchronization(struct dc_context *dc_ctx = dc->ctx;struct output_pixel_processor *opp;struct timing_generator *tg; -int i, width, height; +int i, width =0 , height =0 ;DC_LOGGER_INIT (dc_ctx->logger);
drivers/gpu/drm/amd/display/dc/hwss/dcn201/dcn201_hwseq.c +1 -1
@@ -170,7 +170,7 @@ void dcn201_init_blank(struct tg_color black_color = {0 };struct output_pixel_processor *opp =NULL ;uint32_t num_opps, opp_id_src0, opp_id_src1; -uint32_t otg_active_width, otg_active_height; +uint32_t otg_active_width =0 , otg_active_height =0 ;/* program opp dpg blank color */ color_space =COLOR_SPACE_SRGB ;
drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.c +1 -1
@@ -66,7 +66,7 @@ static void mmhub_update_page_table_config(struct dcn_hubbub_phys_addr_config *cint dcn21_init_sys_ctx (struct dce_hwseq *hws,struct dc *dc,struct dc_phy_addr_space_config *pa_config) { -struct dcn_hubbub_phys_addr_config config; +struct dcn_hubbub_phys_addr_config config = {0 }; config.system_aperture.fb_top = pa_config->system_aperture.fb_top; config.system_aperture.fb_offset = pa_config->system_aperture.fb_offset;
drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.c +1 -1
@@ -479,7 +479,7 @@ void dcn31_hubp_pg_control(struct dce_hwseq *hws, unsigned int hubp_inst, bool pint dcn31_init_sys_ctx (struct dce_hwseq *hws,struct dc *dc,struct dc_phy_addr_space_config *pa_config) { -struct dcn_hubbub_phys_addr_config config; +struct dcn_hubbub_phys_addr_config config = {0 }; config.system_aperture.fb_top = pa_config->system_aperture.fb_top; config.system_aperture.fb_offset = pa_config->system_aperture.fb_offset;
drivers/gpu/drm/amd/display/dc/link/link_dpms.c +4 -4
@@ -726,7 +726,7 @@ static void set_avmute(struct pipe_ctx *pipe_ctx, bool enable)static void enable_mst_on_sink (struct dc_link *link,bool enable) { -unsigned char mstmCntl; +unsigned char mstmCntl =0 ;core_link_read_dpcd (link,DP_MSTM_CTRL , &mstmCntl,1 );if (enable)
@@ -804,7 +804,7 @@ void link_set_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable)if (enable) {struct dsc_config dsc_cfg; -struct dsc_optc_config dsc_optc_cfg; +struct dsc_optc_config dsc_optc_cfg = {0 };enum optc_dsc_mode optc_dsc_mode;/* Enable DSC hw block */
@@ -1580,7 +1580,7 @@ static bool write_128b_132b_sst_payload_allocation_table(break ; } }else { -union dpcd_rev dpcdRev; +union dpcd_rev dpcdRev = {0 }; if (core_link_read_dpcd( link,
@@ -2124,7 +2124,7 @@ static enum dc_status enable_link_dp_mst( struct pipe_ctx *pipe_ctx) {struct dc_link *link = pipe_ctx->stream->link; -unsigned char mstm_cntl; +unsigned char mstm_cntl =0 ;/* sink signal type after MST branch is MST. Multiple MST sinks * share one link. Link DP PHY is enable or training only once.
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c +8 -8
@@ -992,7 +992,7 @@ enum dp_link_encoding mst_decide_link_encoding_format(const struct dc_link *linkstatic void read_dp_device_vendor_id (struct dc_link *link) { -struct dp_device_vendor_id dp_id; +struct dp_device_vendor_id dp_id = {0 };/* read IEEE branch device id */ core_link_read_dpcd(
@@ -1087,7 +1087,7 @@ static void get_active_converter_info( }if (link->dpcd_caps.dpcd_rev.raw >=DPCD_REV_11 ) { -uint8_t det_caps[16 ];/* CTS 4.2.2.7 expects source to read Detailed Capabilities Info : 00080h-0008F.*/ +uint8_t det_caps[16 ] = {0 };/* CTS 4.2.2.7 expects source to read Detailed Capabilities Info : 00080h-0008F.*/ union dwnstream_port_caps_byte0 *port_caps = (union dwnstream_port_caps_byte0 *)det_caps; if (core_link_read_dpcd(link, DP_DOWNSTREAM_PORT_0,
@@ -1172,7 +1172,7 @@ static void get_active_converter_info(set_dongle_type (link->ddc, link->dpcd_caps.dongle_type); { -struct dp_sink_hw_fw_revision dp_hw_fw_revision; +struct dp_sink_hw_fw_revision dp_hw_fw_revision = {0 }; core_link_read_dpcd( link,
@@ -1242,7 +1242,7 @@ static void apply_usbc_combo_phy_reset_wa(struct dc_link *link,bool dp_overwrite_extended_receiver_cap (struct dc_link *link) { -uint8_t dpcd_data[16 ]; +uint8_t dpcd_data[16 ] = {0 };uint32_t read_dpcd_retry_cnt =3 ;enum dc_status status =DC_ERROR_UNEXPECTED ;union dp_downstream_port_present ds_port = {0 };
@@ -1408,7 +1408,7 @@ static bool get_usbc_cable_id(struct dc_link *link, union dp_cable_id *cable_id)static void retrieve_cable_id (struct dc_link *link) { -union dp_cable_id usbc_cable_id; +union dp_cable_id usbc_cable_id = {0 }; link->dpcd_caps.cable_id.raw =0 ; core_link_read_dpcd(link, DP_CABLE_ATTRIBUTES_UPDATED_BY_DPRX,
@@ -1475,7 +1475,7 @@ static bool dpcd_read_sink_ext_caps(struct dc_link *link)enum dc_status dp_retrieve_lttpr_cap (struct dc_link *link) { -uint8_t lttpr_dpcd_data[8 ]; +uint8_t lttpr_dpcd_data[8 ] = {0 };enum dc_status status;bool is_lttpr_present;
@@ -1931,8 +1931,8 @@ void detect_edp_sink_caps(struct dc_link *link)uint32_t entry;uint32_t link_rate_in_khz;enum dc_link_rate link_rate =LINK_RATE_UNKNOWN ; -uint8_t backlight_adj_cap; -uint8_t general_edp_cap; +uint8_t backlight_adj_cap =0 ; +uint8_t general_edp_cap =0 ;retrieve_link_cap (link); link->dpcd_caps.edp_supported_link_rates_count =0 ;
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_irq_handler.c +5 -5
@@ -120,7 +120,7 @@ bool dp_parse_link_loss_status(static bool handle_hpd_irq_psr_sink (struct dc_link *link) { -union dpcd_psr_configuration psr_configuration; +union dpcd_psr_configuration psr_configuration = {0 };if (!link->psr_settings.psr_feature_enabled)return false;
@@ -186,9 +186,9 @@ static bool handle_hpd_irq_psr_sink(struct dc_link *link)static void handle_hpd_irq_replay_sink (struct dc_link *link) { -union dpcd_replay_configuration replay_configuration; +union dpcd_replay_configuration replay_configuration = {0 };/*AMD Replay version reuse DP_PSR_ERROR_STATUS for REPLAY_ERROR status.*/ -union psr_error_status replay_error_status; +union psr_error_status replay_error_status = {0 };if (!link->replay_settings.replay_feature_enabled)return ;
@@ -280,7 +280,7 @@ void dp_handle_link_loss(struct dc_link *link)static void read_dpcd204h_on_irq_hpd (struct dc_link *link,union hpd_irq_data *irq_data) {enum dc_status retval; -union lane_align_status_updated dpcd_lane_status_updated; +union lane_align_status_updated dpcd_lane_status_updated = {0 }; retval = core_link_read_dpcd( link,
@@ -320,7 +320,7 @@ enum dc_status dp_read_hpd_rx_irq_data(/* Read 14 bytes in a single read and then copy only the required fields. * This is more efficient than doing it in two separate AUX reads. */ -uint8_t tmp[DP_SINK_STATUS_ESI -DP_SINK_COUNT_ESI +1 ]; +uint8_t tmp[DP_SINK_STATUS_ESI -DP_SINK_COUNT_ESI +1 ] = {0 }; retval = core_link_read_dpcd( link,
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c +2 -2
@@ -321,8 +321,8 @@ bool edp_is_ilr_optimization_required(struct dc_link *link, struct dc_crtc_timing *crtc_timing) {struct dc_link_settings link_setting; -uint8_t link_bw_set; -uint8_t link_rate_set; +uint8_t link_bw_set =0 ; +uint8_t link_rate_set =0 ;uint32_t req_bw;union lane_count_set lane_count_set = {0 };
drivers/gpu/drm/amd/display/dc/link/protocols/link_hpd.c +1 -1
@@ -35,7 +35,7 @@bool link_get_hpd_state (struct dc_link *link) { -uint32_t state; +uint32_t state =0 ;dal_gpio_lock_pin (link->hpd_gpio);dal_gpio_get_value (link->hpd_gpio, &state);
Signature · 1 line
2.37.3
PATCH 38/46 drm/amd/display: Fix FEC_READY write on DP LT
In reply to Wayne LinFrom: Ilya Bakoulin <[email protected]>
[Why/How]
We can miss writing FEC_READY in some cases before LT start, which violates DP spec. Remove the condition guarding the DPCD write so that the write happens unconditionally.
--- .../amd/display/dc/link/protocols/link_dp_phy.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_phy.c +6 -8
@@ -151,16 +151,14 @@ enum dc_status dp_set_fec_ready(struct dc_link *link, const struct link_resourcereturn DC_NOT_SUPPORTED ;if (ready &&dp_should_enable_fec (link)) { -if (link->fec_state == dc_link_fec_not_ready) { - fec_config =1 ; + fec_config =1 ; - status =core_link_write_dpcd (link,DP_FEC_CONFIGURATION , - &fec_config,sizeof (fec_config)); + status =core_link_write_dpcd (link,DP_FEC_CONFIGURATION , + &fec_config,sizeof (fec_config)); -if (status ==DC_OK ) { - link_enc->funcs->fec_set_ready (link_enc, true); - link->fec_state = dc_link_fec_ready; - } +if (status ==DC_OK ) { + link_enc->funcs->fec_set_ready (link_enc, true); + link->fec_state = dc_link_fec_ready; } }else {if (link->fec_state == dc_link_fec_ready) {
Signature · 1 line
2.37.3
PATCH 39/46 drm/amd/display: use even ODM slice width for two pixels per container
In reply to Wayne LinFrom: Wenjing Liu <[email protected]>
[why]
When optc uses two pixel per container, each ODM slice width must be an even number.
[how]
If ODM slice width is odd number increase it by 1.
--- .../gpu/drm/amd/display/dc/core/dc_resource.c | 8 ++++ .../dc/dce110/dce110_timing_generator.c | 18 ++++++++ .../dc/dce110/dce110_timing_generator.h | 2 + .../dc/dce110/dce110_timing_generator_v.c | 3 +- .../dc/dce120/dce120_timing_generator.c | 1 + .../display/dc/dce80/dce80_timing_generator.c | 1 + .../display/dc/dml2/dml2_translation_helper.c | 2 +- .../amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 19 ++++++-- .../amd/display/dc/hwss/dcn201/dcn201_hwseq.c | 2 +- .../amd/display/dc/hwss/dcn314/dcn314_hwseq.c | 4 +- .../amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 6 +-- drivers/gpu/drm/amd/display/dc/inc/hw/optc.h | 4 +- .../amd/display/dc/inc/hw/timing_generator.h | 1 + .../amd/display/dc/optc/dcn10/dcn10_optc.c | 46 +++++++++---------- .../amd/display/dc/optc/dcn20/dcn20_optc.c | 10 +--- .../amd/display/dc/optc/dcn20/dcn20_optc.h | 1 - .../amd/display/dc/optc/dcn201/dcn201_optc.c | 7 +-- .../amd/display/dc/optc/dcn201/dcn201_optc.h | 3 -- .../amd/display/dc/optc/dcn30/dcn30_optc.c | 3 +- .../amd/display/dc/optc/dcn301/dcn301_optc.c | 1 + .../amd/display/dc/optc/dcn31/dcn31_optc.c | 1 + .../amd/display/dc/optc/dcn314/dcn314_optc.c | 3 +- .../amd/display/dc/optc/dcn32/dcn32_optc.c | 3 +- .../amd/display/dc/optc/dcn35/dcn35_optc.c | 1 + .../amd/display/dc/optc/dcn401/dcn401_optc.c | 15 ++++-- .../dc/resource/dcn20/dcn20_resource.c | 2 +- 26 files changed, 103 insertions(+), 64 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +8 -0
@@ -827,6 +827,11 @@ static struct rect calculate_odm_slice_in_timing_active(struct pipe_ctx *pipe_ct stream->timing.h_border_right;int odm_slice_width = h_active / odm_slice_count;struct rect odm_rec; +bool is_two_pixels_per_container = + pipe_ctx->stream_res.tg->funcs->is_two_pixels_per_container (&stream->timing); + +if ((odm_slice_width %2 ) && is_two_pixels_per_container) + odm_slice_width++; odm_rec.x = odm_slice_width * odm_slice_idx; odm_rec.width = is_last_odm_slice ?
@@ -1464,6 +1469,7 @@ void resource_build_test_pattern_params(struct resource_context *res_ctx,int v_active = otg_master->stream->timing.v_addressable + otg_master->stream->timing.v_border_bottom + otg_master->stream->timing.v_border_top; +bool is_two_pixels_per_container = otg_master->stream_res.tg->funcs->is_two_pixels_per_container (&otg_master->stream->timing);int i; controller_test_pattern = convert_dp_to_controller_test_pattern(
@@ -1477,6 +1483,8 @@ void resource_build_test_pattern_params(struct resource_context *res_ctx, odm_cnt =resource_get_opp_heads_for_otg_master (otg_master, res_ctx, opp_heads); odm_slice_width = h_active / odm_cnt; +if ((odm_slice_width %2 ) && is_two_pixels_per_container) + odm_slice_width++; last_odm_slice_width = h_active - odm_slice_width * (odm_cnt -1 );for (i =0 ; i < odm_cnt; i++) {
drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator.c +18 -0
@@ -2015,6 +2015,23 @@ bool dce110_tg_validate_timing(struct timing_generator *tg,return dce110_timing_generator_validate_timing (tg, timing,SIGNAL_TYPE_NONE ); } +/* "Container" vs. "pixel" is a concept within HW blocks, mostly those closer to the back-end. It works like this: +* +* - In most of the formats (RGB or YCbCr 4:4:4, 4:2:2 uncompressed and DSC 4:2:2 Simple) pixel rate is the same as +* container rate. +* +* - In 4:2:0 (DSC or uncompressed) there are two pixels per container, hence the target container rate has to be +* halved to maintain the correct pixel rate. +* +* - Unlike 4:2:2 uncompressed, DSC 4:2:2 Native also has two pixels per container (this happens when DSC is applied +* to it) and has to be treated the same as 4:2:0, i.e. target containter rate has to be halved in this case as well. +* +*/ +bool dce110_is_two_pixels_per_container (const struct dc_crtc_timing *timing) +{ +return timing->pixel_encoding ==PIXEL_ENCODING_YCBCR420 ; +} +void dce110_tg_wait_for_state (struct timing_generator *tg,enum crtc_state state) {
@@ -2239,6 +2256,7 @@ static const struct timing_generator_funcs dce110_tg_funcs = { .is_tg_enabled = dce110_is_tg_enabled, .configure_crc = dce110_configure_crc, .get_crc = dce110_get_crc, + .is_two_pixels_per_container = dce110_is_two_pixels_per_container, }; void dce110_timing_generator_construct(
drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator.h +2 -0
@@ -288,4 +288,6 @@ bool dce110_configure_crc(struct timing_generator *tg,bool dce110_get_crc (struct timing_generator *tg,uint32_t *r_cr,uint32_t *g_y,uint32_t *b_cb); +bool dce110_is_two_pixels_per_container (const struct dc_crtc_timing *timing); +#endif /* __DC_TIMING_GENERATOR_DCE110_H__ */
drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator_v.c +2 -1
@@ -682,7 +682,8 @@ static const struct timing_generator_funcs dce110_tg_v_funcs = { .tear_down_global_swap_lock = dce110_timing_generator_v_tear_down_global_swap_lock, .enable_advanced_request = - dce110_timing_generator_v_enable_advanced_request + dce110_timing_generator_v_enable_advanced_request, + .is_two_pixels_per_container = dce110_is_two_pixels_per_container, }; void dce110_timing_generator_v_construct(
drivers/gpu/drm/amd/display/dc/dce120/dce120_timing_generator.c +1 -0
@@ -1197,6 +1197,7 @@ static const struct timing_generator_funcs dce120_tg_funcs = { .is_tg_enabled = dce120_is_tg_enabled, .configure_crc = dce120_configure_crc, .get_crc = dce120_get_crc, + .is_two_pixels_per_container = dce110_is_two_pixels_per_container, };
drivers/gpu/drm/amd/display/dc/dce80/dce80_timing_generator.c +1 -0
@@ -220,6 +220,7 @@ static const struct timing_generator_funcs dce80_tg_funcs = { dce80_timing_generator_enable_advanced_request, .configure_crc = dce110_configure_crc, .get_crc = dce110_get_crc, + .is_two_pixels_per_container = dce110_is_two_pixels_per_container, }; void dce80_timing_generator_construct(
drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c +1 -1
@@ -941,7 +941,7 @@ static struct scaler_data get_scaler_data_for_plane(const struct dc_plane_state temp_pipe->stream = pipe->stream; temp_pipe->plane_state = pipe->plane_state; temp_pipe->plane_res.scl_data.taps = pipe->plane_res.scl_data.taps; - + temp_pipe->stream_res = pipe->stream_res;resource_build_scaling_params (temp_pipe);break ; }
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c +14 -5
@@ -758,9 +758,9 @@ void dcn20_disable_pixel_data(struct dc *dc, struct pipe_ctx *pipe_ctx, bool bla }static int calc_mpc_flow_ctrl_cnt (const struct dc_stream_state *stream, -int opp_cnt) +int opp_cnt,bool is_two_pixels_per_container) { -bool hblank_halved =optc2_is_two_pixels_per_containter (&stream->timing); +bool hblank_halved = is_two_pixels_per_container;int flow_ctrl_cnt;if (opp_cnt >=2 )
@@ -827,7 +827,9 @@ enum dc_status dcn20_enable_stream_timing(int i;struct mpc_dwb_flow_control flow_control;struct mpc *mpc = dc->res_pool->mpc; -bool rate_control_2x_pclk = (interlace ||optc2_is_two_pixels_per_containter (&stream->timing)); +bool is_two_pixels_per_container = + pipe_ctx->stream_res.tg->funcs->is_two_pixels_per_container (&stream->timing); +bool rate_control_2x_pclk = (interlace || is_two_pixels_per_container);unsigned int k1_div =PIXEL_RATE_DIV_NA ;unsigned int k2_div =PIXEL_RATE_DIV_NA ;
@@ -913,7 +915,8 @@ enum dc_status dcn20_enable_stream_timing( rate_control_2x_pclk = rate_control_2x_pclk || opp_cnt >1 ; flow_control.flow_ctrl_mode =0 ; flow_control.flow_ctrl_cnt0 =0x80 ; - flow_control.flow_ctrl_cnt1 =calc_mpc_flow_ctrl_cnt (stream, opp_cnt); + flow_control.flow_ctrl_cnt1 =calc_mpc_flow_ctrl_cnt (stream, opp_cnt, + is_two_pixels_per_container);if (mpc->funcs->set_out_rate_control) {for (i =0 ; i < opp_cnt; ++i) { mpc->funcs->set_out_rate_control(
@@ -1210,6 +1213,8 @@ void dcn20_blank_pixel_data(int h_active = stream->timing.h_addressable + stream->timing.h_border_left + stream->timing.h_border_right;int v_active = stream->timing.v_addressable + stream->timing.v_border_bottom + stream->timing.v_border_top;int odm_slice_width, last_odm_slice_width, offset =0 ; +bool is_two_pixels_per_container = + pipe_ctx->stream_res.tg->funcs->is_two_pixels_per_container (&stream->timing);if (stream->link->test_pattern_enabled)return ;
@@ -1220,6 +1225,8 @@ void dcn20_blank_pixel_data(for (odm_pipe = pipe_ctx->next_odm_pipe; odm_pipe; odm_pipe = odm_pipe->next_odm_pipe) odm_cnt++; odm_slice_width = h_active / odm_cnt; +if ((odm_slice_width %2 ) && is_two_pixels_per_container) + odm_slice_width++; last_odm_slice_width = h_active - odm_slice_width * (odm_cnt -1 );if (blank) {
@@ -2642,6 +2649,8 @@ void dcn20_unblank_stream(struct pipe_ctx *pipe_ctx,struct dc_link *link = stream->link;struct dce_hwseq *hws = link->dc->hwseq;struct pipe_ctx *odm_pipe; +bool is_two_pixels_per_container = + pipe_ctx->stream_res.tg->funcs->is_two_pixels_per_container (&stream->timing); params.opp_cnt =1 ;for (odm_pipe = pipe_ctx->next_odm_pipe; odm_pipe; odm_pipe = odm_pipe->next_odm_pipe) {
@@ -2658,7 +2667,7 @@ void dcn20_unblank_stream(struct pipe_ctx *pipe_ctx, pipe_ctx->stream_res.hpo_dp_stream_enc, pipe_ctx->stream_res.tg->inst); }else if (dc_is_dp_signal (pipe_ctx->stream->signal)) { -if (optc2_is_two_pixels_per_containter (&stream->timing) || params.opp_cnt >1 ) +if (is_two_pixels_per_container || params.opp_cnt >1 ) params.timing.pix_clk_100hz /=2 ; pipe_ctx->stream_res.stream_enc->funcs->dp_set_odm_combine ( pipe_ctx->stream_res.stream_enc, params.opp_cnt >1 );
drivers/gpu/drm/amd/display/dc/hwss/dcn201/dcn201_hwseq.c +1 -1
@@ -604,7 +604,7 @@ void dcn201_unblank_stream(struct pipe_ctx *pipe_ctx,if (dc_is_dp_signal (pipe_ctx->stream->signal)) {/*check whether it is half the rate*/ -if (optc201_is_two_pixels_per_containter (&stream->timing)) +if (pipe_ctx->stream_res.tg->funcs->is_two_pixels_per_container (&stream->timing)) params.timing.pix_clk_100hz /=2 ; pipe_ctx->stream_res.stream_enc->funcs->dp_unblank (link, pipe_ctx->stream_res.stream_enc, ¶ms);
drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.c +2 -2
@@ -302,7 +302,7 @@ unsigned int dcn314_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsigunsigned int odm_combine_factor =0 ;bool two_pix_per_container = false; - two_pix_per_container =optc2_is_two_pixels_per_containter (&stream->timing); + two_pix_per_container = pipe_ctx->stream_res.tg->funcs->is_two_pixels_per_container (&stream->timing); odm_combine_factor =get_odm_config (pipe_ctx,NULL );if (stream->ctx->dc->link_srv->dp_is_128b_132b_signal (pipe_ctx)) {
@@ -341,7 +341,7 @@ void dcn314_set_pixels_per_cycle(struct pipe_ctx *pipe_ctx)return ; odm_combine_factor =get_odm_config (pipe_ctx,NULL ); -if (optc2_is_two_pixels_per_containter (&pipe_ctx->stream->timing) || odm_combine_factor >1 ) +if (pipe_ctx->stream_res.tg->funcs->is_two_pixels_per_container (&pipe_ctx->stream->timing) || odm_combine_factor >1 ) pix_per_cycle =2 ;if (pipe_ctx->stream_res.stream_enc->funcs->set_input_mode)
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c +3 -3
@@ -1143,7 +1143,7 @@ unsigned int dcn32_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsignunsigned int odm_combine_factor =0 ;bool two_pix_per_container = false; - two_pix_per_container =optc2_is_two_pixels_per_containter (&stream->timing); + two_pix_per_container = pipe_ctx->stream_res.tg->funcs->is_two_pixels_per_container (&stream->timing); odm_combine_factor =get_odm_config (pipe_ctx,NULL );if (stream->ctx->dc->link_srv->dp_is_128b_132b_signal (pipe_ctx)) {
@@ -1182,7 +1182,7 @@ void dcn32_set_pixels_per_cycle(struct pipe_ctx *pipe_ctx)return ; odm_combine_factor =get_odm_config (pipe_ctx,NULL ); -if (optc2_is_two_pixels_per_containter (&pipe_ctx->stream->timing) || odm_combine_factor >1 +if (pipe_ctx->stream_res.tg->funcs->is_two_pixels_per_container (&pipe_ctx->stream->timing) || odm_combine_factor >1 ||dcn32_is_dp_dig_pixel_rate_div_policy (pipe_ctx)) pix_per_cycle =2 ;
@@ -1246,7 +1246,7 @@ void dcn32_unblank_stream(struct pipe_ctx *pipe_ctx, pipe_ctx->stream_res.hpo_dp_stream_enc, pipe_ctx->stream_res.tg->inst); }else if (dc_is_dp_signal (pipe_ctx->stream->signal)) { -if (optc2_is_two_pixels_per_containter (&stream->timing) || params.opp_cnt >1 +if (pipe_ctx->stream_res.tg->funcs->is_two_pixels_per_container (&stream->timing) || params.opp_cnt >1 ||dcn32_is_dp_dig_pixel_rate_div_policy (pipe_ctx)) { params.timing.pix_clk_100hz /=2 ; pix_per_cycle =2 ;
drivers/gpu/drm/amd/display/dc/inc/hw/optc.h +2 -2
@@ -212,10 +212,10 @@ bool optc1_get_crc(struct timing_generator *optc,uint32_t *g_y, uint32_t *b_cb); -bool optc1_is_two_pixels_per_containter (const struct dc_crtc_timing *timing); -void optc1_set_vtg_params (struct timing_generator *optc,const struct dc_crtc_timing *dc_crtc_timing,bool program_fp2); +bool optc1_is_two_pixels_per_container (const struct dc_crtc_timing *timing); +#endif
drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h +1 -0
@@ -276,6 +276,7 @@ struct timing_generator_funcs {uint32_t *num_of_input_segments, uint32_t *seg0_src_sel, uint32_t *seg1_src_sel); +bool (*is_two_pixels_per_container)(const struct dc_crtc_timing *timing);/** * Configure CRCs for the given timing generator. Return false if TG is
drivers/gpu/drm/amd/display/dc/optc/dcn10/dcn10_optc.c +23 -23
67 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/optc/dcn20/dcn20_optc.c +2 -8
@@ -158,13 +158,6 @@ void optc2_get_dsc_status(struct timing_generator *optc, OPTC_DSC_MODE, dsc_mode); } - -/*TEMP: Need to figure out inheritance model here.*/ -bool optc2_is_two_pixels_per_containter (const struct dc_crtc_timing *timing) -{ -return optc1_is_two_pixels_per_containter (timing); -} -void optc2_set_odm_bypass (struct timing_generator *optc,const struct dc_crtc_timing *dc_crtc_timing) {
@@ -177,7 +170,7 @@ void optc2_set_odm_bypass(struct timing_generator *optc, OPTC_SEG1_SRC_SEL, 0xf);REG_WRITE (OTG_H_TIMING_CNTL ,0 ); - h_div_2 =optc2_is_two_pixels_per_containter (dc_crtc_timing); + h_div_2 = optc->funcs->is_two_pixels_per_container (dc_crtc_timing);REG_UPDATE (OTG_H_TIMING_CNTL ,OTG_H_TIMING_DIV_BY2 , h_div_2); REG_SET(OPTC_MEMORY_CONFIG, 0,
@@ -560,6 +553,7 @@ static struct timing_generator_funcs dcn20_tg_funcs = { .setup_manual_trigger = optc2_setup_manual_trigger, .get_hw_timing = optc1_get_hw_timing, .align_vblanks = optc2_align_vblanks, + .is_two_pixels_per_container = optc1_is_two_pixels_per_container, };void dcn20_timing_generator_init (struct optc *optc1)
drivers/gpu/drm/amd/display/dc/optc/dcn20/dcn20_optc.h +0 -1
@@ -118,7 +118,6 @@ void optc2_lock_doublebuffer_disable(struct timing_generator *optc);void optc2_lock_doublebuffer_enable (struct timing_generator *optc);void optc2_setup_manual_trigger (struct timing_generator *optc);void optc2_program_manual_trigger (struct timing_generator *optc); -bool optc2_is_two_pixels_per_containter (const struct dc_crtc_timing *timing);bool optc2_configure_crc (struct timing_generator *optc,const struct crc_params *params);#endif /* __DC_OPTC_DCN20_H__ */
drivers/gpu/drm/amd/display/dc/optc/dcn201/dcn201_optc.c +1 -6
@@ -38,12 +38,6 @@#define FN (reg_name, field_name) \ optc1->tg_shift->field_name, optc1->tg_mask->field_name -/*TEMP: Need to figure out inheritance model here.*/ -bool optc201_is_two_pixels_per_containter (const struct dc_crtc_timing *timing) -{ -return optc1_is_two_pixels_per_containter (timing); -} -static void optc201_triplebuffer_lock (struct timing_generator *optc) {struct optc *optc1 =DCN10TG_FROM_TG (optc);
@@ -185,6 +179,7 @@ static struct timing_generator_funcs dcn201_tg_funcs = { .program_manual_trigger = optc2_program_manual_trigger, .setup_manual_trigger = optc2_setup_manual_trigger, .get_hw_timing = optc1_get_hw_timing, + .is_two_pixels_per_container = optc1_is_two_pixels_per_container, };void dcn201_timing_generator_init (struct optc *optc1)
drivers/gpu/drm/amd/display/dc/optc/dcn201/dcn201_optc.h +0 -3
@@ -68,7 +68,4 @@ SF(DWB_SOURCE_SELECT, OPTC_DWB1_SOURCE_SELECT, mask_sh)void dcn201_timing_generator_init (struct optc *optc); - -bool optc201_is_two_pixels_per_containter (const struct dc_crtc_timing *timing); -#endif
drivers/gpu/drm/amd/display/dc/optc/dcn30/dcn30_optc.c +2 -1
@@ -206,7 +206,7 @@ void optc3_set_odm_bypass(struct timing_generator *optc,OPTC_SEG3_SRC_SEL ,0xf ); - h_div =optc1_is_two_pixels_per_containter (dc_crtc_timing); + h_div = optc->funcs->is_two_pixels_per_container (dc_crtc_timing);REG_UPDATE (OTG_H_TIMING_CNTL ,OTG_H_TIMING_DIV_MODE , h_div);
@@ -376,6 +376,7 @@ static struct timing_generator_funcs dcn30_tg_funcs = { .setup_manual_trigger = optc2_setup_manual_trigger, .get_hw_timing = optc1_get_hw_timing, .wait_drr_doublebuffer_pending_clear = optc3_wait_drr_doublebuffer_pending_clear, + .is_two_pixels_per_container = optc1_is_two_pixels_per_container, };void dcn30_timing_generator_init (struct optc *optc1)
drivers/gpu/drm/amd/display/dc/optc/dcn301/dcn301_optc.c +1 -0
@@ -168,6 +168,7 @@ static struct timing_generator_funcs dcn30_tg_funcs = { .setup_manual_trigger = optc301_setup_manual_trigger, .get_hw_timing = optc1_get_hw_timing, .wait_drr_doublebuffer_pending_clear = optc3_wait_drr_doublebuffer_pending_clear, + .is_two_pixels_per_container = optc1_is_two_pixels_per_container, };void dcn301_timing_generator_init (struct optc *optc1)
drivers/gpu/drm/amd/display/dc/optc/dcn31/dcn31_optc.c +1 -0
@@ -292,6 +292,7 @@ static struct timing_generator_funcs dcn31_tg_funcs = { .setup_manual_trigger = optc2_setup_manual_trigger, .get_hw_timing = optc1_get_hw_timing, .init_odm = optc3_init_odm, + .is_two_pixels_per_container = optc1_is_two_pixels_per_container, };void dcn31_timing_generator_init (struct optc *optc1)
drivers/gpu/drm/amd/display/dc/optc/dcn314/dcn314_optc.c +2 -1
@@ -175,7 +175,7 @@ static void optc314_set_odm_bypass(struct timing_generator *optc,OPTC_SEG3_SRC_SEL ,0xf ); - h_div =optc1_is_two_pixels_per_containter (dc_crtc_timing); + h_div = optc->funcs->is_two_pixels_per_container (dc_crtc_timing);REG_UPDATE (OTG_H_TIMING_CNTL ,OTG_H_TIMING_DIV_MODE , h_div);
@@ -255,6 +255,7 @@ static struct timing_generator_funcs dcn314_tg_funcs = { .set_odm_bypass = optc314_set_odm_bypass, .set_odm_combine = optc314_set_odm_combine, .set_h_timing_div_manual_mode = optc314_set_h_timing_div_manual_mode, + .is_two_pixels_per_container = optc1_is_two_pixels_per_container, };void dcn314_timing_generator_init (struct optc *optc1)
drivers/gpu/drm/amd/display/dc/optc/dcn32/dcn32_optc.c +2 -1
@@ -239,7 +239,7 @@ void optc32_set_odm_bypass(struct timing_generator *optc,OPTC_SEG3_SRC_SEL ,0xf ); - h_div =optc1_is_two_pixels_per_containter (dc_crtc_timing); + h_div = optc->funcs->is_two_pixels_per_container (dc_crtc_timing);REG_UPDATE (OTG_H_TIMING_CNTL ,OTG_H_TIMING_DIV_MODE , h_div);
@@ -368,6 +368,7 @@ static struct timing_generator_funcs dcn32_tg_funcs = { .program_manual_trigger = optc2_program_manual_trigger, .setup_manual_trigger = optc2_setup_manual_trigger, .get_hw_timing = optc1_get_hw_timing, + .is_two_pixels_per_container = optc1_is_two_pixels_per_container, };void dcn32_timing_generator_init (struct optc *optc1)
drivers/gpu/drm/amd/display/dc/optc/dcn35/dcn35_optc.c +1 -0
@@ -438,6 +438,7 @@ static struct timing_generator_funcs dcn35_tg_funcs = { .get_hw_timing = optc1_get_hw_timing, .init_odm = optc3_init_odm, .set_long_vtotal = optc35_set_long_vtotal, + .is_two_pixels_per_container = optc1_is_two_pixels_per_container, };void dcn35_timing_generator_init (struct optc *optc1)
drivers/gpu/drm/amd/display/dc/optc/dcn401/dcn401_optc.c +11 -4
@@ -107,11 +107,17 @@ static void optc401_set_odm_combine(struct timing_generator *optc, int *opp_id,struct optc *optc1 =DCN10TG_FROM_TG (optc);uint32_t h_active = timing->h_addressable + timing->h_border_left + timing->h_border_right; -uint32_t odm_segment_width = h_active / opp_cnt; -uint32_t odm_segment_width_last = - h_active - odm_segment_width * (opp_cnt -1 );uint32_t odm_mem_bit_map =decide_odm_mem_bit_map ( opp_id, opp_cnt, h_active); +uint32_t odm_segment_width; +uint32_t odm_segment_width_last; +bool is_two_pixels_per_container = optc->funcs->is_two_pixels_per_container (timing); + + odm_segment_width = h_active / opp_cnt; +if ((odm_segment_width %2 ) && is_two_pixels_per_container) + odm_segment_width++; + odm_segment_width_last = + h_active - odm_segment_width * (opp_cnt -1 );REG_SET (OPTC_MEMORY_CONFIG ,0 ,OPTC_MEM_SEL , odm_mem_bit_map);
@@ -273,7 +279,7 @@ static void optc401_set_odm_bypass(struct timing_generator *optc,OPTC_SEG3_SRC_SEL ,0xf ); - h_div =optc1_is_two_pixels_per_containter (dc_crtc_timing); + h_div = optc->funcs->is_two_pixels_per_container (dc_crtc_timing);REG_UPDATE (OTG_H_TIMING_CNTL ,OTG_H_TIMING_DIV_MODE , h_div);
@@ -457,6 +463,7 @@ static struct timing_generator_funcs dcn401_tg_funcs = { .program_manual_trigger = optc2_program_manual_trigger, .setup_manual_trigger = optc2_setup_manual_trigger, .get_hw_timing = optc1_get_hw_timing, + .is_two_pixels_per_container = optc1_is_two_pixels_per_container, };void dcn401_timing_generator_init (struct optc *optc1)
drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c +1 -1
@@ -1251,7 +1251,7 @@ static void get_pixel_clock_parameters(if (opp_cnt ==4 ) pixel_clk_params->requested_pix_clk_100hz /=4 ; -else if (optc2_is_two_pixels_per_containter (&stream->timing) || opp_cnt ==2 ) +else if (pipe_ctx->stream_res.tg->funcs->is_two_pixels_per_container (&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))
Signature · 1 line
2.37.3
PATCH 40/46 drm/amd/display: Enable Replay for DCN315
In reply to Wayne LinFrom: Joan Lee <[email protected]>
[why & how]
Enable Replay for DCN315.
--- .../amd/display/dc/resource/dcn315/dcn315_resource.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c +12 -0
@@ -125,6 +125,7 @@#include "reg_helper.h" #include "dce/dmub_abm.h" #include "dce/dmub_psr.h" +#include "dce/dmub_replay.h" #include "dce/dce_aux.h" #include "dce/dce_i2c.h"
@@ -1484,6 +1485,9 @@ static void dcn315_resource_destruct(struct dcn315_resource_pool *pool)if (pool->base.psr !=NULL )dmub_psr_destroy (&pool->base.psr); +if (pool->base.replay !=NULL ) +dmub_replay_destroy (&pool->base.replay); +if (pool->base.dccg !=NULL )dcn_dccg_destroy (&pool->base.dccg); }
@@ -2048,6 +2052,14 @@ static bool dcn315_resource_construct( goto create_fail; } +/* Replay */ + pool->base.replay =dmub_replay_create (ctx); +if (pool->base.replay ==NULL ) { +dm_error ("DC: failed to create replay obj!\n" ); +BREAK_TO_DEBUGGER (); + goto create_fail; + } +/* ABM */ for (i =0 ; i < pool->base.res_cap->num_timing_generator; i++) { pool->base.multiple_abms[i] = dmub_abm_create(ctx,
Signature · 1 line
2.37.3
PATCH 41/46 drm/amd/display: Notify idle link detection through shared state
In reply to Wayne LinFrom: Nicholas Kazlauskas <[email protected]>
[Why]
We can hang in IPS2 checking DMCUB_SCRATCH0 for link detection state.
[How]
Replace the HW access with a check on the shared state bit. This will work the same way as the SCRATCH0 but won't require a wake in the case where link detection isn't required.
--- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 30 +++++++++++++++++++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 10 +++++++ drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 1 + .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 15 +++++++++- .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 2 ++ 5 files changed, 57 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +30 -0
@@ -1460,6 +1460,36 @@ void dc_dmub_srv_set_power_state(struct dc_dmub_srv *dc_dmub_srv, enum dc_acpi_cdmub_srv_set_power_state (dmub,DMUB_POWER_STATE_D3 ); } +bool dc_dmub_srv_should_detect (struct dc_dmub_srv *dc_dmub_srv) +{ +volatile const struct dmub_shared_state_ips_fw *ips_fw; +bool reallow_idle = false, should_detect = false; + +if (!dc_dmub_srv || !dc_dmub_srv->dmub) +return false; + +if (dc_dmub_srv->dmub->shared_state && + dc_dmub_srv->dmub->meta_info.feature_bits.bits.shared_state_link_detection) { + ips_fw = &dc_dmub_srv->dmub->shared_state[DMUB_SHARED_SHARE_FEATURE__IPS_FW ].data.ips_fw; +return ips_fw->signals.bits.detection_required; + } + +/* Detection may require reading scratch 0 - exit out of idle prior to the read. */ +if (dc_dmub_srv->idle_allowed) { +dc_dmub_srv_apply_idle_power_optimizations (dc_dmub_srv->ctx->dc, false); + reallow_idle = true; + } + + should_detect =dmub_srv_should_detect (dc_dmub_srv->dmub); + +/* Re-enter idle if we're not about to immediately redetect links. */ +if (!should_detect && reallow_idle && dc_dmub_srv->idle_exit_counter ==0 && + !dc_dmub_srv->ctx->dc->debug.disable_dmub_reallow_idle) +dc_dmub_srv_apply_idle_power_optimizations (dc_dmub_srv->ctx->dc, true); + +return should_detect; +} +void dc_dmub_srv_apply_idle_power_optimizations (const struct dc *dc,bool allow_idle) {struct dc_dmub_srv *dc_dmub_srv = dc->ctx->dmub_srv;
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h +10 -0
@@ -111,6 +111,16 @@ void dc_dmub_srv_apply_idle_power_optimizations(const struct dc *dc, bool allow_void dc_dmub_srv_set_power_state (struct dc_dmub_srv *dc_dmub_srv,enum dc_acpi_cm_power_state powerState); +/** +* @dc_dmub_srv_should_detect() - Checks if link detection is required. +* +* While in idle power states we may need driver to manually redetect in +* the case of a missing hotplug. Should be called from a polling timer. +* +* Return: true if redetection is required. +*/ +bool dc_dmub_srv_should_detect (struct dc_dmub_srv *dc_dmub_srv); +/** * dc_wake_and_execute_dmub_cmd() - Wrapper for DMUB command execution. *
drivers/gpu/drm/amd/display/dmub/dmub_srv.h +1 -0
@@ -529,6 +529,7 @@ struct dmub_srv {uint32_t psp_version;/* Feature capabilities reported by fw */ +struct dmub_fw_meta_info meta_info;struct dmub_feature_caps feature_caps;struct dmub_visual_confirm_color visual_confirm_color;
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +14 -1
@@ -496,6 +496,17 @@ struct dmub_visual_confirm_color {/* Offset from the end of the file to the dmub_fw_meta_info */ #define DMUB_FW_META_OFFSET 0x24 +/** +* union dmub_fw_meta_feature_bits - Static feature bits for pre-initialization +*/ +union dmub_fw_meta_feature_bits { +struct { +uint32_t shared_state_link_detection :1 ;/**< 1 supports link detection via shared state */ +uint32_t reserved :31 ; + } bits;/**< status bits */ +uint32_t all;/**< 32-bit access to status bits */ +}; +/** * struct dmub_fw_meta_info - metadata associated with fw binary *
@@ -521,6 +532,7 @@ struct dmub_fw_meta_info {uint32_t shared_state_size;/**< size of the shared state region in bytes */ uint16_t shared_state_features;/**< number of shared state features */ uint16_t reserved2;/**< padding bytes */ +union dmub_fw_meta_feature_bits feature_bits;/**< static feature bits */ };/**
@@ -698,7 +710,8 @@ union dmub_shared_state_ips_fw_signals { uint32_t ips1_commit : 1; /**< 1 if in IPS1 */ uint32_t ips2_commit : 1; /**< 1 if in IPS2 */ uint32_t in_idle : 1; /**< 1 if DMCUB is in idle */ - uint32_t reserved_bits : 29; /**< Reversed */ + uint32_t detection_required : 1; /**< 1 if detection is required */ + uint32_t reserved_bits : 28; /**< Reversed */ } bits;uint32_t all; };
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +2 -0
@@ -510,6 +510,8 @@ enum dmub_status fw_info =dmub_get_fw_meta_info (params);if (fw_info) { +memcpy (&dmub->meta_info, fw_info,sizeof (*fw_info)); + fw_state_size = fw_info->fw_region_size; trace_buffer_size = fw_info->trace_buffer_size;
Signature · 1 line
2.37.3
PATCH 42/46 drm/amd/display: Add periodic detection for IPS
In reply to Wayne LinFrom: Roman Li <[email protected]>
[Why]
HPD interrupt cannot be handled in IPS2 state.
So if there's a display topology change while system in IPS2 it can be missed.
[How]
Implement worker to check each 5 sec in IPS for HPD.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 13 ++++ .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 9 +++ .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 59 ++++++++++++++++++- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 5 +- .../drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 28 +++++++++ .../drm/amd/display/amdgpu_dm/amdgpu_dm_psr.h | 1 + 6 files changed, 113 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +13 -0
@@ -1838,6 +1838,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)DRM_ERROR ("amdgpu: failed to initialize vblank_workqueue.\n" ); } +if (adev->dm.dc->caps.ips_support && adev->dm.dc->config.disable_ips ==DMUB_IPS_ENABLE ) + adev->dm.idle_workqueue =idle_create_workqueue (adev); +if (adev->dm.dc->caps.max_links >0 && adev->family >=AMDGPU_FAMILY_RV ) { adev->dm.hdcp_workqueue =hdcp_create_workqueue (adev, &init_params.cp_psp, adev->dm.dc);
@@ -1935,6 +1938,16 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev) adev->dm.vblank_control_workqueue =NULL ; } +if (adev->dm.idle_workqueue) { +if (adev->dm.idle_workqueue->running) { + adev->dm.idle_workqueue->enable = false; +flush_work (&adev->dm.idle_workqueue->work); + } + +kfree (adev->dm.idle_workqueue); + adev->dm.idle_workqueue =NULL ; + } +amdgpu_dm_destroy_drm_device (&adev->dm);#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY )
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +9 -0
@@ -137,6 +137,13 @@ struct vblank_control_work {bool enable; }; +struct idle_workqueue { +struct work_struct work; +struct amdgpu_display_manager *dm; +bool enable; +bool running; +}; +/** * struct amdgpu_dm_backlight_caps - Information about backlight *
@@ -487,6 +494,7 @@ struct amdgpu_display_manager {* Deferred work for vblank control events. */ struct workqueue_struct *vblank_control_workqueue; +struct idle_workqueue *idle_workqueue;struct drm_atomic_state *cached_state;struct dc_state *cached_dc_state;
@@ -956,4 +964,5 @@ amdgpu_dm_find_first_crtc_matching_connector(struct drm_atomic_state *state, struct drm_crtc *crtc);int convert_dc_color_depth_into_bpc (enum dc_color_depth display_color_depth); +struct idle_workqueue *idle_create_workqueue (struct amdgpu_device *adev);#endif /* __AMDGPU_DM_H__ */
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +58 -1
75 lines not on this page · raw message
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +4 -1
@@ -1261,7 +1261,10 @@ void dm_set_phyd32clk(struct dc_context *ctx, int freq_khz)void dm_helpers_enable_periodic_detection (struct dc_context *ctx,bool enable) { -/* TODO: add periodic detection implementation */ +struct amdgpu_device *adev = ctx->driver_context; + +if (adev->dm.idle_workqueue) + adev->dm.idle_workqueue->enable = enable; } void dm_helpers_dp_mst_update_branch_bandwidth(
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c +28 -0
@@ -223,3 +223,31 @@ bool amdgpu_dm_psr_disable_all(struct amdgpu_display_manager *dm)return dc_set_psr_allow_active (dm->dc, false); } +/* +* amdgpu_dm_psr_is_active_allowed() - check if psr is allowed on any stream +* @dm: pointer to amdgpu_display_manager +* +* Return: true if allowed +*/ + +bool amdgpu_dm_psr_is_active_allowed (struct amdgpu_display_manager *dm) +{ +unsigned int i; +bool allow_active = false; + +for (i =0 ; i < dm->dc->current_state->stream_count ; i++) { +struct dc_link *link; +struct dc_stream_state *stream = dm->dc->current_state->streams[i]; + + link = stream->link; +if (!link) +continue ; +if (link->psr_settings.psr_feature_enabled && + link->psr_settings.psr_allow_active) { + allow_active = true; +break ; + } + } + +return allow_active; +}
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.h +1 -0
@@ -36,5 +36,6 @@ void amdgpu_dm_psr_enable(struct dc_stream_state *stream);bool amdgpu_dm_link_setup_psr (struct dc_stream_state *stream);bool amdgpu_dm_psr_disable (struct dc_stream_state *stream);bool amdgpu_dm_psr_disable_all (struct amdgpu_display_manager *dm); +bool amdgpu_dm_psr_is_active_allowed (struct amdgpu_display_manager *dm);#endif /* AMDGPU_DM_AMDGPU_DM_PSR_H_ */
Signature · 1 line
2.37.3
PATCH 43/46 drm/amd/display: Change ASSR disable sequence
In reply to Wayne LinFrom: Swapnil Patel <[email protected]>
[Why]
Currently disabling ASSR before stream is disabled causes visible display corruption.
[How]
Move disable ASSR command to after stream has been disabled.
--- drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/link/link_dpms.c +1 -2
@@ -2317,8 +2317,6 @@ void link_set_dpms_off(struct pipe_ctx *pipe_ctx) dc->hwss.disable_audio_stream (pipe_ctx); -edp_set_panel_assr (link, pipe_ctx, &panel_mode_dp, false); -update_psp_stream_config (pipe_ctx, true); dc->hwss.blank_stream (pipe_ctx);
@@ -2372,6 +2370,7 @@ void link_set_dpms_off(struct pipe_ctx *pipe_ctx) dc->hwss.disable_stream (pipe_ctx);disable_link (pipe_ctx->stream->link, &pipe_ctx->link_res, pipe_ctx->stream->signal); } +edp_set_panel_assr (link, pipe_ctx, &panel_mode_dp, false);if (pipe_ctx->stream->timing.flags.DSC) {if (dc_is_dp_signal (pipe_ctx->stream->signal))
Signature · 1 line
2.37.3
PATCH 44/46 drm/amd/display: Fix uninitialized variables in DC
In reply to Wayne LinFrom: Alex Hung <[email protected]>
This fixes 29 UNINIT issues reported by Coverity.
--- drivers/gpu/drm/amd/display/dc/bios/command_table.c | 2 +- drivers/gpu/drm/amd/display/dc/bios/command_table2.c | 2 +- drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 4 ++-- drivers/gpu/drm/amd/display/dc/dml/dcn30/dcn30_fpu.c | 2 +- drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 2 +- .../drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c | 4 ++-- drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c | 4 ++-- drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 2 +- drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.c | 2 +- drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 4 ++-- drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 2 +- drivers/gpu/drm/amd/display/dc/link/link_detection.c | 4 ++-- .../gpu/drm/amd/display/dc/link/protocols/link_dp_training.c | 2 +- .../gpu/drm/amd/display/dc/resource/dcn303/dcn303_resource.c | 2 +- 14 files changed, 19 insertions(+), 19 deletions(-)
drivers/gpu/drm/amd/display/dc/bios/command_table.c +1 -1
@@ -399,7 +399,7 @@ static enum bp_result transmitter_control_v1_6(static void init_transmitter_control (struct bios_parser *bp) {uint8_t frev; -uint8_t crev; +uint8_t crev =0 ;if (BIOS_CMD_TABLE_REVISION (UNIPHYTransmitterControl, frev, crev) == false)
drivers/gpu/drm/amd/display/dc/bios/command_table2.c +1 -1
@@ -225,7 +225,7 @@ static enum bp_result transmitter_control_fallback(static void init_transmitter_control (struct bios_parser *bp) {uint8_t frev; -uint8_t crev; +uint8_t crev =0 ;BIOS_CMD_TABLE_REVISION (dig1transmittercontrol, frev, crev);
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c +2 -2
@@ -2372,7 +2372,7 @@ bool dcn21_validate_bandwidth_fp(struct dc *dc, struct dc_state *context,static struct _vcs_dpi_voltage_scaling_st construct_low_pstate_lvl (struct clk_limit_table *clk_table,unsigned int high_voltage_lvl) { -struct _vcs_dpi_voltage_scaling_st low_pstate_lvl; +struct _vcs_dpi_voltage_scaling_st low_pstate_lvl = {0 };int i; low_pstate_lvl.state =1 ;
@@ -2477,7 +2477,7 @@ void dcn201_populate_dml_writeback_from_context_fpu(struct dc *dc,int pipe_cnt, i, j;double max_calc_writeback_dispclk;double writeback_dispclk; -struct writeback_st dout_wb; +struct writeback_st dout_wb = {0 };dc_assert_fp_enabled ();
drivers/gpu/drm/amd/display/dc/dml/dcn30/dcn30_fpu.c +1 -1
@@ -260,7 +260,7 @@ void dcn30_fpu_populate_dml_writeback_from_context(int pipe_cnt, i, j;double max_calc_writeback_dispclk;double writeback_dispclk; -struct writeback_st dout_wb; +struct writeback_st dout_wb = {0 };dc_assert_fp_enabled ();
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +1 -1
@@ -723,7 +723,7 @@ static bool dcn32_enough_pipes_for_subvp(struct dc *dc, struct dc_state *context*/ static bool subvp_subvp_schedulable (struct dc *dc,struct dc_state *context) { -struct pipe_ctx *subvp_pipes[2 ]; +struct pipe_ctx *subvp_pipes[2 ] = {0 };struct dc_stream_state *phantom =NULL ;uint32_t microschedule_lines =0 ;uint32_t index =0 ;
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c +2 -2
@@ -1973,8 +1973,8 @@ void dml32_CalculateVMRowAndSwath(unsigned int PTEBufferSizeInRequestsForChroma[DC__NUM_DPP__MAX ];unsigned int PDEAndMetaPTEBytesFrameY;unsigned int PDEAndMetaPTEBytesFrameC; -unsigned int MetaRowByteY[DC__NUM_DPP__MAX ]; -unsigned int MetaRowByteC[DC__NUM_DPP__MAX ]; +unsigned int MetaRowByteY[DC__NUM_DPP__MAX ] = {0 }; +unsigned int MetaRowByteC[DC__NUM_DPP__MAX ] = {0 };unsigned int PixelPTEBytesPerRowY[DC__NUM_DPP__MAX ];unsigned int PixelPTEBytesPerRowC[DC__NUM_DPP__MAX ];unsigned int PixelPTEBytesPerRowY_one_row_per_frame[DC__NUM_DPP__MAX ];
drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c +2 -2
@@ -326,8 +326,8 @@ void dml2_init_soc_states(struct dml2_context *dml2, const struct dc *in_dc, {struct dml2_policy_build_synthetic_soc_states_scratch *s = &dml2->v20.scratch.create_scratch.build_synthetic_socbb_scratch;struct dml2_policy_build_synthetic_soc_states_params *p = &dml2->v20.scratch.build_synthetic_socbb_params; -unsigned int dcfclk_stas_mhz[NUM_DCFCLK_STAS ]; -unsigned int dcfclk_stas_mhz_new[NUM_DCFCLK_STAS_NEW ]; +unsigned int dcfclk_stas_mhz[NUM_DCFCLK_STAS ] = {0 }; +unsigned int dcfclk_stas_mhz_new[NUM_DCFCLK_STAS_NEW ] = {0 };unsigned int dml_project = dml2->v20.dml_core_ctx.project;unsigned int i =0 ;
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c +1 -1
@@ -403,7 +403,7 @@ void dcn20_init_blank(struct output_pixel_processor *opp =NULL ;struct output_pixel_processor *bottom_opp =NULL ;uint32_t num_opps, opp_id_src0, opp_id_src1; -uint32_t otg_active_width, otg_active_height; +uint32_t otg_active_width =0 , otg_active_height =0 ;/* program opp dpg blank color */ color_space =COLOR_SPACE_SRGB ;
drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.c +1 -1
@@ -82,7 +82,7 @@ static void update_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable)if (enable) {struct dsc_config dsc_cfg; -struct dsc_optc_config dsc_optc_cfg; +struct dsc_optc_config dsc_optc_cfg = {0 };enum optc_dsc_mode optc_dsc_mode;/* Enable DSC hw block */
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c +2 -2
@@ -1005,7 +1005,7 @@ static void update_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable)if (enable) {struct dsc_config dsc_cfg; -struct dsc_optc_config dsc_optc_cfg; +struct dsc_optc_config dsc_optc_cfg = {0 };enum optc_dsc_mode optc_dsc_mode;/* Enable DSC hw block */
@@ -1558,7 +1558,7 @@ void dcn32_init_blank(struct output_pixel_processor *opp =NULL ;struct output_pixel_processor *bottom_opp =NULL ;uint32_t num_opps, opp_id_src0, opp_id_src1; -uint32_t otg_active_width, otg_active_height; +uint32_t otg_active_width =0 , otg_active_height =0 ;uint32_t i;/* program opp dpg blank color */
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +1 -1
@@ -373,7 +373,7 @@ static void update_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable)if (enable) {struct dsc_config dsc_cfg; -struct dsc_optc_config dsc_optc_cfg; +struct dsc_optc_config dsc_optc_cfg = {0 };enum optc_dsc_mode optc_dsc_mode;/* Enable DSC hw block */
drivers/gpu/drm/amd/display/dc/link/link_detection.c +2 -2
@@ -516,8 +516,8 @@ static void query_hdcp_capability(enum signal_type signal, struct dc_link *link)static void read_current_link_settings_on_detect (struct dc_link *link) {union lane_count_set lane_count_set = {0 }; -uint8_t link_bw_set; -uint8_t link_rate_set; +uint8_t link_bw_set =0 ; +uint8_t link_rate_set =0 ;uint32_t read_dpcd_retry_cnt =10 ;enum dc_status status =DC_ERROR_UNEXPECTED ;int i;
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c +1 -1
@@ -1071,7 +1071,7 @@ enum dc_status dpcd_set_link_settings(* MUX chip gets link rate set back before link training. */ if (link->connector_signal ==SIGNAL_TYPE_EDP ) { -uint8_t supported_link_rates[16 ]; +uint8_t supported_link_rates[16 ] = {0 };core_link_read_dpcd (link,DP_SUPPORTED_LINK_RATES , supported_link_rates,sizeof (supported_link_rates));
drivers/gpu/drm/amd/display/dc/resource/dcn303/dcn303_resource.c +1 -1
@@ -1144,7 +1144,7 @@ static bool dcn303_resource_construct(int i;struct dc_context *ctx = dc->ctx;struct irq_service_init_data init_data; -struct ddc_service_init_data ddc_init_data; +struct ddc_service_init_data ddc_init_data = {0 }; ctx->dc_bios->regs = &bios_regs;
Signature · 1 line
2.37.3
PATCH 45/46 drm/amd/display: Disable seamless boot on 128b/132b encoding
In reply to Wayne LinFrom: Sung Joon Kim <[email protected]>
[why]
preOS will not support display mode programming and link training for UHBR rates.
[how]
If we detect a sink that's UHBR capable, disable seamless boot
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -0
@@ -1838,6 +1838,9 @@ bool dc_validate_boot_timing(const struct dc *dc,return false; } +if (link->dpcd_caps.channel_coding_cap.bits.DP_128b_132b_SUPPORTED) +return false; +if (dc->link_srv->edp_is_ilr_optimization_required (link, crtc_timing)) {DC_LOG_EVENT_LINK_TRAINING ("Seamless boot disabled to optimize eDP link rate\n" );return false;
Signature · 1 line
2.37.3
PATCH 46/46 drm/amd/display: 3.2.283
In reply to Wayne LinFrom: Aric Cyr <[email protected]>
This version brings along following fixes:
- Disable seamless boot on 128b/132b encoding
- Have cursor and surface updates together
- Change ASSR disable sequence to avoid corruption
- Fix few IPS problems
- Enable Replay for DCN315
- Fix few ODM problems
- Fix FEC_READY write timing
- Fix few FPO problems
- Adjust DML21 gpuvm_enable assignment
- Fix divide by 0 error in VM environment
- Fix few DCN35 problems
- Fix flickering on DCN321
- Fix mst resume problem
- Fix multi-disp FAMS problem
- Refactor Replay
- Update some of the dcn303 parameters
- Enable legacy fast update for dcn301
- Add VCO parameter for DCN31 FPU
- Fix problems reported by Coverity
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -55,7 +55,7 @@ struct aux_payload;struct set_config_cmd_payload ;struct dmub_notification ; -#define DC_VER "3.2.282" +#define DC_VER "3.2.283"#define MAX_SURFACES 3#define MAX_PLANES 6
Signature · 1 line
2.37.3
RE: [PATCH 28/46] drm/amd/display: Enable RCO for PHYSYMCLK in DCN35
In reply to Wayne Lin[Public]
Quoted 252 lines
-----Original Message-----
From: Wayne Lin <[email protected]>
Sent: Wednesday, April 24, 2024 4:49 AM
To: [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Pillai, Aurabindo <[email protected]>; Li, Roman <[email protected]>; Lin, Wayne <[email protected]>; Gutierrez, Agustin <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; Wu, Hersen <[email protected]>; Zuo, Jerry <[email protected]>; Miess, Daniel <[email protected]>; Liu, Charlene <[email protected]>
Subject: [PATCH 28/46] drm/amd/display: Enable RCO for PHYSYMCLK in DCN35From: Daniel Miess <[email protected]>
[Why & How]
Enable root clock optimization for PHYSYMCLK and only disable it when it's actively being usedReviewed-by Charlene Liu <[email protected]>Acked-by Wayne Lin <[email protected]>Signed-off-by Daniel Miess <[email protected]>--- drivers/gpu/drm/amd/display/dc/dc.h | 1 + .../gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c | 45 ------------------- .../amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 32 +++++++++++++ .../amd/display/dc/hwss/dcn35/dcn35_hwseq.h | 2 + .../amd/display/dc/hwss/dcn35/dcn35_init.c | 1 + .../amd/display/dc/hwss/dcn351/dcn351_init.c | 1 + .../display/dc/hwss/hw_sequencer_private.h | 4 ++ 7 files changed, 41 insertions(+), 45 deletions(-)drivers/gpu/drm/amd/display/dc/dc.h +1
-0@@ -724,6 +724,7 @@ enum pg_hw_pipe_resources {PG_OPTC ,PG_DPSTREAM ,PG_HDMISTREAM , +PG_PHYSYMCLK , PG_HW_PIPE_RESOURCES_NUM_ELEMENT };drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c +0
-0@@ -461,32 +461,22 @@ static voiddccg35_set_physymclk_root_clock_gating(
case 0:
REG_UPDATE(DCCG_GATE_DISABLE_CNTL2,
PHYASYMCLK_ROOT_GATE_DISABLE, enable ?
1 : 0);drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c +0
-2-// REG_UPDATE(DCCG_GATE_DISABLE_CNTL4, -// PHYA_REFCLK_ROOT_GATE_DISABLE, enable ? 1 : 0); break; case 1: REG_UPDATE(DCCG_GATE_DISABLE_CNTL2, PHYBSYMCLK_ROOT_GATE_DISABLE, enable ?1 : 0);
drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c +0
-2-// REG_UPDATE(DCCG_GATE_DISABLE_CNTL4, -// PHYB_REFCLK_ROOT_GATE_DISABLE, enable ? 1 : 0); break; case 2: REG_UPDATE(DCCG_GATE_DISABLE_CNTL2, PHYCSYMCLK_ROOT_GATE_DISABLE, enable ?1 : 0);
drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c +0
-2-// REG_UPDATE(DCCG_GATE_DISABLE_CNTL4, -// PHYC_REFCLK_ROOT_GATE_DISABLE, enable ? 1 : 0); break; case 3: REG_UPDATE(DCCG_GATE_DISABLE_CNTL2, PHYDSYMCLK_ROOT_GATE_DISABLE, enable ?1 : 0);
drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c +0
-2-// REG_UPDATE(DCCG_GATE_DISABLE_CNTL4, -// PHYD_REFCLK_ROOT_GATE_DISABLE, enable ? 1 : 0); break; case 4: REG_UPDATE(DCCG_GATE_DISABLE_CNTL2, PHYESYMCLK_ROOT_GATE_DISABLE, enable ?1 : 0);
drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c +0
-2-// REG_UPDATE(DCCG_GATE_DISABLE_CNTL4, -// PHYE_REFCLK_ROOT_GATE_DISABLE, enable ? 1 : 0); break; default: BREAK_TO_DEBUGGER();drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c +0
-6@@ -509,16 +499,10 @@ static void dccg35_set_physymclk(REG_UPDATE_2 (PHYASYMCLK_CLOCK_CNTL ,PHYASYMCLK_EN ,1 ,PHYASYMCLK_SRC_SEL , clk_src); -// if (dccg->ctx->dc- >debug.root_clock_optimization.bits.physymclk) -// REG_UPDATE(DCCG_GATE_DISABLE_CNTL4, -// PHYA_REFCLK_ROOT_GATE_DISABLE, 0); }else {REG_UPDATE_2 (PHYASYMCLK_CLOCK_CNTL ,PHYASYMCLK_EN ,0 ,PHYASYMCLK_SRC_SEL ,0 ); -// if (dccg->ctx->dc- >debug.root_clock_optimization.bits.physymclk) -// REG_UPDATE(DCCG_GATE_DISABLE_CNTL4, -// PHYA_REFCLK_ROOT_GATE_DISABLE, 1); } break; case 1:drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c +0
-6@@ -526,16 +510,10 @@ static void dccg35_set_physymclk(REG_UPDATE_2 (PHYBSYMCLK_CLOCK_CNTL ,PHYBSYMCLK_EN ,1 ,PHYBSYMCLK_SRC_SEL , clk_src); -// if (dccg->ctx->dc- >debug.root_clock_optimization.bits.physymclk) -// REG_UPDATE(DCCG_GATE_DISABLE_CNTL4, -// PHYB_REFCLK_ROOT_GATE_DISABLE, 0); }else {REG_UPDATE_2 (PHYBSYMCLK_CLOCK_CNTL ,PHYBSYMCLK_EN ,0 ,PHYBSYMCLK_SRC_SEL ,0 ); -// if (dccg->ctx->dc- >debug.root_clock_optimization.bits.physymclk) -// REG_UPDATE(DCCG_GATE_DISABLE_CNTL4, -// PHYB_REFCLK_ROOT_GATE_DISABLE, 1); } break; case 2:drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c +0
-6@@ -543,16 +521,10 @@ static void dccg35_set_physymclk(REG_UPDATE_2 (PHYCSYMCLK_CLOCK_CNTL ,PHYCSYMCLK_EN ,1 ,PHYCSYMCLK_SRC_SEL , clk_src); -// if (dccg->ctx->dc- >debug.root_clock_optimization.bits.physymclk) -// REG_UPDATE(DCCG_GATE_DISABLE_CNTL4, -// PHYC_REFCLK_ROOT_GATE_DISABLE, 0); }else {REG_UPDATE_2 (PHYCSYMCLK_CLOCK_CNTL ,PHYCSYMCLK_EN ,0 ,PHYCSYMCLK_SRC_SEL ,0 ); -// if (dccg->ctx->dc- >debug.root_clock_optimization.bits.physymclk) -// REG_UPDATE(DCCG_GATE_DISABLE_CNTL4, -// PHYC_REFCLK_ROOT_GATE_DISABLE, 1); } break; case 3:drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c +0
-6@@ -560,16 +532,10 @@ static void dccg35_set_physymclk(REG_UPDATE_2 (PHYDSYMCLK_CLOCK_CNTL ,PHYDSYMCLK_EN ,1 ,PHYDSYMCLK_SRC_SEL , clk_src); -// if (dccg->ctx->dc- >debug.root_clock_optimization.bits.physymclk) -// REG_UPDATE(DCCG_GATE_DISABLE_CNTL4, -// PHYD_REFCLK_ROOT_GATE_DISABLE, 0); }else {REG_UPDATE_2 (PHYDSYMCLK_CLOCK_CNTL ,PHYDSYMCLK_EN ,0 ,PHYDSYMCLK_SRC_SEL ,0 ); -// if (dccg->ctx->dc- >debug.root_clock_optimization.bits.physymclk) -// REG_UPDATE(DCCG_GATE_DISABLE_CNTL4, -// PHYD_REFCLK_ROOT_GATE_DISABLE, 1); } break; case 4:drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c +0
-6@@ -577,16 +543,10 @@ static void dccg35_set_physymclk(REG_UPDATE_2 (PHYESYMCLK_CLOCK_CNTL ,PHYESYMCLK_EN ,1 ,PHYESYMCLK_SRC_SEL , clk_src); -// if (dccg->ctx->dc- >debug.root_clock_optimization.bits.physymclk) -// REG_UPDATE(DCCG_GATE_DISABLE_CNTL4, -// PHYE_REFCLK_ROOT_GATE_DISABLE, 0); }else {REG_UPDATE_2 (PHYESYMCLK_CLOCK_CNTL ,PHYESYMCLK_EN ,0 ,PHYESYMCLK_SRC_SEL ,0 ); -// if (dccg->ctx->dc- >debug.root_clock_optimization.bits.physymclk) -// REG_UPDATE(DCCG_GATE_DISABLE_CNTL4, -// PHYE_REFCLK_ROOT_GATE_DISABLE, 1); } break; default:drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c +0
-5@@ -724,11 +684,6 @@ void dccg35_init(struct dccg *dccg)dccg35_set_dpstreamclk_root_clock_gating (dccg, otg_inst, false); } -if (dccg->ctx->dc->debug.root_clock_optimization.bits.physymclk) -for (otg_inst =0 ; otg_inst <5 ; otg_inst++) -dccg35_set_physymclk_root_clock_gating (dccg, otg_inst, - false); - if (dccg->ctx->dc->debug.root_clock_optimization.bits.dpp)for (otg_inst = 0; otg_inst < 4; otg_inst++) dccg35_set_dppclk_root_clock_gating(dccg, otg_inst,0); diff --git
a/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.cb/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.cindexb94a85380d73..dea7e63a49d9100644drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +0
-0@@ -506,6 +506,17 @@ void dcn35_dpstream_root_clock_control(struct
dce_hwseq*hws, unsigned intdp_hp}}
+void dcn35_physymclk_root_clock_control(struct
dce_hwseq*hws, unsigneddrivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +5
-0+int phy_inst, bool clock_on) { +if (!hws->ctx->dc->debug.root_clock_optimization.bits.physymclk) +return ; + + if (hws->ctx->dc->res_pool->dccg->funcs-Quoted 1 line
set_physymclk_root_clock_gating) {+ hws->ctx->dc->res_pool->dccg->funcs-
Quoted 1 line
set_physymclk_root_clock_gating(
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +4
-0+ hws->ctx->dc->res_pool->dccg, phy_inst, clock_on); + } +} + void dcn35_dsc_pg_control( struct dce_hwseq *hws, unsigned int dsc_inst,@@ -1020,6 +1031,13 @@ void dcn35_calc_blocks_to_gate(struct dc *dc, struct dc_state *context, if (pipe_ctx->stream_res.hpo_dp_stream_enc) update_state-Quoted 2 lines
pg_pipe_res_update[PG_DPSTREAM][pipe_ctx-
stream_res.hpo_dp_stream_enc->inst] = false;}drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +3
-0+ +for (i =0 ; i < dc->link_count; i++) { + update_state->pg_pipe_res_update[PG_PHYSYMCLK][i] =
Quoted 1 line
true;
Please fix the index:
update_state->pg_pipe_res_update[PG_PHYSYMCLK][dc->links[i]->link_enc_hw_inst] = true;
With that fixed, the patch is:
Quoted 129 lines
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +2
-0+if (dc->links[i]->type != dc_connection_none) + update_state-Quoted 1 line
pg_pipe_res_update[PG_PHYSYMCLK][dc->links[i]->link_enc_hw_inst] =
false;
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +2
-0+ } +/*domain24 controls all the otg, mpc, opp, as long as one otg is still up, avoid enabling OTG PG*/
for (i = 0; i < dc->res_pool->timing_generator_count; i++) { struct timing_generator *tg = dc->res_pool-Quoted 1 line
timing_generators[i];
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +4
-0@@ -1117,6 +1135,10 @@ void dcn35_calc_blocks_to_ungate(struct dc *dc, struct dc_state *context, } } +for (i =0 ; i < dc->link_count; i++) +if (dc->links[i]->type != dc_connection_none) + +update_state->pg_pipe_res_update[PG_PHYSYMCLK][dc->links[i]-Quoted 1 line
link_enc_hdrivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +2
-0+w_inst] = true; +for (i =0 ; i < dc->res_pool->hpo_dp_stream_enc_count; i++) {if (context->res_ctx.is_hpo_dp_stream_enc_acquired[i] && dc->res_pool->hpo_dp_stream_enc[i]) { @@ -1267,6 +1289,11 @@ void dcn35_root_clock_control(struct dc *dc,
dc->hwseq-Quoted 1 line
funcs.dpstream_root_clock_control(dc->hwseq, i, power_on);}drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +2
-0+for (i =0 ; i < dc->res_pool->dig_link_enc_count; i++) + if (update_state-Quoted 1 line
pg_pipe_res_update[PG_PHYSYMCLK][i])
+ if (dc->hwseq-
Quoted 1 line
funcs.physymclk_root_clock_control)
+ dc->hwseq-
Quoted 1 line
funcs.physymclk_root_clock_control(dc->hwseq, i,
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +2
-0+power_on); + }for (i =0 ; i < dc->res_pool->res_cap->num_dsc; i++) { if (update_state->pg_pipe_res_update[PG_DSC][i]) { @@ -1292,6 +1319,11 @@ void dcn35_root_clock_control(struct dc *dc,
dc->hwseq-Quoted 1 line
funcs.dpstream_root_clock_control(dc->hwseq, i, power_on);}drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +2
-0+for (i =0 ; i < dc->res_pool->dig_link_enc_count; i++) + if (update_state-Quoted 1 line
pg_pipe_res_update[PG_PHYSYMCLK][i])
+ if (dc->hwseq-
Quoted 1 line
funcs.physymclk_root_clock_control)
+ dc->hwseq-
Quoted 1 line
funcs.physymclk_root_clock_control(dc->hwseq, i,
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +2
-0+power_on); + } }drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h +1
-0@@ -39,6 +39,8 @@ void dcn35_dpp_root_clock_control(struct dce_hwseq *hws, unsigned int dpp_inst, void dcn35_dpstream_root_clock_control(struct dce_hwseq *hws, unsignedint dp_hpo_inst,bool clock_on); +void dcn35_physymclk_root_clock_control(struct dce_hwseq *hws,unsigned
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h +2
-0+int phy_inst, bool clock_on); + void dcn35_enable_power_gating_plane(struct dce_hwseq *hws, boolenable);
void
dcn35_set_dmu_fgcg(struct dce_hwseq *hws, bool enable); diff --gita/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.cb/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.cindex0e87f3503265..7f2cbfac9099100644drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c +1
-0@@ -149,6 +149,7 @@ static const struct hwseq_private_funcs dcn35_private_funcs = { .enable_power_gating_plane = dcn35_enable_power_gating_plane, .dpp_root_clock_control = dcn35_dpp_root_clock_control, .dpstream_root_clock_control = dcn35_dpstream_root_clock_control, + .physymclk_root_clock_control = dcn35_physymclk_root_clock_control, .program_all_writeback_pipes_in_tree =
dcn30_program_all_writeback_pipes_in_tree,.update_odm = dcn35_update_odm, .set_hdr_multiplier = dcn10_set_hdr_multiplier, diff --git
a/drivers/gpu/drm/amd/display/dc/hwss/dcn351/dcn351_init.cb/drivers/gpu/drm/amd/display/dc/hwss/dcn351/dcn351_init.cindexff772665d1ae..91484b71b7da100644drivers/gpu/drm/amd/display/dc/hwss/dcn351/dcn351_init.c +1
-0@@ -148,6 +148,7 @@ static const struct hwseq_private_funcs dcn351_private_funcs = { .enable_power_gating_plane = dcn35_enable_power_gating_plane, .dpp_root_clock_control = dcn35_dpp_root_clock_control, .dpstream_root_clock_control = dcn35_dpstream_root_clock_control, + .physymclk_root_clock_control = dcn35_physymclk_root_clock_control, .program_all_writeback_pipes_in_tree =
dcn30_program_all_writeback_pipes_in_tree,.update_odm = dcn35_update_odm, .set_hdr_multiplier = dcn10_set_hdr_multiplier, diff --git
a/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer_private.hb/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer_private.hindex939832372baf..7553d6816d36100644drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer_private.h +4
-1@@ -124,6 +124,10 @@ struct hwseq_private_funcs {struct dce_hwseq *hws, unsigned int dpp_inst, bool clock_on); +void (*physymclk_root_clock_control)( +struct dce_hwseq *hws, +unsigned int phy_inst, +bool clock_on);void (*dpp_pg_control)(struct dce_hwseq *hws,unsigned int dpp_inst,bool power_on); --2.37.3
[Public]
Hi all,
This week this patchset was tested on the following systems:
* Lenovo ThinkBook T13s Gen4 with AMD Ryzen 5 6600U
* MSI Gaming X Trio RX 6800
* Gigabyte Gaming OC RX 7900 XTX
These systems were tested on the following display/connection types:
* eDP, (1080p 60hz [5650U]) (1920x1200 60hz [6600U]) (2560x1600 120hz[6600U])
* VGA and DVI (1680x1050 60hz [DP to VGA/DVI, USB-C to VGA/DVI])
* DP/HDMI/USB-C (1440p 170hz, 4k 60hz, 4k 144hz, 4k 240hz [Includes USB-C to DP/HDMI adapters])
* Thunderbolt (LG Ultrafine 5k)
* MST (Startech MST14DP123DP [DP to 3x DP] and 2x 4k 60Hz displays)
* DSC (with Cable Matters 101075 [DP to 3x DP] with 3x 4k60 displays, and HP Hook G2 with 1 4k60 display)
* USB 4 (Kensington SD5700T and 1x 4k 60Hz display)
* PCON (Club3D CAC-1085 and 1x 4k 144Hz display [at 4k 120HZ, as that is the max the adapter supports])
The testing is a mix of automated and manual tests. Manual testing includes (but is not limited to):
* Changing display configurations and settings
* Benchmark testing
* Feature testing (Freesync, etc.)
Automated testing includes (but is not limited to):
* Script testing (scripts to automate some of the manual checks)
* IGT testing
The patchset consists of the amd-staging-drm-next branch (Head commit - 6fdf2d7a8aaa drm/amd/display: 3.2.282) with new patches added on top of it.
Tested on Ubuntu 22.04.3, on Wayland and X11, using KDE Plasma and Gnome.
Thank you,
Dan Wheeler
Sr. Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
amd.com
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Wayne Lin
Sent: Wednesday, April 24, 2024 4:49 AM
To: [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Pillai, Aurabindo <[email protected]>; Li, Roman <[email protected]>; Lin, Wayne <[email protected]>; Gutierrez, Agustin <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; Wu, Hersen <[email protected]>; Zuo, Jerry <[email protected]>; Lin, Wayne <[email protected]>
Subject: [PATCH 00/46] DC Patches April 29, 2024
This DC patchset brings improvements in multiple areas. In summary, we highlight:
- Disable seamless boot on 128b/132b encoding
- Change ASSR disable sequence to avoid corruption
- Fix few IPS problems
- Enable Replay for DCN315
- Fix few ODM problems
- Fix FEC_READY write timing
- Fix few FPO problems
- Adjust DML21 gpuvm_enable assignment
- Fix divide by 0 error in VM environment
- Fix few DCN35 problems
- Fix flickering on DCN321
- Fix mst resume problem
- Fix multi-disp FAMS problem
- Refactor Replay
- Update some of the dcn303 parameters
- Enable legacy fast update for dcn301
- Add VCO parameter for DCN31 FPU
- Have cursor and surface updates together
- Fix problems reported by Coverity
---
Alex Hung (9):
drm/amd/display: Check index msg_id before read or write drm/amd/display: Check pipe offset before setting vblank drm/amd/display: Skip finding free audio for unknown engine_id drm/amd/display: Do not return negative stream id for array drm/amd/display: ASSERT when failing to find index by plane/stream id drm/amd/display: Remove redundant include file drm/amd/display: Fix uninitialized variables in DM drm/amd/display: Fix uninitialized variables in DC drm/amd/display: Fix uninitialized variables in DC
Alvin Lee (3):
drm/amd/display: Only program P-State force if pipe config changed drm/amd/display: Assign linear_pitch_alignment even for VM drm/amd/display: For FPO + Vactive check that all pipes support VA
Aric Cyr (1):
drm/amd/display: 3.2.283
Daniel Miess (1):
drm/amd/display: Enable RCO for PHYSYMCLK in DCN35
Dennis Chan (1):
drm/amd/display: Refactor for Replay Link off frame count
Harry Wentland (2):
drm/amd/display: Do cursor programming with rest of pipe drm/amd/display: Always use legacy way of setting cursor on DCE
Hersen Wu (2):
drm/amd/display: Add NULL pointer check for kzalloc drm/amd/display: Fix overlapping copy within dml_core_mode_programming
Ilya Bakoulin (1):
drm/amd/display: Fix FEC_READY write on DP LT
Iswara Nagulendran (1):
drm/amd/display: Restrict multi-disp support for in-game FAMS
Joan Lee (1):
drm/amd/display: Enable Replay for DCN315
Leo Ma (1):
drm/amd/display: Fix DC mode screen flickering on DCN321
Nevenko Stupar (1):
drm/amd/display: gpuvm handling in DML21
Nicholas Kazlauskas (2):
drm/amd/display: Add trigger FIFO resync path for DCN35 drm/amd/display: Notify idle link detection through shared state
Revalla Hari Krishna (1):
drm/amd/display: Refactor HUBBUB into component folder
Rodrigo Siqueira (10):
drm/amd/display: Improve registers write drm/amd/display: Add missing SMU version drm/amd/display: Adjust codestyle for dcn31 and hdcp_msg drm/amd/display: Add VCO speed parameter for DCN31 FPU drm/amd/display: Adjust functions prefix for some of the dcn301 fpu
functions
drm/amd/display: Enable legacy fast update for dcn301 drm/amd/display: Update some of the dcn303 parameters drm/amd/display: Remove legacy code in DC drm/amd/display: Add log_color_state callback to multiple DCNs drm/amd/display: Handle the case which quad_part is equal 0
Roman Li (2):
drm/amd/display: Re-enable IPS2 for static screen drm/amd/display: Add periodic detection for IPS
Sung Joon Kim (1):
drm/amd/display: Disable seamless boot on 128b/132b encoding
Swapnil Patel (1):
drm/amd/display: Change ASSR disable sequence
Wayne Lin (2):
drm/amd/display: Remove unnecessary files drm/amd/display: Defer handling mst up request in resume
Webb Chen (1):
drm/amd/display: Revert "dc: Keep VBios pixel rate div setting util
next mode set"
Wenjing Liu (2):
drm/amd/display: take ODM slice count into account when deciding DSC
slice
drm/amd/display: use even ODM slice width for two pixels per container
drivers/gpu/drm/amd/display/Makefile | 1 +
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 105 ++++++++++++++++--
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 9 ++
.../amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 59 +++++++++-
.../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 4 +-
.../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 5 +-
.../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 4 +-
.../amd/display/amdgpu_dm/amdgpu_dm_plane.h | 3 +
.../drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 28 +++++
.../drm/amd/display/amdgpu_dm/amdgpu_dm_psr.h | 1 +
drivers/gpu/drm/amd/display/dc/Makefile | 2 +-
.../drm/amd/display/dc/bios/command_table.c | 2 +-
.../drm/amd/display/dc/bios/command_table2.c | 2 +-
.../display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c | 8 ++
.../display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 23 +++-
drivers/gpu/drm/amd/display/dc/core/dc.c | 13 ++-
.../gpu/drm/amd/display/dc/core/dc_resource.c | 24 +++-
.../gpu/drm/amd/display/dc/core/dc_stream.c | 14 +--
.../drm/amd/display/dc/core/dc_vm_helper.c | 1 +
drivers/gpu/drm/amd/display/dc/dc.h | 11 +-
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 30 +++++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 10 ++
drivers/gpu/drm/amd/display/dc/dc_stream.h | 12 ++
drivers/gpu/drm/amd/display/dc/dc_types.h | 2 +-
.../dc/dce110/dce110_timing_generator.c | 18 +++
.../dc/dce110/dce110_timing_generator.h | 2 +
.../dc/dce110/dce110_timing_generator_v.c | 3 +-
.../dc/dce120/dce120_timing_generator.c | 1 +
.../display/dc/dce80/dce80_timing_generator.c | 1 +
drivers/gpu/drm/amd/display/dc/dcn10/Makefile | 2 +-
.../dc/dcn10/dcn10_hw_sequencer_debug.c | 2 +-
drivers/gpu/drm/amd/display/dc/dcn20/Makefile | 2 +-
.../gpu/drm/amd/display/dc/dcn201/Makefile | 3 +-
drivers/gpu/drm/amd/display/dc/dcn21/Makefile | 2 +-
drivers/gpu/drm/amd/display/dc/dcn30/Makefile | 3 +-
.../gpu/drm/amd/display/dc/dcn30/dcn30_mpc.c | 2 +-
.../gpu/drm/amd/display/dc/dcn301/Makefile | 2 +-
drivers/gpu/drm/amd/display/dc/dcn31/Makefile | 2 +-
.../drm/amd/display/dc/dcn314/dcn314_dccg.c | 12 +-
drivers/gpu/drm/amd/display/dc/dcn32/Makefile | 2 +-
.../gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c | 12 +-
.../dc/dcn32/dcn32_dio_stream_encoder.c | 40 ++++++-
.../display/dc/dcn32/dcn32_resource_helpers.c | 6 +-
drivers/gpu/drm/amd/display/dc/dcn35/Makefile | 2 +-
.../gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c | 63 +++--------
.../dc/dcn35/dcn35_dio_stream_encoder.c | 36 +++++-
drivers/gpu/drm/amd/display/dc/dm_pp_smu.h | 3 +-
.../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 4 +-
.../drm/amd/display/dc/dml/dcn30/dcn30_fpu.c | 2 +-
.../amd/display/dc/dml/dcn301/dcn301_fpu.c | 4 +-
.../amd/display/dc/dml/dcn301/dcn301_fpu.h | 7 +-
.../drm/amd/display/dc/dml/dcn31/dcn31_fpu.c | 22 +--- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 22 +++-
.../drm/amd/display/dc/dml/dcn32/dcn32_fpu.h | 2 +-
.../dc/dml/dcn32/display_mode_vba_util_32.c | 4 +-
.../amd/display/dc/dml2/display_mode_core.c | 4 +-
.../dc/dml2/dml21/dml21_translation_helper.c | 2 +-
.../display/dc/dml2/dml2_dc_resource_mgmt.c | 8 +-
.../display/dc/dml2/dml2_translation_helper.c | 6 +-
.../drm/amd/display/dc/dml2/dml2_wrapper.h | 1 +
.../amd/display/dc/dpp/dcn10/CMakeLists.txt | 6 -
.../amd/display/dc/dpp/dcn10/dcn10_dpp_cm.c | 5 +-
.../amd/display/dc/dpp/dcn20/CMakeLists.txt | 5 -
.../amd/display/dc/dpp/dcn20/dcn20_dpp_cm.c | 2 +-
.../amd/display/dc/dpp/dcn201/CMakeLists.txt | 4 -
.../amd/display/dc/dpp/dcn30/CMakeLists.txt | 5 -
.../amd/display/dc/dpp/dcn30/dcn30_dpp_cm.c | 2 +-
.../amd/display/dc/dpp/dcn32/CMakeLists.txt | 4 -
.../amd/display/dc/dpp/dcn35/CMakeLists.txt | 4 -
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 30 +++--
.../drm/amd/display/dc/gpio/gpio_service.c | 6 +-
.../gpu/drm/amd/display/dc/hdcp/hdcp_msg.c | 2 +-
.../gpu/drm/amd/display/dc/hubbub/Makefile | 100 +++++++++++++++++
.../dc/{ => hubbub}/dcn10/dcn10_hubbub.c | 2 +-
.../dc/{ => hubbub}/dcn10/dcn10_hubbub.h | 0
.../dc/{ => hubbub}/dcn20/dcn20_hubbub.c | 0
.../dc/{ => hubbub}/dcn20/dcn20_hubbub.h | 2 +-
.../dc/{ => hubbub}/dcn201/dcn201_hubbub.c | 0
.../dc/{ => hubbub}/dcn201/dcn201_hubbub.h | 0
.../dc/{ => hubbub}/dcn21/dcn21_hubbub.c | 0
.../dc/{ => hubbub}/dcn21/dcn21_hubbub.h | 0
.../dc/{ => hubbub}/dcn30/dcn30_hubbub.c | 0
.../dc/{ => hubbub}/dcn30/dcn30_hubbub.h | 0
.../dc/{ => hubbub}/dcn301/dcn301_hubbub.c | 0
.../dc/{ => hubbub}/dcn301/dcn301_hubbub.h | 0
.../dc/{ => hubbub}/dcn31/dcn31_hubbub.c | 0
.../dc/{ => hubbub}/dcn31/dcn31_hubbub.h | 0
.../dc/{ => hubbub}/dcn32/dcn32_hubbub.c | 0
.../dc/{ => hubbub}/dcn32/dcn32_hubbub.h | 0
.../dc/{ => hubbub}/dcn35/dcn35_hubbub.c | 0
.../dc/{ => hubbub}/dcn35/dcn35_hubbub.h | 0
drivers/gpu/drm/amd/display/dc/hwss/Makefile | 6 -
.../amd/display/dc/hwss/dce110/dce110_hwseq.c | 28 +----
.../amd/display/dc/hwss/dcn10/dcn10_hwseq.c | 6 +-
.../amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 42 ++++---
.../amd/display/dc/hwss/dcn201/dcn201_hwseq.c | 7 +-
.../amd/display/dc/hwss/dcn21/dcn21_hwseq.c | 2 +-
.../amd/display/dc/hwss/dcn21/dcn21_init.c | 1 +
.../amd/display/dc/hwss/dcn30/dcn30_hwseq.h | 2 +-
.../amd/display/dc/hwss/dcn30/dcn30_init.c | 1 +
.../amd/display/dc/hwss/dcn301/dcn301_init.c | 4 +-
.../amd/display/dc/hwss/dcn31/dcn31_hwseq.c | 2 +-
.../amd/display/dc/hwss/dcn31/dcn31_init.c | 1 +
.../amd/display/dc/hwss/dcn314/dcn314_hwseq.c | 29 +----
.../amd/display/dc/hwss/dcn314/dcn314_hwseq.h | 4 -
.../amd/display/dc/hwss/dcn314/dcn314_init.c | 2 +-
.../amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 68 +++++-------
.../amd/display/dc/hwss/dcn32/dcn32_hwseq.h | 4 -
.../amd/display/dc/hwss/dcn32/dcn32_init.c | 1 -
.../amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 34 +++++-
.../amd/display/dc/hwss/dcn35/dcn35_hwseq.h | 2 +
.../amd/display/dc/hwss/dcn35/dcn35_init.c | 4 +-
.../amd/display/dc/hwss/dcn351/dcn351_init.c | 2 +-
.../display/dc/hwss/hw_sequencer_private.h | 7 +-
.../gpu/drm/amd/display/dc/inc/core_types.h | 7 --
drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h | 5 -
drivers/gpu/drm/amd/display/dc/inc/hw/optc.h | 4 +-
.../amd/display/dc/inc/hw/stream_encoder.h | 1 -
.../amd/display/dc/inc/hw/timing_generator.h | 1 +
.../dc/irq/dce110/irq_service_dce110.c | 8 +-
.../drm/amd/display/dc/link/link_detection.c | 4 +-
.../gpu/drm/amd/display/dc/link/link_dpms.c | 11 +-
.../dc/link/protocols/link_dp_capability.c | 16 +--
.../dc/link/protocols/link_dp_irq_handler.c | 10 +-
.../display/dc/link/protocols/link_dp_phy.c | 14 +--
.../dc/link/protocols/link_dp_training.c | 2 +-
.../link/protocols/link_edp_panel_control.c | 4 +-
.../amd/display/dc/link/protocols/link_hpd.c | 2 +-
.../amd/display/dc/optc/dcn10/dcn10_optc.c | 46 ++++----
.../amd/display/dc/optc/dcn20/dcn20_optc.c | 10 +-
.../amd/display/dc/optc/dcn20/dcn20_optc.h | 1 -
.../amd/display/dc/optc/dcn201/dcn201_optc.c | 7 +-
.../amd/display/dc/optc/dcn201/dcn201_optc.h | 3 -
.../amd/display/dc/optc/dcn30/dcn30_optc.c | 3 +-
.../amd/display/dc/optc/dcn301/dcn301_optc.c | 1 +
.../amd/display/dc/optc/dcn31/dcn31_optc.c | 1 +
.../amd/display/dc/optc/dcn314/dcn314_optc.c | 3 +-
.../amd/display/dc/optc/dcn32/dcn32_optc.c | 3 +-
.../amd/display/dc/optc/dcn35/dcn35_optc.c | 1 +
.../amd/display/dc/optc/dcn401/dcn401_optc.c | 15 ++-
drivers/gpu/drm/amd/display/dc/os_types.h | 2 -
.../display/dc/resource/dce80/CMakeLists.txt | 4 -
.../dc/resource/dcn20/dcn20_resource.c | 2 +-
.../dc/resource/dcn30/dcn30_resource.c | 5 +-
.../dc/resource/dcn301/dcn301_resource.c | 20 +++-
.../dc/resource/dcn303/dcn303_resource.c | 13 ++-
.../dc/resource/dcn31/dcn31_resource.c | 5 +
.../dc/resource/dcn314/dcn314_resource.c | 5 +
.../dc/resource/dcn315/dcn315_resource.c | 14 +++
.../dc/resource/dcn316/dcn316_resource.c | 2 +
.../dc/resource/dcn32/dcn32_resource.c | 5 +
.../dc/resource/dcn321/dcn321_resource.c | 2 +
.../dc/resource/dcn35/dcn35_resource.c | 2 +
.../dc/resource/dcn351/dcn351_resource.c | 2 +
drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 1 +
.../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 15 ++-
.../gpu/drm/amd/display/dmub/src/dmub_srv.c | 2 +
.../gpu/drm/amd/display/include/dal_types.h | 1 -
.../drm/amd/display/modules/hdcp/hdcp_ddc.c | 8 ++
.../amd/display/modules/power/power_helpers.c | 8 +-
160 files changed, 952 insertions(+), 469 deletions(-) delete mode 100644 drivers/gpu/drm/amd/display/dc/dpp/dcn10/CMakeLists.txt
delete mode 100644 drivers/gpu/drm/amd/display/dc/dpp/dcn20/CMakeLists.txt
delete mode 100644 drivers/gpu/drm/amd/display/dc/dpp/dcn201/CMakeLists.txt
delete mode 100644 drivers/gpu/drm/amd/display/dc/dpp/dcn30/CMakeLists.txt
delete mode 100644 drivers/gpu/drm/amd/display/dc/dpp/dcn32/CMakeLists.txt
delete mode 100644 drivers/gpu/drm/amd/display/dc/dpp/dcn35/CMakeLists.txt
create mode 100644 drivers/gpu/drm/amd/display/dc/hubbub/Makefile
rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn10/dcn10_hubbub.c (99%) rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn10/dcn10_hubbub.h (100%) rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn20/dcn20_hubbub.c (100%) rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn20/dcn20_hubbub.h (99%) rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn201/dcn201_hubbub.c (100%) rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn201/dcn201_hubbub.h (100%) rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn21/dcn21_hubbub.c (100%) rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn21/dcn21_hubbub.h (100%) rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn30/dcn30_hubbub.c (100%) rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn30/dcn30_hubbub.h (100%) rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn301/dcn301_hubbub.c (100%) rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn301/dcn301_hubbub.h (100%) rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn31/dcn31_hubbub.c (100%) rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn31/dcn31_hubbub.h (100%) rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn32/dcn32_hubbub.c (100%) rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn32/dcn32_hubbub.h (100%) rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn35/dcn35_hubbub.c (100%) rename drivers/gpu/drm/amd/display/dc/{ => hubbub}/dcn35/dcn35_hubbub.h (100%) delete mode 100644 drivers/gpu/drm/amd/display/dc/resource/dce80/CMakeLists.txt--
2.37.3