Skip to contentSkip to conversation

video/fbdev: Support 'nomodeset' in PCI drivers

PATCH Superseded Thomas Zimmermann 3 participants 15 messages Nov 7, 2022 – Nov 11, 2022

Subsystems (19)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Thomas Zimmermann

author maintainer
#0 lore raw

cover video/fbdev: Support 'nomodeset' in PCI drivers

Add support for the kernel's 'nomodeset' parameter to PCI-based fbdev drivers. The option prevents DRM drivers from loading if they could possibly displace a hardware-agnostic driver that runs on the firmware framebuffer. It is a fallback for systems on which the hardware's native driver does not work correctly.

After the work on the aperture helpers and their integration with fbdev, it can happen that an fbdev driver replaces a hardware- agnostic DRM driver. Supporting the nomodeset parameter unifies the behavior among the graphics drivers and subsystems. An fbdev driver will not replace any hardware-agnostic driver with nomodeset given.

Thomas Zimmermann (2):
drm: Move nomodeset kernel parameter to drivers/video
fbdev: Add support for the nomodeset kernel parameter

 .../admin-guide/kernel-parameters.txt         |  2 +-
 MAINTAINERS                                   |  2 +
 drivers/gpu/drm/Kconfig                       |  7 +---
 drivers/gpu/drm/Makefile                      |  1 -
 drivers/staging/sm750fb/Kconfig               |  1 +
 drivers/staging/sm750fb/sm750.c               |  4 ++
 drivers/video/Kconfig                         |  4 ++
 drivers/video/Makefile                        |  1 +
 drivers/video/fbdev/Kconfig                   | 37 +++++++++++++++++++
 drivers/video/fbdev/arkfb.c                   |  6 +++
 drivers/video/fbdev/asiliantfb.c              |  5 +++
 drivers/video/fbdev/aty/aty128fb.c            |  6 +++
 drivers/video/fbdev/aty/atyfb_base.c          |  6 +++
 drivers/video/fbdev/aty/radeon_base.c         |  6 +++
 drivers/video/fbdev/carminefb.c               |  5 +++
 drivers/video/fbdev/chipsfb.c                 |  5 +++
 drivers/video/fbdev/cirrusfb.c                |  6 +++
 drivers/video/fbdev/cyber2000fb.c             |  6 +++
 drivers/video/fbdev/geode/Kconfig             |  3 ++
 drivers/video/fbdev/geode/gx1fb_core.c        |  7 ++++
 drivers/video/fbdev/geode/gxfb_core.c         |  7 ++++
 drivers/video/fbdev/geode/lxfb_core.c         |  7 ++++
 drivers/video/fbdev/gxt4500.c                 |  5 +++
 drivers/video/fbdev/hyperv_fb.c               |  5 +++
 drivers/video/fbdev/i740fb.c                  |  6 +++
 drivers/video/fbdev/i810/i810_main.c          |  8 ++++
 drivers/video/fbdev/imsttfb.c                 |  7 ++++
 drivers/video/fbdev/intelfb/intelfbdrv.c      |  5 +++
 drivers/video/fbdev/kyro/fbdev.c              |  6 +++
 drivers/video/fbdev/matrox/matroxfb_base.c    |  5 +++
 drivers/video/fbdev/mb862xx/mb862xxfbdrv.c    |  5 +++
 drivers/video/fbdev/neofb.c                   |  6 +++
 drivers/video/fbdev/nvidia/nvidia.c           |  7 ++++
 drivers/video/fbdev/pm2fb.c                   |  6 +++
 drivers/video/fbdev/pm3fb.c                   |  6 +++
 drivers/video/fbdev/pvr2fb.c                  |  7 ++++
 drivers/video/fbdev/riva/fbdev.c              |  7 ++++
 drivers/video/fbdev/s3fb.c                    |  6 +++
 drivers/video/fbdev/savage/savagefb_driver.c  |  5 +++
 drivers/video/fbdev/sis/sis_main.c            |  7 ++++
 drivers/video/fbdev/skeletonfb.c              |  7 ++++
 drivers/video/fbdev/sm712fb.c                 |  5 +++
 drivers/video/fbdev/sstfb.c                   |  4 ++
 drivers/video/fbdev/sunxvr2500.c              |  5 +++
 drivers/video/fbdev/sunxvr500.c               |  5 +++
 drivers/video/fbdev/tdfxfb.c                  |  6 +++
 drivers/video/fbdev/tgafb.c                   |  6 +++
 drivers/video/fbdev/tridentfb.c               |  6 +++
 drivers/video/fbdev/vermilion/vermilion.c     |  7 ++++
 drivers/video/fbdev/via/via-core.c            |  5 +++
 drivers/video/fbdev/vt8623fb.c                |  6 +++
 .../drm/drm_nomodeset.c => video/nomodeset.c} | 12 +++---
 include/drm/drm_drv.h                         |  8 +++-
 include/video/nomodeset.h                     |  8 ++++
 54 files changed, 319 insertions(+), 14 deletions(-)
 rename drivers/{gpu/drm/drm_nomodeset.c => video/nomodeset.c} (63%)
 create mode 100644 include/video/nomodeset.h

base-commit: 3aa97a74d622aa26fe79cf4bd819b6a4fd176e90

Signature · 1 line
2.38.0
author maintainer
#1 lore raw

PATCH 1/2 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.

---
 Documentation/admin-guide/kernel-parameters.txt      |  2 +-
 MAINTAINERS                                          |  2 ++
 drivers/gpu/drm/Kconfig                              |  7 +------
 drivers/gpu/drm/Makefile                             |  1 -
 drivers/video/Kconfig                                |  4 ++++
 drivers/video/Makefile                               |  1 +
 .../{gpu/drm/drm_nomodeset.c => video/nomodeset.c}   | 12 +++++++-----
 include/drm/drm_drv.h                                |  8 +++++++-
 include/video/nomodeset.h                            |  8 ++++++++
 9 files changed, 31 insertions(+), 14 deletions(-)
 rename drivers/{gpu/drm/drm_nomodeset.c => video/nomodeset.c} (63%)
 create mode 100644 include/video/nomodeset.h
Documentation/admin-guide/kernel-parameters.txt +1 -1
index a465d5242774a..70178c5f53956 100644
@@ -3777,7 +3777,7 @@
 			shutdown the other cpus.  Instead use the REBOOT_VECTOR
 			irq.
 
-	nomodeset	Disable kernel modesetting. DRM drivers will not perform
+	nomodeset	Disable kernel modesetting. Graphics drivers will not perform
 			display-mode changes or accelerated rendering. Only the
 			system framebuffer will be available for use if this was
 			set-up by the firmware or boot loader.
MAINTAINERS +2 -0
index 0f624e3ef6235..84b008f5aacbc 100644
@@ -6698,8 +6698,10 @@ F:	drivers/gpu/drm/drm_aperture.c
 F:	drivers/gpu/drm/tiny/ofdrm.c
 F:	drivers/gpu/drm/tiny/simpledrm.c
 F:	drivers/video/aperture.c
+F:	drivers/video/nomodeset.c
 F:	include/drm/drm_aperture.h
 F:	include/linux/aperture.h
+F:	include/video/nomodeset.h
 
 DRM DRIVER FOR SIS VIDEO CARDS
 S:	Orphan / Obsolete
drivers/gpu/drm/Kconfig +1 -6
index f30f99166531f..6b11614aecc5b 100644
@@ -8,7 +8,6 @@
 menuconfig DRM
 	tristate "Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)"
 	depends on (AGP || AGP=n) && !EMULATED_CMPXCHG && HAS_DMA
-	select DRM_NOMODESET
 	select DRM_PANEL_ORIENTATION_QUIRKS
 	select HDMI
 	select FB_CMDLINE
@@ -19,6 +18,7 @@ menuconfig DRM
 # gallium uses SYS_kcmp for os_same_file_description() to de-duplicate
 # device and dmabuf fd. Let's make sure that is available for our userspace.
 	select KCMP
+	select VIDEO_NOMODESET
 	help
 	  Kernel-level support for the Direct Rendering Infrastructure (DRI)
 	  introduced in XFree86 4.0. If you say Y here, you need to select
@@ -515,11 +515,6 @@ config DRM_EXPORT_FOR_TESTS
 config DRM_PANEL_ORIENTATION_QUIRKS
 	tristate
 
-# Separate option because nomodeset parameter is global and expected built-in
-config DRM_NOMODESET
-	bool
-	default n
-
 config DRM_LIB_RANDOM
 	bool
 	default n
drivers/gpu/drm/Makefile +0 -1
index c44a54cadb618..f92cd78927110 100644
@@ -72,7 +72,6 @@ drm-$(CONFIG_DRM_PRIVACY_SCREEN) += \
 	drm_privacy_screen_x86.o
 obj-$(CONFIG_DRM)	+= drm.o
 
-obj-$(CONFIG_DRM_NOMODESET) += drm_nomodeset.o
 obj-$(CONFIG_DRM_PANEL_ORIENTATION_QUIRKS) += drm_panel_orientation_quirks.o
 
 #
drivers/video/Kconfig +4 -0
index 0587e21abad94..6d2fde6c5d11a 100644
@@ -11,6 +11,10 @@ config APERTURE_HELPERS
 	  Support tracking and hand-over of aperture ownership. Required
 	  by graphics drivers for firmware-provided framebuffers.
 
+config VIDEO_NOMODESET
+	bool
+	default n
+
 if HAS_IOMEM
 
 config HAVE_FB_ATMEL
drivers/video/Makefile +1 -0
index 5bb6b452cc83a..a50eb528ed3c3 100644
@@ -2,6 +2,7 @@
 
 obj-$(CONFIG_APERTURE_HELPERS)    += aperture.o
 obj-$(CONFIG_VGASTATE)            += vgastate.o
+obj-$(CONFIG_VIDEO_NOMODESET)     += nomodeset.o
 obj-$(CONFIG_HDMI)                += hdmi.o
 
 obj-$(CONFIG_VT)		  += console/
drivers/video/nomodeset.c renamed from drivers/gpu/drm/drm_nomodeset.c +7 -5
similarity index 63%
rename from drivers/gpu/drm/drm_nomodeset.c
rename to drivers/video/nomodeset.c
index f3978d5bd3a1d..13cc8b7196978 100644
@@ -3,17 +3,19 @@
 #include <linux/module.h>
 #include <linux/types.h>
 
