From: Thomas Zimmermann <tzimmermann@suse.de>
To: jfalempe@redhat.com, maarten.lankhorst@linux.intel.com,
mripard@kernel.org, airlied@gmail.com, simona@ffwll.ch
Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
linux-hyperv@vger.kernel.org, intel-gfx@lists.freedesktop.org,
imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
nouveau@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org,
virtualization@lists.linux.dev, sashiko-reviews@lists.linux.dev,
Thomas Zimmermann <tzimmermann@suse.de>
Subject: [PATCH 3/4] drm/pixel: Link panic helpers into drm_pixel_helper.ko
Date: Mon, 19 Oct 2026 17:32:44 +0200 [thread overview]
Message-ID: <20261019154612.777074-4-tzimmermann@suse.de> (raw)
In-Reply-To: <20261019154612.777074-1-tzimmermann@suse.de>
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
next prev parent reply other threads:[~2026-10-19 15:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
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 16:11 ` sashiko-bot
2026-10-19 15:32 ` Thomas Zimmermann [this message]
2026-10-19 16:19 ` [PATCH 3/4] drm/pixel: Link panic " sashiko-bot
2026-10-19 16:32 ` Thomas Zimmermann
2026-10-19 15:32 ` [PATCH 4/4] drm/pixel: Link draw " Thomas Zimmermann
2026-10-19 16:32 ` sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261019154612.777074-4-tzimmermann@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@gmail.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=imx@lists.linux.dev \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jfalempe@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=simona@ffwll.ch \
--cc=virtualization@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox