Skip to contentSkip to conversation

drm/amd/display: Drop KUnit tests for removed parse_hdmi_amd_vsdb()

PATCH Applied Rodrigo Vivi 5 participants 6 messages Aug 20 – Sep 8

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: Drop KUnit tests for removed parse_hdmi_amd_vsdb()

parse_hdmi_amd_vsdb() was removed when HDMI FreeSync detection moved to the common EDID parser, but its declaration and KUnit tests remained, breaking modpost:

ERROR: modpost: "parse_hdmi_amd_vsdb" [...connector_test.ko] undefined!

Remove the stale declaration and the three dead test cases.

Fixes f65198b3d073 ("drm/amd/display: Use HDMI FreeSync range from common EDID parser")
Cc Alex Huang <[email protected]>
Cc Mario Limonciello <[email protected]>
Assisted-by Copilot:Claude-Opus-5
---
 .../display/amdgpu_dm/amdgpu_dm_connector.h   |  3 -
 .../tests/amdgpu_dm_connector_test.c          | 73 -------------------
 2 files changed, 76 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.h +0 -3
index 4e9eb3ff2c90..ce900844602e 100644
@@ -153,9 +153,6 @@ void parse_edid_displayid_vrr(struct drm_connector *connector,
 			      const struct edid *edid);
 int get_amd_vsdb(struct amdgpu_dm_connector *aconnector,
 		 struct amdgpu_hdmi_vsdb_info *vsdb_info);
-int parse_hdmi_amd_vsdb(struct amdgpu_dm_connector *aconnector,
-			const struct edid *edid,
-			struct amdgpu_hdmi_vsdb_info *vsdb_info);
 void amdgpu_dm_connector_funcs_force(struct drm_connector *connector);
 enum dc_status dm_validate_stream_and_context(struct dc *dc,
 					      struct dc_stream_state *stream);
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c +0 -73

85 lines not on this page · raw message

Signature · 1 line
2.55.0
#1 lore raw
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] Erroneous deletion of active test coverage and prototype causing a compiler warning. The patch…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Erroneous deletion of active test coverage and prototype causing a compiler warning. The patch removes the KUnit tests and header declaration for parse_hdmi_amd_vsdb() based on the incorrect assumption that the function was removed by commit f65198b3d073. However, f65198b3d073 is not present in the baseline tree. As a result, parse_hdmi_amd_vsdb() remains fully implemented and actively used by amdgpu_dm_update_freesync_caps(). Applying this patch deletes valid test coverage for an active code path. Additionally, because the function uses the STATIC_IFN_KUNIT macro (making it global when KUnit is enabled), removing its prototype from the header triggers a -Wmissing-prototypes compiler warning. --

--- Patch [1]: [PATCH] drm/amd/display: Drop KUnit tests for removed parse_hdmi_amd_vsdb() --- commit 9e04fb9539ed0ab6b97c5e730b64224c40a317f4
Author: Rodrigo Vivi <[email protected]>

drm/amd/display: Drop KUnit tests for removed parse_hdmi_amd_vsdb()

This commit removes the declaration and KUnit tests for parse_hdmi_amd_vsdb(), stating that the function was previously removed.

