summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorAlex Hung <alex.hung@amd.com>2026-09-10 10:28:11 -0600
committerAlex Deucher <alexander.deucher@amd.com>2026-09-23 13:46:12 -0400
commit47a84adcade0000dbc05dbc90229f7adcea17618 (patch)
treeda43769ebd3801b13f0f160a2e844370cb5e5332 /drivers/gpu
parent2e6d5212d4795ac818317b91823fe3c281135a60 (diff)
downloadlinux-next-47a84adcade0000dbc05dbc90229f7adcea17618.tar.gz
linux-next-47a84adcade0000dbc05dbc90229f7adcea17618.zip
drm/amd/display: Fix KUnit writeback warnings
[WHY] Writeback mode tests call drm_mode_probed_add without holding mode_config.mutex, producing a warning for every generated mode. [HOW] Hold the mutex around writeback mode enumeration and release it before checking the returned count or inspecting the generated modes. Assisted-by: Copilot:GPT-6-Astra Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_wb_test.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_wb_test.c b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_wb_test.c
index 03036f906385..4bc033fdfa97 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_wb_test.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_wb_test.c
@@ -418,7 +418,9 @@ static void dm_test_wb_get_modes_returns_modes(struct kunit *test)
drmm_connector_init(drm, connector, &dm_wb_test_connector_funcs,
DRM_MODE_CONNECTOR_VIRTUAL, NULL);
+ mutex_lock(&drm->mode_config.mutex);
count = amdgpu_dm_wb_connector_get_modes(connector);
+ mutex_unlock(&drm->mode_config.mutex);
/* drm_add_modes_noedid should return at least one mode */
KUNIT_EXPECT_GT(test, count, 0);
@@ -453,7 +455,9 @@ static void dm_test_wb_get_modes_bounded_by_max(struct kunit *test)
drmm_connector_init(drm, connector, &dm_wb_test_connector_funcs,
DRM_MODE_CONNECTOR_VIRTUAL, NULL);
+ mutex_lock(&drm->mode_config.mutex);
amdgpu_dm_wb_connector_get_modes(connector);
+ mutex_unlock(&drm->mode_config.mutex);
/* All modes must fit within 3840x2160 */
list_for_each_entry(mode, &connector->probed_modes, head) {