drm/xe: Support 'nomodeset' kernel command-line option
authorThomas Zimmermann <tzimmermann@suse.de>
Tue, 27 Aug 2024 12:09:05 +0000 (14:09 +0200)
committerLucas De Marchi <lucas.demarchi@intel.com>
Tue, 27 Aug 2024 19:35:19 +0000 (12:35 -0700)
commit014125c64d09e58e90dde49fbb57d802a13e2559
tree632cbddb0d19cab0756d272a3a7e13883282debf
parent8a04e342684a75ad1455fc3f23fab8e67c1aa9fc
drm/xe: Support 'nomodeset' kernel command-line option

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

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

v2:
- use xe's init table (Lucas)
- do NULL test for init/exit functions

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240827121003.97429-1-tzimmermann@suse.de
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/xe/xe_module.c