Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Medium] drm/amd/display: broken KUnit test dm_test_get_plane_formats()
--

commit 7e1267e34b886f02722f18cb9144a71e1afc6858
Author: MuXian Chen <[email protected]>

drm/amd/display: drop RGBA8888 from plane format lists

This commit removes DRM_FORMAT_RGBA8888 from rgb_formats[] and
overlay_formats[] because DC has no surface pixel format for RGBA8888 and
fails atomic commits in fill_dc_plane_info_and_addr() when compositors select
it.

Link: https://gitlab.freedesktop.org/drm/amd/-/work_items/5339

> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c 
> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
> index 91398230d4083..6d5454fb5e379 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
> @@ -49,11 +49,13 @@
>   * For future use cases we should either initialize them dynamically based on
>   * plane capabilities, or initialize this array to all formats, so internal 
> drm
>   * check will succeed, and let DC implement proper check
> + *
> + * DC has no surface format for DRM_FORMAT_RGBA8888, so it must not be
> + * advertised here or in overlay_formats.
>   */
>  static const uint32_t rgb_formats[] = {
>       DRM_FORMAT_XRGB8888,
>       DRM_FORMAT_ARGB8888,
> -     DRM_FORMAT_RGBA8888,
>       DRM_FORMAT_XRGB2101010,
>       DRM_FORMAT_XBGR2101010,
>       DRM_FORMAT_ARGB2101010,
> @@ -70,7 +72,6 @@ static const uint32_t rgb_formats[] = {
>  static const uint32_t overlay_formats[] = {
>       DRM_FORMAT_XRGB8888,
>       DRM_FORMAT_ARGB8888,
> -     DRM_FORMAT_RGBA8888,

[Severity: Medium]
Does removing DRM_FORMAT_RGBA8888 from rgb_formats[] and overlay_formats[] in
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c break the KUnit test
dm_test_get_plane_formats() in
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_plane_test.c?

Because amdgpu_dm_plane_get_plane_formats() populates the format list by
iterating over ARRAY_SIZE(rgb_formats) (reduced from 14 to 13) for primary and
universal planes and ARRAY_SIZE(overlay_formats) (reduced from 9 to 8) for
overlay planes, running the amdgpu_dm_plane KUnit suite triggers failures in
dm_test_get_plane_formats():

        plane->type = DRM_PLANE_TYPE_PRIMARY;
        KUNIT_EXPECT_EQ(test, amdgpu_dm_plane_get_plane_formats(plane, NULL, 
formats, 32), 14);

        cap->pixel_format_support.nv12 = true;
        cap->pixel_format_support.p010 = true;
        cap->pixel_format_support.fp16 = true;
        KUNIT_EXPECT_EQ(test, amdgpu_dm_plane_get_plane_formats(plane, cap, 
formats, 32), 20);

        plane->type = DRM_PLANE_TYPE_OVERLAY;
        KUNIT_EXPECT_EQ(test, amdgpu_dm_plane_get_plane_formats(plane, NULL, 
formats, 32), 9);

        universal_cap->type = DC_PLANE_TYPE_DCN_UNIVERSAL;
        KUNIT_EXPECT_EQ(test,
                        amdgpu_dm_plane_get_plane_formats(plane, universal_cap, 
formats, 32),
                        14);

Should these expected counts in dm_test_get_plane_formats() be updated to 13,
19, 8, and 13 to match the new array sizes?

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=1

Reply via email to