Re: [PATCH 00/60] drm: Make all drivers to honour the nomodeset parameter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/16/21 01:24, Laurent Pinchart wrote:
> Hi Javier,
> 
> On Thu, Dec 16, 2021 at 01:13:56AM +0100, Javier Martinez Canillas wrote:
>> Hello Laurent,
>>
>> On 12/16/21 00:35, Laurent Pinchart wrote:
>>
>> [snip]
>>
>>>>
>>>> I've built tested with 'make allmodconfig && make M=drivers/gpu/drm/', but
>>>> only booted in a few devices with and without nomodeset in the cmdline. So
>>>> testing and reviewing for all the drivers would be highly appreciated.
>>>
>>> The fact that the series is so big makes me think it would be better to
>>> handle this in the DRM core. Is there any way we could do so ? Otherwise
>>> we'll chase this issue forever in new drivers, and will be plagued with
>>> cargo cult problems.
>>>
>>
>> Yes, what Thomas suggested is to add a set of drm_module_{pci,platform}_driver()
>> macros in include/drm/drm_drv.h, that will just check whether the driver should
>> be registered or not and call the {pci,platform}_register_driver() functions.
>>
>> That way the change in the drivers would just be something like the following:
>>
>> -module_platform_driver(malidp_platform_driver);
>> +drm_module_platform_driver(malidp_platform_driver);
>>
>> There are some drivers that still need a custom module init functions for various
>> reasons (e.g: register a set of devices/drivers, need to be a late init call, etc)
>> but at least for most drivers this should be handled transparently as long as they
>> use these drm_*_register_driver() macros.
> 
> Another option could be to return an error from drm_dev_alloc(). That
> may avoid changes in the drivers.
>

That was actually the first approach I proposed but was told that it wouldn't work
for two reasons:

1) Usually that's called in the driver's probe function and the goal was to make it
   fail as early as possible if nomodeset is present, so that means it is desirable
   for this to be in the module init function (and is how most drivers implement).

2) Not all KMS drivers should fail if nomodeset is used. For example the simpledrm
   driver still needs to be registered and probed since is what users would want
   as a fallback / troubleshooting option if their native driver doesn't work.
 
Solving (2) is easy since we could just add a new .driver_features flag to indicate
that the driver should not fail if nomodeset is present. That way only the drivers
that are the exception would need to be modified.

But (1) is more tricky since this may be  DRM driver maintainers preference.

Best regards,
-- 
Javier Martinez Canillas
Linux Engineering
Red Hat




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux