From c3c5b79b6ed1d7ae7356b51f7c17bd88197bf405 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Mon, 12 Aug 2024 10:28:22 +0200 Subject: drm: Do delayed switcheroo in drm_lastclose() Amdgpu and nouveau call vga_switcheroo_process_delayed_switch() from their lastclose callbacks. Call it from drm_lastclose(), so that the driver functions can finally be removed. Only PCI devices with enabled switcheroo do the delayed switching. The call has no effect on other hardware. v2: - move change to drm_lastclose() (Sima) - update docs for vga_switcheroo_process_delayed_switch() Signed-off-by: Thomas Zimmermann Reviewed-by: Daniel Vetter Reviewed-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20240812083000.337744-2-tzimmermann@suse.de --- drivers/gpu/drm/drm_file.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/gpu/drm/drm_file.c') diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c index 714e42b05108..513bef816ae9 100644 --- a/drivers/gpu/drm/drm_file.c +++ b/drivers/gpu/drm/drm_file.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -404,6 +405,9 @@ void drm_lastclose(struct drm_device * dev) drm_dbg_core(dev, "driver lastclose completed\n"); drm_client_dev_restore(dev); + + if (dev_is_pci(dev->dev)) + vga_switcheroo_process_delayed_switch(); } /** -- cgit v1.2.3