[PATCH 1/8] drm/fbdev-helper: Do delayed switcheroo in lastclose helper

Thomas Zimmermann tzimmermann at suse.de
Fri Aug 9 09:28:09 UTC 2024


Hi

Am 09.08.24 um 10:44 schrieb Daniel Vetter:
> On Wed, Aug 07, 2024 at 10:41:33AM +0200, Thomas Zimmermann wrote:
>> Amdgpu and nouveau call vga_switcheroo_process_delayed_switch() from
>> their lastclose callbacks. Call it from the fbdev lastclose helper,
>> so that the driver functions can finally be removed.
>>
>> The fbdev call is part of all lastclose handling that restores the
>> DRM fbcon terminal. Only PCI devices with enabled switcheroo do the
>> delayed switching. The call has no effect on other drivers.
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
>> ---
>>   drivers/gpu/drm/drm_fb_helper.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
>> index 3f7da78849e4..f6667dfba8a2 100644
>> --- a/drivers/gpu/drm/drm_fb_helper.c
>> +++ b/drivers/gpu/drm/drm_fb_helper.c
>> @@ -2009,6 +2009,10 @@ EXPORT_SYMBOL(drm_fb_helper_hotplug_event);
>>   void drm_fb_helper_lastclose(struct drm_device *dev)
>>   {
>>   	drm_fb_helper_restore_fbdev_mode_unlocked(dev->fb_helper);
>> +
>> +	if (dev_is_pci(dev->dev))
>> +		vga_switcheroo_process_delayed_switch();
> I think if you want to move this, it needs to be in drm core. Otherwise
> the vgaswitcheroo delayed switching stops working if you disable fbdev
> support. Which doesn't make much sense.

Thanks for reviewing. This call can then go directly into 
drm_lastclose(), which will stay around.

Best regards
Thomas

> -Sima
>
>> +
>>   }
>>   EXPORT_SYMBOL(drm_fb_helper_lastclose);
>>   
>> -- 
>> 2.46.0
>>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)



More information about the dri-devel mailing list