Thank you for your contribution! Sashiko AI review found 2 potential issue(s) 
to consider:
- [Low] drm: undefined drm_format_conv_state_*() references in drm_kms_helper
- [Low] drm/sitronix: missing DRM_PIXEL_HELPER select in config DRM_ST7920
--

commit 5297070737eb21b200d62be5b5e13861b6e29b57
Author: Thomas Zimmermann <[email protected]>

drm/pixel: Link format helpers into drm_pixel_helper.ko

This commit moves drm_format_helper.o from drm_kms_helper.ko into
drm_pixel_helper.ko and updates drivers using format helpers to select
DRM_PIXEL_HELPER and include <drm/drm_format_helper.h>.

> diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
> index 5f555a2c1a4c8..fbc643747110f 100644
> --- a/drivers/gpu/drm/Makefile
> +++ b/drivers/gpu/drm/Makefile
> @@ -100,6 +100,7 @@ obj-$(CONFIG_DRM_PANEL_ORIENTATION_QUIRKS) += 
> drm_panel_orientation_quirks.o
>  obj-$(CONFIG_DRM_PANEL_BACKLIGHT_QUIRKS) += drm_panel_backlight_quirks.o
>  
>  drm_pixel_helper-y := \
> +     drm_format_helper.o \
>       drm_pixel_helper_common.o
>  obj-$(CONFIG_DRM_PIXEL_HELPER) += drm_pixel_helper.o
>  
> @@ -150,7 +151,6 @@ drm_kms_helper-y := \
>       drm_crtc_helper.o \
>       drm_damage_helper.o \
>       drm_flip_work.o \
> -     drm_format_helper.o \
>       drm_gem_atomic_helper.o \
>       drm_gem_framebuffer_helper.o \
>       drm_kms_helper_common.o \

[Severity: Low]
Will moving drm_format_helper.o to drm_pixel_helper-y while leaving
drm_gem_atomic_helper.o in drm_kms_helper-y cause undefined symbol references
when CONFIG_DRM_KMS_HELPER is enabled without CONFIG_DRM_PIXEL_HELPER (or when
CONFIG_DRM_KMS_HELPER=y and CONFIG_DRM_PIXEL_HELPER=m)?

In drivers/gpu/drm/drm_gem_atomic_helper.c, the shadow plane helpers call
functions defined in drivers/gpu/drm/drm_format_helper.c:

drivers/gpu/drm/drm_gem_atomic_helper.c:
__drm_gem_shadow_plane_state_init()
        __drm_atomic_helper_plane_state_init(&shadow_plane_state->base, plane);
        drm_format_conv_state_init(&shadow_plane_state->fmtcnv_state);

__drm_gem_duplicate_shadow_plane_state()
        drm_format_conv_state_copy(&new_shadow_plane_state->fmtcnv_state,
                                   &shadow_plane_state->fmtcnv_state);

__drm_gem_destroy_shadow_plane_state()
        drm_format_conv_state_release(&shadow_plane_state->fmtcnv_state);
        __drm_atomic_helper_plane_destroy_state(&shadow_plane_state->base);

Because config DRM_KMS_HELPER in drivers/gpu/drm/Kconfig does not select
DRM_PIXEL_HELPER, linking drm_kms_helper fails with undefined references to
drm_format_conv_state_init(), drm_format_conv_state_copy(), and
drm_format_conv_state_release().

[ ... ]

> diff --git a/drivers/gpu/drm/sitronix/Kconfig 
> b/drivers/gpu/drm/sitronix/Kconfig
> index 41a428ef8295e..c4b54f4f4f69a 100644
> --- a/drivers/gpu/drm/sitronix/Kconfig
> +++ b/drivers/gpu/drm/sitronix/Kconfig
> @@ -4,6 +4,7 @@ config DRM_ST7571
>       select DRM_CLIENT_SELECTION
>       select DRM_GEM_SHMEM_HELPER
>       select DRM_KMS_HELPER
> +     select DRM_PIXEL_HELPER
>       select VIDEOMODE_HELPERS
>       help
>         Sitronix ST7571 is a driver and controller for 4-level gray
> @@ -46,6 +47,7 @@ config DRM_ST7586
>       select DRM_KMS_HELPER
>       select DRM_GEM_DMA_HELPER
>       select DRM_MIPI_DBI
> +     select DRM_PIXEL_HELPER
>       help
>         DRM driver for the following Sitronix ST7586 panels:
>         * LEGO MINDSTORMS EV3

[Severity: Low]
Should config DRM_ST7920 in drivers/gpu/drm/sitronix/Kconfig also select
DRM_PIXEL_HELPER (and include <drm/drm_format_helper.h> in
drivers/gpu/drm/sitronix/st7920.c)?

In drivers/gpu/drm/sitronix/st7920.c, the driver calls format helpers
directly:

st7920_fb_blit_rect()
        iosys_map_set_vaddr(&dst, buf);
        drm_fb_xrgb8888_to_mono(&dst, &dst_pitch, vmap, fb, rect, fmtcnv_state);

st7920_primary_plane_atomic_check()
        /* format conversion necessary; reserve buffer */
        buf = drm_format_conv_state_reserve(&shadow_plane_state->fmtcnv_state,
                                            pitch, GFP_KERNEL);

Without selecting DRM_PIXEL_HELPER in DRM_ST7920, building st7920 when
CONFIG_DRM_PIXEL_HELPER is disabled (or when CONFIG_DRM_ST7920=y and
CONFIG_DRM_PIXEL_HELPER=m) fails with undefined references to
drm_fb_xrgb8888_to_mono() and drm_format_conv_state_reserve().

[ ... ]

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

Reply via email to