Move drm_draw.o from the DRM core to drm_pixel_helper.ko. Remove the
Kconfig option DRM_DRAW and provide the draw helpers unconditionally.

Having draw code in the DRM core is a left-over fro when panic handling
was entirely located in the DRM core as well. With all the panic drawing
in drm_pixel_helper.ko, the drawing helpers can go there as well. DRM's
log clients also uses the drawing helpers for output. Update the Kconfig
rules to select DRM_PIXEL_HELPER instead of DRM_DRAW for this client.

The format and the draw helpers share the per-pixel color-format code
from drm_format_internal. Putting it all into one place will hopefully
help with sharing more code in the future.

Signed-off-by: Thomas Zimmermann <[email protected]>
---
 drivers/gpu/drm/Kconfig                           | 5 -----
 drivers/gpu/drm/Makefile                          | 2 +-
 drivers/gpu/drm/clients/Kconfig                   | 2 +-
 drivers/gpu/drm/{drm_draw.c => drm_draw_helper.c} | 0
 4 files changed, 2 insertions(+), 7 deletions(-)
 rename drivers/gpu/drm/{drm_draw.c => drm_draw_helper.c} (100%)

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index bf7c59944340..1b16e6101a53 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -52,15 +52,10 @@ config DRM_KMS_HELPER
 config DRM_PIXEL_HELPER
        tristate
        depends on DRM
-       select DRM_DRAW if DRM_PANIC
        select FONT_SUPPORT if DRM_PANIC
        help
          Helpers for working with pixel data in DRM.
 
-config DRM_DRAW
-       bool
-       depends on DRM
-
 config DRM_PANIC
        bool "Display a user-friendly message when a kernel panic occurs"
        depends on DRM && PRINTK
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 18a5a5baf029..ab9eb4c21264 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -91,7 +91,6 @@ drm-$(CONFIG_DRM_PRIVACY_SCREEN) += \
        drm_privacy_screen_x86.o
 drm-$(CONFIG_DRM_ACCEL) += ../../accel/drm_accel.o
 drm-$(CONFIG_DRM_PANIC) += drm_panic.o
-drm-$(CONFIG_DRM_DRAW) += drm_draw.o
 drm-$(CONFIG_DRM_RAS) += drm_ras.o drm_ras_nl.o drm_ras_genl_family.o
 obj-$(CONFIG_DRM)      += drm.o
 
@@ -100,6 +99,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_draw_helper.o \
        drm_format_helper.o \
        drm_pixel_helper_common.o
 drm_pixel_helper-$(CONFIG_DRM_PANIC) += drm_panic_helper.o
diff --git a/drivers/gpu/drm/clients/Kconfig b/drivers/gpu/drm/clients/Kconfig
index 6096c623d9d5..8d21edc4cc5b 100644
--- a/drivers/gpu/drm/clients/Kconfig
+++ b/drivers/gpu/drm/clients/Kconfig
@@ -3,6 +3,7 @@
 config DRM_CLIENT_LIB
        tristate
        depends on DRM
+       select DRM_PIXEL_HELPER if DRM_CLIENT_LOG
        select DRM_KMS_HELPER if DRM_FBDEV_EMULATION
        select FB_CORE if DRM_FBDEV_EMULATION
        help
@@ -76,7 +77,6 @@ config DRM_CLIENT_LOG
        depends on DRM_CLIENT_SELECTION
        select DRM_CLIENT
        select DRM_CLIENT_SETUP
-       select DRM_DRAW
        select FONT_SUPPORT
        help
          This enable a drm logger, that will print the kernel messages to the
diff --git a/drivers/gpu/drm/drm_draw.c b/drivers/gpu/drm/drm_draw_helper.c
similarity index 100%
rename from drivers/gpu/drm/drm_draw.c
rename to drivers/gpu/drm/drm_draw_helper.c
-- 
2.56.0


Reply via email to