Re: [PATCH v2 2/9] ALSA: hda/i915: Allow override of gpu binding.

From: Takashi Iwai
Date: Tue Jul 25 2023 - 08:19:28 EST


On Tue, 25 Jul 2023 13:52:32 +0200,
Pierre-Louis Bossart wrote:
>
>
> >>>> @@ -121,6 +128,9 @@ static int i915_gfx_present(struct pci_dev
> >>>> *hdac_pci)
> >>>>   {
> >>>>       struct pci_dev *display_dev = NULL;
> >>>>   +    if (!gpu_bind || (gpu_bind < 0 &&
> >>>> video_firmware_drivers_only()))
> >>>> +        return false;
> >>
> >>
> >> Bear with me since I am just going back to work mode but I can't figure
> >> out what the second part of the test does
> >>
> >> bool video_firmware_drivers_only(void)
> >> {
> >>     return video_nomodeset;
> >> }
> >> EXPORT_SYMBOL(video_firmware_drivers_only);
> >>
> >> and video_nomodeset=1 by default, so why would we return false when
> >> gpu_bind = -1?
> >>
> >> This seems to be a change of functionality, what am I missing?
> > video_nomodeset is 0 by default, only when nomodeset is given as
> > argument is it set to 1. :-)
>
>
> I must be missing something on how the default is handled.
>
> bool video_firmware_drivers_only(void)
> {
> return video_nomodeset;
> }
> EXPORT_SYMBOL(video_firmware_drivers_only);
>
> static int __init disable_modeset(char *str)
> {
> video_nomodeset = true;
>
> isn't default 'true' then?

disable_modeset() is called *only* when nomodeset boot option is
given. Then it overrides the value to true.


Takashi