From: James Lin <PingLei.Lin@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Harry Wentland <harry.wentland@amd.com>,
Leo Li <sunpeng.li@amd.com>,
Aurabindo Pillai <aurabindo.pillai@amd.com>,
Roman Li <roman.li@amd.com>, Wayne Lin <wayne.lin@amd.com>,
Tom Chung <chiahsuan.chung@amd.com>,
"Fangzhi Zuo" <jerry.zuo@amd.com>,
Dan Wheeler <daniel.wheeler@amd.com>, Ray Wu <Ray.Wu@amd.com>,
Ivan Lipski <ivan.lipski@amd.com>, Alex Hung <alex.hung@amd.com>,
James Lin <PingLei.Lin@amd.com>,
Chenyu Chen <Chen-Yu.Chen@amd.com>,
George Zhang <george.zhang@amd.com>,
James Lin <pinglei.lin@amd.com>
Subject: [PATCH 15/33] drm/amd/display: Fix KUnit tests for vblank control rework
Date: Tue, 17 Nov 2026 05:50:52 +0800 [thread overview]
Message-ID: <20261116215641.2800595-16-PingLei.Lin@amd.com> (raw)
In-Reply-To: <20261116215641.2800595-1-PingLei.Lin@amd.com>
From: George Zhang <george.zhang@amd.com>
[why & how]
The per-CRTC vblank_toggle_lock was replaced by a device-wide sw_counter_lock,
and the vblank-control-worker no longer touches active_vblank_irq_count on
disable (that now happens synchronously in amdgpu_dm_crtc_set_vblank() before
the worker is queued) -- seed the new lock across the affected fixtures and
rework the worker tests accordingly, also seeding reset_domain where
amdgpu_dm_crtc_set_vblank() now calls amdgpu_in_reset() unconditionally.
Cc: Sun peng Li <sunpeng.li@amd.com>
Signed-off-by: George Zhang <george.zhang@amd.com>
Signed-off-by: James Lin <pinglei.lin@amd.com>
---
.../amdgpu_dm/tests/amdgpu_dm_crtc_test.c | 219 +++++++++++++-----
.../amdgpu_dm/tests/amdgpu_dm_kunit_helpers.c | 2 +
.../display/amdgpu_dm/tests/amdgpu_dm_test.c | 5 +
3 files changed, 171 insertions(+), 55 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_crtc_test.c b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_crtc_test.c
index 20ad887979f7..ff73931a8c4d 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_crtc_test.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_crtc_test.c
@@ -909,6 +909,38 @@ static void dm_test_crtc_cleanup(void *data)
list_del_init(&acrtc->base.head);
}
+static void dm_test_crtc_destroy_vblank_wq(void *data)
+{
+ struct amdgpu_device *adev = data;
+
+ destroy_workqueue(adev->dm.vblank_control_workqueue);
+ adev->dm.vblank_control_workqueue = NULL;
+}
+
+/*
+ * dm_test_crtc_init_vblank_wq - Give @adev a live vblank control workqueue.
+ * @test: The KUnit test context
+ * @adev: The device to equip
+ *
+ * amdgpu_dm_crtc_set_vblank() queues unconditionally, as amdgpu_dm_init()
+ * fails driver init when the workqueue cannot be created. The worker takes
+ * dc_lock, so initialize that too. The workqueue is drained and destroyed at
+ * teardown; tests that assert on state the worker touches must flush it
+ * first.
+ */
+static void dm_test_crtc_init_vblank_wq(struct kunit *test,
+ struct amdgpu_device *adev)
+{
+ mutex_init(&adev->dm.dc_lock);
+ adev->dm.vblank_control_workqueue =
+ create_singlethread_workqueue("dm_test_vblank");
+ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, adev->dm.vblank_control_workqueue);
+ KUNIT_ASSERT_EQ(test,
+ kunit_add_action_or_reset(test,
+ dm_test_crtc_destroy_vblank_wq,
+ adev), 0);
+}
+
/*
* dm_test_crtc_arm_irq_src - Prime an IRQ source so get()/put() short-circuit.
* @test: The KUnit test context
@@ -978,6 +1010,9 @@ dm_test_crtc_setup_enable(struct kunit *test, struct amdgpu_device **adev_out,
acrtc->base.funcs = &dm_test_crtc_funcs;
acrtc->base.enabled = true;
acrtc->crtc_id = 0;
+ /* amdgpu_dm_crtc_set_vblank() takes this; amdgpu_dm_crtc_init() is bypassed. */
+ spin_lock_init(&adev->dm.sw_counter_lock);
+ dm_test_crtc_init_vblank_wq(test, adev);
INIT_LIST_HEAD(&acrtc->base.head);
list_add_tail(&acrtc->base.head, &adev->ddev.mode_config.crtc_list);
KUNIT_ASSERT_EQ(test,
@@ -1148,22 +1183,56 @@ static void dm_test_crtc_enable_vblank_queues_work(struct kunit *test)
dm_test_crtc_arm_irq_src(test, &adev->crtc_irq, 1);
dm_test_crtc_arm_irq_src(test, &adev->pageflip_irq, 1);
- /* Real workqueue so the queue_work() branch runs the control worker. */
- mutex_init(&adev->dm.dc_lock);
- adev->dm.vblank_control_workqueue =
- create_singlethread_workqueue("dm_test_vblank");
- KUNIT_ASSERT_NOT_ERR_OR_NULL(test, adev->dm.vblank_control_workqueue);
-
KUNIT_EXPECT_EQ(test, amdgpu_dm_crtc_enable_vblank(&acrtc->base), 0);
- /* Drain the queued worker before the fixture is torn down, then tidy up. */
- destroy_workqueue(adev->dm.vblank_control_workqueue);
- adev->dm.vblank_control_workqueue = NULL;
+ /* Drain the queued worker so the count below is observed deterministically. */
+ flush_workqueue(adev->dm.vblank_control_workqueue);
/* The queued worker ran and accounted the active vblank IRQ. */
KUNIT_EXPECT_EQ(test, adev->dm.active_vblank_irq_count, 1);
}
+/**
+ * dm_test_crtc_enable_vblank_idempotent - Test a redundant enable programs nothing
+ * @test: The KUnit test context
+ *
+ * amdgpu_dm_sync_vblank_irq() short-circuits when the request already matches
+ * vblank_irq_programmed, so a second enable must leave the crtc and pageflip
+ * IRQ references untouched rather than taking a second one.
+ */
+static void dm_test_crtc_enable_vblank_idempotent(struct kunit *test)
+{
+ struct dm_crtc_state *acrtc_state;
+ struct amdgpu_device *adev;
+ struct amdgpu_crtc *acrtc;
+ int crtc_refs, pflip_refs;
+
+ /* DCE_VERSION_8_0 supports VRR -> the vupdate-irq branch is walked. */
+ acrtc = dm_test_crtc_setup_enable(test, &adev, DCE_VERSION_8_0);
+
+ /* OTG unassigned -> amdgpu_dm_crtc_set_vupdate_irq() returns 0 early. */
+ acrtc->otg_inst = -1;
+ acrtc_state = to_dm_crtc_state(acrtc->base.state);
+ acrtc_state->freesync_config.state = VRR_STATE_ACTIVE_VARIABLE;
+
+ adev->irq.installed = true;
+ dm_test_crtc_arm_irq_src(test, &adev->crtc_irq, 1);
+ dm_test_crtc_arm_irq_src(test, &adev->pageflip_irq, 1);
+
+ KUNIT_EXPECT_EQ(test, amdgpu_dm_crtc_enable_vblank(&acrtc->base), 0);
+ KUNIT_EXPECT_TRUE(test, acrtc->dm_irq_params.vblank_irq_programmed);
+
+ crtc_refs = atomic_read(&adev->crtc_irq.enabled_types[0]);
+ pflip_refs = atomic_read(&adev->pageflip_irq.enabled_types[0]);
+
+ KUNIT_EXPECT_EQ(test, amdgpu_dm_crtc_enable_vblank(&acrtc->base), 0);
+
+ KUNIT_EXPECT_EQ(test, atomic_read(&adev->crtc_irq.enabled_types[0]),
+ crtc_refs);
+ KUNIT_EXPECT_EQ(test, atomic_read(&adev->pageflip_irq.enabled_types[0]),
+ pflip_refs);
+}
+
/**
* dm_test_crtc_enable_vblank_ips_restore - Test IPS/self-refresh vblank restore
* @test: The KUnit test context
@@ -1881,12 +1950,15 @@ static void dm_test_crtc_handle_vblank_completes_cursor_only(struct kunit *test)
/**
* dm_test_vblank_control_worker_setup - Build a vblank_control_work for the worker
* @test: The KUnit test context
- * @enable: Value for vblank_work->enable
+ * @enable: Value for vblank_work->enable; also seeds vblank_irq_desired so the
+ * worker's own program-decision ("desired && !programmed") matches it
* @count: Initial dm->active_vblank_irq_count
*
- * Returns a work item wired to a freshly allocated adev/crtc/stream. The CRTC is
- * left without an atomic state so amdgpu_dm_ism_commit_event() short-circuits and
- * only the vblank IRQ accounting in the worker runs.
+ * Returns a work item wired to a freshly allocated adev/crtc/stream, with the
+ * crtc/pageflip IRQ sources armed so amdgpu_dm_sync_vblank_irq() can actually
+ * program on the enable path. The CRTC is left without an atomic state so
+ * amdgpu_dm_ism_commit_event() short-circuits and only the vblank IRQ
+ * programming in the worker runs.
*/
static struct vblank_control_work *
dm_test_vblank_control_worker_setup(struct kunit *test, bool enable,
@@ -1901,14 +1973,24 @@ dm_test_vblank_control_worker_setup(struct kunit *test, bool enable,
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, adev);
mutex_init(&adev->dm.dc_lock);
+ spin_lock_init(&adev->dm.sw_counter_lock);
adev->dm.dc = dm_kunit_alloc_dc_with_ctx(test);
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, adev->dm.dc);
adev->dm.active_vblank_irq_count = count;
+ adev->mode_info.num_crtc = 1;
+ adev->irq.installed = true;
+
acrtc = kunit_kzalloc(test, sizeof(*acrtc), GFP_KERNEL);
KUNIT_ASSERT_NOT_NULL(test, acrtc);
acrtc->base.dev = &adev->ddev;
acrtc->base.state = NULL;
+ acrtc->crtc_id = 0;
+ /* OTG unassigned -> amdgpu_dm_crtc_set_vupdate_irq() returns 0 early. */
+ acrtc->otg_inst = -1;
+ acrtc->dm_irq_params.vblank_irq_desired = enable;
+ dm_test_crtc_arm_irq_src(test, &adev->crtc_irq, 1);
+ dm_test_crtc_arm_irq_src(test, &adev->pageflip_irq, 1);
stream = dm_kunit_alloc_stream(test, NULL);
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, stream);
@@ -1930,7 +2012,9 @@ dm_test_vblank_control_worker_setup(struct kunit *test, bool enable,
* dm_test_vblank_control_worker_enable_increments - Test enable bumps IRQ count
* @test: The KUnit test context
*
- * Running the worker with enable set must increment the active vblank IRQ count.
+ * With vblank_irq_desired seeded true and nothing yet programmed, the worker's
+ * program decision is true, so it calls amdgpu_dm_sync_vblank_irq(), which
+ * programs the IRQ and increments the active vblank IRQ count.
*/
static void dm_test_vblank_control_worker_enable_increments(struct kunit *test)
{
@@ -1943,16 +2027,22 @@ static void dm_test_vblank_control_worker_enable_increments(struct kunit *test)
amdgpu_dm_crtc_vblank_control_worker(&work->work);
KUNIT_EXPECT_EQ(test, dm->active_vblank_irq_count, 1);
+ KUNIT_EXPECT_TRUE(test, work->acrtc->dm_irq_params.vblank_irq_programmed);
}
/**
- * dm_test_vblank_control_worker_disable_decrements - Test disable drops IRQ count
+ * dm_test_vblank_control_worker_disable_leaves_count_unchanged - Test disable is a no-op here
* @test: The KUnit test context
*
- * Running the worker with enable clear must decrement a non-zero active vblank
- * IRQ count.
+ * amdgpu_dm_crtc_set_vblank()'s disable branch calls amdgpu_dm_sync_vblank_irq()
+ * synchronously, inline, before ever queuing this worker -- so by the time the
+ * worker runs, the real decrement has already happened elsewhere. With
+ * vblank_irq_desired seeded false and vblank_irq_programmed defaulting false,
+ * the worker's own program decision is false, so it must leave the count
+ * untouched; its only remaining job on disable is the (short-circuited) ISM
+ * ENTER_IDLE_REQUESTED dispatch.
*/
-static void dm_test_vblank_control_worker_disable_decrements(struct kunit *test)
+static void dm_test_vblank_control_worker_disable_leaves_count_unchanged(struct kunit *test)
{
struct vblank_control_work *work;
struct amdgpu_display_manager *dm;
@@ -1962,26 +2052,7 @@ static void dm_test_vblank_control_worker_disable_decrements(struct kunit *test)
amdgpu_dm_crtc_vblank_control_worker(&work->work);
- KUNIT_EXPECT_EQ(test, dm->active_vblank_irq_count, 1);
-}
-
-/**
- * dm_test_vblank_control_worker_disable_clamps_zero - Test disable clamps at zero
- * @test: The KUnit test context
- *
- * Disabling when the active vblank IRQ count is already zero must not underflow.
- */
-static void dm_test_vblank_control_worker_disable_clamps_zero(struct kunit *test)
-{
- struct vblank_control_work *work;
- struct amdgpu_display_manager *dm;
-
- work = dm_test_vblank_control_worker_setup(test, false, 0);
- dm = work->dm;
-
- amdgpu_dm_crtc_vblank_control_worker(&work->work);
-
- KUNIT_EXPECT_EQ(test, dm->active_vblank_irq_count, 0);
+ KUNIT_EXPECT_EQ(test, dm->active_vblank_irq_count, 2);
}
/**
@@ -1990,10 +2061,12 @@ static void dm_test_vblank_control_worker_disable_clamps_zero(struct kunit *test
*
* Disabling vblank walks amdgpu_dm_crtc_set_vblank()'s disable path. With the
* IRQ subsystem not installed, amdgpu_irq_put() returns early so the routine
- * completes without touching the vblank workqueue or the active IRQ count.
+ * completes without changing the active IRQ count.
*/
static void dm_test_crtc_disable_vblank_no_irq_installed(struct kunit *test)
{
+ struct amdgpu_reset_domain *reset_domain;
+ struct dm_crtc_state *dm_state;
struct amdgpu_device *adev;
struct amdgpu_crtc *acrtc;
@@ -2006,6 +2079,11 @@ static void dm_test_crtc_disable_vblank_no_irq_installed(struct kunit *test)
adev->dm.dc->ctx->dce_version = DCE_VERSION_6_0;
adev->dm.active_vblank_irq_count = 0;
+ /* amdgpu_dm_crtc_set_vblank() calls amdgpu_in_reset(adev) unconditionally. */
+ reset_domain = kunit_kzalloc(test, sizeof(*reset_domain), GFP_KERNEL);
+ KUNIT_ASSERT_NOT_NULL(test, reset_domain);
+ adev->reset_domain = reset_domain;
+
/* No CRTCs registered and IRQs not installed -> irq_put returns early. */
adev->mode_info.num_crtc = 0;
adev->irq.installed = false;
@@ -2014,8 +2092,23 @@ static void dm_test_crtc_disable_vblank_no_irq_installed(struct kunit *test)
KUNIT_ASSERT_NOT_NULL(test, acrtc);
acrtc->base.dev = &adev->ddev;
acrtc->crtc_id = 0;
+ spin_lock_init(&adev->dm.sw_counter_lock);
+ dm_test_crtc_init_vblank_wq(test, adev);
+ /* Without this the disable is a no-op: the IRQ is already not programmed. */
+ acrtc->dm_irq_params.vblank_irq_programmed = true;
+ /*
+ * Seed the ISM in a state where ENTER_IDLE_REQUESTED does not transition
+ * so the worker skips the ISM power-state dispatch and its timers.
+ */
+ acrtc->ism.current_state = DM_ISM_STATE_HYSTERESIS_WAITING;
+
+ /* CRTC state with no stream -> the stream-retain branch is skipped. */
+ dm_state = kunit_kzalloc(test, sizeof(*dm_state), GFP_KERNEL);
+ KUNIT_ASSERT_NOT_NULL(test, dm_state);
+ acrtc->base.state = &dm_state->base;
amdgpu_dm_crtc_disable_vblank(&acrtc->base);
+ flush_workqueue(adev->dm.vblank_control_workqueue);
KUNIT_EXPECT_EQ(test, adev->dm.active_vblank_irq_count, 0);
}
@@ -2025,12 +2118,13 @@ static void dm_test_crtc_disable_vblank_no_irq_installed(struct kunit *test)
* @test: The KUnit test context
*
* On a VRR-capable DC the disable path turns the vupdate IRQ off (OTG
- * unassigned so it returns early), releases the armed crtc and pageflip IRQ
- * references and completes without queuing vblank control work.
+ * unassigned so it returns early) and releases the armed crtc and pageflip
+ * IRQ references.
*/
static void dm_test_crtc_disable_vblank_vrr(struct kunit *test)
{
struct amdgpu_reset_domain *reset_domain;
+ struct dm_crtc_state *dm_state;
struct amdgpu_device *adev;
struct amdgpu_crtc *acrtc;
@@ -2059,8 +2153,23 @@ static void dm_test_crtc_disable_vblank_vrr(struct kunit *test)
acrtc->crtc_id = 0;
/* OTG unassigned -> amdgpu_dm_crtc_set_vupdate_irq() returns 0 early. */
acrtc->otg_inst = -1;
+ spin_lock_init(&adev->dm.sw_counter_lock);
+ dm_test_crtc_init_vblank_wq(test, adev);
+ /* Without this the disable is a no-op: the IRQ is already not programmed. */
+ acrtc->dm_irq_params.vblank_irq_programmed = true;
+ /*
+ * Seed the ISM in a state where ENTER_IDLE_REQUESTED does not transition
+ * so the worker skips the ISM power-state dispatch and its timers.
+ */
+ acrtc->ism.current_state = DM_ISM_STATE_HYSTERESIS_WAITING;
+
+ /* CRTC state with no stream -> the stream-retain branch is skipped. */
+ dm_state = kunit_kzalloc(test, sizeof(*dm_state), GFP_KERNEL);
+ KUNIT_ASSERT_NOT_NULL(test, dm_state);
+ acrtc->base.state = &dm_state->base;
amdgpu_dm_crtc_disable_vblank(&acrtc->base);
+ flush_workqueue(adev->dm.vblank_control_workqueue);
/* Both IRQ references were released without underflow. */
KUNIT_EXPECT_EQ(test, atomic_read(&adev->crtc_irq.enabled_types[0]), 1);
@@ -2073,9 +2182,12 @@ static void dm_test_crtc_disable_vblank_vrr(struct kunit *test)
*
* With a vblank control workqueue installed and a CRTC state carrying no
* stream, the disable path queues the control worker without retaining a
- * stream. Draining the queue runs the worker, which drops the active vblank IRQ
- * count. The ISM is seeded in a state with no ENTER_IDLE_REQUESTED transition
- * so the worker only exercises the vblank accounting.
+ * stream. amdgpu_dm_crtc_set_vblank()'s disable branch calls
+ * amdgpu_dm_sync_vblank_irq() synchronously (not via the worker), so the
+ * active vblank IRQ count has already dropped by the time this call returns.
+ * The ISM is seeded in a state with no ENTER_IDLE_REQUESTED transition so
+ * draining the queued worker only exercises its (short-circuited) ISM
+ * dispatch, leaving the count as this call already left it.
*/
static void dm_test_crtc_disable_vblank_queues_work(struct kunit *test)
{
@@ -2109,28 +2221,25 @@ static void dm_test_crtc_disable_vblank_queues_work(struct kunit *test)
acrtc->base.dev = &adev->ddev;
acrtc->crtc_id = 0;
acrtc->otg_inst = -1;
+ spin_lock_init(&adev->dm.sw_counter_lock);
+ /* Without this the disable is a no-op: the IRQ is already not programmed. */
+ acrtc->dm_irq_params.vblank_irq_programmed = true;
/*
* Seed the ISM in a state where ENTER_IDLE_REQUESTED does not transition
* so the worker skips the ISM power-state dispatch and its timers.
*/
acrtc->ism.current_state = DM_ISM_STATE_HYSTERESIS_WAITING;
+ dm_test_crtc_init_vblank_wq(test, adev);
/* CRTC state with no stream -> the stream-retain branch is skipped. */
dm_state = kunit_kzalloc(test, sizeof(*dm_state), GFP_KERNEL);
KUNIT_ASSERT_NOT_NULL(test, dm_state);
acrtc->base.state = &dm_state->base;
- /* Real workqueue so the queue_work() branch runs the control worker. */
- mutex_init(&adev->dm.dc_lock);
- adev->dm.vblank_control_workqueue =
- create_singlethread_workqueue("dm_test_vblank");
- KUNIT_ASSERT_NOT_ERR_OR_NULL(test, adev->dm.vblank_control_workqueue);
-
amdgpu_dm_crtc_disable_vblank(&acrtc->base);
- /* Drain the queued worker before the fixture is torn down, then tidy up. */
- destroy_workqueue(adev->dm.vblank_control_workqueue);
- adev->dm.vblank_control_workqueue = NULL;
+ /* Drain the queued worker so the count below is observed deterministically. */
+ flush_workqueue(adev->dm.vblank_control_workqueue);
/* The queued worker ran and decremented the active vblank IRQ count. */
KUNIT_EXPECT_EQ(test, adev->dm.active_vblank_irq_count, 1);
@@ -2667,6 +2776,7 @@ static struct kunit_case amdgpu_dm_crtc_tests[] = {
KUNIT_CASE(dm_test_crtc_enable_vblank_crtc_irq_error),
KUNIT_CASE(dm_test_crtc_enable_vblank_in_reset),
KUNIT_CASE(dm_test_crtc_enable_vblank_queues_work),
+ KUNIT_CASE(dm_test_crtc_enable_vblank_idempotent),
KUNIT_CASE(dm_test_crtc_enable_vblank_ips_restore),
KUNIT_CASE(dm_test_crtc_enable_vblank_ips_restore_replay),
/* amdgpu_dm_crtc_set_vline0_irq */
@@ -2696,8 +2806,7 @@ static struct kunit_case amdgpu_dm_crtc_tests[] = {
KUNIT_CASE(dm_test_crtc_handle_vblank_completes_cursor_only),
/* amdgpu_dm_crtc_vblank_control_worker */
KUNIT_CASE(dm_test_vblank_control_worker_enable_increments),
- KUNIT_CASE(dm_test_vblank_control_worker_disable_decrements),
- KUNIT_CASE(dm_test_vblank_control_worker_disable_clamps_zero),
+ KUNIT_CASE(dm_test_vblank_control_worker_disable_leaves_count_unchanged),
/* amdgpu_dm_crtc_disable_vblank */
KUNIT_CASE(dm_test_crtc_disable_vblank_no_irq_installed),
KUNIT_CASE(dm_test_crtc_disable_vblank_vrr),
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_kunit_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_kunit_helpers.c
index f844b644bb77..6031d9c9c29f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_kunit_helpers.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_kunit_helpers.c
@@ -95,6 +95,8 @@ struct amdgpu_display_manager *dm_kunit_alloc_dm(struct kunit *test)
dm->dc = dc;
dc->current_state = state;
+ /* Guards otg_sw_counter[]; amdgpu_dm_init() is bypassed here. */
+ spin_lock_init(&dm->sw_counter_lock);
return dm;
}
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_test.c b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_test.c
index a7618473e207..85f2e78c54af 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_test.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_test.c
@@ -1292,6 +1292,11 @@ static void dm_test_crtc_with_stream(struct kunit *test,
adev->mode_info.num_crtc = 1;
adev->mode_info.crtcs[0] = acrtc;
acrtc->dm_irq_params.stream = stream;
+
+ /* dm_vblank_get_counter()/dm_crtc_get_scanoutpos() take this unconditionally
+ * once a stream is set.
+ */
+ spin_lock_init(&adev->dm.sw_counter_lock);
}
/**
--
2.43.0
next prev parent reply other threads:[~2026-11-17 17:15 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 21:50 [PATCH 00/33] DC Patches November 23, 2026 James Lin
2026-11-16 21:50 ` [PATCH 01/33] drm/amd/display: Clear OTG_AUTO_FORCE_VSYNC_MODE on OTG disable James Lin
2026-11-16 21:50 ` [PATCH 02/33] drm/amd/display: Rename DPMS to DPMS_v1 James Lin
2026-11-16 21:50 ` [PATCH 03/33] drm/amd/display: Power up eDP when detect link James Lin
2026-11-16 21:50 ` [PATCH 04/33] drm/amd/display: Add DPMS-v2 files James Lin
2026-11-16 21:50 ` [PATCH 05/33] drm/amd/display: Refactor DP retrain link HW sequence James Lin
2026-11-16 21:50 ` [PATCH 06/33] drm/amd/display: add extra 0.25 line reserved for TSetup/TCalc inefficiency James Lin
2026-11-16 21:50 ` [PATCH 07/33] drm/amd/display: Use panel luminance range for AUX backlight in power module James Lin
2026-11-16 21:50 ` [PATCH 08/33] drm/amd/display: Read PWM back linearly with the linear backlight curve James Lin
2026-11-16 21:50 ` [PATCH 09/33] drm/amd/display: Add API to set brightness percent James Lin
2026-11-16 21:50 ` [PATCH 10/33] drm/amd/display: Pass linear brightness percent to power module James Lin
2026-11-16 21:50 ` [PATCH 11/33] drm/amd/display: Add DPMS-v2 types James Lin
2026-11-16 21:50 ` [PATCH 12/33] drm/amd/display: Always apply 0ppm pixel clock adjustment James Lin
2026-11-16 21:50 ` [PATCH 13/33] drm/amd/display: Add otg versions of get_vblank_counter/scanoutpos James Lin
2026-11-16 21:50 ` [PATCH 14/33] drm/amd/display: Queue vblank control work to sleepable context James Lin
2026-11-16 21:50 ` James Lin [this message]
2026-11-16 21:50 ` [PATCH 16/33] drm/amd/display: Add urgent request and assertion probes James Lin
2026-11-16 21:50 ` [PATCH 17/33] drm/amd/display: Fix G7 P-state aperture addresses James Lin
2026-11-16 21:50 ` [PATCH 18/33] drm/amd/display: Set stream min/max refresh from VRR config James Lin
2026-11-16 21:50 ` [PATCH 19/33] drm/amd/display: Add DC2 wrapped initialization for DCN401 James Lin
2026-11-16 21:50 ` [PATCH 20/33] drm/amd/display: Honor the Replay stream regeneration wait event James Lin
2026-11-16 21:50 ` [PATCH 21/33] drm/amd/display: Disable Replay when link off frame count is below 2 James Lin
2026-11-16 21:50 ` [PATCH 22/33] drm/amd/display: Skip DSC padding borrow estimate for zero padding James Lin
2026-11-16 21:51 ` [PATCH 23/33] drm/amd/display: Drop unused DC interfaces James Lin
2026-11-16 21:51 ` [PATCH 24/33] drm/amd/display: Let the DC2 commit replace or keep a stream James Lin
2026-11-16 21:51 ` [PATCH 25/33] drm/amd/display: Support two streams in the dcn401 DC2 builders James Lin
2026-11-16 21:51 ` [PATCH 26/33] drm/amd/display: Add a plane beside a kept plane in DC2 update James Lin
2026-11-16 21:51 ` [PATCH 27/33] drm/amd/display: Keep an unchanged stream in the DC2 commit James Lin
2026-11-16 21:51 ` [PATCH 28/33] drm/amd/display: Change the ODM and MPC layout in DC2 update James Lin
2026-11-16 21:51 ` [PATCH 29/33] drm/amd/display: Give the DC2 builders State pipe facts James Lin
2026-11-16 21:51 ` [PATCH 30/33] drm/amd/display: Add RGBA8888 surface pixel format support James Lin
2026-11-16 21:51 ` [PATCH 31/33] drm/amd/display: Fix DCE crossbar for RGBA8888 surface format James Lin
2026-11-16 21:51 ` [PATCH 32/33] drm/amd/display: [FW Promotion] Release 0.1.85.0 James Lin
2026-11-16 21:51 ` [PATCH 33/33] drm/amd/display: Promote DC to 3.2.408 James Lin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261116215641.2800595-16-PingLei.Lin@amd.com \
--to=pinglei.lin@amd.com \
--cc=Chen-Yu.Chen@amd.com \
--cc=Ray.Wu@amd.com \
--cc=alex.hung@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=aurabindo.pillai@amd.com \
--cc=chiahsuan.chung@amd.com \
--cc=daniel.wheeler@amd.com \
--cc=george.zhang@amd.com \
--cc=harry.wentland@amd.com \
--cc=ivan.lipski@amd.com \
--cc=jerry.zuo@amd.com \
--cc=roman.li@amd.com \
--cc=sunpeng.li@amd.com \
--cc=wayne.lin@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.