Fixes f65198b3d073 ("drm/amd/display: Use HDMI FreeSync range from common EDID parser")
Cc Alex Huang <[email protected]>
Cc Mario Limonciello <[email protected]>
Assisted-by Copilot:Claude-Opus-5

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.h void parse_edid_displayid_vrr(struct drm_connector *connector, · line 158

Quoted 11 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.h +0 -3
index 4e9eb3ff2c904..ce900844602e5 100644
@@ -153,9 +153,6 @@ void parse_edid_displayid_vrr(struct drm_connector *connector,
 			      const struct edid *edid);
 int get_amd_vsdb(struct amdgpu_dm_connector *aconnector,
 		 struct amdgpu_hdmi_vsdb_info *vsdb_info);
-int parse_hdmi_amd_vsdb(struct amdgpu_dm_connector *aconnector,
-			const struct edid *edid,
-			struct amdgpu_hdmi_vsdb_info *vsdb_info);

[Severity: Medium]
Is this function actually removed in the current tree?

The commit message states parse_hdmi_amd_vsdb() was removed by f65198b3d073, but it appears that commit is not present in the baseline tree.

Looking at drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c, parse_hdmi_amd_vsdb() is still fully implemented and actively called by amdgpu_dm_update_freesync_caps():

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c:amdgpu_dm_update_freesync_caps() {
    ...
    i = parse_hdmi_amd_vsdb(amdgpu_dm_connector, edid, &vsdb_info);
    ...
}

Since parse_hdmi_amd_vsdb() is defined using STATIC_IFN_KUNIT (which makes it a global function when KUnit is enabled), removing its prototype here triggers a -Wmissing-prototypes compiler warning during KUnit builds.

[ ... ]

drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c static void dm_test_get_amd_vsdb_supported(struct kunit *test) · line 4881

Quoted 13 lines
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c +0 -5
index a54fd9529dc9e..83d3be5432028 100644
@@ -4874,75 +4874,6 @@ static void dm_test_get_amd_vsdb_supported(struct kunit *test)
 	KUNIT_EXPECT_TRUE(test, vsdb_info.replay_mode);
 }
 
-/**
- * dm_test_parse_hdmi_amd_vsdb_null_edid - Test NULL EDID returns -ENODEV
- * @test: The KUnit test context
- */
-static void dm_test_parse_hdmi_amd_vsdb_null_edid(struct kunit *test)

[Severity: Medium]
Because parse_hdmi_amd_vsdb() is still present and used, does removing these tests prematurely delete valid test coverage for an active code path?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Reviewed-by on v1 1/1
#2 lore raw
In reply to Rodrigo Vivi
Quoted 6 lines · Rodrigo Vivi

parse_hdmi_amd_vsdb() was removed when HDMI FreeSync detection moved to the common EDID parser, but its declaration and KUnit tests remained, breaking modpost:

ERROR: modpost: "parse_hdmi_amd_vsdb" [...connector_test.ko] undefined!

Quoted 8 lines

Remove the stale declaration and the three dead test cases.

Fixes f65198b3d073 ("drm/amd/display: Use HDMI FreeSync range from common EDID parser")
Cc Alex Huang <[email protected]>
Cc Mario Limonciello <[email protected]>
Assisted-by Copilot:Claude-Opus-5

---

Thanks this looks correct to me.

I'm not sure where we should apply it though, it's from a conflict between drm-misc-next and Alex's drm-next pull.

Quoted 109 lines
  .../display/amdgpu_dm/amdgpu_dm_connector.h   |  3 -
  .../tests/amdgpu_dm_connector_test.c          | 73 -------------------
  2 files changed, 76 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.h +0 -3
index 4e9eb3ff2c90..ce900844602e 100644
@@ -153,9 +153,6 @@ void parse_edid_displayid_vrr(struct drm_connector *connector,
  			      const struct edid *edid);
  int get_amd_vsdb(struct amdgpu_dm_connector *aconnector,
  		 struct amdgpu_hdmi_vsdb_info *vsdb_info);
-int parse_hdmi_amd_vsdb(struct amdgpu_dm_connector *aconnector,
-			const struct edid *edid,
-			struct amdgpu_hdmi_vsdb_info *vsdb_info);
  void amdgpu_dm_connector_funcs_force(struct drm_connector *connector);
  enum dc_status dm_validate_stream_and_context(struct dc *dc,
  					      struct dc_stream_state *stream);
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c +0 -73
index a54fd9529dc9..83d3be543202 100644
@@ -4874,75 +4874,6 @@ static void dm_test_get_amd_vsdb_supported(struct kunit *test)
  	KUNIT_EXPECT_TRUE(test, vsdb_info.replay_mode);
  }
 
-/**
- * dm_test_parse_hdmi_amd_vsdb_null_edid - Test NULL EDID returns -ENODEV
- * @test: The KUnit test context
- */
-static void dm_test_parse_hdmi_amd_vsdb_null_edid(struct kunit *test)
-{
-	struct amdgpu_dm_connector *aconnector;
-	struct amdgpu_hdmi_vsdb_info vsdb_info = {0};
-
-	aconnector = kunit_kzalloc(test, sizeof(*aconnector), GFP_KERNEL);
-	KUNIT_ASSERT_NOT_NULL(test, aconnector);
-
-	KUNIT_EXPECT_EQ(test,
-			parse_hdmi_amd_vsdb(aconnector, NULL, &vsdb_info),
-			-ENODEV);
-}
-
-/**
- * dm_test_parse_hdmi_amd_vsdb_no_extensions - Test EDID without extensions
- * @test: The KUnit test context
- *
- * An EDID that declares no extension blocks has no CEA block to parse.
- */
-static void dm_test_parse_hdmi_amd_vsdb_no_extensions(struct kunit *test)
-{
-	struct amdgpu_dm_connector *aconnector;
-	struct amdgpu_hdmi_vsdb_info vsdb_info = {0};
-	struct edid *edid;
-
-	aconnector = kunit_kzalloc(test, sizeof(*aconnector), GFP_KERNEL);
-	KUNIT_ASSERT_NOT_NULL(test, aconnector);
-	edid = kunit_kzalloc(test, sizeof(*edid), GFP_KERNEL);
-	KUNIT_ASSERT_NOT_NULL(test, edid);
-
-	edid->extensions = 0;
-
-	KUNIT_EXPECT_EQ(test,
-			parse_hdmi_amd_vsdb(aconnector, edid, &vsdb_info),
-			-ENODEV);
-}
-
-/**
- * dm_test_parse_hdmi_amd_vsdb_no_cea_ext - Test EDID with no CEA extension
- * @test: The KUnit test context
- *
- * An extension block that is not a CEA block leaves no VSDB to parse.
- */
-static void dm_test_parse_hdmi_amd_vsdb_no_cea_ext(struct kunit *test)
-{
-	struct amdgpu_dm_connector *aconnector;
-	struct amdgpu_hdmi_vsdb_info vsdb_info = {0};
-	struct edid *edid;
-	u8 *raw;
-
-	aconnector = kunit_kzalloc(test, sizeof(*aconnector), GFP_KERNEL);
-	KUNIT_ASSERT_NOT_NULL(test, aconnector);
-
-	/* Base block + one extension block that is NOT a CEA extension. */
-	raw = kunit_kzalloc(test, 2 * EDID_LENGTH, GFP_KERNEL);
-	KUNIT_ASSERT_NOT_NULL(test, raw);
-	edid = (struct edid *)raw;
-	edid->extensions = 1;
-	raw[EDID_LENGTH] = DM_TEST_DISPLAYID_EXT;
-
-	KUNIT_EXPECT_EQ(test,
-			parse_hdmi_amd_vsdb(aconnector, edid, &vsdb_info),
-			-ENODEV);
-}
-
  /**
   * dm_test_parse_displayid_vrr_null_edid - Test NULL EDID leaves range untouched
   * @test: The KUnit test context
@@ -5647,10 +5578,6 @@ static struct kunit_case amdgpu_dm_connector_tests[] = {
  	/* get_amd_vsdb */
  	KUNIT_CASE(dm_test_get_amd_vsdb_unsupported),
  	KUNIT_CASE(dm_test_get_amd_vsdb_supported),
-	/* parse_hdmi_amd_vsdb */
-	KUNIT_CASE(dm_test_parse_hdmi_amd_vsdb_null_edid),
-	KUNIT_CASE(dm_test_parse_hdmi_amd_vsdb_no_extensions),
-	KUNIT_CASE(dm_test_parse_hdmi_amd_vsdb_no_cea_ext),
  	/* parse_edid_displayid_vrr */
  	KUNIT_CASE(dm_test_parse_displayid_vrr_null_edid),
  	KUNIT_CASE(dm_test_parse_displayid_vrr_no_displayid),
#3 lore raw
Quoted 16 lines · Mario Limonciello
Quoted 6 lines · Rodrigo Vivi

parse_hdmi_amd_vsdb() was removed when HDMI FreeSync detection moved to the common EDID parser, but its declaration and KUnit tests remained, breaking modpost:

