Skip to contentSkip to conversation

drm/amd/display: Drop dm_pp_get_static_clocks KUnit tests

PATCH In review Alex Hung 2 participants 2 messages Jun 29

Subsystems (3)
lore
Share & tools
lore

Alex Hung

author
#0 lore raw

PATCH 1/1 drm/amd/display: Drop dm_pp_get_static_clocks KUnit tests

[WHY]
dm_pp_get_static_clocks() is removed, but the KUnit still referenced it.

[HOW]
Remove the two dm_pp_get_static_clocks test cases and their entries from the test case array so the suite builds again.

Fixes 897f2ea8a45e1 ("drm/amd/display: Add KUnit tests for amdgpu_dm_pp_smu")
Assisted-by Copilot:Claude-Opus-4.8
---
 .../amdgpu_dm/tests/amdgpu_dm_pp_smu_test.c   | 54 -------------------
 1 file changed, 54 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_pp_smu_test.c +0 -54
index e1d5088d8c0f..8d1d26bfcc16 100644
@@ -1121,57 +1121,6 @@ static void dm_test_nv_clock_id_invalid(struct kunit *test)
 
 /* ---- Tests using stub DPM layer ---- */
 
-/**
- * dm_test_get_static_clocks_success - Test successful static clock retrieval
- * @test: KUnit test context
- *
- * Verify that dm_pp_get_static_clocks returns true and correctly scales
- * the max engine and memory clocks from 10kHz to kHz units.
- */
-static void dm_test_get_static_clocks_success(struct kunit *test)
-{
-	struct amdgpu_device *adev = kunit_kzalloc(test, sizeof(*adev), GFP_KERNEL);
-	struct dc_context *ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL);
-	struct dm_pp_static_clock_info info = {};
-
-	KUNIT_ASSERT_NOT_NULL(test, adev);
-	KUNIT_ASSERT_NOT_NULL(test, ctx);
-
-	setup_stub_dpm(test, adev);
-	ctx->driver_context = adev;
-
-	stub_dpm_ctx->get_current_clocks_info.max_memory_clock = 80000;
-	stub_dpm_ctx->get_current_clocks_info.max_engine_clock = 72000;
-
-	KUNIT_EXPECT_TRUE(test, dm_pp_get_static_clocks(ctx, &info));
-	KUNIT_EXPECT_EQ(test, info.max_mclk_khz, 800000U);
-	KUNIT_EXPECT_EQ(test, info.max_sclk_khz, 720000U);
-	KUNIT_EXPECT_EQ(test, (int)info.max_clocks_state, (int)DM_PP_CLOCKS_STATE_NOMINAL);
-}
-
-/**
- * dm_test_get_static_clocks_failure - Test DPM error returns false
- * @test: KUnit test context
- *
- * Verify that dm_pp_get_static_clocks returns false when the DPM callback
- * returns an error.
- */
-static void dm_test_get_static_clocks_failure(struct kunit *test)
-{
-	struct amdgpu_device *adev = kunit_kzalloc(test, sizeof(*adev), GFP_KERNEL);
-	struct dc_context *ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL);
-	struct dm_pp_static_clock_info info = {};
-
-	KUNIT_ASSERT_NOT_NULL(test, adev);
-	KUNIT_ASSERT_NOT_NULL(test, ctx);
-
-	setup_stub_dpm(test, adev);
-	ctx->driver_context = adev;
-	stub_dpm_ctx->ret_val = -EINVAL;
-
-	KUNIT_EXPECT_FALSE(test, dm_pp_get_static_clocks(ctx, &info));
-}
-
 /**
  * dm_test_apply_display_requirements_dpm_enabled - Test DPM-enabled path
  * @test: KUnit test context
@@ -2424,9 +2373,6 @@ static struct kunit_case dm_pp_smu_test_cases[] = {
 	KUNIT_CASE(dm_test_nv_clock_id_phyclk),
 	KUNIT_CASE(dm_test_nv_clock_id_pixelclk),
 	KUNIT_CASE(dm_test_nv_clock_id_invalid),
-	/* dm_pp_get_static_clocks (with stub DPM) */
-	KUNIT_CASE(dm_test_get_static_clocks_success),
-	KUNIT_CASE(dm_test_get_static_clocks_failure),
 	/* dm_pp_apply_display_requirements (DPM enabled) */
 	KUNIT_CASE(dm_test_apply_display_requirements_dpm_enabled),
 	/* dm_pp_get_clock_levels_by_type */
Signature · 1 line
2.43.0
maintainer Acked-by on v1 1/1
#1 lore raw

Public

Quoted 17 lines

-----Original Message-----
From: Hung, Alex <[email protected]>
Sent: Monday, June 29, 2026 10:46 AM
To: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; [email protected]; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; [email protected]; [email protected]; Hung, Alex <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Zhang, George <[email protected]>; Pillai, Aurabindo <[email protected]>; Chen, Chen-Yu <[email protected]>; [email protected]; [email protected]
Subject: [PATCH] drm/amd/display: Drop dm_pp_get_static_clocks KUnit tests

[WHY]
dm_pp_get_static_clocks() is removed, but the KUnit still referenced it.

Quoted 8 lines

[HOW]
Remove the two dm_pp_get_static_clocks test cases and their entries from the test case array so the suite builds again.

Fixes 897f2ea8a45e1 ("drm/amd/display: Add KUnit tests for

amdgpu_dm_pp_smu")

Assisted-by Copilot:Claude-Opus-4.8
Quoted 91 lines
---
 .../amdgpu_dm/tests/amdgpu_dm_pp_smu_test.c   | 54 -------------------
 1 file changed, 54 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_pp_smu_t est.c b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_pp_smu_t est.c
index e1d5088d8c0f..8d1d26bfcc16 100644
---
a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_pp_smu_t est.c
+++
b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_pp_smu_t est.
+++ c

drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_pp_smu_test.c +0 -36
@@ -1121,57 +1121,6 @@ static void dm_test_nv_clock_id_invalid(struct
 kunit *test)
 
 /* ---- Tests using stub DPM layer ---- */
 
-/**
- * dm_test_get_static_clocks_success - Test successful static clock retrieval
- * @test: KUnit test context
- *
- * Verify that dm_pp_get_static_clocks returns true and correctly scales
- * the max engine and memory clocks from 10kHz to kHz units.
- */
-static void dm_test_get_static_clocks_success(struct kunit *test) -{
-     struct amdgpu_device *adev = kunit_kzalloc(test, sizeof(*adev),
 GFP_KERNEL);
-     struct dc_context *ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL);
-     struct dm_pp_static_clock_info info = {};
-
-     KUNIT_ASSERT_NOT_NULL(test, adev);
-     KUNIT_ASSERT_NOT_NULL(test, ctx);
-
-     setup_stub_dpm(test, adev);
-     ctx->driver_context = adev;
-
-     stub_dpm_ctx->get_current_clocks_info.max_memory_clock = 80000;
-     stub_dpm_ctx->get_current_clocks_info.max_engine_clock = 72000;
-
-     KUNIT_EXPECT_TRUE(test, dm_pp_get_static_clocks(ctx, &info));
-     KUNIT_EXPECT_EQ(test, info.max_mclk_khz, 800000U);
-     KUNIT_EXPECT_EQ(test, info.max_sclk_khz, 720000U);
-     KUNIT_EXPECT_EQ(test, (int)info.max_clocks_state,
 (int)DM_PP_CLOCKS_STATE_NOMINAL);
-}
-
-/**
- * dm_test_get_static_clocks_failure - Test DPM error returns false
- * @test: KUnit test context
- *
- * Verify that dm_pp_get_static_clocks returns false when the DPM callback
- * returns an error.
- */
-static void dm_test_get_static_clocks_failure(struct kunit *test) -{
-     struct amdgpu_device *adev = kunit_kzalloc(test, sizeof(*adev),

GFP_KERNEL);

drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_pp_smu_test.c +0 -13
-     struct dc_context *ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL);
-     struct dm_pp_static_clock_info info = {};
-
-     KUNIT_ASSERT_NOT_NULL(test, adev);
-     KUNIT_ASSERT_NOT_NULL(test, ctx);
-
-     setup_stub_dpm(test, adev);
-     ctx->driver_context = adev;
-     stub_dpm_ctx->ret_val = -EINVAL;
-
-     KUNIT_EXPECT_FALSE(test, dm_pp_get_static_clocks(ctx, &info));
-}
-
 /**
  * dm_test_apply_display_requirements_dpm_enabled - Test DPM-enabled

path
* @test: KUnit test context

drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_pp_smu_test.c +0 -3
@@ -2424,9 +2373,6 @@ static struct kunit_case dm_pp_smu_test_cases[] =
 {
      KUNIT_CASE(dm_test_nv_clock_id_phyclk),
      KUNIT_CASE(dm_test_nv_clock_id_pixelclk),
      KUNIT_CASE(dm_test_nv_clock_id_invalid),
-     /* dm_pp_get_static_clocks (with stub DPM) */
-     KUNIT_CASE(dm_test_get_static_clocks_success),
-     KUNIT_CASE(dm_test_get_static_clocks_failure),
      /* dm_pp_apply_display_requirements (DPM enabled) */
      KUNIT_CASE(dm_test_apply_display_requirements_dpm_enabled),
      /* dm_pp_get_clock_levels_by_type */

--
2.43.0