fbdev: Add support for the nomodeset kernel parameter
authorThomas Zimmermann <tzimmermann@suse.de>
Fri, 11 Nov 2022 13:30:24 +0000 (14:30 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Wed, 16 Nov 2022 12:26:25 +0000 (13:26 +0100)
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.

v2:
* print a warning if a driver does not init (Helge)
* wrap video_firmware_drivers_only() in helper

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221111133024.9897-3-tzimmermann@suse.de
47 files changed:
drivers/staging/sm750fb/Kconfig
drivers/staging/sm750fb/sm750.c
drivers/video/fbdev/Kconfig
drivers/video/fbdev/arkfb.c
drivers/video/fbdev/asiliantfb.c
drivers/video/fbdev/aty/aty128fb.c
drivers/video/fbdev/aty/atyfb_base.c
drivers/video/fbdev/aty/radeon_base.c
drivers/video/fbdev/carminefb.c
drivers/video/fbdev/chipsfb.c
drivers/video/fbdev/cirrusfb.c
drivers/video/fbdev/core/fbmem.c
drivers/video/fbdev/cyber2000fb.c
drivers/video/fbdev/geode/Kconfig
drivers/video/fbdev/geode/gx1fb_core.c
drivers/video/fbdev/geode/gxfb_core.c
drivers/video/fbdev/geode/lxfb_core.c
drivers/video/fbdev/gxt4500.c
drivers/video/fbdev/hyperv_fb.c
drivers/video/fbdev/i740fb.c
drivers/video/fbdev/i810/i810_main.c
drivers/video/fbdev/imsttfb.c
drivers/video/fbdev/intelfb/intelfbdrv.c
drivers/video/fbdev/kyro/fbdev.c
drivers/video/fbdev/matrox/matroxfb_base.c
drivers/video/fbdev/mb862xx/mb862xxfbdrv.c
drivers/video/fbdev/neofb.c
drivers/video/fbdev/nvidia/nvidia.c
drivers/video/fbdev/pm2fb.c
drivers/video/fbdev/pm3fb.c
drivers/video/fbdev/pvr2fb.c
drivers/video/fbdev/riva/fbdev.c
drivers/video/fbdev/s3fb.c
drivers/video/fbdev/savage/savagefb_driver.c
drivers/video/fbdev/sis/sis_main.c
drivers/video/fbdev/skeletonfb.c
drivers/video/fbdev/sm712fb.c
drivers/video/fbdev/sstfb.c
drivers/video/fbdev/sunxvr2500.c
drivers/video/fbdev/sunxvr500.c
drivers/video/fbdev/tdfxfb.c
drivers/video/fbdev/tgafb.c
drivers/video/fbdev/tridentfb.c
drivers/video/fbdev/vermilion/vermilion.c
drivers/video/fbdev/via/via-core.c
drivers/video/fbdev/vt8623fb.c
include/linux/fb.h

index 8c0d8a873d5b0c7921e067bd871dc1f7812896bc..acb6c08d09dce7bfe2626ecd67a66c30fe4cf911 100644 (file)
@@ -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.
index 168ae2e9005d7606e31dfec4c28983ab88dd8ecd..effc7fcc3703fe25074cbea6545f7f51f9704e4c 100644 (file)
@@ -1168,6 +1168,9 @@ static int __init lynxfb_init(void)
 {
        char *option;
 
+       if (fb_modesetting_disabled("sm750fb"))
+               return -ENODEV;
+
 #ifdef MODULE
        option = g_option;
 #else
index a98987aa278467234a2ee8e7da521355fa604065..71019b167f8b0db6c49d1eb1048d9ebbb9430182 100644 (file)
@@ -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.
index 5f8fec9e5fd4da339d3788ad7a2fd22a4e74f6bb..60a96fdb5dd8e8f1c2ad2e8f08f5925696a39894 100644 (file)
@@ -1187,7 +1187,12 @@ static int __init arkfb_init(void)
 
 #ifndef MODULE
        char *option = NULL;
+#endif
+
+       if (fb_modesetting_disabled("arkfb"))
+               return -ENODEV;
 
+#ifndef MODULE
        if (fb_get_options("arkfb", &option))
                return -ENODEV;
 
index 3818437a8f6917e8f17538d04c21270cdbd6aca5..8383468f5577549cf15e7eae816ce4c7a227c50e 100644 (file)
@@ -616,6 +616,9 @@ static struct pci_driver asiliantfb_driver = {
 
 static int __init asiliantfb_init(void)
 {
+       if (fb_modesetting_disabled("asiliantfb"))
+               return -ENODEV;
+
        if (fb_get_options("asiliantfb", NULL))
                return -ENODEV;
 
index 57e398fe7a81c2ab22d955705bd275f083463f6f..dd31b9d7d337cc41fb61e9b14a6a65f663be1c4f 100644 (file)
@@ -2503,7 +2503,12 @@ static int aty128fb_init(void)
 {
 #ifndef MODULE
        char *option = NULL;
+#endif
+
+       if (fb_modesetting_disabled("aty128fb"))
+               return -ENODEV;
 
+#ifndef MODULE
        if (fb_get_options("aty128fb", &option))
                return -ENODEV;
        aty128fb_setup(option);
index b3463d137152015aacaa94032d3eab5207589e9f..0ccf5d401ecbccb239b039991ae94188a5f507fb 100644 (file)
@@ -3965,7 +3965,12 @@ static int __init atyfb_init(void)
        int err1 = 1, err2 = 1;
 #ifndef MODULE
        char *option = NULL;
+#endif
+
+       if (fb_modesetting_disabled("atyfb"))
+               return -ENODEV;
 
+#ifndef MODULE
        if (fb_get_options("atyfb", &option))
                return -ENODEV;
        atyfb_setup(option);
index 8b28c9bddd974301597565bbd977ce1ef7280d54..657064227de848bc08f1f904864d13d133c7cf19 100644 (file)
@@ -2607,7 +2607,12 @@ static int __init radeonfb_init (void)
 {
 #ifndef MODULE
        char *option = NULL;
+#endif
+
+       if (fb_modesetting_disabled("radeonfb"))
+               return -ENODEV;
 
+#ifndef MODULE
        if (fb_get_options("radeonfb", &option))
                return -ENODEV;
        radeonfb_setup(option);
index 4651b48a87f9396a2de3a986928dc2b0fea4a422..4ae21dbdb8caac2638fc2e2c68ce4b8651dc171e 100644 (file)
@@ -773,6 +773,9 @@ static struct pci_driver carmine_pci_driver = {
 
 static int __init carminefb_init(void)
 {
+       if (fb_modesetting_disabled("carminefb"))
+               return -ENODEV;
+
        if (!(fb_displays &
                (CARMINE_USE_DISPLAY0 | CARMINE_USE_DISPLAY1))) {
                printk(KERN_ERR "If you disable both displays than you don't "
index f1c1c95c1fdf05e52b70075a18f4ed253cbe8d4c..cc37ec3f8fc1f466af20402ff1254f1e780fcaff 100644 (file)
@@ -506,6 +506,9 @@ static struct pci_driver chipsfb_driver = {
 
 int __init chips_init(void)
 {
+       if (fb_modesetting_disabled("chipsfb"))
+               return -ENODEV;
+
        if (fb_get_options("chipsfb", NULL))
                return -ENODEV;
 
index b08bee43779ae074379bdcdaa3e3b7815d152dff..ba45e2147c52af6ed505ac0c70af662ce374ae06 100644 (file)
@@ -2359,7 +2359,12 @@ static int __init cirrusfb_init(void)
 
 #ifndef MODULE
        char *option = NULL;
+#endif
+
+       if (fb_modesetting_disabled("cirrusfb"))
+               return -ENODEV;
 
+#ifndef MODULE
        if (fb_get_options("cirrusfb", &option))
                return -ENODEV;
        cirrusfb_setup(option);
index 1e70d8c6765337b9b8ad99676fc61d9edc180cc8..3a6c8458eb8d5349c84230f4a9b8e30b5a20882a 100644 (file)
@@ -40,6 +40,7 @@
 
 #include <asm/fb.h>
 
+#include <video/nomodeset.h>
 #include <video/vga.h>
 
     /*
@@ -1844,4 +1845,18 @@ int fb_new_modelist(struct fb_info *info)
        return 0;
 }
 
+#if defined(CONFIG_VIDEO_NOMODESET)
+bool fb_modesetting_disabled(const char *drvname)
+{
+       bool fwonly = video_firmware_drivers_only();
+
+       if (fwonly)
+               pr_warn("Driver %s not loading because of nomodeset parameter\n",
+                       drvname);
+
+       return fwonly;
+}
+EXPORT_SYMBOL(fb_modesetting_disabled);
+#endif
+
 MODULE_LICENSE("GPL");
index 585af90a68a5f1c0f06c9101f0bcddf6938bc1ff..f005db54371f814f22fd21135b36bd5d18fa7139 100644 (file)
@@ -48,7 +48,6 @@
 #include <linux/i2c.h>
 #include <linux/i2c-algo-bit.h>
 
-
 #ifdef __arm__
 #include <asm/mach-types.h>
 #endif
@@ -1876,7 +1875,12 @@ static int __init cyber2000fb_init(void)
 
 #ifndef MODULE
        char *option = NULL;
+#endif
 
+       if (fb_modesetting_disabled("CyberPro"))
+               return -ENODEV;
+
+#ifndef MODULE
        if (fb_get_options("cyber2000fb", &option))
                return -ENODEV;
        cyber2000fb_setup(option);
index ac9c860592aaf5ac2780862d5a3edbc14b53b16f..2f8f0fb1dae2fec454f6e27e51119bfd4f4bd8c6 100644 (file)
@@ -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.
index 1514c653a84fb30de0bb730f4560edcd12cdce35..9c942001ac10359496cce6168ef2af526c88675a 100644 (file)
@@ -446,7 +446,12 @@ static int __init gx1fb_init(void)
 {
 #ifndef MODULE
        char *option = NULL;
+#endif
+
+       if (fb_modesetting_disabled("gx1fb"))
+               return -ENODEV;
 
+#ifndef MODULE
        if (fb_get_options("gx1fb", &option))
                return -ENODEV;
        gx1fb_setup(option);
index 2527bd80ec5f537e704742f69f2836bb0d9c512a..8e05e76de0759d47461864dfd55ee04564b7f40d 100644 (file)
@@ -511,7 +511,12 @@ static int __init gxfb_init(void)
 {
 #ifndef MODULE
        char *option = NULL;
+#endif
+
+       if (fb_modesetting_disabled("gxfb"))
+               return -ENODEV;
 
+#ifndef MODULE
        if (fb_get_options("gxfb", &option))
                return -ENODEV;
 
index 9d26592dbfce9aaf06b54d2cf22f455fc2694b50..8130e9eee2b4b4151a202358d0ce9d69964530de 100644 (file)
@@ -647,7 +647,12 @@ static int __init lxfb_init(void)
 {
 #ifndef MODULE
        char *option = NULL;
+#endif
+
+       if (fb_modesetting_disabled("lxfb"))
+               return -ENODEV;
 
+#ifndef MODULE
        if (fb_get_options("lxfb", &option))
                return -ENODEV;
 
index 0dcef4bec8d7cd871098ed1cbdd784e11df9a59b..5f42d3d9d6cef66301252a302bc07a59040d3166 100644 (file)
@@ -779,6 +779,9 @@ static struct pci_driver gxt4500_driver = {
 
 static int gxt4500_init(void)
 {
+       if (fb_modesetting_disabled("gxt4500"))
+               return -ENODEV;
+
 #ifndef MODULE
        if (fb_get_options("gxt4500", &mode_option))
                return -ENODEV;
index 072ce07ba9e0586506fe4914d01cd81d511f804a..d8edb5635f773bab8fe3eda292d11b75bc7e1507 100644 (file)
@@ -59,7 +59,6 @@
 
 #include <linux/hyperv.h>
 
-
 /* Hyper-V Synthetic Video Protocol definitions and structures */
 #define MAX_VMBUS_PKT_SIZE 0x4000
 
@@ -1363,6 +1362,9 @@ static int __init hvfb_drv_init(void)
 {
        int ret;
 
+       if (fb_modesetting_disabled("hyper_fb"))
+               return -ENODEV;
+
        ret = vmbus_driver_register(&hvfb_drv);
        if (ret != 0)
                return ret;
index b795f6503cb671466d97bdc9e2470e261fb06695..3860b137b86a929089ee22586e2d1a589befc23e 100644 (file)
@@ -1285,7 +1285,12 @@ static int __init i740fb_init(void)
 {
 #ifndef MODULE
        char *option = NULL;
+#endif
+
+       if (fb_modesetting_disabled("i740fb"))
+               return -ENODEV;
 
+#ifndef MODULE
        if (fb_get_options("i740fb", &option))
                return -ENODEV;
        i740fb_setup(option);
index ff09f8c20bfcbaafac8d0a233537b608d8742f11..85abb65f07d7ddd5a49be5519aa58c33ef47e7cd 100644 (file)
@@ -2143,6 +2143,9 @@ static int i810fb_init(void)
 {
        char *option = NULL;
 
+       if (fb_modesetting_disabled("i810fb"))
+               return -ENODEV;
+
        if (fb_get_options("i810fb", &option))
                return -ENODEV;
        i810fb_setup(option);
@@ -2159,6 +2162,9 @@ static int i810fb_init(void)
 
 static int i810fb_init(void)
 {
+       if (fb_modesetting_disabled("i810fb"))
+               return -ENODEV;
+
        hsync1 *= 1000;
        hsync2 *= 1000;
 
index d7edb9c5d3a3feb0e176f2e05bd11d45bab10c36..bea45647184e1539d13015ed06680725752386cb 100644 (file)
@@ -1617,7 +1617,12 @@ static int __init imsttfb_init(void)
 {
 #ifndef MODULE
        char *option = NULL;
+#endif
+
+       if (fb_modesetting_disabled("imsttfb"))
+               return -ENODEV;
 
+#ifndef MODULE
        if (fb_get_options("imsttfb", &option))
                return -ENODEV;
 
index d4a2891a9a7acee21a3563529198e67961d1436c..0a9e5067b201083be2b74654b7c60ea89b575d43 100644 (file)
@@ -389,6 +389,9 @@ static int __init intelfb_init(void)
        if (idonly)
                return -ENODEV;
 
+       if (fb_modesetting_disabled("intelfb"))
+               return -ENODEV;
+
 #ifndef MODULE
        if (fb_get_options("intelfb", &option))
                return -ENODEV;
index b4b93054c5208fa4fda85d8202f54fb87006048b..0596573ef14007da38951c34653b5599cae21f9e 100644 (file)
@@ -789,7 +789,12 @@ static int __init kyrofb_init(void)
 {
 #ifndef MODULE
        char *option = NULL;
+#endif
+
+       if (fb_modesetting_disabled("kyrofb"))
+               return -ENODEV;
 
+#ifndef MODULE
        if (fb_get_options("kyrofb", &option))
                return -ENODEV;
        kyrofb_setup(option);
index 775d34115e2dfdd59f76acbc34322e0cd700861e..0d3cee7ae7268c61f444dd8bf2f5401983e38a77 100644 (file)
@@ -2314,6 +2314,9 @@ static void __init matroxfb_init_params(void) {
 static int __init matrox_init(void) {
        int err;
 
+       if (fb_modesetting_disabled("matroxfb"))
+               return -ENODEV;
+
        matroxfb_init_params();
        err = pci_register_driver(&matroxfb_driver);
        dev = -1;       /* accept all new devices... */
index 90c79e8c11570399b2fdaa5cbf1298d57a3601fd..a236fc9101484f48c0de9b09e87f8efa87d21a95 100644 (file)
@@ -1181,6 +1181,9 @@ static int mb862xxfb_init(void)
 {
        int ret = -ENODEV;
 
+       if (fb_modesetting_disabled(DRV_NAME))
+               return -ENODEV;
+
 #if defined(CONFIG_FB_MB862XX_LIME)
        ret = platform_driver_register(&of_platform_mb862xxfb_driver);
 #endif
index 93a2d2d1abe8f620a57f55e43ec8f3a71dec52ca..39d8cdef5c97ac99a2254fda7b5fbba719a80a4b 100644 (file)
@@ -2209,7 +2209,12 @@ static int __init neofb_init(void)
 {
 #ifndef MODULE
        char *option = NULL;
+#endif
+
+       if (fb_modesetting_disabled("neofb"))
+               return -ENODEV;
 
+#ifndef MODULE
        if (fb_get_options("neofb", &option))
                return -ENODEV;
        neofb_setup(option);
index 329e2e8133c6937095ff75fbf22d60d893828a2d..1960916098d4642f956bbcccc5192b03971e5b2e 100644 (file)
@@ -1521,7 +1521,12 @@ static int nvidiafb_init(void)
 {
 #ifndef MODULE
        char *option = NULL;
+#endif
+
+       if (fb_modesetting_disabled("nvidiafb"))
+               return -ENODEV;
 
+#ifndef MODULE
        if (fb_get_options("nvidiafb", &option))
                return -ENODEV;
        nvidiafb_setup(option);
index 7da715d31a933b8a2b97a0b643d909a9a4e6abb4..0823c9de859a076b649f756c743424bc2f84d9de 100644 (file)
@@ -1799,7 +1799,12 @@ static int __init pm2fb_init(void)
 {
 #ifndef MODULE
        char *option = NULL;
+#endif
+
+       if (fb_modesetting_disabled("pm2fb"))
+               return -ENODEV;
 
+#ifndef MODULE
        if (fb_get_options("pm2fb", &option))
                return -ENODEV;
        pm2fb_setup(option);
index ba69846d444f532c700b2732ad665e9dfa210b0d..b46a471df9ae800869e286a872ee43dda1f6dd5d 100644 (file)
@@ -1540,7 +1540,12 @@ static int __init pm3fb_init(void)
         */
 #ifndef MODULE
        char *option = NULL;
+#endif
+
+       if (fb_modesetting_disabled("pm3fb"))
+               return -ENODEV;
 
+#ifndef MODULE
        if (fb_get_options("pm3fb", &option))
                return -ENODEV;
        pm3fb_setup(option);
index b73ad14efa201c0b6d6f648194f712f85c431bde..6888127a5eb8859437432abdf43cfbf936cfd1ff 100644 (file)
@@ -1082,7 +1082,12 @@ static int __init pvr2fb_init(void)
 
 #ifndef MODULE
        char *option = NULL;
+#endif
+
+       if (fb_modesetting_disabled("pvr2fb"))
+               return -ENODEV;
 
+#ifndef MODULE
        if (fb_get_options("pvr2fb", &option))
                return -ENODEV;
        pvr2fb_setup(option);
index 0ea74e28f9152e528fa42c22b0183e6e4e3e2245..644278146d3b7143add567f37521ea945dd252d6 100644 (file)
@@ -2165,7 +2165,12 @@ static int rivafb_init(void)
 {
 #ifndef MODULE
        char *option = NULL;
+#endif
+
+       if (fb_modesetting_disabled("rivafb"))
+               return -ENODEV;
 
+#ifndef MODULE
        if (fb_get_options("rivafb", &option))
                return -ENODEV;
        rivafb_setup(option);
index 7713274bd04c22a53141ff999579b471987e9844..7d257489edcc284b60df5210b0cb7e01e844183e 100644 (file)
@@ -1558,7 +1558,12 @@ static int __init s3fb_init(void)
 
 #ifndef MODULE
        char *option = NULL;
+#endif
+
+       if (fb_modesetting_disabled("s3fb"))
+               return -ENODEV;
 
+#ifndef MODULE
        if (fb_get_options("s3fb", &option))
                return -ENODEV;
        s3fb_setup(option);
index b7818b652698f079ba2500fd963bb9c89efbd7ab..4a27b68798bf5831655d4b82f7f4e7ff309d8180 100644 (file)
@@ -2556,6 +2556,9 @@ static int __init savagefb_init(void)
 
        DBG("savagefb_init");
 
+       if (fb_modesetting_disabled("savagefb"))
+               return -ENODEV;
+
        if (fb_get_options("savagefb", &option))
                return -ENODEV;
 
index 1c197c3f95381e531d45209419f72aa172e172c8..cfba776afcea6d7a3ee464f34d32c4d61f95314e 100644 (file)
@@ -6588,7 +6588,12 @@ static int __init sisfb_init(void)
 {
 #ifndef MODULE
        char *options = NULL;
+#endif
+
+       if (fb_modesetting_disabled("sisfb"))
+               return -ENODEV;
 
+#ifndef MODULE
        if(fb_get_options("sisfb", &options))
                return -ENODEV;
 
index a10f1057293b40d7dc30704f6521a6d283725c88..40c130ab6b38d0c0f374b3448b074aa97ed87b79 100644 (file)
@@ -987,7 +987,12 @@ static int __init xxxfb_init(void)
         */
 #ifndef MODULE
        char *option = NULL;
+#endif
+
+       if (fb_modesetting_disabled("xxxfb"))
+               return -ENODEV;
 
+#ifndef MODULE
        if (fb_get_options("xxxfb", &option))
                return -ENODEV;
        xxxfb_setup(option);
index 3baf33635e65f8ac6b013c37dd261b7680d38773..b528776c761251eb7e393ab63b1876296a5ca9e3 100644 (file)
@@ -1756,6 +1756,9 @@ static int __init sm712fb_init(void)
 {
        char *option = NULL;
 
+       if (fb_modesetting_disabled("sm712fb"))
+               return -ENODEV;
+
        if (fb_get_options("sm712fb", &option))
                return -ENODEV;
        if (option && *option)
index a56b24288566b6c19b539246cafb9d45b20130d6..da296b2ab54a3e6aa817eba859eedb2811c7a01b 100644 (file)
@@ -1503,6 +1503,9 @@ static int sstfb_init(void)
 {
        char *option = NULL;
 
+       if (fb_modesetting_disabled("sstfb"))
+               return -ENODEV;
+
        if (fb_get_options("sstfb", &option))
                return -ENODEV;
        sstfb_setup(option);
index f4059529c60249a8f669e35c805c235b97e43359..2cab4b9be68aaddcaacf1e8a76a31863fe222d93 100644 (file)
@@ -247,6 +247,9 @@ static struct pci_driver s3d_driver = {
 
 static int __init s3d_init(void)
 {
+       if (fb_modesetting_disabled("s3d"))
+               return -ENODEV;
+
        if (fb_get_options("s3d", NULL))
                return -ENODEV;
 
index b0c8cf0c535a4b8399b1df21937aab945a11655a..6ec358af125603ad55a2e488fb872af74a8aa63a 100644 (file)
@@ -430,6 +430,9 @@ static struct pci_driver e3d_driver = {
 
 static int __init e3d_init(void)
 {
+       if (fb_modesetting_disabled("e3d"))
+               return -ENODEV;
+
        if (fb_get_options("e3d", NULL))
                return -ENODEV;
 
index 592a913d07189da0a72c049500b830a66a0f7269..d17e5e1472aa6de56f58c23f49557e5be6d6728d 100644 (file)
@@ -1632,7 +1632,12 @@ static int __init tdfxfb_init(void)
 {
 #ifndef MODULE
        char *option = NULL;
+#endif
+
+       if (fb_modesetting_disabled("tdfxfb"))
+               return -ENODEV;
 
+#ifndef MODULE
        if (fb_get_options("tdfxfb", &option))
                return -ENODEV;
 
index 251dbd282f5eddeac5ddd44924a770350024e89b..14d37c49633c6b36819bda002333b4d63b199795 100644 (file)
@@ -1597,7 +1597,12 @@ static int tgafb_init(void)
        int status;
 #ifndef MODULE
        char *option = NULL;
+#endif
+
+       if (fb_modesetting_disabled("tgafb"))
+               return -ENODEV;
 
+#ifndef MODULE
        if (fb_get_options("tgafb", &option))
                return -ENODEV;
        tgafb_setup(option);
index 219ce7292337034271dc17aabf1105e2a51d2cc8..6099b9768ba16bfe8c4f00da4bd05e5348b868cd 100644 (file)
@@ -1811,7 +1811,12 @@ static int __init tridentfb_init(void)
 {
 #ifndef MODULE
        char *option = NULL;
+#endif
+
+       if (fb_modesetting_disabled("tridentfb"))
+               return -ENODEV;
 
+#ifndef MODULE
        if (fb_get_options("tridentfb", &option))
                return -ENODEV;
        tridentfb_setup(option);
index 82b36dbb5b1a93b223419ae4465383a4d0f938da..1465fb7b619e1e48ebbdf2978bc11e449de75dac 100644 (file)
@@ -1057,7 +1057,12 @@ static int __init vmlfb_init(void)
 
 #ifndef MODULE
        char *option = NULL;
+#endif
+
+       if (fb_modesetting_disabled("vmlfb"))
+               return -ENODEV;
 
+#ifndef MODULE
        if (fb_get_options(MODULE_NAME, &option))
                return -ENODEV;
 #endif
index 2ee8fcae08dfbbf3fe1dac69643ed0dc1ee88940..32a6399b080b1b111428d4c5704941d8ccce0d67 100644 (file)
@@ -725,6 +725,9 @@ static int __init via_core_init(void)
 {
        int ret;
 
+       if (fb_modesetting_disabled("viafb"))
+               return -ENODEV;
+
        ret = viafb_init();
        if (ret)
                return ret;
index 49b9f148d3a17cb611490dcbbf86c9e6b931e626..034333ee6e4558ea5af4dd1df5da3e879e898dbc 100644 (file)
@@ -920,7 +920,12 @@ static int __init vt8623fb_init(void)
 
 #ifndef MODULE
        char *option = NULL;
+#endif
+
+       if (fb_modesetting_disabled("vt8623fb"))
+               return -ENODEV;
 
+#ifndef MODULE
        if (fb_get_options("vt8623fb", &option))
                return -ENODEV;
 
index 731fad5e39fac84b1c35ffacf562bb30db6b763e..8dc9635f5bc1b84d45efe61ba13db476e16208bc 100644 (file)
@@ -804,6 +804,15 @@ extern int fb_find_mode(struct fb_var_screeninfo *var,
                        const struct fb_videomode *default_mode,
                        unsigned int default_bpp);
 
+#if defined(CONFIG_VIDEO_NOMODESET)
+bool fb_modesetting_disabled(const char *drvname);
+#else
+bool fb_modesetting_disabled(const char *drvname)
+{
+       return false;
+}
+#endif
+
 /* Convenience logging macros */
 #define fb_err(fb_info, fmt, ...)                                      \
        pr_err("fb%d: " fmt, (fb_info)->node, ##__VA_ARGS__)