[PATCH] drm/xe: Support 'nomodeset' kernel command-line option

Jani Nikula jani.nikula at linux.intel.com
Wed Aug 21 14:29:05 UTC 2024


On Wed, 21 Aug 2024, Gustavo Sousa <gustavo.sousa at intel.com> wrote:
> Quoting Thomas Zimmermann (2024-08-21 10:56:59-03:00)
>>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.
>>
>>Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
>>---
>> drivers/gpu/drm/xe/xe_module.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>>diff --git a/drivers/gpu/drm/xe/xe_module.c b/drivers/gpu/drm/xe/xe_module.c
>>index 923460119cec..60fb7dd26903 100644
>>--- a/drivers/gpu/drm/xe/xe_module.c
>>+++ b/drivers/gpu/drm/xe/xe_module.c
>>@@ -8,6 +8,8 @@
>> #include <linux/init.h>
>> #include <linux/module.h>
>> 
>>+#include <drm/drm_module.h>
>>+
>> #include "xe_drv.h"
>> #include "xe_hw_fence.h"
>> #include "xe_pci.h"
>>@@ -92,6 +94,9 @@ static int __init xe_init(void)
>> {
>>         int err, i;
>> 
>>+        if (drm_firmware_drivers_only())
>>+                return -ENODEV;
>>+
>
> Hm... But what if xe is to be used only for compute or render? Shouldn't
> we handle this somewhere else?

The question becomes, what does "nomodeset" really mean here?

See what i915 does in i915_module.c.

Cc: Sima.

BR,
Jani.



>
> Taking a quick look, xe_display_probe() might be a good candidate?
>
> --
> Gustavo Sousa
>
>>         for (i = 0; i < ARRAY_SIZE(init_funcs); i++) {
>>                 err = init_funcs[i].init();
>>                 if (err) {
>>-- 
>>2.46.0
>>

-- 
Jani Nikula, Intel


More information about the dri-devel mailing list