Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe: Support 'nomodeset' kernel command-line option
@ 2024-08-21 13:56 Thomas Zimmermann
  2024-08-21 14:03 ` ✓ CI.Patch_applied: success for " Patchwork
                   ` (9 more replies)
  0 siblings, 10 replies; 17+ messages in thread
From: Thomas Zimmermann @ 2024-08-21 13:56 UTC (permalink / raw)
  To: lucas.demarchi, thomas.hellstrom, rodrigo.vivi, maarten.lankhorst,
	mripard, airlied, daniel
  Cc: intel-xe, dri-devel, Thomas Zimmermann

Setting 'nomodeset' on the kernel command line disables all graphics
drivers with modesetting capabilities; leaving only firmware drivers,
such as simpledrm or efifb.

Most DRM drivers automatically support 'nomodeset' via DRM's module
helper macros. In xe, which uses regular module_init(), manually call
drm_firmware_drivers_only() to test for 'nomodeset'. Do not register
the driver if set.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/xe/xe_module.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_module.c b/drivers/gpu/drm/xe/xe_module.c
index 923460119cec..60fb7dd26903 100644
--- a/drivers/gpu/drm/xe/xe_module.c
+++ b/drivers/gpu/drm/xe/xe_module.c
@@ -8,6 +8,8 @@
 #include <linux/init.h>
 #include <linux/module.h>
 
+#include <drm/drm_module.h>
+
 #include "xe_drv.h"
 #include "xe_hw_fence.h"
 #include "xe_pci.h"
@@ -92,6 +94,9 @@ static int __init xe_init(void)
 {
 	int err, i;
 
+	if (drm_firmware_drivers_only())
+		return -ENODEV;
+
 	for (i = 0; i < ARRAY_SIZE(init_funcs); i++) {
 		err = init_funcs[i].init();
 		if (err) {
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-08-27  6:54 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-21 13:56 [PATCH] drm/xe: Support 'nomodeset' kernel command-line option Thomas Zimmermann
2024-08-21 14:03 ` ✓ CI.Patch_applied: success for " Patchwork
2024-08-21 14:03 ` ✓ CI.checkpatch: " Patchwork
2024-08-21 14:04 ` ✓ CI.KUnit: " Patchwork
2024-08-21 14:16 ` [PATCH] " Gustavo Sousa
2024-08-21 14:29   ` Jani Nikula
2024-08-21 14:48     ` Thomas Zimmermann
2024-08-27  3:59       ` Lucas De Marchi
2024-08-27  6:54         ` Thomas Zimmermann
2024-08-21 14:31   ` Thomas Zimmermann
2024-08-21 14:16 ` ✓ CI.Build: success for " Patchwork
2024-08-21 14:18 ` ✓ CI.Hooks: " Patchwork
2024-08-21 14:19 ` ✓ CI.checksparse: " Patchwork
2024-08-21 14:24 ` [PATCH] " Lucas De Marchi
2024-08-21 14:34   ` Thomas Zimmermann
2024-08-21 14:39 ` ✓ CI.BAT: success for " Patchwork
2024-08-21 15:47 ` ✗ CI.FULL: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox