summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2026-07-09 11:16:01 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2026-09-11 16:52:43 +0200
commit0fbd06de08c18e37af0b20fc37be1fe108f1b881 (patch)
tree8460cb09c6ee517abd9d8fb78b24457cfe306744 /drivers/gpu/drm/nouveau
parent649e96efe2caadb438c980459011a7f77e4d4959 (diff)
drm: Implement struct vga_switcheroo_client_ops.pre_switch
Call drm_client_dev_acquire_outputs() from vga_switcheroo's pre_switch callback. Pushes fbcon updates from vga_switcheroo into DRM's fbdev emulation. This affects amdgpu, i915, nouveau and radeon. No other drivers implement vga_switcheroo. Also remove the calls to vga_switcheroo_client_fb_set() from fbcon. It is called from the DRM client's hotplug and sets the fbcon's framebuffer at vga_switcheroo. Running pre_switch and hotplug concurrently could result in a deadlock between clientlist_mutex and vgasr_mutex. Hence clean up fbcon here as well. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Lyude Paul <lyude@redhat.com> # nouveau Acked-by: Maxime Ripard <mripard@kernel.org> Acked-by: Helge Deller <deller@gmx.de> Link: https://patch.msgid.link/20260709092215.168172-6-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_vga.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_vga.c b/drivers/gpu/drm/nouveau/nouveau_vga.c
index a6c375a24154..2d2d08be8fbe 100644
--- a/drivers/gpu/drm/nouveau/nouveau_vga.c
+++ b/drivers/gpu/drm/nouveau/nouveau_vga.c
@@ -76,11 +76,20 @@ nouveau_switcheroo_can_switch(struct pci_dev *pdev)
return atomic_read(&drm->dev->open_count) == 0;
}
+static void
+nouveau_switcheroo_pre_switch(struct pci_dev *pdev)
+{
+ struct nouveau_drm *drm = pci_get_drvdata(pdev);
+
+ drm_client_dev_acquire_outputs(drm->dev);
+}
+
static const struct vga_switcheroo_client_ops
nouveau_switcheroo_ops = {
.set_gpu_state = nouveau_switcheroo_set_state,
.reprobe = nouveau_switcheroo_reprobe,
.can_switch = nouveau_switcheroo_can_switch,
+ .pre_switch = nouveau_switcheroo_pre_switch,
};
void