ERROR: modpost: "parse_hdmi_amd_vsdb" [...connector_test.ko] undefined!

Quoted 8 lines

Remove the stale declaration and the three dead test cases.

Fixes f65198b3d073 ("drm/amd/display: Use HDMI FreeSync range from common EDID parser")
Cc Alex Huang <[email protected]>
Cc Mario Limonciello <[email protected]>
Assisted-by Copilot:Claude-Opus-5

---

Quoted 6 lines

Thanks this looks correct to me.

I'm not sure where we should apply it though, it's from a conflict between drm-misc-next and Alex's drm-next pull.

I'll pull it into my next -fixes PR.

Alex

Quoted 110 lines
Quoted 109 lines
  .../display/amdgpu_dm/amdgpu_dm_connector.h   |  3 -
  .../tests/amdgpu_dm_connector_test.c          | 73 -------------------
  2 files changed, 76 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.h +0 -3
index 4e9eb3ff2c90..ce900844602e 100644
@@ -153,9 +153,6 @@ void parse_edid_displayid_vrr(struct drm_connector *connector,
                            const struct edid *edid);
  int get_amd_vsdb(struct amdgpu_dm_connector *aconnector,
               struct amdgpu_hdmi_vsdb_info *vsdb_info);
-int parse_hdmi_amd_vsdb(struct amdgpu_dm_connector *aconnector,
-                     const struct edid *edid,
-                     struct amdgpu_hdmi_vsdb_info *vsdb_info);
  void amdgpu_dm_connector_funcs_force(struct drm_connector *connector);
  enum dc_status dm_validate_stream_and_context(struct dc *dc,
                                            struct dc_stream_state *stream);
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c +0 -73
index a54fd9529dc9..83d3be543202 100644
@@ -4874,75 +4874,6 @@ static void dm_test_get_amd_vsdb_supported(struct kunit *test)
      KUNIT_EXPECT_TRUE(test, vsdb_info.replay_mode);
  }
 
-/**
- * dm_test_parse_hdmi_amd_vsdb_null_edid - Test NULL EDID returns -ENODEV
- * @test: The KUnit test context
- */
-static void dm_test_parse_hdmi_amd_vsdb_null_edid(struct kunit *test)
-{
-     struct amdgpu_dm_connector *aconnector;
-     struct amdgpu_hdmi_vsdb_info vsdb_info = {0};
-
-     aconnector = kunit_kzalloc(test, sizeof(*aconnector), GFP_KERNEL);
-     KUNIT_ASSERT_NOT_NULL(test, aconnector);
-
-     KUNIT_EXPECT_EQ(test,
-                     parse_hdmi_amd_vsdb(aconnector, NULL, &vsdb_info),
-                     -ENODEV);
-}
-
-/**
- * dm_test_parse_hdmi_amd_vsdb_no_extensions - Test EDID without extensions
- * @test: The KUnit test context
- *
- * An EDID that declares no extension blocks has no CEA block to parse.
- */
-static void dm_test_parse_hdmi_amd_vsdb_no_extensions(struct kunit *test)
-{
-     struct amdgpu_dm_connector *aconnector;
-     struct amdgpu_hdmi_vsdb_info vsdb_info = {0};
-     struct edid *edid;
-
-     aconnector = kunit_kzalloc(test, sizeof(*aconnector), GFP_KERNEL);
-     KUNIT_ASSERT_NOT_NULL(test, aconnector);
-     edid = kunit_kzalloc(test, sizeof(*edid), GFP_KERNEL);
-     KUNIT_ASSERT_NOT_NULL(test, edid);
-
-     edid->extensions = 0;
-
-     KUNIT_EXPECT_EQ(test,
-                     parse_hdmi_amd_vsdb(aconnector, edid, &vsdb_info),
-                     -ENODEV);
-}
-
-/**
- * dm_test_parse_hdmi_amd_vsdb_no_cea_ext - Test EDID with no CEA extension
- * @test: The KUnit test context
- *
- * An extension block that is not a CEA block leaves no VSDB to parse.
- */
-static void dm_test_parse_hdmi_amd_vsdb_no_cea_ext(struct kunit *test)
-{
-     struct amdgpu_dm_connector *aconnector;
-     struct amdgpu_hdmi_vsdb_info vsdb_info = {0};
-     struct edid *edid;
-     u8 *raw;
-
-     aconnector = kunit_kzalloc(test, sizeof(*aconnector), GFP_KERNEL);
-     KUNIT_ASSERT_NOT_NULL(test, aconnector);
-
-     /* Base block + one extension block that is NOT a CEA extension. */
-     raw = kunit_kzalloc(test, 2 * EDID_LENGTH, GFP_KERNEL);
-     KUNIT_ASSERT_NOT_NULL(test, raw);
-     edid = (struct edid *)raw;
-     edid->extensions = 1;
-     raw[EDID_LENGTH] = DM_TEST_DISPLAYID_EXT;
-
-     KUNIT_EXPECT_EQ(test,
-                     parse_hdmi_amd_vsdb(aconnector, edid, &vsdb_info),
-                     -ENODEV);
-}
-
  /**
   * dm_test_parse_displayid_vrr_null_edid - Test NULL EDID leaves range untouched
   * @test: The KUnit test context
@@ -5647,10 +5578,6 @@ static struct kunit_case amdgpu_dm_connector_tests[] = {
      /* get_amd_vsdb */
      KUNIT_CASE(dm_test_get_amd_vsdb_unsupported),
      KUNIT_CASE(dm_test_get_amd_vsdb_supported),
