Skip to content

Commit 9a758d8

Browse files
author
Thomas Zimmermann
committed
drm: Move nomodeset kernel parameter to drivers/video
Move the nomodeset kernel parameter to drivers/video to make it available to non-DRM drivers. Adapt the interface, but keep the DRM interface drm_firmware_drivers_only() to avoid churn within DRM. The function should later be inlined into callers. The parameter disables any DRM graphics driver that would replace a driver for firmware-provided scanout buffers. It is an option to easily fallback to basic graphics output if the hardware's native driver is broken. Moving it to a more prominent location wil make it available to fbdev as well. v2: * clarify the meaning of the nomodeset parameter (Javier) Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 27c3e94 commit 9a758d8

File tree

9 files changed

+39
-19
lines changed

9 files changed

+39
-19
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3777,12 +3777,15 @@
37773777
shutdown the other cpus. Instead use the REBOOT_VECTOR
37783778
irq.
37793779

3780-
nomodeset Disable kernel modesetting. DRM drivers will not perform
3781-
display-mode changes or accelerated rendering. Only the
3782-
system framebuffer will be available for use if this was
3783-
set-up by the firmware or boot loader.
3784-
3785-
Useful as fallback, or for testing and debugging.
3780+
nomodeset Disable kernel modesetting. Most systems' firmware
3781+
sets up a display mode and provides framebuffer memory
3782+
for output. With nomodeset, DRM and fbdev drivers will
3783+
not load if they could possibly displace the pre-
3784+
initialized output. Only the system framebuffer will
3785+
be available for use. The respective drivers will not
3786+
perform display-mode changes or accelerated rendering.
3787+
3788+
Useful as error fallback, or for testing and debugging.
37863789

37873790
nomodule Disable module load
37883791

MAINTAINERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6701,8 +6701,10 @@ F: drivers/gpu/drm/drm_aperture.c
67016701
F: drivers/gpu/drm/tiny/ofdrm.c
67026702
F: drivers/gpu/drm/tiny/simpledrm.c
67036703
F: drivers/video/aperture.c
6704+
F: drivers/video/nomodeset.c
67046705
F: include/drm/drm_aperture.h
67056706
F: include/linux/aperture.h
6707+
F: include/video/nomodeset.h
67066708

67076709
DRM DRIVER FOR SIS VIDEO CARDS
67086710
S: Orphan / Obsolete

drivers/gpu/drm/Kconfig

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
menuconfig DRM
99
tristate "Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)"
1010
depends on (AGP || AGP=n) && !EMULATED_CMPXCHG && HAS_DMA
11-
select DRM_NOMODESET
1211
select DRM_PANEL_ORIENTATION_QUIRKS
1312
select HDMI
1413
select FB_CMDLINE
@@ -19,6 +18,7 @@ menuconfig DRM
1918
# gallium uses SYS_kcmp for os_same_file_description() to de-duplicate
2019
# device and dmabuf fd. Let's make sure that is available for our userspace.
2120
select KCMP
21+
select VIDEO_NOMODESET
2222
help
2323
Kernel-level support for the Direct Rendering Infrastructure (DRI)
2424
introduced in XFree86 4.0. If you say Y here, you need to select
@@ -514,11 +514,6 @@ config DRM_EXPORT_FOR_TESTS
514514
config DRM_PANEL_ORIENTATION_QUIRKS
515515
tristate
516516

517-
# Separate option because nomodeset parameter is global and expected built-in
518-
config DRM_NOMODESET
519-
bool
520-
default n
521-
522517
config DRM_LIB_RANDOM
523518
bool
524519
default n

drivers/gpu/drm/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ drm-$(CONFIG_DRM_PRIVACY_SCREEN) += \
7272
drm_privacy_screen_x86.o
7373
obj-$(CONFIG_DRM) += drm.o
7474

75-
obj-$(CONFIG_DRM_NOMODESET) += drm_nomodeset.o
7675
obj-$(CONFIG_DRM_PANEL_ORIENTATION_QUIRKS) += drm_panel_orientation_quirks.o
7776

7877
#

drivers/video/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ config APERTURE_HELPERS
1111
Support tracking and hand-over of aperture ownership. Required
1212
by graphics drivers for firmware-provided framebuffers.
1313

14+
config VIDEO_NOMODESET
15+
bool
16+
default n
17+
1418
if HAS_IOMEM
1519

1620
config HAVE_FB_ATMEL

drivers/video/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
obj-$(CONFIG_APERTURE_HELPERS) += aperture.o
44
obj-$(CONFIG_VGASTATE) += vgastate.o
5+
obj-$(CONFIG_VIDEO_NOMODESET) += nomodeset.o
56
obj-$(CONFIG_HDMI) += hdmi.o
67

78
obj-$(CONFIG_VT) += console/

drivers/gpu/drm/drm_nomodeset.c renamed to drivers/video/nomodeset.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@
33
#include <linux/module.h>
44
#include <linux/types.h>
55

6-
static bool drm_nomodeset;
6+
#include <video/nomodeset.h>
77

8-
bool drm_firmware_drivers_only(void)
8+
static bool video_nomodeset;
9+
10+
bool video_firmware_drivers_only(void)
911
{
10-
return drm_nomodeset;
12+
return video_nomodeset;
1113
}
12-
EXPORT_SYMBOL(drm_firmware_drivers_only);
14+
EXPORT_SYMBOL(video_firmware_drivers_only);
1315

1416
static int __init disable_modeset(char *str)
1517
{
16-
drm_nomodeset = true;
18+
video_nomodeset = true;
1719

1820
pr_warn("Booted with the nomodeset parameter. Only the system framebuffer will be available\n");
1921

include/drm/drm_drv.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
#include <linux/list.h>
3131
#include <linux/irqreturn.h>
3232

33+
#include <video/nomodeset.h>
34+
3335
#include <drm/drm_device.h>
3436

3537
struct drm_file;
@@ -602,6 +604,10 @@ static inline bool drm_drv_uses_atomic_modeset(struct drm_device *dev)
602604

603605
int drm_dev_set_unique(struct drm_device *dev, const char *name);
604606

605-
extern bool drm_firmware_drivers_only(void);
607+
/* TODO: Inline drm_firmware_drivers_only() in all its callers. */
608+
static inline bool drm_firmware_drivers_only(void)
609+
{
610+
return video_firmware_drivers_only();
611+
}
606612

607613
#endif

include/video/nomodeset.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* SPDX-License-Identifier: MIT */
2+
3+
#ifndef VIDEO_NOMODESET_H
4+
#define VIDEO_NOMODESET_H
5+
6+
bool video_firmware_drivers_only(void);
7+
8+
#endif

0 commit comments

Comments
 (0)