summaryrefslogtreecommitdiff
path: root/include/linux/fb.h
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2022-11-11 14:30:24 +0100
committerThomas Zimmermann <tzimmermann@suse.de>2022-11-16 13:26:25 +0100
commit0ba2fa8cbd29278a180ac90bd66b2c0bbdeacc89 (patch)
tree048750c67099f42c7ae500ddbc22cdf51ba433d9 /include/linux/fb.h
parent9a758d8756daab5b8fda006e131c066336b16a32 (diff)
fbdev: Add support for the nomodeset kernel parameter
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
Diffstat (limited to 'include/linux/fb.h')
-rw-r--r--include/linux/fb.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 731fad5e39fa..8dc9635f5bc1 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -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__)