-static bool drm_nomodeset;
+#include <video/nomodeset.h>
 
-bool drm_firmware_drivers_only(void)
+static bool video_nomodeset;
+
+bool video_firmware_drivers_only(void)
 {
-	return drm_nomodeset;
+	return video_nomodeset;
 }
-EXPORT_SYMBOL(drm_firmware_drivers_only);
+EXPORT_SYMBOL(video_firmware_drivers_only);
 
 static int __init disable_modeset(char *str)
 {
-	drm_nomodeset = true;
+	video_nomodeset = true;
 
 	pr_warn("Booted with the nomodeset parameter. Only the system framebuffer will be available\n");
 
include/drm/drm_drv.h +7 -1
index f6159acb88569..700d3857e0881 100644
@@ -30,6 +30,8 @@
 #include <linux/list.h>
 #include <linux/irqreturn.h>
 
+#include <video/nomodeset.h>
+
 #include <drm/drm_device.h>
 
 struct drm_file;
@@ -602,6 +604,10 @@ static inline bool drm_drv_uses_atomic_modeset(struct drm_device *dev)
 
 int drm_dev_set_unique(struct drm_device *dev, const char *name);
 
-extern bool drm_firmware_drivers_only(void);
+/* TODO: Inline drm_firmware_drivers_only() in all its callers. */
+static inline bool drm_firmware_drivers_only(void)
+{
+	return video_firmware_drivers_only();
+}
 
 #endif
include/video/nomodeset.h new file +8 -0
new file mode 100644
index 0000000000000..8f8688b8beabe
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: MIT */
+
+#ifndef VIDEO_NOMODESET_H
+#define VIDEO_NOMODESET_H
+
+bool video_firmware_drivers_only(void);
+
+#endif
Signature · 1 line
2.38.0
maintainer Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] drm: Move nomodeset kernel parameter to drivers/video

Hello Thomas,

On 11/7/22 11:49, Thomas Zimmermann wrote:

[...]

Quoted 6 lines
Documentation/admin-guide/kernel-parameters.txt +0 -0
index a465d5242774a..70178c5f53956 100644

Documentation/admin-guide/kernel-parameters.txt line 3783

Quoted 8 lines
Documentation/admin-guide/kernel-parameters.txt +1 -1
@@ -3777,7 +3777,7 @@
 			shutdown the other cpus.  Instead use the REBOOT_VECTOR
 			irq.
 
-	nomodeset	Disable kernel modesetting. DRM drivers will not perform
+	nomodeset	Disable kernel modesetting. Graphics drivers will not perform
 			display-mode changes or accelerated rendering. Only the
 			system framebuffer will be available for use if this was
 			set-up by the firmware or boot loader.

Not really part of your patch but probably we should reword this a little bit.

Because as this is written, it implies that not only DRM drivers with feature DRIVER_MODESET will not be available but also drivers with DRIVER_RENDER. But that's not the case, render-only drivers usually just ignore this parameter (but not all IIRC), so I wonder how we could make this comment more accurate.

Also maybe we can mention in the comment fbdev and DRM? Just to make it clear that this will affect to both subsystems? When I first worked on this, there were a lot of assumptions in the stack (gdm, mutter, plymouth) that nomodeset basically meant "no DRM but fbdev".

[...]

Documentation/admin-guide/kernel-parameters.txt

Quoted 5 lines

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

Documentation/admin-guide/kernel-parameters.txt +1 -1
-extern bool drm_firmware_drivers_only(void);
+/* TODO: Inline drm_firmware_drivers_only() in all its callers. */

I guess you plan to do that as follow-up patches once this series land? Just to avoid the churn to require acks for all the drivers to merge this series?

The changes looks good to me.

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
author maintainer
#3 lore raw

Re: [PATCH 1/2] drm: Move nomodeset kernel parameter to drivers/video

Hi

Am 11.11.22 um 10:28 schrieb Javier Martinez Canillas:

Quoted 36 lines

Hello Thomas,

On 11/7/22 11:49, Thomas Zimmermann wrote:

[...]

Quoted 6 lines
Documentation/admin-guide/kernel-parameters.txt +0 -0
index a465d5242774a..70178c5f53956 100644

Documentation/admin-guide/kernel-parameters.txt line 3783

Quoted 8 lines
Documentation/admin-guide/kernel-parameters.txt +1 -1
@@ -3777,7 +3777,7 @@
  			shutdown the other cpus.  Instead use the REBOOT_VECTOR
  			irq.
 
-	nomodeset	Disable kernel modesetting. DRM drivers will not perform
+	nomodeset	Disable kernel modesetting. Graphics drivers will not perform
  			display-mode changes or accelerated rendering. Only the
  			system framebuffer will be available for use if this was
  			set-up by the firmware or boot loader.

Not really part of your patch but probably we should reword this a little bit.

Because as this is written, it implies that not only DRM drivers with feature DRIVER_MODESET will not be available but also drivers with DRIVER_RENDER. But that's not the case, render-only drivers usually just ignore this parameter (but not all IIRC), so I wonder how we could make this comment more accurate.

Also maybe we can mention in the comment fbdev and DRM? Just to make it clear that this will affect to both subsystems? When I first worked on this, there were a lot of assumptions in the stack (gdm, mutter, plymouth) that nomodeset basically meant "no DRM but fbdev".

[...]

Quoted 1 line
Quoted 7 lines

Documentation/admin-guide/kernel-parameters.txt

Quoted 4 lines
  int drm_dev_set_unique(struct drm_device *dev, const char *name);
Documentation/admin-guide/kernel-parameters.txt +1 -1
-extern bool drm_firmware_drivers_only(void);
+/* TODO: Inline drm_firmware_drivers_only() in all its callers. */

I guess you plan to do that as follow-up patches once this series land? Just to avoid the churn to require acks for all the drivers to merge this series?

Yes. It has no hurry, but we can do that.

Best regards
Thomas

Quoted 5 lines

The changes looks good to me.

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
author maintainer
#4 lore raw

Re: [PATCH 1/2] drm: Move nomodeset kernel parameter to drivers/video

In reply to Javier Martinez Canillas

Hi

Am 11.11.22 um 10:28 schrieb Javier Martinez Canillas:

Quoted 23 lines

Hello Thomas,

On 11/7/22 11:49, Thomas Zimmermann wrote:

[...]

Quoted 6 lines
Documentation/admin-guide/kernel-parameters.txt +0 -0
index a465d5242774a..70178c5f53956 100644

Documentation/admin-guide/kernel-parameters.txt line 3783

Quoted 8 lines
Documentation/admin-guide/kernel-parameters.txt +1 -1
@@ -3777,7 +3777,7 @@
  			shutdown the other cpus.  Instead use the REBOOT_VECTOR
  			irq.
 
-	nomodeset	Disable kernel modesetting. DRM drivers will not perform
+	nomodeset	Disable kernel modesetting. Graphics drivers will not perform
  			display-mode changes or accelerated rendering. Only the
  			system framebuffer will be available for use if this was
  			set-up by the firmware or boot loader.

Not really part of your patch but probably we should reword this a little bit.

Quoted 4 lines

Because as this is written, it implies that not only DRM drivers with feature DRIVER_MODESET will not be available but also drivers with DRIVER_RENDER. But that's not the case, render-only drivers usually just ignore this parameter (but not all IIRC), so I wonder how we could make this comment more accurate.

I see what you mean, but it's hard to describe in simple words. The option is a bit fuzzy. It means that a driver will not replace a firmware buffer; even if that means it won't initialize at all. I guess we should spell that out.

Quoted 5 lines

Also maybe we can mention in the comment fbdev and DRM? Just to make it clear that this will affect to both subsystems? When I first worked on this, there were a lot of assumptions in the stack (gdm, mutter, plymouth) that nomodeset basically meant "no DRM but fbdev".

I can change the text to say 'DRM and fbdev drivers'.

Best regards
Thomas

Quoted 16 lines

[...]

Documentation/admin-guide/kernel-parameters.txt

Quoted 5 lines
  
  int drm_dev_set_unique(struct drm_device *dev, const char *name);
Documentation/admin-guide/kernel-parameters.txt +1 -1
-extern bool drm_firmware_drivers_only(void);
+/* TODO: Inline drm_firmware_drivers_only() in all its callers. */

I guess you plan to do that as follow-up patches once this series land? Just to avoid the churn to require acks for all the drivers to merge this series?

The changes looks good to me.

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
author maintainer
#5 lore raw

PATCH 2/2 fbdev: Add support for the nomodeset kernel parameter

In reply to Thomas Zimmermann

Support the kernel's nomodeset parameter for all PCI-based fbdev drivers that use aperture helpers to remove other, hardware-agnostic graphics drivers.

The parameter is a simple way of using the firmware-provided scanout buffer if the hardware's native driver is broken. The same effect could be achieved with per-driver options, but the importance of the graphics output for many users makes a single, unified approach worthwhile.

With nomodeset specified, the fbdev driver module will not load. This unifies behavior with similar DRM drivers. In DRM helpers, modules first check the nomodeset parameter before registering the PCI driver. As fbdev has no such module helpers, we have to modify each driver individually.

The name 'nomodeset' is slightly misleading, but has been chosen for historical reasons. Several drivers implemented it before it became a general option for DRM. So keeping the existing name was preferred over introducing a new one.

---
 drivers/staging/sm750fb/Kconfig              |  1 +
 drivers/staging/sm750fb/sm750.c              |  4 +++
 drivers/video/fbdev/Kconfig                  | 37 ++++++++++++++++++++
 drivers/video/fbdev/arkfb.c                  |  6 ++++
 drivers/video/fbdev/asiliantfb.c             |  5 +++
 drivers/video/fbdev/aty/aty128fb.c           |  6 ++++
 drivers/video/fbdev/aty/atyfb_base.c         |  6 ++++
 drivers/video/fbdev/aty/radeon_base.c        |  6 ++++
 drivers/video/fbdev/carminefb.c              |  5 +++
 drivers/video/fbdev/chipsfb.c                |  5 +++
 drivers/video/fbdev/cirrusfb.c               |  6 ++++
 drivers/video/fbdev/cyber2000fb.c            |  6 ++++
 drivers/video/fbdev/geode/Kconfig            |  3 ++
 drivers/video/fbdev/geode/gx1fb_core.c       |  7 ++++
 drivers/video/fbdev/geode/gxfb_core.c        |  7 ++++
 drivers/video/fbdev/geode/lxfb_core.c        |  7 ++++
 drivers/video/fbdev/gxt4500.c                |  5 +++
 drivers/video/fbdev/hyperv_fb.c              |  5 +++
 drivers/video/fbdev/i740fb.c                 |  6 ++++
 drivers/video/fbdev/i810/i810_main.c         |  8 +++++
 drivers/video/fbdev/imsttfb.c                |  7 ++++
 drivers/video/fbdev/intelfb/intelfbdrv.c     |  5 +++
 drivers/video/fbdev/kyro/fbdev.c             |  6 ++++
 drivers/video/fbdev/matrox/matroxfb_base.c   |  5 +++
 drivers/video/fbdev/mb862xx/mb862xxfbdrv.c   |  5 +++
 drivers/video/fbdev/neofb.c                  |  6 ++++
 drivers/video/fbdev/nvidia/nvidia.c          |  7 ++++
 drivers/video/fbdev/pm2fb.c                  |  6 ++++
 drivers/video/fbdev/pm3fb.c                  |  6 ++++
 drivers/video/fbdev/pvr2fb.c                 |  7 ++++
 drivers/video/fbdev/riva/fbdev.c             |  7 ++++
 drivers/video/fbdev/s3fb.c                   |  6 ++++
 drivers/video/fbdev/savage/savagefb_driver.c |  5 +++
 drivers/video/fbdev/sis/sis_main.c           |  7 ++++
 drivers/video/fbdev/skeletonfb.c             |  7 ++++
 drivers/video/fbdev/sm712fb.c                |  5 +++
 drivers/video/fbdev/sstfb.c                  |  4 +++
 drivers/video/fbdev/sunxvr2500.c             |  5 +++
 drivers/video/fbdev/sunxvr500.c              |  5 +++
 drivers/video/fbdev/tdfxfb.c                 |  6 ++++
 drivers/video/fbdev/tgafb.c                  |  6 ++++
 drivers/video/fbdev/tridentfb.c              |  6 ++++
 drivers/video/fbdev/vermilion/vermilion.c    |  7 ++++
 drivers/video/fbdev/via/via-core.c           |  5 +++
 drivers/video/fbdev/vt8623fb.c               |  6 ++++
 45 files changed, 288 insertions(+)
drivers/staging/sm750fb/Kconfig +1 -0
index 8c0d8a873d5b0..acb6c08d09dce 100644
@@ -6,6 +6,7 @@ config FB_SM750
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
+	select VIDEO_NOMODESET
 	help
 	  Frame buffer driver for the Silicon Motion SM750 chip
 	  with 2D accelearion and dual head support.
drivers/staging/sm750fb/sm750.c +4 -0
index 168ae2e9005d7..d6f89dd3f59ba 100644
@@ -17,6 +17,7 @@
 #include <linux/screen_info.h>
 #include <linux/console.h>
 #include <asm/fb.h>
+#include <video/nomodeset.h>
 #include "sm750.h"
 #include "sm750_accel.h"
 #include "sm750_cursor.h"
@@ -1168,6 +1169,9 @@ static int __init lynxfb_init(void)
 {
 	char *option;
 
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
 #ifdef MODULE
 	option = g_option;
 #else
drivers/video/fbdev/Kconfig +37 -0
index a98987aa27846..71019b167f8b0 100644
@@ -227,6 +227,7 @@ config FB_CIRRUS
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
+	select VIDEO_NOMODESET
 	help
 	  This enables support for Cirrus Logic GD542x/543x based boards on
 	  Amiga: SD64, Piccolo, Picasso II/II+, Picasso IV, or EGS Spectrum.
@@ -245,6 +246,7 @@ config FB_PM2
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
+	select VIDEO_NOMODESET
 	help
 	  This is the frame buffer device driver for cards based on
 	  the 3D Labs Permedia, Permedia 2 and Permedia 2V chips.
@@ -340,6 +342,7 @@ config FB_CYBER2000
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
+	select VIDEO_NOMODESET
 	help
 	  This enables support for the Integraphics CyberPro 20x0 and 5000
 	  VGA chips used in the Rebel.com Netwinder and other machines.
@@ -504,6 +507,7 @@ config FB_CT65550
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
+	select VIDEO_NOMODESET
 	help
 	  This is the frame buffer device driver for the Chips & Technologies
 	  65550 graphics chip in PowerBooks.
@@ -514,6 +518,7 @@ config FB_ASILIANT
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
+	select VIDEO_NOMODESET
 	help
 	  This is the frame buffer device driver for the Asiliant 69030 chipset
 
@@ -522,6 +527,7 @@ config FB_IMSTT
 	depends on (FB = y) && PCI
 	select FB_CFB_IMAGEBLIT
 	select FB_MACMODES if PPC_PMAC
+	select VIDEO_NOMODESET
 	help
 	  The IMS Twin Turbo is a PCI-based frame buffer card bundled with
 	  many Macintosh and compatible computers.
@@ -585,6 +591,7 @@ config FB_TGA
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
 	select BITREVERSE
+	select VIDEO_NOMODESET
 	help
 	  This is the frame buffer device driver for generic TGA and SFB+
 	  graphic cards.  These include DEC ZLXp-E1, -E2 and -E3 PCI cards,
@@ -777,6 +784,7 @@ config FB_XVR500
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
+	select VIDEO_NOMODESET
 	help
 	  This is the framebuffer device for the Sun XVR-500 and similar
 	  graphics cards based upon the 3DLABS Wildcat chipset.  The driver
@@ -790,6 +798,7 @@ config FB_XVR2500
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
+	select VIDEO_NOMODESET
 	help
 	  This is the framebuffer device for the Sun XVR-2500 and similar
 	  graphics cards based upon the 3DLABS Wildcat chipset.  The driver
@@ -816,6 +825,7 @@ config FB_PVR2
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
+	select VIDEO_NOMODESET
 	help
 	  Say Y here if you have a PowerVR 2 card in your box.  If you plan to
 	  run linux on your Dreamcast, you will have to say Y here.
@@ -881,6 +891,7 @@ config FB_NVIDIA
 	select FB_CFB_IMAGEBLIT
 	select BITREVERSE
 	select VGASTATE
+	select VIDEO_NOMODESET
 	help
 	  This driver supports graphics boards with the nVidia chips, TNT
 	  and newer. For very old chipsets, such as the RIVA128, then use
@@ -928,6 +939,7 @@ config FB_RIVA
 	select FB_CFB_IMAGEBLIT
 	select BITREVERSE
 	select VGASTATE
+	select VIDEO_NOMODESET
 	help
 	  This driver supports graphics boards with the nVidia Riva/Geforce
 	  chips.
@@ -972,6 +984,7 @@ config FB_I740
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
 	select VGASTATE
+	select VIDEO_NOMODESET
 	select FB_DDC
 	help
 	  This driver supports graphics cards based on Intel740 chip.
@@ -984,6 +997,7 @@ config FB_I810
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
 	select VGASTATE
+	select VIDEO_NOMODESET
 	help
 	  This driver supports the on-board graphics built in to the Intel 810
 	  and 815 chipsets.  Say Y if you have and plan to use such a board.
@@ -1034,6 +1048,7 @@ config FB_LE80578
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
+	select VIDEO_NOMODESET
 	help
 	  This driver supports the LE80578 (Vermilion Range) chipset
 
@@ -1051,6 +1066,7 @@ config FB_INTEL
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
 	select BOOT_VESA_SUPPORT if FB_INTEL = y
+	select VIDEO_NOMODESET
 	depends on !DRM_I915
 	help
 	  This driver supports the on-board graphics built in to the Intel
@@ -1088,6 +1104,7 @@ config FB_MATROX
 	select FB_CFB_IMAGEBLIT
 	select FB_TILEBLITTING
 	select FB_MACMODES if PPC_PMAC
+	select VIDEO_NOMODESET
 	help
 	  Say Y here if you have a Matrox Millennium, Matrox Millennium II,
 	  Matrox Mystique, Matrox Mystique 220, Matrox Productiva G100, Matrox
@@ -1208,6 +1225,7 @@ config FB_RADEON
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
 	select FB_MACMODES if PPC
+	select VIDEO_NOMODESET
 	help
 	  Choose this option if you want to use an ATI Radeon graphics card as
 	  a framebuffer device.  There are both PCI and AGP versions.  You
@@ -1247,6 +1265,7 @@ config FB_ATY128
 	select FB_CFB_IMAGEBLIT
 	select FB_BACKLIGHT if FB_ATY128_BACKLIGHT
 	select FB_MACMODES if PPC_PMAC
+	select VIDEO_NOMODESET
 	help
 	  This driver supports graphics boards with the ATI Rage128 chips.
 	  Say Y if you have such a graphics board and read
@@ -1271,6 +1290,7 @@ config FB_ATY
 	select FB_BACKLIGHT if FB_ATY_BACKLIGHT
 	select FB_MACMODES if PPC
 	select FB_ATY_CT if SPARC64 && PCI
+	select VIDEO_NOMODESET
 	help
 	  This driver supports graphics boards with the ATI Mach64 chips.
 	  Say Y if you have such a graphics board.
@@ -1321,6 +1341,7 @@ config FB_S3
 	select FB_TILEBLITTING
 	select FB_SVGALIB
 	select VGASTATE
+	select VIDEO_NOMODESET
 	select FONT_8x16 if FRAMEBUFFER_CONSOLE
 	help
 	  Driver for graphics boards with S3 Trio / S3 Virge chip.
@@ -1341,6 +1362,7 @@ config FB_SAVAGE
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
 	select VGASTATE
+	select VIDEO_NOMODESET
 	help
 	  This driver supports notebooks and computers with S3 Savage PCI/AGP
 	  chips.
@@ -1379,6 +1401,7 @@ config FB_SIS
 	select FB_CFB_IMAGEBLIT
 	select BOOT_VESA_SUPPORT if FB_SIS = y
 	select FB_SIS_300 if !FB_SIS_315
+	select VIDEO_NOMODESET
 	help
 	  This is the frame buffer device driver for the SiS 300, 315, 330
 	  and 340 series as well as XGI V3XT, V5, V8, Z7 graphics chipsets.
@@ -1408,6 +1431,7 @@ config FB_VIA
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
 	select I2C_ALGOBIT
+	select VIDEO_NOMODESET
 	help
 	  This is the frame buffer device driver for Graphics chips of VIA
 	  UniChrome (Pro) Family (CLE266,PM800/CN400,P4M800CE/P4M800Pro/
@@ -1447,6 +1471,7 @@ config FB_NEOMAGIC
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
 	select VGASTATE
+	select VIDEO_NOMODESET
 	help
 	  This driver supports notebooks with NeoMagic PCI chips.
 	  Say Y if you have such a graphics card.
@@ -1460,6 +1485,7 @@ config FB_KYRO
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
+	select VIDEO_NOMODESET
 	help
 	  Say Y here if you have a STG4000 / Kyro / PowerVR 3 based
 	  graphics board.
@@ -1474,6 +1500,7 @@ config FB_3DFX
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_MODE_HELPERS
+	select VIDEO_NOMODESET
 	help
 	  This driver supports graphics boards with the 3Dfx Banshee,
 	  Voodoo3 or VSA-100 (aka Voodoo4/5) chips. Say Y if you have
@@ -1503,6 +1530,7 @@ config FB_VOODOO1
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
+	select VIDEO_NOMODESET
 	help
 	  Say Y here if you have a 3Dfx Voodoo Graphics (Voodoo1/sst1) or
 	  Voodoo2 (cvg) based graphics card.
@@ -1524,6 +1552,7 @@ config FB_VT8623
 	select FB_TILEBLITTING
 	select FB_SVGALIB
 	select VGASTATE
+	select VIDEO_NOMODESET
 	select FONT_8x16 if FRAMEBUFFER_CONSOLE
 	help
 	  Driver for CastleRock integrated graphics core in the
@@ -1537,6 +1566,7 @@ config FB_TRIDENT
 	select FB_CFB_IMAGEBLIT
 	select FB_DDC
 	select FB_MODE_HELPERS
+	select VIDEO_NOMODESET
 	help
 	  This is the frame buffer device driver for Trident PCI/AGP chipsets.
 	  Supported chipset families are TGUI 9440/96XX, 3DImage, Blade3D
@@ -1560,6 +1590,7 @@ config FB_ARK
 	select FB_TILEBLITTING
 	select FB_SVGALIB
 	select VGASTATE
+	select VIDEO_NOMODESET
 	select FONT_8x16 if FRAMEBUFFER_CONSOLE
 	help
 	  Driver for PCI graphics boards with ARK 2000PV chip
@@ -1571,6 +1602,7 @@ config FB_PM3
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
+	select VIDEO_NOMODESET
 	help
 	  This is the frame buffer device driver for the 3DLabs Permedia3
 	  chipset, used in Formac ProFormance III, 3DLabs Oxygen VX1 &
@@ -1583,6 +1615,7 @@ config FB_CARMINE
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
+	select VIDEO_NOMODESET
 	help
 	  This is the frame buffer device driver for the Fujitsu Carmine chip.
 	  The driver provides two independent frame buffer devices.
@@ -1961,6 +1994,7 @@ config FB_IBM_GXT4500
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
+	select VIDEO_NOMODESET
 	help
 	  Say Y here to enable support for the IBM GXT4000P/6000P and
 	  GXT4500P/6500P display adaptor based on Raster Engine RC1000,
@@ -2101,6 +2135,7 @@ config FB_MB862XX
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
+	select VIDEO_NOMODESET
 	help
 	  Frame buffer driver for Fujitsu Carmine/Coral-P(A)/Lime controllers.
 
@@ -2188,6 +2223,7 @@ config FB_HYPERV
 	select FB_CFB_IMAGEBLIT
 	select FB_DEFERRED_IO
 	select DMA_CMA if HAVE_DMA_CONTIGUOUS && CMA
+	select VIDEO_NOMODESET
 	help
 	  This framebuffer driver supports Microsoft Hyper-V Synthetic Video.
 
@@ -2230,6 +2266,7 @@ config FB_SM712
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
+	select VIDEO_NOMODESET
 	help
 	  Frame buffer driver for the Silicon Motion SM710, SM712, SM721
 	  and SM722 chips.
drivers/video/fbdev/arkfb.c +6 -0
index 5f8fec9e5fd4d..d76243980cfad 100644
@@ -25,6 +25,7 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/console.h> /* Why should fb driver call console functions? because console_lock() */
+#include <video/nomodeset.h>
 #include <video/vga.h>
 
 struct arkfb_info {
@@ -1187,7 +1188,12 @@ static int __init arkfb_init(void)
 
 #ifndef MODULE
 	char *option = NULL;
+#endif
+
+	if (video_firmware_drivers_only())
+		return -ENODEV;
 
+#ifndef MODULE
 	if (fb_get_options("arkfb", &option))
 		return -ENODEV;
 
drivers/video/fbdev/asiliantfb.c +5 -0
index 3818437a8f691..9209d2df95320 100644
@@ -43,6 +43,8 @@
 #include <linux/pci.h>
 #include <asm/io.h>
 
+#include <video/nomodeset.h>
+
 /* Built in clock of the 69030 */
 static const unsigned Fref = 14318180;
 
@@ -616,6 +618,9 @@ static struct pci_driver asiliantfb_driver = {
 
 static int __init asiliantfb_init(void)
 {
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
 	if (fb_get_options("asiliantfb", NULL))
 		return -ENODEV;
 
drivers/video/fbdev/aty/aty128fb.c +6 -0
index 57e398fe7a81c..1a26ac2865d65 100644
@@ -80,6 +80,7 @@
 #include <asm/btext.h>
 #endif /* CONFIG_BOOTX_TEXT */
 
+#include <video/nomodeset.h>
 #include <video/aty128.h>
 
 /* Debug flag */
@@ -2503,7 +2504,12 @@ static int aty128fb_init(void)
 {
 #ifndef MODULE
 	char *option = NULL;
+#endif
+
+	if (video_firmware_drivers_only())
+		return -ENODEV;
 
+#ifndef MODULE
 	if (fb_get_options("aty128fb", &option))
 		return -ENODEV;
 	aty128fb_setup(option);
drivers/video/fbdev/aty/atyfb_base.c +6 -0
index b3463d1371520..2b7c643cfdd97 100644
@@ -75,6 +75,7 @@
 #include <linux/uaccess.h>
 
 #include <video/mach64.h>
+#include <video/nomodeset.h>
 #include "atyfb.h"
 #include "ati_ids.h"
 
@@ -3965,7 +3966,12 @@ static int __init atyfb_init(void)
 	int err1 = 1, err2 = 1;
 #ifndef MODULE
 	char *option = NULL;
+#endif
+
+	if (video_firmware_drivers_only())
+		return -ENODEV;
 
+#ifndef MODULE
 	if (fb_get_options("atyfb", &option))
 		return -ENODEV;
 	atyfb_setup(option);
drivers/video/fbdev/aty/radeon_base.c +6 -0
index 8b28c9bddd974..53088c706e89b 100644
@@ -85,6 +85,7 @@
 
 #endif /* CONFIG_PPC */
 
+#include <video/nomodeset.h>
 #include <video/radeon.h>
 #include <linux/radeonfb.h>
 
@@ -2607,7 +2608,12 @@ static int __init radeonfb_init (void)
 {
 #ifndef MODULE
 	char *option = NULL;
+#endif
+
+	if (video_firmware_drivers_only())
+		return -ENODEV;
 
+#ifndef MODULE
 	if (fb_get_options("radeonfb", &option))
 		return -ENODEV;
 	radeonfb_setup(option);
drivers/video/fbdev/carminefb.c +5 -0
index 4651b48a87f93..afdd2994325d7 100644
@@ -16,6 +16,8 @@
 #include <linux/slab.h>
 #include <linux/module.h>
 
+#include <video/nomodeset.h>
+
 #include "carminefb.h"
 #include "carminefb_regs.h"
 
@@ -773,6 +775,9 @@ static struct pci_driver carmine_pci_driver = {
 
 static int __init carminefb_init(void)
 {
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
 	if (!(fb_displays &
 		(CARMINE_USE_DISPLAY0 | CARMINE_USE_DISPLAY1))) {
 		printk(KERN_ERR "If you disable both displays than you don't "
drivers/video/fbdev/chipsfb.c +5 -0
index f1c1c95c1fdf0..f95c07295090e 100644
@@ -29,6 +29,8 @@
 #include <linux/pci.h>
 #include <linux/console.h>
 
+#include <video/nomodeset.h>
+
 #ifdef CONFIG_PMAC_BACKLIGHT
 #include <asm/backlight.h>
 #endif
@@ -506,6 +508,9 @@ static struct pci_driver chipsfb_driver = {
 
 int __init chips_init(void)
 {
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
 	if (fb_get_options("chipsfb", NULL))
 		return -ENODEV;
 
drivers/video/fbdev/cirrusfb.c +6 -0
index b08bee43779ae..89da055cd3b95 100644
@@ -54,6 +54,7 @@
 #include <asm/amigahw.h>
 #endif
 
+#include <video/nomodeset.h>
 #include <video/vga.h>
 #include <video/cirrus.h>
 
@@ -2359,7 +2360,12 @@ static int __init cirrusfb_init(void)
 
 #ifndef MODULE
 	char *option = NULL;
+#endif
+
+	if (video_firmware_drivers_only())
+		return -ENODEV;
 
+#ifndef MODULE
 	if (fb_get_options("cirrusfb", &option))
 		return -ENODEV;
 	cirrusfb_setup(option);
drivers/video/fbdev/cyber2000fb.c +6 -0
index 31ff1da82c052..afe9f8a4c07a8 100644
@@ -48,6 +48,7 @@
 #include <linux/i2c.h>
 #include <linux/i2c-algo-bit.h>
 
+#include <video/nomodeset.h>
 
 #ifdef __arm__
 #include <asm/mach-types.h>
@@ -1878,7 +1879,12 @@ static int __init cyber2000fb_init(void)
 
 #ifndef MODULE
 	char *option = NULL;
+#endif
+
+	if (video_firmware_drivers_only())
+		return -ENODEV;
 
+#ifndef MODULE
 	if (fb_get_options("cyber2000fb", &option))
 		return -ENODEV;
 	cyber2000fb_setup(option);
drivers/video/fbdev/geode/Kconfig +3 -0
index ac9c860592aaf..2f8f0fb1dae2f 100644
@@ -15,6 +15,7 @@ config FB_GEODE_LX
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
+	select VIDEO_NOMODESET
 	help
 	  Framebuffer driver for the display controller integrated into the
 	  AMD Geode LX processors.
@@ -30,6 +31,7 @@ config FB_GEODE_GX
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
+	select VIDEO_NOMODESET
 	help
 	  Framebuffer driver for the display controller integrated into the
 	  AMD Geode GX processors.
@@ -45,6 +47,7 @@ config FB_GEODE_GX1
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
+	select VIDEO_NOMODESET
 	help
 	  Framebuffer driver for the display controller integrated into the
 	  AMD Geode GX1 processor.
drivers/video/fbdev/geode/gx1fb_core.c +7 -0
index 1514c653a84fb..d1296c9b1d1c4 100644
@@ -17,6 +17,8 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 
+#include <video/nomodeset.h>
+
 #include "geodefb.h"
 #include "display_gx1.h"
 #include "video_cs5530.h"
@@ -446,7 +448,12 @@ static int __init gx1fb_init(void)
 {
 #ifndef MODULE
 	char *option = NULL;
+#endif
 
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
+#ifndef MODULE
 	if (fb_get_options("gx1fb", &option))
 		return -ENODEV;
 	gx1fb_setup(option);
drivers/video/fbdev/geode/gxfb_core.c +7 -0
index 2527bd80ec5f5..ddf5a86b35bbf 100644
@@ -31,6 +31,8 @@
 
 #include <asm/olpc.h>
 
+#include <video/nomodeset.h>
+
 #include "gxfb.h"
 
 static char *mode_option;
@@ -511,7 +513,12 @@ static int __init gxfb_init(void)
 {
 #ifndef MODULE
 	char *option = NULL;
+#endif
 
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
+#ifndef MODULE
 	if (fb_get_options("gxfb", &option))
 		return -ENODEV;
 
drivers/video/fbdev/geode/lxfb_core.c +7 -0
index 9d26592dbfce9..8ecf4a24966cb 100644
@@ -22,6 +22,8 @@
 
 #include <asm/olpc.h>
 
+#include <video/nomodeset.h>
+
 #include "lxfb.h"
 
 static char *mode_option;
@@ -647,7 +649,12 @@ static int __init lxfb_init(void)
 {
 #ifndef MODULE
 	char *option = NULL;
+#endif
 
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
+#ifndef MODULE
 	if (fb_get_options("lxfb", &option))
 		return -ENODEV;
 
drivers/video/fbdev/gxt4500.c +5 -0
index 0dcef4bec8d7c..5a8544efb4b61 100644
@@ -16,6 +16,8 @@
 #include <linux/delay.h>
 #include <linux/string.h>
 
+#include <video/nomodeset.h>
+
 #define PCI_DEVICE_ID_IBM_GXT4500P	0x21c
 #define PCI_DEVICE_ID_IBM_GXT6500P	0x21b
 #define PCI_DEVICE_ID_IBM_GXT4000P	0x16e
@@ -779,6 +781,9 @@ static struct pci_driver gxt4500_driver = {
 
 static int gxt4500_init(void)
 {
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
 #ifndef MODULE
 	if (fb_get_options("gxt4500", &mode_option))
 		return -ENODEV;
drivers/video/fbdev/hyperv_fb.c +5 -0
index 072ce07ba9e05..3cdabc36748f7 100644
@@ -59,6 +59,8 @@
 
 #include <linux/hyperv.h>
 
+#include <video/nomodeset.h>
+
 
 /* Hyper-V Synthetic Video Protocol definitions and structures */
 #define MAX_VMBUS_PKT_SIZE 0x4000
@@ -1363,6 +1365,9 @@ static int __init hvfb_drv_init(void)
 {
 	int ret;
 
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
 	ret = vmbus_driver_register(&hvfb_drv);
 	if (ret != 0)
 		return ret;
drivers/video/fbdev/i740fb.c +6 -0
index b795f6503cb67..ebb0b89fefc5c 100644
@@ -27,6 +27,7 @@
 #include <linux/i2c.h>
 #include <linux/i2c-algo-bit.h>
 #include <linux/console.h>
+#include <video/nomodeset.h>
 #include <video/vga.h>
 
 #include "i740_reg.h"
@@ -1285,7 +1286,12 @@ static int __init i740fb_init(void)
 {
 #ifndef MODULE
 	char *option = NULL;
+#endif
+
+	if (video_firmware_drivers_only())
+		return -ENODEV;
 
+#ifndef MODULE
 	if (fb_get_options("i740fb", &option))
 		return -ENODEV;
 	i740fb_setup(option);
drivers/video/fbdev/i810/i810_main.c +8 -0
index ff09f8c20bfcb..6e94e4b35f334 100644
@@ -44,6 +44,8 @@
 #include <linux/console.h>
 #include <linux/io.h>
 
+#include <video/nomodeset.h>
+
 #include <asm/io.h>
 #include <asm/div64.h>
 #include <asm/page.h>
@@ -2143,6 +2145,9 @@ static int i810fb_init(void)
 {
 	char *option = NULL;
 
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
 	if (fb_get_options("i810fb", &option))
 		return -ENODEV;
 	i810fb_setup(option);
@@ -2159,6 +2164,9 @@ static int i810fb_init(void)
 
 static int i810fb_init(void)
 {
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
 	hsync1 *= 1000;
 	hsync2 *= 1000;
 
drivers/video/fbdev/imsttfb.c +7 -0
index d7edb9c5d3a3f..ac143dbf76e08 100644
@@ -36,6 +36,8 @@
 #include "macmodes.h"
 #endif
 
+#include <video/nomodeset.h>
+
 #ifndef __powerpc__
 #define eieio()		/* Enforce In-order Execution of I/O */
 #endif
@@ -1617,7 +1619,12 @@ static int __init imsttfb_init(void)
 {
 #ifndef MODULE
 	char *option = NULL;
+#endif
 
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
+#ifndef MODULE
 	if (fb_get_options("imsttfb", &option))
 		return -ENODEV;
 
drivers/video/fbdev/intelfb/intelfbdrv.c +5 -0
index d4a2891a9a7ac..bca9f0a1854c7 100644
@@ -125,6 +125,8 @@
 
 #include <asm/io.h>
 
+#include <video/nomodeset.h>
+
 #include "intelfb.h"
 #include "intelfbhw.h"
 #include "../edid.h"
@@ -380,6 +382,9 @@ static int __init intelfb_init(void)
 	char *option = NULL;
 #endif
 
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
 	DBG_MSG("intelfb_init\n");
 
 	INF_MSG("Framebuffer driver for "
drivers/video/fbdev/kyro/fbdev.c +6 -0
index b4b93054c5208..0e2514db58f5b 100644
@@ -25,6 +25,7 @@
 #include <linux/uaccess.h>
 
 #include <video/kyro.h>
+#include <video/nomodeset.h>
 
 #include "STG4000Reg.h"
 #include "STG4000Interface.h"
@@ -789,7 +790,12 @@ static int __init kyrofb_init(void)
 {
 #ifndef MODULE
 	char *option = NULL;
+#endif
+
+	if (video_firmware_drivers_only())
+		return -ENODEV;
 
+#ifndef MODULE
 	if (fb_get_options("kyrofb", &option))
 		return -ENODEV;
 	kyrofb_setup(option);
drivers/video/fbdev/matrox/matroxfb_base.c +5 -0
index 775d34115e2df..5797301329957 100644
@@ -123,6 +123,8 @@ static int default_vmode = VMODE_NVRAM;
 static int default_cmode = CMODE_NVRAM;
 #endif
 
+#include <video/nomodeset.h>
+
 static void matroxfb_unregister_device(struct matrox_fb_info* minfo);
 
 /* --------------------------------------------------------------------- */
@@ -2314,6 +2316,9 @@ static void __init matroxfb_init_params(void) {
 static int __init matrox_init(void) {
 	int err;
 
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
 	matroxfb_init_params();
 	err = pci_register_driver(&matroxfb_driver);
 	dev = -1;	/* accept all new devices... */
drivers/video/fbdev/mb862xx/mb862xxfbdrv.c +5 -0
index 90c79e8c11570..6d61d47d4b43a 100644
@@ -26,6 +26,8 @@
 #include "mb862xxfb.h"
 #include "mb862xx_reg.h"
 
+#include <video/nomodeset.h>
+
 #define NR_PALETTE		256
 #define MB862XX_MEM_SIZE	0x1000000
 #define CORALP_MEM_SIZE		0x2000000
@@ -1181,6 +1183,9 @@ static int mb862xxfb_init(void)
 {
 	int ret = -ENODEV;
 
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
 #if defined(CONFIG_FB_MB862XX_LIME)
 	ret = platform_driver_register(&of_platform_mb862xxfb_driver);
 #endif
drivers/video/fbdev/neofb.c +6 -0
index 93a2d2d1abe8f..572275d4f5b60 100644
@@ -73,6 +73,7 @@
 #include <asm/irq.h>
 #include <video/vga.h>
 #include <video/neomagic.h>
+#include <video/nomodeset.h>
 
 #define NEOFB_VERSION "0.4.2"
 
@@ -2209,7 +2210,12 @@ static int __init neofb_init(void)
 {
 #ifndef MODULE
 	char *option = NULL;
+#endif
+
+	if (video_firmware_drivers_only())
+		return -ENODEV;
 
+#ifndef MODULE
 	if (fb_get_options("neofb", &option))
 		return -ENODEV;
 	neofb_setup(option);
drivers/video/fbdev/nvidia/nvidia.c +7 -0
index 329e2e8133c69..a8bd1c10dff17 100644
@@ -26,6 +26,8 @@
 #include <asm/btext.h>
 #endif
 
+#include <video/nomodeset.h>
+
 #include "nv_local.h"
 #include "nv_type.h"
 #include "nv_proto.h"
@@ -1521,7 +1523,12 @@ static int nvidiafb_init(void)
 {
 #ifndef MODULE
 	char *option = NULL;
+#endif
 
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
+#ifndef MODULE
 	if (fb_get_options("nvidiafb", &option))
 		return -ENODEV;
 	nvidiafb_setup(option);
drivers/video/fbdev/pm2fb.c +6 -0
index 7da715d31a933..37d3672aff88a 100644
@@ -41,6 +41,7 @@
 #include <linux/pci.h>
 #include <video/permedia2.h>
 #include <video/cvisionppc.h>
+#include <video/nomodeset.h>
 
 #if !defined(__LITTLE_ENDIAN) && !defined(__BIG_ENDIAN)
 #error	"The endianness of the target host has not been defined."
@@ -1799,7 +1800,12 @@ static int __init pm2fb_init(void)
 {
 #ifndef MODULE
 	char *option = NULL;
+#endif
+
+	if (video_firmware_drivers_only())
+		return -ENODEV;
 
+#ifndef MODULE
 	if (fb_get_options("pm2fb", &option))
 		return -ENODEV;
 	pm2fb_setup(option);
drivers/video/fbdev/pm3fb.c +6 -0
index ba69846d444f5..75d6580384774 100644
@@ -34,6 +34,7 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 
+#include <video/nomodeset.h>
 #include <video/pm3fb.h>
 
 #if !defined(CONFIG_PCI)
@@ -1540,7 +1541,12 @@ static int __init pm3fb_init(void)
 	 */
 #ifndef MODULE
 	char *option = NULL;
+#endif
+
+	if (video_firmware_drivers_only())
+		return -ENODEV;
 
+#ifndef MODULE
 	if (fb_get_options("pm3fb", &option))
 		return -ENODEV;
 	pm3fb_setup(option);
drivers/video/fbdev/pvr2fb.c +7 -0
index b73ad14efa201..235774d677262 100644
@@ -74,6 +74,8 @@
 #include <cpu/sq.h>
 #endif
 
+#include <video/nomodeset.h>
+
 #ifndef PCI_DEVICE_ID_NEC_NEON250
 #  define PCI_DEVICE_ID_NEC_NEON250	0x0067
 #endif
@@ -1082,7 +1084,12 @@ static int __init pvr2fb_init(void)
 
 #ifndef MODULE
 	char *option = NULL;
+#endif
 
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
+#ifndef MODULE
 	if (fb_get_options("pvr2fb", &option))
 		return -ENODEV;
 	pvr2fb_setup(option);
drivers/video/fbdev/riva/fbdev.c +7 -0
index 0ea74e28f9152..827cf13d23958 100644
@@ -47,6 +47,8 @@
 #include <asm/backlight.h>
 #endif
 
+#include <video/nomodeset.h>
+
 #include "rivafb.h"
 #include "nvreg.h"
 
@@ -2165,7 +2167,12 @@ static int rivafb_init(void)
 {
 #ifndef MODULE
 	char *option = NULL;
+#endif
 
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
+#ifndef MODULE
 	if (fb_get_options("rivafb", &option))
 		return -ENODEV;
 	rivafb_setup(option);
drivers/video/fbdev/s3fb.c +6 -0
index 7713274bd04c2..54862c2034a67 100644
@@ -24,6 +24,7 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/console.h> /* Why should fb driver call console functions? because console_lock() */
+#include <video/nomodeset.h>
 #include <video/vga.h>
 
 #include <linux/i2c.h>
@@ -1558,7 +1559,12 @@ static int __init s3fb_init(void)
 
 #ifndef MODULE
 	char *option = NULL;
+#endif
+
+	if (video_firmware_drivers_only())
+		return -ENODEV;
 
+#ifndef MODULE
 	if (fb_get_options("s3fb", &option))
 		return -ENODEV;
 	s3fb_setup(option);
drivers/video/fbdev/savage/savagefb_driver.c +5 -0
index b7818b652698f..706c66d480c2f 100644
@@ -57,6 +57,8 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 
+#include <video/nomodeset.h>
+
 #include "savagefb.h"
 
 
@@ -2556,6 +2558,9 @@ static int __init savagefb_init(void)
 
 	DBG("savagefb_init");
 
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
 	if (fb_get_options("savagefb", &option))
 		return -ENODEV;
 
drivers/video/fbdev/sis/sis_main.c +7 -0
index 1c197c3f95381..d83a6dbe6f7a1 100644
@@ -41,6 +41,8 @@
 #include <linux/uaccess.h>
 #include <asm/io.h>
 
+#include <video/nomodeset.h>
+
 #include "sis.h"
 #include "sis_main.h"
 #include "init301.h"
@@ -6588,7 +6590,12 @@ static int __init sisfb_init(void)
 {
 #ifndef MODULE
 	char *options = NULL;
+#endif
 
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
+#ifndef MODULE
 	if(fb_get_options("sisfb", &options))
 		return -ENODEV;
 
drivers/video/fbdev/skeletonfb.c +7 -0
index a10f1057293b4..984016b781bb5 100644
@@ -54,6 +54,8 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 
+#include <video/nomodeset.h>
+
     /*
      *  This is just simple sample code.
      *
@@ -987,7 +989,12 @@ static int __init xxxfb_init(void)
 	 */
 #ifndef MODULE
 	char *option = NULL;
+#endif
 
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
+#ifndef MODULE
 	if (fb_get_options("xxxfb", &option))
 		return -ENODEV;
 	xxxfb_setup(option);
drivers/video/fbdev/sm712fb.c +5 -0
index 3baf33635e65f..a1c3070af2e57 100644
@@ -31,6 +31,8 @@
 
 #include <linux/pm.h>
 
+#include <video/nomodeset.h>
+
 #include "sm712.h"
 
 /*
@@ -1756,6 +1758,9 @@ static int __init sm712fb_init(void)
 {
 	char *option = NULL;
 
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
 	if (fb_get_options("sm712fb", &option))
 		return -ENODEV;
 	if (option && *option)
drivers/video/fbdev/sstfb.c +4 -0
index a56b24288566b..1892a1760410f 100644
@@ -90,6 +90,7 @@
 #include <linux/init.h>
 #include <asm/io.h>
 #include <linux/uaccess.h>
+#include <video/nomodeset.h>
 #include <video/sstfb.h>
 
 
@@ -1503,6 +1504,9 @@ static int sstfb_init(void)
 {
 	char *option = NULL;
 
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
 	if (fb_get_options("sstfb", &option))
 		return -ENODEV;
 	sstfb_setup(option);
drivers/video/fbdev/sunxvr2500.c +5 -0
index f4059529c6024..4340e0533c587 100644
@@ -12,6 +12,8 @@
 #include <linux/init.h>
 #include <linux/of_device.h>
 
+#include <video/nomodeset.h>
+
 #include <asm/io.h>
 
 struct s3d_info {
@@ -247,6 +249,9 @@ static struct pci_driver s3d_driver = {
 
 static int __init s3d_init(void)
 {
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
 	if (fb_get_options("s3d", NULL))
 		return -ENODEV;
 
drivers/video/fbdev/sunxvr500.c +5 -0
index b0c8cf0c535a4..13b778d457fdd 100644
@@ -12,6 +12,8 @@
 #include <linux/init.h>
 #include <linux/of_device.h>
 
+#include <video/nomodeset.h>
+
 #include <asm/io.h>
 
 /* XXX This device has a 'dev-comm' property which apparently is
@@ -430,6 +432,9 @@ static struct pci_driver e3d_driver = {
 
 static int __init e3d_init(void)
 {
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
 	if (fb_get_options("e3d", NULL))
 		return -ENODEV;
 
drivers/video/fbdev/tdfxfb.c +6 -0
index 592a913d07189..56d9daa89cdb4 100644
@@ -76,6 +76,7 @@
 #include <linux/pci.h>
 #include <asm/io.h>
 
+#include <video/nomodeset.h>
 #include <video/tdfx.h>
 
 #define DPRINTK(a, b...) pr_debug("fb: %s: " a, __func__ , ## b)
@@ -1632,7 +1633,12 @@ static int __init tdfxfb_init(void)
 {
 #ifndef MODULE
 	char *option = NULL;
+#endif
+
+	if (video_firmware_drivers_only())
+		return -ENODEV;
 
+#ifndef MODULE
 	if (fb_get_options("tdfxfb", &option))
 		return -ENODEV;
 
drivers/video/fbdev/tgafb.c +6 -0
index 251dbd282f5ed..5927fd5d837a4 100644
@@ -31,6 +31,7 @@
 
 #include <asm/io.h>
 
+#include <video/nomodeset.h>
 #include <video/tgafb.h>
 
 #ifdef CONFIG_TC
@@ -1597,7 +1598,12 @@ static int tgafb_init(void)
 	int status;
 #ifndef MODULE
 	char *option = NULL;
+#endif
+
+	if (video_firmware_drivers_only())
+		return -ENODEV;
 
+#ifndef MODULE
 	if (fb_get_options("tgafb", &option))
 		return -ENODEV;
 	tgafb_setup(option);
drivers/video/fbdev/tridentfb.c +6 -0
index 219ce72923370..a7f3caa3b1e2b 100644
@@ -25,6 +25,7 @@
 
 #include <linux/delay.h>
 #include <video/vga.h>
+#include <video/nomodeset.h>
 #include <video/trident.h>
 
 #include <linux/i2c.h>
@@ -1811,7 +1812,12 @@ static int __init tridentfb_init(void)
 {
 #ifndef MODULE
 	char *option = NULL;
+#endif
+
+	if (video_firmware_drivers_only())
+		return -ENODEV;
 
+#ifndef MODULE
 	if (fb_get_options("tridentfb", &option))
 		return -ENODEV;
 	tridentfb_setup(option);
drivers/video/fbdev/vermilion/vermilion.c +7 -0
index 82b36dbb5b1a9..ccef6500534aa 100644
@@ -28,6 +28,8 @@
 #include <asm/tlbflush.h>
 #include <linux/mmzone.h>
 
+#include <video/nomodeset.h>
+
 /* #define VERMILION_DEBUG */
 
 #include "vermilion.h"
@@ -1057,7 +1059,12 @@ static int __init vmlfb_init(void)
 
 #ifndef MODULE
 	char *option = NULL;
+#endif
 
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
+#ifndef MODULE
 	if (fb_get_options(MODULE_NAME, &option))
 		return -ENODEV;
 #endif
drivers/video/fbdev/via/via-core.c +5 -0
index 2ee8fcae08dfb..b11531b4b31e8 100644
@@ -20,6 +20,8 @@
 #include <linux/list.h>
 #include <linux/pm.h>
 
+#include <video/nomodeset.h>
+
 /*
  * The default port config.
  */
@@ -725,6 +727,9 @@ static int __init via_core_init(void)
 {
 	int ret;
 
+	if (video_firmware_drivers_only())
+		return -ENODEV;
+
 	ret = viafb_init();
 	if (ret)
 		return ret;
drivers/video/fbdev/vt8623fb.c +6 -0
index 49b9f148d3a17..81858d02595a8 100644
@@ -25,6 +25,7 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/console.h> /* Why should fb driver call console functions? because console_lock() */
+#include <video/nomodeset.h>
 #include <video/vga.h>
 
 struct vt8623fb_info {
@@ -920,7 +921,12 @@ static int __init vt8623fb_init(void)
 
 #ifndef MODULE
 	char *option = NULL;
+#endif
+
+	if (video_firmware_drivers_only())
+		return -ENODEV;
 
+#ifndef MODULE
 	if (fb_get_options("vt8623fb", &option))
 		return -ENODEV;
 
Signature · 1 line
2.38.0
maintainer
#6 lore raw

Re: [PATCH 2/2] fbdev: Add support for the nomodeset kernel parameter

Quoted 6 lines · Thomas Zimmermann

Support the kernel's nomodeset parameter for all PCI-based fbdev drivers that use aperture helpers to remove other, hardware-agnostic graphics drivers.

The parameter is a simple way of using the firmware-provided scanout buffer if the hardware's native driver is broken.

Nah... it's probably not broken, but you want it disabled in order to use the DRM driver instead?

Quoted 10 lines

The same effect
could be achieved with per-driver options, but the importance of the graphics output for many users makes a single, unified approach worthwhile.

With nomodeset specified, the fbdev driver module will not load. This unifies behavior with similar DRM drivers. In DRM helpers, modules first check the nomodeset parameter before registering the PCI driver. As fbdev has no such module helpers, we have to modify each driver individually.

Ok.

Quoted 10 lines

The name 'nomodeset' is slightly misleading, but has been chosen for historical reasons. Several drivers implemented it before it became a general option for DRM. So keeping the existing name was preferred over introducing a new one.

drivers/video/fbdev/aty/aty128fb.c +0 -0
index 57e398fe7a81c..1a26ac2865d65 100644

drivers/video/fbdev/aty/aty128fb.c static int aty128fb_init(void) · line 2510

Quoted 7 lines
drivers/video/fbdev/aty/aty128fb.c +4 -0
@@ -2503,7 +2504,12 @@ static int aty128fb_init(void)
  {
  #ifndef MODULE
  	char *option = NULL;
+#endif
+
+	if (video_firmware_drivers_only())
+		return -ENODEV;

I think it makes sense to give at least some info, why a specific driver wasn't loaded, e.g. something like this kernel message:
aty128fb: Driver disabled due to "nomodeset" kernel parameter.

If you e.g. change the function video_firmware_drivers_only() to become video_firmware_drivers_only(const char *drivername) then you could print such a message in video_firmware_drivers_only().

And I don't like very much the name of function video_firmware_drivers_only(), but don't have any other better idea right now either...

Helge

author maintainer
#7 lore raw

Re: [PATCH 2/2] fbdev: Add support for the nomodeset kernel parameter

Hi

Am 07.11.22 um 14:57 schrieb Helge Deller:

Quoted 10 lines · Thomas Zimmermann
Quoted 6 lines

Support the kernel's nomodeset parameter for all PCI-based fbdev drivers that use aperture helpers to remove other, hardware-agnostic graphics drivers.

The parameter is a simple way of using the firmware-provided scanout buffer if the hardware's native driver is broken.

Nah... it's probably not broken, but you want it disabled in order to use the DRM driver instead?

No, it's really for broken native drivers or any kind of problematic modesetting. Most DRM drivers already respect the nomodeset option and won't load when given. All you'd get are the generic drivers, such as simpledrm, efifb or simplefb.

There are better options of configuring video output on the kernel command line. But as graphics output is such a fundamental feature to using a computer, we found that a simple and easy option to workaround erroneous systems would benefit DRM users; hence the nomodeset parameter.

As fbdev drivers also do modesetting, supporting the parameter simply unifies the behavior.

Quoted 36 lines
Quoted 11 lines

The same effect
could be achieved with per-driver options, but the importance of the graphics output for many users makes a single, unified approach worthwhile.

With nomodeset specified, the fbdev driver module will not load. This unifies behavior with similar DRM drivers. In DRM helpers, modules first check the nomodeset parameter before registering the PCI driver. As fbdev has no such module helpers, we have to modify each driver individually.

Ok.

Quoted 10 lines

The name 'nomodeset' is slightly misleading, but has been chosen for historical reasons. Several drivers implemented it before it became a general option for DRM. So keeping the existing name was preferred over introducing a new one.

drivers/video/fbdev/aty/aty128fb.c +0 -0
index 57e398fe7a81c..1a26ac2865d65 100644

drivers/video/fbdev/aty/aty128fb.c static int aty128fb_init(void) · line 2510

Quoted 7 lines
drivers/video/fbdev/aty/aty128fb.c +4 -0
@@ -2503,7 +2504,12 @@ static int aty128fb_init(void)
   {
   #ifndef MODULE
       char *option = NULL;
+#endif
+
+    if (video_firmware_drivers_only())
+        return -ENODEV;

I think it makes sense to give at least some info, why a specific driver wasn't loaded, e.g. something like this kernel message:
aty128fb: Driver disabled due to "nomodeset" kernel parameter.

Quoted 3 lines

If you e.g. change the function video_firmware_drivers_only() to become video_firmware_drivers_only(const char *drivername) then you could print such a message in video_firmware_drivers_only()

Well, we do have such a message in disable_modeset() already. [1]

[1] https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/drm_nomodeset.c#L18

Quoted 3 lines

And I don't like very much the name of function video_firmware_drivers_only(), but don't have any other better idea right now either...

It's part of the 'video' module, hence the prefix. The 'nomodeset' option used to be implemented in several DRM drivers. It's an awful name, but we didn't want to remove it or introduce a new one for the same feature. So we kept nomodeset for all of DRM. Then we started bikeshedding the function name that returns the setting. And firmware-drivers-only is the best description of what is happening here. So that's how the name happend.

Best regards
Thomas

Quoted 2 lines

Helge

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
maintainer
#8 lore raw

Re: [PATCH 2/2] fbdev: Add support for the nomodeset kernel parameter

Quoted 19 lines · Thomas Zimmermann

Hi

Am 07.11.22 um 14:57 schrieb Helge Deller:

Quoted 10 lines · Thomas Zimmermann
Quoted 6 lines

Support the kernel's nomodeset parameter for all PCI-based fbdev drivers that use aperture helpers to remove other, hardware-agnostic graphics drivers.

The parameter is a simple way of using the firmware-provided scanout buffer if the hardware's native driver is broken.

Nah... it's probably not broken, but you want it disabled in order to use the DRM driver instead?

No, it's really for broken native drivers or any kind of problematic modesetting. Most DRM drivers already respect the nomodeset option and won't load when given. All you'd get are the generic drivers, such as simpledrm, efifb or simplefb.

Quoted 8 lines

There are better options of configuring video output on the kernel command line. But as graphics output is such a fundamental feature to using a computer, we found that a simple and easy option to workaround erroneous systems would benefit DRM users; hence the nomodeset parameter.

As fbdev drivers also do modesetting, supporting the parameter simply unifies the behavior.

Ok.

Quoted 35 lines
Quoted 35 lines
Quoted 10 lines

The same effect
could be achieved with per-driver options, but the importance of the graphics output for many users makes a single, unified approach worthwhile.

With nomodeset specified, the fbdev driver module will not load. This unifies behavior with similar DRM drivers. In DRM helpers, modules first check the nomodeset parameter before registering the PCI driver. As fbdev has no such module helpers, we have to modify each driver individually.

Ok.

Quoted 10 lines

The name 'nomodeset' is slightly misleading, but has been chosen for historical reasons. Several drivers implemented it before it became a general option for DRM. So keeping the existing name was preferred over introducing a new one.

drivers/video/fbdev/aty/aty128fb.c +0 -0
index 57e398fe7a81c..1a26ac2865d65 100644

drivers/video/fbdev/aty/aty128fb.c static int aty128fb_init(void) · line 2510

Quoted 7 lines
drivers/video/fbdev/aty/aty128fb.c +4 -0
@@ -2503,7 +2504,12 @@ static int aty128fb_init(void)
   {
   #ifndef MODULE
       char *option = NULL;
+#endif
+
+    if (video_firmware_drivers_only())
+        return -ENODEV;

I think it makes sense to give at least some info, why a specific driver wasn't loaded, e.g. something like this kernel message:
aty128fb: Driver disabled due to "nomodeset" kernel parameter.

Quoted 6 lines
Quoted 3 lines

If you e.g. change the function video_firmware_drivers_only() to become video_firmware_drivers_only(const char *drivername) then you could print such a message in video_firmware_drivers_only()

Well, we do have such a message in disable_modeset() already. [1]
[1] https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/drm_nomodeset.c#L18

Yes, I saw it, but that message quite generic.
If for example my atyfb doesn't show up, I would grep dmesg for "aty" and not "nomodeset"...

Quoted 10 lines
Quoted 2 lines

And I don't like very much the name of function video_firmware_drivers_only(), but don't have any other better idea right now either...

It's part of the 'video' module, hence the prefix. The 'nomodeset' option used to be implemented in several DRM drivers. It's an awful name, but we didn't want to remove it or introduce a new one for the same feature. So we kept nomodeset for all of DRM. Then we started bikeshedding the function name that returns the setting. And firmware-drivers-only is the best description of what is happening here. So that's how the name happend.

video_modesetting_disabled() ?
(Just an idea)

Helge

author maintainer
#9 lore raw

Re: [PATCH 2/2] fbdev: Add support for the nomodeset kernel parameter

Hi

Am 07.11.22 um 21:46 schrieb Helge Deller:

Quoted 70 lines · Thomas Zimmermann
Quoted 19 lines

Hi

Am 07.11.22 um 14:57 schrieb Helge Deller:

Quoted 10 lines · Thomas Zimmermann
Quoted 6 lines

Support the kernel's nomodeset parameter for all PCI-based fbdev drivers that use aperture helpers to remove other, hardware-agnostic graphics drivers.

The parameter is a simple way of using the firmware-provided scanout buffer if the hardware's native driver is broken.

Nah... it's probably not broken, but you want it disabled in order to use the DRM driver instead?

No, it's really for broken native drivers or any kind of problematic modesetting. Most DRM drivers already respect the nomodeset option and won't load when given. All you'd get are the generic drivers, such as simpledrm, efifb or simplefb.

Quoted 8 lines

There are better options of configuring video output on the kernel command line.  But as graphics output is such a fundamental feature to using a computer, we found that a simple and easy option to workaround erroneous systems would benefit DRM users; hence the nomodeset parameter.

As fbdev drivers also do modesetting, supporting the parameter simply unifies the behavior.

Ok.

Quoted 39 lines
Quoted 38 lines
Quoted 10 lines

The same effect
could be achieved with per-driver options, but the importance of the graphics output for many users makes a single, unified approach worthwhile.

With nomodeset specified, the fbdev driver module will not load. This unifies behavior with similar DRM drivers. In DRM helpers, modules first check the nomodeset parameter before registering the PCI driver. As fbdev has no such module helpers, we have to modify each driver individually.

Ok.

Quoted 10 lines

The name 'nomodeset' is slightly misleading, but has been chosen for historical reasons. Several drivers implemented it before it became a general option for DRM. So keeping the existing name was preferred over introducing a new one.

drivers/video/fbdev/aty/aty128fb.c +0 -0
index 57e398fe7a81c..1a26ac2865d65 100644

drivers/video/fbdev/aty/aty128fb.c static int aty128fb_init(void) · line 2510

Quoted 7 lines
drivers/video/fbdev/aty/aty128fb.c +4 -0
@@ -2503,7 +2504,12 @@ static int aty128fb_init(void)
   {
   #ifndef MODULE
       char *option = NULL;
+#endif
+
+    if (video_firmware_drivers_only())
+        return -ENODEV;

I think it makes sense to give at least some info, why a specific driver wasn't loaded, e.g. something like this kernel message:
aty128fb: Driver disabled due to "nomodeset" kernel parameter.

If you e.g. change the function video_firmware_drivers_only() to become video_firmware_drivers_only(const char *drivername) then you could print such a message in video_firmware_drivers_only()

Quoted 6 lines
Quoted 2 lines

Well, we do have such a message in disable_modeset() already. [1]
[1] https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/drm_nomodeset.c#L18

Yes, I saw it, but that message quite generic.
If for example my atyfb doesn't show up, I would grep dmesg for "aty" and not "nomodeset"...

I'd like to add this to fbdev or the drivers instead of the video helper. On the DRM side, it works a a bit different and I think I have a use case for the function that does not directly involve disabling drivers. See below for a proposal.

Quoted 13 lines
Quoted 5 lines
Quoted 4 lines

And I don't like very much the name of function video_firmware_drivers_only(), but don't have any other better idea right now either...

Quoted 7 lines

It's part of the 'video' module, hence the prefix. The 'nomodeset' option used to be implemented in several DRM drivers. It's an awful name, but we didn't want to remove it or introduce a new one for the same feature. So we kept nomodeset for all of DRM.  Then we started bikeshedding the function name that returns the setting. And firmware-drivers-only is the best description of what is happening here. So that's how the name happend.

Quoted 2 lines

video_modesetting_disabled() ?
(Just an idea)

The term modesetting is misleading and we had this problem with 'nomodeset' already. There are still plenty of drivers with mode setting, such as the USB-based ones. It's also not so easy on the DRM side, where a modesetting operation is one of many effects of loading an atomic state. Maybe let's leave the name is for now? If we ever find the perfect name, it's a simple rename with sed.

My proposal would be to add a little helper to fbdev that includes your suggestions:

bool fb_modesetting_disabled(const char *drvname)

  {
     fwonly = video_firmware_drivers_only()
     if (fbonly && drvname)
	pr_warn("")
     return fbonly;

}

Drivers can use that for the test.

Best regards
Thomas

Quoted 2 lines

Helge

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
#10 lore raw

Re: [PATCH 2/2] fbdev: Add support for the nomodeset kernel parameter

Quoted 1 line · Thomas Zimmermann

Hi

[...]

Quoted 4 lines

My proposal would be to add a little helper to fbdev that includes your suggestions:

Quoted 8 lines
   bool fb_modesetting_disabled(const char *drvname)
   {
      fwonly = video_firmware_drivers_only()
      if (fbonly && drvname)
	pr_warn("")
      return fbonly;
   }

Agreed with this proposal.

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
maintainer
#11 lore raw

Re: [PATCH 2/2] fbdev: Add support for the nomodeset kernel parameter

Quoted 9 lines · Javier Martinez Canillas
Quoted 1 line · Thomas Zimmermann

Hi

[...]

Quoted 4 lines

My proposal would be to add a little helper to fbdev that includes your suggestions:

Quoted 7 lines
Quoted 7 lines
    bool fb_modesetting_disabled(const char *drvname)
    {
       fwonly = video_firmware_drivers_only()
       if (fbonly && drvname)
	pr_warn("")
       return fbonly;
    }

I'm still wondering why you can't simply merge it with what is printed in
[1] https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/drm_nomodeset.c#L18

Other than that, your the proposal is okay, if you adjust your patches to call this new function "fb_modesetting_disabled()" instead of calling video_firmware_drivers_only() like this:

Review

Quoted 2 lines
(quoted diff) +2 -0
+    if (video_firmware_drivers_only())
+        return -ENODEV;

Helge

author maintainer
#12 lore raw

Re: [PATCH 2/2] fbdev: Add support for the nomodeset kernel parameter

Hi

Am 11.11.22 um 11:49 schrieb Helge Deller:

Quoted 18 lines · Javier Martinez Canillas
Quoted 9 lines · Thomas Zimmermann
Quoted 1 line

Hi

[...]

Quoted 4 lines

My proposal would be to add a little helper to fbdev that includes your suggestions:

Quoted 7 lines
Quoted 7 lines

    bool fb_modesetting_disabled(const char *drvname) {
       fwonly = video_firmware_drivers_only() if (fbonly && drvname)
    pr_warn("")
       return fbonly;
    }

Quoted 3 lines

I'm still wondering why you can't simply merge it with what is printed in
 [1]
https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/drm_nomodeset.c#L18

I don't understand. That message is still there after moving the code around. It is always printed if the nomodeset parameter is given.

In addition to that, you get a per-driver warning for fbdev, so that it's clear which drivers are affected.

Best regards
Thomas

Quoted 9 lines

Other than that, your the proposal is okay, if you adjust your patches to call this new function "fb_modesetting_disabled()" instead of calling video_firmware_drivers_only() like this:

Quoted 2 lines

+    if (video_firmware_drivers_only())
+        return -ENODEV;

Helge

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
maintainer
#13 lore raw

Re: [PATCH 2/2] fbdev: Add support for the nomodeset kernel parameter

Quoted 21 lines · Thomas Zimmermann

Hi

Am 11.11.22 um 11:49 schrieb Helge Deller:

Quoted 18 lines · Javier Martinez Canillas
Quoted 16 lines · Thomas Zimmermann
Quoted 1 line

Hi

[...]

Quoted 11 lines

My proposal would be to add a little helper to fbdev that includes your suggestions:

    bool fb_modesetting_disabled(const char *drvname) {
       fwonly = video_firmware_drivers_only() if (fbonly && drvname)
    pr_warn("")
       return fbonly;
    }

Quoted 5 lines
Quoted 2 lines

I'm still wondering why you can't simply merge it with what is printed in
  [1] https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/drm_nomodeset.c#L18

I don't understand. That message is still there after moving the code around.

Sure.

Quoted 1 line

It is always printed if the nomodeset parameter is given.

Yes, but wouldn't it be better if it would print the name of the really affected DRM driver too? Currently it even shows up if you don't have any graphic card installed (and gave that parameter).

Quoted 1 line

In addition to that, you get a per-driver warning for fbdev, so that it's clear which drivers are affected.

and a per-drm-driver message would be nice too (can be added by follow-up patches).

Helge

Quoted 14 lines

Best regards
Thomas

Quoted 9 lines

Other than that, your the proposal is okay, if you adjust your patches to call this new function "fb_modesetting_disabled()" instead of calling video_firmware_drivers_only() like this:

Quoted 2 lines

+    if (video_firmware_drivers_only())
+        return -ENODEV;

Helge

maintainer Reviewed-by on v1 2/2
#14 lore raw

Re: [PATCH 2/2] fbdev: Add support for the nomodeset kernel parameter

In reply to Thomas Zimmermann
Quoted 16 lines · Thomas Zimmermann

Support the kernel's nomodeset parameter for all PCI-based fbdev drivers that use aperture helpers to remove other, hardware-agnostic graphics drivers.

The parameter is a simple way of using the firmware-provided scanout buffer if the hardware's native driver is broken. The same effect could be achieved with per-driver options, but the importance of the graphics output for many users makes a single, unified approach worthwhile.

With nomodeset specified, the fbdev driver module will not load. This unifies behavior with similar DRM drivers. In DRM helpers, modules first check the nomodeset parameter before registering the PCI driver. As fbdev has no such module helpers, we have to modify each driver individually.

Quoted 7 lines

The name 'nomodeset' is slightly misleading, but has been chosen for historical reasons. Several drivers implemented it before it became a general option for DRM. So keeping the existing name was preferred over introducing a new one.

---

Agreed that makes sense to have this in fbdev as well for consistency.

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat