public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Export symbols for KUnit test modules
@ 2026-06-02 16:15 Alex Hung
  2026-06-02 16:59 ` Aurabindo Pillai
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alex Hung @ 2026-06-02 16:15 UTC (permalink / raw)
  To: harry.wentland, sunpeng.li, siqueira, alexander.deucher,
	christian.koenig, airlied, simona, ray.wu, alex.hung, ivan.lipski,
	Aurabindo.Pillai, srinivasan.shanmugam, marco.crivellari,
	mario.limonciello, amd-gfx, dri-devel

Add missing EXPORT_IF_KUNIT() calls for amdgpu_dm_psr_set_event,
amdgpu_dm_ism_init, and amdgpu_dm_ism_fini so that the KUnit test
modules can resolve these symbols when built as modules, i.e.,
CONFIG_DRM_AMD_DC_KUNIT_TEST=m.

Fixes: 7c1bb28ce2f0 ("drm/amd/display: Add KUnit tests for amdgpu_dm_psr_set_event")
Fixes: 4db0dd9e5a63 ("drm/amd/display: Add more KUnit tests for amdgpu_dm_ism")
Assisted-by: Copilot:Claude-Opus-4.6
Signed-off-by: Alex Hung <alex.hung@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_ism.c | 2 ++
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_ism.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_ism.c
index 5c0841728671..32391b56097e 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_ism.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_ism.c
@@ -640,6 +640,7 @@ void amdgpu_dm_ism_init(struct amdgpu_dm_ism *ism,
 	INIT_DELAYED_WORK(&ism->delayed_work, dm_ism_delayed_work_func);
 	INIT_DELAYED_WORK(&ism->sso_delayed_work, dm_ism_sso_delayed_work_func);
 }
+EXPORT_IF_KUNIT(amdgpu_dm_ism_init);
 
 
 void amdgpu_dm_ism_fini(struct amdgpu_dm_ism *ism)
@@ -647,3 +648,4 @@ void amdgpu_dm_ism_fini(struct amdgpu_dm_ism *ism)
 	cancel_delayed_work_sync(&ism->sso_delayed_work);
 	cancel_delayed_work_sync(&ism->delayed_work);
 }
+EXPORT_IF_KUNIT(amdgpu_dm_ism_fini);
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c
index 85caa8534184..0dadc0bb214f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c
@@ -189,3 +189,4 @@ bool amdgpu_dm_psr_set_event(struct amdgpu_display_manager *dm, struct dc_stream
 	return mod_power_set_psr_event(dm->power_module, stream,
 				       set_event, event, wait_for_disable);
 }
+EXPORT_IF_KUNIT(amdgpu_dm_psr_set_event);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amd/display: Export symbols for KUnit test modules
  2026-06-02 16:15 [PATCH] drm/amd/display: Export symbols for KUnit test modules Alex Hung
@ 2026-06-02 16:59 ` Aurabindo Pillai
  2026-06-04  2:38 ` Claude review: " Claude Code Review Bot
  2026-06-04  2:38 ` Claude Code Review Bot
  2 siblings, 0 replies; 4+ messages in thread
From: Aurabindo Pillai @ 2026-06-02 16:59 UTC (permalink / raw)
  To: Alex Hung, harry.wentland, sunpeng.li, siqueira,
	alexander.deucher, christian.koenig, airlied, simona, ray.wu,
	ivan.lipski, srinivasan.shanmugam, marco.crivellari,
	mario.limonciello, amd-gfx, dri-devel



On 6/2/26 12:15 PM, Alex Hung wrote:
> Add missing EXPORT_IF_KUNIT() calls for amdgpu_dm_psr_set_event,
> amdgpu_dm_ism_init, and amdgpu_dm_ism_fini so that the KUnit test
> modules can resolve these symbols when built as modules, i.e.,
> CONFIG_DRM_AMD_DC_KUNIT_TEST=m.
> 
> Fixes: 7c1bb28ce2f0 ("drm/amd/display: Add KUnit tests for amdgpu_dm_psr_set_event")
> Fixes: 4db0dd9e5a63 ("drm/amd/display: Add more KUnit tests for amdgpu_dm_ism")
> Assisted-by: Copilot:Claude-Opus-4.6
> Signed-off-by: Alex Hung <alex.hung@amd.com>
> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_ism.c | 2 ++
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 1 +
>   2 files changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_ism.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_ism.c
> index 5c0841728671..32391b56097e 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_ism.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_ism.c
> @@ -640,6 +640,7 @@ void amdgpu_dm_ism_init(struct amdgpu_dm_ism *ism,
>   	INIT_DELAYED_WORK(&ism->delayed_work, dm_ism_delayed_work_func);
>   	INIT_DELAYED_WORK(&ism->sso_delayed_work, dm_ism_sso_delayed_work_func);
>   }
> +EXPORT_IF_KUNIT(amdgpu_dm_ism_init);
>   
>   
>   void amdgpu_dm_ism_fini(struct amdgpu_dm_ism *ism)
> @@ -647,3 +648,4 @@ void amdgpu_dm_ism_fini(struct amdgpu_dm_ism *ism)
>   	cancel_delayed_work_sync(&ism->sso_delayed_work);
>   	cancel_delayed_work_sync(&ism->delayed_work);
>   }
> +EXPORT_IF_KUNIT(amdgpu_dm_ism_fini);
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c
> index 85caa8534184..0dadc0bb214f 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c
> @@ -189,3 +189,4 @@ bool amdgpu_dm_psr_set_event(struct amdgpu_display_manager *dm, struct dc_stream
>   	return mod_power_set_psr_event(dm->power_module, stream,
>   				       set_event, event, wait_for_disable);
>   }
> +EXPORT_IF_KUNIT(amdgpu_dm_psr_set_event);

Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Claude review: drm/amd/display: Export symbols for KUnit test modules
  2026-06-02 16:15 [PATCH] drm/amd/display: Export symbols for KUnit test modules Alex Hung
  2026-06-02 16:59 ` Aurabindo Pillai
@ 2026-06-04  2:38 ` Claude Code Review Bot
  2026-06-04  2:38 ` Claude Code Review Bot
  2 siblings, 0 replies; 4+ messages in thread
From: Claude Code Review Bot @ 2026-06-04  2:38 UTC (permalink / raw)
  To: dri-devel-reviews

Overall Series Review

Subject: drm/amd/display: Export symbols for KUnit test modules
Author: Alex Hung <alex.hung@amd.com>
Patches: 2
Reviewed: 2026-06-04T12:38:58.621766

---

This is a single straightforward fix patch that adds missing `EXPORT_IF_KUNIT()` calls for three functions: `amdgpu_dm_psr_set_event`, `amdgpu_dm_ism_init`, and `amdgpu_dm_ism_fini`. These exports are needed so that KUnit test modules can resolve the symbols when `CONFIG_DRM_AMD_DC_KUNIT_TEST=m`.

The patch follows the established pattern exactly — every other exported-for-KUnit function in this directory uses the same `EXPORT_IF_KUNIT()` macro from `amdgpu_dm_kunit_helpers.h`, placed immediately after the function's closing brace. Both modified files already include that header. The macro correctly expands to `EXPORT_SYMBOL()` when `CONFIG_DRM_AMD_DC_KUNIT_TEST` is enabled and to nothing otherwise, so there is no impact on non-KUnit builds.

**One observation:** The Fixes tags reference commits `7c1bb28ce2f0` ("Add KUnit tests for amdgpu_dm_psr_set_event") and `4db0dd9e5a63` ("Add more KUnit tests for amdgpu_dm_ism") which are not present in the current drm-next tree. The existing test files (`amdgpu_dm_psr_test.c` and `amdgpu_dm_ism_test.c`) on drm-next don't call any of these three functions — they test `amdgpu_dm_psr_fill_caps`, `dm_ism_next_state`, `dm_ism_get_sso_delay`, and `dm_ism_get_idle_allow_delay` instead. This patch presumably fixes those commits in a topic branch where the new tests were already added. The maintainer should confirm proper ordering so this patch lands alongside or after the commits it fixes.

**Verdict: Patch looks correct.** No functional concerns.

---

---
Generated by Claude Code Patch Reviewer

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Claude review: drm/amd/display: Export symbols for KUnit test modules
  2026-06-02 16:15 [PATCH] drm/amd/display: Export symbols for KUnit test modules Alex Hung
  2026-06-02 16:59 ` Aurabindo Pillai
  2026-06-04  2:38 ` Claude review: " Claude Code Review Bot
@ 2026-06-04  2:38 ` Claude Code Review Bot
  2 siblings, 0 replies; 4+ messages in thread
From: Claude Code Review Bot @ 2026-06-04  2:38 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

**Correctness: Good.** The three `EXPORT_IF_KUNIT()` additions are placed correctly — immediately after the closing brace of each function definition, consistent with all existing uses in the codebase (e.g., `amdgpu_dm_psr_fill_caps` at `amdgpu_dm_psr.c:92`, `dm_ism_next_state` at `amdgpu_dm_ism.c:131`, etc.).

**Pattern consistency:**
```c
+EXPORT_IF_KUNIT(amdgpu_dm_ism_init);
...
+EXPORT_IF_KUNIT(amdgpu_dm_ism_fini);
...
+EXPORT_IF_KUNIT(amdgpu_dm_psr_set_event);
```
All three follow the same one-liner format used throughout the directory. Both source files already have `#include "amdgpu_dm_kunit_helpers.h"`, so the macro is defined.

**Commit message:** Clear and accurate. The Fixes tags correctly identify the commits that introduced the tests needing these symbols. The `Assisted-by: Copilot:Claude-Opus-4.6` tag is noted.

**Minor nit (non-blocking):** The diff context shows a blank line between `amdgpu_dm_ism_init()` and `amdgpu_dm_ism_fini()` at the export location (lines 142-143 in the diff show two blank lines). The `EXPORT_IF_KUNIT(amdgpu_dm_ism_init)` is placed before those blank lines, while most other uses in the file place the macro right after the closing `}` with one blank line separation before the next function. This is fine — the existing code already had a double blank line there, and the macro placement is correct.

**No issues found.** The patch is minimal, correct, and follows established conventions.

---
Generated by Claude Code Patch Reviewer

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-06-04  2:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-02 16:15 [PATCH] drm/amd/display: Export symbols for KUnit test modules Alex Hung
2026-06-02 16:59 ` Aurabindo Pillai
2026-06-04  2:38 ` Claude review: " Claude Code Review Bot
2026-06-04  2:38 ` Claude Code Review Bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox