* [PATCH 01/27] drm/amd/display: Avoid per-entry long division in __drm_lut32_to_dc_gamma
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
@ 2026-11-25 6:54 ` Chenyu Chen
2026-11-25 6:54 ` [PATCH 02/27] drm/amd/display: Capture more diagnostic register state Chenyu Chen
` (27 subsequent siblings)
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:54 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, Alan Liu, Chenyu Chen
From: Alan Liu <haoping.liu@amd.com>
[Why]
__drm_lut32_to_dc_gamma() converts each entry of a 4096-entry 32-bit LUT
with dc_fixpt_from_fraction(v, 0xFFFFFFFF). That helper does a 64-bit
division followed by a 32-iteration bit-by-bit long division, so one LUT
costs 12288 such calls.
When a plane with a 32-bit LUT colorop is recreated in atomic check (for
example on every plane size change), this conversion accounts for ~97%
of amdgpu_dm_update_plane_color_mgmt() time, and it runs for TEST_ONLY
commits as well.
[How]
The denominator is constant, so the result has a closed form:
v * 2^32 / (2^32 - 1) = v + v / (2^32 - 1). The fractional term is below
1 and rounds up exactly when v >= 2^31, so the result is v + (v >= 2^31).
This is bit-exact with the previous dc_fixpt_from_fraction() result for
all 2^32 inputs (checked exhaustively in userspace), so there is no
functional change.
With this change __drm_lut32_to_dc_gamma() takes >99% less time, and
amdgpu_dm_update_plane_color_mgmt() takes ~95% less time per recreated
plane. KUnit amdgpu_dm_color results are unchanged.
Cc: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alan Liu <haoping.liu@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
.../amd/display/amdgpu_dm/amdgpu_dm_color.c | 21 ++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
index 45cea72111c7..e09a8a686ec9 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
@@ -534,6 +534,21 @@ void __drm_lut_to_dc_gamma(const struct drm_color_lut *lut,
}
EXPORT_IF_KUNIT(__drm_lut_to_dc_gamma);
+/*
+ * Convert a 32-bit DRM LUT value to S31.32 fixed point, i.e. v / 0xFFFFFFFF.
+ *
+ * Bit-exact replacement for dc_fixpt_from_fraction(v, MAX_DRM_LUT32_VALUE),
+ * which does a 64-bit division plus a 32-iteration long division per value.
+ * With d = 2^32 - 1: v * 2^32 / d = v + v / d, and v / d is in [0, 1], so
+ * the rounded result is v + 1 when v / d >= 1/2, i.e. when v >= 2^31.
+ */
+static inline struct fixed31_32 __drm_lut32_value_to_fixpt(u32 v)
+{
+ struct fixed31_32 res = { .value = (long long)v + (v >= 0x80000000u) };
+
+ return res;
+}
+
/**
* __drm_lut32_to_dc_gamma - convert the drm_color_lut to dc_gamma.
* @lut: DRM lookup table for color conversion
@@ -547,9 +562,9 @@ void __drm_lut32_to_dc_gamma(const struct drm_color_lut32 *lut, struct dc_gamma
int i;
for (i = 0; i < MAX_COLOR_LUT_ENTRIES; i++) {
- gamma->entries.red[i] = dc_fixpt_from_fraction(lut[i].red, MAX_DRM_LUT32_VALUE);
- gamma->entries.green[i] = dc_fixpt_from_fraction(lut[i].green, MAX_DRM_LUT32_VALUE);
- gamma->entries.blue[i] = dc_fixpt_from_fraction(lut[i].blue, MAX_DRM_LUT32_VALUE);
+ gamma->entries.red[i] = __drm_lut32_value_to_fixpt(lut[i].red);
+ gamma->entries.green[i] = __drm_lut32_value_to_fixpt(lut[i].green);
+ gamma->entries.blue[i] = __drm_lut32_value_to_fixpt(lut[i].blue);
}
}
EXPORT_IF_KUNIT(__drm_lut32_to_dc_gamma);
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* [PATCH 02/27] drm/amd/display: Capture more diagnostic register state
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
2026-11-25 6:54 ` [PATCH 01/27] drm/amd/display: Avoid per-entry long division in __drm_lut32_to_dc_gamma Chenyu Chen
@ 2026-11-25 6:54 ` Chenyu Chen
2026-11-25 6:54 ` [PATCH 03/27] drm/amd/display: Add debug option to force DP link rate Chenyu Chen
` (26 subsequent siblings)
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:54 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, Dillon Varone,
Nicholas Kazlauskas, Chenyu Chen
From: Dillon Varone <Dillon.Varone@amd.com>
[WHY&HOW]
Captures more register state for diagnosing potential FW and interrupt
related issues. The values are only stored in the diagnostic data
structures; this patch does not print them.
- IHC interrupt status (DISP_INTERRUPT_STATUS and its CONTINUE
registers), per ASIC through DMUB_DCN401_IHC_REGS, DMUB_DCN42_IHC_REGS
and DMUB_DCN60_IHC_REGS. DCN42B uses the DCN42 list.
- DCHUBBUB timeout detection control 2 (DCHUBBUB_TIMEOUT_DETECTION_CTRL2)
- DCHUBBUB timeout interrupt status (DCHUBBUB_TIMEOUT_INTERRUPT_STATUS),
added to the hubbub register lists and read into
hubbub_state->timeout_interrupt_status
- DMCUB interrupt status (DMCUB_INTERRUPT_STATUS)
- DMCUB external interrupt context and status (DMCUB_EXT_INTERRUPT_CTXID
and DMCUB_EXT_INTERRUPT_STATUS), read into ext_int_ctx_id and
ext_int_id. DMUB_DCN401, DMUB_DCN42 and DMUB_DCN60 also add the
DMCUB_EXT_INTERRUPT_ID field.
Reserved placeholders, not used yet: the client_debug array
(MAX_IHC_CLIENT_DEBUG_REG entries) in the IHC diagnostic data and the
empty DMUB_DCN401_IHC_DEBUG_REGS() macro, which is expanded in the
DCN401 IHC register list. They are reserved for IHC client debug
registers in a later change. Nothing reads or fills them in this patch.
Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Dillon Varone <Dillon.Varone@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
.../display/dc/hubbub/dcn10/dcn10_hubbub.h | 1 +
.../display/dc/hubbub/dcn20/dcn20_hubbub.c | 6 +++
.../display/dc/hubbub/dcn35/dcn35_hubbub.h | 1 +
.../display/dc/hubbub/dcn42/dcn42_hubbub.h | 3 +-
.../gpu/drm/amd/display/dc/inc/hw/dchubbub.h | 2 +
.../dc/resource/dcn401/dcn401_resource.h | 1 +
.../dc/resource/dcn60/dcn60_resource.h | 1 +
drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 12 ++++++
.../drm/amd/display/dmub/src/dmub_dcn401.c | 40 +++++++++++++++++++
.../drm/amd/display/dmub/src/dmub_dcn401.h | 39 +++++++++++++++++-
.../gpu/drm/amd/display/dmub/src/dmub_dcn42.c | 37 +++++++++++++++++
.../gpu/drm/amd/display/dmub/src/dmub_dcn42.h | 36 ++++++++++++++++-
.../drm/amd/display/dmub/src/dmub_dcn42b.c | 1 +
.../gpu/drm/amd/display/dmub/src/dmub_dcn60.c | 38 ++++++++++++++++++
.../gpu/drm/amd/display/dmub/src/dmub_dcn60.h | 36 ++++++++++++++++-
15 files changed, 247 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/hubbub/dcn10/dcn10_hubbub.h b/drivers/gpu/drm/amd/display/dc/hubbub/dcn10/dcn10_hubbub.h
index 581e2c1578b5..69316b284e5d 100644
--- a/drivers/gpu/drm/amd/display/dc/hubbub/dcn10/dcn10_hubbub.h
+++ b/drivers/gpu/drm/amd/display/dc/hubbub/dcn10/dcn10_hubbub.h
@@ -201,6 +201,7 @@ struct dcn_hubbub_registers {
uint32_t DCHUBBUB_ARB_FRAC_URG_BW_MALL_B;
uint32_t DCHUBBUB_TIMEOUT_DETECTION_CTRL1;
uint32_t DCHUBBUB_TIMEOUT_DETECTION_CTRL2;
+ uint32_t DCHUBBUB_TIMEOUT_INTERRUPT_STATUS;
uint32_t DCHUBBUB_CTRL_STATUS;
uint32_t DCHUBBUB_ARB_BUFFER_FULLNESS_WATERMARK_A;
uint32_t DCHUBBUB_ARB_BUFFER_FULLNESS_WATERMARK_B;
diff --git a/drivers/gpu/drm/amd/display/dc/hubbub/dcn20/dcn20_hubbub.c b/drivers/gpu/drm/amd/display/dc/hubbub/dcn20/dcn20_hubbub.c
index 6cfcce7bb48f..a145c3692f1b 100644
--- a/drivers/gpu/drm/amd/display/dc/hubbub/dcn20/dcn20_hubbub.c
+++ b/drivers/gpu/drm/amd/display/dc/hubbub/dcn20/dcn20_hubbub.c
@@ -656,6 +656,12 @@ void hubbub2_read_state(struct hubbub *hubbub, struct dcn_hubbub_state *hubbub_s
if (REG(DCHUBBUB_ARB_DRAM_STATE_CNTL))
hubbub_state->dram_state_cntl = REG_READ(DCHUBBUB_ARB_DRAM_STATE_CNTL);
+
+ if (REG(DCHUBBUB_TIMEOUT_DETECTION_CTRL2))
+ hubbub_state->timeout_detection_ctrl2 = REG_READ(DCHUBBUB_TIMEOUT_DETECTION_CTRL2);
+
+ if (REG(DCHUBBUB_TIMEOUT_INTERRUPT_STATUS))
+ hubbub_state->timeout_interrupt_status = REG_READ(DCHUBBUB_TIMEOUT_INTERRUPT_STATUS);
}
static const struct hubbub_funcs hubbub2_funcs = {
diff --git a/drivers/gpu/drm/amd/display/dc/hubbub/dcn35/dcn35_hubbub.h b/drivers/gpu/drm/amd/display/dc/hubbub/dcn35/dcn35_hubbub.h
index 831b9888c831..08d4897a0e95 100644
--- a/drivers/gpu/drm/amd/display/dc/hubbub/dcn35/dcn35_hubbub.h
+++ b/drivers/gpu/drm/amd/display/dc/hubbub/dcn35/dcn35_hubbub.h
@@ -189,6 +189,7 @@
SR(DCHUBBUB_CTRL_STATUS),\
SR(DCHUBBUB_TIMEOUT_DETECTION_CTRL1),\
SR(DCHUBBUB_TIMEOUT_DETECTION_CTRL2),\
+ SR(DCHUBBUB_TIMEOUT_INTERRUPT_STATUS),\
SR(DCHUBBUB_ARB_QOS_FORCE)
diff --git a/drivers/gpu/drm/amd/display/dc/hubbub/dcn42/dcn42_hubbub.h b/drivers/gpu/drm/amd/display/dc/hubbub/dcn42/dcn42_hubbub.h
index f74d5690c89d..9b673512b80e 100644
--- a/drivers/gpu/drm/amd/display/dc/hubbub/dcn42/dcn42_hubbub.h
+++ b/drivers/gpu/drm/amd/display/dc/hubbub/dcn42/dcn42_hubbub.h
@@ -119,7 +119,8 @@
SR(DCHUBBUB_TEST_DEBUG_DATA),\
SR(DCHUBBUB_CTRL_STATUS),\
SR(DCHUBBUB_TIMEOUT_DETECTION_CTRL1),\
- SR(DCHUBBUB_TIMEOUT_DETECTION_CTRL2)\
+ SR(DCHUBBUB_TIMEOUT_DETECTION_CTRL2),\
+ SR(DCHUBBUB_TIMEOUT_INTERRUPT_STATUS)
#define HUBBUB_MASK_SH_LIST_DCN4_2(mask_sh)\
HUBBUB_MASK_SH_LIST_DCN32(mask_sh), \
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h b/drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h
index 0b5fe1ca04e0..71658a4c775a 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h
@@ -153,6 +153,8 @@ struct dcn_hubbub_state {
uint32_t test_debug_data;
uint32_t watermark_change_cntl;
uint32_t dram_state_cntl;
+ uint32_t timeout_detection_ctrl2;
+ uint32_t timeout_interrupt_status;
};
struct dcn_hubbub_reg_state {
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.h b/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.h
index 3cfc1a39a103..065c9fffee3e 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.h
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.h
@@ -633,6 +633,7 @@ int dcn401_get_power_profile(const struct dc_state *context);
SR(DCHUBBUB_MEM_PWR_MODE_CTRL), \
SR(DCHUBBUB_TIMEOUT_DETECTION_CTRL1), \
SR(DCHUBBUB_TIMEOUT_DETECTION_CTRL2), \
+ SR(DCHUBBUB_TIMEOUT_INTERRUPT_STATUS), \
SR(DCHUBBUB_CTRL_STATUS), \
SR(DCHUBBUB_ARB_MALL_CNTL)
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn60/dcn60_resource.h b/drivers/gpu/drm/amd/display/dc/resource/dcn60/dcn60_resource.h
index 34cfdc6eb8e5..b73f9616b3ee 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn60/dcn60_resource.h
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn60/dcn60_resource.h
@@ -133,6 +133,7 @@ bool dcn50_program_mcache_pipe_config(struct dc_state *context,
SR(DCHUBBUB_MEM_PWR_MODE_CTRL), \
SR(DCHUBBUB_TIMEOUT_DETECTION_CTRL1), \
SR(DCHUBBUB_TIMEOUT_DETECTION_CTRL2), \
+ SR(DCHUBBUB_TIMEOUT_INTERRUPT_STATUS), \
SR(DCHUBBUB_CTRL_STATUS), \
SR(DCHUBBUB_PERFORMANCE_MEASUREMENT_CNTL), \
SR(DCHUBBUB_PERFORMANCE_MEASUREMENT_CNTL2), \
diff --git a/drivers/gpu/drm/amd/display/dmub/dmub_srv.h b/drivers/gpu/drm/amd/display/dmub/dmub_srv.h
index 84f825c924bc..eb3b34aec745 100644
--- a/drivers/gpu/drm/amd/display/dmub/dmub_srv.h
+++ b/drivers/gpu/drm/amd/display/dmub/dmub_srv.h
@@ -79,6 +79,9 @@
#define PSP_FOOTER_BYTES_512 0x200 // 512 bytes
#define PSP_FOOTER_BYTES_1932 0x78C // 1932 bytes
+#define MAX_IHC_INT_REG 32
+#define MAX_IHC_CLIENT_DEBUG_REG 5
+
/* Forward declarations */
struct dmub_srv;
struct dmub_srv_common_regs;
@@ -394,10 +397,16 @@ struct dmub_timeout_info {
struct dmub_trace_snapshot trace_snapshot;
};
+struct dmub_ihc_diagnostic_data {
+ uint32_t int_status[MAX_IHC_INT_REG];
+ uint32_t client_debug[MAX_IHC_CLIENT_DEBUG_REG];
+};
+
/**
* struct dmub_hw_diagnostic_data - Hardware diagnostic data for the DMUB
*/
struct dmub_hw_diagnostic_data {
+ struct dmub_ihc_diagnostic_data ihc;
uint32_t dmcub_version;
uint32_t scratch[17];
uint32_t pc[DMUB_PC_SNAPSHOT_COUNT];
@@ -414,6 +423,9 @@ struct dmub_hw_diagnostic_data {
uint32_t outbox1_wptr;
uint32_t outbox1_size;
uint32_t gpint_datain0;
+ uint32_t int_status;
+ uint32_t ext_int_ctx_id;
+ uint32_t ext_int_id;
uint8_t is_dmcub_enabled : 1;
uint8_t is_dmcub_soft_reset : 1;
uint8_t is_dmcub_secure_reset : 1;
diff --git a/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn401.c b/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn401.c
index 02ab26516584..ffe6ce231ae4 100644
--- a/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn401.c
+++ b/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn401.c
@@ -20,6 +20,8 @@ const struct dmub_srv_dcn401_regs dmub_srv_dcn401_regs = {
#define DMUB_SR(reg) REG_OFFSET_EXP(reg),
{
DMUB_DCN401_REGS()
+ DMUB_DCN401_IHC_REGS()
+ DMUB_DCN401_IHC_DEBUG_REGS()
DMCUB_INTERNAL_REGS()
},
#undef DMUB_SR
@@ -423,6 +425,37 @@ uint32_t dmub_dcn401_get_current_time(struct dmub_srv *dmub)
return REG_READ(DMCUB_TIMER_CURRENT);
}
+static void dmub_dcn401_get_ihc_diagnostic_data(struct dmub_srv *dmub, struct dmub_ihc_diagnostic_data *ihc_data)
+{
+ ihc_data->int_status[0] = REG_READ(DISP_INTERRUPT_STATUS);
+ ihc_data->int_status[1] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE);
+ ihc_data->int_status[2] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE2);
+ ihc_data->int_status[3] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE3);
+ ihc_data->int_status[4] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE4);
+ ihc_data->int_status[5] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE5);
+ ihc_data->int_status[6] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE6);
+ ihc_data->int_status[7] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE7);
+ ihc_data->int_status[8] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE8);
+ ihc_data->int_status[9] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE9);
+ ihc_data->int_status[10] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE10);
+ ihc_data->int_status[11] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE11);
+ ihc_data->int_status[12] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE12);
+ ihc_data->int_status[13] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE13);
+ ihc_data->int_status[14] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE14);
+ ihc_data->int_status[15] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE15);
+ ihc_data->int_status[16] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE16);
+ ihc_data->int_status[17] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE17);
+ ihc_data->int_status[18] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE18);
+ ihc_data->int_status[19] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE19);
+ ihc_data->int_status[20] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE20);
+ ihc_data->int_status[21] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE21);
+ ihc_data->int_status[22] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE22);
+ ihc_data->int_status[23] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE23);
+ ihc_data->int_status[24] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE24);
+ ihc_data->int_status[25] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE25);
+
+}
+
void dmub_dcn401_get_diagnostic_data(struct dmub_srv *dmub, struct dmub_hw_diagnostic_data *hw_data)
{
uint32_t is_dmub_enabled, is_soft_reset, is_sec_reset, is_pwait;
@@ -498,7 +531,14 @@ void dmub_dcn401_get_diagnostic_data(struct dmub_srv *dmub, struct dmub_hw_diagn
hw_data->is_cw6_enabled = (uint8_t)is_cw6_enabled;
hw_data->gpint_datain0 = REG_READ(DMCUB_GPINT_DATAIN0);
+
+ hw_data->int_status = REG_READ(DMCUB_INTERRUPT_STATUS);
+ hw_data->ext_int_ctx_id = REG_READ(DMCUB_EXT_INTERRUPT_CTXID);
+ hw_data->ext_int_id = REG_READ(DMCUB_EXT_INTERRUPT_STATUS);
+
+ dmub_dcn401_get_ihc_diagnostic_data(dmub, &hw_data->ihc);
}
+
void dmub_dcn401_configure_dmub_in_system_memory(struct dmub_srv *dmub)
{
/* DMCUB_REGION3_TMR_AXI_SPACE values:
diff --git a/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn401.h b/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn401.h
index de7840d93592..c90c0478e56b 100644
--- a/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn401.h
+++ b/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn401.h
@@ -124,7 +124,39 @@ struct dmub_srv;
DMUB_SR(DMCUB_REG_OUTBOX0_RDY) \
DMUB_SR(DMCUB_REG_OUTBOX0_MSG0) \
DMUB_SR(DMCUB_REG_OUTBOX0_RSP) \
- DMUB_SR(HOST_INTERRUPT_CSR)
+ DMUB_SR(HOST_INTERRUPT_CSR) \
+ DMUB_SR(DMCUB_EXT_INTERRUPT_CTXID) \
+ DMUB_SR(DMCUB_EXT_INTERRUPT_STATUS)
+
+#define DMUB_DCN401_IHC_REGS() \
+ DMUB_SR(DISP_INTERRUPT_STATUS) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE2) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE3) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE4) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE5) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE6) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE7) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE8) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE9) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE10) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE11) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE12) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE13) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE14) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE15) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE16) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE17) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE18) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE19) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE20) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE21) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE22) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE23) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE24) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE25)
+
+#define DMUB_DCN401_IHC_DEBUG_REGS()
#define DMUB_DCN401_FIELDS() \
DMUB_SF(DMCUB_CNTL, DMCUB_ENABLE) \
@@ -170,11 +202,14 @@ struct dmub_srv;
DMUB_SF(HOST_INTERRUPT_CSR, HOST_REG_OUTBOX0_RDY_INT_ACK) \
DMUB_SF(HOST_INTERRUPT_CSR, HOST_REG_OUTBOX0_RDY_INT_STAT) \
DMUB_SF(HOST_INTERRUPT_CSR, HOST_REG_OUTBOX0_RDY_INT_EN) \
- DMUB_SF(DMCUB_CNTL, DMCUB_PWAIT_MODE_STATUS)
+ DMUB_SF(DMCUB_CNTL, DMCUB_PWAIT_MODE_STATUS) \
+ DMUB_SF(DMCUB_EXT_INTERRUPT_STATUS, DMCUB_EXT_INTERRUPT_ID)
struct dmub_srv_dcn401_reg_offset {
#define DMUB_SR(reg) uint32_t reg;
DMUB_DCN401_REGS()
+ DMUB_DCN401_IHC_REGS()
+ DMUB_DCN401_IHC_DEBUG_REGS()
DMCUB_INTERNAL_REGS()
#undef DMUB_SR
};
diff --git a/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn42.c b/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn42.c
index 8ebd3d948567..17b3a2304ac7 100644
--- a/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn42.c
+++ b/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn42.c
@@ -23,6 +23,7 @@ void dmub_srv_dcn42_regs_init(struct dmub_srv *dmub, struct dc_context *ctx)
#define DMUB_SR(reg) REG_STRUCT->offset.reg = REG_OFFSET_EXP(reg);
DMUB_DCN42_REGS()
+ DMUB_DCN42_IHC_REGS()
DMCUB_INTERNAL_REGS()
#undef DMUB_SR
@@ -633,6 +634,36 @@ uint32_t dmub_dcn42_get_current_time(struct dmub_srv *dmub)
return REG_READ(DMCUB_TIMER_CURRENT);
}
+static void dmub_dcn42_get_ihc_diagnostic_data(struct dmub_srv *dmub, struct dmub_ihc_diagnostic_data *ihc_data)
+{
+ ihc_data->int_status[0] = REG_READ(DISP_INTERRUPT_STATUS);
+ ihc_data->int_status[1] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE);
+ ihc_data->int_status[2] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE2);
+ ihc_data->int_status[3] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE3);
+ ihc_data->int_status[4] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE4);
+ ihc_data->int_status[5] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE5);
+ ihc_data->int_status[6] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE6);
+ ihc_data->int_status[7] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE7);
+ ihc_data->int_status[8] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE8);
+ ihc_data->int_status[9] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE9);
+ ihc_data->int_status[10] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE10);
+ ihc_data->int_status[11] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE11);
+ ihc_data->int_status[12] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE12);
+ ihc_data->int_status[13] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE13);
+ ihc_data->int_status[14] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE14);
+ ihc_data->int_status[15] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE15);
+ ihc_data->int_status[16] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE16);
+ ihc_data->int_status[17] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE17);
+ ihc_data->int_status[18] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE18);
+ ihc_data->int_status[19] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE19);
+ ihc_data->int_status[20] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE20);
+ ihc_data->int_status[21] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE21);
+ ihc_data->int_status[22] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE22);
+ ihc_data->int_status[23] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE23);
+ ihc_data->int_status[24] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE24);
+ ihc_data->int_status[25] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE25);
+}
+
void dmub_dcn42_get_diagnostic_data(struct dmub_srv *dmub, struct dmub_hw_diagnostic_data *hw_data)
{
uint32_t is_dmub_enabled, is_soft_reset, is_sec_reset, is_pwait;
@@ -708,6 +739,12 @@ void dmub_dcn42_get_diagnostic_data(struct dmub_srv *dmub, struct dmub_hw_diagno
hw_data->is_cw6_enabled = (uint8_t)is_cw6_enabled;
hw_data->gpint_datain0 = REG_READ(DMCUB_GPINT_DATAIN0);
+
+ hw_data->int_status = REG_READ(DMCUB_INTERRUPT_STATUS);
+ hw_data->ext_int_ctx_id = REG_READ(DMCUB_EXT_INTERRUPT_CTXID);
+ hw_data->ext_int_id = REG_READ(DMCUB_EXT_INTERRUPT_STATUS);
+
+ dmub_dcn42_get_ihc_diagnostic_data(dmub, &hw_data->ihc);
}
bool dmub_dcn42_get_preos_fw_info(struct dmub_srv *dmub)
diff --git a/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn42.h b/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn42.h
index c879e94272d7..cf901715ec36 100644
--- a/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn42.h
+++ b/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn42.h
@@ -150,7 +150,37 @@ struct dmub_srv;
DMUB_SR(DMCUB_REG_OUTBOX0_RDY) \
DMUB_SR(DMCUB_REG_OUTBOX0_MSG0) \
DMUB_SR(DMCUB_REG_OUTBOX0_RSP) \
- DMUB_SR(HOST_INTERRUPT_CSR)
+ DMUB_SR(HOST_INTERRUPT_CSR) \
+ DMUB_SR(DMCUB_EXT_INTERRUPT_CTXID) \
+ DMUB_SR(DMCUB_EXT_INTERRUPT_STATUS)
+
+#define DMUB_DCN42_IHC_REGS() \
+ DMUB_SR(DISP_INTERRUPT_STATUS) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE2) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE3) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE4) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE5) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE6) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE7) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE8) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE9) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE10) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE11) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE12) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE13) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE14) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE15) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE16) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE17) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE18) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE19) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE20) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE21) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE22) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE23) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE24) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE25)
#define DMUB_DCN42_FIELDS() \
DMUB_SF(DMCUB_CNTL, DMCUB_ENABLE) \
@@ -198,11 +228,13 @@ struct dmub_srv;
DMUB_SF(HOST_INTERRUPT_CSR, HOST_REG_INBOX0_RSP_INT_EN) \
DMUB_SF(HOST_INTERRUPT_CSR, HOST_REG_OUTBOX0_RDY_INT_ACK) \
DMUB_SF(HOST_INTERRUPT_CSR, HOST_REG_OUTBOX0_RDY_INT_STAT) \
- DMUB_SF(HOST_INTERRUPT_CSR, HOST_REG_OUTBOX0_RDY_INT_EN)
+ DMUB_SF(HOST_INTERRUPT_CSR, HOST_REG_OUTBOX0_RDY_INT_EN) \
+ DMUB_SF(DMCUB_EXT_INTERRUPT_STATUS, DMCUB_EXT_INTERRUPT_ID)
struct dmub_srv_dcn42_reg_offset {
#define DMUB_SR(reg) uint32_t reg;
DMUB_DCN42_REGS()
+ DMUB_DCN42_IHC_REGS()
DMCUB_INTERNAL_REGS()
#undef DMUB_SR
};
diff --git a/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn42b.c b/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn42b.c
index 97eb022b837b..25fde94df2ca 100644
--- a/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn42b.c
+++ b/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn42b.c
@@ -20,6 +20,7 @@ void dmub_srv_dcn42b_regs_init(struct dmub_srv *dmub, struct dc_context *ctx)
#define DMUB_SR(reg) REG_STRUCT->offset.reg = REG_OFFSET_EXP(reg);
DMUB_DCN42_REGS()
+ DMUB_DCN42_IHC_REGS()
DMCUB_INTERNAL_REGS()
#undef DMUB_SR
diff --git a/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn60.c b/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn60.c
index 8c3cc51c07a3..384bdb0410f1 100644
--- a/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn60.c
+++ b/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn60.c
@@ -30,6 +30,7 @@ const struct dmub_srv_dcn60_regs dmub_srv_dcn60_regs = {
#define MMHUB_SR(reg) .reg = MMHUB_REG_OFFSET(reg),
.offset = {
DMUB_DCN60_REGS()
+ DMUB_DCN60_IHC_REGS()
DMCUB_INTERNAL_REGS()
DCN60_EXTERNAL_MMHUB_REGS()
},
@@ -469,6 +470,36 @@ uint32_t dmub_dcn60_get_current_time(struct dmub_srv *dmub)
return REG_READ(DMCUB_TIMER_CURRENT);
}
+static void dmub_dcn60_get_ihc_diagnostic_data(struct dmub_srv *dmub, struct dmub_ihc_diagnostic_data *ihc_data)
+{
+ ihc_data->int_status[0] = REG_READ(DISP_INTERRUPT_STATUS);
+ ihc_data->int_status[1] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE);
+ ihc_data->int_status[2] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE2);
+ ihc_data->int_status[3] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE3);
+ ihc_data->int_status[4] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE4);
+ ihc_data->int_status[5] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE5);
+ ihc_data->int_status[6] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE6);
+ ihc_data->int_status[7] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE7);
+ ihc_data->int_status[8] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE8);
+ ihc_data->int_status[9] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE9);
+ ihc_data->int_status[10] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE10);
+ ihc_data->int_status[11] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE11);
+ ihc_data->int_status[12] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE12);
+ ihc_data->int_status[13] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE13);
+ ihc_data->int_status[14] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE14);
+ ihc_data->int_status[15] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE15);
+ ihc_data->int_status[16] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE16);
+ ihc_data->int_status[17] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE17);
+ ihc_data->int_status[18] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE18);
+ ihc_data->int_status[19] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE19);
+ ihc_data->int_status[20] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE20);
+ ihc_data->int_status[21] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE21);
+ ihc_data->int_status[22] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE22);
+ ihc_data->int_status[23] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE23);
+ ihc_data->int_status[24] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE24);
+ ihc_data->int_status[25] = REG_READ(DISP_INTERRUPT_STATUS_CONTINUE25);
+}
+
void dmub_dcn60_get_diagnostic_data(struct dmub_srv *dmub, struct dmub_hw_diagnostic_data *hw_data)
{
uint32_t is_dmub_enabled, is_soft_reset, is_sec_reset, is_pwait;
@@ -544,7 +575,14 @@ void dmub_dcn60_get_diagnostic_data(struct dmub_srv *dmub, struct dmub_hw_diagno
hw_data->is_cw6_enabled = (uint8_t)is_cw6_enabled;
hw_data->gpint_datain0 = REG_READ(DMCUB_GPINT_DATAIN0);
+
+ hw_data->int_status = REG_READ(DMCUB_INTERRUPT_STATUS);
+ hw_data->ext_int_ctx_id = REG_READ(DMCUB_EXT_INTERRUPT_CTXID);
+ hw_data->ext_int_id = REG_READ(DMCUB_EXT_INTERRUPT_STATUS);
+
+ dmub_dcn60_get_ihc_diagnostic_data(dmub, &hw_data->ihc);
}
+
void dmub_dcn60_configure_dmub_in_system_memory(struct dmub_srv *dmub)
{
/* DMCUB_REGION3_TMR_AXI_SPACE values:
diff --git a/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn60.h b/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn60.h
index 238cba46d366..7e8bae49baee 100644
--- a/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn60.h
+++ b/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn60.h
@@ -124,7 +124,37 @@ struct dmub_srv;
DMUB_SR(DMCUB_REG_OUTBOX0_RDY) \
DMUB_SR(DMCUB_REG_OUTBOX0_MSG0) \
DMUB_SR(DMCUB_REG_OUTBOX0_RSP) \
- DMUB_SR(HOST_INTERRUPT_CSR)
+ DMUB_SR(HOST_INTERRUPT_CSR) \
+ DMUB_SR(DMCUB_EXT_INTERRUPT_CTXID) \
+ DMUB_SR(DMCUB_EXT_INTERRUPT_STATUS)
+
+#define DMUB_DCN60_IHC_REGS() \
+ DMUB_SR(DISP_INTERRUPT_STATUS) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE2) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE3) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE4) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE5) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE6) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE7) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE8) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE9) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE10) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE11) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE12) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE13) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE14) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE15) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE16) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE17) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE18) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE19) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE20) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE21) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE22) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE23) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE24) \
+ DMUB_SR(DISP_INTERRUPT_STATUS_CONTINUE25)
#define DMUB_DCN60_FIELDS() \
DMUB_SF(DMCUB_CNTL, DMCUB_ENABLE) \
@@ -170,7 +200,8 @@ struct dmub_srv;
DMUB_SF(HOST_INTERRUPT_CSR, HOST_REG_OUTBOX0_RDY_INT_ACK) \
DMUB_SF(HOST_INTERRUPT_CSR, HOST_REG_OUTBOX0_RDY_INT_STAT) \
DMUB_SF(HOST_INTERRUPT_CSR, HOST_REG_OUTBOX0_RDY_INT_EN) \
- DMUB_SF(DMCUB_CNTL, DMCUB_PWAIT_MODE_STATUS)
+ DMUB_SF(DMCUB_CNTL, DMCUB_PWAIT_MODE_STATUS) \
+ DMUB_SF(DMCUB_EXT_INTERRUPT_STATUS, DMCUB_EXT_INTERRUPT_ID)
#define DCN60_EXTERNAL_MMHUB_REGS() \
MMHUB_SR(MMMC_VM_FB_LOCATION_BASE) \
@@ -184,6 +215,7 @@ struct dmub_srv_dcn60_reg_offset {
#define DMUB_SR(reg) uint32_t reg;
#define MMHUB_SR(reg) uint32_t reg;
DMUB_DCN60_REGS()
+ DMUB_DCN60_IHC_REGS()
DMCUB_INTERNAL_REGS()
DCN60_EXTERNAL_MMHUB_REGS()
#undef MMHUB_SR
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* [PATCH 03/27] drm/amd/display: Add debug option to force DP link rate
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
2026-11-25 6:54 ` [PATCH 01/27] drm/amd/display: Avoid per-entry long division in __drm_lut32_to_dc_gamma Chenyu Chen
2026-11-25 6:54 ` [PATCH 02/27] drm/amd/display: Capture more diagnostic register state Chenyu Chen
@ 2026-11-25 6:54 ` Chenyu Chen
2026-11-25 6:54 ` [PATCH 04/27] drm/amd/display: Reject Replay activation on an inactive link Chenyu Chen
` (25 subsequent siblings)
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:54 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, Allen Pan, Charlene Liu,
Chenyu Chen
From: Allen Pan <Allen.Pan@amd.com>
[Why]
Link rate testing needs a way to override the max DP link rate that
VBIOS reports for the link encoder, including rates above it.
[How]
Add force_dp_link_rate to dc_debug_options. When set, the DCN4.2 link
encoder reports it as its max link rate instead of the rate VBIOS
reports. dp_get_max_link_cap() still lowers it to the sink's DPCD max
link rate and the cable ID and LTTPR caps, and link settings are
decided as before.
Cc: Charlene Liu <charlene.liu@amd.com>
Signed-off-by: Allen Pan <Allen.Pan@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
drivers/gpu/drm/amd/display/dc/dc.h | 1 +
.../display/dc/dio/dcn42/dcn42_dio_link_encoder.c | 12 +++++++++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index 58e443672411..75d1ede366c7 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -1269,6 +1269,7 @@ struct dc_debug_options {
bool enable_dp_dig_pixel_rate_div_policy;
bool using_dml21;
enum lttpr_mode lttpr_mode_override;
+ enum dc_link_rate force_dp_link_rate;
unsigned int dsc_delay_factor_wa_x1000;
unsigned int min_prefetch_in_strobe_ns;
bool disable_unbounded_requesting;
diff --git a/drivers/gpu/drm/amd/display/dc/dio/dcn42/dcn42_dio_link_encoder.c b/drivers/gpu/drm/amd/display/dc/dio/dcn42/dcn42_dio_link_encoder.c
index 3b11be9991c3..687df8cb4b60 100644
--- a/drivers/gpu/drm/amd/display/dc/dio/dcn42/dcn42_dio_link_encoder.c
+++ b/drivers/gpu/drm/amd/display/dc/dio/dcn42/dcn42_dio_link_encoder.c
@@ -64,6 +64,16 @@ bool dcn42_program_hpd_filter(struct link_encoder *enc, int delay_on_connect_in_
return true;
}
+/* DMs load debug options after link encoders are constructed */
+static void dcn42_link_encoder_get_max_link_cap(struct link_encoder *enc,
+ struct dc_link_settings *link_settings)
+{
+ dcn32_link_encoder_get_max_link_cap(enc, link_settings);
+
+ if (enc->ctx->dc->debug.force_dp_link_rate != LINK_RATE_UNKNOWN)
+ link_settings->link_rate = enc->ctx->dc->debug.force_dp_link_rate;
+}
+
static const struct link_encoder_funcs dcn42_link_enc_funcs = {
.read_state = link_enc2_read_state,
.validate_output_with_stream =
@@ -92,7 +102,7 @@ static const struct link_encoder_funcs dcn42_link_enc_funcs = {
.get_dig_frontend = dcn10_get_dig_frontend,
.get_dig_mode = dcn401_get_dig_mode,
.is_in_alt_mode = dcn32_link_encoder_is_in_alt_mode,
- .get_max_link_cap = dcn32_link_encoder_get_max_link_cap,
+ .get_max_link_cap = dcn42_link_encoder_get_max_link_cap,
.dpcstx_set_order_invert_18_bit = NULL,
.set_phy_source = NULL,
.dpcs_initialize_phy = NULL,
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* [PATCH 04/27] drm/amd/display: Reject Replay activation on an inactive link
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (2 preceding siblings ...)
2026-11-25 6:54 ` [PATCH 03/27] drm/amd/display: Add debug option to force DP link rate Chenyu Chen
@ 2026-11-25 6:54 ` Chenyu Chen
2026-11-25 6:54 ` [PATCH 05/27] drm/amd/display: Decouple PROGRAM_CURSOR_UPDATE_NOW from dc and pipe_ctx Chenyu Chen
` (24 subsequent siblings)
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:54 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, Harry VanZyllDeJong, Ian Chen,
Aric Cyr, Chenyu Chen
From: Harry VanZyllDeJong <hvanzyll@amd.com>
[Why]
Replay can attempt PHY power management on an untrained link with no
frontend connected to its backend. The resulting ALPM handshake can
stall firmware and block display recovery.
[How]
Reject Replay enable requests while the link is inactive without
blocking disable requests.
Cc: Ian Chen <ian.chen@amd.com>
Cc: Aric Cyr <aric.cyr@amd.com>
Signed-off-by: Harry VanZyllDeJong <hvanzyll@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
.../amd/display/dc/link/protocols/link_edp_panel_control.c | 6 ++++++
1 file changed, 6 insertions(+)
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 0e9b2b675eac..3f8063f6f06c 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
@@ -956,6 +956,12 @@ bool edp_set_replay_allow_active(struct dc_link *link, const bool *allow_active,
}
}
+ /* Replay drives the PHY/ALPM and hangs DMCUB if the link was never trained,
+ * e.g. on the GPU that does not own the panel after a mux switch.
+ */
+ if (allow_active && *allow_active && !link->link_status.link_active)
+ return false;
+
/* Activate or deactivate Replay */
if (allow_active && link->replay_settings.replay_allow_active != *allow_active) {
// TODO: Handle mux change case if force_static is set
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* [PATCH 05/27] drm/amd/display: Decouple PROGRAM_CURSOR_UPDATE_NOW from dc and pipe_ctx
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (3 preceding siblings ...)
2026-11-25 6:54 ` [PATCH 04/27] drm/amd/display: Reject Replay activation on an inactive link Chenyu Chen
@ 2026-11-25 6:54 ` Chenyu Chen
2026-11-25 6:54 ` [PATCH 06/27] drm/amd/display: Add DPMS-v2 init Chenyu Chen
` (23 subsequent siblings)
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:54 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, Piotr Maziarz, Alvin Lee,
Chenyu Chen
From: Piotr Maziarz <piotr.maziarz@amd.com>
[WHY]
PROGRAM_CURSOR_UPDATE_NOW carried dc and pipe_ctx, and its executor
read the OTG instance and the cursor offload state through them at run
time, against the BLS contract.
[HOW]
Carry the DMUB service handle and the OTG instance instead, filled by
the new hwss_add_program_cursor_update_now(). The executor passes them
through the program_cursor_offload_now hook to
dc_dmub_srv_program_cursor_now(), which checks the service itself for
cursor offload. The non-BLS path in commit_planes_for_stream uses the
same hook signature.
Cc: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Piotr Maziarz <piotr.maziarz@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
drivers/gpu/drm/amd/display/dc/core/dc.c | 3 +-
.../drm/amd/display/dc/core/dc_hw_sequencer.c | 28 +++++++++++++------
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 11 +++-----
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 8 +++---
.../amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 4 +--
.../amd/display/dc/hwss/dcn35/dcn35_hwseq.h | 2 +-
.../drm/amd/display/dc/hwss/hw_sequencer.h | 10 +++++--
7 files changed, 40 insertions(+), 26 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 92cb123e459b..584eb3e0f4c6 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -5435,7 +5435,8 @@ static void commit_planes_for_stream(struct dc *dc,
continue;
if (dc->hwss.program_cursor_offload_now)
- dc->hwss.program_cursor_offload_now(dc, pipe_ctx);
+ dc->hwss.program_cursor_offload_now(dc->ctx->dmub_srv,
+ pipe_ctx->stream_res.tg->inst);
if (pipe_ctx->stream_res.tg->funcs->program_manual_trigger)
pipe_ctx->stream_res.tg->funcs->program_manual_trigger(pipe_ctx->stream_res.tg);
}
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c
index 241cbe19056d..079a9ee8c5f5 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c
@@ -1715,12 +1715,9 @@ void hwss_build_fast_sequence(struct dc *dc,
current_mpc_pipe->stream && current_mpc_pipe->plane_state &&
current_mpc_pipe->plane_state->update_bits.addr_update &&
!current_mpc_pipe->plane_state->skip_manual_trigger) {
- if (dc->hwss.program_cursor_offload_now) {
- block_sequence[*num_steps].params.program_cursor_update_now_params.dc = dc;
- block_sequence[*num_steps].params.program_cursor_update_now_params.pipe_ctx = current_mpc_pipe;
- block_sequence[*num_steps].func = PROGRAM_CURSOR_UPDATE_NOW;
- (*num_steps)++;
- }
+ if (dc->hwss.program_cursor_offload_now)
+ hwss_add_program_cursor_update_now(&seq_state, dc->ctx->dmub_srv,
+ current_mpc_pipe->stream_res.tg->inst);
hwss_add_optc_program_manual_trigger(&seq_state, current_mpc_pipe->stream_res.tg);
}
@@ -1849,8 +1846,8 @@ void hwss_execute_sequence(struct dc *dc,
break;
case PROGRAM_CURSOR_UPDATE_NOW:
dc->hwss.program_cursor_offload_now(
- params->program_cursor_update_now_params.dc,
- params->program_cursor_update_now_params.pipe_ctx);
+ params->program_cursor_update_now_params.dmub_srv,
+ params->program_cursor_update_now_params.otg_inst);
break;
case HUBP_WAIT_PIPE_READ_START:
params->hubp_wait_pipe_read_start_params.hubp->funcs->hubp_wait_pipe_read_start(
@@ -6439,6 +6436,21 @@ void hwss_add_abort_cursor_offload_update(struct block_sequence_state *seq_state
}
}
+void hwss_add_program_cursor_update_now(struct block_sequence_state *seq_state,
+ struct dc_dmub_srv *dmub_srv,
+ uint32_t otg_inst)
+{
+ struct program_cursor_update_now_params *p;
+
+ if (*seq_state->num_steps < MAX_HWSS_BLOCK_SEQUENCE_SIZE) {
+ seq_state->steps[*seq_state->num_steps].func = PROGRAM_CURSOR_UPDATE_NOW;
+ p = &seq_state->steps[*seq_state->num_steps].params.program_cursor_update_now_params;
+ p->dmub_srv = dmub_srv;
+ p->otg_inst = otg_inst;
+ (*seq_state->num_steps)++;
+ }
+}
+
void hwss_add_stream_enc_update_hdmi_info_packets(struct block_sequence_state *seq_state,
struct pipe_ctx *pipe_ctx)
{
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 323e8bec23dc..220e3fc34f3f 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
+++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
@@ -1328,15 +1328,12 @@ void dc_dmub_srv_control_cursor_offload(struct dc *dc, struct dc_state *context,
enable ? DM_DMUB_WAIT_TYPE_NO_WAIT : DM_DMUB_WAIT_TYPE_WAIT);
}
-void dc_dmub_srv_program_cursor_now(struct dc *dc, const struct pipe_ctx *pipe)
+void dc_dmub_srv_program_cursor_now(struct dc_dmub_srv *dc_dmub_srv, uint32_t otg_inst)
{
struct dmub_rb_cmd_cursor_offload_stream_cntl *cntl;
union dmub_rb_cmd cmd;
- if (!dc_dmub_srv_is_cursor_offload_enabled(dc))
- return;
-
- if (!pipe || !pipe->stream || !pipe->stream_res.tg)
+ if (!dc_dmub_srv || !dc_dmub_srv->cursor_offload_enabled)
return;
memset(&cmd, 0, sizeof(cmd));
@@ -1345,9 +1342,9 @@ void dc_dmub_srv_program_cursor_now(struct dc *dc, const struct pipe_ctx *pipe)
cntl->header.type = DMUB_CMD__CURSOR_OFFLOAD;
cntl->header.sub_type = DMUB_CMD__CURSOR_OFFLOAD_STREAM_PROGRAM;
cntl->header.payload_bytes = sizeof(cntl->data);
- cntl->data.otg_inst = pipe->stream_res.tg->inst;
+ cntl->data.otg_inst = otg_inst;
- dc_wake_and_execute_dmub_cmd(dc->ctx, &cmd, DM_DMUB_WAIT_TYPE_NO_WAIT);
+ dc_wake_and_execute_dmub_cmd(dc_dmub_srv->ctx, &cmd, DM_DMUB_WAIT_TYPE_NO_WAIT);
}
bool dc_dmub_srv_is_hw_pwr_up(struct dc_dmub_srv *dc_dmub_srv, bool wait)
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 b3d6279cbc15..6c1e1b8f6d9b 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h
@@ -397,12 +397,12 @@ void dc_dmub_srv_control_cursor_offload(struct dc *dc, struct dc_state *context,
const struct dc_stream_state *stream, bool enable);
/**
- * dc_dmub_srv_program_cursor_now() - Requests immediate cursor programming for a given pipe.
+ * dc_dmub_srv_program_cursor_now() - Requests immediate cursor programming for a given OTG.
*
- * @dc: pointer to DC object
- * @pipe: top-most pipe for a stream.
+ * @dc_dmub_srv: DMUB service handle
+ * @otg_inst: OTG instance of the stream
*/
-void dc_dmub_srv_program_cursor_now(struct dc *dc, const struct pipe_ctx *pipe);
+void dc_dmub_srv_program_cursor_now(struct dc_dmub_srv *dc_dmub_srv, uint32_t otg_inst);
/**
* dc_dmub_srv_is_cursor_offload_enabled() - Checks if cursor offload is supported.
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 aa047b5b4939..564ffd61f391 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
@@ -1806,9 +1806,9 @@ void dcn35_notify_cursor_offload_drr_update(struct dc *dc, struct dc_state *cont
dc_dmub_srv_control_cursor_offload(dc, context, stream, true);
}
-void dcn35_program_cursor_offload_now(struct dc *dc, const struct pipe_ctx *pipe)
+void dcn35_program_cursor_offload_now(struct dc_dmub_srv *dc_dmub_srv, uint32_t otg_inst)
{
- dc_dmub_srv_program_cursor_now(dc, pipe);
+ dc_dmub_srv_program_cursor_now(dc_dmub_srv, otg_inst);
}
static void disable_link_output_symclk_on_tx_off(struct dc_link *link, enum dp_link_encoding link_encoding)
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 0ae2f44cfb9f..2bc210d5fcc4 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
@@ -117,7 +117,7 @@ void dcn35_update_cursor_offload_pipe(struct dmub_srv *dmub, uint32_t stream_idx
uint8_t pipe_idx, const struct dpp *dpp, const struct hubp *hubp);
void dcn35_notify_cursor_offload_drr_update(struct dc *dc, struct dc_state *context,
const struct dc_stream_state *stream);
-void dcn35_program_cursor_offload_now(struct dc *dc, const struct pipe_ctx *pipe);
+void dcn35_program_cursor_offload_now(struct dc_dmub_srv *dc_dmub_srv, uint32_t otg_inst);
void dcn35_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/hw_sequencer.h b/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h
index 6e009ba37ff9..4769c71f05fb 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h
+++ b/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h
@@ -597,8 +597,8 @@ struct control_cm_hist_params {
};
struct program_cursor_update_now_params {
- struct dc *dc;
- struct pipe_ctx *pipe_ctx;
+ struct dc_dmub_srv *dmub_srv;
+ uint32_t otg_inst;
};
struct hubp_wait_pipe_read_start_params {
@@ -2050,7 +2050,7 @@ struct hw_sequencer_funcs {
const struct hubp *hubp);
void (*notify_cursor_offload_drr_update)(struct dc *dc, struct dc_state *context,
const struct dc_stream_state *stream);
- void (*program_cursor_offload_now)(struct dc *dc, const struct pipe_ctx *pipe);
+ void (*program_cursor_offload_now)(struct dc_dmub_srv *dc_dmub_srv, uint32_t otg_inst);
/* Colour Related */
void (*program_gamut_remap)(struct program_gamut_remap_params *params);
@@ -3226,6 +3226,10 @@ void hwss_add_commit_cursor_offload_update(struct block_sequence_state *seq_stat
struct dc *dc,
struct pipe_ctx *pipe_ctx);
+void hwss_add_program_cursor_update_now(struct block_sequence_state *seq_state,
+ struct dc_dmub_srv *dmub_srv,
+ uint32_t otg_inst);
+
void hwss_add_stream_enc_update_hdmi_info_packets(struct block_sequence_state *seq_state,
struct pipe_ctx *pipe_ctx);
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* [PATCH 06/27] drm/amd/display: Add DPMS-v2 init
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (4 preceding siblings ...)
2026-11-25 6:54 ` [PATCH 05/27] drm/amd/display: Decouple PROGRAM_CURSOR_UPDATE_NOW from dc and pipe_ctx Chenyu Chen
@ 2026-11-25 6:54 ` Chenyu Chen
2026-11-25 6:54 ` [PATCH 07/27] drm/amd/display: Expose per-CRTC pstate method in connector debugfs Chenyu Chen
` (22 subsequent siblings)
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:54 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, Dominik Kowalski, Wenjing Liu,
Chenyu Chen
From: Dominik Kowalski <dominik.kowalski@amd.com>
[Why & How]
Add allocation, deallocation and initialization of DPMS-v2 context.
Cc: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Dominik Kowalski <dominik.kowalski@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
.../drm/amd/display/dc/link/link_dpms_v2.c | 25 ++++++++-
.../drm/amd/display/dc/link/link_factory.c | 55 ++++++++++++++++++-
2 files changed, 76 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/link/link_dpms_v2.c b/drivers/gpu/drm/amd/display/dc/link/link_dpms_v2.c
index 43c3f7dfa343..14f5bf4f53b1 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_dpms_v2.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_dpms_v2.c
@@ -25,10 +25,28 @@
#include "dc/link/link_dpms_v2.h"
+#include "dc/inc/core_types.h"
+#include "dc/inc/link_tx.h"
+
+// TODO: This should be moved to dc_update_state_prepare
+static void link_dpms_ctx_init(struct link_dpms_ctx *dpms_ctx,
+ struct pipe_ctx *pipe_ctx)
+{
+ dpms_ctx->link_config = pipe_ctx->link_config;
+
+ // TODO: Implement
+ dpms_ctx->stream_descriptor = (struct link_dpms_stream_descriptor){
+ .dummy = 0,
+ };
+}
+
enum dc_status link_set_dpms_off_v2(struct pipe_ctx *pipe_ctx)
{
+ struct dc_link *link = pipe_ctx->stream->link;
+
+ link_dpms_ctx_init(link->dpms_ctx, pipe_ctx);
+
// TODO: Implement
- (void)pipe_ctx;
ASSERT(false);
return DC_ERROR_UNEXPECTED;
}
@@ -36,9 +54,12 @@ enum dc_status link_set_dpms_off_v2(struct pipe_ctx *pipe_ctx)
enum dc_status link_set_dpms_on_v2(struct dc_state *state,
struct pipe_ctx *pipe_ctx)
{
+ struct dc_link *link = pipe_ctx->stream->link;
+
+ link_dpms_ctx_init(link->dpms_ctx, pipe_ctx);
+
// TODO: Implement
(void)state;
- (void)pipe_ctx;
ASSERT(false);
return DC_ERROR_UNEXPECTED;
}
diff --git a/drivers/gpu/drm/amd/display/dc/link/link_factory.c b/drivers/gpu/drm/amd/display/dc/link/link_factory.c
index 919f67b76f91..1e32f96348b7 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_factory.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_factory.c
@@ -416,6 +416,29 @@ static bool encoder_is_external_dp(
}
}
+static void link_destroy_dpms_ctx(struct link_dpms_ctx *ctx)
+{
+ if (!ctx)
+ return;
+
+ kfree(ctx);
+}
+
+// Do not dereference the pointer, as it is mid-construction
+static struct link_dpms_ctx *link_create_dpms_ctx(struct dc_link *link)
+{
+ struct link_dpms_ctx *ctx = kzalloc_obj(*ctx);
+
+ if (!ctx)
+ return NULL;
+
+ *ctx = (struct link_dpms_ctx){
+ .link = link,
+ };
+
+ return ctx;
+}
+
static void link_destruct(struct dc_link *link)
{
unsigned int i;
@@ -445,6 +468,9 @@ static void link_destruct(struct dc_link *link)
for (i = 0; i < link->sink_count; ++i)
dc_sink_release(link->remote_sinks[i]);
+
+ if (link->dpms_ctx)
+ link_destroy_dpms_ctx(link->dpms_ctx);
}
static enum channel_id get_ddc_line(struct dc_link *link)
@@ -896,12 +922,22 @@ static bool construct_phy(struct dc_link *link,
}
}
+ if (init_params->dc->config.enable_dpms_v2) {
+ link->dpms_ctx = link_create_dpms_ctx(link);
+ if (!link->dpms_ctx) {
+ DC_ERROR("Failed to create dpms_ctx!\n");
+ goto fail;
+ }
+ }
+
link->psr_settings.psr_vtotal_control_support = false;
link->psr_settings.psr_version = DC_PSR_VERSION_UNSUPPORTED;
link->replay_settings.config.replay_version = DC_REPLAY_VERSION_UNSUPPORTED;
DC_LOG_DC("BIOS object table - %s finished successfully.\n", __func__);
return true;
+
+fail:
hpo_enc_create_fail:
device_tag_fail:
link_enc_create_fail:
@@ -914,6 +950,8 @@ static bool construct_phy(struct dc_link *link,
link->panel_cntl->funcs->destroy(&link->panel_cntl);
if (link->link_enc)
link->link_enc->funcs->destroy(&link->link_enc);
+ if (link->dpms_ctx)
+ link_destroy_dpms_ctx(link->dpms_ctx);
DC_LOG_DC("BIOS object table - %s failed.\n", __func__);
return false;
@@ -965,7 +1003,15 @@ static bool construct_dpia(struct dc_link *link,
link->ddc = link_create_ddc_service(&ddc_service_init_data);
if (!link->ddc) {
DC_ERROR("Failed to create ddc_service!\n");
- goto ddc_create_fail;
+ goto fail;
+ }
+
+ if (init_params->dc->config.enable_dpms_v2) {
+ link->dpms_ctx = link_create_dpms_ctx(link);
+ if (!link->dpms_ctx) {
+ DC_ERROR("Failed to create dpms_ctx!\n");
+ goto fail;
+ }
}
/* Set dpia port index : 0 to number of dpia ports */
@@ -982,7 +1028,12 @@ static bool construct_dpia(struct dc_link *link,
return true;
-ddc_create_fail:
+fail:
+ if (link->ddc)
+ link_destroy_ddc_service(&link->ddc);
+ if (link->dpms_ctx)
+ link_destroy_dpms_ctx(link->dpms_ctx);
+
return false;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* [PATCH 07/27] drm/amd/display: Expose per-CRTC pstate method in connector debugfs
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (5 preceding siblings ...)
2026-11-25 6:54 ` [PATCH 06/27] drm/amd/display: Add DPMS-v2 init Chenyu Chen
@ 2026-11-25 6:54 ` Chenyu Chen
2026-11-25 6:54 ` [PATCH 08/27] drm/amd/display: Add DPMS-v2 tx init Chenyu Chen
` (21 subsequent siblings)
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:54 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, George Zhang, Chenyu Chen
From: Ivan Lipski <ivan.lipski@amd.com>
[Why&How]
Other than visualconfirm, which is not always accurate, there is no
reliable way to get the currently used pstate switch method in runtime.
Expand debugfs to output the current pstate switch method per connector.
Resolve the connector's current CRTC stream and report the matching pipe's
p_state_type, or P_STATE_UNKNOWN if inactive.
Cc: George Zhang <george.zhang@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
.../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 34 +++++++++++++++++++
1 file changed, 34 insertions(+)
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 68356cb8e4de..dc7d5c19eb6c 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
@@ -3739,6 +3739,37 @@ DEFINE_SHOW_ATTRIBUTE(cacp_ace_curve_area);
DEFINE_SHOW_ATTRIBUTE(ips_status);
DEFINE_SHOW_ATTRIBUTE(ips_residency);
+/* Reports the pstate method of this connector's active CRTC. */
+static int pstate_switch_method_show(struct seq_file *m, void *unused)
+{
+ struct amdgpu_dm_connector *connector = to_amdgpu_dm_connector(m->private);
+ struct amdgpu_device *adev = drm_to_adev(connector->base.dev);
+ struct dm_crtc_state *crtc_state;
+ struct dc_state *context;
+ unsigned int i;
+ int method = P_STATE_UNKNOWN;
+
+ if (connector->base.state && connector->base.state->crtc) {
+ crtc_state = to_dm_crtc_state(connector->base.state->crtc->state);
+ mutex_lock(&adev->dm.dc_lock);
+ context = adev->dm.dc->current_state;
+ for (i = 0; i < adev->dm.dc->res_pool->pipe_count; i++) {
+ struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
+
+ if (pipe->stream == crtc_state->stream && pipe->plane_state) {
+ method = pipe->p_state_type;
+ break;
+ }
+ }
+ mutex_unlock(&adev->dm.dc_lock);
+ }
+
+ seq_printf(m, "%d\n", method);
+
+ return 0;
+}
+DEFINE_SHOW_ATTRIBUTE(pstate_switch_method);
+
static const struct {
char *name;
const struct file_operations *fops;
@@ -3907,6 +3938,9 @@ void connector_debugfs_init(struct amdgpu_dm_connector *connector)
int i;
struct dentry *dir = connector->base.debugfs_entry;
+ debugfs_create_file("pstate_switch_method", 0444, dir, connector,
+ &pstate_switch_method_fops);
+
if (connector->base.connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
connector->base.connector_type == DRM_MODE_CONNECTOR_eDP) {
for (i = 0; i < ARRAY_SIZE(dp_debugfs_entries); i++) {
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* [PATCH 08/27] drm/amd/display: Add DPMS-v2 tx init
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (6 preceding siblings ...)
2026-11-25 6:54 ` [PATCH 07/27] drm/amd/display: Expose per-CRTC pstate method in connector debugfs Chenyu Chen
@ 2026-11-25 6:54 ` Chenyu Chen
2026-11-25 6:54 ` [PATCH 09/27] drm/amd/display: Derive DCN6 DSCCLK range from DISPCLK Chenyu Chen
` (20 subsequent siblings)
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:54 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, Dominik Kowalski, Wenjing Liu,
Chenyu Chen
From: Dominik Kowalski <dominik.kowalski@amd.com>
[Why & How]
Add allocation, deallocation and initialization of DPMS-v2 tx structs.
When enable_dpms_v2 is set, link_factory creates a v2 tx; otherwise it
creates a v1 tx, so every link gets a tx. The tx is stored in a new
tx_inst field of dc_link and passed to the dpms_ctx. Link construction
fails if the tx cannot be created.
Cc: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Dominik Kowalski <dominik.kowalski@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
drivers/gpu/drm/amd/display/dc/dc.h | 1 +
drivers/gpu/drm/amd/display/dc/link/Makefile | 11 +++
.../drm/amd/display/dc/link/link_factory.c | 39 ++++++++-
.../drm/amd/display/dc/link/tx/link_tx_v1.c | 55 ++++++++++++
.../drm/amd/display/dc/link/tx/link_tx_v1.h | 34 ++++++++
.../drm/amd/display/dc/link/tx/link_tx_v2.c | 83 +++++++++++++++++++
.../drm/amd/display/dc/link/tx/link_tx_v2.h | 38 +++++++++
7 files changed, 259 insertions(+), 2 deletions(-)
create mode 100644 drivers/gpu/drm/amd/display/dc/link/tx/link_tx_v1.c
create mode 100644 drivers/gpu/drm/amd/display/dc/link/tx/link_tx_v1.h
create mode 100644 drivers/gpu/drm/amd/display/dc/link/tx/link_tx_v2.c
create mode 100644 drivers/gpu/drm/amd/display/dc/link/tx/link_tx_v2.h
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index 75d1ede366c7..69d6eed1df41 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -1935,6 +1935,7 @@ struct dc_scratch_space {
struct ddc_service *ddc;
struct link_dpms_ctx *dpms_ctx;
+ struct link_tx *tx_inst;
enum dp_panel_mode panel_mode;
bool panel_mode_initialized;
diff --git a/drivers/gpu/drm/amd/display/dc/link/Makefile b/drivers/gpu/drm/amd/display/dc/link/Makefile
index ea08f1b1e60e..2d9bbf33ed97 100644
--- a/drivers/gpu/drm/amd/display/dc/link/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/link/Makefile
@@ -70,3 +70,14 @@ AMD_DAL_LINK_PROTOCOLS = $(addprefix $(AMDDALPATH)/dc/link/protocols/, \
$(LINK_PROTOCOLS))
AMD_DISPLAY_FILES += $(AMD_DAL_LINK_PROTOCOLS)
+
+###############################################################################
+# tx
+###############################################################################
+LINK_TX = link_tx_v1.o
+LINK_TX += link_tx_v2.o
+
+AMD_DAL_LINK_TX = $(addprefix $(AMDDALPATH)/dc/link/tx/, \
+$(LINK_TX))
+
+AMD_DISPLAY_FILES += $(AMD_DAL_LINK_TX)
diff --git a/drivers/gpu/drm/amd/display/dc/link/link_factory.c b/drivers/gpu/drm/amd/display/dc/link/link_factory.c
index 1e32f96348b7..e5a5bc70e7d3 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_factory.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_factory.c
@@ -47,6 +47,9 @@
#include "protocols/link_hpd.h"
#include "gpio_service_interface.h"
#include "atomfirmware.h"
+#include "dc/inc/link_tx.h"
+#include "dc/link/tx/link_tx_v1.h"
+#include "dc/link/tx/link_tx_v2.h"
#define DC_LOGGER \
dc_ctx->logger
@@ -434,11 +437,18 @@ static struct link_dpms_ctx *link_create_dpms_ctx(struct dc_link *link)
*ctx = (struct link_dpms_ctx){
.link = link,
+ .tx = link->tx_inst,
};
return ctx;
}
+static void link_destroy_tx(struct link_tx *tx)
+{
+ if (tx && tx->funcs && tx->funcs->destroy)
+ tx->funcs->destroy(tx);
+}
+
static void link_destruct(struct dc_link *link)
{
unsigned int i;
@@ -471,6 +481,9 @@ static void link_destruct(struct dc_link *link)
if (link->dpms_ctx)
link_destroy_dpms_ctx(link->dpms_ctx);
+
+ if (link->tx_inst)
+ link_destroy_tx(link->tx_inst);
}
static enum channel_id get_ddc_line(struct dc_link *link)
@@ -922,7 +935,11 @@ static bool construct_phy(struct dc_link *link,
}
}
- if (init_params->dc->config.enable_dpms_v2) {
+ if (!init_params->dc->config.enable_dpms_v2) {
+ link->tx_inst = link_tx_create_v1(link);
+ } else {
+ link->tx_inst = link_tx_create_v2(link);
+
link->dpms_ctx = link_create_dpms_ctx(link);
if (!link->dpms_ctx) {
DC_ERROR("Failed to create dpms_ctx!\n");
@@ -930,6 +947,11 @@ static bool construct_phy(struct dc_link *link,
}
}
+ if (!link->tx_inst) {
+ DC_ERROR("Failed to create tx!\n");
+ goto fail;
+ }
+
link->psr_settings.psr_vtotal_control_support = false;
link->psr_settings.psr_version = DC_PSR_VERSION_UNSUPPORTED;
link->replay_settings.config.replay_version = DC_REPLAY_VERSION_UNSUPPORTED;
@@ -952,6 +974,8 @@ static bool construct_phy(struct dc_link *link,
link->link_enc->funcs->destroy(&link->link_enc);
if (link->dpms_ctx)
link_destroy_dpms_ctx(link->dpms_ctx);
+ if (link->tx_inst)
+ link_destroy_tx(link->tx_inst);
DC_LOG_DC("BIOS object table - %s failed.\n", __func__);
return false;
@@ -1006,7 +1030,11 @@ static bool construct_dpia(struct dc_link *link,
goto fail;
}
- if (init_params->dc->config.enable_dpms_v2) {
+ if (!init_params->dc->config.enable_dpms_v2) {
+ link->tx_inst = link_tx_create_v1(link);
+ } else {
+ link->tx_inst = link_tx_create_v2(link);
+
link->dpms_ctx = link_create_dpms_ctx(link);
if (!link->dpms_ctx) {
DC_ERROR("Failed to create dpms_ctx!\n");
@@ -1014,6 +1042,11 @@ static bool construct_dpia(struct dc_link *link,
}
}
+ if (!link->tx_inst) {
+ DC_ERROR("Failed to create tx!\n");
+ goto fail;
+ }
+
/* Set dpia port index : 0 to number of dpia ports */
link->ddc_hw_inst = (uint8_t)init_params->connector_index;
@@ -1033,6 +1066,8 @@ static bool construct_dpia(struct dc_link *link,
link_destroy_ddc_service(&link->ddc);
if (link->dpms_ctx)
link_destroy_dpms_ctx(link->dpms_ctx);
+ if (link->tx_inst)
+ link_destroy_tx(link->tx_inst);
return false;
}
diff --git a/drivers/gpu/drm/amd/display/dc/link/tx/link_tx_v1.c b/drivers/gpu/drm/amd/display/dc/link/tx/link_tx_v1.c
new file mode 100644
index 000000000000..68312ab50711
--- /dev/null
+++ b/drivers/gpu/drm/amd/display/dc/link/tx/link_tx_v1.c
@@ -0,0 +1,55 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright 2026 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.
+ *
+ * Authors: AMD
+ *
+ */
+
+#include "dc/link/tx/link_tx_v1.h"
+
+static void link_tx_destroy_v1(struct link_tx *tx)
+{
+ if (!tx)
+ return;
+
+ kfree(tx);
+}
+
+static const struct link_tx_funcs link_tx_funcs_v1 = {
+ .destroy = link_tx_destroy_v1,
+};
+
+struct link_tx *link_tx_create_v1(struct dc_link *link)
+{
+ struct link_tx *tx = kzalloc_obj(*tx);
+
+ if (!tx)
+ return NULL;
+
+ *tx = (struct link_tx){
+ .funcs = &link_tx_funcs_v1,
+ .link = link,
+ .ctx = NULL,
+ };
+
+ return tx;
+}
diff --git a/drivers/gpu/drm/amd/display/dc/link/tx/link_tx_v1.h b/drivers/gpu/drm/amd/display/dc/link/tx/link_tx_v1.h
new file mode 100644
index 000000000000..11211f3955cf
--- /dev/null
+++ b/drivers/gpu/drm/amd/display/dc/link/tx/link_tx_v1.h
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright 2026 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.
+ *
+ * Authors: AMD
+ *
+ */
+
+#ifndef LINK_TX_V1_H
+#define LINK_TX_V1_H
+
+#include "dc/inc/link_tx.h"
+
+struct link_tx *link_tx_create_v1(struct dc_link *link);
+
+#endif
diff --git a/drivers/gpu/drm/amd/display/dc/link/tx/link_tx_v2.c b/drivers/gpu/drm/amd/display/dc/link/tx/link_tx_v2.c
new file mode 100644
index 000000000000..b42704453f89
--- /dev/null
+++ b/drivers/gpu/drm/amd/display/dc/link/tx/link_tx_v2.c
@@ -0,0 +1,83 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright 2026 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.
+ *
+ * Authors: AMD
+ *
+ */
+
+#include "dc/link/tx/link_tx_v2.h"
+
+static void link_tx_v2_ctx_destroy(struct link_tx_v2_ctx *ctx)
+{
+ if (!ctx)
+ return;
+
+ kfree(ctx);
+}
+
+static struct link_tx_v2_ctx *link_tx_v2_ctx_create(void)
+{
+ struct link_tx_v2_ctx *ctx = kzalloc_obj(*ctx);
+
+ if (!ctx)
+ return NULL;
+
+ *ctx = (struct link_tx_v2_ctx){
+ .dummy = 0,
+ };
+
+ return ctx;
+}
+
+static void link_tx_destroy_v2(struct link_tx *tx)
+{
+ if (!tx)
+ return;
+
+ link_tx_v2_ctx_destroy(tx->ctx);
+ kfree(tx);
+}
+
+static const struct link_tx_funcs link_tx_funcs_v2 = {
+ .destroy = link_tx_destroy_v2,
+};
+
+struct link_tx *link_tx_create_v2(struct dc_link *link)
+{
+ struct link_tx *tx = kzalloc_obj(*tx);
+
+ if (!tx)
+ return NULL;
+
+ *tx = (struct link_tx){
+ .funcs = &link_tx_funcs_v2,
+ .link = link,
+ .ctx = link_tx_v2_ctx_create(),
+ };
+
+ if (!tx->ctx) {
+ link_tx_destroy_v2(tx);
+ return NULL;
+ }
+
+ return tx;
+}
diff --git a/drivers/gpu/drm/amd/display/dc/link/tx/link_tx_v2.h b/drivers/gpu/drm/amd/display/dc/link/tx/link_tx_v2.h
new file mode 100644
index 000000000000..151a6173b2a7
--- /dev/null
+++ b/drivers/gpu/drm/amd/display/dc/link/tx/link_tx_v2.h
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright 2026 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.
+ *
+ * Authors: AMD
+ *
+ */
+
+#ifndef LINK_TX_V2_H
+#define LINK_TX_V2_H
+
+#include "dc/inc/link_tx.h"
+
+struct link_tx_v2_ctx {
+ int dummy;
+};
+
+struct link_tx *link_tx_create_v2(struct dc_link *link);
+
+#endif
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* [PATCH 09/27] drm/amd/display: Derive DCN6 DSCCLK range from DISPCLK
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (7 preceding siblings ...)
2026-11-25 6:54 ` [PATCH 08/27] drm/amd/display: Add DPMS-v2 tx init Chenyu Chen
@ 2026-11-25 6:54 ` Chenyu Chen
2026-11-25 6:54 ` [PATCH 10/27] drm/amd/display: Carry the stream and plane update bits in update_flags Chenyu Chen
` (19 subsequent siblings)
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:54 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, Dillon Varone, Chenyu Chen
From: Ivan Lipski <ivan.lipski@amd.com>
[Why&How]
DSCCLK limit should be derived from the real DISPCLK instead of static
soc_bb values.
Set the min to 0 and the max to max_dispclk / 6.
Cc: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
.../dcn60/dcn60_soc_and_ip_translator.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/dcn60/dcn60_soc_and_ip_translator.c b/drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/dcn60/dcn60_soc_and_ip_translator.c
index f33e818d1b1e..9c92c5bf7a0f 100644
--- a/drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/dcn60/dcn60_soc_and_ip_translator.c
+++ b/drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/dcn60/dcn60_soc_and_ip_translator.c
@@ -129,6 +129,20 @@ static void dcn60_update_soc_bb_with_values_from_software_policy(struct dml2_soc
dc->bb_overrides.sr_lp_enter_plus_exit_time_ns / 1000.0;
}
+/* Derive DSCCLK range from the final dispclk table. */
+static void dcn60_update_soc_bb_dscclk_from_dispclk(struct dml2_soc_bb *soc_bb)
+{
+ const struct dml2_clk_table *dispclk = &soc_bb->clk_table.dispclk;
+
+ if (dispclk->num_clk_values == 0)
+ return;
+
+ soc_bb->clk_table.dscclk.clk_values_khz[0] = 0;
+ soc_bb->clk_table.dscclk.clk_values_khz[1] =
+ dispclk->clk_values_khz[dispclk->num_clk_values - 1] / 6;
+ soc_bb->clk_table.dscclk.num_clk_values = 2;
+}
+
static void apply_soc_bb_updates(struct dml2_soc_bb *soc_bb, const struct dc *dc, const struct dml2_configuration_options *config)
{
/* Individual modification can be overwritten even if it was obtained by a previous function.
@@ -140,6 +154,7 @@ static void apply_soc_bb_updates(struct dml2_soc_bb *soc_bb, const struct dc *dc
dcn401_update_soc_bb_with_values_from_clk_mgr(soc_bb, dc, config);
dcn401_update_soc_bb_with_values_from_vbios(soc_bb, dc);
dcn60_update_soc_bb_with_values_from_software_policy(soc_bb, dc);
+ dcn60_update_soc_bb_dscclk_from_dispclk(soc_bb);
}
static void dcn60_get_soc_bb(struct dml2_soc_bb *soc_bb, const struct dc *dc, const struct dml2_configuration_options *config)
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* [PATCH 10/27] drm/amd/display: Carry the stream and plane update bits in update_flags
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (8 preceding siblings ...)
2026-11-25 6:54 ` [PATCH 09/27] drm/amd/display: Derive DCN6 DSCCLK range from DISPCLK Chenyu Chen
@ 2026-11-25 6:54 ` Chenyu Chen
2026-11-25 6:55 ` [PATCH 11/27] drm/amd/display: Add the vsync flip to the DC2 seamless update Chenyu Chen
` (18 subsequent siblings)
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:54 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, Tony Cheng, Jun Lei,
Chenyu Chen
From: Tony Cheng <tony.cheng@amd.com>
[Why]
A BLS builder should read what dc_core changed from the update flags
instead of comparing the current and new states itself.
[How]
dc_state_compute_update_flags copies the update flags of each stream
into streams[], and the update bits of the plane on each pipe into the
plane field of its pipe flags. No builder reads them yet.
Cc: Jun Lei <jun.lei@amd.com>
Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
drivers/gpu/drm/amd/display/dc/core/dc_state.c | 4 ++++
drivers/gpu/drm/amd/display/dc/dc_state_priv.h | 8 +++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_state.c b/drivers/gpu/drm/amd/display/dc/core/dc_state.c
index 961c3c1ea51f..7eadf802c3e9 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_state.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_state.c
@@ -1174,6 +1174,8 @@ static void pipe_flags(const struct pipe_ctx *pipe,
pipe->plane_res.hubp && pipe->plane_res.dpp &&
pipe->stream_res.opp;
flags->det_size = pipe->hubp_regs.det_size;
+ if (pipe->plane_state)
+ flags->plane = pipe->plane_state->update_bits;
}
enum dc_status dc_state_compute_update_flags(const struct dc_state *cur_state,
@@ -1191,5 +1193,7 @@ enum dc_status dc_state_compute_update_flags(const struct dc_state *cur_state,
pipe_flags(&target_state->res_ctx.pipe_ctx[i],
&out_flags->new_pipes[i]);
}
+ for (i = 0; i < target_state->stream_count && i < MAX_STREAMS; i++)
+ out_flags->streams[i] = target_state->streams[i]->update_flags;
return DC_OK;
}
diff --git a/drivers/gpu/drm/amd/display/dc/dc_state_priv.h b/drivers/gpu/drm/amd/display/dc/dc_state_priv.h
index 0415e45d438e..c73c08989bd9 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_state_priv.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_state_priv.h
@@ -136,12 +136,18 @@ struct dc_state_pipe_flags {
bool has_plane;
/* The DET size from hubp_regs. */
uint32_t det_size;
+ /* What dc_core changed on the plane of the pipe. */
+ struct pipe_update_bits plane;
};
-/* The facts of pipe i in the current and in the target state. */
+/*
+ * The facts of pipe i in the current and in the target state, and what
+ * dc_core changed on stream i of the target state.
+ */
struct dc_state_update_flags {
struct dc_state_pipe_flags cur_pipes[MAX_PIPES];
struct dc_state_pipe_flags new_pipes[MAX_PIPES];
+ union stream_update_flags streams[MAX_STREAMS];
};
/* Pure: reads both states and writes only out_flags. */
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* [PATCH 11/27] drm/amd/display: Add the vsync flip to the DC2 seamless update
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (9 preceding siblings ...)
2026-11-25 6:54 ` [PATCH 10/27] drm/amd/display: Carry the stream and plane update bits in update_flags Chenyu Chen
@ 2026-11-25 6:55 ` Chenyu Chen
2026-11-25 6:55 ` [PATCH 12/27] drm/amd/display: Preserve bandwidth floors in overrides Chenyu Chen
` (17 subsequent siblings)
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:55 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, Tony Cheng, Jun Lei,
Chenyu Chen
From: Tony Cheng <tony.cheng@amd.com>
[Why]
With DC2 selected, Core2 rejects every fast update. A flip on the one
virtual plane falls back to DC1.
[How]
Split enable_plane into named stages: ungate_hw, setup_pipe_1,
reconfigure_mpc, setup_pipe_2, program_flip and setup_pipe_3. A
per-DPP-pipe sub-sequence can hold stages, and each pipe runs every
stage before the next pipe, so the emitted order does not change.
program_flip holds the plane address and the GSL and triple buffer of
the fast flip. The update chooses its steps from the update flags only.
dcn401_is_hardware_remapped compares the enabled, plane and DET facts
of each pipe of the stream in both states.
dcn401_are_pipe_configs_changed reports a stream flag, or a plane bit
other than the address, on a pipe of the stream. A new only_if meta
holds the necessary conditions of a step, next to skip_if, which holds
the sufficient conditions for a skip. The GSL and triple buffer steps
are emitted only if the hardware is not remapped and no pipe config
changed, so a new or reconfigured plane programs only the address. A
new skip_if.only_addresses_changed skips each step that only a full
update needs, so a flip emits the lock, program_flip, the unlock and
the trigger.
The DCC meta wait and the cursor update are not emitted. The wait is 0
without an immediate flip, and the cursor update does nothing without
cursor offload, which the dc check rejects.
The flip check uses the shared dc and stream checks and reads only the
state, not the hwss. It rejects each state that makes DC1 send a DMUB
command, take a DMUB lock, or add a call: SubVP, PSR, Replay, an ABM
level, a stream update flag, ODM, more than one plane, an immediate
flip, triple-buffer flips, an MCM LUT and any plane update bit other
than the address. A kept state that does not flip is rejected.
Core2 takes the context-fast flow on the kept context in the same
support and execute path as the full update, when each surface is a
plane of the stream and there is no stream update. A fast update skips
the mcache programming and the bandwidth bookkeeping. After the
update, Core2 marks the VMID, records the requested address and clears
the stream update flags.
Before the build, core2_update_state_execute also calls
set_p_state_switch_method on every DPP pipe of the stream, for both
full and fast updates, unless dc->debug.using_dml2 is set.
Cc: Jun Lei <jun.lei@amd.com>
Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
.../bls_builder/bls_builder_private_types.h | 12 +
.../dc/bls_builder/dcn401_builder_internal.h | 14 +
.../dc/bls_builder/dcn401_seamless_builder.c | 462 +++++++++++++++---
.../gpu/drm/amd/display/dc/core2/dc_core2.c | 71 ++-
4 files changed, 487 insertions(+), 72 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/bls_builder/bls_builder_private_types.h b/drivers/gpu/drm/amd/display/dc/bls_builder/bls_builder_private_types.h
index 11e452b36e05..2fdac8415f31 100644
--- a/drivers/gpu/drm/amd/display/dc/bls_builder/bls_builder_private_types.h
+++ b/drivers/gpu/drm/amd/display/dc/bls_builder/bls_builder_private_types.h
@@ -150,7 +150,19 @@ struct dcn401_commit_step_meta {
bool scaling_unchanged;
/* funcs.pg_needs_ip_request() is false: no PG hook can gate. */
bool no_ip_request;
+ /* update_flags has no address update for the plane of the pipe. */
+ bool no_addr_update;
+ /*
+ * update_flags change only plane addresses: the hardware is not
+ * remapped and no pipe config changed.
+ */
+ bool only_addresses_changed;
} skip_if;
+ /* Necessary conditions: the step is emitted only if each holds. */
+ struct {
+ bool hardware_not_remapped;
+ bool pipe_configs_not_changed;
+ } only_if;
};
struct dcn401_commit_step {
diff --git a/drivers/gpu/drm/amd/display/dc/bls_builder/dcn401_builder_internal.h b/drivers/gpu/drm/amd/display/dc/bls_builder/dcn401_builder_internal.h
index 4af30178b42b..ee829acb3c78 100644
--- a/drivers/gpu/drm/amd/display/dc/bls_builder/dcn401_builder_internal.h
+++ b/drivers/gpu/drm/amd/display/dc/bls_builder/dcn401_builder_internal.h
@@ -125,6 +125,10 @@ struct dcn401_commit_step_args {
const struct dc_state_update_flags *update_flags;
/* stream is in both states on the same pipes, planes and blocks. */
bool stream_unchanged;
+ /* update_flags: a pipe of stream changes its blocks, plane or DET. */
+ bool hardware_remapped;
+ /* update_flags: a stream change or a non-address plane change. */
+ bool pipe_configs_changed;
};
/*
@@ -133,6 +137,9 @@ struct dcn401_commit_step_args {
* of that state, the OTG master first. A builder lists its sub-sequences
* in emission order. A sequence longer than DC2_BLS_MAX_STEPS keeps its
* count and only the first entries; Core rejects it.
+ *
+ * A per-DPP-pipe sub-sequence can hold a group of named stages instead of
+ * steps. Each pipe then emits every stage before the next pipe starts.
*/
#define DCN401_CURRENT_STATE (1u << 0)
#define DCN401_NEW_STATE (1u << 1)
@@ -140,10 +147,17 @@ struct dcn401_commit_step_args {
#define DCN401_PER_STREAM_PER_OPP_HEAD (1u << 3)
#define DCN401_PER_STREAM_PER_DPP_PIPE (1u << 4)
+struct dcn401_stage {
+ const struct dcn401_commit_step *steps;
+ unsigned int count;
+};
+
struct dcn401_sub_sequence {
uint32_t flags;
const struct dcn401_commit_step *steps;
unsigned int count;
+ const struct dcn401_stage *stages;
+ unsigned int stage_count;
};
/* The support check found an OTG master for each stream it expands. */
diff --git a/drivers/gpu/drm/amd/display/dc/bls_builder/dcn401_seamless_builder.c b/drivers/gpu/drm/amd/display/dc/bls_builder/dcn401_seamless_builder.c
index a2c8d7964208..850b5d8c96d4 100644
--- a/drivers/gpu/drm/amd/display/dc/bls_builder/dcn401_seamless_builder.c
+++ b/drivers/gpu/drm/amd/display/dc/bls_builder/dcn401_seamless_builder.c
@@ -39,7 +39,9 @@
* post_unlock_program_front_end. Under the lock, a removed pipe leaves its
* MPCC; after it, the pipe powers down. A kept pipe skips the first-enable
* steps of enable_plane. The bandwidth lower stays with
- * dc_post_update_surfaces_to_stream.
+ * dc_post_update_surfaces_to_stream. When only the plane address of the
+ * stream changes, the update is a flip: it locks the pipe, programs the
+ * address and unlocks, with no DMUB command and no DMUB lock.
*
* This file also holds what both builders share: the dc and stream
* support checks, and the step walkers that turn a table into BLS entries.
@@ -931,6 +933,159 @@ static bool check_no_dsc_change(const struct dc *dc,
} while (0)
/* The updated stream: the one named, else the state's only stream. */
+
+static bool check_no_subvp(const struct dc *dc,
+ const struct dc_state *current_state,
+ const struct dc_state *new_state, unsigned int i)
+{
+ (void)dc;
+ (void)current_state;
+ return new_state->stream_status[i].mall_stream_config.type ==
+ SUBVP_NONE;
+}
+
+/*
+ * DC1 sends dirty rects to DMUB with PSR, Replay or an ABM level, and
+ * takes the DMUB HW lock around the flip with Replay or HWFQ.
+ */
+static bool check_no_dmub_work(const struct dc *dc,
+ const struct dc_state *current_state,
+ const struct dc_state *new_state, unsigned int i)
+{
+ const struct dc_stream_state *stream = new_state->streams[i];
+ const struct dc_link *link = stream->link;
+
+ (void)current_state;
+ (void)dc;
+ return link->psr_settings.psr_version == DC_PSR_VERSION_UNSUPPORTED &&
+ !link->replay_settings.config.replay_supported &&
+ !link->replay_settings.replay_feature_enabled &&
+ !stream->abm_level;
+}
+
+/*
+ * Each stream update flag adds a step: cursor, info frame, dither,
+ * gamut remap, output CSC, output transfer function and others.
+ */
+static bool check_no_stream_update_flags(const struct dc *dc,
+ const struct dc_state *current_state,
+ const struct dc_state *new_state, unsigned int i)
+{
+ (void)dc;
+ (void)current_state;
+ return !new_state->streams[i]->update_flags.raw;
+}
+
+/*
+ * Any other plane update bit adds a step to the flip. DC1 hands an
+ * offloaded flip to HWFQ. With triple-buffer flips, the pipe lock is not
+ * a TG_LOCK leaf.
+ */
+static bool check_one_address_only_plane(const struct dc *dc,
+ const struct dc_state *current_state,
+ const struct dc_state *new_state, unsigned int i)
+{
+ struct pipe_ctx *dpp_pipes[MAX_PIPES];
+ const struct dc_plane_state *plane;
+
+ (void)dc;
+ (void)current_state;
+ if (new_state->stream_status[i].plane_count != 1 ||
+ resource_get_opp_heads_for_stream(new_state->streams[i],
+ (struct resource_context *)&new_state->res_ctx,
+ dpp_pipes) != 1 ||
+ resource_get_dpp_pipes_for_stream(new_state->streams[i],
+ (struct resource_context *)&new_state->res_ctx,
+ dpp_pipes) != 1 ||
+ !dpp_pipes[0]->plane_state ||
+ !dpp_pipes[0]->plane_res.hubp)
+ return false;
+ plane = dpp_pipes[0]->plane_state;
+ return dc_check_address_only_update(plane->update_bits) &&
+ !plane->triplebuffer_flips;
+}
+
+static bool dcn401_pipe_on_either(const struct dc_state *current_state,
+ const struct dc_state *new_state, unsigned int j,
+ const struct dc_stream_state *stream)
+{
+ return dcn401_pipe_on_stream(¤t_state->res_ctx.pipe_ctx[j],
+ stream) ||
+ dcn401_pipe_on_stream(&new_state->res_ctx.pipe_ctx[j],
+ stream);
+}
+
+/* A pipe of the stream changes its blocks, its plane or its DET. */
+static bool dcn401_is_hardware_remapped(
+ const struct dc_state_update_flags *flags,
+ const struct dc_state *current_state,
+ const struct dc_state *new_state,
+ const struct dc_stream_state *stream)
+{
+ const struct dc_state_pipe_flags *cur, *new;
+ unsigned int j;
+
+ if (!flags || !stream)
+ return true;
+ for (j = 0; j < MAX_PIPES; j++) {
+ if (!dcn401_pipe_on_either(current_state, new_state, j, stream))
+ continue;
+ cur = &flags->cur_pipes[j];
+ new = &flags->new_pipes[j];
+ if (cur->enabled != new->enabled ||
+ cur->has_plane != new->has_plane ||
+ cur->det_size != new->det_size)
+ return true;
+ }
+ return false;
+}
+
+/*
+ * dc_core flags a stream change, or a plane change other than its
+ * address, on a pipe of the stream.
+ */
+static bool dcn401_are_pipe_configs_changed(
+ const struct dc_state_update_flags *flags,
+ const struct dc_state *new_state,
+ const struct dc_stream_state *stream)
+{
+ struct pipe_update_bits bits;
+ int i = dcn401_stream_index(new_state, stream);
+ unsigned int j;
+
+ if (!flags || i < 0 || i >= MAX_STREAMS || flags->streams[i].raw)
+ return true;
+ for (j = 0; j < MAX_PIPES; j++) {
+ if (!dcn401_pipe_on_stream(&new_state->res_ctx.pipe_ctx[j],
+ stream))
+ continue;
+ bits = flags->new_pipes[j].plane;
+ bits.addr_update = 0;
+ if (dc_pipe_update_bits_is_any_set(&bits))
+ return true;
+ }
+ return false;
+}
+
+/*
+ * Each check rejects a state for which DC1 would make a call the flip
+ * does not emit.
+ */
+static enum bls_builder_result dcn401_check_flip(const struct dc *dc,
+ const struct dc_state *current_state,
+ const struct dc_state *new_state, unsigned int i)
+{
+ CHECK_UPDATE(no_subvp, "subvp is set");
+ CHECK_UPDATE(no_dmub_work, "psr, replay, abm or hwfq needs dmub");
+ CHECK_UPDATE(no_stream_update_flags, "stream update flags are set");
+ CHECK_UPDATE(one_address_only_plane,
+ "stream has odm, or not one plane with an address-only update");
+ CHECK_CONDITION(triple_buffer, "triple buffer is disabled");
+ CHECK_UPDATE(no_immediate_flip, "flip is immediate");
+ CHECK_UPDATE(no_mcm_luts, "an mcm lut is enabled");
+ return BLS_BUILD_SUCCESS;
+}
+
static const struct dc_stream_state *dcn401_updated_stream(
const struct dc_state *new_state,
const struct dc_stream_state *stream)
@@ -969,6 +1124,18 @@ static enum bls_builder_result dcn401_check_seamless_update_support(
CHECK_UPDATE_FLAGS(streams_kept,
"a stream is not kept, or another stream changes");
+ if (!dcn401_is_hardware_remapped(update_flags, current_state,
+ new_state, new_state->streams[i]) &&
+ !dcn401_are_pipe_configs_changed(update_flags, new_state,
+ new_state->streams[i]))
+ return dcn401_check_flip(dc, current_state, new_state,
+ (unsigned int)i);
+ /* Without a new state, the update can only flip. */
+ if (current_state == new_state) {
+ dcn401_commit_check_failed(dc,
+ "state is kept and the update is not a flip");
+ return BLS_BUILD_ERROR_UNSUPPORTED_STATE_UPDATE;
+ }
return dcn401_check_stream_update(dc, current_state, new_state, i);
}
@@ -1037,13 +1204,17 @@ enum bls_builder_result dcn401_check_stream_update(const struct dc *dc,
static const struct dcn401_commit_step
prepare_bandwidth[] = {
{ .func = CLK_MGR_UPDATE_CLOCKS_FOR_STATE,
- .meta.clk_mgr_update_clocks_for_state.safe_to_lower = false },
+ .meta.clk_mgr_update_clocks_for_state.safe_to_lower = false,
+ .meta.skip_if.only_addresses_changed = true },
{ .func = HUBBUB_PROGRAM_WATERMARKS,
- .meta.hubbub_program_watermarks.safe_to_lower = false },
+ .meta.hubbub_program_watermarks.safe_to_lower = false,
+ .meta.skip_if.only_addresses_changed = true },
{ .func = HUBBUB_PROGRAM_ARBITER,
- .meta.hubbub_program_arbiter.safe_to_lower = false },
+ .meta.hubbub_program_arbiter.safe_to_lower = false,
+ .meta.skip_if.only_addresses_changed = true },
{ .func = HUBBUB_PROGRAM_COMPBUF_SEGMENTS,
- .meta.hubbub_program_compbuf_segments.safe_to_lower = false },
+ .meta.hubbub_program_compbuf_segments.safe_to_lower = false,
+ .meta.skip_if.only_addresses_changed = true },
};
/*
@@ -1054,11 +1225,14 @@ prepare_bandwidth[] = {
*/
static const struct dcn401_commit_step preamble[] = {
{ .func = TG_WAIT_FOR_ALL_PENDING_UPDATES,
- .meta.skip_if.optimized_not_required = true },
+ .meta.skip_if.optimized_not_required = true,
+ .meta.skip_if.only_addresses_changed = true },
{ .func = TG_WAIT_ODM_DOUBLEBUFFER_PENDING_CLEAR,
- .meta.skip_if.optimized_not_required = true },
+ .meta.skip_if.optimized_not_required = true,
+ .meta.skip_if.only_addresses_changed = true },
{ .func = OPP_WAIT_FOR_BLANK_COMPLETE,
- .meta.skip_if.optimized_not_required = true },
+ .meta.skip_if.optimized_not_required = true,
+ .meta.skip_if.only_addresses_changed = true },
};
/* Net effect: dcn401_program_outstanding_updates on the current state. */
@@ -1066,7 +1240,8 @@ static const struct dcn401_commit_step global_preamble[] = {
{ .func = HUBBUB_PROGRAM_COMPBUF_SEGMENTS,
.meta.hubbub_program_compbuf_segments.safe_to_lower = true,
.meta.hubbub_program_compbuf_segments.use_current_state_size = true,
- .meta.skip_if.optimized_not_required = true },
+ .meta.skip_if.optimized_not_required = true,
+ .meta.skip_if.only_addresses_changed = true },
};
/*
@@ -1075,11 +1250,14 @@ static const struct dcn401_commit_step global_preamble[] = {
*/
static const struct dcn401_commit_step pending[] = {
{ .func = TG_WAIT_FOR_ALL_PENDING_UPDATES,
- .meta.skip_if.stream_unchanged = true },
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true },
{ .func = TG_WAIT_ODM_DOUBLEBUFFER_PENDING_CLEAR,
- .meta.skip_if.stream_unchanged = true },
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true },
{ .func = OPP_WAIT_FOR_BLANK_COMPLETE,
- .meta.skip_if.stream_unchanged = true },
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true },
};
/*
@@ -1098,17 +1276,21 @@ static const struct dcn401_commit_step lock[] = {
static const struct dcn401_commit_step dpp_lock[] = {
{ .func = HUBP_PROGRAM_TRIPLEBUFFER,
- .meta.skip_if.stream_unchanged = true },
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true },
{ .func = HUBP_PROGRAM_TRIPLEBUFFER,
- .meta.skip_if.stream_unchanged = true },
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true },
};
static const struct dcn401_commit_step first_hubp[] = {
{ .func = HUBBUB_FORCE_PSTATE_CHANGE_CONTROL,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.hubbub_force_pstate_change_control.enable = true },
{ .func = DC_UDELAY,
- .meta.skip_if.stream_unchanged = true },
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true },
};
/*
@@ -1118,6 +1300,7 @@ static const struct dcn401_commit_step first_hubp[] = {
static const struct dcn401_commit_step opp_unblank[] = {
{ .func = OPP_SET_DISP_PATTERN_GENERATOR,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.opp_set_disp_pattern_generator.unblank = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
};
@@ -1125,18 +1308,23 @@ static const struct dcn401_commit_step opp_unblank[] = {
static const struct dcn401_commit_step global_sync[] = {
{ .func = TG_PROGRAM_GLOBAL_SYNC,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = TG_WAIT_FOR_STATE,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = TG_SET_VTG_PARAMS,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = TG_SETUP_VERTICAL_INTERRUPT2,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = OPTC_SET_ODM_COMBINE,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true,
.meta.skip_if.pipe_deltas.odm_kept = true,
.meta.skip_if.pipe_deltas_all = true },
@@ -1145,11 +1333,13 @@ static const struct dcn401_commit_step global_sync[] = {
static const struct dcn401_commit_step opp_odm[] = {
{ .func = OPP_PIPE_CLOCK_CONTROL,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true,
.meta.skip_if.pipe_deltas.odm_kept = true,
.meta.skip_if.pipe_deltas_all = true },
{ .func = OPP_PROGRAM_LEFT_EDGE_EXTRA_PIXEL,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true,
.meta.skip_if.pipe_deltas.odm_kept = true,
.meta.skip_if.pipe_deltas_all = true },
@@ -1161,89 +1351,135 @@ static const struct dcn401_commit_step opp_odm[] = {
*/
const struct dcn401_commit_step dcn401_disconnect[DCN401_DISCONNECT_STEPS] = {
{ .func = HUBP_PROGRAM_DET_SEGMENTS,
- .meta.skip_if.stream_unchanged = true, .meta.skip_if.pipe_deltas.current_has_no_plane = true,
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
+ .meta.skip_if.pipe_deltas.current_has_no_plane = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = MPC_REMOVE_MPCC,
- .meta.skip_if.stream_unchanged = true, .meta.skip_if.pipe_deltas.current_has_no_plane = true,
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
+ .meta.skip_if.pipe_deltas.current_has_no_plane = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
};
/* After the unlock, disable_plane on each removed pipe. */
const struct dcn401_commit_step dcn401_power_down[DCN401_POWER_DOWN_STEPS] = {
{ .func = MPC_ASSERT_IDLE_MPCC,
- .meta.skip_if.stream_unchanged = true, .meta.skip_if.pipe_deltas.current_has_no_plane = true,
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
+ .meta.skip_if.pipe_deltas.current_has_no_plane = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = HUBP_SET_BLANK,
- .meta.skip_if.stream_unchanged = true, .meta.skip_if.pipe_deltas.current_has_no_plane = true,
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
+ .meta.skip_if.pipe_deltas.current_has_no_plane = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = HUBP_UPDATE_MALL_SEL,
- .meta.skip_if.stream_unchanged = true, .meta.skip_if.pipe_deltas.current_has_no_plane = true,
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
+ .meta.skip_if.pipe_deltas.current_has_no_plane = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = HUBP_SET_FLIP_CONTROL_GSL,
- .meta.skip_if.stream_unchanged = true, .meta.skip_if.pipe_deltas.current_has_no_plane = true,
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
+ .meta.skip_if.pipe_deltas.current_has_no_plane = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = HUBP_CLK_CNTL,
- .meta.skip_if.stream_unchanged = true, .meta.skip_if.pipe_deltas.current_has_no_plane = true,
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
+ .meta.skip_if.pipe_deltas.current_has_no_plane = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = DPP_DPPCLK_CONTROL,
- .meta.skip_if.stream_unchanged = true, .meta.skip_if.pipe_deltas.current_has_no_plane = true,
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
+ .meta.skip_if.pipe_deltas.current_has_no_plane = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = DC_IP_REQUEST_STATUS,
- .meta.skip_if.stream_unchanged = true, .meta.skip_if.no_ip_request = true,
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
+ .meta.skip_if.no_ip_request = true,
.meta.skip_if.pipe_deltas.current_has_no_plane = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = DC_IP_REQUEST_CNTL,
- .meta.skip_if.stream_unchanged = true, .meta.dc_ip_request_cntl.enable = true,
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
+ .meta.dc_ip_request_cntl.enable = true,
.meta.skip_if.no_ip_request = true,
.meta.skip_if.pipe_deltas.current_has_no_plane = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = HUBP_PG_CONTROL,
- .meta.skip_if.stream_unchanged = true, .meta.skip_if.pipe_deltas.current_has_no_plane = true,
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
+ .meta.skip_if.pipe_deltas.current_has_no_plane = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = HUBP_RESET,
- .meta.skip_if.stream_unchanged = true, .meta.skip_if.pipe_deltas.current_has_no_plane = true,
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
+ .meta.skip_if.pipe_deltas.current_has_no_plane = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = DPP_RESET,
- .meta.skip_if.stream_unchanged = true, .meta.skip_if.pipe_deltas.current_has_no_plane = true,
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
+ .meta.skip_if.pipe_deltas.current_has_no_plane = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = DC_IP_REQUEST_CNTL,
- .meta.skip_if.stream_unchanged = true, .meta.dc_ip_request_cntl.enable = false,
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
+ .meta.dc_ip_request_cntl.enable = false,
.meta.skip_if.no_ip_request = true,
.meta.skip_if.pipe_deltas.current_has_no_plane = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
};
/* enable_plane, then the watermark propagate and the DET segments. */
-static const struct dcn401_commit_step enable_plane[] = {
+/* Ungate and clock the HUBP and DPP of a pipe brought up. */
+static const struct dcn401_commit_step ungate_hw[] = {
{ .func = DC_IP_REQUEST_STATUS,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true,
.meta.skip_if.no_ip_request = true },
{ .func = DC_IP_REQUEST_CNTL,
- .meta.skip_if.stream_unchanged = true, .meta.dc_ip_request_cntl.enable = true,
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
+ .meta.dc_ip_request_cntl.enable = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true,
.meta.skip_if.no_ip_request = true },
{ .func = HUBP_PG_CONTROL,
- .meta.skip_if.stream_unchanged = true, .meta.hubp_pg_control.power_on = true,
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
+ .meta.hubp_pg_control.power_on = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = DC_IP_REQUEST_CNTL,
- .meta.skip_if.stream_unchanged = true, .meta.dc_ip_request_cntl.enable = false,
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
+ .meta.dc_ip_request_cntl.enable = false,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true,
.meta.skip_if.no_ip_request = true },
{ .func = HUBP_CLK_CNTL,
- .meta.skip_if.stream_unchanged = true, .meta.hubp_clk_cntl.enable = true,
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
+ .meta.hubp_clk_cntl.enable = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = HUBP_INIT,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = OPP_PIPE_CLOCK_CONTROL,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = HUBBUB_FORCE_WM_PROPAGATE_TO_PIPES,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
+};
+
+/* The DET, then update_dchubp_dpp up to the DPP bias and scale. */
+static const struct dcn401_commit_step setup_pipe_1[] = {
{ .func = HUBP_PROGRAM_DET_SEGMENTS,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.hubp_program_det_segments.allocate = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true,
.meta.skip_if.pipe_deltas.det_unchanged = true,
@@ -1255,111 +1491,188 @@ static const struct dcn401_commit_step enable_plane[] = {
* removed when the OPP tree already holds one.
*/
{ .func = DPP_DPPCLK_CONTROL,
- .meta.skip_if.stream_unchanged = true, .meta.dpp_dppclk_control.enable = true,
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
+ .meta.dpp_dppclk_control.enable = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = DCCG_UPDATE_DPP_DTO,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = HUBP_VTG_SEL,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = HUBP_SETUP2,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = HUBP_SET_UNBOUNDED_REQUESTING,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = HUBP_SETUP_INTERDEPENDENT2,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = DPP_SETUP_DPP,
- .meta.skip_if.stream_unchanged = true },
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true },
{ .func = DPP_SET_CURSOR_MATRIX,
- .meta.skip_if.stream_unchanged = true },
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true },
{ .func = DPP_PROGRAM_BIAS_AND_SCALE,
- .meta.skip_if.stream_unchanged = true },
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true },
+};
+
+/* Remove and insert the MPCC of the plane. */
+static const struct dcn401_commit_step reconfigure_mpc[] = {
{ .func = MPC_REMOVE_MPCC,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.opp_tree_empty = true },
/* insert_plane programs the blending; no update_blending follows. */
{ .func = MPC_INSERT_PLANE,
- .meta.skip_if.stream_unchanged = true },
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true },
{ .func = MPC_UPDATE_VISUAL_CONFIRM,
- .meta.skip_if.stream_unchanged = true },
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true },
+};
+
+/* The scaler, viewport, MCACHE, gamut remap and surface config. */
+static const struct dcn401_commit_step setup_pipe_2[] = {
{ .func = DPP_SET_SCALER,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.scaling_unchanged = true },
{ .func = HUBP_MEM_PROGRAM_VIEWPORT,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.scaling_unchanged = true },
{ .func = HUBP_PROGRAM_MCACHE_ID,
- .meta.skip_if.stream_unchanged = true },
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true },
{ .func = MPC_SET_GAMUT_REMAP_BYPASS,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.mpc_set_gamut_remap_bypass.block_id =
MPCC_MCM_FIRST_GAMUT_REMAP },
{ .func = MPC_SET_GAMUT_REMAP_BYPASS,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.mpc_set_gamut_remap_bypass.block_id =
MPCC_MCM_SECOND_GAMUT_REMAP },
{ .func = MPC_SET_GAMUT_REMAP_BYPASS,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.mpc_set_gamut_remap_bypass.block_id = MPCC_OGAM_GAMUT_REMAP },
{ .func = MPC_POWER_ON_MPC_MEM_PWR,
- .meta.skip_if.stream_unchanged = true },
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true },
{ .func = MPC_SET_OCSC_DEFAULT,
- .meta.skip_if.stream_unchanged = true },
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true },
{ .func = HUBP_PROGRAM_SURFACE_CONFIG,
- .meta.skip_if.stream_unchanged = true },
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true },
+};
+
+/*
+ * The plane address. On a flip, also the GSL and triple buffer of
+ * commit_planes_for_stream_fast; a new or reconfigured plane skips them.
+ */
+static const struct dcn401_commit_step program_flip[] = {
+ { .func = HUBP_SET_FLIP_CONTROL_GSL,
+ .meta.only_if.hardware_not_remapped = true,
+ .meta.only_if.pipe_configs_not_changed = true,
+ .meta.skip_if.no_addr_update = true },
+ { .func = HUBP_PROGRAM_TRIPLEBUFFER,
+ .meta.only_if.hardware_not_remapped = true,
+ .meta.only_if.pipe_configs_not_changed = true,
+ .meta.skip_if.no_addr_update = true },
{ .func = HUBP_UPDATE_PLANE_ADDR,
.meta.skip_if.stream_unchanged = true },
+};
+
+/* Unblank, then the transfer functions and the OPP format. */
+static const struct dcn401_commit_step setup_pipe_3[] = {
{ .func = HUBP_SET_BLANK,
- .meta.skip_if.stream_unchanged = true, .meta.hubp_set_blank.unblank = true,
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
+ .meta.hubp_set_blank.unblank = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
/* set_hdr_multiplier, the input and MCM transfer functions, the
* output transfer function and the OPP format. First enable only.
*/
{ .func = DPP_SET_HDR_MULTIPLIER,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = DPP_SET_PRE_DEGAM,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = DPP_PROGRAM_GAMCOR_LUT,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = MPC_SET_MOVABLE_CM_LOCATION,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = MPC_PROGRAM_LUT_MODE,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.mpc_program_lut_mode.id = MCM_LUT_1DLUT,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = MPC_PROGRAM_LUT_MODE,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.mpc_program_lut_mode.id = MCM_LUT_SHAPER,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = MPC_PROGRAM_LUT_MODE,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.mpc_program_lut_mode.id = MCM_LUT_3DLUT,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = HUBP_PROGRAM_3DLUT_FL_CONFIG,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = HUBP_SET_3DLUT_FL,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = MPC_SET_OUTPUT_GAMMA,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = OPP_SET_DYN_EXPANSION,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
{ .func = OPP_PROGRAM_FMT,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.hubp_dpp_already_enabled = true },
};
+static const struct dcn401_stage enable_plane[] = {
+ { ungate_hw, ARRAY_SIZE(ungate_hw) },
+ { setup_pipe_1, ARRAY_SIZE(setup_pipe_1) },
+ { reconfigure_mpc, ARRAY_SIZE(reconfigure_mpc) },
+ { setup_pipe_2, ARRAY_SIZE(setup_pipe_2) },
+ { program_flip, ARRAY_SIZE(program_flip) },
+ { setup_pipe_3, ARRAY_SIZE(setup_pipe_3) },
+};
+
+#define DCN401_ENABLE_PLANE_STEPS (ARRAY_SIZE(ungate_hw) + \
+ ARRAY_SIZE(setup_pipe_1) + ARRAY_SIZE(reconfigure_mpc) + \
+ ARRAY_SIZE(setup_pipe_2) + ARRAY_SIZE(program_flip) + \
+ ARRAY_SIZE(setup_pipe_3))
+
/*
* The pipe unlock, then dcn401_post_unlock_program_front_end: the
* flip-pending wait, the p-state release and the MALL selection. Last,
@@ -1372,17 +1685,20 @@ static const struct dcn401_commit_step unlock[] = {
static const struct dcn401_commit_step dpp_flip[] = {
{ .func = HUBP_WAIT_FLIP_PENDING,
- .meta.skip_if.stream_unchanged = true },
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true },
};
static const struct dcn401_commit_step pstate[] = {
{ .func = HUBBUB_FORCE_PSTATE_CHANGE_CONTROL,
- .meta.skip_if.stream_unchanged = true },
+ .meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true },
};
static const struct dcn401_commit_step dpp_mall[] = {
{ .func = HUBP_UPDATE_MALL_SEL,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.hubp_update_mall_sel.from_new_state = true },
};
@@ -1390,6 +1706,7 @@ static const struct dcn401_commit_step dpp_mall[] = {
static const struct dcn401_commit_step odm_wait[] = {
{ .func = TG_WAIT_ODM_DOUBLEBUFFER_PENDING_CLEAR,
.meta.skip_if.stream_unchanged = true,
+ .meta.skip_if.only_addresses_changed = true,
.meta.skip_if.pipe_deltas.odm_kept = true },
};
@@ -1405,7 +1722,7 @@ static const struct dcn401_commit_step trigger[] = {
* pipe as programmed. dcn401_add_step catches a longer sequence.
*/
static_assert(ARRAY_SIZE(dcn401_disconnect) + ARRAY_SIZE(dcn401_power_down) <=
- ARRAY_SIZE(dpp_lock) + ARRAY_SIZE(enable_plane) +
+ ARRAY_SIZE(dpp_lock) + DCN401_ENABLE_PLANE_STEPS +
ARRAY_SIZE(dpp_flip) + ARRAY_SIZE(dpp_mall),
"a removed pipe emits more than a programmed pipe");
static_assert(
@@ -1425,7 +1742,7 @@ static_assert(
ARRAY_SIZE(trigger) +
DCN401_MAX_DPP_PIPES * (
ARRAY_SIZE(dpp_lock) +
- ARRAY_SIZE(enable_plane) +
+ DCN401_ENABLE_PLANE_STEPS +
ARRAY_SIZE(dpp_flip) +
ARRAY_SIZE(dpp_mall)) <= DC2_BLS_MAX_STEPS,
"dcn401 seamless update head exceeds DC2_BLS_MAX_STEPS");
@@ -2345,6 +2662,14 @@ static bool dcn401_skip_step(const struct dcn401_commit_step_args *args,
struct dcn401_pipe_deltas deltas;
const struct pipe_ctx *cur, *new;
+ if (step->meta.skip_if.only_addresses_changed &&
+ !args->hardware_remapped && !args->pipe_configs_changed)
+ return true;
+ if (step->meta.only_if.hardware_not_remapped && args->hardware_remapped)
+ return true;
+ if (step->meta.only_if.pipe_configs_not_changed &&
+ args->pipe_configs_changed)
+ return true;
if (step->meta.skip_if.new_state_has_stream &&
args->new_state->stream_count)
return true;
@@ -2363,6 +2688,10 @@ static bool dcn401_skip_step(const struct dcn401_commit_step_args *args,
cur = &args->current_state->res_ctx.pipe_ctx[args->pipe->pipe_idx];
new = &args->new_state->res_ctx.pipe_ctx[args->pipe->pipe_idx];
dcn401_eval_pipe_deltas(args, args->pipe->pipe_idx, &deltas);
+ if (step->meta.skip_if.no_addr_update &&
+ !args->update_flags->new_pipes[args->pipe->pipe_idx]
+ .plane.addr_update)
+ return true;
if (step->meta.skip_if.no_manual_trigger &&
(!args->pipe->plane_state->update_bits.addr_update ||
args->pipe->plane_state->skip_manual_trigger))
@@ -2447,12 +2776,11 @@ static void dcn401_add_per_opp_head(struct block_sequence_state *sequence,
static void dcn401_add_per_dpp_pipe(struct block_sequence_state *sequence,
const struct dcn401_commit_step_args *state_args,
- struct dc_state *state,
- const struct dcn401_commit_step *steps, unsigned int count)
+ struct dc_state *state, const struct dcn401_sub_sequence *sub)
{
struct dcn401_commit_step_args args = *state_args;
struct pipe_ctx *dpp_pipes[MAX_PIPES];
- unsigned int i;
+ unsigned int i, k;
int j, n;
for (i = 0; i < state->stream_count; i++) {
@@ -2462,7 +2790,15 @@ static void dcn401_add_per_dpp_pipe(struct block_sequence_state *sequence,
&state->res_ctx, dpp_pipes);
for (j = 0; j < n; j++) {
args.pipe = dpp_pipes[j];
- dcn401_add_steps(sequence, &args, steps, count);
+ if (!sub->stages) {
+ dcn401_add_steps(sequence, &args, sub->steps,
+ sub->count);
+ continue;
+ }
+ for (k = 0; k < sub->stage_count; k++)
+ dcn401_add_steps(sequence, &args,
+ sub->stages[k].steps,
+ sub->stages[k].count);
}
}
}
@@ -2487,8 +2823,7 @@ void dcn401_add_sub_sequences(struct block_sequence_state *sequence,
dcn401_add_per_opp_head(sequence, state_args, state,
sub->steps, sub->count);
else if (sub->flags & DCN401_PER_STREAM_PER_DPP_PIPE)
- dcn401_add_per_dpp_pipe(sequence, state_args, state,
- sub->steps, sub->count);
+ dcn401_add_per_dpp_pipe(sequence, state_args, state, sub);
else
dcn401_add_steps(sequence, state_args, sub->steps,
sub->count);
@@ -2507,6 +2842,8 @@ void dcn401_init_and_unpack_params(
state_args->pipe = NULL;
state_args->update_flags = params->update_flags;
state_args->stream_unchanged = false;
+ state_args->hardware_remapped = true;
+ state_args->pipe_configs_changed = true;
params->head_num_steps = 0;
params->tail_num_steps = 0;
@@ -2517,8 +2854,10 @@ void dcn401_init_and_unpack_params(
/*
* The waits and the bandwidth raise, then the updated stream only.
* skip_if drops the steps a kept pipe or ODM layout does not need, so
- * every transition is the same table. The enable_plane list runs per DPP
- * pipe, top pipe first, so the top MPCC is inserted before the bottom one.
+ * every transition is the same table. Each DPP pipe runs every
+ * enable_plane stage before the next pipe, top pipe first, so the top
+ * MPCC is inserted before the bottom one. A flip runs only the lock,
+ * program_flip, the unlock and the trigger.
*/
static const struct dcn401_sub_sequence bls_update_head[] = {
{ .flags = DCN401_CURRENT_STATE | DCN401_PER_STREAM_PER_OTG_MASTER,
@@ -2559,8 +2898,8 @@ static const struct dcn401_sub_sequence bls_stream_update[] = {
.steps = opp_odm,
.count = ARRAY_SIZE(opp_odm) },
{ .flags = DCN401_NEW_STATE | DCN401_PER_STREAM_PER_DPP_PIPE,
- .steps = enable_plane,
- .count = ARRAY_SIZE(enable_plane) },
+ .stages = enable_plane,
+ .stage_count = ARRAY_SIZE(enable_plane) },
{ .flags = DCN401_NEW_STATE | DCN401_PER_STREAM_PER_OTG_MASTER,
.steps = unlock,
.count = ARRAY_SIZE(unlock) },
@@ -2608,6 +2947,11 @@ static enum bls_builder_result dcn401_build_seamless_update(
dcn401_init_and_unpack_params(params, &state_args, &head);
state_args.stream = dcn401_updated_stream(params->new_state,
params->stream);
+ state_args.hardware_remapped = dcn401_is_hardware_remapped(
+ params->update_flags, params->current_state,
+ params->new_state, state_args.stream);
+ state_args.pipe_configs_changed = dcn401_are_pipe_configs_changed(
+ params->update_flags, params->new_state, state_args.stream);
DCN401_ADD_SUB_SEQUENCES(&head, &state_args, bls_update_head);
dcn401_add_stream_update(&head, &state_args);
diff --git a/drivers/gpu/drm/amd/display/dc/core2/dc_core2.c b/drivers/gpu/drm/amd/display/dc/core2/dc_core2.c
index c4e1fef8266e..245ebd8e01d0 100644
--- a/drivers/gpu/drm/amd/display/dc/core2/dc_core2.c
+++ b/drivers/gpu/drm/amd/display/dc/core2/dc_core2.c
@@ -247,7 +247,7 @@ static void core2_update_prepare(struct dc *dc, struct dc_state *context,
}
static void core2_update_done(struct dc *dc, struct dc_state *context,
- struct dc_stream_state *stream);
+ struct dc_stream_state *stream, enum dc_update_type update_type);
/* Never falls back to legacy_commit_state_hw: DC2 must not call DC1. */
enum dc_status core2_commit_state_hw(struct dc *dc, struct dc_state *context)
@@ -297,7 +297,8 @@ enum dc_status core2_commit_state_hw(struct dc *dc, struct dc_state *context)
if (dcn401_stream_kept(dc, current_state, context,
context->streams[i]))
- core2_update_done(dc, context, context->streams[i]);
+ core2_update_done(dc, context, context->streams[i],
+ UPDATE_TYPE_FULL);
else if (otg_master)
core2_commit_enable_done(otg_master);
}
@@ -331,6 +332,30 @@ static bool core2_stream_update_supported(
!(update->wb_update && update->wb_update->num_wb_info);
}
+/* Each surface of the update is a plane of the stream in the new context. */
+static bool core2_surfaces_supported(
+ const struct dc_update_scratch_space *scratch)
+{
+ struct pipe_ctx *dpp_pipes[MAX_PIPES];
+ int i, j, n;
+
+ if (!scratch->surface_updates)
+ return false;
+ n = resource_get_dpp_pipes_for_stream(scratch->stream,
+ &scratch->new_context->res_ctx, dpp_pipes);
+ if (n != scratch->surface_count)
+ return false;
+ for (i = 0; i < scratch->surface_count; i++) {
+ for (j = 0; j < n; j++)
+ if (dpp_pipes[j]->plane_state ==
+ scratch->surface_updates[i].surface)
+ break;
+ if (j == n)
+ return false;
+ }
+ return true;
+}
+
static bool core2_update_state_supported(
const struct dc_update_scratch_space *scratch)
{
@@ -338,15 +363,22 @@ static bool core2_update_state_supported(
if (!scratch->stream || !scratch->update_v3 || scratch->probe_updates)
return false;
/*
- * Only a full update on a new context has a builder. A context-full
- * flow keeps dc->current_state, so its update type is below FULL.
+ * The builder takes both states: a full update on a new context, or
+ * a fast update on the kept one. A context-full flow keeps
+ * dc->current_state with an update type below FULL, and has no
+ * builder.
*/
- if (scratch->update_type != UPDATE_TYPE_FULL ||
- scratch->flow != UPDATE_V3_FLOW_NEW_CONTEXT_SEAMLESS)
+ if (!(scratch->update_type == UPDATE_TYPE_FULL &&
+ scratch->flow == UPDATE_V3_FLOW_NEW_CONTEXT_SEAMLESS) &&
+ !(scratch->update_type == UPDATE_TYPE_FAST &&
+ scratch->flow == UPDATE_V3_FLOW_NO_NEW_CONTEXT_CONTEXT_FAST &&
+ scratch->new_context == scratch->dc->current_state))
return false;
- /* The full-update builder adds one or two planes, or keeps one. */
+ /* The builder adds one or two planes, keeps them, or flips one. */
if (scratch->surface_count != 1 && scratch->surface_count != 2)
return false;
+ if (!core2_surfaces_supported(scratch))
+ return false;
if (!core2_stream_update_supported(scratch->stream_update))
return false;
return core2_builder_supports(scratch->dc, DCN_DECL_SEAMLESS_UPDATE,
@@ -355,11 +387,11 @@ static bool core2_update_state_supported(
/*
* The software state commit_planes_for_stream writes while it programs
- * the plane. The swap to the new context stays in
- * dc_update_state_cleanup.
+ * the plane, and that the HUBP_UPDATE_PLANE_ADDR entry does not write.
+ * The swap to the new context stays in dc_update_state_cleanup.
*/
static void core2_update_done(struct dc *dc, struct dc_state *context,
- struct dc_stream_state *stream)
+ struct dc_stream_state *stream, enum dc_update_type update_type)
{
struct pipe_ctx *dpp_pipes[MAX_PIPES];
struct pipe_ctx *pipe;
@@ -389,7 +421,9 @@ static void core2_update_done(struct dc *dc, struct dc_state *context,
hubp->mpcc_id = hubp->inst;
hubp->power_gated = false;
}
- core2_commit_prepare_done(dc, context);
+ /* DC1 prepares bandwidth only on a full update. */
+ if (update_type == UPDATE_TYPE_FULL)
+ core2_commit_prepare_done(dc, context);
}
static void core2_update_state_execute(
@@ -400,14 +434,25 @@ static void core2_update_state_execute(
struct pipe_ctx *pipe = resource_get_otg_master_for_stream(
&context->res_ctx, scratch->stream);
+ struct pipe_ctx *dpp_pipes[MAX_PIPES];
+ int i, n;
+
if (!pipe || !pipe->plane_state)
return;
- core2_update_prepare(dc, context, scratch->stream);
+ if (scratch->update_type != UPDATE_TYPE_FAST)
+ core2_update_prepare(dc, context, scratch->stream);
+ if (!dc->debug.using_dml2) {
+ n = resource_get_dpp_pipes_for_stream(scratch->stream,
+ &context->res_ctx, dpp_pipes);
+ for (i = 0; i < n; i++)
+ set_p_state_switch_method(dc, context, dpp_pipes[i]);
+ }
if (core2_build_and_run(dc, DCN_DECL_SEAMLESS_UPDATE, context,
scratch->stream) != DC_OK) {
ASSERT(false);
return;
}
- core2_update_done(dc, context, scratch->stream);
+ stream_update_flags_clear(&scratch->stream->update_flags);
+ core2_update_done(dc, context, scratch->stream, scratch->update_type);
}
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* [PATCH 12/27] drm/amd/display: Preserve bandwidth floors in overrides
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (10 preceding siblings ...)
2026-11-25 6:55 ` [PATCH 11/27] drm/amd/display: Add the vsync flip to the DC2 seamless update Chenyu Chen
@ 2026-11-25 6:55 ` Chenyu Chen
2026-11-25 6:55 ` [PATCH 13/27] drm/amd/display: Set HDMI bypass earlier Chenyu Chen
` (16 subsequent siblings)
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:55 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, Wenjing Liu, Alvin Lee,
Chenyu Chen
From: Wenjing Liu <wenjing.liu@amd.com>
[Why]
Bandwidth overrides must respect each current-state requirement
while allowing descending requests to release previous peak votes.
[How]
Recompute nominal and urgent requests from their corresponding
current-state floors and the capped input on every call. Restore
the state values when the request is zero.
Cc: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
.../display/dc/clk_mgr/dcn60/dcn60_clk_mgr.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn60/dcn60_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn60/dcn60_clk_mgr.c
index f801f3337e5d..9556da79cdce 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn60/dcn60_clk_mgr.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn60/dcn60_clk_mgr.c
@@ -1614,23 +1614,27 @@ static unsigned int dcn60_override_memory_bandwidth_request(
struct dc_clocks new_clocks;
unsigned int max_bw_kbps;
unsigned int capped_bw_kbps;
+ unsigned int original_nominal_bw_kbps = dc->current_state->bw_ctx.bw.dcn.clk.utm_nominal_bandwidth_lb_KBps;
+ unsigned int original_urgent_bw_kbps = dc->current_state->bw_ctx.bw.dcn.clk.utm_urgent_bandwidth_lb_KBps;
int num_steps;
memcpy(&new_clocks, &clk_mgr_base->clks, sizeof(struct dc_clocks));
if (bw_kbps == 0) {
- /* Clearing the override restores the request of the committed mode. */
- new_clocks.utm_nominal_bandwidth_lb_KBps =
- dc->current_state->bw_ctx.bw.dcn.clk.utm_nominal_bandwidth_lb_KBps;
- new_clocks.utm_urgent_bandwidth_lb_KBps =
- dc->current_state->bw_ctx.bw.dcn.clk.utm_urgent_bandwidth_lb_KBps;
+ new_clocks.utm_nominal_bandwidth_lb_KBps = original_nominal_bw_kbps;
+ new_clocks.utm_urgent_bandwidth_lb_KBps = original_urgent_bw_kbps;
} else {
max_bw_kbps = dcn60_get_max_active_utm_bandwidth_kbps(clk_mgr_base);
capped_bw_kbps = (bw_kbps > max_bw_kbps) ? max_bw_kbps : bw_kbps;
- new_clocks.utm_nominal_bandwidth_lb_KBps = capped_bw_kbps;
- if (new_clocks.utm_urgent_bandwidth_lb_KBps < capped_bw_kbps)
+ if (capped_bw_kbps > original_nominal_bw_kbps)
+ new_clocks.utm_nominal_bandwidth_lb_KBps = capped_bw_kbps;
+ else
+ new_clocks.utm_nominal_bandwidth_lb_KBps = original_nominal_bw_kbps;
+ if (capped_bw_kbps > original_urgent_bw_kbps)
new_clocks.utm_urgent_bandwidth_lb_KBps = capped_bw_kbps;
+ else
+ new_clocks.utm_urgent_bandwidth_lb_KBps = original_urgent_bw_kbps;
}
num_steps = dcn60_build_update_bandwidth_clocks_sequence(clk_mgr_base,
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* [PATCH 13/27] drm/amd/display: Set HDMI bypass earlier
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (11 preceding siblings ...)
2026-11-25 6:55 ` [PATCH 12/27] drm/amd/display: Preserve bandwidth floors in overrides Chenyu Chen
@ 2026-11-25 6:55 ` Chenyu Chen
2026-11-25 6:55 ` [PATCH 14/27] drm/amd/display: Add DMUB timer reference clock to ref_clocks Chenyu Chen
` (15 subsequent siblings)
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:55 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, Charlene Liu, Chris Park,
Chenyu Chen
From: Charlene Liu <Charlene.Liu@amd.com>
[Why]
This is a HW-required change.
[How]
Enable the existing TMDS double-buffer bypass before the first
metadata packet-enable write. FRL behavior remains unchanged.
This mitigates lost updates but does not prevent V_UPDATE collisions.
Only update DCN42 or later for now.
Cc: Roman Li <roman.li@amd.com>
Cc: Chris Park <chris.park@amd.com>
Signed-off-by: Charlene Liu <Charlene.Liu@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
.../dc/dio/dcn401/dcn401_dio_stream_encoder.c | 15 +++++++++++++++
.../dc/dio/dcn401/dcn401_dio_stream_encoder.h | 4 ++++
.../dc/dio/dcn42/dcn42_dio_stream_encoder.c | 2 +-
.../dc/dio/dcn60/dcn60_dio_stream_encoder.c | 2 +-
4 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder.c b/drivers/gpu/drm/amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder.c
index 4616b6f76aeb..86111cebc944 100644
--- a/drivers/gpu/drm/amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder.c
+++ b/drivers/gpu/drm/amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder.c
@@ -436,6 +436,21 @@ void enc401_stream_encoder_enable(
}
}
+void enc401_stream_encoder_enable_with_hdmi_db_bypass(
+ struct stream_encoder *enc,
+ enum signal_type signal,
+ bool enable)
+{
+ struct dcn10_stream_encoder *enc1 = DCN10STRENC_FROM_STRENC(enc);
+
+ if (enable && signal == SIGNAL_TYPE_HDMI_TYPE_A) {
+ /* Bypass HDMI double buffering before enabling the stream. */
+ REG_UPDATE(HDMI_DB_CONTROL, HDMI_DB_DISABLE, 1);
+ }
+
+ enc401_stream_encoder_enable(enc, signal, enable);
+}
+
void enc401_stream_encoder_dp_set_stream_attribute(
struct stream_encoder *enc,
struct dc_crtc_timing *crtc_timing,
diff --git a/drivers/gpu/drm/amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder.h b/drivers/gpu/drm/amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder.h
index d6b00cd246b1..dea7f941675d 100644
--- a/drivers/gpu/drm/amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder.h
+++ b/drivers/gpu/drm/amd/display/dc/dio/dcn401/dcn401_dio_stream_encoder.h
@@ -226,6 +226,10 @@ void enc401_stream_encoder_enable(
struct stream_encoder *enc,
enum signal_type signal,
bool enable);
+void enc401_stream_encoder_enable_with_hdmi_db_bypass(
+ struct stream_encoder *enc,
+ enum signal_type signal,
+ bool enable);
void enc401_set_dig_input_mode(struct stream_encoder *enc, unsigned int pix_per_container);
void enc401_stream_encoder_map_to_link(
struct stream_encoder *enc,
diff --git a/drivers/gpu/drm/amd/display/dc/dio/dcn42/dcn42_dio_stream_encoder.c b/drivers/gpu/drm/amd/display/dc/dio/dcn42/dcn42_dio_stream_encoder.c
index b7671d41ea24..98dc158e7094 100644
--- a/drivers/gpu/drm/amd/display/dc/dio/dcn42/dcn42_dio_stream_encoder.c
+++ b/drivers/gpu/drm/amd/display/dc/dio/dcn42/dcn42_dio_stream_encoder.c
@@ -552,7 +552,7 @@ static const struct stream_encoder_funcs dcn42_str_enc_funcs = {
.dp_set_dsc_pps_info_packet = enc42_dp_set_dsc_pps_info_packet,
.set_dynamic_metadata = enc401_set_dynamic_metadata,
.hdmi_reset_stream_attribute = enc42_reset_hdmi_stream_attribute,
- .enable_stream = enc401_stream_encoder_enable,
+ .enable_stream = enc401_stream_encoder_enable_with_hdmi_db_bypass,
.set_input_mode = enc401_set_dig_input_mode,
.enable_fifo = enc35_enable_fifo,
diff --git a/drivers/gpu/drm/amd/display/dc/dio/dcn60/dcn60_dio_stream_encoder.c b/drivers/gpu/drm/amd/display/dc/dio/dcn60/dcn60_dio_stream_encoder.c
index b645914c1c71..3fc503681177 100644
--- a/drivers/gpu/drm/amd/display/dc/dio/dcn60/dcn60_dio_stream_encoder.c
+++ b/drivers/gpu/drm/amd/display/dc/dio/dcn60/dcn60_dio_stream_encoder.c
@@ -506,7 +506,7 @@ static const struct stream_encoder_funcs dcn60_str_enc_funcs = {
.dp_set_dsc_pps_info_packet = enc60_dp_set_dsc_pps_info_packet,
.set_dynamic_metadata = enc401_set_dynamic_metadata,
.hdmi_reset_stream_attribute = enc60_reset_hdmi_stream_attribute,
- .enable_stream = enc401_stream_encoder_enable,
+ .enable_stream = enc401_stream_encoder_enable_with_hdmi_db_bypass,
.set_input_mode = enc401_set_dig_input_mode,
.enable_fifo = enc35_enable_fifo,
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* [PATCH 14/27] drm/amd/display: Add DMUB timer reference clock to ref_clocks
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (12 preceding siblings ...)
2026-11-25 6:55 ` [PATCH 13/27] drm/amd/display: Set HDMI bypass earlier Chenyu Chen
@ 2026-11-25 6:55 ` Chenyu Chen
2026-11-25 6:55 ` [PATCH 15/27] drm/amd/display: Guard connector I2C transfer without DDC pin Chenyu Chen
` (14 subsequent siblings)
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:55 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, Alvin Lee, Nicholas Kazlauskas,
Chenyu Chen
From: Alvin Lee <Alvin.Lee2@amd.com>
[Why]
The DMUB timer reference clock can differ from the crystal frequency,
so it should be tracked separately from the other reference clocks.
[How]
Add dmub_timer_refclk_khz to resource_pool ref_clocks. DCN3.0, 3.1,
3.2, 3.5, 4.01, 4.2 and 5.0 set it in init_hw from the crystal
frequency, next to xtalin_clock_inKhz, so their behavior does not
change. DCN6.0 sets it to a fixed 100 MHz (DCN60_DMUB_TIMER_REFCLK_KHZ)
in dcn60_resource_construct instead of using the crystal frequency.
Other init paths, such as DCN1.0, DCN2.01, DCN6.0 init_hw and the core
and bls_builder init, are not changed by this patch and leave the field
unset.
Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alvin Lee <Alvin.Lee2@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c | 2 ++
drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.c | 2 ++
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 2 ++
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 2 ++
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 2 ++
drivers/gpu/drm/amd/display/dc/hwss/dcn42/dcn42_hwseq.c | 2 ++
drivers/gpu/drm/amd/display/dc/hwss/dcn50/dcn50_hwseq.c | 2 ++
drivers/gpu/drm/amd/display/dc/inc/core_types.h | 1 +
.../gpu/drm/amd/display/dc/resource/dcn60/dcn60_resource.c | 4 ++++
9 files changed, 19 insertions(+)
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c
index 35d5cce0a791..c4500617dc85 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c
@@ -686,6 +686,8 @@ void dcn30_init_hw(struct dc *dc)
if (dc->ctx->dc_bios->fw_info_valid) {
res_pool->ref_clocks.xtalin_clock_inKhz =
dc->ctx->dc_bios->fw_info.pll_info.crystal_frequency;
+ res_pool->ref_clocks.dmub_timer_refclk_khz =
+ dc->ctx->dc_bios->fw_info.pll_info.crystal_frequency;
if (res_pool->hubbub) {
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 7acf6af7e472..e90afdd6f1c9 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
@@ -138,6 +138,8 @@ void dcn31_init_hw(struct dc *dc)
if (dc->ctx->dc_bios->fw_info_valid) {
res_pool->ref_clocks.xtalin_clock_inKhz =
dc->ctx->dc_bios->fw_info.pll_info.crystal_frequency;
+ res_pool->ref_clocks.dmub_timer_refclk_khz =
+ dc->ctx->dc_bios->fw_info.pll_info.crystal_frequency;
if (res_pool->hubbub) {
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 b78041ba94e9..945052b1808f 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
@@ -848,6 +848,8 @@ void dcn32_init_hw(struct dc *dc)
if (dc->ctx->dc_bios->fw_info_valid) {
res_pool->ref_clocks.xtalin_clock_inKhz =
dc->ctx->dc_bios->fw_info.pll_info.crystal_frequency;
+ res_pool->ref_clocks.dmub_timer_refclk_khz =
+ dc->ctx->dc_bios->fw_info.pll_info.crystal_frequency;
if (res_pool->hubbub) {
(res_pool->dccg->funcs->get_dccg_ref_freq)(res_pool->dccg,
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 564ffd61f391..d24569870a2d 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
@@ -171,6 +171,8 @@ void dcn35_init_hw(struct dc *dc)
if (dc->ctx->dc_bios->fw_info_valid) {
res_pool->ref_clocks.xtalin_clock_inKhz =
dc->ctx->dc_bios->fw_info.pll_info.crystal_frequency;
+ res_pool->ref_clocks.dmub_timer_refclk_khz =
+ dc->ctx->dc_bios->fw_info.pll_info.crystal_frequency;
if (res_pool->hubbub) {
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
index c39189deb244..7b1eca0e2b57 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
@@ -178,6 +178,8 @@ void dcn401_init_hw(struct dc *dc)
if (dc->ctx->dc_bios->fw_info_valid) {
res_pool->ref_clocks.xtalin_clock_inKhz =
dc->ctx->dc_bios->fw_info.pll_info.crystal_frequency;
+ res_pool->ref_clocks.dmub_timer_refclk_khz =
+ dc->ctx->dc_bios->fw_info.pll_info.crystal_frequency;
if (res_pool->hubbub) {
(res_pool->dccg->funcs->get_dccg_ref_freq)(res_pool->dccg,
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn42/dcn42_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn42/dcn42_hwseq.c
index b1cc09df5e63..62876d489b8e 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn42/dcn42_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn42/dcn42_hwseq.c
@@ -103,6 +103,8 @@ void dcn42_init_hw(struct dc *dc)
if (dc->ctx->dc_bios->fw_info_valid) {
res_pool->ref_clocks.xtalin_clock_inKhz =
dc->ctx->dc_bios->fw_info.pll_info.crystal_frequency;
+ res_pool->ref_clocks.dmub_timer_refclk_khz =
+ dc->ctx->dc_bios->fw_info.pll_info.crystal_frequency;
if (res_pool->hubbub) {
(res_pool->dccg->funcs->get_dccg_ref_freq)(res_pool->dccg,
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn50/dcn50_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn50/dcn50_hwseq.c
index 151ec838f613..2986eaa73eae 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn50/dcn50_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn50/dcn50_hwseq.c
@@ -582,6 +582,8 @@ void dcn50_init_hw(struct dc *dc)
if (dc->ctx->dc_bios->fw_info_valid) {
res_pool->ref_clocks.xtalin_clock_inKhz =
dc->ctx->dc_bios->fw_info.pll_info.crystal_frequency;
+ res_pool->ref_clocks.dmub_timer_refclk_khz =
+ dc->ctx->dc_bios->fw_info.pll_info.crystal_frequency;
if (res_pool->hubbub) {
(res_pool->dccg->funcs->get_dccg_ref_freq)(res_pool->dccg,
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 f1b6053fa5c6..09395f5d4e13 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/core_types.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/core_types.h
@@ -317,6 +317,7 @@ struct resource_pool {
unsigned int xtalin_clock_inKhz;
unsigned int dccg_ref_clock_inKhz;
unsigned int dchub_ref_clock_inKhz;
+ unsigned int dmub_timer_refclk_khz;
} ref_clocks;
unsigned int timing_generator_count;
unsigned int mpcc_count;
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn60/dcn60_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn60/dcn60_resource.c
index 1d7074451ac1..7fa1bcbd00ef 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn60/dcn60_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn60/dcn60_resource.c
@@ -107,6 +107,8 @@ enum dcn60_clk_src_array_id {
static const uint32_t MCACHE_ID_UNASSIGNED = 0xF;
static const uint32_t SPLIT_LOCATION_UNDEFINED = 0xFFFF;
+#define DCN60_DMUB_TIMER_REFCLK_KHZ 100000
+
/* DCN */
#define BASE_INNER(seg) ctx->dcn_reg_offsets[seg]
@@ -2010,6 +2012,8 @@ static bool dcn60_resource_construct(
pool->base.res_cap = &res_cap_dcn6_0;
+ pool->base.ref_clocks.dmub_timer_refclk_khz = DCN60_DMUB_TIMER_REFCLK_KHZ;
+
/* max number of pipes for ASIC before checking for pipe fuses */
num_pipes = pool->base.res_cap->num_timing_generator;
pipe_fuses = read_pipe_fuses(ctx);
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* [PATCH 15/27] drm/amd/display: Guard connector I2C transfer without DDC pin
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (13 preceding siblings ...)
2026-11-25 6:55 ` [PATCH 14/27] drm/amd/display: Add DMUB timer reference clock to ref_clocks Chenyu Chen
@ 2026-11-25 6:55 ` Chenyu Chen
2026-11-28 9:43 ` Eren Özen
2026-11-25 6:55 ` [PATCH 16/27] drm/amd/display: Refactor ABM_SET_PIPE and ABM_SET_IMMEDIATE_DISABLE Chenyu Chen
` (13 subsequent siblings)
28 siblings, 1 reply; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:55 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, James Lin, Chenyu Chen
From: James Lin <pinglei.lin@amd.com>
[Why]
amdgpu_dm_i2c_xfer() checks for a missing DDC pin only after
considering the native DP AUX transfer path. A connector without
a DDC pin can therefore reach that path before the check.
[How]
Move the DDC pin check to the beginning of amdgpu_dm_i2c_xfer()
and return -EIO before selecting an I2C transfer path.
Cc: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: James Lin <pinglei.lin@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
index 41fc641b1b60..1acc2b44c968 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
@@ -3442,6 +3442,9 @@ STATIC_IFN_KUNIT int amdgpu_dm_i2c_xfer(struct i2c_adapter *i2c_adap,
int i;
int result = -EIO;
+ if (!ddc_service->ddc_pin)
+ return result;
+
if (!i2c->oem) {
struct dc_link *link = ddc_service->link;
struct amdgpu_dm_connector *aconnector = link->priv;
@@ -3458,9 +3461,6 @@ STATIC_IFN_KUNIT int amdgpu_dm_i2c_xfer(struct i2c_adapter *i2c_adap,
return i2c_transfer(&aconnector->dm_dp_aux.aux.ddc, msgs, num);
}
- if (!ddc_service->ddc_pin)
- return result;
-
cmd.payloads = kzalloc_objs(struct i2c_payload, num);
if (!cmd.payloads)
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* Re: [PATCH 15/27] drm/amd/display: Guard connector I2C transfer without DDC pin
2026-11-25 6:55 ` [PATCH 15/27] drm/amd/display: Guard connector I2C transfer without DDC pin Chenyu Chen
@ 2026-11-28 9:43 ` Eren Özen
0 siblings, 0 replies; 31+ messages in thread
From: Eren Özen @ 2026-11-28 9:43 UTC (permalink / raw)
To: Chenyu Chen
Cc: amd-gfx, Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li,
Wayne Lin, Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu,
Ivan Lipski, Alex Hung, James Lin, Mario Limonciello
Hi James, Chenyu,
This fixes the dm_test_i2c_xfer_no_ddc_pin() crash I reported on
11-18 against commit 48b8c06b05ad ("drm/amd/display: Route connector
DDC over AUX for native DP sinks"):
https://lore.kernel.org/all/QU464501lRPW3X8es-jXBFOvvwqS3eKR3HRS33U6x6o5eYC6h5AKV7f3ZXRCaU7-sEcupJMHereqyDUsUSG_fsOMNwvGO_CcZRKsz1AgObk=@protonmail.com/
I think moving the check to the top also turns off the AUX routing on
links that have no DDC pin. ddc_service_construct() leaves ddc_pin
NULL for USB4 DPIA links and for force_to_use_aux links (no_ddc_pin
on ASICs with dp_connector_no_native_i2c, i.e. DCN 4.2b and DCN 6.0).
Those connectors still get the hw i2c adapter as their "ddc" bus, and
AUX is the only way to reach the sink. With this patch, DDC/CI through
that bus fails with -EIO there again, and that's the case
48b8c06b05ad was written for (fwupd). I found this by reading the
code and haven't tested it on DPIA hardware.
Mario's v4 fixes the crash without that side effect: it checks
ddc_service->link before using it and keeps the routing. It also
carries my test fix, which gives the test a zeroed dc_link:
https://lore.kernel.org/all/20261118-superm1-amdgpu-ddc-v4-1-539eaeb4edd7@kernel.org/
Could this patch be dropped in favour of v4, or changed to check
ddc_service->link instead? If it stays as it is, could you please add
the tags below? These are some of my first kernel contributions, so
the credit would mean a lot to me.
Fixes: 48b8c06b05ad ("drm/amd/display: Route connector DDC over AUX for native DP sinks")
Reported-by: Eren Özen <erenozen@protonmail.com>
Closes: https://lore.kernel.org/all/QU464501lRPW3X8es-jXBFOvvwqS3eKR3HRS33U6x6o5eYC6h5AKV7f3ZXRCaU7-sEcupJMHereqyDUsUSG_fsOMNwvGO_CcZRKsz1AgObk=@protonmail.com/
Thanks,
Eren
^ permalink raw reply [flat|nested] 31+ messages in thread
* [PATCH 16/27] drm/amd/display: Refactor ABM_SET_PIPE and ABM_SET_IMMEDIATE_DISABLE
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (14 preceding siblings ...)
2026-11-25 6:55 ` [PATCH 15/27] drm/amd/display: Guard connector I2C transfer without DDC pin Chenyu Chen
@ 2026-11-25 6:55 ` Chenyu Chen
2026-11-25 6:55 ` [PATCH 17/27] drm/amd/display: Implement link_set_dpms_off_v2 Chenyu Chen
` (12 subsequent siblings)
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:55 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, Rafal Ostrowski, Alvin Lee,
Chenyu Chen
From: Rafal Ostrowski <rafal.ostrowski@amd.com>
[Why]
- Both steps carried dc and pipe_ctx, which breaks the block sequence
rules on flat params and instance specification.
- ABM_SET_IMMEDIATE_DISABLE also stored the panel backlight level, which
belongs to a different HW block (panel_cntl).
[How]
- Both steps share set_abm_pipe_params: the ABM handle, otg, panel and
pwrseq instances and the ABM type of the panel. The builder resolves
them with hwss_prepare_abm_set_pipe(), which the legacy dcn21 path
uses too.
- Add a sixth parameter, feature_support, to abm_funcs.set_pipe_ex so
the executor needs no dc lookup. The type is the new enum
abm_feature_support in abm.h.
- Rename abm_feature_support() in dmub_abm.c to
dmub_abm_feature_support(), declare it in dmub_abm.h and make it
return the new enum. It looks the panel up by panel_inst, so the ABM
type is unchanged.
hwss_prepare_abm_set_pipe() uses it, like the other dmub_abm hooks.
- Adders return bool and hold all null and hook checks. Both adders
require set_pipe_ex: no ASIC that runs the block sequence creates a
DMCU, so the DMCU branch is gone from the BLS path. The level 0/255
skip for non-CACP panels applies as in dcn21_set_abm_immediate_disable.
- Add PANEL_CNTL_STORE_BACKLIGHT_LEVEL. The callers add it with
hwss_add_abm_immediate_disable_and_store_backlight(), which checks
both free slots and the store hook first, so the ABM is never
disabled without storing the backlight level.
Cc: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Rafal Ostrowski <rafal.ostrowski@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
drivers/gpu/drm/amd/display/dc/core/dc.c | 2 +-
.../drm/amd/display/dc/core/dc_hw_sequencer.c | 164 ++++++++++++++----
drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c | 66 ++++---
drivers/gpu/drm/amd/display/dc/dce/dmub_abm.h | 2 +
.../amd/display/dc/hwss/dcn21/dcn21_hwseq.c | 108 ++++++------
.../amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 6 +-
.../drm/amd/display/dc/hwss/hw_sequencer.h | 49 ++++--
drivers/gpu/drm/amd/display/dc/inc/hw/abm.h | 10 +-
8 files changed, 267 insertions(+), 140 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 584eb3e0f4c6..032ce62c810e 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -4471,7 +4471,7 @@ static void commit_planes_do_stream_update_sequence(struct dc *dc,
if (should_program_abm) {
if (*stream_update->abm_level == ABM_LEVEL_IMMEDIATE_DISABLE) {
- hwss_add_abm_set_immediate_disable(&seq_state, dc, pipe_ctx);
+ hwss_add_abm_immediate_disable_and_store_backlight(&seq_state, pipe_ctx);
} else {
hwss_add_abm_set_level(&seq_state, pipe_ctx->stream_res.abm, stream->abm_level);
}
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c
index 079a9ee8c5f5..0cd17e0a4b9f 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c
@@ -40,6 +40,7 @@
#include "clk_mgr.h"
#include "dcn10/dcn10_hubbub.h"
#include "dce/dmub_hw_lock_mgr.h"
+#include "dce/dmub_abm.h"
#include "link_service.h"
#include "custom_float.h"
@@ -1926,13 +1927,16 @@ void hwss_execute_sequence(struct dc *dc,
hwss_opp_set_disp_pattern_generator(params);
break;
case ABM_SET_PIPE:
- hwss_set_abm_pipe(params);
+ hwss_abm_set_pipe(params);
break;
case ABM_SET_LEVEL:
- hwss_set_abm_level(params);
+ hwss_abm_set_level(params);
break;
case ABM_SET_IMMEDIATE_DISABLE:
- hwss_set_abm_immediate_disable(params);
+ hwss_abm_set_immediate_disable(params);
+ break;
+ case PANEL_CNTL_STORE_BACKLIGHT_LEVEL:
+ hwss_panel_cntl_store_backlight_level(params);
break;
case MPC_REMOVE_MPCC:
hwss_mpc_remove_mpcc(params);
@@ -2948,19 +2952,64 @@ void hwss_add_opp_program_left_edge_extra_pixel(struct block_sequence_state *seq
}
}
+bool hwss_should_skip_abm_immediate_disable(const struct pipe_ctx *pipe_ctx)
+{
+ const struct dc_stream_state *stream = pipe_ctx->stream;
+ const struct dc_link *link = stream->link;
+
+ // make a short term w/a for an issue that backlight ramping unexpectedly paused in the middle,
+ // will decouple backlight from ABM and redefine DMUB interface, then this w/a could be removed
+ return (stream->abm_level == 0 || stream->abm_level == ABM_LEVEL_IMMEDIATE_DISABLE) &&
+ (link && !link->panel_config.cacp.cacp_supported);
+}
+
+bool hwss_prepare_abm_set_pipe(const struct pipe_ctx *pipe_ctx,
+ struct set_abm_pipe_params *params)
+{
+ struct abm *abm = pipe_ctx->stream_res.abm;
+ struct timing_generator *tg = pipe_ctx->stream_res.tg;
+ struct panel_cntl *panel_cntl = NULL;
+
+ memset(params, 0, sizeof(*params));
+
+ if (!pipe_ctx->stream || !pipe_ctx->stream->link)
+ return false;
+
+ panel_cntl = pipe_ctx->stream->link->panel_cntl;
+
+ if (!abm || !tg || !panel_cntl)
+ return false;
+
+ params->abm = abm;
+ params->otg_inst = tg->inst;
+ params->panel_inst = panel_cntl->inst;
+ params->pwrseq_inst = panel_cntl->pwrseq_inst;
+ params->abm_feature_support = dmub_abm_feature_support(abm, params->panel_inst);
+
+ return true;
+}
+
/*
* Helper function to add ABM set pipe to block sequence
*/
-void hwss_add_abm_set_pipe(struct block_sequence_state *seq_state,
- struct dc *dc,
+bool hwss_add_abm_set_pipe(struct block_sequence_state *seq_state,
struct pipe_ctx *pipe_ctx)
{
- if (*seq_state->num_steps < MAX_HWSS_BLOCK_SEQUENCE_SIZE) {
- seq_state->steps[*seq_state->num_steps].params.set_abm_pipe_params.dc = dc;
- seq_state->steps[*seq_state->num_steps].params.set_abm_pipe_params.pipe_ctx = pipe_ctx;
- seq_state->steps[*seq_state->num_steps].func = ABM_SET_PIPE;
- (*seq_state->num_steps)++;
- }
+ struct set_abm_pipe_params prepared = {};
+
+ if (!seq_state || !seq_state->steps || !seq_state->num_steps ||
+ *seq_state->num_steps >= MAX_HWSS_BLOCK_SEQUENCE_SIZE || !pipe_ctx)
+ return false;
+
+ if (!hwss_prepare_abm_set_pipe(pipe_ctx, &prepared) ||
+ !prepared.abm->funcs || !prepared.abm->funcs->set_pipe_ex)
+ return false;
+
+ seq_state->steps[*seq_state->num_steps].func = ABM_SET_PIPE;
+ seq_state->steps[*seq_state->num_steps].params.set_abm_pipe_params = prepared;
+ (*seq_state->num_steps)++;
+
+ return true;
}
/*
@@ -3803,15 +3852,15 @@ void hwss_opp_set_disp_pattern_generator(union block_sequence_params *params)
}
}
-void hwss_set_abm_pipe(union block_sequence_params *params)
+void hwss_abm_set_pipe(union block_sequence_params *params)
{
- struct dc *dc = params->set_abm_pipe_params.dc;
- struct pipe_ctx *pipe_ctx = params->set_abm_pipe_params.pipe_ctx;
+ struct set_abm_pipe_params *p = ¶ms->set_abm_pipe_params;
- dc->hwss.set_pipe(pipe_ctx);
+ p->abm->funcs->set_pipe_ex(p->abm, p->otg_inst, SET_ABM_PIPE_NORMAL, p->panel_inst,
+ p->pwrseq_inst, p->abm_feature_support);
}
-void hwss_set_abm_level(union block_sequence_params *params)
+void hwss_abm_set_level(union block_sequence_params *params)
{
struct abm *abm = params->set_abm_level_params.abm;
unsigned int abm_level = params->set_abm_level_params.abm_level;
@@ -3820,13 +3869,19 @@ void hwss_set_abm_level(union block_sequence_params *params)
abm->funcs->set_abm_level(abm, abm_level);
}
-void hwss_set_abm_immediate_disable(union block_sequence_params *params)
+void hwss_abm_set_immediate_disable(union block_sequence_params *params)
{
- struct dc *dc = params->set_abm_immediate_disable_params.dc;
- struct pipe_ctx *pipe_ctx = params->set_abm_immediate_disable_params.pipe_ctx;
+ struct set_abm_pipe_params *p = ¶ms->set_abm_immediate_disable_params;
- if (dc && dc->hwss.set_abm_immediate_disable)
- dc->hwss.set_abm_immediate_disable(pipe_ctx);
+ p->abm->funcs->set_pipe_ex(p->abm, p->otg_inst, SET_ABM_PIPE_IMMEDIATELY_DISABLE,
+ p->panel_inst, p->pwrseq_inst, p->abm_feature_support);
+}
+
+void hwss_panel_cntl_store_backlight_level(union block_sequence_params *params)
+{
+ struct panel_cntl *panel_cntl = params->panel_cntl_store_backlight_level_params.panel_cntl;
+
+ panel_cntl->funcs->store_backlight_level(panel_cntl);
}
void hwss_mpc_remove_mpcc(union block_sequence_params *params)
@@ -5112,15 +5167,66 @@ void hwss_add_dc_set_optimized_required(struct block_sequence_state *seq_state,
}
}
-void hwss_add_abm_set_immediate_disable(struct block_sequence_state *seq_state,
- struct dc *dc, struct pipe_ctx *pipe_ctx)
+bool hwss_add_abm_set_immediate_disable(struct block_sequence_state *seq_state,
+ struct pipe_ctx *pipe_ctx)
{
- if (*seq_state->num_steps < MAX_HWSS_BLOCK_SEQUENCE_SIZE) {
- seq_state->steps[*seq_state->num_steps].func = ABM_SET_IMMEDIATE_DISABLE;
- seq_state->steps[*seq_state->num_steps].params.set_abm_immediate_disable_params.dc = dc;
- seq_state->steps[*seq_state->num_steps].params.set_abm_immediate_disable_params.pipe_ctx = pipe_ctx;
- (*seq_state->num_steps)++;
- }
+ struct set_abm_pipe_params prepared = {};
+
+ if (!seq_state || !seq_state->steps || !seq_state->num_steps ||
+ *seq_state->num_steps >= MAX_HWSS_BLOCK_SEQUENCE_SIZE || !pipe_ctx)
+ return false;
+
+ if (!hwss_prepare_abm_set_pipe(pipe_ctx, &prepared) ||
+ !prepared.abm->funcs || !prepared.abm->funcs->set_pipe_ex)
+ return false;
+
+ if (hwss_should_skip_abm_immediate_disable(pipe_ctx))
+ return false;
+
+ seq_state->steps[*seq_state->num_steps].func = ABM_SET_IMMEDIATE_DISABLE;
+ seq_state->steps[*seq_state->num_steps].params.set_abm_immediate_disable_params = prepared;
+ (*seq_state->num_steps)++;
+
+ return true;
+}
+
+bool hwss_add_panel_cntl_store_backlight_level(struct block_sequence_state *seq_state,
+ struct panel_cntl *panel_cntl)
+{
+ if (!seq_state || !seq_state->steps || !seq_state->num_steps ||
+ *seq_state->num_steps >= MAX_HWSS_BLOCK_SEQUENCE_SIZE || !panel_cntl)
+ return false;
+
+ if (!panel_cntl->funcs || !panel_cntl->funcs->store_backlight_level)
+ return false;
+
+ seq_state->steps[*seq_state->num_steps].func = PANEL_CNTL_STORE_BACKLIGHT_LEVEL;
+ seq_state->steps[*seq_state->num_steps]
+ .params.panel_cntl_store_backlight_level_params.panel_cntl = panel_cntl;
+ (*seq_state->num_steps)++;
+
+ return true;
+}
+
+bool hwss_add_abm_immediate_disable_and_store_backlight(
+ struct block_sequence_state *seq_state, struct pipe_ctx *pipe_ctx)
+{
+ struct panel_cntl *panel_cntl;
+
+ if (!seq_state || !seq_state->num_steps || !pipe_ctx || !pipe_ctx->stream ||
+ !pipe_ctx->stream->link)
+ return false;
+
+ panel_cntl = pipe_ctx->stream->link->panel_cntl;
+
+ if (*seq_state->num_steps + 2 > MAX_HWSS_BLOCK_SEQUENCE_SIZE || !panel_cntl ||
+ !panel_cntl->funcs || !panel_cntl->funcs->store_backlight_level)
+ return false;
+
+ if (!hwss_add_abm_set_immediate_disable(seq_state, pipe_ctx))
+ return false;
+
+ return hwss_add_panel_cntl_store_backlight_level(seq_state, panel_cntl);
}
void hwss_add_opp_set_disp_pattern_generator(struct block_sequence_state *seq_state,
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c b/drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c
index 8cca8599b917..b50260d2bd45 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c
@@ -35,33 +35,26 @@
#define TO_DMUB_ABM(abm)\
container_of(abm, struct dce_abm, base)
-#define ABM_FEATURE_NO_SUPPORT 0
-#define ABM_LCD_SUPPORT 1
-#define ABM_CACP_SUPPORT 2
-
-static unsigned int abm_feature_support(struct abm *abm, unsigned int panel_inst)
+enum abm_feature_support dmub_abm_feature_support(struct abm *abm, unsigned int panel_inst)
{
- struct dc_context *dc = abm->ctx;
struct dc_link *edp_links[MAX_NUM_EDP];
- unsigned int i, edp_num;
- unsigned int ret = ABM_FEATURE_NO_SUPPORT;
+ unsigned int edp_num;
+ const struct dc_link *link;
- dc_get_edp_links(dc->dc, edp_links, &edp_num);
+ dc_get_edp_links(abm->ctx->dc, edp_links, &edp_num);
- for (i = 0; i < edp_num; i++) {
- if (panel_inst == i)
- break;
- }
+ if (panel_inst >= edp_num)
+ return ABM_FEATURE_NO_SUPPORT;
- if (i < edp_num) {
- if (edp_links[panel_inst]->panel_config.cacp.cacp_supported)
- ret = ABM_CACP_SUPPORT;
- else if ((edp_links[panel_inst]->panel_type == PANEL_TYPE_LCD) ||
- (edp_links[panel_inst]->panel_type == PANEL_TYPE_MINILED))
- ret = ABM_LCD_SUPPORT;
- }
+ link = edp_links[panel_inst];
- return ret;
+ if (link->panel_config.cacp.cacp_supported)
+ return ABM_CACP_SUPPORT;
+
+ if (link->panel_type == PANEL_TYPE_LCD || link->panel_type == PANEL_TYPE_MINILED)
+ return ABM_LCD_SUPPORT;
+
+ return ABM_FEATURE_NO_SUPPORT;
}
static enum dc_panel_type abm_get_paneltype(struct abm *abm, unsigned int panel_inst)
@@ -115,12 +108,13 @@ static unsigned int dmub_abm_get_target_backlight_ex(struct abm *abm)
static bool dmub_abm_set_level_ex(struct abm *abm, uint32_t level)
{
bool ret = false;
- unsigned int feature_support, i;
+ enum abm_feature_support feature_support;
+ unsigned int i;
uint8_t panel_mask0 = 0;
uint8_t panel_mask1 = 0;
for (i = 0; i < MAX_NUM_EDP; i++) {
- feature_support = abm_feature_support(abm, i);
+ feature_support = dmub_abm_feature_support(abm, i);
if (feature_support == ABM_LCD_SUPPORT)
panel_mask0 |= (0x01 << i);
@@ -142,9 +136,9 @@ static bool dmub_abm_init_config_ex(struct abm *abm,
unsigned int bytes,
unsigned int inst)
{
- unsigned int feature_support;
+ enum abm_feature_support feature_support;
- feature_support = abm_feature_support(abm, inst);
+ feature_support = dmub_abm_feature_support(abm, inst);
if (feature_support == ABM_LCD_SUPPORT)
dmub_abm_init_config(abm, src, bytes, inst);
@@ -157,9 +151,9 @@ static bool dmub_abm_init_config_ex(struct abm *abm,
static bool dmub_abm_set_pause_ex(struct abm *abm, bool pause, unsigned int panel_inst, unsigned int stream_inst)
{
bool ret = false;
- unsigned int feature_support;
+ enum abm_feature_support feature_support;
- feature_support = abm_feature_support(abm, panel_inst);
+ feature_support = dmub_abm_feature_support(abm, panel_inst);
if (feature_support == ABM_LCD_SUPPORT)
ret = dmub_abm_set_pause(abm, pause, panel_inst, stream_inst);
@@ -184,10 +178,10 @@ static bool dmub_abm_save_restore_ex(
struct abm_save_restore *pData)
{
bool ret = false;
- unsigned int feature_support;
+ enum abm_feature_support feature_support;
struct dc_context *dc = abm->ctx;
- feature_support = abm_feature_support(abm, panel_inst);
+ feature_support = dmub_abm_feature_support(abm, panel_inst);
if (feature_support == ABM_LCD_SUPPORT)
ret = dmub_abm_save_restore(dc, panel_inst, pData);
@@ -199,12 +193,10 @@ static bool dmub_abm_set_pipe_ex(struct abm *abm,
uint32_t otg_inst,
uint32_t option,
uint32_t panel_inst,
- uint32_t pwrseq_inst)
+ uint32_t pwrseq_inst,
+ enum abm_feature_support feature_support)
{
bool ret = false;
- unsigned int feature_support;
-
- feature_support = abm_feature_support(abm, panel_inst);
if (feature_support == ABM_LCD_SUPPORT)
ret = dmub_abm_set_pipe(abm, otg_inst, option, panel_inst, pwrseq_inst);
@@ -219,9 +211,9 @@ static bool dmub_abm_set_event_ex(struct abm *abm, unsigned int full_screen, uns
unsigned int panel_inst)
{
bool ret = false;
- unsigned int feature_support;
+ enum abm_feature_support feature_support;
- feature_support = abm_feature_support(abm, panel_inst);
+ feature_support = dmub_abm_feature_support(abm, panel_inst);
if (feature_support == ABM_LCD_SUPPORT)
ret = dmub_abm_set_event(abm, scaling_enable, scaling_strength_map, panel_inst);
@@ -239,10 +231,10 @@ static bool dmub_abm_set_backlight_level_pwm_ex(struct abm *abm,
{
(void)controller_id;
bool ret = false;
- unsigned int feature_support;
+ enum abm_feature_support feature_support;
enum dc_panel_type panel_type = PANEL_TYPE_NONE;
- feature_support = abm_feature_support(abm, panel_inst);
+ feature_support = dmub_abm_feature_support(abm, panel_inst);
if (feature_support == ABM_LCD_SUPPORT)
ret = dmub_abm_set_backlight_level(abm, backlight_pwm_u16_16, frame_ramp, panel_inst);
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dmub_abm.h b/drivers/gpu/drm/amd/display/dc/dce/dmub_abm.h
index 3a5d5ac7a86e..eef2fa803aed 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dmub_abm.h
+++ b/drivers/gpu/drm/amd/display/dc/dce/dmub_abm.h
@@ -37,4 +37,6 @@ struct abm *dmub_abm_create(
void dmub_abm_destroy(struct abm **abm);
+enum abm_feature_support dmub_abm_feature_support(struct abm *abm, unsigned int panel_inst);
+
#endif
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 2be68f8dd0fc..673fc188fca9 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
@@ -197,55 +197,51 @@ static void dmub_abm_set_backlight(struct dc_context *dc, uint32_t backlight_pwm
void dcn21_set_abm_immediate_disable(struct pipe_ctx *pipe_ctx)
{
- struct abm *abm = pipe_ctx->stream_res.abm;
- uint32_t otg_inst = pipe_ctx->stream_res.tg->inst;
- struct panel_cntl *panel_cntl = pipe_ctx->stream->link->panel_cntl;
+ struct set_abm_pipe_params params = {};
struct dmcu *dmcu = pipe_ctx->stream->ctx->dc->res_pool->dmcu;
struct dc_link *link = pipe_ctx->stream->link;
+ struct abm *abm = NULL;
- // make a short term w/a for an issue that backlight ramping unexpectedly paused in the middle,
- // will decouple backlight from ABM and redefine DMUB interface, then this w/a could be removed
- if ((pipe_ctx->stream->abm_level == 0 || pipe_ctx->stream->abm_level == ABM_LEVEL_IMMEDIATE_DISABLE)
- && (link && !link->panel_config.cacp.cacp_supported)) {
+ if (hwss_should_skip_abm_immediate_disable(pipe_ctx))
return;
- }
if (dmcu) {
dce110_set_abm_immediate_disable(pipe_ctx);
return;
}
- if (abm && panel_cntl) {
- if (abm->funcs && abm->funcs->set_pipe_ex) {
- abm->funcs->set_pipe_ex(abm, otg_inst, SET_ABM_PIPE_IMMEDIATELY_DISABLE,
- panel_cntl->inst, panel_cntl->pwrseq_inst);
- } else if (link && link->panel_config.cacp.cacp_supported) {
- dcn21_dmub_cacp_set_pipe(abm, otg_inst, SET_CACP_PIPE_IMMEDIATELY_DISABLE,
- panel_cntl->inst, panel_cntl->pwrseq_inst);
- } else {
- dcn21_dmub_abm_set_pipe(abm,
- otg_inst,
- SET_ABM_PIPE_IMMEDIATELY_DISABLE,
- panel_cntl->inst,
- panel_cntl->pwrseq_inst);
- }
- panel_cntl->funcs->store_backlight_level(panel_cntl);
+ if (!hwss_prepare_abm_set_pipe(pipe_ctx, ¶ms))
+ return;
+
+ abm = params.abm;
+
+ if (abm->funcs && abm->funcs->set_pipe_ex) {
+ abm->funcs->set_pipe_ex(abm, params.otg_inst, SET_ABM_PIPE_IMMEDIATELY_DISABLE,
+ params.panel_inst, params.pwrseq_inst, params.abm_feature_support);
+ } else if (link->panel_config.cacp.cacp_supported) {
+ dcn21_dmub_cacp_set_pipe(abm, params.otg_inst, SET_CACP_PIPE_IMMEDIATELY_DISABLE,
+ params.panel_inst, params.pwrseq_inst);
+ } else {
+ dcn21_dmub_abm_set_pipe(abm,
+ params.otg_inst,
+ SET_ABM_PIPE_IMMEDIATELY_DISABLE,
+ params.panel_inst,
+ params.pwrseq_inst);
}
+ link->panel_cntl->funcs->store_backlight_level(link->panel_cntl);
}
void dcn21_set_pipe(struct pipe_ctx *pipe_ctx)
{
- struct abm *abm = pipe_ctx->stream_res.abm;
- struct timing_generator *tg = pipe_ctx->stream_res.tg;
- struct panel_cntl *panel_cntl = pipe_ctx->stream->link->panel_cntl;
+ struct set_abm_pipe_params params = {};
struct dmcu *dmcu = pipe_ctx->stream->ctx->dc->res_pool->dmcu;
struct dc_link *link = pipe_ctx->stream->link;
- uint32_t otg_inst;
+ struct abm *abm = NULL;
- if (!abm || !tg || !panel_cntl)
+ if (!hwss_prepare_abm_set_pipe(pipe_ctx, ¶ms))
return;
- otg_inst = tg->inst;
+ abm = params.abm;
if (dmcu) {
dce110_set_pipe(pipe_ctx);
@@ -254,20 +250,21 @@ void dcn21_set_pipe(struct pipe_ctx *pipe_ctx)
if (abm->funcs && abm->funcs->set_pipe_ex) {
abm->funcs->set_pipe_ex(abm,
- otg_inst,
+ params.otg_inst,
SET_ABM_PIPE_NORMAL,
- panel_cntl->inst,
- panel_cntl->pwrseq_inst);
+ params.panel_inst,
+ params.pwrseq_inst,
+ params.abm_feature_support);
} else {
- if (link && link->panel_config.cacp.cacp_supported)
- dcn21_dmub_cacp_set_pipe(abm, otg_inst, SET_CACP_PIPE_NORMAL,
- panel_cntl->inst, panel_cntl->pwrseq_inst);
+ if (link->panel_config.cacp.cacp_supported)
+ dcn21_dmub_cacp_set_pipe(abm, params.otg_inst, SET_CACP_PIPE_NORMAL,
+ params.panel_inst, params.pwrseq_inst);
else
- dcn21_dmub_abm_set_pipe(abm, otg_inst,
+ dcn21_dmub_abm_set_pipe(abm, params.otg_inst,
SET_ABM_PIPE_NORMAL,
- panel_cntl->inst,
- panel_cntl->pwrseq_inst);
+ params.panel_inst,
+ params.pwrseq_inst);
}
}
@@ -275,18 +272,16 @@ bool dcn21_set_backlight_level(struct pipe_ctx *pipe_ctx,
struct set_backlight_level_params *backlight_level_params)
{
struct dc_context *dc = pipe_ctx->stream->ctx;
- struct abm *abm = pipe_ctx->stream_res.abm;
- struct timing_generator *tg = pipe_ctx->stream_res.tg;
- struct panel_cntl *panel_cntl = pipe_ctx->stream->link->panel_cntl;
- uint32_t otg_inst;
+ struct set_abm_pipe_params params = {};
uint32_t backlight_pwm_u16_16 = backlight_level_params->backlight_pwm_u16_16;
uint32_t frame_ramp = backlight_level_params->frame_ramp;
struct dc_link *link = pipe_ctx->stream->link;
+ struct abm *abm = NULL;
- if (!abm || !tg || !panel_cntl)
+ if (!hwss_prepare_abm_set_pipe(pipe_ctx, ¶ms))
return false;
- otg_inst = tg->inst;
+ abm = params.abm;
if (dc->dc->res_pool->dmcu) {
dce110_set_backlight_level(pipe_ctx, backlight_level_params);
@@ -295,29 +290,30 @@ bool dcn21_set_backlight_level(struct pipe_ctx *pipe_ctx,
if (abm->funcs && abm->funcs->set_pipe_ex) {
abm->funcs->set_pipe_ex(abm,
- otg_inst,
+ params.otg_inst,
SET_ABM_PIPE_NORMAL,
- panel_cntl->inst,
- panel_cntl->pwrseq_inst);
+ params.panel_inst,
+ params.pwrseq_inst,
+ params.abm_feature_support);
} else {
- if (link && link->panel_config.cacp.cacp_supported)
- dcn21_dmub_cacp_set_pipe(abm, otg_inst,
+ if (link->panel_config.cacp.cacp_supported)
+ dcn21_dmub_cacp_set_pipe(abm, params.otg_inst,
SET_CACP_PIPE_NORMAL,
- panel_cntl->inst,
- panel_cntl->pwrseq_inst);
+ params.panel_inst,
+ params.pwrseq_inst);
else
dcn21_dmub_abm_set_pipe(abm,
- otg_inst,
+ params.otg_inst,
SET_ABM_PIPE_NORMAL,
- panel_cntl->inst,
- panel_cntl->pwrseq_inst);
+ params.panel_inst,
+ params.pwrseq_inst);
}
if (abm->funcs && abm->funcs->set_backlight_level_pwm)
abm->funcs->set_backlight_level_pwm(abm, backlight_pwm_u16_16,
- frame_ramp, 0, panel_cntl->inst);
+ frame_ramp, 0, params.panel_inst);
else
- dmub_abm_set_backlight(dc, backlight_pwm_u16_16, frame_ramp, panel_cntl->inst);
+ dmub_abm_set_backlight(dc, backlight_pwm_u16_16, frame_ramp, params.panel_inst);
return true;
}
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
index 7b1eca0e2b57..26b9137dc017 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
@@ -2553,7 +2553,7 @@ void dcn401_program_pipe_sequence(
/* Set ABM pipe after other pipe configurations done */
if ((pipe_ctx->plane_state && pipe_ctx->plane_state->visible)) {
if (pipe_ctx->stream_res.abm) {
- hwss_add_abm_set_pipe(seq_state, dc, pipe_ctx);
+ hwss_add_abm_set_pipe(seq_state, pipe_ctx);
hwss_add_abm_set_level(seq_state, pipe_ctx->stream_res.abm, pipe_ctx->stream->abm_level);
}
@@ -3382,7 +3382,7 @@ void dcn401_blank_pixel_data_sequence(
if (blank) {
/* Set ABM immediate disable */
- hwss_add_abm_set_immediate_disable(seq_state, dc, pipe_ctx);
+ hwss_add_abm_immediate_disable_and_store_backlight(seq_state, pipe_ctx);
if (dc->debug.visual_confirm != VISUAL_CONFIRM_DISABLE) {
test_pattern = CONTROLLER_DP_TEST_PATTERN_COLORSQUARES;
@@ -3432,7 +3432,7 @@ void dcn401_blank_pixel_data_sequence(
if (!blank) {
if (stream_res->abm) {
/* Set pipe for ABM */
- hwss_add_abm_set_pipe(seq_state, dc, pipe_ctx);
+ hwss_add_abm_set_pipe(seq_state, pipe_ctx);
/* Set ABM level */
hwss_add_abm_set_level(seq_state, stream_res->abm, stream->abm_level);
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h b/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h
index 4769c71f05fb..da795c6501f5 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h
+++ b/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h
@@ -34,6 +34,7 @@
#include "inc/core_status.h"
#include "inc/hw/hw_shared.h"
#include "inc/hw/dchubbub.h"
+#include "inc/hw/abm.h"
#include "dsc/dsc.h"
#include "link_service_types.h"
#include "dmub/inc/dmub_cmd.h"
@@ -772,9 +773,13 @@ struct opp_set_disp_pattern_generator_params {
bool disable_dyn_exp_for_test_pattern;
};
+/* Params of both ABM_SET_PIPE and ABM_SET_IMMEDIATE_DISABLE. */
struct set_abm_pipe_params {
- struct dc *dc;
- struct pipe_ctx *pipe_ctx;
+ struct abm *abm;
+ unsigned int otg_inst;
+ unsigned int panel_inst;
+ unsigned int pwrseq_inst;
+ enum abm_feature_support abm_feature_support; /* resolved at build time */
};
struct set_abm_level_params {
@@ -782,9 +787,8 @@ struct set_abm_level_params {
unsigned int abm_level;
};
-struct set_abm_immediate_disable_params {
- struct dc *dc;
- struct pipe_ctx *pipe_ctx;
+struct panel_cntl_store_backlight_level_params {
+ struct panel_cntl *panel_cntl;
};
struct mpc_update_blending_params {
@@ -1459,7 +1463,9 @@ union block_sequence_params {
struct opp_set_disp_pattern_generator_params opp_set_disp_pattern_generator_params;
struct set_abm_pipe_params set_abm_pipe_params;
struct set_abm_level_params set_abm_level_params;
- struct set_abm_immediate_disable_params set_abm_immediate_disable_params;
+ struct set_abm_pipe_params set_abm_immediate_disable_params;
+ struct panel_cntl_store_backlight_level_params
+ panel_cntl_store_backlight_level_params;
struct mpc_remove_mpcc_params mpc_remove_mpcc_params;
struct dc_set_optimized_required_params dc_set_optimized_required_params;
struct hubp_disconnect_params hubp_disconnect_params;
@@ -1896,6 +1902,7 @@ enum block_sequence_func {
HUBP_SET_3DLUT_FL,
PMFW_SEND_MESSAGE_AND_WAIT,
DMUB_SEND_DMCUB_CMD2,
+ PANEL_CNTL_STORE_BACKLIGHT_LEVEL,
/* This must be the last value in this enum, add new ones above */
HWSS_BLOCK_SEQUENCE_FUNC_COUNT
};
@@ -2500,11 +2507,13 @@ void hwss_opp_program_bit_depth_reduction(union block_sequence_params *params);
void hwss_opp_set_disp_pattern_generator(union block_sequence_params *params);
-void hwss_set_abm_pipe(union block_sequence_params *params);
+void hwss_abm_set_pipe(union block_sequence_params *params);
-void hwss_set_abm_level(union block_sequence_params *params);
+void hwss_abm_set_level(union block_sequence_params *params);
-void hwss_set_abm_immediate_disable(union block_sequence_params *params);
+void hwss_abm_set_immediate_disable(union block_sequence_params *params);
+
+void hwss_panel_cntl_store_backlight_level(union block_sequence_params *params);
void hwss_mpc_remove_mpcc(union block_sequence_params *params);
@@ -2805,8 +2814,13 @@ void hwss_add_opp_program_fmt(struct block_sequence_state *seq_state,
struct output_pixel_processor *opp, struct bit_depth_reduction_params *fmt_bit_depth,
struct clamping_and_pixel_encoding_params *clamping);
-void hwss_add_abm_set_pipe(struct block_sequence_state *seq_state,
- struct dc *dc, struct pipe_ctx *pipe_ctx);
+bool hwss_add_abm_set_pipe(struct block_sequence_state *seq_state,
+ struct pipe_ctx *pipe_ctx);
+
+bool hwss_prepare_abm_set_pipe(const struct pipe_ctx *pipe_ctx,
+ struct set_abm_pipe_params *params);
+
+bool hwss_should_skip_abm_immediate_disable(const struct pipe_ctx *pipe_ctx);
void hwss_add_abm_set_level(struct block_sequence_state *seq_state,
struct abm *abm, uint32_t abm_level);
@@ -2842,8 +2856,17 @@ void hwss_add_dsc_disconnect(struct block_sequence_state *seq_state,
void hwss_add_dc_set_optimized_required(struct block_sequence_state *seq_state,
bool optimized_required);
-void hwss_add_abm_set_immediate_disable(struct block_sequence_state *seq_state,
- struct dc *dc, struct pipe_ctx *pipe_ctx);
+/* Callers must use hwss_add_abm_immediate_disable_and_store_backlight(): this step alone
+ * does not store the backlight level.
+ */
+bool hwss_add_abm_set_immediate_disable(struct block_sequence_state *seq_state,
+ struct pipe_ctx *pipe_ctx);
+
+bool hwss_add_panel_cntl_store_backlight_level(struct block_sequence_state *seq_state,
+ struct panel_cntl *panel_cntl);
+
+bool hwss_add_abm_immediate_disable_and_store_backlight(
+ struct block_sequence_state *seq_state, struct pipe_ctx *pipe_ctx);
void hwss_add_opp_set_disp_pattern_generator(struct block_sequence_state *seq_state,
struct output_pixel_processor *opp,
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/abm.h b/drivers/gpu/drm/amd/display/dc/inc/hw/abm.h
index e3fa987304da..925d80d956d8 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/abm.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/abm.h
@@ -27,6 +27,13 @@
#include "dm_services_types.h"
+/* ABM engine type a panel is driven by. */
+enum abm_feature_support {
+ ABM_FEATURE_NO_SUPPORT = 0,
+ ABM_LCD_SUPPORT = 1,
+ ABM_CACP_SUPPORT = 2,
+};
+
struct abm_save_restore;
struct abm {
@@ -66,7 +73,8 @@ struct abm_funcs {
unsigned int otg_inst,
unsigned int option,
unsigned int panel_inst,
- unsigned int pwrseq_inst);
+ unsigned int pwrseq_inst,
+ enum abm_feature_support feature_support);
bool (*set_abm_event)(struct abm *abm, unsigned int full_screen, unsigned int trans_info,
unsigned int hdr_mode, unsigned int scaling_enable, unsigned int scaling_strength_map,
unsigned int panel_inst);
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* [PATCH 17/27] drm/amd/display: Implement link_set_dpms_off_v2
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (15 preceding siblings ...)
2026-11-25 6:55 ` [PATCH 16/27] drm/amd/display: Refactor ABM_SET_PIPE and ABM_SET_IMMEDIATE_DISABLE Chenyu Chen
@ 2026-11-25 6:55 ` Chenyu Chen
2026-11-25 6:55 ` [PATCH 18/27] drm/amd/display: Add the immediate flip to the DC2 seamless update Chenyu Chen
` (11 subsequent siblings)
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:55 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, Dominik Kowalski, Wenjing Liu,
Chenyu Chen
From: Dominik Kowalski <dominik.kowalski@amd.com>
[Why & How]
Initial implementation of link_set_dpms_off_v2 in terms of new step
architecture, using temporarily exposed internals of v1. Will be
reworked in future work to remove use of pipe_ctx wherever possible.
Cc: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Dominik Kowalski <dominik.kowalski@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
.../drm/amd/display/dc/link/link_dpms_v1.c | 84 +++++++
.../drm/amd/display/dc/link/link_dpms_v1.h | 29 +++
.../drm/amd/display/dc/link/link_dpms_v2.c | 229 +++++++++++++++++-
3 files changed, 337 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/link/link_dpms_v1.c b/drivers/gpu/drm/amd/display/dc/link/link_dpms_v1.c
index 1a6fe2e12c06..4677ad4a2cd0 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_dpms_v1.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_dpms_v1.c
@@ -206,6 +206,12 @@ static bool is_master_pipe_for_link(const struct dc_link *link,
pipe->stream->link == link;
}
+bool link_dpms_impl_is_master_pipe_for_link(const struct dc_link *link,
+ const struct pipe_ctx *pipe)
+{
+ return is_master_pipe_for_link(link, pipe);
+}
+
/*
* This function finds all master pipes feeding to a given link with dpms set to
* on in given dc state.
@@ -329,6 +335,13 @@ static bool get_ext_hdmi_settings(
return true;
}
+bool link_dpms_impl_get_ext_hdmi_settings(const struct integrated_info *info,
+ enum engine_id eng_id,
+ struct ext_hdmi_settings *settings)
+{
+ return get_ext_hdmi_settings(info, eng_id, settings);
+}
+
static bool write_i2c(
const struct dc_link *link,
uint8_t address,
@@ -472,6 +485,14 @@ static bool write_i2c_retimer_setting(
return true;
}
+bool link_dpms_impl_write_i2c_retimer_setting(
+ const struct dc_link *link, bool is_vga_mode, bool is_over_340mhz,
+ struct ext_hdmi_settings *settings)
+{
+ return write_i2c_retimer_setting(link, is_vga_mode, is_over_340mhz,
+ settings);
+}
+
static bool write_i2c_default_retimer_setting(
const struct dc_link *link,
bool is_vga_mode,
@@ -503,6 +524,13 @@ static bool write_i2c_default_retimer_setting(
return true;
}
+bool link_dpms_impl_write_i2c_default_retimer_setting(
+ const struct dc_link *link, bool is_vga_mode, bool is_over_340mhz)
+{
+ return write_i2c_default_retimer_setting(link, is_vga_mode,
+ is_over_340mhz);
+}
+
static bool write_i2c_redriver_setting(
const struct dc_link *link,
bool is_over_340mhz)
@@ -528,6 +556,12 @@ static bool write_i2c_redriver_setting(
return success;
}
+bool link_dpms_impl_write_i2c_redriver_setting(const struct dc_link *link,
+ bool is_over_340mhz)
+{
+ return write_i2c_redriver_setting(link, is_over_340mhz);
+}
+
static struct link_encoder *get_link_encoder(struct pipe_ctx *pipe_ctx)
{
struct link_encoder *link_enc
@@ -611,6 +645,12 @@ static void update_psp_stream_config(struct pipe_ctx *pipe_ctx, bool dpms_off)
cp_psp->funcs.update_stream_config(cp_psp->handle, &config);
}
+void link_dpms_impl_update_psp_stream_config(struct pipe_ctx *pipe_ctx,
+ bool dpms_off)
+{
+ update_psp_stream_config(pipe_ctx, dpms_off);
+}
+
void link_wait_for_unlocked(struct dc_link *link)
{
unsigned long long enter_timestamp;
@@ -656,6 +696,11 @@ static void set_avmute(struct pipe_ctx *pipe_ctx, bool enable)
dc->hwss.set_avmute(pipe_ctx, enable);
}
+void link_dpms_impl_set_avmute(struct pipe_ctx *pipe_ctx, bool enable)
+{
+ set_avmute(pipe_ctx, enable);
+}
+
static void enable_mst_on_sink(struct dc_link *link, bool enable)
{
unsigned char mstmCntl = 0;
@@ -1387,6 +1432,11 @@ static enum dc_status deallocate_mst_payload(struct pipe_ctx *pipe_ctx)
return DC_OK;
}
+enum dc_status link_dpms_impl_deallocate_mst_payload(struct pipe_ctx *pipe_ctx)
+{
+ return deallocate_mst_payload(pipe_ctx);
+}
+
/* convert link_mst_stream_alloc_table to dm dp_mst_stream_alloc_table
* because stream_encoder is not exposed to dm
*/
@@ -1468,6 +1518,11 @@ static enum dc_status allocate_mst_payload(struct pipe_ctx *pipe_ctx)
return DC_OK;
}
+enum dc_status link_dpms_impl_allocate_mst_payload(struct pipe_ctx *pipe_ctx)
+{
+ return allocate_mst_payload(pipe_ctx);
+}
+
struct fixed31_32 link_calculate_sst_avg_time_slots_per_mtp(
const struct dc_stream_state *stream,
const struct dc_link *link)
@@ -1679,6 +1734,12 @@ static enum dc_status update_sst_payload(struct pipe_ctx *pipe_ctx,
return DC_OK;
}
+enum dc_status link_dpms_impl_update_sst_payload(struct pipe_ctx *pipe_ctx,
+ bool allocate)
+{
+ return update_sst_payload(pipe_ctx, allocate);
+}
+
enum dc_status link_reduce_mst_payload(struct pipe_ctx *pipe_ctx, uint32_t bw_in_kbps)
{
struct dc_stream_state *stream = pipe_ctx->stream;
@@ -1863,6 +1924,13 @@ static void disable_link(struct dc_link *link,
}
}
+void link_dpms_impl_disable_link(struct dc_link *link,
+ const struct link_resource *link_res,
+ enum signal_type signal)
+{
+ disable_link(link, link_res, signal);
+}
+
static void enable_link_hdmi(struct pipe_ctx *pipe_ctx)
{
struct dc_stream_state *stream = pipe_ctx->stream;
@@ -2366,6 +2434,12 @@ static bool allocate_usb4_bandwidth_for_stream(struct dc_stream_state *stream, i
return true;
}
+bool link_dpms_impl_allocate_usb4_bandwidth_for_stream(
+ struct dc_stream_state *stream, int stream_bw)
+{
+ return allocate_usb4_bandwidth_for_stream(stream, stream_bw);
+}
+
static bool allocate_usb4_bandwidth(struct dc_stream_state *stream)
{
ASSERT(stream->sink);
@@ -2393,6 +2467,11 @@ static bool deallocate_usb4_bandwidth(struct dc_stream_state *stream)
return ret;
}
+bool link_dpms_impl_deallocate_usb4_bandwidth(struct dc_stream_state *stream)
+{
+ return deallocate_usb4_bandwidth(stream);
+}
+
static struct vpg *get_vpg(struct pipe_ctx *pipe_ctx)
{
if (dc_is_hdmi_frl_signal(pipe_ctx->stream->signal))
@@ -2403,6 +2482,11 @@ static struct vpg *get_vpg(struct pipe_ctx *pipe_ctx)
return pipe_ctx->stream_res.stream_enc->vpg;
}
+struct vpg *link_dpms_impl_get_vpg(struct pipe_ctx *pipe_ctx)
+{
+ return get_vpg(pipe_ctx);
+}
+
enum dc_status link_set_dpms_off_v1(struct pipe_ctx *pipe_ctx)
{
DC_LOGGER_INIT(pipe_ctx->stream->ctx->logger);
diff --git a/drivers/gpu/drm/amd/display/dc/link/link_dpms_v1.h b/drivers/gpu/drm/amd/display/dc/link/link_dpms_v1.h
index b170c9a8622d..439372484f79 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_dpms_v1.h
+++ b/drivers/gpu/drm/amd/display/dc/link/link_dpms_v1.h
@@ -51,4 +51,33 @@ void link_set_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable);
bool link_set_dsc_enable(struct pipe_ctx *pipe_ctx, bool enable);
bool link_update_dsc_config(struct pipe_ctx *pipe_ctx);
void link_wait_for_unlocked(struct dc_link *link);
+
+// Temporarily exposed function during migration v1 -> v2, not public API
+enum dc_status link_dpms_impl_allocate_mst_payload(struct pipe_ctx *pipe_ctx);
+bool link_dpms_impl_allocate_usb4_bandwidth_for_stream(
+ struct dc_stream_state *stream, int stream_bw);
+enum dc_status link_dpms_impl_deallocate_mst_payload(struct pipe_ctx *pipe_ctx);
+bool link_dpms_impl_deallocate_usb4_bandwidth(struct dc_stream_state *stream);
+void link_dpms_impl_disable_link(struct dc_link *link,
+ const struct link_resource *link_res,
+ enum signal_type signal);
+bool link_dpms_impl_get_ext_hdmi_settings(const struct integrated_info *info,
+ enum engine_id eng_id,
+ struct ext_hdmi_settings *settings);
+struct vpg *link_dpms_impl_get_vpg(struct pipe_ctx *pipe_ctx);
+bool link_dpms_impl_is_master_pipe_for_link(const struct dc_link *link,
+ const struct pipe_ctx *pipe);
+void link_dpms_impl_set_avmute(struct pipe_ctx *pipe_ctx, bool enable);
+void link_dpms_impl_update_psp_stream_config(struct pipe_ctx *pipe_ctx,
+ bool dpms_off);
+enum dc_status link_dpms_impl_update_sst_payload(struct pipe_ctx *pipe_ctx,
+ bool allocate);
+bool link_dpms_impl_write_i2c_default_retimer_setting(
+ const struct dc_link *link, bool is_vga_mode, bool is_over_340mhz);
+bool link_dpms_impl_write_i2c_redriver_setting(const struct dc_link *link,
+ bool is_over_340mhz);
+bool link_dpms_impl_write_i2c_retimer_setting(
+ const struct dc_link *link, bool is_vga_mode, bool is_over_340mhz,
+ struct ext_hdmi_settings *settings);
+
#endif
diff --git a/drivers/gpu/drm/amd/display/dc/link/link_dpms_v2.c b/drivers/gpu/drm/amd/display/dc/link/link_dpms_v2.c
index 14f5bf4f53b1..5bbd9316cba2 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_dpms_v2.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_dpms_v2.c
@@ -26,11 +26,19 @@
#include "dc/link/link_dpms_v2.h"
#include "dc/inc/core_types.h"
+#include "dc/inc/hw/vpg.h"
#include "dc/inc/link_tx.h"
+#include "dc/link/link_dpms_v1.h"
+#include "dc/link/protocols/link_ddc.h"
+#include "dc/link/protocols/link_dp_capability.h"
+#include "dc/link/protocols/link_edp_panel_control.h"
+
+// Define required by logging framewok
+#define DC_LOGGER dc_logger
// TODO: This should be moved to dc_update_state_prepare
static void link_dpms_ctx_init(struct link_dpms_ctx *dpms_ctx,
- struct pipe_ctx *pipe_ctx)
+ struct pipe_ctx *pipe_ctx)
{
dpms_ctx->link_config = pipe_ctx->link_config;
@@ -40,15 +48,226 @@ static void link_dpms_ctx_init(struct link_dpms_ctx *dpms_ctx,
};
}
+static bool
+link_legacy_set_dpms_off_step_check_skipped(struct pipe_ctx *pipe_ctx)
+{
+ struct dc_stream_state *stream = pipe_ctx->stream;
+ struct dc_link *link = stream->link;
+ struct dal_logger *DC_LOGGER = stream->ctx->logger;
+
+ ASSERT(link_dpms_impl_is_master_pipe_for_link(link, pipe_ctx));
+
+ if (dc_is_virtual_signal(stream->signal))
+ /* No real hardware to program for virtual signals. */
+ return true;
+
+ if (stream->sink && stream->sink->sink_signal != SIGNAL_TYPE_VIRTUAL &&
+ stream->sink->sink_signal != SIGNAL_TYPE_NONE)
+ DC_LOG_DC(
+ "%s pipe_ctx dispname=%s signal=%x link=%d sink_count=%d\n",
+ __func__, stream->sink->edid_caps.display_name,
+ stream->signal, link->link_index, link->sink_count);
+
+ return false;
+}
+
+static void
+link_legacy_set_dpms_off_step_wait_for_unlocked(struct pipe_ctx *pipe_ctx)
+{
+ link_wait_for_unlocked(pipe_ctx->stream->link);
+}
+
+static void link_legacy_set_dpms_off_step_set_avmute(struct pipe_ctx *pipe_ctx)
+{
+ struct dc_stream_state *stream = pipe_ctx->stream;
+
+ if (stream->sink && !stream->sink->edid_caps.panel_patch.skip_avmute &&
+ dc_is_hdmi_signal(stream->signal))
+ link_dpms_impl_set_avmute(pipe_ctx, true);
+}
+
+static void
+link_legacy_set_dpms_off_step_disable_audio_stream(struct pipe_ctx *pipe_ctx)
+{
+ pipe_ctx->stream->ctx->dc->hwss.disable_audio_stream(pipe_ctx);
+}
+
+static void link_legacy_set_dpms_off_step_update_psp_stream_config(
+ struct pipe_ctx *pipe_ctx)
+{
+ link_dpms_impl_update_psp_stream_config(pipe_ctx, true);
+}
+
+static void
+link_legacy_set_dpms_off_step_blank_stream(struct pipe_ctx *pipe_ctx)
+{
+ pipe_ctx->stream->ctx->dc->hwss.blank_stream(pipe_ctx);
+}
+
+static void link_legacy_set_dpms_off_step_deallocate_usb4_bandwidth(
+ struct pipe_ctx *pipe_ctx)
+{
+ if (pipe_ctx->stream->sink &&
+ pipe_ctx->link_config.dp_tunnel_settings.should_use_dp_bw_allocation)
+ link_dpms_impl_deallocate_usb4_bandwidth(pipe_ctx->stream);
+}
+
+static void
+link_legacy_set_dpms_off_step_update_payloads(struct pipe_ctx *pipe_ctx)
+{
+ struct dc_stream_state *stream = pipe_ctx->stream;
+
+ if (stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST)
+ link_dpms_impl_deallocate_mst_payload(pipe_ctx);
+ else if (dc_is_dp_sst_signal(stream->signal) &&
+ dp_is_128b_132b_signal(pipe_ctx))
+ link_dpms_impl_update_sst_payload(pipe_ctx, false);
+}
+
+static void
+link_legacy_set_dpms_off_step_configure_hdmi(struct pipe_ctx *pipe_ctx)
+{
+ if (!dc_is_hdmi_signal(pipe_ctx->stream->signal))
+ return;
+
+ const uint32_t mhz_multiplier = 1000;
+ const uint32_t vbios_hdmi_freq = 165 * mhz_multiplier;
+
+ struct dc_stream_state *stream = pipe_ctx->stream;
+ struct dc_link *link = stream->link;
+ struct ext_hdmi_settings settings = { 0 };
+ const enum engine_id eng_id = pipe_ctx->stream_res.stream_enc->id;
+ const struct integrated_info *info =
+ stream->ctx->dc_bios->integrated_info;
+
+ write_scdc_data(link->ddc, vbios_hdmi_freq, false);
+
+ switch (link->chip_caps & AMD_EXT_DISPLAY_PATH_CAPS__EXT_CHIP_MASK) {
+ case AMD_EXT_DISPLAY_PATH_CAPS__HDMI20_TISN65DP159RSBT:
+ if (link_dpms_impl_get_ext_hdmi_settings(info, eng_id,
+ &settings))
+ link_dpms_impl_write_i2c_retimer_setting(
+ link, false, false, &settings);
+ else
+ link_dpms_impl_write_i2c_default_retimer_setting(
+ link, false, false);
+ break;
+ case AMD_EXT_DISPLAY_PATH_CAPS__HDMI20_PI3EQX1204:
+ link_dpms_impl_write_i2c_redriver_setting(link, false);
+ break;
+ }
+}
+
+static void
+link_legacy_set_dpms_off_step_disable_link_and_stream(struct pipe_ctx *pipe_ctx)
+{
+ struct dc_stream_state *stream = pipe_ctx->stream;
+ struct dc_link *link = stream->link;
+ const struct hw_sequencer_funcs *hwss = &link->ctx->dc->hwss;
+
+ if (stream->signal == SIGNAL_TYPE_DISPLAY_PORT &&
+ !dp_is_128b_132b_signal(pipe_ctx)) {
+ /* In DP1.x SST mode, our encoder will go to TPS1
+ * when link is on but stream is off.
+ * Disabling link before stream will avoid exposing TPS1 pattern
+ * during the disable sequence as it will confuse some receivers
+ * state machine.
+ * In DP2 or MST mode, our encoder will stay video active
+ */
+ link_dpms_impl_disable_link(link, &pipe_ctx->link_res,
+ stream->signal);
+ hwss->disable_stream(pipe_ctx);
+ } else {
+ hwss->disable_stream(pipe_ctx);
+ link_dpms_impl_disable_link(link, &pipe_ctx->link_res,
+ stream->signal);
+ }
+}
+
+static void
+link_legacy_set_dpms_off_step_set_edp_panel_assr(struct pipe_ctx *pipe_ctx)
+{
+ struct dc_link *link = pipe_ctx->stream->link;
+ enum dp_panel_mode panel_mode_dp = dp_get_panel_mode(link);
+
+ edp_set_panel_assr(link, pipe_ctx, &panel_mode_dp, false);
+}
+
+static void link_legacy_set_dpms_off_step_set_dsc(struct pipe_ctx *pipe_ctx)
+{
+ struct dc_stream_state *stream = pipe_ctx->stream;
+
+ if (!stream->timing.flags.DSC)
+ return;
+
+ if (dc_is_dp_signal(stream->signal))
+ link_set_dsc_enable(pipe_ctx, false);
+ else if (dc_is_hdmi_frl_signal(stream->signal))
+ link_set_dsc_on_stream(pipe_ctx, false);
+}
+
+static void link_legacy_set_dpms_off_step_set_out_mux(struct pipe_ctx *pipe_ctx)
+{
+ if (!dp_is_128b_132b_signal(pipe_ctx))
+ return;
+
+ const struct timing_generator_funcs *funcs =
+ pipe_ctx->stream_res.tg->funcs;
+
+ if (funcs->set_out_mux)
+ funcs->set_out_mux(pipe_ctx->stream_res.tg, OUT_MUX_DIO);
+}
+
+static void
+link_legacy_set_dpms_off_step_vpg_powerdown(struct pipe_ctx *pipe_ctx)
+{
+ struct vpg *vpg = link_dpms_impl_get_vpg(pipe_ctx);
+
+ if (vpg && vpg->funcs->vpg_powerdown)
+ vpg->funcs->vpg_powerdown(vpg);
+}
+
+static void
+link_legacy_set_dpms_off_step_panel_mode_workaround(struct pipe_ctx *pipe_ctx)
+{
+ struct dc_stream_state *stream = pipe_ctx->stream;
+ struct dc_link *link = stream->link;
+
+ if (link->connector_signal != SIGNAL_TYPE_EDP ||
+ !link->ctx->dc->debug.psp_disabled_wa)
+ return;
+
+ enum dp_panel_mode panel_mode = dp_get_panel_mode(link);
+
+ link->panel_mode = panel_mode;
+}
+
enum dc_status link_set_dpms_off_v2(struct pipe_ctx *pipe_ctx)
{
struct dc_link *link = pipe_ctx->stream->link;
+ struct link_dpms_ctx *dpms_ctx = link->dpms_ctx;
- link_dpms_ctx_init(link->dpms_ctx, pipe_ctx);
+ link_dpms_ctx_init(dpms_ctx, pipe_ctx);
- // TODO: Implement
- ASSERT(false);
- return DC_ERROR_UNEXPECTED;
+ if (link_legacy_set_dpms_off_step_check_skipped(pipe_ctx))
+ return DC_DPMS_SKIPPED_HANDSHAKE;
+
+ link_legacy_set_dpms_off_step_wait_for_unlocked(pipe_ctx);
+ link_legacy_set_dpms_off_step_set_avmute(pipe_ctx);
+ link_legacy_set_dpms_off_step_disable_audio_stream(pipe_ctx);
+ link_legacy_set_dpms_off_step_update_psp_stream_config(pipe_ctx);
+ link_legacy_set_dpms_off_step_blank_stream(pipe_ctx);
+ link_legacy_set_dpms_off_step_deallocate_usb4_bandwidth(pipe_ctx);
+ link_legacy_set_dpms_off_step_update_payloads(pipe_ctx);
+ link_legacy_set_dpms_off_step_configure_hdmi(pipe_ctx);
+ link_legacy_set_dpms_off_step_disable_link_and_stream(pipe_ctx);
+ link_legacy_set_dpms_off_step_set_edp_panel_assr(pipe_ctx);
+ link_legacy_set_dpms_off_step_set_dsc(pipe_ctx);
+ link_legacy_set_dpms_off_step_set_out_mux(pipe_ctx);
+ link_legacy_set_dpms_off_step_vpg_powerdown(pipe_ctx);
+ link_legacy_set_dpms_off_step_panel_mode_workaround(pipe_ctx);
+
+ return DC_DPMS_SUCCESS;
}
enum dc_status link_set_dpms_on_v2(struct dc_state *state,
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* [PATCH 18/27] drm/amd/display: Add the immediate flip to the DC2 seamless update
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (16 preceding siblings ...)
2026-11-25 6:55 ` [PATCH 17/27] drm/amd/display: Implement link_set_dpms_off_v2 Chenyu Chen
@ 2026-11-25 6:55 ` Chenyu Chen
2026-11-25 6:55 ` [PATCH 19/27] drm/amd/display: Test amdgpu_dm_dmub alt-ch apertures Chenyu Chen
` (10 subsequent siblings)
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:55 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, Tony Cheng, Jun Lei,
Chenyu Chen
From: Tony Cheng <tony.cheng@amd.com>
[Why]
With DC2 selected, Core2 rejects an immediate flip. The flip falls
back to DC1, although DC1 programs it in the same order as the vsync
flip.
[How]
Let the flip on the kept context run when the plane flips
immediately. The order stays lock, GSL, triple buffer, the address,
unlock and the manual trigger. GSL now takes flip_immediate from the
plane, as the address already did.
After the flip, Core2 sets the current address of an immediate flip,
as dcn20_prepare_plane_addr_update does.
Reject an immediate flip of a DCC surface. For it, DC1 waits for the
DCC meta data to propagate, and the flip does not emit that wait.
Cc: Jun Lei <jun.lei@amd.com>
Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
.../dc/bls_builder/dcn401_seamless_builder.c | 22 ++++++++++++++++++-
.../gpu/drm/amd/display/dc/core2/dc_core2.c | 2 ++
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/bls_builder/dcn401_seamless_builder.c b/drivers/gpu/drm/amd/display/dc/bls_builder/dcn401_seamless_builder.c
index 850b5d8c96d4..bc7dd933e35e 100644
--- a/drivers/gpu/drm/amd/display/dc/bls_builder/dcn401_seamless_builder.c
+++ b/drivers/gpu/drm/amd/display/dc/bls_builder/dcn401_seamless_builder.c
@@ -824,6 +824,24 @@ static bool check_no_immediate_flip(const struct dc *dc,
DC_TRAIT_MATCH(DC_PLANE_TRAIT_FLIP_IMMEDIATE, 0));
}
+/*
+ * DC1 waits for the DCC meta data to propagate before an immediate flip of
+ * a DCC surface. The flip does not emit that wait.
+ */
+static bool check_no_immediate_dcc_flip(const struct dc *dc,
+ const struct dc_state *current_state,
+ const struct dc_state *new_state, unsigned int i)
+{
+ struct dc_state_facts facts;
+
+ (void)current_state;
+ (void)dc;
+ dc_state_facts_derive(new_state, &facts);
+ return !dc_state_facts_any_plane(&facts, (uint8_t)i,
+ DC_TRAIT_MATCH(DC_PLANE_TRAIT_FLIP_IMMEDIATE |
+ DC_PLANE_TRAIT_DCC, 0));
+}
+
/*
* DC1 translates a distributed-points curve into a LUT while it programs
* the plane. The update programs only the predefined and bypass curves.
@@ -1081,7 +1099,7 @@ static enum bls_builder_result dcn401_check_flip(const struct dc *dc,
CHECK_UPDATE(one_address_only_plane,
"stream has odm, or not one plane with an address-only update");
CHECK_CONDITION(triple_buffer, "triple buffer is disabled");
- CHECK_UPDATE(no_immediate_flip, "flip is immediate");
+ CHECK_UPDATE(no_immediate_dcc_flip, "immediate flip of a dcc surface");
CHECK_UPDATE(no_mcm_luts, "an mcm lut is enabled");
return BLS_BUILD_SUCCESS;
}
@@ -2318,6 +2336,8 @@ static void dcn401_add_step(struct block_sequence_state *sequence,
break;
case HUBP_SET_FLIP_CONTROL_GSL:
p->set_flip_control_gsl_params.hubp = pipe->plane_res.hubp;
+ p->set_flip_control_gsl_params.flip_immediate =
+ plane->flip_immediate;
break;
case HUBP_CLK_CNTL:
p->hubp_clk_cntl_params.hubp = pipe->plane_res.hubp;
diff --git a/drivers/gpu/drm/amd/display/dc/core2/dc_core2.c b/drivers/gpu/drm/amd/display/dc/core2/dc_core2.c
index 245ebd8e01d0..ce2d4f0c89d6 100644
--- a/drivers/gpu/drm/amd/display/dc/core2/dc_core2.c
+++ b/drivers/gpu/drm/amd/display/dc/core2/dc_core2.c
@@ -417,6 +417,8 @@ static void core2_update_done(struct dc *dc, struct dc_state *context,
vm_helper_mark_vmid_used(dc->vm_helper, plane->address.vmid,
(uint8_t)hubp->inst);
plane->status.requested_address = plane->address;
+ if (plane->flip_immediate)
+ plane->status.current_address = plane->address;
hubp->opp_id = pipe->stream_res.opp->inst;
hubp->mpcc_id = hubp->inst;
hubp->power_gated = false;
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* [PATCH 19/27] drm/amd/display: Test amdgpu_dm_dmub alt-ch apertures
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (17 preceding siblings ...)
2026-11-25 6:55 ` [PATCH 18/27] drm/amd/display: Add the immediate flip to the DC2 seamless update Chenyu Chen
@ 2026-11-25 6:55 ` Chenyu Chen
2026-11-25 6:55 ` [PATCH 20/27] drm/amd/display: Test amdgpu_dm_dmub SET_CONFIG sync wait Chenyu Chen
` (9 subsequent siblings)
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:55 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, Bhawanpreet Lakha, Chenyu Chen
From: Alex Hung <alex.hung@amd.com>
[WHAT]
Add KUnit tests for dm_dmub_hw_init() covering the alternate-channel
p-state apertures: both apertures published to DML2, and a missing or
invalid-size aperture leaving the feature disabled.
Cc: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
.../amdgpu_dm/tests/amdgpu_dm_dmub_test.c | 92 +++++++++++++++++++
1 file changed, 92 insertions(+)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_dmub_test.c b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_dmub_test.c
index 595a7dcb57ad..1a4fa8c7e00c 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_dmub_test.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_dmub_test.c
@@ -835,6 +835,96 @@ static void dm_test_dmub_hw_init_dmcu_abm(struct kunit *test)
KUNIT_EXPECT_TRUE(test, abm->dmcu_is_running);
}
+/*
+ * Fake discovery MEM_RESERVED_INFO table: the real lookup in
+ * amdgpu_discovery_get_mem_reserved_region_by_id() walks this cached table.
+ */
+
+#define DM_TEST_VRAM_START 0x8000000000ULL
+#define DM_TEST_VRAM_BASE_OFFSET 0x40000000ULL
+#define DM_TEST_APERTURE1_START 0x10000000ULL
+#define DM_TEST_APERTURE2_START 0x30000000ULL
+#define DM_TEST_APERTURE1_SIZE SZ_16M
+#define DM_TEST_APERTURE2_SIZE SZ_32M
+#define DM_TEST_MC_BASE(s) ((s) + DM_TEST_VRAM_START - DM_TEST_VRAM_BASE_OFFSET)
+
+static void dm_test_set_reserved_regions(struct kunit *test, struct amdgpu_device *adev,
+ u32 num_regions, u64 aperture2_size)
+{
+ struct mem_reserved_info_table_v1_0 *table;
+
+ table = kunit_kzalloc(test, sizeof(*table), GFP_KERNEL);
+ KUNIT_ASSERT_NOT_NULL(test, table);
+
+ table->list_num = cpu_to_le32(num_regions);
+ table->list[0].reserved_region_id = cpu_to_le32(G7_PSTATE_APERTURE1_ID);
+ table->list[0].reserved_region_size = cpu_to_le64(DM_TEST_APERTURE1_SIZE);
+ table->list[0].reserved_region_start = cpu_to_le64(DM_TEST_APERTURE1_START);
+ table->list[1].reserved_region_id = cpu_to_le32(G7_PSTATE_APERTURE2_ID);
+ table->list[1].reserved_region_size = cpu_to_le64(aperture2_size);
+ table->list[1].reserved_region_start = cpu_to_le64(DM_TEST_APERTURE2_START);
+
+ adev->discovery.mem_reserved_table = table;
+ adev->gmc.vram_start = DM_TEST_VRAM_START;
+ adev->vm_manager.vram_base_offset = DM_TEST_VRAM_BASE_OFFSET;
+ adev->ip_versions[DCE_HWIP][0] = IP_VERSION(6, 0, 0);
+}
+
+/**
+ * dm_test_dmub_hw_init_alt_channel_apertures - Test hw init publishes both p-state apertures
+ * @test: The KUnit test context
+ *
+ * With both G7 p-state apertures present in the discovery table,
+ * dm_dmub_hw_init() should translate each base into MC space and hand bits
+ * [47:16] and the size to DML2.
+ */
+static void dm_test_dmub_hw_init_alt_channel_apertures(struct kunit *test)
+{
+ struct amdgpu_device *adev = dm_test_alloc_adev_with_dmub(test);
+ struct dml2_soc_alt_ch_info *cfg = &adev->dm.dc->dml2_options.alt_ch_cfg;
+
+ dm_test_set_reserved_regions(test, adev, 2, DM_TEST_APERTURE2_SIZE);
+
+ KUNIT_EXPECT_EQ(test, dm_dmub_hw_init(adev), 0);
+ KUNIT_EXPECT_EQ(test, cfg->region_base_addr_47_16[0],
+ (u32)(DM_TEST_MC_BASE(DM_TEST_APERTURE1_START) >> 16));
+ KUNIT_EXPECT_EQ(test, cfg->region_base_addr_47_16[1],
+ (u32)(DM_TEST_MC_BASE(DM_TEST_APERTURE2_START) >> 16));
+ KUNIT_EXPECT_EQ(test, cfg->region_size_bytes[0], (u32)DM_TEST_APERTURE1_SIZE);
+ KUNIT_EXPECT_EQ(test, cfg->region_size_bytes[1], (u32)DM_TEST_APERTURE2_SIZE);
+}
+
+/**
+ * dm_test_dmub_hw_init_alt_channel_rejected - Test unusable apertures disable the feature
+ * @test: The KUnit test context
+ *
+ * A missing aperture 2, a zero-sized one or one of at least 0xfff MiB disables
+ * the feature, and dm_dmub_hw_init() must not publish the valid aperture 1.
+ */
+static void dm_test_dmub_hw_init_alt_channel_rejected(struct kunit *test)
+{
+ static const struct {
+ u32 num_regions;
+ u64 aperture2_size;
+ } cases[] = {
+ { 1, DM_TEST_APERTURE2_SIZE },
+ { 2, 0 },
+ { 2, 0xfffULL << 20 },
+ };
+ struct amdgpu_device *adev;
+ unsigned int i;
+
+ for (i = 0; i < ARRAY_SIZE(cases); i++) {
+ adev = dm_test_alloc_adev_with_dmub(test);
+ dm_test_set_reserved_regions(test, adev, cases[i].num_regions,
+ cases[i].aperture2_size);
+
+ KUNIT_EXPECT_EQ(test, dm_dmub_hw_init(adev), 0);
+ KUNIT_EXPECT_EQ_MSG(test, adev->dm.dc->dml2_options.alt_ch_cfg.region_size_bytes[0],
+ 0, "case %u", i);
+ }
+}
+
/* Tests for dm_dmub_hw_resume() */
/**
@@ -1958,6 +2048,8 @@ static struct kunit_case amdgpu_dm_dmub_tests[] = {
KUNIT_CASE(dm_test_dmub_hw_init_sanity_checks_dcn31),
KUNIT_CASE(dm_test_dmub_hw_init_sanity_checks_dcn314),
KUNIT_CASE(dm_test_dmub_hw_init_dmcu_abm),
+ KUNIT_CASE(dm_test_dmub_hw_init_alt_channel_apertures),
+ KUNIT_CASE(dm_test_dmub_hw_init_alt_channel_rejected),
/* dm_dmub_hw_resume() */
KUNIT_CASE(dm_test_dmub_hw_resume_no_dmub_srv),
KUNIT_CASE(dm_test_dmub_hw_resume_initialized_dmub),
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* [PATCH 20/27] drm/amd/display: Test amdgpu_dm_dmub SET_CONFIG sync wait
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (18 preceding siblings ...)
2026-11-25 6:55 ` [PATCH 19/27] drm/amd/display: Test amdgpu_dm_dmub alt-ch apertures Chenyu Chen
@ 2026-11-25 6:55 ` Chenyu Chen
2026-11-25 6:55 ` [PATCH 21/27] drm/amd/display: Test amdgpu_dm_dmub AUX transfer timeout Chenyu Chen
` (8 subsequent siblings)
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:55 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, Bhawanpreet Lakha, Chenyu Chen
From: Alex Hung <alex.hung@amd.com>
[WHAT]
Add KUnit tests for amdgpu_dm_process_dmub_set_config_sync() covering
a pending command completed by a DMUB notification, and the reply
timeout.
Cc: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
.../amdgpu_dm/tests/amdgpu_dm_dmub_test.c | 97 +++++++++++++++++++
1 file changed, 97 insertions(+)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_dmub_test.c b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_dmub_test.c
index 1a4fa8c7e00c..164071f39731 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_dmub_test.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_dmub_test.c
@@ -925,6 +925,33 @@ static void dm_test_dmub_hw_init_alt_channel_rejected(struct kunit *test)
}
}
+static void dm_test_free_dc_dmub_srv(void *data)
+{
+ struct dc_context *ctx = data;
+
+ kfree(ctx->dmub_srv);
+ ctx->dmub_srv = NULL;
+}
+
+/*
+ * Build an amdgpu_device whose DC DMUB service runs on the fake DMUB, so
+ * commands complete instantly and replies echo the submitted command.
+ */
+static struct amdgpu_device *dm_test_alloc_adev_with_dc_dmub(struct kunit *test)
+{
+ struct amdgpu_device *adev = dm_test_alloc_adev_with_dmub(test);
+ struct dc_context *ctx = adev->dm.dc->ctx;
+
+ spin_lock_init(&adev->dm.dmub_lock);
+ mutex_init(&adev->dm.dpia_aux_lock);
+
+ KUNIT_ASSERT_EQ(test, dm_dmub_hw_init(adev), 0);
+ KUNIT_ASSERT_NOT_NULL(test, ctx->dmub_srv);
+ KUNIT_ASSERT_EQ(test, kunit_add_action_or_reset(test, dm_test_free_dc_dmub_srv, ctx), 0);
+
+ return adev;
+}
+
/* Tests for dm_dmub_hw_resume() */
/**
@@ -1441,6 +1468,74 @@ static void dm_test_process_dmub_set_config_sync_unknown_error(struct kunit *tes
KUNIT_EXPECT_EQ(test, result, SET_CONFIG_UNKNOWN_ERROR);
}
+static struct amdgpu_device *dm_test_alloc_adev_with_link(struct kunit *test)
+{
+ struct amdgpu_device *adev = dm_test_alloc_adev_with_dc_dmub(test);
+ struct dc_link *link;
+
+ link = kunit_kzalloc(test, sizeof(*link), GFP_KERNEL);
+ KUNIT_ASSERT_NOT_NULL(test, link);
+
+ link->ddc = kunit_kzalloc(test, sizeof(*link->ddc), GFP_KERNEL);
+ KUNIT_ASSERT_NOT_NULL(test, link->ddc);
+
+ link->ctx = adev->dm.dc->ctx;
+ adev->dm.dc->links[0] = link;
+ adev->dm.dc->link_count = 1;
+
+ adev->dm.dmub_notify = kunit_kzalloc(test, sizeof(struct dmub_notification), GFP_KERNEL);
+ KUNIT_ASSERT_NOT_NULL(test, adev->dm.dmub_notify);
+
+ init_completion(&adev->dm.dmub_aux_transfer_done);
+
+ return adev;
+}
+
+/**
+ * dm_test_process_dmub_set_config_sync_pending_notified - Test a pending SET_CONFIG completes
+ * @test: The KUnit test context
+ *
+ * When DMUB accepts the command without an immediate status, the sync helper
+ * waits for the outbox notification, reports its status and rearms the
+ * completion for the next request.
+ */
+static void dm_test_process_dmub_set_config_sync_pending_notified(struct kunit *test)
+{
+ struct amdgpu_device *adev = dm_test_alloc_adev_with_link(test);
+ struct set_config_cmd_payload payload = { 0 };
+ enum set_config_status result = SET_CONFIG_PENDING;
+ int ret;
+
+ adev->dm.dmub_notify->sc_status = SET_CONFIG_ACK_RECEIVED;
+ complete(&adev->dm.dmub_aux_transfer_done);
+
+ ret = amdgpu_dm_process_dmub_set_config_sync(adev->dm.dc->ctx, 0, &payload, &result);
+
+ KUNIT_EXPECT_EQ(test, ret, 0);
+ KUNIT_EXPECT_EQ(test, result, SET_CONFIG_ACK_RECEIVED);
+ KUNIT_EXPECT_FALSE(test, completion_done(&adev->dm.dmub_aux_transfer_done));
+}
+
+/**
+ * dm_test_process_dmub_set_config_sync_timeout - Test a pending SET_CONFIG times out
+ * @test: The KUnit test context
+ *
+ * When DMUB accepts the command but no notification arrives within the 10
+ * second wait, the sync helper returns -1 with SET_CONFIG_UNKNOWN_ERROR.
+ */
+static void dm_test_process_dmub_set_config_sync_timeout(struct kunit *test)
+{
+ struct amdgpu_device *adev = dm_test_alloc_adev_with_link(test);
+ struct set_config_cmd_payload payload = { 0 };
+ enum set_config_status result = SET_CONFIG_PENDING;
+ int ret;
+
+ ret = amdgpu_dm_process_dmub_set_config_sync(adev->dm.dc->ctx, 0, &payload, &result);
+
+ KUNIT_EXPECT_EQ(test, ret, -1);
+ KUNIT_EXPECT_EQ(test, result, SET_CONFIG_UNKNOWN_ERROR);
+}
+
/* Tests for abort_fused_io() */
/**
@@ -2071,6 +2166,8 @@ static struct kunit_case amdgpu_dm_dmub_tests[] = {
KUNIT_CASE(dm_test_process_dmub_aux_transfer_sync_zero_length),
/* amdgpu_dm_process_dmub_set_config_sync() */
KUNIT_CASE(dm_test_process_dmub_set_config_sync_unknown_error),
+ KUNIT_CASE(dm_test_process_dmub_set_config_sync_pending_notified),
+ KUNIT_CASE_SLOW(dm_test_process_dmub_set_config_sync_timeout),
/* abort_fused_io() */
KUNIT_CASE(dm_test_abort_fused_io_no_dmub_srv),
{}
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* [PATCH 21/27] drm/amd/display: Test amdgpu_dm_dmub AUX transfer timeout
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (19 preceding siblings ...)
2026-11-25 6:55 ` [PATCH 20/27] drm/amd/display: Test amdgpu_dm_dmub SET_CONFIG sync wait Chenyu Chen
@ 2026-11-25 6:55 ` Chenyu Chen
2026-11-25 6:55 ` [PATCH 22/27] drm/amd/display: Test amdgpu_dm_dmub fused IO replies Chenyu Chen
` (7 subsequent siblings)
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:55 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, Bhawanpreet Lakha, Chenyu Chen
From: Alex Hung <alex.hung@amd.com>
[WHAT]
Add a KUnit test for amdgpu_dm_process_dmub_aux_transfer_sync()
covering the AUX reply timeout.
Cc: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
.../amdgpu_dm/tests/amdgpu_dm_dmub_test.c | 21 +++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_dmub_test.c b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_dmub_test.c
index 164071f39731..8117ae4a2aef 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_dmub_test.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_dmub_test.c
@@ -1536,6 +1536,26 @@ static void dm_test_process_dmub_set_config_sync_timeout(struct kunit *test)
KUNIT_EXPECT_EQ(test, result, SET_CONFIG_UNKNOWN_ERROR);
}
+/**
+ * dm_test_process_dmub_aux_transfer_sync_timeout - Test AUX transfer reply timeout
+ * @test: The KUnit test context
+ *
+ * When DMUB accepts the AUX request but never signals a reply within the 10
+ * second wait, the sync helper returns -1 with AUX_RET_ERROR_TIMEOUT.
+ */
+static void dm_test_process_dmub_aux_transfer_sync_timeout(struct kunit *test)
+{
+ struct amdgpu_device *adev = dm_test_alloc_adev_with_link(test);
+ struct aux_payload payload = { 0 };
+ enum aux_return_code_type result = AUX_RET_SUCCESS;
+ int ret;
+
+ ret = amdgpu_dm_process_dmub_aux_transfer_sync(adev->dm.dc->ctx, 0, &payload, &result);
+
+ KUNIT_EXPECT_EQ(test, ret, -1);
+ KUNIT_EXPECT_EQ(test, result, AUX_RET_ERROR_TIMEOUT);
+}
+
/* Tests for abort_fused_io() */
/**
@@ -2164,6 +2184,7 @@ static struct kunit_case amdgpu_dm_dmub_tests[] = {
KUNIT_CASE(dm_test_process_dmub_aux_transfer_sync_protocol_error),
KUNIT_CASE(dm_test_process_dmub_aux_transfer_sync_copies_data),
KUNIT_CASE(dm_test_process_dmub_aux_transfer_sync_zero_length),
+ KUNIT_CASE_SLOW(dm_test_process_dmub_aux_transfer_sync_timeout),
/* amdgpu_dm_process_dmub_set_config_sync() */
KUNIT_CASE(dm_test_process_dmub_set_config_sync_unknown_error),
KUNIT_CASE(dm_test_process_dmub_set_config_sync_pending_notified),
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* [PATCH 22/27] drm/amd/display: Test amdgpu_dm_dmub fused IO replies
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (20 preceding siblings ...)
2026-11-25 6:55 ` [PATCH 21/27] drm/amd/display: Test amdgpu_dm_dmub AUX transfer timeout Chenyu Chen
@ 2026-11-25 6:55 ` Chenyu Chen
2026-11-25 6:55 ` [PATCH 23/27] drm/amd/display: Use Z8 enter plus exit for vblank reserve Chenyu Chen
` (6 subsequent siblings)
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:55 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, Bhawanpreet Lakha, Chenyu Chen
From: Alex Hung <alex.hung@amd.com>
[WHAT]
Add KUnit tests for amdgpu_dm_execute_fused_io() covering a matching
reply, and a stale reply that times out and aborts the request.
Cc: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
.../amd/display/amdgpu_dm/amdgpu_dm_dmub.c | 1 +
.../amdgpu_dm/tests/amdgpu_dm_dmub_test.c | 73 +++++++++++++++++++
2 files changed, 74 insertions(+)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_dmub.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_dmub.c
index 6c26fd361ce4..024c2395d2c2 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_dmub.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_dmub.c
@@ -1018,6 +1018,7 @@ bool amdgpu_dm_execute_fused_io(
mutex_unlock(&dm->dpia_aux_lock);
return result;
}
+EXPORT_IF_KUNIT(amdgpu_dm_execute_fused_io);
int amdgpu_dm_process_dmub_set_config_sync(
struct dc_context *ctx,
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_dmub_test.c b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_dmub_test.c
index 8117ae4a2aef..9c0171b86c67 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_dmub_test.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_dmub_test.c
@@ -1589,6 +1589,76 @@ static void dm_test_abort_fused_io_no_dmub_srv(struct kunit *test)
abort_fused_io(ctx, req);
}
+/* Tests for amdgpu_dm_execute_fused_io() */
+
+#define DM_TEST_FUSED_DDC_LINE 2
+#define DM_TEST_FUSED_ID 0x5a
+
+/*
+ * Fill @cmd with a fused IO request the fake DMUB echoes back as accepted, and
+ * seed the reply slot of its DDC line with a reply carrying @reply_id as if
+ * the DMUB outbox callback had already delivered it.
+ */
+static struct completion *dm_test_prepare_fused_io(struct amdgpu_device *adev,
+ union dmub_rb_cmd *cmd, u8 reply_id)
+{
+ struct fused_io_sync *sync = &adev->dm.fused_io[DM_TEST_FUSED_DDC_LINE];
+ struct dmub_cmd_fused_request *reply = (struct dmub_cmd_fused_request *)sync->reply_data;
+
+ cmd->fused_io.header.ret_status = 1;
+ cmd->fused_io.request.status = FUSED_REQUEST_STATUS_SUCCESS;
+ cmd->fused_io.request.identifier = DM_TEST_FUSED_ID;
+ cmd->fused_io.request.u.aux.ddc_line = DM_TEST_FUSED_DDC_LINE;
+
+ init_completion(&sync->replied);
+ reply->status = FUSED_REQUEST_STATUS_REPLY;
+ reply->identifier = reply_id;
+ complete(&sync->replied);
+
+ return &sync->replied;
+}
+
+/**
+ * dm_test_execute_fused_io_reply_matches - Test fused IO returns the matching reply
+ * @test: The KUnit test context
+ *
+ * Once DMUB accepts the request, a reply with the same identifier must be
+ * copied into the caller's request and the reply completion rearmed.
+ */
+static void dm_test_execute_fused_io_reply_matches(struct kunit *test)
+{
+ struct amdgpu_device *adev = dm_test_alloc_adev_with_link(test);
+ union dmub_rb_cmd cmd = { 0 };
+ struct completion *replied = dm_test_prepare_fused_io(adev, &cmd, DM_TEST_FUSED_ID);
+
+ KUNIT_EXPECT_TRUE(test, amdgpu_dm_execute_fused_io(adev, adev->dm.dc->links[0], &cmd, 1,
+ 1000));
+ KUNIT_EXPECT_EQ(test, cmd.fused_io.request.status, FUSED_REQUEST_STATUS_REPLY);
+ KUNIT_EXPECT_FALSE(test, completion_done(replied));
+}
+
+/**
+ * dm_test_execute_fused_io_reply_mismatch_aborts - Test a stale reply leads to abort
+ * @test: The KUnit test context
+ *
+ * A reply for a different identifier is discarded; when no matching reply
+ * arrives before the timeout, the request is marked timed out and an abort
+ * command follows the execute command into the DMUB inbox.
+ */
+static void dm_test_execute_fused_io_reply_mismatch_aborts(struct kunit *test)
+{
+ struct amdgpu_device *adev = dm_test_alloc_adev_with_link(test);
+ u32 wrpt = adev->dm.dmub_srv->inbox1.rb.wrpt;
+ union dmub_rb_cmd cmd = { 0 };
+
+ dm_test_prepare_fused_io(adev, &cmd, DM_TEST_FUSED_ID + 1);
+
+ KUNIT_EXPECT_FALSE(test, amdgpu_dm_execute_fused_io(adev, adev->dm.dc->links[0], &cmd, 1,
+ 1000));
+ KUNIT_EXPECT_EQ(test, cmd.fused_io.request.status, FUSED_REQUEST_STATUS_TIMEOUT);
+ KUNIT_EXPECT_EQ(test, adev->dm.dmub_srv->inbox1.rb.wrpt, wrpt + 2 * DMUB_RB_CMD_SIZE);
+}
+
/*
* Fake CGS device: the DMUB register callbacks reach the hardware through
* cgs_read_register()/cgs_write_register(), which dispatch via the ops table
@@ -2191,6 +2261,9 @@ static struct kunit_case amdgpu_dm_dmub_tests[] = {
KUNIT_CASE_SLOW(dm_test_process_dmub_set_config_sync_timeout),
/* abort_fused_io() */
KUNIT_CASE(dm_test_abort_fused_io_no_dmub_srv),
+ /* amdgpu_dm_execute_fused_io() */
+ KUNIT_CASE(dm_test_execute_fused_io_reply_matches),
+ KUNIT_CASE(dm_test_execute_fused_io_reply_mismatch_aborts),
{}
};
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* [PATCH 23/27] drm/amd/display: Use Z8 enter plus exit for vblank reserve
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (21 preceding siblings ...)
2026-11-25 6:55 ` [PATCH 22/27] drm/amd/display: Test amdgpu_dm_dmub fused IO replies Chenyu Chen
@ 2026-11-25 6:55 ` Chenyu Chen
2026-11-25 6:55 ` [PATCH 24/27] drm/amd/display: Fix two streams sharing one OTG Chenyu Chen
` (5 subsequent siblings)
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:55 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, Ovidiu Bunea, Dillon Varone,
Chenyu Chen
From: Ovidiu Bunea <ovidiu.bunea@amd.com>
[Why]
The FAMS2 PMO stutter optimization uses the Z8 stutter exit latency
both to decide whether Z8 meets its eco requirement and as the vblank
time to reserve for Z8. The reserved vblank time is what feeds
min_ttu_vblank, so it only covered the exit latency rather than the
full Z8 enter plus exit latency.
Also, the stutter candidate index is never advanced, so when the Z8
candidate fails mode support the regular stutter candidate is never
attempted and the whole stutter optimization is dropped.
[How]
Use z8_stutter_enter_plus_exit_latency_us instead of
z8_stutter_exit_latency_us in pmo_dcn4_fams2_init_for_stutter() for
the Z8 eco check and for the Z8 vblank reserved time candidate, and in
pmo_dcn4_fams2_test_for_stutter() for the reserved vblank time check.
In pmo_dcn4_fams2_optimize_for_stutter(), advance to the next
candidate on each attempt instead of giving up after the first one
fails. Track which candidate is the Z8 one, and only require the Z8
reserved time in the stutter test while that candidate is the one
being attempted.
Fewer configs now meet the Z8 eco check. Configs that still meet it
reserve more vblank time (Z8 enter plus exit latency). Configs that no
longer meet it fall back to the regular stutter candidate.
Cc: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Ovidiu Bunea <ovidiu.bunea@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
.../dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c | 35 +++++++++++--------
.../src/inc/dml2_internal_shared_types.h | 1 +
2 files changed, 21 insertions(+), 15 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c
index 62ac29dfe9be..cd68b5010a06 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c
@@ -2387,7 +2387,7 @@ bool pmo_dcn4_fams2_init_for_stutter(struct dml2_pmo_init_for_stutter_in_out *in
for (i = 0; i < in_out->base_display_config->display_config.num_planes; i++) {
if (in_out->base_display_config->mode_support_result.cfg_support_info.plane_support_info[i].active_latency_hiding_us <
- pmo->soc_bb->power_management_parameters.z8_stutter_exit_latency_us + pmo->soc_bb->power_management_parameters.z8_min_idle_time) {
+ pmo->soc_bb->power_management_parameters.z8_stutter_enter_plus_exit_latency_us + pmo->soc_bb->power_management_parameters.z8_min_idle_time) {
stutter_period_meets_z8_eco = false;
break;
}
@@ -2414,8 +2414,9 @@ bool pmo_dcn4_fams2_init_for_stutter(struct dml2_pmo_init_for_stutter_in_out *in
pmo->scratch.pmo_dcn4.cur_stutter_candidate = 0;
if (stutter_period_meets_z8_eco && !z8_stutter_optimization_too_expensive) {
- if (pmo->soc_bb->power_management_parameters.z8_stutter_exit_latency_us > 0) {
- pmo->scratch.pmo_dcn4.optimal_vblank_reserved_time_for_stutter_us[pmo->scratch.pmo_dcn4.num_stutter_candidates] = (unsigned int)pmo->soc_bb->power_management_parameters.z8_stutter_exit_latency_us;
+ if (pmo->soc_bb->power_management_parameters.z8_stutter_enter_plus_exit_latency_us > 0) {
+ pmo->scratch.pmo_dcn4.optimal_vblank_reserved_time_for_stutter_us[pmo->scratch.pmo_dcn4.num_stutter_candidates] = (unsigned int)pmo->soc_bb->power_management_parameters.z8_stutter_enter_plus_exit_latency_us;
+ pmo->scratch.pmo_dcn4.stutter_candidate_is_z8[pmo->scratch.pmo_dcn4.num_stutter_candidates] = true;
pmo->scratch.pmo_dcn4.num_stutter_candidates++;
pmo->scratch.pmo_dcn4.z8_vblank_optimizable = true;
}
@@ -2425,6 +2426,7 @@ bool pmo_dcn4_fams2_init_for_stutter(struct dml2_pmo_init_for_stutter_in_out *in
if (!stutter_optimization_too_expensive && pmo->soc_bb->power_management_parameters.stutter_enter_plus_exit_latency_us > 0) {
pmo->scratch.pmo_dcn4.optimal_vblank_reserved_time_for_stutter_us[pmo->scratch.pmo_dcn4.num_stutter_candidates] = (unsigned int)pmo->soc_bb->power_management_parameters.stutter_enter_plus_exit_latency_us;
+ pmo->scratch.pmo_dcn4.stutter_candidate_is_z8[pmo->scratch.pmo_dcn4.num_stutter_candidates] = false;
pmo->scratch.pmo_dcn4.num_stutter_candidates++;
}
@@ -2442,9 +2444,9 @@ bool pmo_dcn4_fams2_test_for_stutter(struct dml2_pmo_test_for_stutter_in_out *in
unsigned int i;
for (i = 0; i < in_out->base_display_config->display_config.num_planes; i++) {
- if (pmo->soc_bb->power_management_parameters.z8_stutter_exit_latency_us > 0 &&
+ if (pmo->soc_bb->power_management_parameters.z8_stutter_enter_plus_exit_latency_us > 0 &&
pmo->scratch.pmo_dcn4.z8_vblank_optimizable &&
- in_out->base_display_config->display_config.plane_descriptors[i].overrides.reserved_vblank_time_ns < (int)pmo->soc_bb->power_management_parameters.z8_stutter_exit_latency_us * 1000) {
+ in_out->base_display_config->display_config.plane_descriptors[i].overrides.reserved_vblank_time_ns < (int)pmo->soc_bb->power_management_parameters.z8_stutter_enter_plus_exit_latency_us * 1000) {
success = false;
break;
}
@@ -2466,17 +2468,20 @@ bool pmo_dcn4_fams2_optimize_for_stutter(struct dml2_pmo_optimize_for_stutter_in
memcpy(in_out->optimized_display_config, in_out->base_display_config, sizeof(struct display_configuation_with_meta));
- if (!in_out->last_candidate_failed) {
- if (pmo->scratch.pmo_dcn4.cur_stutter_candidate < pmo->scratch.pmo_dcn4.num_stutter_candidates) {
- for (i = 0; i < in_out->optimized_display_config->display_config.num_planes; i++) {
- /* take the max of the current and the optimal reserved time */
- in_out->optimized_display_config->display_config.plane_descriptors[i].overrides.reserved_vblank_time_ns =
- (long)math_max2(pmo->scratch.pmo_dcn4.optimal_vblank_reserved_time_for_stutter_us[pmo->scratch.pmo_dcn4.cur_stutter_candidate] * 1000,
- in_out->optimized_display_config->display_config.plane_descriptors[i].overrides.reserved_vblank_time_ns);
- }
-
- success = true;
+ if (pmo->scratch.pmo_dcn4.cur_stutter_candidate < pmo->scratch.pmo_dcn4.num_stutter_candidates) {
+ for (i = 0; i < in_out->optimized_display_config->display_config.num_planes; i++) {
+ /* take the max of the current and the optimal reserved time */
+ in_out->optimized_display_config->display_config.plane_descriptors[i].overrides.reserved_vblank_time_ns =
+ (long)math_max2(pmo->scratch.pmo_dcn4.optimal_vblank_reserved_time_for_stutter_us[pmo->scratch.pmo_dcn4.cur_stutter_candidate] * 1000,
+ in_out->optimized_display_config->display_config.plane_descriptors[i].overrides.reserved_vblank_time_ns);
}
+
+ /* only require the Z8 reserved time in the stutter test while the Z8 candidate is the one being attempted */
+ pmo->scratch.pmo_dcn4.z8_vblank_optimizable =
+ pmo->scratch.pmo_dcn4.stutter_candidate_is_z8[pmo->scratch.pmo_dcn4.cur_stutter_candidate];
+
+ pmo->scratch.pmo_dcn4.cur_stutter_candidate++;
+ success = true;
}
return success;
diff --git a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/inc/dml2_internal_shared_types.h b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/inc/dml2_internal_shared_types.h
index 54ec7ef7cbae..3f51c26dc238 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/inc/dml2_internal_shared_types.h
+++ b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/inc/dml2_internal_shared_types.h
@@ -1093,6 +1093,7 @@ struct dml2_pmo_scratch {
struct dml2_pstate_meta stream_pstate_meta[DML2_MAX_PLANES];
unsigned int optimal_vblank_reserved_time_for_stutter_us[DML2_PMO_STUTTER_CANDIDATE_LIST_SIZE];
+ bool stutter_candidate_is_z8[DML2_PMO_STUTTER_CANDIDATE_LIST_SIZE];
unsigned int num_stutter_candidates;
unsigned int cur_stutter_candidate;
bool z8_vblank_optimizable;
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* [PATCH 24/27] drm/amd/display: Fix two streams sharing one OTG
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (22 preceding siblings ...)
2026-11-25 6:55 ` [PATCH 23/27] drm/amd/display: Use Z8 enter plus exit for vblank reserve Chenyu Chen
@ 2026-11-25 6:55 ` Chenyu Chen
2026-11-25 6:55 ` [PATCH 25/27] drm/amd/display: Count planes, not pipes, in the surface check Chenyu Chen
` (4 subsequent siblings)
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:55 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, Gabe Teeger, Charlene Liu,
Chenyu Chen
From: Gabe Teeger <gabe.teeger@amd.com>
[Why]
Some ASICs have more pipes than OTGs and OPPs. A stream could be
given a pipe without its own OTG and was then aliased to the last
OTG and OPP, which another stream already used. Both streams then
shared one OTG, so one of them stopped getting vblank interrupts.
[How]
Only pick a pipe as OTG master if it has its own OTG. If none is
free, drop another stream's ODM slices and let DML validation add
them back if needed. Remove the aliasing fallback. Skip pipes
without an OPP when acquiring an ODM slice.
Cc: Charlene Liu <charlene.liu@amd.com>
Signed-off-by: Gabe Teeger <gabe.teeger@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
.../gpu/drm/amd/display/dc/core/dc_resource.c | 64 ++++++++++++---
.../dc/resource/dcn42b/dcn42b_resource.c | 82 ++++++++++++++++++-
.../dc/resource/dcn42b/dcn42b_resource.h | 6 ++
3 files changed, 140 insertions(+), 12 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 ec11a79811e7..cb537aa90ad5 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -4295,6 +4295,48 @@ static void mark_seamless_boot_stream(const struct dc *dc,
}
}
+/*
+ * Some ASICs (e.g. DCN 2.0.1 and DCN 4.2B) have more pipes than OTGs. A pipe
+ * without its own OTG can only be a secondary DPP pipe. As an OTG master it
+ * would share the OTG and OPP of another stream.
+ */
+static bool can_pipe_be_otg_master(const struct resource_pool *pool,
+ int pipe_idx)
+{
+ return pipe_idx >= 0 &&
+ (unsigned int)pipe_idx < pool->timing_generator_count;
+}
+
+/*
+ * Remove the ODM slices of the first stream that has more than one and return
+ * the first free pipe. DML re-evaluates the ODM slice count of that stream
+ * during validation. It adds the slices back if the timing needs them and
+ * enough OPPs are left, and fails validation otherwise.
+ */
+static int release_odm_slices_of_a_stream(
+ const struct dc_state *cur_ctx,
+ struct dc_state *new_ctx,
+ const struct resource_pool *pool)
+{
+ unsigned int i;
+
+ for (i = 0; i < pool->pipe_count; i++) {
+ struct pipe_ctx *otg_master = &new_ctx->res_ctx.pipe_ctx[i];
+
+ if (!resource_is_pipe_type(otg_master, OTG_MASTER) ||
+ resource_get_odm_slice_count(otg_master) == 1)
+ continue;
+
+ if (!resource_update_pipes_for_stream_with_slice_count(new_ctx,
+ cur_ctx, pool, otg_master->stream, 1))
+ return FREE_PIPE_INDEX_NOT_FOUND;
+
+ return resource_find_any_free_pipe(&new_ctx->res_ctx, pool);
+ }
+
+ return FREE_PIPE_INDEX_NOT_FOUND;
+}
+
/*
* Acquire a pipe as OTG master and assign to the stream in new dc context.
* return - true if OTG master pipe is acquired and new dc context is updated.
@@ -4349,7 +4391,7 @@ static bool acquire_otg_master_pipe_for_stream(
* Try to acquire a pipe not used in current resource context to avoid
* pipe swapping.
*/
- if (pipe_idx == FREE_PIPE_INDEX_NOT_FOUND)
+ if (!can_pipe_be_otg_master(pool, pipe_idx))
pipe_idx = recource_find_free_pipe_not_used_in_cur_res_ctx(
&cur_ctx->res_ctx, &new_ctx->res_ctx, pool);
/*
@@ -4357,12 +4399,19 @@ static bool acquire_otg_master_pipe_for_stream(
* secondary DPP pipe in current state as we prioritize to support more
* streams over supporting MPO planes.
*/
- if (pipe_idx == FREE_PIPE_INDEX_NOT_FOUND)
+ if (!can_pipe_be_otg_master(pool, pipe_idx))
pipe_idx = resource_find_free_pipe_used_as_cur_sec_dpp(
&cur_ctx->res_ctx, &new_ctx->res_ctx, pool);
- if (pipe_idx == FREE_PIPE_INDEX_NOT_FOUND)
+ if (!can_pipe_be_otg_master(pool, pipe_idx))
pipe_idx = resource_find_any_free_pipe(&new_ctx->res_ctx, pool);
- if (pipe_idx != FREE_PIPE_INDEX_NOT_FOUND) {
+ /*
+ * If the only free pipes have no OTG (e.g. pipe 3 on DCN 4.2B), free a
+ * pipe that has one by removing the ODM slices of another stream.
+ */
+ if (pipe_idx != FREE_PIPE_INDEX_NOT_FOUND &&
+ !can_pipe_be_otg_master(pool, pipe_idx))
+ pipe_idx = release_odm_slices_of_a_stream(cur_ctx, new_ctx, pool);
+ if (can_pipe_be_otg_master(pool, pipe_idx)) {
pipe_ctx = &new_ctx->res_ctx.pipe_ctx[pipe_idx];
memset(pipe_ctx, 0, sizeof(*pipe_ctx));
pipe_ctx->pipe_idx = (uint8_t)pipe_idx;
@@ -4376,13 +4425,6 @@ static bool acquire_otg_master_pipe_for_stream(
if (pool->dpps[pipe_idx])
pipe_ctx->plane_res.mpcc_inst = (uint8_t)pool->dpps[pipe_idx]->inst;
- if ((unsigned int)pipe_idx >= pool->timing_generator_count && pool->timing_generator_count != 0) {
- int tg_inst = pool->timing_generator_count - 1;
-
- pipe_ctx->stream_res.tg = pool->timing_generators[tg_inst];
- pipe_ctx->stream_res.opp = pool->opps[tg_inst];
- }
-
pipe_ctx->stream = stream;
} else {
pipe_idx = acquire_first_split_pipe(&new_ctx->res_ctx, pool, stream);
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn42b/dcn42b_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn42b/dcn42b_resource.c
index 338c506588d9..aeecdd2daae2 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn42b/dcn42b_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn42b/dcn42b_resource.c
@@ -1950,6 +1950,86 @@ static unsigned int dcn42b_get_max_hw_cursor_size(const struct dc *dc,
return dc->caps.max_cursor_size;
}
+/*
+ * DCN 4.2B has 4 pipes but only 3 OPPs. An OPP head needs its own OPP, so the
+ * pipe without one can only be a secondary DPP pipe.
+ */
+static bool dcn42b_can_pipe_be_opp_head(const struct resource_pool *pool,
+ int pipe_idx)
+{
+ return pipe_idx >= 0 && pool->opps[pipe_idx];
+}
+
+static int dcn42b_find_optimal_free_pipe_as_secondary_opp_head(
+ const struct resource_context *cur_res_ctx,
+ struct resource_context *new_res_ctx,
+ const struct resource_pool *pool,
+ const struct pipe_ctx *new_otg_master)
+{
+ const struct pipe_ctx *cur_otg_master;
+ int free_pipe_idx;
+
+ cur_otg_master = &cur_res_ctx->pipe_ctx[new_otg_master->pipe_idx];
+ free_pipe_idx = resource_find_free_pipe_used_as_sec_opp_head_by_cur_otg_master(
+ cur_res_ctx, new_res_ctx, cur_otg_master);
+
+ if (!dcn42b_can_pipe_be_opp_head(pool, free_pipe_idx))
+ free_pipe_idx = recource_find_free_pipe_not_used_in_cur_res_ctx(
+ cur_res_ctx, new_res_ctx, pool);
+
+ if (!dcn42b_can_pipe_be_opp_head(pool, free_pipe_idx))
+ free_pipe_idx = resource_find_any_free_pipe(new_res_ctx, pool);
+
+ if (!dcn42b_can_pipe_be_opp_head(pool, free_pipe_idx))
+ return FREE_PIPE_INDEX_NOT_FOUND;
+
+ return free_pipe_idx;
+}
+
+struct pipe_ctx *dcn42b_acquire_free_pipe_as_secondary_opp_head(
+ const struct dc_state *cur_ctx,
+ struct dc_state *new_ctx,
+ const struct resource_pool *pool,
+ const struct pipe_ctx *otg_master)
+{
+ int free_pipe_idx = dcn42b_find_optimal_free_pipe_as_secondary_opp_head(
+ &cur_ctx->res_ctx, &new_ctx->res_ctx,
+ pool, otg_master);
+ struct pipe_ctx *free_pipe;
+
+ if (free_pipe_idx >= 0) {
+ free_pipe = &new_ctx->res_ctx.pipe_ctx[free_pipe_idx];
+ free_pipe->pipe_idx = (uint8_t)free_pipe_idx;
+ free_pipe->stream = otg_master->stream;
+ free_pipe->stream_res.tg = otg_master->stream_res.tg;
+ free_pipe->stream_res.dsc = NULL;
+ free_pipe->stream_res.opp = pool->opps[free_pipe_idx];
+ free_pipe->plane_res.mi = pool->mis[free_pipe_idx];
+ free_pipe->plane_res.hubp = pool->hubps[free_pipe_idx];
+ free_pipe->plane_res.ipp = pool->ipps[free_pipe_idx];
+ free_pipe->plane_res.xfm = pool->transforms[free_pipe_idx];
+ free_pipe->plane_res.dpp = pool->dpps[free_pipe_idx];
+ free_pipe->plane_res.mpcc_inst = (uint8_t)pool->dpps[free_pipe_idx]->inst;
+ free_pipe->dsc_padding_params = otg_master->dsc_padding_params;
+ if (free_pipe->stream->timing.flags.DSC == 1) {
+ dcn20_acquire_dsc(free_pipe->stream->ctx->dc,
+ &new_ctx->res_ctx,
+ &free_pipe->stream_res.dsc,
+ free_pipe_idx);
+ ASSERT(free_pipe->stream_res.dsc);
+ if (free_pipe->stream_res.dsc == NULL) {
+ memset(free_pipe, 0, sizeof(*free_pipe));
+ free_pipe = NULL;
+ }
+ }
+ } else {
+ ASSERT(otg_master);
+ free_pipe = NULL;
+ }
+
+ return free_pipe;
+}
+
static struct resource_funcs dcn42b_res_pool_funcs = {
.destroy = dcn42b_destroy_resource_pool,
.link_enc_create = dcn42b_link_encoder_create,
@@ -1961,7 +2041,7 @@ static struct resource_funcs dcn42b_res_pool_funcs = {
.calculate_wm_and_dlg = NULL,
.populate_dml_pipes = NULL,
.acquire_free_pipe_as_secondary_dpp_pipe = dcn32_acquire_free_pipe_as_secondary_dpp_pipe,
- .acquire_free_pipe_as_secondary_opp_head = dcn32_acquire_free_pipe_as_secondary_opp_head,
+ .acquire_free_pipe_as_secondary_opp_head = dcn42b_acquire_free_pipe_as_secondary_opp_head,
.release_pipe = dcn20_release_pipe,
.add_stream_to_ctx = dcn30_add_stream_to_ctx,
.add_dsc_to_stream_resource = dcn20_add_dsc_to_stream_resource,
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn42b/dcn42b_resource.h b/drivers/gpu/drm/amd/display/dc/resource/dcn42b/dcn42b_resource.h
index 484ba1455468..8b9e3e9723ed 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn42b/dcn42b_resource.h
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn42b/dcn42b_resource.h
@@ -516,4 +516,10 @@ enum dc_status dcn42b_validate_bandwidth(struct dc *dc,
void dcn42b_prepare_mcache_programming(struct dc *dc, struct dc_state *context);
+struct pipe_ctx *dcn42b_acquire_free_pipe_as_secondary_opp_head(
+ const struct dc_state *cur_ctx,
+ struct dc_state *new_ctx,
+ const struct resource_pool *pool,
+ const struct pipe_ctx *otg_master);
+
#endif /* _DCN42B_RESOURCE_H_ */
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* [PATCH 25/27] drm/amd/display: Count planes, not pipes, in the surface check
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (23 preceding siblings ...)
2026-11-25 6:55 ` [PATCH 24/27] drm/amd/display: Fix two streams sharing one OTG Chenyu Chen
@ 2026-11-25 6:55 ` Chenyu Chen
2026-11-25 6:55 ` [PATCH 26/27] drm/amd/display: [FW Promotion] Release 0.1.86.0 Chenyu Chen
` (3 subsequent siblings)
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:55 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, Tony Cheng, Jun Lei,
Chenyu Chen
From: Tony Cheng <tony.cheng@amd.com>
[Why]
core2_surfaces_supported compares the number of DPP pipes of the
stream with the number of surfaces. With ODM, one plane has one DPP
pipe for each ODM slice. Thus the check rejects each plane update on
an ODM stream, and DC does not program the plane.
[How]
Compare the plane count of the stream status in the new state with
the number of surfaces. Each surface must still be the plane of a DPP
pipe of the stream. The vsync flip change to the DC2 seamless update
added the pipe count check.
Cc: Jun Lei <jun.lei@amd.com>
Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
drivers/gpu/drm/amd/display/dc/core2/dc_core2.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core2/dc_core2.c b/drivers/gpu/drm/amd/display/dc/core2/dc_core2.c
index ce2d4f0c89d6..1ab1f0ec2e41 100644
--- a/drivers/gpu/drm/amd/display/dc/core2/dc_core2.c
+++ b/drivers/gpu/drm/amd/display/dc/core2/dc_core2.c
@@ -337,14 +337,17 @@ static bool core2_surfaces_supported(
const struct dc_update_scratch_space *scratch)
{
struct pipe_ctx *dpp_pipes[MAX_PIPES];
+ struct dc_stream_status *status;
int i, j, n;
if (!scratch->surface_updates)
return false;
+ status = dc_state_get_stream_status(scratch->new_context,
+ scratch->stream);
+ if (!status || status->plane_count != scratch->surface_count)
+ return false;
n = resource_get_dpp_pipes_for_stream(scratch->stream,
&scratch->new_context->res_ctx, dpp_pipes);
- if (n != scratch->surface_count)
- return false;
for (i = 0; i < scratch->surface_count; i++) {
for (j = 0; j < n; j++)
if (dpp_pipes[j]->plane_state ==
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* [PATCH 26/27] drm/amd/display: [FW Promotion] Release 0.1.86.0
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (24 preceding siblings ...)
2026-11-25 6:55 ` [PATCH 25/27] drm/amd/display: Count planes, not pipes, in the surface check Chenyu Chen
@ 2026-11-25 6:55 ` Chenyu Chen
2026-11-25 6:55 ` [PATCH 27/27] drm/amd/display: Promote DC to 3.2.409 Chenyu Chen
` (2 subsequent siblings)
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:55 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, Taimur Hassan, Chenyu Chen
From: Taimur Hassan <Syed.Hassan@amd.com>
Updated DMUB interface
- Add the maximum LSDMA bandwidth parameter to the DCN6 bounding-box data
Signed-off-by: Taimur Hassan <Syed.Hassan@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 1 +
1 file changed, 1 insertion(+)
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 8a0ef22e7e82..36c75c6a0764 100644
--- a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
+++ b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
@@ -444,6 +444,7 @@ struct dmub_soc_bb_params {
uint32_t fams2_lock_timeout_us;
uint32_t fams2_recovery_timeout_us;
uint32_t fams2_flip_programming_delay_us;
+ uint32_t max_lsdma_bandwidth_kbps;
};
#pragma pack(pop)
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* [PATCH 27/27] drm/amd/display: Promote DC to 3.2.409
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (25 preceding siblings ...)
2026-11-25 6:55 ` [PATCH 26/27] drm/amd/display: [FW Promotion] Release 0.1.86.0 Chenyu Chen
@ 2026-11-25 6:55 ` Chenyu Chen
2026-11-27 5:44 ` [PATCH 00/27] DC Patches Nov 30 2026 Chung, ChiaHsuan (Tom)
2026-11-30 14:10 ` Wheeler, Daniel
28 siblings, 0 replies; 31+ messages in thread
From: Chenyu Chen @ 2026-11-25 6:55 UTC (permalink / raw)
To: amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Tom Chung, Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski,
Alex Hung, James Lin, Chenyu Chen, Taimur Hassan, Chenyu Chen
From: Taimur Hassan <Syed.Hassan@amd.com>
This version brings along the following updates:
- Avoid per-entry long division in __drm_lut32_to_dc_gamma
- Add more diagnostic logging, a debug option to force the DP link rate
and per-CRTC pstate method in connector debugfs
- Reject Replay activation on an inactive link
- Decouple PROGRAM_CURSOR_UPDATE_NOW from dc and pipe_ctx
- Add DPMS-v2 init and tx init, and implement link_set_dpms_off_v2
- Derive DCN6 DSCCLK range from DISPCLK
- Carry stream and plane update bits in update_flags and add vsync and
immediate flips to the DC2 seamless update
- Preserve bandwidth floors in overrides
- Set HDMI bypass earlier
- Add DMUB timer reference clock to ref_clocks
- Guard connector I2C transfer without DDC pin
- Refactor ABM_SET_PIPE and ABM_SET_IMMEDIATE_DISABLE
- Add amdgpu_dm_dmub tests for alt-ch apertures, SET_CONFIG sync wait,
AUX transfer timeout and fused IO replies
- Use Z8 enter plus exit for vblank reserve
- Fix two streams sharing one OTG
- Count planes, not pipes, in the surface check
- Promote DMUB firmware to release 0.1.86.0
Signed-off-by: Taimur Hassan <Syed.Hassan@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@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 69d6eed1df41..14703c0e0224 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -69,7 +69,7 @@ struct dcn_dsc_reg_state;
struct dcn_optc_reg_state;
struct dcn_dccg_reg_state;
-#define DC_VER "3.2.408"
+#define DC_VER "3.2.409"
/**
* MAX_SURFACES - representative of the upper bound of surfaces that can be piped to a single CRTC
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread* Re: [PATCH 00/27] DC Patches Nov 30 2026
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (26 preceding siblings ...)
2026-11-25 6:55 ` [PATCH 27/27] drm/amd/display: Promote DC to 3.2.409 Chenyu Chen
@ 2026-11-27 5:44 ` Chung, ChiaHsuan (Tom)
2026-11-30 14:10 ` Wheeler, Daniel
28 siblings, 0 replies; 31+ messages in thread
From: Chung, ChiaHsuan (Tom) @ 2026-11-27 5:44 UTC (permalink / raw)
To: Chenyu Chen, amd-gfx
Cc: Harry Wentland, Leo Li, Aurabindo Pillai, Roman Li, Wayne Lin,
Fangzhi Zuo, Dan Wheeler, Ray Wu, Ivan Lipski, Alex Hung,
James Lin
On 11/25/2026 2:54 PM, Chenyu Chen wrote:
> This DC patchset brings improvements in multiple areas. In summary, we highlight:
>
> - Avoid per-entry long division in __drm_lut32_to_dc_gamma
> - Add more diagnostic logging, a debug option to force the DP link rate
> and per-CRTC pstate method in connector debugfs
> - Reject Replay activation on an inactive link
> - Decouple PROGRAM_CURSOR_UPDATE_NOW from dc and pipe_ctx
> - Add DPMS-v2 init and tx init, and implement link_set_dpms_off_v2
> - Derive DCN6 DSCCLK range from DISPCLK
> - Carry stream and plane update bits in update_flags and add vsync and
> immediate flips to the DC2 seamless update
> - Preserve bandwidth floors in overrides
> - Set HDMI bypass earlier
> - Add DMUB timer reference clock to ref_clocks
> - Guard connector I2C transfer without DDC pin
> - Refactor ABM_SET_PIPE and ABM_SET_IMMEDIATE_DISABLE
> - Add amdgpu_dm_dmub tests for alt-ch apertures, SET_CONFIG sync wait,
> AUX transfer timeout and fused IO replies
> - Use Z8 enter plus exit for vblank reserve
> - Fix two streams sharing one OTG
> - Count planes, not pipes, in the surface check
> - Promote DMUB firmware to release 0.1.86.0
>
> Cc: Daniel Wheeler <daniel.wheeler@amd.com>
Series is
Reviewed-by: Tom Chung <chiahsuan.chung@amd.com>
Tom
>
> Alan Liu (1):
> drm/amd/display: Avoid per-entry long division in
> __drm_lut32_to_dc_gamma
>
> Alex Hung (4):
> drm/amd/display: Test amdgpu_dm_dmub alt-ch apertures
> drm/amd/display: Test amdgpu_dm_dmub SET_CONFIG sync wait
> drm/amd/display: Test amdgpu_dm_dmub AUX transfer timeout
> drm/amd/display: Test amdgpu_dm_dmub fused IO replies
>
> Allen Pan (1):
> drm/amd/display: Add debug option to force DP link rate
>
> Alvin Lee (1):
> drm/amd/display: Add DMUB timer reference clock to ref_clocks
>
> Charlene Liu (1):
> drm/amd/display: Set HDMI bypass earlier
>
> Dillon Varone (1):
> drm/amd/display: Capture more diagnostic register state
>
> Dominik Kowalski (3):
> drm/amd/display: Add DPMS-v2 init
> drm/amd/display: Add DPMS-v2 tx init
> drm/amd/display: Implement link_set_dpms_off_v2
>
> Gabe Teeger (1):
> drm/amd/display: Fix two streams sharing one OTG
>
> Harry VanZyllDeJong (1):
> drm/amd/display: Reject Replay activation on an inactive link
>
> Ivan Lipski (2):
> drm/amd/display: Expose per-CRTC pstate method in connector debugfs
> drm/amd/display: Derive DCN6 DSCCLK range from DISPCLK
>
> James Lin (1):
> drm/amd/display: Guard connector I2C transfer without DDC pin
>
> Ovidiu Bunea (1):
> drm/amd/display: Use Z8 enter plus exit for vblank reserve
>
> Piotr Maziarz (1):
> drm/amd/display: Decouple PROGRAM_CURSOR_UPDATE_NOW from dc and
> pipe_ctx
>
> Rafal Ostrowski (1):
> drm/amd/display: Refactor ABM_SET_PIPE and ABM_SET_IMMEDIATE_DISABLE
>
> Taimur Hassan (2):
> drm/amd/display: [FW Promotion] Release 0.1.86.0
> drm/amd/display: Promote DC to 3.2.409
>
> Tony Cheng (4):
> drm/amd/display: Carry the stream and plane update bits in
> update_flags
> drm/amd/display: Add the vsync flip to the DC2 seamless update
> drm/amd/display: Add the immediate flip to the DC2 seamless update
> drm/amd/display: Count planes, not pipes, in the surface check
>
> Wenjing Liu (1):
> drm/amd/display: Preserve bandwidth floors in overrides
>
> .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 21 +-
> .../display/amdgpu_dm/amdgpu_dm_connector.c | 6 +-
> .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 34 ++
> .../amd/display/amdgpu_dm/amdgpu_dm_dmub.c | 1 +
> .../amdgpu_dm/tests/amdgpu_dm_dmub_test.c | 283 ++++++++++
> .../bls_builder/bls_builder_private_types.h | 12 +
> .../dc/bls_builder/dcn401_builder_internal.h | 14 +
> .../dc/bls_builder/dcn401_seamless_builder.c | 482 +++++++++++++++---
> .../display/dc/clk_mgr/dcn60/dcn60_clk_mgr.c | 18 +-
> drivers/gpu/drm/amd/display/dc/core/dc.c | 5 +-
> .../drm/amd/display/dc/core/dc_hw_sequencer.c | 192 +++++--
> .../gpu/drm/amd/display/dc/core/dc_resource.c | 64 ++-
> .../gpu/drm/amd/display/dc/core/dc_state.c | 4 +
> .../gpu/drm/amd/display/dc/core2/dc_core2.c | 76 ++-
> drivers/gpu/drm/amd/display/dc/dc.h | 4 +-
> drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 11 +-
> drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 8 +-
> .../gpu/drm/amd/display/dc/dc_state_priv.h | 8 +-
> drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c | 66 ++-
> drivers/gpu/drm/amd/display/dc/dce/dmub_abm.h | 2 +
> .../dc/dio/dcn401/dcn401_dio_stream_encoder.c | 15 +
> .../dc/dio/dcn401/dcn401_dio_stream_encoder.h | 4 +
> .../dc/dio/dcn42/dcn42_dio_link_encoder.c | 12 +-
> .../dc/dio/dcn42/dcn42_dio_stream_encoder.c | 2 +-
> .../dc/dio/dcn60/dcn60_dio_stream_encoder.c | 2 +-
> .../dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c | 35 +-
> .../src/inc/dml2_internal_shared_types.h | 1 +
> .../display/dc/hubbub/dcn10/dcn10_hubbub.h | 1 +
> .../display/dc/hubbub/dcn20/dcn20_hubbub.c | 6 +
> .../display/dc/hubbub/dcn35/dcn35_hubbub.h | 1 +
> .../display/dc/hubbub/dcn42/dcn42_hubbub.h | 3 +-
> .../amd/display/dc/hwss/dcn21/dcn21_hwseq.c | 108 ++--
> .../amd/display/dc/hwss/dcn30/dcn30_hwseq.c | 2 +
> .../amd/display/dc/hwss/dcn31/dcn31_hwseq.c | 2 +
> .../amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 2 +
> .../amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 6 +-
> .../amd/display/dc/hwss/dcn35/dcn35_hwseq.h | 2 +-
> .../amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 8 +-
> .../amd/display/dc/hwss/dcn42/dcn42_hwseq.c | 2 +
> .../amd/display/dc/hwss/dcn50/dcn50_hwseq.c | 2 +
> .../drm/amd/display/dc/hwss/hw_sequencer.h | 59 ++-
> .../gpu/drm/amd/display/dc/inc/core_types.h | 1 +
> drivers/gpu/drm/amd/display/dc/inc/hw/abm.h | 10 +-
> .../gpu/drm/amd/display/dc/inc/hw/dchubbub.h | 2 +
> drivers/gpu/drm/amd/display/dc/link/Makefile | 11 +
> .../drm/amd/display/dc/link/link_dpms_v1.c | 84 +++
> .../drm/amd/display/dc/link/link_dpms_v1.h | 29 ++
> .../drm/amd/display/dc/link/link_dpms_v2.c | 250 ++++++++-
> .../drm/amd/display/dc/link/link_factory.c | 90 +++-
> .../link/protocols/link_edp_panel_control.c | 6 +
> .../drm/amd/display/dc/link/tx/link_tx_v1.c | 55 ++
> .../drm/amd/display/dc/link/tx/link_tx_v1.h | 34 ++
> .../drm/amd/display/dc/link/tx/link_tx_v2.c | 83 +++
> .../drm/amd/display/dc/link/tx/link_tx_v2.h | 38 ++
> .../dc/resource/dcn401/dcn401_resource.h | 1 +
> .../dc/resource/dcn42b/dcn42b_resource.c | 82 ++-
> .../dc/resource/dcn42b/dcn42b_resource.h | 6 +
> .../dc/resource/dcn60/dcn60_resource.c | 4 +
> .../dc/resource/dcn60/dcn60_resource.h | 1 +
> .../dcn60/dcn60_soc_and_ip_translator.c | 15 +
> drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 12 +
> .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 1 +
> .../drm/amd/display/dmub/src/dmub_dcn401.c | 40 ++
> .../drm/amd/display/dmub/src/dmub_dcn401.h | 39 +-
> .../gpu/drm/amd/display/dmub/src/dmub_dcn42.c | 37 ++
> .../gpu/drm/amd/display/dmub/src/dmub_dcn42.h | 36 +-
> .../drm/amd/display/dmub/src/dmub_dcn42b.c | 1 +
> .../gpu/drm/amd/display/dmub/src/dmub_dcn60.c | 38 ++
> .../gpu/drm/amd/display/dmub/src/dmub_dcn60.h | 36 +-
> 69 files changed, 2331 insertions(+), 297 deletions(-)
> create mode 100644 drivers/gpu/drm/amd/display/dc/link/tx/link_tx_v1.c
> create mode 100644 drivers/gpu/drm/amd/display/dc/link/tx/link_tx_v1.h
> create mode 100644 drivers/gpu/drm/amd/display/dc/link/tx/link_tx_v2.c
> create mode 100644 drivers/gpu/drm/amd/display/dc/link/tx/link_tx_v2.h
>
^ permalink raw reply [flat|nested] 31+ messages in thread* RE: [PATCH 00/27] DC Patches Nov 30 2026
2026-11-25 6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
` (27 preceding siblings ...)
2026-11-27 5:44 ` [PATCH 00/27] DC Patches Nov 30 2026 Chung, ChiaHsuan (Tom)
@ 2026-11-30 14:10 ` Wheeler, Daniel
28 siblings, 0 replies; 31+ messages in thread
From: Wheeler, Daniel @ 2026-11-30 14:10 UTC (permalink / raw)
To: Chen, Chen-Yu, amd-gfx@lists.freedesktop.org
Cc: Wentland, Harry, Li, Sun peng (Leo), Pillai, Aurabindo, Li, Roman,
Lin, Wayne, Chung, ChiaHsuan (Tom), Zuo, Jerry, Wu, Ray,
LIPSKI, IVAN, Hung, Alex, Lin, Ping Lei, Chen, Chen-Yu,
Chen, Chen-Yu
Public
Hi all,
This week this patchset was tested on 4 systems, two dGPU and two APU based, and tested across multiple display and connection types.
APU
* Single Display eDP -> 1080p 60hz, 1920x1200 165hz, 3840x2400 60hz
* Single Display DP (SST DSC) -> 4k144hz, 4k240hz
* Multi display -> eDP + DP/HDMI/USB-C -> 1080p 60hz eDP + 4k 144hz, 4k 240hz (Includes USB-C to DP/HDMI adapters)
* Thunderbolt -> LG Ultrafine 5k
* MST DSC -> Cable Matters 101075 (DP to 3x DP) with 3x 4k60hz displays, HP Hook G2 with 2x 4k60hz displays
* USB 4 -> HP Hook G4, Lenovo Thunderbolt Dock, both with 2x 4k60hz DP and 1x 4k60hz HDMI displays
* SST PCON -> Club3D CAC-1085 + 1x 4k 144hz, FRL3, at a max resolution supported by the dongle of 4k 120hz YUV420 12bpc.
* MST PCON -> 1x 4k 144hz, FRL3, at a max resolution supported by the adapter of 4k 120hz RGB 8bpc.
DGPU
* Single Display DP (SST DSC) -> 4k144hz, 4k240hz
* Multiple Display DP -> 4k240hz + 4k144hz
* MST (Startech MST14DP123DP [DP to 3x DP] and 2x 4k 60hz displays)
* MST DSC (with Cable Matters 101075 [DP to 3x DP] with 3x 4k60hz displays)
The testing is a mix of automated and manual tests. Manual testing includes (but is not limited to)
* Changing display configurations and settings
* Video/Audio playback
* Benchmark testing
* Suspend/Resume testing
* Feature testing (Freesync, HDCP, etc.)
Automated testing includes (but is not limited to)
* Script testing (scripts to automate some of the manual checks)
* IGT testing
The testing is mainly tested on the following displays, but occasionally there are tests with other displays
* Samsung G8 Neo 4k240hz
* Samsung QN55QN95B 4k 120hz
* Acer XV322QKKV 4k144hz
* HP U27 4k Wireless 4k60hz
* LG 27UD58B 4k60hz
* LG 32UN650WA 4k60hz
* LG Ultrafine 5k 5k60hz
* AU Optronics B140HAN01.1 1080p 60hz eDP
* AU Optronics B160UAN01.J 1920x1200 165hz eDP
* Samsung ATNA60YV02-0 3840x2400 60Hz OLED eDP
The patchset consists of the amd-staging-drm-next branch (Head commit -> 5e6d3a550bc82ddce90a29936267331e18a7d725 -> drm/amd/display: Fix aux timeout callback across engines) with new patches added on top of it.
Tested on Ubuntu 26.04, on Gnome Wayland.
Tested-by: Dan 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: Chenyu Chen <chen-yu.chen@amd.com>
Sent: Wednesday, November 25, 2026 1:55 AM
To: amd-gfx@lists.freedesktop.org
Cc: Wentland, Harry <Harry.Wentland@amd.com>; Li, Sun peng (Leo) <Sunpeng.Li@amd.com>; Pillai, Aurabindo <Aurabindo.Pillai@amd.com>; Li, Roman <Roman.Li@amd.com>; Lin, Wayne <Wayne.Lin@amd.com>; Chung, ChiaHsuan (Tom) <ChiaHsuan.Chung@amd.com>; Zuo, Jerry <Jerry.Zuo@amd.com>; Wheeler, Daniel <Daniel.Wheeler@amd.com>; Wu, Ray <Ray.Wu@amd.com>; LIPSKI, IVAN <IVAN.LIPSKI@amd.com>; Hung, Alex <Alex.Hung@amd.com>; Lin, Ping Lei <PingLei.Lin@amd.com>; Chen, Chen-Yu <Chen-Yu.Chen@amd.com>; Chen, Chen-Yu <Chen-Yu.Chen@amd.com>
Subject: [PATCH 00/27] DC Patches Nov 30 2026
This DC patchset brings improvements in multiple areas. In summary, we highlight:
- Avoid per-entry long division in __drm_lut32_to_dc_gamma
- Add more diagnostic logging, a debug option to force the DP link rate
and per-CRTC pstate method in connector debugfs
- Reject Replay activation on an inactive link
- Decouple PROGRAM_CURSOR_UPDATE_NOW from dc and pipe_ctx
- Add DPMS-v2 init and tx init, and implement link_set_dpms_off_v2
- Derive DCN6 DSCCLK range from DISPCLK
- Carry stream and plane update bits in update_flags and add vsync and
immediate flips to the DC2 seamless update
- Preserve bandwidth floors in overrides
- Set HDMI bypass earlier
- Add DMUB timer reference clock to ref_clocks
- Guard connector I2C transfer without DDC pin
- Refactor ABM_SET_PIPE and ABM_SET_IMMEDIATE_DISABLE
- Add amdgpu_dm_dmub tests for alt-ch apertures, SET_CONFIG sync wait,
AUX transfer timeout and fused IO replies
- Use Z8 enter plus exit for vblank reserve
- Fix two streams sharing one OTG
- Count planes, not pipes, in the surface check
- Promote DMUB firmware to release 0.1.86.0
Cc: Daniel Wheeler <daniel.wheeler@amd.com>
Alan Liu (1):
drm/amd/display: Avoid per-entry long division in
__drm_lut32_to_dc_gamma
Alex Hung (4):
drm/amd/display: Test amdgpu_dm_dmub alt-ch apertures
drm/amd/display: Test amdgpu_dm_dmub SET_CONFIG sync wait
drm/amd/display: Test amdgpu_dm_dmub AUX transfer timeout
drm/amd/display: Test amdgpu_dm_dmub fused IO replies
Allen Pan (1):
drm/amd/display: Add debug option to force DP link rate
Alvin Lee (1):
drm/amd/display: Add DMUB timer reference clock to ref_clocks
Charlene Liu (1):
drm/amd/display: Set HDMI bypass earlier
Dillon Varone (1):
drm/amd/display: Capture more diagnostic register state
Dominik Kowalski (3):
drm/amd/display: Add DPMS-v2 init
drm/amd/display: Add DPMS-v2 tx init
drm/amd/display: Implement link_set_dpms_off_v2
Gabe Teeger (1):
drm/amd/display: Fix two streams sharing one OTG
Harry VanZyllDeJong (1):
drm/amd/display: Reject Replay activation on an inactive link
Ivan Lipski (2):
drm/amd/display: Expose per-CRTC pstate method in connector debugfs
drm/amd/display: Derive DCN6 DSCCLK range from DISPCLK
James Lin (1):
drm/amd/display: Guard connector I2C transfer without DDC pin
Ovidiu Bunea (1):
drm/amd/display: Use Z8 enter plus exit for vblank reserve
Piotr Maziarz (1):
drm/amd/display: Decouple PROGRAM_CURSOR_UPDATE_NOW from dc and
pipe_ctx
Rafal Ostrowski (1):
drm/amd/display: Refactor ABM_SET_PIPE and ABM_SET_IMMEDIATE_DISABLE
Taimur Hassan (2):
drm/amd/display: [FW Promotion] Release 0.1.86.0
drm/amd/display: Promote DC to 3.2.409
Tony Cheng (4):
drm/amd/display: Carry the stream and plane update bits in
update_flags
drm/amd/display: Add the vsync flip to the DC2 seamless update
drm/amd/display: Add the immediate flip to the DC2 seamless update
drm/amd/display: Count planes, not pipes, in the surface check
Wenjing Liu (1):
drm/amd/display: Preserve bandwidth floors in overrides
.../amd/display/amdgpu_dm/amdgpu_dm_color.c | 21 +-
.../display/amdgpu_dm/amdgpu_dm_connector.c | 6 +-
.../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 34 ++
.../amd/display/amdgpu_dm/amdgpu_dm_dmub.c | 1 +
.../amdgpu_dm/tests/amdgpu_dm_dmub_test.c | 283 ++++++++++
.../bls_builder/bls_builder_private_types.h | 12 +
.../dc/bls_builder/dcn401_builder_internal.h | 14 + .../dc/bls_builder/dcn401_seamless_builder.c | 482 +++++++++++++++--- .../display/dc/clk_mgr/dcn60/dcn60_clk_mgr.c | 18 +-
drivers/gpu/drm/amd/display/dc/core/dc.c | 5 +-
.../drm/amd/display/dc/core/dc_hw_sequencer.c | 192 +++++-- .../gpu/drm/amd/display/dc/core/dc_resource.c | 64 ++-
.../gpu/drm/amd/display/dc/core/dc_state.c | 4 +
.../gpu/drm/amd/display/dc/core2/dc_core2.c | 76 ++-
drivers/gpu/drm/amd/display/dc/dc.h | 4 +-
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 11 +-
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 8 +-
.../gpu/drm/amd/display/dc/dc_state_priv.h | 8 +-
drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c | 66 ++-
drivers/gpu/drm/amd/display/dc/dce/dmub_abm.h | 2 +
.../dc/dio/dcn401/dcn401_dio_stream_encoder.c | 15 +
.../dc/dio/dcn401/dcn401_dio_stream_encoder.h | 4 +
.../dc/dio/dcn42/dcn42_dio_link_encoder.c | 12 +-
.../dc/dio/dcn42/dcn42_dio_stream_encoder.c | 2 +-
.../dc/dio/dcn60/dcn60_dio_stream_encoder.c | 2 +-
.../dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c | 35 +-
.../src/inc/dml2_internal_shared_types.h | 1 +
.../display/dc/hubbub/dcn10/dcn10_hubbub.h | 1 +
.../display/dc/hubbub/dcn20/dcn20_hubbub.c | 6 +
.../display/dc/hubbub/dcn35/dcn35_hubbub.h | 1 +
.../display/dc/hubbub/dcn42/dcn42_hubbub.h | 3 +-
.../amd/display/dc/hwss/dcn21/dcn21_hwseq.c | 108 ++--
.../amd/display/dc/hwss/dcn30/dcn30_hwseq.c | 2 +
.../amd/display/dc/hwss/dcn31/dcn31_hwseq.c | 2 +
.../amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 2 +
.../amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 6 +-
.../amd/display/dc/hwss/dcn35/dcn35_hwseq.h | 2 +-
.../amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 8 +-
.../amd/display/dc/hwss/dcn42/dcn42_hwseq.c | 2 +
.../amd/display/dc/hwss/dcn50/dcn50_hwseq.c | 2 +
.../drm/amd/display/dc/hwss/hw_sequencer.h | 59 ++-
.../gpu/drm/amd/display/dc/inc/core_types.h | 1 +
drivers/gpu/drm/amd/display/dc/inc/hw/abm.h | 10 +-
.../gpu/drm/amd/display/dc/inc/hw/dchubbub.h | 2 +
drivers/gpu/drm/amd/display/dc/link/Makefile | 11 +
.../drm/amd/display/dc/link/link_dpms_v1.c | 84 +++
.../drm/amd/display/dc/link/link_dpms_v1.h | 29 ++
.../drm/amd/display/dc/link/link_dpms_v2.c | 250 ++++++++-
.../drm/amd/display/dc/link/link_factory.c | 90 +++-
.../link/protocols/link_edp_panel_control.c | 6 +
.../drm/amd/display/dc/link/tx/link_tx_v1.c | 55 ++
.../drm/amd/display/dc/link/tx/link_tx_v1.h | 34 ++
.../drm/amd/display/dc/link/tx/link_tx_v2.c | 83 +++
.../drm/amd/display/dc/link/tx/link_tx_v2.h | 38 ++
.../dc/resource/dcn401/dcn401_resource.h | 1 +
.../dc/resource/dcn42b/dcn42b_resource.c | 82 ++-
.../dc/resource/dcn42b/dcn42b_resource.h | 6 +
.../dc/resource/dcn60/dcn60_resource.c | 4 +
.../dc/resource/dcn60/dcn60_resource.h | 1 +
.../dcn60/dcn60_soc_and_ip_translator.c | 15 +
drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 12 +
.../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 1 +
.../drm/amd/display/dmub/src/dmub_dcn401.c | 40 ++
.../drm/amd/display/dmub/src/dmub_dcn401.h | 39 +-
.../gpu/drm/amd/display/dmub/src/dmub_dcn42.c | 37 ++ .../gpu/drm/amd/display/dmub/src/dmub_dcn42.h | 36 +-
.../drm/amd/display/dmub/src/dmub_dcn42b.c | 1 +
.../gpu/drm/amd/display/dmub/src/dmub_dcn60.c | 38 ++ .../gpu/drm/amd/display/dmub/src/dmub_dcn60.h | 36 +-
69 files changed, 2331 insertions(+), 297 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/link/tx/link_tx_v1.c
create mode 100644 drivers/gpu/drm/amd/display/dc/link/tx/link_tx_v1.h
create mode 100644 drivers/gpu/drm/amd/display/dc/link/tx/link_tx_v2.c
create mode 100644 drivers/gpu/drm/amd/display/dc/link/tx/link_tx_v2.h
--
2.43.0
^ permalink raw reply [flat|nested] 31+ messages in thread