* [PATCH 10/46] drm/amd/display: Remove unnecessary files
2024-04-24 8:31 Wayne Lin
@ 2024-04-24 8:31 ` Wayne Lin
0 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:31 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Wayne Lin
[Why & How]
We accidentally upstream unnecessary files. Remove them.
Reviewed-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
---
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
diff --git a/drivers/gpu/drm/amd/display/dc/dpp/dcn10/CMakeLists.txt b/drivers/gpu/drm/amd/display/dc/dpp/dcn10/CMakeLists.txt
deleted file mode 100644
index 1318c6fba3e7..000000000000
--- a/drivers/gpu/drm/amd/display/dc/dpp/dcn10/CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-dal3_subdirectory_sources(
- dcn10_dpp.c
- dcn10_dpp_cm.c
- dcn10_dpp_dscl.c
- dcn10_dpp.h
-)
diff --git a/drivers/gpu/drm/amd/display/dc/dpp/dcn20/CMakeLists.txt b/drivers/gpu/drm/amd/display/dc/dpp/dcn20/CMakeLists.txt
deleted file mode 100644
index 9c2d7096348e..000000000000
--- a/drivers/gpu/drm/amd/display/dc/dpp/dcn20/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-dal3_subdirectory_sources(
- dcn20_dpp.c
- dcn20_dpp_cm.c
- dcn20_dpp.h
-)
diff --git a/drivers/gpu/drm/amd/display/dc/dpp/dcn201/CMakeLists.txt b/drivers/gpu/drm/amd/display/dc/dpp/dcn201/CMakeLists.txt
deleted file mode 100644
index 7711cd3c47a7..000000000000
--- a/drivers/gpu/drm/amd/display/dc/dpp/dcn201/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-dal3_subdirectory_sources(
- dcn201_dpp.c
- dcn201_dpp.h
-)
diff --git a/drivers/gpu/drm/amd/display/dc/dpp/dcn30/CMakeLists.txt b/drivers/gpu/drm/amd/display/dc/dpp/dcn30/CMakeLists.txt
deleted file mode 100644
index 0faee2a1e32b..000000000000
--- a/drivers/gpu/drm/amd/display/dc/dpp/dcn30/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-dal3_subdirectory_sources(
- dcn30_dpp.c
- dcn30_dpp_cm.c
- dcn30_dpp.h
-)
diff --git a/drivers/gpu/drm/amd/display/dc/dpp/dcn32/CMakeLists.txt b/drivers/gpu/drm/amd/display/dc/dpp/dcn32/CMakeLists.txt
deleted file mode 100644
index 7743edc4599f..000000000000
--- a/drivers/gpu/drm/amd/display/dc/dpp/dcn32/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-dal3_subdirectory_sources(
- dcn32_dpp.c
- dcn32_dpp.h
-)
diff --git a/drivers/gpu/drm/amd/display/dc/dpp/dcn35/CMakeLists.txt b/drivers/gpu/drm/amd/display/dc/dpp/dcn35/CMakeLists.txt
deleted file mode 100644
index 91df5db26435..000000000000
--- a/drivers/gpu/drm/amd/display/dc/dpp/dcn35/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-dal3_subdirectory_sources(
- dcn35_dpp.c
- dcn35_dpp.h
-)
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dce80/CMakeLists.txt b/drivers/gpu/drm/amd/display/dc/resource/dce80/CMakeLists.txt
deleted file mode 100644
index 19dd73bc9ab0..000000000000
--- a/drivers/gpu/drm/amd/display/dc/resource/dce80/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-dal3_subdirectory_sources(
- dce80_resource.c
- dce80_resource.h
- )
\ No newline at end of file
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 00/46] DC Patches April 29, 2024
@ 2024-04-24 8:48 Wayne Lin
2024-04-24 8:48 ` [PATCH 01/46] drm/amd/display: Do cursor programming with rest of pipe Wayne Lin
` (46 more replies)
0 siblings, 47 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:48 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Wayne Lin
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
^ permalink raw reply [flat|nested] 50+ messages in thread
* [PATCH 01/46] drm/amd/display: Do cursor programming with rest of pipe
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
@ 2024-04-24 8:48 ` Wayne Lin
2024-04-24 8:48 ` [PATCH 02/46] drm/amd/display: Always use legacy way of setting cursor on DCE Wayne Lin
` (45 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:48 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Harry Wentland
From: Harry Wentland <harry.wentland@amd.com>
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.
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/2186
Reviewed-by: Agustin Gutierrez <agustin.gutierrez@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
---
.../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(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 7481440ab124..75b65b243f1e 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -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:
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
index 3c03f690852c..a64f20fcddaa 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
@@ -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;
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.h
index b51a6b57bd9b..6498359bff6f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.h
@@ -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);
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 3e16041bf4f9..e955c97697ff 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -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)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
index 3ac1fec4bf53..b5a89b587d86 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
@@ -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);
diff --git a/drivers/gpu/drm/amd/display/dc/dc_stream.h b/drivers/gpu/drm/amd/display/dc/dc_stream.h
index 8dd65a95d84b..1469a20f2511 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_stream.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_stream.h
@@ -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);
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 02/46] drm/amd/display: Always use legacy way of setting cursor on DCE
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
2024-04-24 8:48 ` [PATCH 01/46] drm/amd/display: Do cursor programming with rest of pipe Wayne Lin
@ 2024-04-24 8:48 ` Wayne Lin
2024-04-24 8:48 ` [PATCH 03/46] drm/amd/display: Add NULL pointer check for kzalloc Wayne Lin
` (44 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:48 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Harry Wentland, Sun peng Li
From: Harry Wentland <harry.wentland@amd.com>
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.
Reviewed-by: Agustin Gutierrez <agustin.gutierrez@amd.com>
Reviewed-by: Sun peng Li <sunpeng.li@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 75b65b243f1e..9d36dba914e9 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -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:
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 03/46] drm/amd/display: Add NULL pointer check for kzalloc
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
2024-04-24 8:48 ` [PATCH 01/46] drm/amd/display: Do cursor programming with rest of pipe Wayne Lin
2024-04-24 8:48 ` [PATCH 02/46] drm/amd/display: Always use legacy way of setting cursor on DCE Wayne Lin
@ 2024-04-24 8:48 ` Wayne Lin
2024-04-24 8:48 ` [PATCH 04/46] drm/amd/display: Check index msg_id before read or write Wayne Lin
` (43 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:48 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Alex Hung
From: Hersen Wu <hersenxs.wu@amd.com>
[Why & How]
Check return pointer of kzalloc before using it.
Reviewed-by: Alex Hung <alex.hung@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Hersen Wu <hersenxs.wu@amd.com>
---
.../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(+)
diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c
index 4cb0db0ed92f..8083a553c60e 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c
@@ -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)
diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c
index d7bbb0891398..b9e1f3e0b31d 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c
@@ -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)
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c
index d9e98abb3640..fa1305f04341 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c
@@ -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();
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c
index ecec3b69bb88..d4c3e2754f51 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c
@@ -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();
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.c
index 3bae606ed700..ff50f43e4c00 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.c
@@ -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;
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c
index 515ba435f759..4ce0f4bf1d9b 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c
@@ -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],
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn316/dcn316_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn316/dcn316_resource.c
index e808231e8478..5fd52c5fcee4 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn316/dcn316_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn316/dcn316_resource.c
@@ -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],
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c
index d17241a882bd..022d320be1d5 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c
@@ -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_val
BW_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();
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn321/dcn321_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn321/dcn321_resource.c
index 3816678b044f..e4b360d89b3b 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn321/dcn321_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn321/dcn321_resource.c
@@ -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
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c
index 25ac450944e7..2df8a742516c 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c
@@ -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
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c
index ed98bfd9622a..982526c41d55 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c
@@ -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
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 04/46] drm/amd/display: Check index msg_id before read or write
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (2 preceding siblings ...)
2024-04-24 8:48 ` [PATCH 03/46] drm/amd/display: Add NULL pointer check for kzalloc Wayne Lin
@ 2024-04-24 8:48 ` Wayne Lin
2024-04-24 8:48 ` [PATCH 05/46] drm/amd/display: Check pipe offset before setting vblank Wayne Lin
` (42 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:48 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Alex Hung, Rodrigo Siqueira
From: Alex Hung <alex.hung@amd.com>
[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.
Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
---
drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c
index f7b5583ee609..8e9caae7c955 100644
--- a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c
+++ b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c
@@ -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);
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 05/46] drm/amd/display: Check pipe offset before setting vblank
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (3 preceding siblings ...)
2024-04-24 8:48 ` [PATCH 04/46] drm/amd/display: Check index msg_id before read or write Wayne Lin
@ 2024-04-24 8:48 ` Wayne Lin
2024-04-24 8:48 ` [PATCH 06/46] drm/amd/display: Skip finding free audio for unknown engine_id Wayne Lin
` (41 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:48 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Alex Hung, Rodrigo Siqueira
From: Alex Hung <alex.hung@amd.com>
pipe_ctx has a size of MAX_PIPES so checking its index before accessing
the array.
This fixes an OVERRUN issue reported by Coverity.
Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
---
.../drm/amd/display/dc/irq/dce110/irq_service_dce110.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c b/drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c
index 1c0d89e675da..bb576a9c5fdb 100644
--- a/drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c
+++ b/drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c
@@ -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)) {
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 06/46] drm/amd/display: Skip finding free audio for unknown engine_id
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (4 preceding siblings ...)
2024-04-24 8:48 ` [PATCH 05/46] drm/amd/display: Check pipe offset before setting vblank Wayne Lin
@ 2024-04-24 8:48 ` Wayne Lin
2024-04-24 8:48 ` [PATCH 07/46] drm/amd/display: Fix overlapping copy within dml_core_mode_programming Wayne Lin
` (40 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:48 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Alex Hung, Rodrigo Siqueira
From: Alex Hung <alex.hung@amd.com>
[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.
Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
---
drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index fa93d6d6563d..93f05e2080f4 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -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++) {
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 07/46] drm/amd/display: Fix overlapping copy within dml_core_mode_programming
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (5 preceding siblings ...)
2024-04-24 8:48 ` [PATCH 06/46] drm/amd/display: Skip finding free audio for unknown engine_id Wayne Lin
@ 2024-04-24 8:48 ` Wayne Lin
2024-04-24 8:48 ` [PATCH 08/46] drm/amd/display: Do not return negative stream id for array Wayne Lin
` (39 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:48 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Rodrigo Siqueira, Alex Hung
From: Hersen Wu <hersenxs.wu@amd.com>
[WHY]
&mode_lib->mp.Watermark and &locals->Watermark are
the same address. memcpy may lead to unexpected behavior.
[HOW]
memmove should be used.
Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Hersen Wu <hersenxs.wu@amd.com>
---
drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c b/drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c
index 6255101737b5..3e919f5c00ca 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c
@@ -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) {
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 08/46] drm/amd/display: Do not return negative stream id for array
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (6 preceding siblings ...)
2024-04-24 8:48 ` [PATCH 07/46] drm/amd/display: Fix overlapping copy within dml_core_mode_programming Wayne Lin
@ 2024-04-24 8:48 ` Wayne Lin
2024-04-24 8:48 ` [PATCH 09/46] drm/amd/display: ASSERT when failing to find index by plane/stream id Wayne Lin
` (38 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:48 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Alex Hung, Rodrigo Siqueira
From: Alex Hung <alex.hung@amd.com>
[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.
Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
---
drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index 93f05e2080f4..25c64fdcfa44 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -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;
}
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 09/46] drm/amd/display: ASSERT when failing to find index by plane/stream id
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (7 preceding siblings ...)
2024-04-24 8:48 ` [PATCH 08/46] drm/amd/display: Do not return negative stream id for array Wayne Lin
@ 2024-04-24 8:48 ` Wayne Lin
2024-04-24 8:48 ` [PATCH 10/46] drm/amd/display: Remove unnecessary files Wayne Lin
` (37 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:48 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Alex Hung, Rodrigo Siqueira
From: Alex Hung <alex.hung@amd.com>
[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.
Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
---
drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c b/drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c
index b82d56ed1ef4..a2ced0bc772c 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c
@@ -88,7 +88,8 @@ static int find_disp_cfg_idx_by_plane_id(struct dml2_dml_to_dc_pipe_mapping *map
return 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 *ma
return 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
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 10/46] drm/amd/display: Remove unnecessary files
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (8 preceding siblings ...)
2024-04-24 8:48 ` [PATCH 09/46] drm/amd/display: ASSERT when failing to find index by plane/stream id Wayne Lin
@ 2024-04-24 8:48 ` Wayne Lin
2024-04-24 8:48 ` [PATCH 11/46] drm/amd/display: Improve registers write Wayne Lin
` (36 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:48 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Wayne Lin
[Why & How]
We accidentally upstream unnecessary files. Remove them.
Reviewed-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
---
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
diff --git a/drivers/gpu/drm/amd/display/dc/dpp/dcn10/CMakeLists.txt b/drivers/gpu/drm/amd/display/dc/dpp/dcn10/CMakeLists.txt
deleted file mode 100644
index 1318c6fba3e7..000000000000
--- a/drivers/gpu/drm/amd/display/dc/dpp/dcn10/CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-dal3_subdirectory_sources(
- dcn10_dpp.c
- dcn10_dpp_cm.c
- dcn10_dpp_dscl.c
- dcn10_dpp.h
-)
diff --git a/drivers/gpu/drm/amd/display/dc/dpp/dcn20/CMakeLists.txt b/drivers/gpu/drm/amd/display/dc/dpp/dcn20/CMakeLists.txt
deleted file mode 100644
index 9c2d7096348e..000000000000
--- a/drivers/gpu/drm/amd/display/dc/dpp/dcn20/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-dal3_subdirectory_sources(
- dcn20_dpp.c
- dcn20_dpp_cm.c
- dcn20_dpp.h
-)
diff --git a/drivers/gpu/drm/amd/display/dc/dpp/dcn201/CMakeLists.txt b/drivers/gpu/drm/amd/display/dc/dpp/dcn201/CMakeLists.txt
deleted file mode 100644
index 7711cd3c47a7..000000000000
--- a/drivers/gpu/drm/amd/display/dc/dpp/dcn201/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-dal3_subdirectory_sources(
- dcn201_dpp.c
- dcn201_dpp.h
-)
diff --git a/drivers/gpu/drm/amd/display/dc/dpp/dcn30/CMakeLists.txt b/drivers/gpu/drm/amd/display/dc/dpp/dcn30/CMakeLists.txt
deleted file mode 100644
index 0faee2a1e32b..000000000000
--- a/drivers/gpu/drm/amd/display/dc/dpp/dcn30/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-dal3_subdirectory_sources(
- dcn30_dpp.c
- dcn30_dpp_cm.c
- dcn30_dpp.h
-)
diff --git a/drivers/gpu/drm/amd/display/dc/dpp/dcn32/CMakeLists.txt b/drivers/gpu/drm/amd/display/dc/dpp/dcn32/CMakeLists.txt
deleted file mode 100644
index 7743edc4599f..000000000000
--- a/drivers/gpu/drm/amd/display/dc/dpp/dcn32/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-dal3_subdirectory_sources(
- dcn32_dpp.c
- dcn32_dpp.h
-)
diff --git a/drivers/gpu/drm/amd/display/dc/dpp/dcn35/CMakeLists.txt b/drivers/gpu/drm/amd/display/dc/dpp/dcn35/CMakeLists.txt
deleted file mode 100644
index 91df5db26435..000000000000
--- a/drivers/gpu/drm/amd/display/dc/dpp/dcn35/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-dal3_subdirectory_sources(
- dcn35_dpp.c
- dcn35_dpp.h
-)
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dce80/CMakeLists.txt b/drivers/gpu/drm/amd/display/dc/resource/dce80/CMakeLists.txt
deleted file mode 100644
index 19dd73bc9ab0..000000000000
--- a/drivers/gpu/drm/amd/display/dc/resource/dce80/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-dal3_subdirectory_sources(
- dce80_resource.c
- dce80_resource.h
- )
\ No newline at end of file
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 11/46] drm/amd/display: Improve registers write
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (9 preceding siblings ...)
2024-04-24 8:48 ` [PATCH 10/46] drm/amd/display: Remove unnecessary files Wayne Lin
@ 2024-04-24 8:48 ` Wayne Lin
2024-04-24 8:48 ` [PATCH 12/46] drm/amd/display: Add missing SMU version Wayne Lin
` (35 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:48 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo
From: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Add REG_SEQ_SUBMIT and REG_SEQ_WAIT_DONE to optimize the burst write for
the regama lut.
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
---
drivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp_cm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp_cm.c b/drivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp_cm.c
index 20481b144609..2d5d64276cb0 100644
--- a/drivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp_cm.c
+++ b/drivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp_cm.c
@@ -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(
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 12/46] drm/amd/display: Add missing SMU version
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (10 preceding siblings ...)
2024-04-24 8:48 ` [PATCH 11/46] drm/amd/display: Improve registers write Wayne Lin
@ 2024-04-24 8:48 ` Wayne Lin
2024-04-24 8:48 ` [PATCH 13/46] drm/amd/display: Adjust codestyle for dcn31 and hdcp_msg Wayne Lin
` (34 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:48 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo
From: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
This commit add PP_SMU_VER_VG to the pp_smu_ver list.
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
---
drivers/gpu/drm/amd/display/dc/dm_pp_smu.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dm_pp_smu.h b/drivers/gpu/drm/amd/display/dc/dm_pp_smu.h
index bd7ba0a25198..b0e17a594ec3 100644
--- a/drivers/gpu/drm/amd/display/dc/dm_pp_smu.h
+++ b/drivers/gpu/drm/amd/display/dc/dm_pp_smu.h
@@ -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
};
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 13/46] drm/amd/display: Adjust codestyle for dcn31 and hdcp_msg
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (11 preceding siblings ...)
2024-04-24 8:48 ` [PATCH 12/46] drm/amd/display: Add missing SMU version Wayne Lin
@ 2024-04-24 8:48 ` Wayne Lin
2024-04-24 8:48 ` [PATCH 14/46] drm/amd/display: Add VCO speed parameter for DCN31 FPU Wayne Lin
` (33 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:48 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo
From: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
This commit just update the code style in two if conditions and in an
static array.
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
---
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(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c
index 59a902313200..4407640c5f87 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c
@@ -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));
diff --git a/drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c b/drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c
index 99e17c164ce7..076a829c2378 100644
--- a/drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c
+++ b/drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c
@@ -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] = {
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 14/46] drm/amd/display: Add VCO speed parameter for DCN31 FPU
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (12 preceding siblings ...)
2024-04-24 8:48 ` [PATCH 13/46] drm/amd/display: Adjust codestyle for dcn31 and hdcp_msg Wayne Lin
@ 2024-04-24 8:48 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 15/46] drm/amd/display: Adjust functions prefix for some of the dcn301 fpu functions Wayne Lin
` (32 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:48 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo
From: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Add VCO speed parameters in the bounding box array.
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
---
drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c
index 4407640c5f87..bfc042209007 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c
@@ -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,
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 15/46] drm/amd/display: Adjust functions prefix for some of the dcn301 fpu functions
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (13 preceding siblings ...)
2024-04-24 8:48 ` [PATCH 14/46] drm/amd/display: Add VCO speed parameter for DCN31 FPU Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 16/46] drm/amd/display: Enable legacy fast update for dcn301 Wayne Lin
` (31 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo
From: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Add dcn301_fpu prefix to some of the FPU function with the required
adjustments.
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
---
.../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(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn301/dcn301_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn301/dcn301_fpu.c
index 6ce90678b33c..0c0b2d67c9cd 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn301/dcn301_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn301/dcn301_fpu.c
@@ -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,
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn301/dcn301_fpu.h b/drivers/gpu/drm/amd/display/dc/dml/dcn301/dcn301_fpu.h
index 774b0fdfc80b..3e103e23dc6f 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn301/dcn301_fpu.h
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn301/dcn301_fpu.h
@@ -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,
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn301/dcn301_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn301/dcn301_resource.c
index 7538b548c572..346cec70de96 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn301/dcn301_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn301/dcn301_resource.c
@@ -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();
}
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 16/46] drm/amd/display: Enable legacy fast update for dcn301
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (14 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 15/46] drm/amd/display: Adjust functions prefix for some of the dcn301 fpu functions Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 17/46] drm/amd/display: Update some of the dcn303 parameters Wayne Lin
` (30 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo
From: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Set up to enable legacy fast update.
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
---
drivers/gpu/drm/amd/display/dc/resource/dcn301/dcn301_resource.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn301/dcn301_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn301/dcn301_resource.c
index 346cec70de96..7d04739c3ba1 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn301/dcn301_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn301/dcn301_resource.c
@@ -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,
};
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 17/46] drm/amd/display: Update some of the dcn303 parameters
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (15 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 16/46] drm/amd/display: Enable legacy fast update for dcn301 Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 18/46] drm/amd/display: Remove legacy code in DC Wayne Lin
` (29 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo
From: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Adjust to update some of the dcn303 parameters.
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
---
.../amd/display/dc/resource/dcn303/dcn303_resource.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn303/dcn303_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn303/dcn303_resource.c
index 25cd6236b054..d2bc66904217 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn303/dcn303_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn303/dcn303_resource.c
@@ -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;
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 18/46] drm/amd/display: Remove legacy code in DC
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (16 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 17/46] drm/amd/display: Update some of the dcn303 parameters Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 19/46] drm/amd/display: Add log_color_state callback to multiple DCNs Wayne Lin
` (28 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo
From: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
This commit just remove some trivial legacy code in some of the DC
files.
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
---
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(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c
index bfc042209007..17a21bcbde17 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c
@@ -762,23 +762,11 @@ void dcn316_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param
break;
}
}
- // 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 *
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/Makefile b/drivers/gpu/drm/amd/display/dc/hwss/Makefile
index ba55050be161..40ecebea1ba0 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/hwss/Makefile
@@ -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))
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.h b/drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.h
index 76b16839486a..6a153e7ce910 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.h
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.h
@@ -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);
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn301/dcn301_init.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn301/dcn301_init.c
index 6477009ce065..0e5c037e82a6 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn301/dcn301_init.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn301/dcn301_init.c
@@ -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,
diff --git a/drivers/gpu/drm/amd/display/dc/os_types.h b/drivers/gpu/drm/amd/display/dc/os_types.h
index 6c4578d347af..f2ba76c1e0c0 100644
--- a/drivers/gpu/drm/amd/display/dc/os_types.h
+++ b/drivers/gpu/drm/amd/display/dc/os_types.h
@@ -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>
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 19/46] drm/amd/display: Add log_color_state callback to multiple DCNs
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (17 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 18/46] drm/amd/display: Remove legacy code in DC Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 20/46] drm/amd/display: Handle the case which quad_part is equal 0 Wayne Lin
` (27 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo
From: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Set up to enable log color state for multiple DCNs.
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
---
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(+)
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_init.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_init.c
index 18249c6b6d81..3dfac372d165 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_init.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_init.c
@@ -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,
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_init.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_init.c
index ef913445a795..4b32497c09d0 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_init.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_init.c
@@ -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,
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn301/dcn301_init.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn301/dcn301_init.c
index 0e5c037e82a6..97e33eb7ac5a 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn301/dcn301_init.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn301/dcn301_init.c
@@ -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,
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_init.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_init.c
index c06cc2c5da92..9cb7afe0e731 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_init.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_init.c
@@ -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,
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_init.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_init.c
index 934203ef52bb..f9120b1c1c1f 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_init.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_init.c
@@ -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,
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 20/46] drm/amd/display: Handle the case which quad_part is equal 0
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (18 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 19/46] drm/amd/display: Add log_color_state callback to multiple DCNs Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 21/46] drm/amd/display: Refactor for Replay Link off frame count Wayne Lin
` (26 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo
From: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Add code to handle case when quad_part is 0 in gpu_addr_to_uma().
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
---
drivers/gpu/drm/amd/display/dc/hwss/dcn201/dcn201_hwseq.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn201/dcn201_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn201/dcn201_hwseq.c
index d5769f38874f..7f7b6bf76a8d 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn201/dcn201_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn201/dcn201_hwseq.c
@@ -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;
}
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 21/46] drm/amd/display: Refactor for Replay Link off frame count
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (19 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 20/46] drm/amd/display: Handle the case which quad_part is equal 0 Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 22/46] drm/amd/display: Restrict multi-disp support for in-game FAMS Wayne Lin
` (25 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Dennis Chan, ChunTao Tso, Robin Chen
From: Dennis Chan <dennis.chan@amd.com>
[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.
Reviewed-by: ChunTao Tso <chuntao.tso@amd.com>
Reviewed-by: Robin Chen <robin.chen@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Dennis Chan <dennis.chan@amd.com>
---
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(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dc_types.h b/drivers/gpu/drm/amd/display/dc/dc_types.h
index d79de4780151..cee012587e6e 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_types.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_types.h
@@ -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 */
diff --git a/drivers/gpu/drm/amd/display/modules/power/power_helpers.c b/drivers/gpu/drm/amd/display/modules/power/power_helpers.c
index 2a3698fd2dc2..530379508a69 100644
--- a/drivers/gpu/drm/amd/display/modules/power/power_helpers.c
+++ b/drivers/gpu/drm/amd/display/modules/power/power_helpers.c
@@ -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)
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 22/46] drm/amd/display: Restrict multi-disp support for in-game FAMS
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (20 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 21/46] drm/amd/display: Refactor for Replay Link off frame count Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 23/46] drm/amd/display: Defer handling mst up request in resume Wayne Lin
` (24 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Iswara Nagulendran, Harry Vanzylldejong
From: Iswara Nagulendran <iswara.nagulendran@amd.com>
[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.
Reviewed-by: Harry Vanzylldejong <harry.vanzylldejong@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Iswara Nagulendran <iswara.nagulendran@amd.com>
---
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(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index a3ebe4f00779..3048d5a0e87d 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -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;
diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c
index 6472da2c361e..a8c36eda1d09 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c
@@ -580,7 +580,9 @@ struct dc_stream_state *dcn32_can_support_mclk_switch_using_fw_based_vblank_stre
if (!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;
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c
index fa1305f04341..1ce727351c39 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c
@@ -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;
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 23/46] drm/amd/display: Defer handling mst up request in resume
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (21 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 22/46] drm/amd/display: Restrict multi-disp support for in-game FAMS Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 24/46] drm/amd/display: Fix DC mode screen flickering on DCN321 Wayne Lin
` (23 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Mario Limonciello, Alex Deucher, stable
From: Wayne Lin <wayne.lin@amd.com>
[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().
Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Reviewed-by: Hersen Wu <hersenxs.wu@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 9d36dba914e9..961b5984afa0 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -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");
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 24/46] drm/amd/display: Fix DC mode screen flickering on DCN321
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (22 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 23/46] drm/amd/display: Defer handling mst up request in resume Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 25/46] drm/amd/display: take ODM slice count into account when deciding DSC slice Wayne Lin
` (22 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Leo Ma, Alvin Lee
From: Leo Ma <hanghong.ma@amd.com>
[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.
Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Leo Ma <hanghong.ma@amd.com>
---
.../amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c
index b9e1f3e0b31d..ff5fdc7b1198 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c
@@ -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) {
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 25/46] drm/amd/display: take ODM slice count into account when deciding DSC slice
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (23 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 24/46] drm/amd/display: Fix DC mode screen flickering on DCN321 Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 26/46] drm/amd/display: Re-enable IPS2 for static screen Wayne Lin
` (21 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Wenjing Liu, Chaitanya Dhere
From: Wenjing Liu <wenjing.liu@amd.com>
[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.
Reviewed-by: Chaitanya Dhere <chaitanya.dhere@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
---
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 30 ++++++++++++++++-----
1 file changed, 23 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
index 7c2d74f4efd8..db795b1a94f0 100644
--- a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
+++ b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
@@ -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;
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 26/46] drm/amd/display: Re-enable IPS2 for static screen
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (24 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 25/46] drm/amd/display: take ODM slice count into account when deciding DSC slice Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 27/46] drm/amd/display: Add trigger FIFO resync path for DCN35 Wayne Lin
` (20 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Nicholas Kazlauskas
From: Roman Li <roman.li@amd.com>
[Why]
IPS stability was fixed in bios.
[How]
Set disable_ips init flag to DMUB_IPS_ENABLE.
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Roman Li <roman.li@amd.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 961b5984afa0..3ece11883941 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -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;
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 27/46] drm/amd/display: Add trigger FIFO resync path for DCN35
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (25 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 26/46] drm/amd/display: Re-enable IPS2 for static screen Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 28/46] drm/amd/display: Enable RCO for PHYSYMCLK in DCN35 Wayne Lin
` (19 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Nicholas Kazlauskas, Charlene Liu
From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
[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.
Reviewed-by: Charlene Liu <charlene.liu@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
---
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(+)
diff --git a/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c b/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c
index 4c53e339e325..4b282b7e0996 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c
@@ -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,
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c
index 7ed5de5c5ec1..0e87f3503265 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c
@@ -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,
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 28/46] drm/amd/display: Enable RCO for PHYSYMCLK in DCN35
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (26 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 27/46] drm/amd/display: Add trigger FIFO resync path for DCN35 Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 13:48 ` Li, Roman
2024-04-24 8:49 ` [PATCH 29/46] drm/amd/display: Revert "dc: Keep VBios pixel rate div setting util next mode set" Wayne Lin
` (18 subsequent siblings)
46 siblings, 1 reply; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Daniel Miess, Charlene Liu
From: Daniel Miess <daniel.miess@amd.com>
[Why & How]
Enable root clock optimization for PHYSYMCLK and only
disable it when it's actively being used
Reviewed-by: Charlene Liu <charlene.liu@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Daniel Miess <daniel.miess@amd.com>
---
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(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index 3048d5a0e87d..dd8940c2a4bf 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -724,6 +724,7 @@ enum pg_hw_pipe_resources {
PG_OPTC,
PG_DPSTREAM,
PG_HDMISTREAM,
+ PG_PHYSYMCLK,
PG_HW_PIPE_RESOURCES_NUM_ELEMENT
};
diff --git a/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c b/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c
index 4b282b7e0996..795320a25fd2 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c
@@ -461,32 +461,22 @@ static void dccg35_set_physymclk_root_clock_gating(
case 0:
REG_UPDATE(DCCG_GATE_DISABLE_CNTL2,
PHYASYMCLK_ROOT_GATE_DISABLE, enable ? 1 : 0);
-// 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);
-// 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);
-// 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);
-// 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);
-// REG_UPDATE(DCCG_GATE_DISABLE_CNTL4,
-// PHYE_REFCLK_ROOT_GATE_DISABLE, enable ? 1 : 0);
break;
default:
BREAK_TO_DEBUGGER();
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c
index b94a85380d73..dea7e63a49d9 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c
@@ -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);
+
}
}
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h b/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h
index a731c8880d60..bc05beba5f2c 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h
@@ -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);
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c
index 0e87f3503265..7f2cbfac9099 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c
@@ -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.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn351/dcn351_init.c
index ff772665d1ae..91484b71b7da 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn351/dcn351_init.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn351/dcn351_init.c
@@ -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.h b/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer_private.h
index 939832372baf..7553d6816d36 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer_private.h
+++ b/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer_private.h
@@ -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
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 29/46] drm/amd/display: Revert "dc: Keep VBios pixel rate div setting util next mode set"
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (27 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 28/46] drm/amd/display: Enable RCO for PHYSYMCLK in DCN35 Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 30/46] drm/amd/display: Only program P-State force if pipe config changed Wayne Lin
` (17 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Webb Chen, Charlene Liu
From: Webb Chen <yi-lchen@amd.com>
This reverts commit f7131558f362 ("drm/amd/display: Keep VBios pixel rate div
setting util next mode set") which causes issue.
Reviewed-by: Charlene Liu <charlene.liu@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Webb Chen <yi-lchen@amd.com>
---
.../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(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index 25c64fdcfa44..263e21756481 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -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;
diff --git a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c
index 8f6edd8e9beb..17a1174b8d80 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c
@@ -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
diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c
index 21a6ca5ca192..56385cede113 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c
@@ -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,
};
diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dio_stream_encoder.c b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dio_stream_encoder.c
index 1a9bb614c41e..2fef1419ae91 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dio_stream_encoder.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dio_stream_encoder.c
@@ -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;
diff --git a/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c b/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c
index 795320a25fd2..02ec16bf381f 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c
@@ -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,
diff --git a/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dio_stream_encoder.c b/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dio_stream_encoder.c
index 2595cbef5942..62a8f0b56006 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dio_stream_encoder.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dio_stream_encoder.c
@@ -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;
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
index 43200f8b1c3c..5920d1825a4c 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
@@ -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;
}
}
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c
index e5f864ca5204..26b19de687cc 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c
@@ -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);
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.c
index 5bfe08a7fef0..093f4387553c 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.c
@@ -332,29 +332,6 @@ unsigned int dcn314_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsig
return 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;
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.h b/drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.h
index fb94e327d4ee..eafcc4ea6d24 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.h
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.h
@@ -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);
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_init.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_init.c
index f9120b1c1c1f..29b56736fa84 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_init.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_init.c
@@ -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,
};
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c
index 7222055fa854..9f1a86ddadb5 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c
@@ -1159,14 +1159,15 @@ unsigned int dcn32_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsign
void dcn32_set_pixels_per_cycle(struct pipe_ctx *pipe_ctx)
{
- uint32_t pix_per_cycle = pipe_ctx->pixel_per_cycle;
+ uint32_t pix_per_cycle = 1;
uint32_t odm_combine_factor = 1;
if (!pipe_ctx || !pipe_ctx->stream || !pipe_ctx->stream_res.stream_enc)
return;
odm_combine_factor = get_odm_config(pipe_ctx, NULL);
- if (optc2_is_two_pixels_per_containter(&pipe_ctx->stream->timing) || odm_combine_factor > 1)
+ if (optc2_is_two_pixels_per_containter(&pipe_ctx->stream->timing) || odm_combine_factor > 1
+ || dcn32_is_dp_dig_pixel_rate_div_policy(pipe_ctx))
pix_per_cycle = 2;
if (pipe_ctx->stream_res.stream_enc->funcs->set_input_mode)
@@ -1212,8 +1213,8 @@ void dcn32_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;
+ uint32_t pix_per_cycle = 1;
- params.pix_per_cycle = pipe_ctx->pixel_per_cycle;
params.opp_cnt = 1;
for (odm_pipe = pipe_ctx->next_odm_pipe; odm_pipe; odm_pipe = odm_pipe->next_odm_pipe)
params.opp_cnt++;
@@ -1229,14 +1230,13 @@ 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)
- params.pix_per_cycle = 2;
-
- if (params.pix_per_cycle == 2)
+ if (optc2_is_two_pixels_per_containter(&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;
+ }
pipe_ctx->stream_res.stream_enc->funcs->dp_set_odm_combine(
- pipe_ctx->stream_res.stream_enc, params.pix_per_cycle > 1);
+ pipe_ctx->stream_res.stream_enc, pix_per_cycle > 1);
pipe_ctx->stream_res.stream_enc->funcs->dp_unblank(link, pipe_ctx->stream_res.stream_enc, ¶ms);
}
@@ -1257,32 +1257,6 @@ bool dcn32_is_dp_dig_pixel_rate_div_policy(struct pipe_ctx *pipe_ctx)
return false;
}
-void dcn32_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 (dcn32_is_dp_dig_pixel_rate_div_policy(pipe_ctx))
- pipe_ctx->pixel_per_cycle = 2;
-
- 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;
- }
-}
-
static void apply_symclk_on_tx_off_wa(struct dc_link *link)
{
/* There are use cases where SYMCLK is referenced by OTG. For instance
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.h b/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.h
index d6345a2408be..f55c11fc56ec 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.h
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.h
@@ -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);
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_init.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_init.c
index 033dca8b9a47..b1f79ca7d77a 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_init.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_init.c
@@ -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,
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c
index 7f2cbfac9099..8e5b87798192 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c
@@ -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,
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn351/dcn351_init.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn351/dcn351_init.c
index 91484b71b7da..701b66634e2d 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn351/dcn351_init.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn351/dcn351_init.c
@@ -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,
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer_private.h b/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer_private.h
index 7553d6816d36..7bfb4fb50dad 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer_private.h
+++ b/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer_private.h
@@ -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);
diff --git a/drivers/gpu/drm/amd/display/dc/inc/core_types.h b/drivers/gpu/drm/amd/display/dc/inc/core_types.h
index 634d52fe111e..286f3219b77e 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/core_types.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/core_types.h
@@ -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.
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h b/drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h
index d6248a73c7c1..d4c7885fc916 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h
@@ -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,
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/stream_encoder.h b/drivers/gpu/drm/amd/display/dc/inc/hw/stream_encoder.h
index 60228f5de4d7..75b9ec21f297 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/stream_encoder.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/stream_encoder.h
@@ -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 {
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 30/46] drm/amd/display: Only program P-State force if pipe config changed
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (28 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 29/46] drm/amd/display: Revert "dc: Keep VBios pixel rate div setting util next mode set" Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 31/46] drm/amd/display: Remove redundant include file Wayne Lin
` (16 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Alvin Lee, Samson Tam
From: Alvin Lee <alvin.lee2@amd.com>
[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.
Reviewed-by: Samson Tam <samson.tam@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Alvin Lee <alvin.lee2@amd.com>
---
.../amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c
index 9f1a86ddadb5..272c4cdfbfe3 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c
@@ -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)
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 31/46] drm/amd/display: Remove redundant include file
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (29 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 30/46] drm/amd/display: Only program P-State force if pipe config changed Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 32/46] drm/amd/display: Refactor HUBBUB into component folder Wayne Lin
` (15 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Alex Hung
From: Alex Hung <alex.hung@amd.com>
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
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
---
drivers/gpu/drm/amd/display/include/dal_types.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/include/dal_types.h b/drivers/gpu/drm/amd/display/include/dal_types.h
index e9591d4aded5..654387cf057f 100644
--- a/drivers/gpu/drm/amd/display/include/dal_types.h
+++ b/drivers/gpu/drm/amd/display/include/dal_types.h
@@ -27,7 +27,6 @@
#define __DAL_TYPES_H__
#include "signal_types.h"
-#include "dc_types.h"
struct dal_logger;
struct dc_bios;
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 32/46] drm/amd/display: Refactor HUBBUB into component folder
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (30 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 31/46] drm/amd/display: Remove redundant include file Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 33/46] drm/amd/display: Assign linear_pitch_alignment even for VM Wayne Lin
` (14 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Revalla Hari Krishna, Martin Leung
From: Revalla Hari Krishna <harikrishna.revalla@amd.com>
[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.
Reviewed-by: Martin Leung <martin.leung@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Revalla Hari Krishna <harikrishna.revalla@amd.com>
---
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%)
diff --git a/drivers/gpu/drm/amd/display/Makefile b/drivers/gpu/drm/amd/display/Makefile
index 9a5bcafbf730..839e71aa7d0c 100644
--- a/drivers/gpu/drm/amd/display/Makefile
+++ b/drivers/gpu/drm/amd/display/Makefile
@@ -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
diff --git a/drivers/gpu/drm/amd/display/dc/Makefile b/drivers/gpu/drm/amd/display/dc/Makefile
index 8d963befc756..f1b0b1f66fb0 100644
--- a/drivers/gpu/drm/amd/display/dc/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/Makefile
@@ -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
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/Makefile b/drivers/gpu/drm/amd/display/dc/dcn10/Makefile
index 8dc7938c36d8..508306baa65a 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/Makefile
@@ -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))
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer_debug.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer_debug.c
index c51b717e5622..3adef474ed26 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer_debug.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer_debug.c
@@ -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"
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/Makefile b/drivers/gpu/drm/amd/display/dc/dcn20/Makefile
index 9b6070c99794..6e5b7fcf8dbd 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/Makefile
@@ -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
diff --git a/drivers/gpu/drm/amd/display/dc/dcn201/Makefile b/drivers/gpu/drm/amd/display/dc/dcn201/Makefile
index 3880db59e457..c5716ea5886a 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn201/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dcn201/Makefile
@@ -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))
diff --git a/drivers/gpu/drm/amd/display/dc/dcn21/Makefile b/drivers/gpu/drm/amd/display/dc/dcn21/Makefile
index ca92f5c8e7fb..b0803403fe23 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn21/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dcn21/Makefile
@@ -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))
diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/Makefile b/drivers/gpu/drm/amd/display/dc/dcn30/Makefile
index c6ca70f3c061..435979febb79 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn30/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dcn30/Makefile
@@ -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 \
diff --git a/drivers/gpu/drm/amd/display/dc/dcn301/Makefile b/drivers/gpu/drm/amd/display/dc/dcn301/Makefile
index d241f665e40a..bfda72fa4f42 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn301/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dcn301/Makefile
@@ -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))
diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/Makefile b/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
index 5d93ac16c03a..9608c1f418ab 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
@@ -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
diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/Makefile b/drivers/gpu/drm/amd/display/dc/dcn32/Makefile
index a58c37165f5a..8a6bc529f376 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn32/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/Makefile
@@ -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
diff --git a/drivers/gpu/drm/amd/display/dc/dcn35/Makefile b/drivers/gpu/drm/amd/display/dc/dcn35/Makefile
index d5b4533d2f62..09fd994ae158 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn35/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dcn35/Makefile
@@ -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))
diff --git a/drivers/gpu/drm/amd/display/dc/hubbub/Makefile b/drivers/gpu/drm/amd/display/dc/hubbub/Makefile
new file mode 100644
index 000000000000..ab2fddc4a858
--- /dev/null
+++ b/drivers/gpu/drm/amd/display/dc/hubbub/Makefile
@@ -0,0 +1,100 @@
+
+# Copyright 2022 Advanced Micro Devices, Inc.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+# THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+#
+# Makefile for the 'hubbub' sub-component of DAL.
+#
+ifdef CONFIG_DRM_AMD_DC_FP
+###############################################################################
+# DCN
+###############################################################################
+
+HUBBUB_DCN10 = dcn10_hubbub.o
+
+AMD_DAL_HUBBUB_DCN10 = $(addprefix $(AMDDALPATH)/dc/hubbub/dcn10/,$(HUBBUB_DCN10))
+
+AMD_DISPLAY_FILES += $(AMD_DAL_HUBBUB_DCN10)
+
+###############################################################################
+
+HUBBUB_DCN20 = dcn20_hubbub.o
+
+AMD_DAL_HUBBUB_DCN20 = $(addprefix $(AMDDALPATH)/dc/hubbub/dcn20/,$(HUBBUB_DCN20))
+
+AMD_DISPLAY_FILES += $(AMD_DAL_HUBBUB_DCN20)
+
+###############################################################################
+
+HUBBUB_DCN201 = dcn201_hubbub.o
+
+AMD_DAL_HUBBUB_DCN201 = $(addprefix $(AMDDALPATH)/dc/hubbub/dcn201/,$(HUBBUB_DCN201))
+
+AMD_DISPLAY_FILES += $(AMD_DAL_HUBBUB_DCN201)
+
+###############################################################################
+
+HUBBUB_DCN21 = dcn21_hubbub.o
+
+AMD_DAL_HUBBUB_DCN21 = $(addprefix $(AMDDALPATH)/dc/hubbub/dcn21/,$(HUBBUB_DCN21))
+
+AMD_DISPLAY_FILES += $(AMD_DAL_HUBBUB_DCN21)
+
+###############################################################################
+HUBBUB_DCN30 = dcn30_hubbub.o
+
+AMD_DAL_HUBBUB_DCN30 = $(addprefix $(AMDDALPATH)/dc/hubbub/dcn30/,$(HUBBUB_DCN30))
+
+AMD_DISPLAY_FILES += $(AMD_DAL_HUBBUB_DCN30)
+
+###############################################################################
+HUBBUB_DCN301 = dcn301_hubbub.o
+
+AMD_DAL_HUBBUB_DCN301 = $(addprefix $(AMDDALPATH)/dc/hubbub/dcn301/,$(HUBBUB_DCN301))
+
+AMD_DISPLAY_FILES += $(AMD_DAL_HUBBUB_DCN301)
+
+###############################################################################
+
+HUBBUB_DCN31 = dcn31_hubbub.o
+
+AMD_DAL_HUBBUB_DCN31 = $(addprefix $(AMDDALPATH)/dc/hubbub/dcn31/,$(HUBBUB_DCN31))
+
+AMD_DISPLAY_FILES += $(AMD_DAL_HUBBUB_DCN31)
+
+###############################################################################
+HUBBUB_DCN32 = dcn32_hubbub.o
+
+AMD_DAL_HUBBUB_DCN32 = $(addprefix $(AMDDALPATH)/dc/hubbub/dcn32/,$(HUBBUB_DCN32))
+
+AMD_DISPLAY_FILES += $(AMD_DAL_HUBBUB_DCN32)
+
+###############################################################################
+
+HUBBUB_DCN35 = dcn35_hubbub.o
+
+AMD_DAL_HUBBUB_DCN35 = $(addprefix $(AMDDALPATH)/dc/hubbub/dcn35/,$(HUBBUB_DCN35))
+
+AMD_DISPLAY_FILES += $(AMD_DAL_HUBBUB_DCN35)
+
+###############################################################################
+
+
+###############################################################################
+endif
\ No newline at end of file
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c b/drivers/gpu/drm/amd/display/dc/hubbub/dcn10/dcn10_hubbub.c
similarity index 99%
rename from drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c
rename to drivers/gpu/drm/amd/display/dc/hubbub/dcn10/dcn10_hubbub.c
index 6dd355a03033..d738a36f2132 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c
+++ b/drivers/gpu/drm/amd/display/dc/hubbub/dcn10/dcn10_hubbub.c
@@ -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"
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.h b/drivers/gpu/drm/amd/display/dc/hubbub/dcn10/dcn10_hubbub.h
similarity index 100%
rename from drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.h
rename to drivers/gpu/drm/amd/display/dc/hubbub/dcn10/dcn10_hubbub.h
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubbub.c b/drivers/gpu/drm/amd/display/dc/hubbub/dcn20/dcn20_hubbub.c
similarity index 100%
rename from drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubbub.c
rename to drivers/gpu/drm/amd/display/dc/hubbub/dcn20/dcn20_hubbub.c
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubbub.h b/drivers/gpu/drm/amd/display/dc/hubbub/dcn20/dcn20_hubbub.h
similarity index 99%
rename from drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubbub.h
rename to drivers/gpu/drm/amd/display/dc/hubbub/dcn20/dcn20_hubbub.h
index 24a9c45988ed..036bb3e6c957 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubbub.h
+++ b/drivers/gpu/drm/amd/display/dc/hubbub/dcn20/dcn20_hubbub.h
@@ -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)
diff --git a/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hubbub.c b/drivers/gpu/drm/amd/display/dc/hubbub/dcn201/dcn201_hubbub.c
similarity index 100%
rename from drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hubbub.c
rename to drivers/gpu/drm/amd/display/dc/hubbub/dcn201/dcn201_hubbub.c
diff --git a/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hubbub.h b/drivers/gpu/drm/amd/display/dc/hubbub/dcn201/dcn201_hubbub.h
similarity index 100%
rename from drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hubbub.h
rename to drivers/gpu/drm/amd/display/dc/hubbub/dcn201/dcn201_hubbub.h
diff --git a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubbub.c b/drivers/gpu/drm/amd/display/dc/hubbub/dcn21/dcn21_hubbub.c
similarity index 100%
rename from drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubbub.c
rename to drivers/gpu/drm/amd/display/dc/hubbub/dcn21/dcn21_hubbub.c
diff --git a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubbub.h b/drivers/gpu/drm/amd/display/dc/hubbub/dcn21/dcn21_hubbub.h
similarity index 100%
rename from drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubbub.h
rename to drivers/gpu/drm/amd/display/dc/hubbub/dcn21/dcn21_hubbub.h
diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubbub.c b/drivers/gpu/drm/amd/display/dc/hubbub/dcn30/dcn30_hubbub.c
similarity index 100%
rename from drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubbub.c
rename to drivers/gpu/drm/amd/display/dc/hubbub/dcn30/dcn30_hubbub.c
diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubbub.h b/drivers/gpu/drm/amd/display/dc/hubbub/dcn30/dcn30_hubbub.h
similarity index 100%
rename from drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubbub.h
rename to drivers/gpu/drm/amd/display/dc/hubbub/dcn30/dcn30_hubbub.h
diff --git a/drivers/gpu/drm/amd/display/dc/dcn301/dcn301_hubbub.c b/drivers/gpu/drm/amd/display/dc/hubbub/dcn301/dcn301_hubbub.c
similarity index 100%
rename from drivers/gpu/drm/amd/display/dc/dcn301/dcn301_hubbub.c
rename to drivers/gpu/drm/amd/display/dc/hubbub/dcn301/dcn301_hubbub.c
diff --git a/drivers/gpu/drm/amd/display/dc/dcn301/dcn301_hubbub.h b/drivers/gpu/drm/amd/display/dc/hubbub/dcn301/dcn301_hubbub.h
similarity index 100%
rename from drivers/gpu/drm/amd/display/dc/dcn301/dcn301_hubbub.h
rename to drivers/gpu/drm/amd/display/dc/hubbub/dcn301/dcn301_hubbub.h
diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.c b/drivers/gpu/drm/amd/display/dc/hubbub/dcn31/dcn31_hubbub.c
similarity index 100%
rename from drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.c
rename to drivers/gpu/drm/amd/display/dc/hubbub/dcn31/dcn31_hubbub.c
diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.h b/drivers/gpu/drm/amd/display/dc/hubbub/dcn31/dcn31_hubbub.h
similarity index 100%
rename from drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.h
rename to drivers/gpu/drm/amd/display/dc/hubbub/dcn31/dcn31_hubbub.h
diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubbub.c b/drivers/gpu/drm/amd/display/dc/hubbub/dcn32/dcn32_hubbub.c
similarity index 100%
rename from drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubbub.c
rename to drivers/gpu/drm/amd/display/dc/hubbub/dcn32/dcn32_hubbub.c
diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubbub.h b/drivers/gpu/drm/amd/display/dc/hubbub/dcn32/dcn32_hubbub.h
similarity index 100%
rename from drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubbub.h
rename to drivers/gpu/drm/amd/display/dc/hubbub/dcn32/dcn32_hubbub.h
diff --git a/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_hubbub.c b/drivers/gpu/drm/amd/display/dc/hubbub/dcn35/dcn35_hubbub.c
similarity index 100%
rename from drivers/gpu/drm/amd/display/dc/dcn35/dcn35_hubbub.c
rename to drivers/gpu/drm/amd/display/dc/hubbub/dcn35/dcn35_hubbub.c
diff --git a/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_hubbub.h b/drivers/gpu/drm/amd/display/dc/hubbub/dcn35/dcn35_hubbub.h
similarity index 100%
rename from drivers/gpu/drm/amd/display/dc/dcn35/dcn35_hubbub.h
rename to drivers/gpu/drm/amd/display/dc/hubbub/dcn35/dcn35_hubbub.h
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 33/46] drm/amd/display: Assign linear_pitch_alignment even for VM
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (31 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 32/46] drm/amd/display: Refactor HUBBUB into component folder Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 34/46] drm/amd/display: gpuvm handling in DML21 Wayne Lin
` (13 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Alvin Lee, Sohaib Nadeem
From: Alvin Lee <alvin.lee2@amd.com>
[Description]
Assign linear_pitch_alignment so we don't cause a divide by 0
error in VM environments
Reviewed-by: Sohaib Nadeem <sohaib.nadeem@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Alvin Lee <alvin.lee2@amd.com>
---
drivers/gpu/drm/amd/display/dc/core/dc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index e955c97697ff..71f211bb4ed8 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -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 {
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 34/46] drm/amd/display: gpuvm handling in DML21
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (32 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 33/46] drm/amd/display: Assign linear_pitch_alignment even for VM Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 35/46] drm/amd/display: For FPO + Vactive check that all pipes support VA Wayne Lin
` (12 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Nevenko Stupar, Chaitanya Dhere
From: Nevenko Stupar <nevenko.stupar@amd.com>
[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.
Reviewed-by: Chaitanya Dhere <chaitanya.dhere@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Nevenko Stupar <nevenko.stupar@amd.com>
---
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(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_vm_helper.c b/drivers/gpu/drm/amd/display/dc/core/dc_vm_helper.c
index eda2152dcd1f..d1e68dc57a2a 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_vm_helper.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_vm_helper.c
@@ -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);
}
diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c b/drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c
index b3602f897872..63f9bda3b130 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c
@@ -943,7 +943,7 @@ bool dml21_map_dc_state_into_dml_display_cfg(const struct dc *in_dc, struct dc_s
memset(&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;
diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h b/drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h
index 97e013ce5516..4e4ed1678d91 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h
+++ b/drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h
@@ -232,6 +232,7 @@ struct dml2_configuration_options {
bool map_dc_pipes_with_callbacks;
bool use_clock_dc_limits;
+ bool gpuvm_enable;
};
/*
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 35/46] drm/amd/display: For FPO + Vactive check that all pipes support VA
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (33 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 34/46] drm/amd/display: gpuvm handling in DML21 Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 36/46] drm/amd/display: Fix uninitialized variables in DM Wayne Lin
` (11 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Alvin Lee, Samson Tam, Chaitanya Dhere
From: Alvin Lee <alvin.lee2@amd.com>
[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.
Reviewed-by: Samson Tam <samson.tam@amd.com>
Reviewed-by: Chaitanya Dhere <chaitanya.dhere@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Alvin Lee <alvin.lee2@amd.com>
---
.../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(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c
index a8c36eda1d09..eba7bfc7e4af 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c
@@ -545,7 +545,7 @@ struct dc_stream_state *dcn32_can_support_mclk_switch_using_fw_based_vblank_stre
if (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;
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c
index 5be976fa44f9..8912475f01e2 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c
@@ -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, uint
if (!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++;
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.h b/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.h
index d25c3f730a59..276e90e4e0ce 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.h
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.h
@@ -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);
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 36/46] drm/amd/display: Fix uninitialized variables in DM
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (34 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 35/46] drm/amd/display: For FPO + Vactive check that all pipes support VA Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 37/46] drm/amd/display: Fix uninitialized variables in DC Wayne Lin
` (10 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Alex Hung
From: Alex Hung <alex.hung@amd.com>
This fixes 11 UNINIT issues reported by Coverity.
Reviewed-by: Hersen Wu <hersenxs.wu@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
---
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(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 3ece11883941..29b5c953a656 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -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);
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
index c7715a17f388..4d7a5d470b1e 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
@@ -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);
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 37/46] drm/amd/display: Fix uninitialized variables in DC
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (35 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 36/46] drm/amd/display: Fix uninitialized variables in DM Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 38/46] drm/amd/display: Fix FEC_READY write on DP LT Wayne Lin
` (9 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Alex Hung
From: Alex Hung <alex.hung@amd.com>
This fixes 49 UNINIT issues reported by Coverity.
Reviewed-by: Hersen Wu <hersenxs.wu@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
---
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(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 71f211bb4ed8..a8eb286ee4ff 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -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};
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index 263e21756481..ebbeb37f36a6 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -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,
diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_mpc.c b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_mpc.c
index ebf6e9458be8..3aeb85ec40b0 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_mpc.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_mpc.c
@@ -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);
diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c b/drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c
index a2ced0bc772c..507cff525f97 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c
@@ -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);
diff --git a/drivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp_cm.c b/drivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp_cm.c
index 2d5d64276cb0..f2a2d53e9689 100644
--- a/drivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp_cm.c
+++ b/drivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp_cm.c
@@ -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);
diff --git a/drivers/gpu/drm/amd/display/dc/dpp/dcn20/dcn20_dpp_cm.c b/drivers/gpu/drm/amd/display/dc/dpp/dcn20/dcn20_dpp_cm.c
index f43fa29971f2..31613372e214 100644
--- a/drivers/gpu/drm/amd/display/dc/dpp/dcn20/dcn20_dpp_cm.c
+++ b/drivers/gpu/drm/amd/display/dc/dpp/dcn20/dcn20_dpp_cm.c
@@ -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);
diff --git a/drivers/gpu/drm/amd/display/dc/dpp/dcn30/dcn30_dpp_cm.c b/drivers/gpu/drm/amd/display/dc/dpp/dcn30/dcn30_dpp_cm.c
index ce1b3cf7e1bb..82eca0e7b7d0 100644
--- a/drivers/gpu/drm/amd/display/dc/dpp/dcn30/dcn30_dpp_cm.c
+++ b/drivers/gpu/drm/amd/display/dc/dpp/dcn30/dcn30_dpp_cm.c
@@ -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);
diff --git a/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c b/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c
index 3ede6e02c3a7..663c17f52779 100644
--- a/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c
+++ b/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c
@@ -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);
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
index 5920d1825a4c..0d3ea291eeee 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
@@ -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);
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c
index 469f4a52f4f5..b3984e8cab64 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c
@@ -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);
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn201/dcn201_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn201/dcn201_hwseq.c
index 7f7b6bf76a8d..59f46df01551 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn201/dcn201_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn201/dcn201_hwseq.c
@@ -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;
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.c
index 7252f5f781f0..804be977ea47 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.c
@@ -66,7 +66,7 @@ static void mmhub_update_page_table_config(struct dcn_hubbub_phys_addr_config *c
int 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;
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.c
index 9ab475a87545..1c8abb417b6e 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.c
@@ -479,7 +479,7 @@ void dcn31_hubp_pg_control(struct dce_hwseq *hws, unsigned int hubp_inst, bool p
int 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;
diff --git a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
index e490dddd0424..16549068d836 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
@@ -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.
diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c
index 289f5d133342..a01d0842bf8e 100644
--- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c
+++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c
@@ -992,7 +992,7 @@ enum dp_link_encoding mst_decide_link_encoding_format(const struct dc_link *link
static 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;
diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_irq_handler.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_irq_handler.c
index 7dc7c25ac398..659b8064d361 100644
--- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_irq_handler.c
+++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_irq_handler.c
@@ -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,
diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c
index 689c5fb44e86..ad9aca790dd7 100644
--- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c
+++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c
@@ -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};
diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_hpd.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_hpd.c
index e3d729ab5b9f..caa617883f62 100644
--- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_hpd.c
+++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_hpd.c
@@ -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);
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 38/46] drm/amd/display: Fix FEC_READY write on DP LT
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (36 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 37/46] drm/amd/display: Fix uninitialized variables in DC Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 39/46] drm/amd/display: use even ODM slice width for two pixels per container Wayne Lin
` (8 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Ilya Bakoulin, Mario Limonciello,
Alex Deucher, stable, Wenjing Liu
From: Ilya Bakoulin <ilya.bakoulin@amd.com>
[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.
Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Reviewed-by: Wenjing Liu <wenjing.liu@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Ilya Bakoulin <ilya.bakoulin@amd.com>
---
.../amd/display/dc/link/protocols/link_dp_phy.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_phy.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_phy.c
index 5cbf5f93e584..bafa52a0165a 100644
--- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_phy.c
+++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_phy.c
@@ -151,16 +151,14 @@ enum dc_status dp_set_fec_ready(struct dc_link *link, const struct link_resource
return 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) {
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 39/46] drm/amd/display: use even ODM slice width for two pixels per container
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (37 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 38/46] drm/amd/display: Fix FEC_READY write on DP LT Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 40/46] drm/amd/display: Enable Replay for DCN315 Wayne Lin
` (7 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Wenjing Liu, Dillon Varone
From: Wenjing Liu <wenjing.liu@amd.com>
[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.
Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
---
.../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(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index ebbeb37f36a6..8dcd7eac4b2b 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -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++) {
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator.c
index 6424e7f279dc..49bcfe6ec999 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator.c
@@ -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(
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator.h b/drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator.h
index d8a5ed7b485d..28c58f1dff2d 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator.h
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator.h
@@ -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__ */
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator_v.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator_v.c
index c509384fff54..bf35dc65ca29 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator_v.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator_v.c
@@ -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(
diff --git a/drivers/gpu/drm/amd/display/dc/dce120/dce120_timing_generator.c b/drivers/gpu/drm/amd/display/dc/dce120/dce120_timing_generator.c
index 4af0c70098c4..eb3557965781 100644
--- a/drivers/gpu/drm/amd/display/dc/dce120/dce120_timing_generator.c
+++ b/drivers/gpu/drm/amd/display/dc/dce120/dce120_timing_generator.c
@@ -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,
};
diff --git a/drivers/gpu/drm/amd/display/dc/dce80/dce80_timing_generator.c b/drivers/gpu/drm/amd/display/dc/dce80/dce80_timing_generator.c
index b8fd43dc010b..2df4654858be 100644
--- a/drivers/gpu/drm/amd/display/dc/dce80/dce80_timing_generator.c
+++ b/drivers/gpu/drm/amd/display/dc/dce80/dce80_timing_generator.c
@@ -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(
diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c b/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c
index 90bb030bb523..f00526d04cb7 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c
@@ -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;
}
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c
index 26b19de687cc..e0cc78e899bd 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c
@@ -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);
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn201/dcn201_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn201/dcn201_hwseq.c
index 59f46df01551..86d871cc74c7 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn201/dcn201_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn201/dcn201_hwseq.c
@@ -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);
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.c
index 093f4387553c..06b70c360ff8 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.c
@@ -302,7 +302,7 @@ unsigned int dcn314_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsig
unsigned 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)
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c
index 272c4cdfbfe3..5bc4d9b2cf79 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c
@@ -1143,7 +1143,7 @@ unsigned int dcn32_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsign
unsigned 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;
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/optc.h b/drivers/gpu/drm/amd/display/dc/inc/hw/optc.h
index 8d32e525f05a..287bf8a90ff6 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/optc.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/optc.h
@@ -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
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h b/drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h
index cd68ecc242c1..a347425c1da2 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h
@@ -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
diff --git a/drivers/gpu/drm/amd/display/dc/optc/dcn10/dcn10_optc.c b/drivers/gpu/drm/amd/display/dc/optc/dcn10/dcn10_optc.c
index 5574bc628053..03140e7372d9 100644
--- a/drivers/gpu/drm/amd/display/dc/optc/dcn10/dcn10_optc.c
+++ b/drivers/gpu/drm/amd/display/dc/optc/dcn10/dcn10_optc.c
@@ -297,7 +297,7 @@ void optc1_program_timing(
* of stereo handled in explicit call
*/
- if (optc1_is_two_pixels_per_containter(&patched_crtc_timing) || optc1->opp_count == 2)
+ if (optc->funcs->is_two_pixels_per_container(&patched_crtc_timing) || optc1->opp_count == 2)
h_div = H_TIMING_DIV_BY2;
if (REG(OPTC_DATA_FORMAT_CONTROL) && optc1->tg_mask->OPTC_DATA_FORMAT != 0) {
@@ -1548,6 +1548,27 @@ bool optc1_get_crc(struct timing_generator *optc,
return true;
}
+/* "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 optc1_is_two_pixels_per_container(const struct dc_crtc_timing *timing)
+{
+ bool two_pix = timing->pixel_encoding == PIXEL_ENCODING_YCBCR420;
+
+ two_pix = two_pix || (timing->flags.DSC && timing->pixel_encoding == PIXEL_ENCODING_YCBCR422
+ && !timing->dsc_cfg.ycbcr422_simple);
+ return two_pix;
+}
+
static const struct timing_generator_funcs dcn10_tg_funcs = {
.validate_timing = optc1_validate_timing,
.program_timing = optc1_program_timing,
@@ -1594,6 +1615,7 @@ static const struct timing_generator_funcs dcn10_tg_funcs = {
.program_manual_trigger = optc1_program_manual_trigger,
.setup_manual_trigger = optc1_setup_manual_trigger,
.get_hw_timing = optc1_get_hw_timing,
+ .is_two_pixels_per_container = optc1_is_two_pixels_per_container,
};
void dcn10_timing_generator_init(struct optc *optc1)
@@ -1609,25 +1631,3 @@ void dcn10_timing_generator_init(struct optc *optc1)
optc1->min_h_sync_width = 4;
optc1->min_v_sync_width = 1;
}
-
-/* "Containter" 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
- * containter 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 optc1_is_two_pixels_per_containter(const struct dc_crtc_timing *timing)
-{
- bool two_pix = timing->pixel_encoding == PIXEL_ENCODING_YCBCR420;
-
- two_pix = two_pix || (timing->flags.DSC && timing->pixel_encoding == PIXEL_ENCODING_YCBCR422
- && !timing->dsc_cfg.ycbcr422_simple);
- return two_pix;
-}
-
diff --git a/drivers/gpu/drm/amd/display/dc/optc/dcn20/dcn20_optc.c b/drivers/gpu/drm/amd/display/dc/optc/dcn20/dcn20_optc.c
index d6f095b4555d..314a0cee08ae 100644
--- a/drivers/gpu/drm/amd/display/dc/optc/dcn20/dcn20_optc.c
+++ b/drivers/gpu/drm/amd/display/dc/optc/dcn20/dcn20_optc.c
@@ -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)
diff --git a/drivers/gpu/drm/amd/display/dc/optc/dcn20/dcn20_optc.h b/drivers/gpu/drm/amd/display/dc/optc/dcn20/dcn20_optc.h
index c2e03ced392e..1f8bc7fce9fc 100644
--- a/drivers/gpu/drm/amd/display/dc/optc/dcn20/dcn20_optc.h
+++ b/drivers/gpu/drm/amd/display/dc/optc/dcn20/dcn20_optc.h
@@ -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__ */
diff --git a/drivers/gpu/drm/amd/display/dc/optc/dcn201/dcn201_optc.c b/drivers/gpu/drm/amd/display/dc/optc/dcn201/dcn201_optc.c
index 70fcbec03fb6..49c2efdfa403 100644
--- a/drivers/gpu/drm/amd/display/dc/optc/dcn201/dcn201_optc.c
+++ b/drivers/gpu/drm/amd/display/dc/optc/dcn201/dcn201_optc.c
@@ -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)
diff --git a/drivers/gpu/drm/amd/display/dc/optc/dcn201/dcn201_optc.h b/drivers/gpu/drm/amd/display/dc/optc/dcn201/dcn201_optc.h
index e9545b73513a..a9b281abfd44 100644
--- a/drivers/gpu/drm/amd/display/dc/optc/dcn201/dcn201_optc.h
+++ b/drivers/gpu/drm/amd/display/dc/optc/dcn201/dcn201_optc.h
@@ -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
diff --git a/drivers/gpu/drm/amd/display/dc/optc/dcn30/dcn30_optc.c b/drivers/gpu/drm/amd/display/dc/optc/dcn30/dcn30_optc.c
index b97bdb868a0e..c805fd2a48a1 100644
--- a/drivers/gpu/drm/amd/display/dc/optc/dcn30/dcn30_optc.c
+++ b/drivers/gpu/drm/amd/display/dc/optc/dcn30/dcn30_optc.c
@@ -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)
diff --git a/drivers/gpu/drm/amd/display/dc/optc/dcn301/dcn301_optc.c b/drivers/gpu/drm/amd/display/dc/optc/dcn301/dcn301_optc.c
index b3cfcb887905..1a22ae89fb55 100644
--- a/drivers/gpu/drm/amd/display/dc/optc/dcn301/dcn301_optc.c
+++ b/drivers/gpu/drm/amd/display/dc/optc/dcn301/dcn301_optc.c
@@ -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)
diff --git a/drivers/gpu/drm/amd/display/dc/optc/dcn31/dcn31_optc.c b/drivers/gpu/drm/amd/display/dc/optc/dcn31/dcn31_optc.c
index 63a677c8ee27..84d2ba31e2ca 100644
--- a/drivers/gpu/drm/amd/display/dc/optc/dcn31/dcn31_optc.c
+++ b/drivers/gpu/drm/amd/display/dc/optc/dcn31/dcn31_optc.c
@@ -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)
diff --git a/drivers/gpu/drm/amd/display/dc/optc/dcn314/dcn314_optc.c b/drivers/gpu/drm/amd/display/dc/optc/dcn314/dcn314_optc.c
index 0086cafb0f7a..9022fb2ffca4 100644
--- a/drivers/gpu/drm/amd/display/dc/optc/dcn314/dcn314_optc.c
+++ b/drivers/gpu/drm/amd/display/dc/optc/dcn314/dcn314_optc.c
@@ -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)
diff --git a/drivers/gpu/drm/amd/display/dc/optc/dcn32/dcn32_optc.c b/drivers/gpu/drm/amd/display/dc/optc/dcn32/dcn32_optc.c
index c4f0e1951427..296d658a2334 100644
--- a/drivers/gpu/drm/amd/display/dc/optc/dcn32/dcn32_optc.c
+++ b/drivers/gpu/drm/amd/display/dc/optc/dcn32/dcn32_optc.c
@@ -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)
diff --git a/drivers/gpu/drm/amd/display/dc/optc/dcn35/dcn35_optc.c b/drivers/gpu/drm/amd/display/dc/optc/dcn35/dcn35_optc.c
index d393be30dff8..cf8da22492dc 100644
--- a/drivers/gpu/drm/amd/display/dc/optc/dcn35/dcn35_optc.c
+++ b/drivers/gpu/drm/amd/display/dc/optc/dcn35/dcn35_optc.c
@@ -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)
diff --git a/drivers/gpu/drm/amd/display/dc/optc/dcn401/dcn401_optc.c b/drivers/gpu/drm/amd/display/dc/optc/dcn401/dcn401_optc.c
index 3c7b0624acea..a974382be6c5 100644
--- a/drivers/gpu/drm/amd/display/dc/optc/dcn401/dcn401_optc.c
+++ b/drivers/gpu/drm/amd/display/dc/optc/dcn401/dcn401_optc.c
@@ -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)
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c
index fd5fdb7f4eea..cf0929b8bec0 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c
@@ -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))
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 40/46] drm/amd/display: Enable Replay for DCN315
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (38 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 39/46] drm/amd/display: use even ODM slice width for two pixels per container Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 41/46] drm/amd/display: Notify idle link detection through shared state Wayne Lin
` (6 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Joan Lee, Robin Chen
From: Joan Lee <joan.lee@amd.com>
[why & how]
Enable Replay for DCN315.
Reviewed-by: Robin Chen <robin.chen@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Joan Lee <joan.lee@amd.com>
---
.../amd/display/dc/resource/dcn315/dcn315_resource.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c
index 4ce0f4bf1d9b..ad40a657e173 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c
@@ -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,
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 41/46] drm/amd/display: Notify idle link detection through shared state
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (39 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 40/46] drm/amd/display: Enable Replay for DCN315 Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 42/46] drm/amd/display: Add periodic detection for IPS Wayne Lin
` (5 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Nicholas Kazlauskas, Duncan Ma
From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
[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.
Reviewed-by: Duncan Ma <duncan.ma@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
---
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(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
index 33d3307f5c1c..364ef9ae32f1 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
+++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
@@ -1460,6 +1460,36 @@ void dc_dmub_srv_set_power_state(struct dc_dmub_srv *dc_dmub_srv, enum dc_acpi_c
dmub_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;
diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h
index 3297c5b33265..580940222777 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h
@@ -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.
*
diff --git a/drivers/gpu/drm/amd/display/dmub/dmub_srv.h b/drivers/gpu/drm/amd/display/dmub/dmub_srv.h
index cec8aa1face5..cd51c91a822b 100644
--- a/drivers/gpu/drm/amd/display/dmub/dmub_srv.h
+++ b/drivers/gpu/drm/amd/display/dmub/dmub_srv.h
@@ -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;
diff --git a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
index 7a0574e6c129..35096aa3d85b 100644
--- a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
+++ b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
@@ -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;
};
diff --git a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
index 9bb4c51b1f5b..db16066bc893 100644
--- a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
+++ b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
@@ -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;
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 42/46] drm/amd/display: Add periodic detection for IPS
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (40 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 41/46] drm/amd/display: Notify idle link detection through shared state Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 43/46] drm/amd/display: Change ASSR disable sequence Wayne Lin
` (4 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Hamza Mahfooz
From: Roman Li <roman.li@amd.com>
[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.
Reviewed-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Roman Li <roman.li@amd.com>
---
.../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(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 29b5c953a656..eb946f1ad4d5 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -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)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
index 09519b7abf67..79469cdc3b10 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
@@ -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__ */
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
index e23a0a276e33..83ea0afddda7 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
@@ -35,6 +35,9 @@
#include "amdgpu_dm_trace.h"
#include "amdgpu_dm_debugfs.h"
+#define HPD_DETECTION_PERIOD_uS 5000000
+#define HPD_DETECTION_TIME_uS 1000
+
void amdgpu_dm_crtc_handle_vblank(struct amdgpu_crtc *acrtc)
{
struct drm_crtc *crtc = &acrtc->base;
@@ -146,11 +149,65 @@ static void amdgpu_dm_crtc_set_panel_sr_feature(
struct amdgpu_dm_connector *aconn =
(struct amdgpu_dm_connector *) vblank_work->stream->dm_stream_context;
- if (!aconn->disallow_edp_enter_psr)
+ if (!aconn->disallow_edp_enter_psr) {
+ struct amdgpu_display_manager *dm = vblank_work->dm;
+
amdgpu_dm_psr_enable(vblank_work->stream);
+ if (dm->idle_workqueue &&
+ dm->dc->idle_optimizations_allowed &&
+ dm->idle_workqueue->enable &&
+ !dm->idle_workqueue->running)
+ schedule_work(&dm->idle_workqueue->work);
+ }
}
}
+static void amdgpu_dm_idle_worker(struct work_struct *work)
+{
+ struct idle_workqueue *idle_work;
+
+ idle_work = container_of(work, struct idle_workqueue, work);
+ idle_work->dm->idle_workqueue->running = true;
+ fsleep(HPD_DETECTION_PERIOD_uS);
+ mutex_lock(&idle_work->dm->dc_lock);
+ while (idle_work->enable) {
+ if (!idle_work->dm->dc->idle_optimizations_allowed)
+ break;
+
+ dc_allow_idle_optimizations(idle_work->dm->dc, false);
+
+ mutex_unlock(&idle_work->dm->dc_lock);
+ fsleep(HPD_DETECTION_TIME_uS);
+ mutex_lock(&idle_work->dm->dc_lock);
+
+ if (!amdgpu_dm_psr_is_active_allowed(idle_work->dm))
+ break;
+
+ dc_allow_idle_optimizations(idle_work->dm->dc, true);
+ mutex_unlock(&idle_work->dm->dc_lock);
+ fsleep(HPD_DETECTION_PERIOD_uS);
+ mutex_lock(&idle_work->dm->dc_lock);
+ }
+ mutex_unlock(&idle_work->dm->dc_lock);
+ idle_work->dm->idle_workqueue->running = false;
+}
+
+struct idle_workqueue *idle_create_workqueue(struct amdgpu_device *adev)
+{
+ struct idle_workqueue *idle_work;
+
+ idle_work = kzalloc(sizeof(*idle_work), GFP_KERNEL);
+ if (ZERO_OR_NULL_PTR(idle_work))
+ return NULL;
+
+ idle_work->dm = &adev->dm;
+ idle_work->enable = false;
+ idle_work->running = false;
+ INIT_WORK(&idle_work->work, amdgpu_dm_idle_worker);
+
+ return idle_work;
+}
+
static void amdgpu_dm_crtc_vblank_control_worker(struct work_struct *work)
{
struct vblank_control_work *vblank_work =
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
index c27063305a13..7a510fe66908 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
@@ -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(
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c
index bfa090432ce2..633ab1c16dc6 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c
@@ -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;
+}
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.h
index 1fdfd183c0d9..cd2d45c2b5ef 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.h
@@ -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_ */
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 43/46] drm/amd/display: Change ASSR disable sequence
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (41 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 42/46] drm/amd/display: Add periodic detection for IPS Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 44/46] drm/amd/display: Fix uninitialized variables in DC Wayne Lin
` (3 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Swapnil Patel, Mario Limonciello,
Alex Deucher, stable, Wenjing Liu
From: Swapnil Patel <swapnil.patel@amd.com>
[Why]
Currently disabling ASSR before stream is disabled causes visible
display corruption.
[How]
Move disable ASSR command to after stream has been disabled.
Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Reviewed-by: Wenjing Liu <wenjing.liu@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Swapnil Patel <swapnil.patel@amd.com>
---
drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
index 16549068d836..8402ca0695cc 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
@@ -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))
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 44/46] drm/amd/display: Fix uninitialized variables in DC
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (42 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 43/46] drm/amd/display: Change ASSR disable sequence Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 45/46] drm/amd/display: Disable seamless boot on 128b/132b encoding Wayne Lin
` (2 subsequent siblings)
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Alex Hung
From: Alex Hung <alex.hung@amd.com>
This fixes 29 UNINIT issues reported by Coverity.
Reviewed-by: Hersen Wu <hersenxs.wu@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
---
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(-)
diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table.c b/drivers/gpu/drm/amd/display/dc/bios/command_table.c
index 86f9198e7501..2bcae0643e61 100644
--- a/drivers/gpu/drm/amd/display/dc/bios/command_table.c
+++ b/drivers/gpu/drm/amd/display/dc/bios/command_table.c
@@ -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)
diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table2.c b/drivers/gpu/drm/amd/display/dc/bios/command_table2.c
index cbae1be7b009..cc000833d300 100644
--- a/drivers/gpu/drm/amd/display/dc/bios/command_table2.c
+++ b/drivers/gpu/drm/amd/display/dc/bios/command_table2.c
@@ -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);
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
index 25d46c69464f..74da9ebda016 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
@@ -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();
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn30/dcn30_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn30/dcn30_fpu.c
index ccb4ad78f667..81f7b90849ce 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn30/dcn30_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn30/dcn30_fpu.c
@@ -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();
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c
index 8912475f01e2..d74f51efb703 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c
@@ -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;
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c b/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c
index 76399c66bc3b..ba1310c8fd77 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c
@@ -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];
diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c b/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c
index f00526d04cb7..705985d3f407 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c
@@ -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;
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c
index e0cc78e899bd..4a37f13cbd62 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c
@@ -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;
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.c
index 06b70c360ff8..0c994b5a48b1 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.c
@@ -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 */
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c
index 5bc4d9b2cf79..4302f9be1a7d 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c
@@ -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 */
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c
index dea7e63a49d9..a39a219a0bce 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c
@@ -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 */
diff --git a/drivers/gpu/drm/amd/display/dc/link/link_detection.c b/drivers/gpu/drm/amd/display/dc/link/link_detection.c
index fd9c1311c2fa..bba644024780 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_detection.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_detection.c
@@ -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;
diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c
index 9de5380757e0..1818970b8eaf 100644
--- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c
+++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c
@@ -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));
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn303/dcn303_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn303/dcn303_resource.c
index d2bc66904217..63f0f882c861 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn303/dcn303_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn303/dcn303_resource.c
@@ -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;
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 45/46] drm/amd/display: Disable seamless boot on 128b/132b encoding
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (43 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 44/46] drm/amd/display: Fix uninitialized variables in DC Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-24 8:49 ` [PATCH 46/46] drm/amd/display: 3.2.283 Wayne Lin
2024-04-29 13:17 ` [PATCH 00/46] DC Patches April 29, 2024 Wheeler, Daniel
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Sung Joon Kim, Anthony Koo
From: Sung Joon Kim <sungjoon.kim@amd.com>
[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
Reviewed-by: Anthony Koo <anthony.koo@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Sung Joon Kim <sungjoon.kim@amd.com>
---
drivers/gpu/drm/amd/display/dc/core/dc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index a8eb286ee4ff..9f56b2743f80 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -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;
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* [PATCH 46/46] drm/amd/display: 3.2.283
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (44 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 45/46] drm/amd/display: Disable seamless boot on 128b/132b encoding Wayne Lin
@ 2024-04-24 8:49 ` Wayne Lin
2024-04-29 13:17 ` [PATCH 00/46] DC Patches April 29, 2024 Wheeler, Daniel
46 siblings, 0 replies; 50+ messages in thread
From: Wayne Lin @ 2024-04-24 8:49 UTC (permalink / raw)
To: amd-gfx
Cc: Harry.Wentland, Sunpeng.Li, Rodrigo.Siqueira, Aurabindo.Pillai,
roman.li, wayne.lin, agustin.gutierrez, chiahsuan.chung,
hersenxs.wu, jerry.zuo, Aric Cyr
From: Aric Cyr <aric.cyr@amd.com>
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
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Aric Cyr <aric.cyr@amd.com>
---
drivers/gpu/drm/amd/display/dc/dc.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index dd8940c2a4bf..b6e92dda4b2d 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -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
--
2.37.3
^ permalink raw reply related [flat|nested] 50+ messages in thread
* RE: [PATCH 28/46] drm/amd/display: Enable RCO for PHYSYMCLK in DCN35
2024-04-24 8:49 ` [PATCH 28/46] drm/amd/display: Enable RCO for PHYSYMCLK in DCN35 Wayne Lin
@ 2024-04-24 13:48 ` Li, Roman
0 siblings, 0 replies; 50+ messages in thread
From: Li, Roman @ 2024-04-24 13:48 UTC (permalink / raw)
To: Lin, Wayne, amd-gfx@lists.freedesktop.org
Cc: Wentland, Harry, Li, Sun peng (Leo), Siqueira, Rodrigo,
Pillai, Aurabindo, Lin, Wayne, Gutierrez, Agustin,
Chung, ChiaHsuan (Tom), Wu, Hersen, Zuo, Jerry, Miess, Daniel,
Liu, Charlene
[Public]
> -----Original Message-----
> From: Wayne Lin <Wayne.Lin@amd.com>
> Sent: Wednesday, April 24, 2024 4:49 AM
> To: amd-gfx@lists.freedesktop.org
> Cc: Wentland, Harry <Harry.Wentland@amd.com>; Li, Sun peng (Leo)
> <Sunpeng.Li@amd.com>; Siqueira, Rodrigo <Rodrigo.Siqueira@amd.com>;
> Pillai, Aurabindo <Aurabindo.Pillai@amd.com>; Li, Roman
> <Roman.Li@amd.com>; Lin, Wayne <Wayne.Lin@amd.com>; Gutierrez,
> Agustin <Agustin.Gutierrez@amd.com>; Chung, ChiaHsuan (Tom)
> <ChiaHsuan.Chung@amd.com>; Wu, Hersen <hersenxs.wu@amd.com>; Zuo,
> Jerry <Jerry.Zuo@amd.com>; Miess, Daniel <Daniel.Miess@amd.com>; Liu,
> Charlene <Charlene.Liu@amd.com>
> Subject: [PATCH 28/46] drm/amd/display: Enable RCO for PHYSYMCLK in
> DCN35
>
> From: Daniel Miess <daniel.miess@amd.com>
>
> [Why & How]
> Enable root clock optimization for PHYSYMCLK and only disable it when it's
> actively being used
>
> Reviewed-by: Charlene Liu <charlene.liu@amd.com>
> Acked-by: Wayne Lin <wayne.lin@amd.com>
> Signed-off-by: Daniel Miess <daniel.miess@amd.com>
> ---
> 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(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dc.h
> b/drivers/gpu/drm/amd/display/dc/dc.h
> index 3048d5a0e87d..dd8940c2a4bf 100644
> --- a/drivers/gpu/drm/amd/display/dc/dc.h
> +++ b/drivers/gpu/drm/amd/display/dc/dc.h
> @@ -724,6 +724,7 @@ enum pg_hw_pipe_resources {
> PG_OPTC,
> PG_DPSTREAM,
> PG_HDMISTREAM,
> + PG_PHYSYMCLK,
> PG_HW_PIPE_RESOURCES_NUM_ELEMENT
> };
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c
> b/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c
> index 4b282b7e0996..795320a25fd2 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dccg.c
> @@ -461,32 +461,22 @@ static void
> dccg35_set_physymclk_root_clock_gating(
> case 0:
> REG_UPDATE(DCCG_GATE_DISABLE_CNTL2,
> PHYASYMCLK_ROOT_GATE_DISABLE, enable ?
> 1 : 0);
> -// 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);
> -// 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);
> -// 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);
> -// 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);
> -// REG_UPDATE(DCCG_GATE_DISABLE_CNTL4,
> -// PHYE_REFCLK_ROOT_GATE_DISABLE, enable ?
> 1 : 0);
> break;
> default:
> BREAK_TO_DEBUGGER();
> @@ -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:
> @@ -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:
> @@ -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:
> @@ -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:
> @@ -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:
> @@ -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.c
> b/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c
> index b94a85380d73..dea7e63a49d9 100644
> --- a/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c
> +++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c
> @@ -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;
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:
Reviewed-by: Roman Li <roman.li@amd.com>
> + 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_h
> +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-
> >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);
> +
> }
> }
>
> diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h
> b/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h
> index a731c8880d60..bc05beba5f2c 100644
> --- a/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h
> +++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h
> @@ -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); diff --git
> a/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c
> b/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c
> index 0e87f3503265..7f2cbfac9099 100644
> --- a/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c
> +++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c
> @@ -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.c
> b/drivers/gpu/drm/amd/display/dc/hwss/dcn351/dcn351_init.c
> index ff772665d1ae..91484b71b7da 100644
> --- a/drivers/gpu/drm/amd/display/dc/hwss/dcn351/dcn351_init.c
> +++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn351/dcn351_init.c
> @@ -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.h
> b/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer_private.h
> index 939832372baf..7553d6816d36 100644
> --- a/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer_private.h
> +++ b/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer_private.h
> @@ -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
^ permalink raw reply [flat|nested] 50+ messages in thread
* RE: [PATCH 00/46] DC Patches April 29, 2024
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
` (45 preceding siblings ...)
2024-04-24 8:49 ` [PATCH 46/46] drm/amd/display: 3.2.283 Wayne Lin
@ 2024-04-29 13:17 ` Wheeler, Daniel
46 siblings, 0 replies; 50+ messages in thread
From: Wheeler, Daniel @ 2024-04-29 13:17 UTC (permalink / raw)
To: Lin, Wayne, amd-gfx@lists.freedesktop.org
Cc: Wentland, Harry, Li, Sun peng (Leo), Siqueira, Rodrigo,
Pillai, Aurabindo, Li, Roman, Lin, Wayne, Gutierrez, Agustin,
Chung, ChiaHsuan (Tom), Wu, Hersen, Zuo, Jerry, Lin, Wayne
[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.
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
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 <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Wayne Lin
Sent: Wednesday, April 24, 2024 4:49 AM
To: amd-gfx@lists.freedesktop.org
Cc: Wentland, Harry <Harry.Wentland@amd.com>; Li, Sun peng (Leo) <Sunpeng.Li@amd.com>; Siqueira, Rodrigo <Rodrigo.Siqueira@amd.com>; Pillai, Aurabindo <Aurabindo.Pillai@amd.com>; Li, Roman <Roman.Li@amd.com>; Lin, Wayne <Wayne.Lin@amd.com>; Gutierrez, Agustin <Agustin.Gutierrez@amd.com>; Chung, ChiaHsuan (Tom) <ChiaHsuan.Chung@amd.com>; Wu, Hersen <hersenxs.wu@amd.com>; Zuo, Jerry <Jerry.Zuo@amd.com>; Lin, Wayne <Wayne.Lin@amd.com>
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
^ permalink raw reply [flat|nested] 50+ messages in thread
end of thread, other threads:[~2024-04-29 13:17 UTC | newest]
Thread overview: 50+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-24 8:48 [PATCH 00/46] DC Patches April 29, 2024 Wayne Lin
2024-04-24 8:48 ` [PATCH 01/46] drm/amd/display: Do cursor programming with rest of pipe Wayne Lin
2024-04-24 8:48 ` [PATCH 02/46] drm/amd/display: Always use legacy way of setting cursor on DCE Wayne Lin
2024-04-24 8:48 ` [PATCH 03/46] drm/amd/display: Add NULL pointer check for kzalloc Wayne Lin
2024-04-24 8:48 ` [PATCH 04/46] drm/amd/display: Check index msg_id before read or write Wayne Lin
2024-04-24 8:48 ` [PATCH 05/46] drm/amd/display: Check pipe offset before setting vblank Wayne Lin
2024-04-24 8:48 ` [PATCH 06/46] drm/amd/display: Skip finding free audio for unknown engine_id Wayne Lin
2024-04-24 8:48 ` [PATCH 07/46] drm/amd/display: Fix overlapping copy within dml_core_mode_programming Wayne Lin
2024-04-24 8:48 ` [PATCH 08/46] drm/amd/display: Do not return negative stream id for array Wayne Lin
2024-04-24 8:48 ` [PATCH 09/46] drm/amd/display: ASSERT when failing to find index by plane/stream id Wayne Lin
2024-04-24 8:48 ` [PATCH 10/46] drm/amd/display: Remove unnecessary files Wayne Lin
2024-04-24 8:48 ` [PATCH 11/46] drm/amd/display: Improve registers write Wayne Lin
2024-04-24 8:48 ` [PATCH 12/46] drm/amd/display: Add missing SMU version Wayne Lin
2024-04-24 8:48 ` [PATCH 13/46] drm/amd/display: Adjust codestyle for dcn31 and hdcp_msg Wayne Lin
2024-04-24 8:48 ` [PATCH 14/46] drm/amd/display: Add VCO speed parameter for DCN31 FPU Wayne Lin
2024-04-24 8:49 ` [PATCH 15/46] drm/amd/display: Adjust functions prefix for some of the dcn301 fpu functions Wayne Lin
2024-04-24 8:49 ` [PATCH 16/46] drm/amd/display: Enable legacy fast update for dcn301 Wayne Lin
2024-04-24 8:49 ` [PATCH 17/46] drm/amd/display: Update some of the dcn303 parameters Wayne Lin
2024-04-24 8:49 ` [PATCH 18/46] drm/amd/display: Remove legacy code in DC Wayne Lin
2024-04-24 8:49 ` [PATCH 19/46] drm/amd/display: Add log_color_state callback to multiple DCNs Wayne Lin
2024-04-24 8:49 ` [PATCH 20/46] drm/amd/display: Handle the case which quad_part is equal 0 Wayne Lin
2024-04-24 8:49 ` [PATCH 21/46] drm/amd/display: Refactor for Replay Link off frame count Wayne Lin
2024-04-24 8:49 ` [PATCH 22/46] drm/amd/display: Restrict multi-disp support for in-game FAMS Wayne Lin
2024-04-24 8:49 ` [PATCH 23/46] drm/amd/display: Defer handling mst up request in resume Wayne Lin
2024-04-24 8:49 ` [PATCH 24/46] drm/amd/display: Fix DC mode screen flickering on DCN321 Wayne Lin
2024-04-24 8:49 ` [PATCH 25/46] drm/amd/display: take ODM slice count into account when deciding DSC slice Wayne Lin
2024-04-24 8:49 ` [PATCH 26/46] drm/amd/display: Re-enable IPS2 for static screen Wayne Lin
2024-04-24 8:49 ` [PATCH 27/46] drm/amd/display: Add trigger FIFO resync path for DCN35 Wayne Lin
2024-04-24 8:49 ` [PATCH 28/46] drm/amd/display: Enable RCO for PHYSYMCLK in DCN35 Wayne Lin
2024-04-24 13:48 ` Li, Roman
2024-04-24 8:49 ` [PATCH 29/46] drm/amd/display: Revert "dc: Keep VBios pixel rate div setting util next mode set" Wayne Lin
2024-04-24 8:49 ` [PATCH 30/46] drm/amd/display: Only program P-State force if pipe config changed Wayne Lin
2024-04-24 8:49 ` [PATCH 31/46] drm/amd/display: Remove redundant include file Wayne Lin
2024-04-24 8:49 ` [PATCH 32/46] drm/amd/display: Refactor HUBBUB into component folder Wayne Lin
2024-04-24 8:49 ` [PATCH 33/46] drm/amd/display: Assign linear_pitch_alignment even for VM Wayne Lin
2024-04-24 8:49 ` [PATCH 34/46] drm/amd/display: gpuvm handling in DML21 Wayne Lin
2024-04-24 8:49 ` [PATCH 35/46] drm/amd/display: For FPO + Vactive check that all pipes support VA Wayne Lin
2024-04-24 8:49 ` [PATCH 36/46] drm/amd/display: Fix uninitialized variables in DM Wayne Lin
2024-04-24 8:49 ` [PATCH 37/46] drm/amd/display: Fix uninitialized variables in DC Wayne Lin
2024-04-24 8:49 ` [PATCH 38/46] drm/amd/display: Fix FEC_READY write on DP LT Wayne Lin
2024-04-24 8:49 ` [PATCH 39/46] drm/amd/display: use even ODM slice width for two pixels per container Wayne Lin
2024-04-24 8:49 ` [PATCH 40/46] drm/amd/display: Enable Replay for DCN315 Wayne Lin
2024-04-24 8:49 ` [PATCH 41/46] drm/amd/display: Notify idle link detection through shared state Wayne Lin
2024-04-24 8:49 ` [PATCH 42/46] drm/amd/display: Add periodic detection for IPS Wayne Lin
2024-04-24 8:49 ` [PATCH 43/46] drm/amd/display: Change ASSR disable sequence Wayne Lin
2024-04-24 8:49 ` [PATCH 44/46] drm/amd/display: Fix uninitialized variables in DC Wayne Lin
2024-04-24 8:49 ` [PATCH 45/46] drm/amd/display: Disable seamless boot on 128b/132b encoding Wayne Lin
2024-04-24 8:49 ` [PATCH 46/46] drm/amd/display: 3.2.283 Wayne Lin
2024-04-29 13:17 ` [PATCH 00/46] DC Patches April 29, 2024 Wheeler, Daniel
-- strict thread matches above, loose matches on Subject: below --
2024-04-24 8:31 Wayne Lin
2024-04-24 8:31 ` [PATCH 10/46] drm/amd/display: Remove unnecessary files Wayne Lin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.