* [PATCH 1/4] drm: Add helper module for working with pixel data
2026-10-19 15:32 [PATCH 0/4] drm: Move drawing to pixel-helper module Thomas Zimmermann
@ 2026-10-19 15:32 ` Thomas Zimmermann
2026-10-19 15:32 ` [PATCH 2/4] drm/pixel: Link format helpers into drm_pixel_helper.ko Thomas Zimmermann
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Thomas Zimmermann @ 2026-10-19 15:32 UTC (permalink / raw)
To: jfalempe, maarten.lankhorst, mripard, airlied, simona
Cc: dri-devel, amd-gfx, linux-hyperv, intel-gfx, imx,
linux-arm-kernel, nouveau, linux-renesas-soc, virtualization,
sashiko-reviews, Thomas Zimmermann
Add drm_pixel_helper.ko. This module will contain helpers that copy
and process pixel data, such as framebuffers. Drivers that want to
use the helpers should select DRM_PIXEL_HELPER.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
drivers/gpu/drm/Kconfig | 6 ++++++
drivers/gpu/drm/Makefile | 4 ++++
drivers/gpu/drm/drm_pixel_helper_common.c | 6 ++++++
3 files changed, 16 insertions(+)
create mode 100644 drivers/gpu/drm/drm_pixel_helper_common.c
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 61111d50b1c6..dce5e25671ee 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -49,6 +49,12 @@ config DRM_KMS_HELPER
help
CRTC helpers for KMS drivers.
+config DRM_PIXEL_HELPER
+ tristate
+ depends on DRM
+ help
+ Helpers for working with pixel data in DRM.
+
config DRM_DRAW
bool
depends on DRM
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 2c6bc093a923..5f555a2c1a4c 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -99,6 +99,10 @@ obj-$(CONFIG_DRM_PANEL) += drm_panel.o
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_pixel_helper_common.o
+obj-$(CONFIG_DRM_PIXEL_HELPER) += drm_pixel_helper.o
+
#
# Memory-management helpers
#
diff --git a/drivers/gpu/drm/drm_pixel_helper_common.c b/drivers/gpu/drm/drm_pixel_helper_common.c
new file mode 100644
index 000000000000..743846e1e003
--- /dev/null
+++ b/drivers/gpu/drm/drm_pixel_helper_common.c
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0 or MIT
+
+#include <linux/module.h>
+
+MODULE_DESCRIPTION("DRM pixel-data helpers");
+MODULE_LICENSE("GPL and additional rights");
--
2.56.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 2/4] drm/pixel: Link format helpers into drm_pixel_helper.ko
2026-10-19 15:32 [PATCH 0/4] drm: Move drawing to pixel-helper module Thomas Zimmermann
2026-10-19 15:32 ` [PATCH 1/4] drm: Add helper module for working with pixel data Thomas Zimmermann
@ 2026-10-19 15:32 ` Thomas Zimmermann
2026-10-19 15:32 ` [PATCH 3/4] drm/pixel: Link panic " Thomas Zimmermann
2026-10-19 15:32 ` [PATCH 4/4] drm/pixel: Link draw " Thomas Zimmermann
3 siblings, 0 replies; 5+ messages in thread
From: Thomas Zimmermann @ 2026-10-19 15:32 UTC (permalink / raw)
To: jfalempe, maarten.lankhorst, mripard, airlied, simona
Cc: dri-devel, amd-gfx, linux-hyperv, intel-gfx, imx,
linux-arm-kernel, nouveau, linux-renesas-soc, virtualization,
sashiko-reviews, Thomas Zimmermann
Move drm_format_helper.o from drm_kms_helper.ko to drm_pixel_helper.ko.
Select DRM_PIXEL_HELPER from the drivers that use the format helpers.
While at it, include <drm/drm_format_helper.h> in a few places where it
is missing.
Format helpers copy pixel data from a DRM framebuffer to a hardware
scanout buffer or some other destination. They can transform the color
format as part of the copying operation. A number of drivers require
this functionality as part of their display update.
The format helpers are currently part of drm_kms_helper.ko, which is
for mode-setting helpers (i.e, helpers that modify the display pipeline).
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
drivers/gpu/drm/Kconfig | 1 +
drivers/gpu/drm/Kconfig.debug | 1 +
drivers/gpu/drm/Makefile | 2 +-
drivers/gpu/drm/ast/Kconfig | 1 +
drivers/gpu/drm/gud/Kconfig | 1 +
drivers/gpu/drm/hisilicon/hibmc/Kconfig | 1 +
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 1 +
drivers/gpu/drm/hyperv/Kconfig | 1 +
drivers/gpu/drm/mgag200/Kconfig | 1 +
drivers/gpu/drm/sitronix/Kconfig | 2 ++
drivers/gpu/drm/solomon/Kconfig | 1 +
drivers/gpu/drm/sysfb/Kconfig | 1 +
drivers/gpu/drm/sysfb/drm_sysfb_modeset.c | 1 +
drivers/gpu/drm/tiny/Kconfig | 6 ++++++
drivers/gpu/drm/tiny/bochs.c | 1 +
15 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index dce5e25671ee..8e4a588e9111 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -37,6 +37,7 @@ config DRM_MIPI_DBI
tristate
depends on DRM
select DRM_KMS_HELPER
+ select DRM_PIXEL_HELPER
config DRM_MIPI_DSI
bool
diff --git a/drivers/gpu/drm/Kconfig.debug b/drivers/gpu/drm/Kconfig.debug
index b909cd0a619f..1afb9cad850f 100644
--- a/drivers/gpu/drm/Kconfig.debug
+++ b/drivers/gpu/drm/Kconfig.debug
@@ -70,6 +70,7 @@ config DRM_KUNIT_TEST
select DRM_GEM_SHMEM_HELPER
select DRM_KUNIT_TEST_HELPERS
select DRM_PANIC_HELPER
+ select DRM_PIXEL_HELPER
select DRM_SYSFB_HELPER
select PRIME_NUMBERS
default KUNIT_ALL_TESTS
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 5f555a2c1a4c..fbc643747110 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 \
diff --git a/drivers/gpu/drm/ast/Kconfig b/drivers/gpu/drm/ast/Kconfig
index 242fbccdf844..1758debb8317 100644
--- a/drivers/gpu/drm/ast/Kconfig
+++ b/drivers/gpu/drm/ast/Kconfig
@@ -5,6 +5,7 @@ config DRM_AST
select DRM_CLIENT_SELECTION
select DRM_GEM_SHMEM_HELPER
select DRM_KMS_HELPER
+ select DRM_PIXEL_HELPER
select I2C
select I2C_ALGOBIT
help
diff --git a/drivers/gpu/drm/gud/Kconfig b/drivers/gpu/drm/gud/Kconfig
index b4d2136942f0..385702103633 100644
--- a/drivers/gpu/drm/gud/Kconfig
+++ b/drivers/gpu/drm/gud/Kconfig
@@ -7,6 +7,7 @@ config DRM_GUD
select DRM_CLIENT_SELECTION
select DRM_KMS_HELPER
select DRM_GEM_SHMEM_HELPER
+ select DRM_PIXEL_HELPER
select BACKLIGHT_CLASS_DEVICE
help
This is a DRM display driver for GUD USB Displays or display
diff --git a/drivers/gpu/drm/hisilicon/hibmc/Kconfig b/drivers/gpu/drm/hisilicon/hibmc/Kconfig
index adf4516bf8f6..f896f8cb8689 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/Kconfig
+++ b/drivers/gpu/drm/hisilicon/hibmc/Kconfig
@@ -7,6 +7,7 @@ config DRM_HISI_HIBMC
select DRM_DISPLAY_DP_HELPER
select DRM_GEM_SHMEM_HELPER
select DRM_KMS_HELPER
+ select DRM_PIXEL_HELPER
select I2C
select I2C_ALGOBIT
help
diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
index 7849abd0488e..aaef70153f7e 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
@@ -17,6 +17,7 @@
#include <drm/drm_atomic_helper.h>
#include <drm/drm_damage_helper.h>
#include <drm/drm_fourcc.h>
+#include <drm/drm_format_helper.h>
#include <drm/drm_gem_atomic_helper.h>
#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/drm_vblank.h>
diff --git a/drivers/gpu/drm/hyperv/Kconfig b/drivers/gpu/drm/hyperv/Kconfig
index 86234f6a73f2..21146ed294e3 100644
--- a/drivers/gpu/drm/hyperv/Kconfig
+++ b/drivers/gpu/drm/hyperv/Kconfig
@@ -5,6 +5,7 @@ config DRM_HYPERV
select DRM_CLIENT_SELECTION
select DRM_KMS_HELPER
select DRM_GEM_SHMEM_HELPER
+ select DRM_PIXEL_HELPER
help
This is a KMS driver for Hyper-V synthetic video device. Choose this
option if you would like to enable drm driver for Hyper-V virtual
diff --git a/drivers/gpu/drm/mgag200/Kconfig b/drivers/gpu/drm/mgag200/Kconfig
index a962ae564a75..06bb23a888f9 100644
--- a/drivers/gpu/drm/mgag200/Kconfig
+++ b/drivers/gpu/drm/mgag200/Kconfig
@@ -5,6 +5,7 @@ config DRM_MGAG200
select DRM_CLIENT_SELECTION
select DRM_GEM_SHMEM_HELPER
select DRM_KMS_HELPER
+ select DRM_PIXEL_HELPER
select I2C
select I2C_ALGOBIT
help
diff --git a/drivers/gpu/drm/sitronix/Kconfig b/drivers/gpu/drm/sitronix/Kconfig
index 41a428ef8295..c4b54f4f4f69 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
diff --git a/drivers/gpu/drm/solomon/Kconfig b/drivers/gpu/drm/solomon/Kconfig
index 400a6cab3a67..b65daabb2e96 100644
--- a/drivers/gpu/drm/solomon/Kconfig
+++ b/drivers/gpu/drm/solomon/Kconfig
@@ -5,6 +5,7 @@ config DRM_SSD130X
select DRM_CLIENT_SELECTION
select DRM_GEM_SHMEM_HELPER
select DRM_KMS_HELPER
+ select DRM_PIXEL_HELPER
help
DRM driver for the SSD13xx Solomon and SINO WEALTH SH110x OLED
controllers. This is only for the core driver, a driver for the
diff --git a/drivers/gpu/drm/sysfb/Kconfig b/drivers/gpu/drm/sysfb/Kconfig
index f7e48178885e..eaf6b8d1cd51 100644
--- a/drivers/gpu/drm/sysfb/Kconfig
+++ b/drivers/gpu/drm/sysfb/Kconfig
@@ -5,6 +5,7 @@ menu "Drivers for system framebuffers"
config DRM_SYSFB_HELPER
tristate
+ select DRM_PIXEL_HELPER
depends on DRM
config DRM_COREBOOTDRM
diff --git a/drivers/gpu/drm/sysfb/drm_sysfb_modeset.c b/drivers/gpu/drm/sysfb/drm_sysfb_modeset.c
index 13df0925163a..c403c168c4c3 100644
--- a/drivers/gpu/drm/sysfb/drm_sysfb_modeset.c
+++ b/drivers/gpu/drm/sysfb/drm_sysfb_modeset.c
@@ -10,6 +10,7 @@
#include <drm/drm_drv.h>
#include <drm/drm_edid.h>
#include <drm/drm_fourcc.h>
+#include <drm/drm_format_helper.h>
#include <drm/drm_framebuffer.h>
#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/drm_panic.h>
diff --git a/drivers/gpu/drm/tiny/Kconfig b/drivers/gpu/drm/tiny/Kconfig
index f0e72d4b6a47..176d75ce17ea 100644
--- a/drivers/gpu/drm/tiny/Kconfig
+++ b/drivers/gpu/drm/tiny/Kconfig
@@ -6,6 +6,7 @@ config DRM_APPLETBDRM
depends on X86 || COMPILE_TEST
select DRM_GEM_SHMEM_HELPER
select DRM_KMS_HELPER
+ select DRM_PIXEL_HELPER
help
Say Y here if you want support for the display of Touch Bars on x86
MacBook Pros.
@@ -30,6 +31,7 @@ config DRM_BOCHS
select DRM_CLIENT_SELECTION
select DRM_GEM_SHMEM_HELPER
select DRM_KMS_HELPER
+ select DRM_PIXEL_HELPER
help
This is a KMS driver for qemu's stdvga output. Choose this option
for qemu.
@@ -42,6 +44,7 @@ config DRM_CIRRUS_QEMU
select DRM_CLIENT_SELECTION
select DRM_KMS_HELPER
select DRM_GEM_SHMEM_HELPER
+ select DRM_PIXEL_HELPER
help
This is a KMS driver for emulated cirrus device in qemu.
It is *NOT* intended for real cirrus devices. This requires
@@ -62,6 +65,7 @@ config DRM_GM12U320
select DRM_CLIENT_SELECTION
select DRM_KMS_HELPER
select DRM_GEM_SHMEM_HELPER
+ select DRM_PIXEL_HELPER
help
This is a KMS driver for projectors which use the GM12U320 chipset
for video transfer over USB2/3, such as the Acer C120 mini projector.
@@ -186,6 +190,7 @@ config TINYDRM_REPAPER
select DRM_CLIENT_SELECTION
select DRM_KMS_HELPER
select DRM_GEM_DMA_HELPER
+ select DRM_PIXEL_HELPER
help
DRM driver for the following Pervasive Displays panels:
1.44" TFT EPD Panel (E1144CS021)
@@ -201,6 +206,7 @@ config TINYDRM_SHARP_MEMORY
select DRM_CLIENT_SELECTION
select DRM_GEM_DMA_HELPER
select DRM_KMS_HELPER
+ select DRM_PIXEL_HELPER
help
DRM Driver for the following Sharp Memory Panels:
* 1.00" Sharp Memory LCD (LS010B7DH04)
diff --git a/drivers/gpu/drm/tiny/bochs.c b/drivers/gpu/drm/tiny/bochs.c
index 8192decddbc1..2744fe26dbeb 100644
--- a/drivers/gpu/drm/tiny/bochs.c
+++ b/drivers/gpu/drm/tiny/bochs.c
@@ -13,6 +13,7 @@
#include <drm/drm_edid.h>
#include <drm/drm_fbdev_shmem.h>
#include <drm/drm_fourcc.h>
+#include <drm/drm_format_helper.h>
#include <drm/drm_framebuffer.h>
#include <drm/drm_gem_atomic_helper.h>
#include <drm/drm_gem_framebuffer_helper.h>
--
2.56.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/4] drm/pixel: Link panic helpers into drm_pixel_helper.ko
2026-10-19 15:32 [PATCH 0/4] drm: Move drawing to pixel-helper module Thomas Zimmermann
2026-10-19 15:32 ` [PATCH 1/4] drm: Add helper module for working with pixel data Thomas Zimmermann
2026-10-19 15:32 ` [PATCH 2/4] drm/pixel: Link format helpers into drm_pixel_helper.ko Thomas Zimmermann
@ 2026-10-19 15:32 ` Thomas Zimmermann
2026-10-19 15:32 ` [PATCH 4/4] drm/pixel: Link draw " Thomas Zimmermann
3 siblings, 0 replies; 5+ messages in thread
From: Thomas Zimmermann @ 2026-10-19 15:32 UTC (permalink / raw)
To: jfalempe, maarten.lankhorst, mripard, airlied, simona
Cc: dri-devel, amd-gfx, linux-hyperv, intel-gfx, imx,
linux-arm-kernel, nouveau, linux-renesas-soc, virtualization,
sashiko-reviews, Thomas Zimmermann
Move panic helpers from drm_kms_helper to drm_pixel_helper.ko. Select
DRM_PIXEL_HELPER in the drivers that use the panic helpers.
Drop the Kconfig option DRM_PANIC_HELPER. With the user selecting
panic support via DRM_PANIC, panic helpers will become available to
drivers.
Related module init and exit functions are now declared in the new
header file drm_pixel_helper_internal.h. Other internal functions for
pixel helpers can later go there as well.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
drivers/gpu/drm/Kconfig | 9 ++-------
drivers/gpu/drm/Kconfig.debug | 1 -
drivers/gpu/drm/Makefile | 4 ++--
drivers/gpu/drm/amd/amdgpu/Kconfig | 1 +
drivers/gpu/drm/drm_kms_helper_common.c | 13 -------------
drivers/gpu/drm/drm_panic_helper.c | 1 +
drivers/gpu/drm/drm_panic_internal.h | 14 --------------
drivers/gpu/drm/drm_pixel_helper_common.c | 14 ++++++++++++++
drivers/gpu/drm/drm_pixel_helper_internal.h | 20 ++++++++++++++++++++
drivers/gpu/drm/i915/Kconfig | 1 +
drivers/gpu/drm/imx/ipuv3/Kconfig | 1 +
drivers/gpu/drm/nouveau/Kconfig | 1 +
drivers/gpu/drm/renesas/rcar-du/Kconfig | 1 +
drivers/gpu/drm/renesas/shmobile/Kconfig | 1 +
drivers/gpu/drm/tidss/Kconfig | 1 +
drivers/gpu/drm/virtio/Kconfig | 1 +
16 files changed, 47 insertions(+), 37 deletions(-)
create mode 100644 drivers/gpu/drm/drm_pixel_helper_internal.h
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 8e4a588e9111..bf7c59944340 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -46,13 +46,14 @@ config DRM_MIPI_DSI
config DRM_KMS_HELPER
tristate
depends on DRM
- select DRM_PANIC_HELPER if DRM_PANIC
help
CRTC helpers for KMS drivers.
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.
@@ -135,12 +136,6 @@ config DRM_PANIC_SCREEN_QR_VERSION
Smaller QR code are easier to read, but will contain less debugging
data. Default is 40.
-config DRM_PANIC_HELPER
- bool
- depends on DRM
- select DRM_DRAW
- select FONT_SUPPORT
-
config DRM_RAS
bool "DRM RAS support"
depends on DRM
diff --git a/drivers/gpu/drm/Kconfig.debug b/drivers/gpu/drm/Kconfig.debug
index 1afb9cad850f..4573cad368a2 100644
--- a/drivers/gpu/drm/Kconfig.debug
+++ b/drivers/gpu/drm/Kconfig.debug
@@ -69,7 +69,6 @@ config DRM_KUNIT_TEST
select DRM_EXPORT_FOR_TESTS if m
select DRM_GEM_SHMEM_HELPER
select DRM_KUNIT_TEST_HELPERS
- select DRM_PANIC_HELPER
select DRM_PIXEL_HELPER
select DRM_SYSFB_HELPER
select PRIME_NUMBERS
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index fbc643747110..18a5a5baf029 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -102,6 +102,8 @@ obj-$(CONFIG_DRM_PANEL_BACKLIGHT_QUIRKS) += drm_panel_backlight_quirks.o
drm_pixel_helper-y := \
drm_format_helper.o \
drm_pixel_helper_common.o
+drm_pixel_helper-$(CONFIG_DRM_PANIC) += drm_panic_helper.o
+drm_pixel_helper-$(CONFIG_DRM_PANIC_SCREEN_QR_CODE) += drm_panic_helper_qr.o
obj-$(CONFIG_DRM_PIXEL_HELPER) += drm_pixel_helper.o
#
@@ -160,8 +162,6 @@ drm_kms_helper-y := \
drm_self_refresh_helper.o \
drm_simple_kms_helper.o \
drm_vblank_helper.o
-drm_kms_helper-$(CONFIG_DRM_PANIC_HELPER) += drm_panic_helper.o
-drm_kms_helper-$(CONFIG_DRM_PANIC_SCREEN_QR_CODE) += drm_panic_helper_qr.o
obj-$(CONFIG_DRM_KMS_HELPER) += drm_kms_helper.o
#
diff --git a/drivers/gpu/drm/amd/amdgpu/Kconfig b/drivers/gpu/drm/amd/amdgpu/Kconfig
index 12e4a41bf1f0..78584d8aeb52 100644
--- a/drivers/gpu/drm/amd/amdgpu/Kconfig
+++ b/drivers/gpu/drm/amd/amdgpu/Kconfig
@@ -12,6 +12,7 @@ config DRM_AMDGPU
select DRM_DISPLAY_HDCP_HELPER
select DRM_DISPLAY_HELPER
select DRM_KMS_HELPER
+ select DRM_PIXEL_HELPER if DRM_PANIC
select DRM_SCHED
select DRM_TTM
select DRM_TTM_HELPER
diff --git a/drivers/gpu/drm/drm_kms_helper_common.c b/drivers/gpu/drm/drm_kms_helper_common.c
index 1e55ecac4698..76c7297b24e9 100644
--- a/drivers/gpu/drm/drm_kms_helper_common.c
+++ b/drivers/gpu/drm/drm_kms_helper_common.c
@@ -30,7 +30,6 @@
#include <linux/moduleparam.h>
#include "drm_crtc_helper_internal.h"
-#include "drm_panic_internal.h"
#if IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION)
bool drm_fbdev_emulation = true;
@@ -68,18 +67,6 @@ MODULE_PARM_DESC(drm_leak_fbdev_smem,
#endif
-static int __init drm_kms_helper_init(void)
-{
- return drm_panic_helper_init();
-}
-module_init(drm_kms_helper_init);
-
-static void __exit drm_kms_helper_exit(void)
-{
- drm_panic_helper_exit();
-}
-module_exit(drm_kms_helper_exit);
-
MODULE_AUTHOR("David Airlie, Jesse Barnes");
MODULE_DESCRIPTION("DRM KMS helper");
MODULE_LICENSE("GPL and additional rights");
diff --git a/drivers/gpu/drm/drm_panic_helper.c b/drivers/gpu/drm/drm_panic_helper.c
index 8913c3d22e8d..6f0d3a2df6b3 100644
--- a/drivers/gpu/drm/drm_panic_helper.c
+++ b/drivers/gpu/drm/drm_panic_helper.c
@@ -20,6 +20,7 @@
#include "drm_draw_internal.h"
#include "drm_panic_internal.h"
+#include "drm_pixel_helper_internal.h"
struct drm_panic_line {
u32 len;
diff --git a/drivers/gpu/drm/drm_panic_internal.h b/drivers/gpu/drm/drm_panic_internal.h
index fe6d514a0833..c68d64c56e15 100644
--- a/drivers/gpu/drm/drm_panic_internal.h
+++ b/drivers/gpu/drm/drm_panic_internal.h
@@ -52,18 +52,4 @@ static inline void drm_panic_lock(struct drm_device *dev, unsigned long flags) {
static inline void drm_panic_unlock(struct drm_device *dev, unsigned long flags) {}
#endif
-#if IS_ENABLED(CONFIG_DRM_PANIC_HELPER)
-/* drm_panic_helper.c */
-int __init drm_panic_helper_init(void);
-void __exit drm_panic_helper_exit(void);
-#else
-static inline int __init drm_panic_helper_init(void)
-{
- return 0;
-}
-
-static inline void __exit drm_panic_helper_exit(void)
-{ }
-#endif
-
#endif /* __DRM_PANIC_INTERNAL_H__ */
diff --git a/drivers/gpu/drm/drm_pixel_helper_common.c b/drivers/gpu/drm/drm_pixel_helper_common.c
index 743846e1e003..0213c59b82f0 100644
--- a/drivers/gpu/drm/drm_pixel_helper_common.c
+++ b/drivers/gpu/drm/drm_pixel_helper_common.c
@@ -2,5 +2,19 @@
#include <linux/module.h>
+#include "drm_pixel_helper_internal.h"
+
+static int __init drm_pixel_helper_init(void)
+{
+ return drm_panic_helper_init();
+}
+module_init(drm_pixel_helper_init);
+
+static void __exit drm_pixel_helper_exit(void)
+{
+ drm_panic_helper_exit();
+}
+module_exit(drm_pixel_helper_exit);
+
MODULE_DESCRIPTION("DRM pixel-data helpers");
MODULE_LICENSE("GPL and additional rights");
diff --git a/drivers/gpu/drm/drm_pixel_helper_internal.h b/drivers/gpu/drm/drm_pixel_helper_internal.h
new file mode 100644
index 000000000000..1606cbb0a460
--- /dev/null
+++ b/drivers/gpu/drm/drm_pixel_helper_internal.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0 or MIT */
+
+#ifndef DRM_PIXEL_HELPER_INTERNAL_H
+#define DRM_PIXEL_HELPER_INTERNAL_H
+
+#if IS_ENABLED(CONFIG_DRM_PANIC)
+/* drm_panic_helper.c */
+int __init drm_panic_helper_init(void);
+void __exit drm_panic_helper_exit(void);
+#else
+static inline int __init drm_panic_helper_init(void)
+{
+ return 0;
+}
+
+static inline void __exit drm_panic_helper_exit(void)
+{ }
+#endif
+
+#endif
diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
index 5e939004b646..1c65b14bf0f4 100644
--- a/drivers/gpu/drm/i915/Kconfig
+++ b/drivers/gpu/drm/i915/Kconfig
@@ -19,6 +19,7 @@ config DRM_I915
select DRM_KMS_HELPER
select DRM_PANEL
select DRM_MIPI_DSI
+ select DRM_PIXEL_HELPER if DRM_PANIC
select FB_IOMEM_HELPERS if DRM_FBDEV_EMULATION
select RELAY
select I2C
diff --git a/drivers/gpu/drm/imx/ipuv3/Kconfig b/drivers/gpu/drm/imx/ipuv3/Kconfig
index 3ca237515e46..19b51835cdd3 100644
--- a/drivers/gpu/drm/imx/ipuv3/Kconfig
+++ b/drivers/gpu/drm/imx/ipuv3/Kconfig
@@ -3,6 +3,7 @@ config DRM_IMX
tristate "DRM Support for Freescale i.MX"
select DRM_CLIENT_SELECTION
select DRM_KMS_HELPER
+ select DRM_PIXEL_HELPER if DRM_PANIC
select VIDEOMODE_HELPERS
select DRM_GEM_DMA_HELPER
depends on DRM && (ARCH_MXC || COMPILE_TEST)
diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig
index 3b5757aed9c8..3850b27861fa 100644
--- a/drivers/gpu/drm/nouveau/Kconfig
+++ b/drivers/gpu/drm/nouveau/Kconfig
@@ -10,6 +10,7 @@ config DRM_NOUVEAU
select DRM_DISPLAY_HDMI_HELPER
select DRM_DISPLAY_HELPER
select DRM_KMS_HELPER
+ select DRM_PIXEL_HELPER if DRM_PANIC
select DRM_TTM
select DRM_TTM_HELPER
select DRM_EXEC
diff --git a/drivers/gpu/drm/renesas/rcar-du/Kconfig b/drivers/gpu/drm/renesas/rcar-du/Kconfig
index 80bd770ae0f6..33337ff84c2e 100644
--- a/drivers/gpu/drm/renesas/rcar-du/Kconfig
+++ b/drivers/gpu/drm/renesas/rcar-du/Kconfig
@@ -9,6 +9,7 @@ config DRM_RCAR_DU
select DRM_DISPLAY_HELPER
select DRM_BRIDGE_CONNECTOR
select DRM_GEM_DMA_HELPER
+ select DRM_PIXEL_HELPER if DRM_PANIC
select VIDEOMODE_HELPERS
help
Choose this option if you have an R-Car chipset.
diff --git a/drivers/gpu/drm/renesas/shmobile/Kconfig b/drivers/gpu/drm/renesas/shmobile/Kconfig
index 52e160464001..dbb86f068499 100644
--- a/drivers/gpu/drm/renesas/shmobile/Kconfig
+++ b/drivers/gpu/drm/renesas/shmobile/Kconfig
@@ -9,6 +9,7 @@ config DRM_SHMOBILE
select DRM_DISPLAY_HELPER
select DRM_BRIDGE_CONNECTOR
select DRM_GEM_DMA_HELPER
+ select DRM_PIXEL_HELPER if DRM_PANIC
select VIDEOMODE_HELPERS
help
Choose this option if you have an SH Mobile chipset.
diff --git a/drivers/gpu/drm/tidss/Kconfig b/drivers/gpu/drm/tidss/Kconfig
index 52a64fa1ad5d..be60ec720544 100644
--- a/drivers/gpu/drm/tidss/Kconfig
+++ b/drivers/gpu/drm/tidss/Kconfig
@@ -8,6 +8,7 @@ config DRM_TIDSS
select DRM_BRIDGE_CONNECTOR
select DRM_GEM_DMA_HELPER
select DRM_PANEL
+ select DRM_PIXEL_HELPER if DRM_PANIC
help
The TI Keystone family SoCs introduced a new generation of
Display SubSystem. There is currently three Keystone family
diff --git a/drivers/gpu/drm/virtio/Kconfig b/drivers/gpu/drm/virtio/Kconfig
index fc884fb57b7e..6440a8f39e04 100644
--- a/drivers/gpu/drm/virtio/Kconfig
+++ b/drivers/gpu/drm/virtio/Kconfig
@@ -6,6 +6,7 @@ config DRM_VIRTIO_GPU
select DRM_CLIENT_SELECTION
select DRM_KMS_HELPER
select DRM_GEM_SHMEM_HELPER
+ select DRM_PIXEL_HELPER if DRM_PANIC
select VIRTIO_DMA_SHARED_BUFFER
help
This is the virtual GPU driver for virtio. It can be used with
--
2.56.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 4/4] drm/pixel: Link draw helpers into drm_pixel_helper.ko
2026-10-19 15:32 [PATCH 0/4] drm: Move drawing to pixel-helper module Thomas Zimmermann
` (2 preceding siblings ...)
2026-10-19 15:32 ` [PATCH 3/4] drm/pixel: Link panic " Thomas Zimmermann
@ 2026-10-19 15:32 ` Thomas Zimmermann
3 siblings, 0 replies; 5+ messages in thread
From: Thomas Zimmermann @ 2026-10-19 15:32 UTC (permalink / raw)
To: jfalempe, maarten.lankhorst, mripard, airlied, simona
Cc: dri-devel, amd-gfx, linux-hyperv, intel-gfx, imx,
linux-arm-kernel, nouveau, linux-renesas-soc, virtualization,
sashiko-reviews, Thomas Zimmermann
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 <tzimmermann@suse.de>
---
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
^ permalink raw reply related [flat|nested] 5+ messages in thread