Re: [PATCH 0/3] drm/amd/display: use kunit/visibility.h for test helpers

From: Alex Deucher

Date: Fri Oct 02 2026 - 09:49:18 EST


On Fri, Oct 2, 2026 at 9:46 AM Albert Esteve <aesteve@xxxxxxxxxx> wrote:
>
> On Fri, Oct 2, 2026 at 3:34 PM Alex Deucher <alexdeucher@xxxxxxxxx> wrote:
> >
> > On Mon, Sep 7, 2026 at 9:45 AM Albert Esteve <aesteve@xxxxxxxxxx> wrote:
> > >
> > > amdgpu_dm grew its own STATIC_IFN_KUNIT / EXPORT_IF_KUNIT /
> > > INLINE_IFN_KUNIT macros instead of using kunit/visibility.h. This
> > > series switches the KUnit helpers over to the common API.
> > >
> > > VISIBLE_IF_KUNIT is gated on CONFIG_KUNIT rather than
> > > CONFIG_DRM_AMD_DC_KUNIT_TEST, so the helpers are non-static whenever
> > > KUnit is enabled. EXPORT_SYMBOL_IF_KUNIT places the symbols in the
> > > EXPORTED_FOR_KUNIT_TESTING namespace; the AMD DC test files import
> > > that namespace with MODULE_IMPORT_NS().
> > >
> > > INLINE_IFN_KUNIT is dropped rather than generalized. It was only used
> > > on amdgpu_dm_fixpt_from_s3132(), inverted the original static inline,
> > > and is unnecessary for tests in another translation unit.
> > >
> > > Tested with:
> > > ./tools/testing/kunit/kunit.py run --arch=x86_64 \
> > > --kunitconfig=drivers/gpu/drm/amd/display/amdgpu_dm/tests
> > >
> > > (CONFIG_GCOV omitted; it is not available on x86_64.)
> > >
> > > Suggested-by: Maxime Ripard <mripard@xxxxxxxxxx>
> > >
> > > Signed-off-by: Albert Esteve <aesteve@xxxxxxxxxx>
> >
> > I've reverted this series. It breaks the build when CONFIG_KUNIT=y and
> > CONFIG_DRM_AMD_DC_KUNIT_TEST=n. When CONFIG_KUNIT=y,
> > the functions are not static, but when CONFIG_DRM_AMD_DC_KUNIT_TEST=n,
> > they should be, resulting in build errors.
>
> Oops! I'm very sorry. What's the procedure now? I see you posted a
> series containing the revert. Can I send another version of this
> series after that lands to fix it?

Yes, that would be fine.

Alex

>
> BR,
> Albert.
>
> >
> > Alex
> >
> > > ---
> > > Albert Esteve (3):
> > > drm/amd/display: replace STATIC_IFN_KUNIT with VISIBLE_IF_KUNIT
> > > drm/amd/display: replace EXPORT_IF_KUNIT with EXPORT_SYMBOL_IF_KUNIT
> > > drm/amd/display: drop INLINE_IFN_KUNIT
> > >
> > > drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 79 ++++-----
> > > .../drm/amd/display/amdgpu_dm/amdgpu_dm_audio.c | 26 +--
> > > .../amd/display/amdgpu_dm/amdgpu_dm_backlight.c | 74 ++++----
> > > .../drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 133 +++++++--------
> > > .../drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c | 12 +-
> > > .../amd/display/amdgpu_dm/amdgpu_dm_connector.c | 190 ++++++++++-----------
> > > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 38 ++---
> > > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 52 +++---
> > > .../drm/amd/display/amdgpu_dm/amdgpu_dm_cursor.c | 10 +-
> > > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_dmub.c | 30 ++--
> > > .../drm/amd/display/amdgpu_dm/amdgpu_dm_freesync.c | 10 +-
> > > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 105 ++++++------
> > > .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 140 +++++++--------
> > > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 146 ++++++++--------
> > > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_ism.c | 40 ++---
> > > .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 60 +++----
> > > .../drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 104 +++++------
> > > .../drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c | 116 ++++++-------
> > > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 22 +--
> > > .../drm/amd/display/amdgpu_dm/amdgpu_dm_quirks.c | 4 +-
> > > .../drm/amd/display/amdgpu_dm/amdgpu_dm_replay.c | 9 +-
> > > .../drm/amd/display/amdgpu_dm/amdgpu_dm_services.c | 10 +-
> > > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_wb.c | 18 +-
> > > .../display/amdgpu_dm/tests/amdgpu_dm_audio_test.c | 1 +
> > > .../amdgpu_dm/tests/amdgpu_dm_backlight_test.c | 1 +
> > > .../display/amdgpu_dm/tests/amdgpu_dm_color_test.c | 1 +
> > > .../amdgpu_dm/tests/amdgpu_dm_colorop_test.c | 1 +
> > > .../amdgpu_dm/tests/amdgpu_dm_connector_test.c | 1 +
> > > .../display/amdgpu_dm/tests/amdgpu_dm_crc_test.c | 1 +
> > > .../display/amdgpu_dm/tests/amdgpu_dm_crtc_test.c | 1 +
> > > .../amdgpu_dm/tests/amdgpu_dm_cursor_test.c | 1 +
> > > .../display/amdgpu_dm/tests/amdgpu_dm_dmub_test.c | 1 +
> > > .../amdgpu_dm/tests/amdgpu_dm_freesync_test.c | 1 +
> > > .../display/amdgpu_dm/tests/amdgpu_dm_hdcp_test.c | 1 +
> > > .../amdgpu_dm/tests/amdgpu_dm_helpers_test.c | 1 +
> > > .../display/amdgpu_dm/tests/amdgpu_dm_irq_test.c | 1 +
> > > .../display/amdgpu_dm/tests/amdgpu_dm_ism_test.c | 1 +
> > > .../amdgpu_dm/tests/amdgpu_dm_kunit_helpers.c | 1 +
> > > .../amdgpu_dm/tests/amdgpu_dm_mst_types_test.c | 1 +
> > > .../display/amdgpu_dm/tests/amdgpu_dm_plane_test.c | 1 +
> > > .../amdgpu_dm/tests/amdgpu_dm_pp_smu_test.c | 1 +
> > > .../display/amdgpu_dm/tests/amdgpu_dm_psr_test.c | 1 +
> > > .../amdgpu_dm/tests/amdgpu_dm_quirks_test.c | 1 +
> > > .../amdgpu_dm/tests/amdgpu_dm_replay_test.c | 1 +
> > > .../amdgpu_dm/tests/amdgpu_dm_services_test.c | 1 +
> > > .../amd/display/amdgpu_dm/tests/amdgpu_dm_test.c | 1 +
> > > .../display/amdgpu_dm/tests/amdgpu_dm_wb_test.c | 1 +
> > > drivers/gpu/drm/amd/display/dc/core/dc_sink.c | 6 +-
> > > drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 2 +-
> > > drivers/gpu/drm/amd/display/dc/dm_helpers.h | 13 +-
> > > tools/lib/python/kdoc/xforms_lists.py | 3 +-
> > > 51 files changed, 748 insertions(+), 728 deletions(-)
> > > ---
> > > base-commit: bc35965f6940a9bf834d54187b6088b8eb09206d
> > > change-id: 20260907-visibility-unification-fd358c580447
> > >
> > > Best regards,
> > > --
> > > Albert Esteve <aesteve@xxxxxxxxxx>
> > >
> >
>