-     /* parse_hdmi_amd_vsdb */
-     KUNIT_CASE(dm_test_parse_hdmi_amd_vsdb_null_edid),
-     KUNIT_CASE(dm_test_parse_hdmi_amd_vsdb_no_extensions),
-     KUNIT_CASE(dm_test_parse_hdmi_amd_vsdb_no_cea_ext),
      /* parse_edid_displayid_vrr */
      KUNIT_CASE(dm_test_parse_displayid_vrr_null_edid),
      KUNIT_CASE(dm_test_parse_displayid_vrr_no_displayid),
maintainer
#4 lore raw
Quoted 18 lines · Alex Deucher
Quoted 16 lines · Mario Limonciello
Quoted 14 lines · Rodrigo Vivi

parse_hdmi_amd_vsdb() was removed when HDMI FreeSync detection moved to the common EDID parser, but its declaration and KUnit tests remained, breaking modpost:

ERROR: modpost: "parse_hdmi_amd_vsdb" [...connector_test.ko] undefined!

Remove the stale declaration and the three dead test cases.

Fixes f65198b3d073 ("drm/amd/display: Use HDMI FreeSync range from common EDID parser")
Cc Alex Huang <[email protected]>
Cc Mario Limonciello <[email protected]>
Assisted-by Copilot:Claude-Opus-5

---

Quoted 8 lines
Quoted 6 lines

Thanks this looks correct to me.

I'm not sure where we should apply it though, it's from a conflict between drm-misc-next and Alex's drm-next pull.

I'll pull it into my next -fixes PR.

I think this should be merged into drm-misc-next ASAP, since the merge is in there.

Dave.

Applied
#5 lore raw
Quoted 24 lines · Dave Airlie
Quoted 22 lines · Alex Deucher
Quoted 20 lines · Mario Limonciello
Quoted 6 lines · Rodrigo Vivi

parse_hdmi_amd_vsdb() was removed when HDMI FreeSync detection moved to the common EDID parser, but its declaration and KUnit tests remained, breaking modpost:

ERROR: modpost: "parse_hdmi_amd_vsdb" [...connector_test.ko] undefined!

Quoted 8 lines

Remove the stale declaration and the three dead test cases.

Fixes f65198b3d073 ("drm/amd/display: Use HDMI FreeSync range from common EDID parser")
Cc Alex Huang <[email protected]>
Cc Mario Limonciello <[email protected]>
Assisted-by Copilot:Claude-Opus-5

---

Thanks this looks correct to me.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

I'm not sure where we should apply it though, it's from a conflict between drm-misc-next and Alex's drm-next pull.

I'll pull it into my next -fixes PR.

I think this should be merged into drm-misc-next ASAP, since the merge is in there.

Applied.

Alex