Re: [PATCH v2 3/4] fbdev: Wrap fbcon updates from vga-switcheroo in helper
From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2026-05-25 09:32:13
Also in:
dri-devel, linux-fbdev
Hi Thomas, On Fri, 22 May 2026 at 15:11, Thomas Zimmermann [off-list ref] wrote:
Handle console remapping in fbcon in fb_switch_output(). Vga-switcheroo invokes this functionality before switching physical outputs to a new graphics device. Open-coding fbcon state in vga-switcheroo exposed fbdev implementation details. Vga-switcheroo is used for switching physical outputs among graphics hardware. This functionality is only supported by DRM drivers. A later update will further move fb_switch_output() into DRM's fbdev emulation; thus fully decoupling vga-switcheroo from fbdev. v2: - use '#if defined' (Helge) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Thanks for your patch, which is now commit 91458b3f2a84bc7b ("fbdev:
Wrap fbcon updates from vga-switcheroo in helper") in fbdev/for-next.
quoted hunk ↗ jump to hunk
--- a/drivers/gpu/vga/vga_switcheroo.c +++ b/drivers/gpu/vga/vga_switcheroo.c@@ -31,11 +31,9 @@ #define pr_fmt(fmt) "vga_switcheroo: " fmt #include <linux/apple-gmux.h> -#include <linux/console.h> #include <linux/debugfs.h> #include <linux/fb.h> #include <linux/fs.h> -#include <linux/fbcon.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/pm_domain.h>@@ -735,8 +733,10 @@ static int vga_switchto_stage2(struct vga_switcheroo_client *new_client) if (!active->driver_power_control) set_audio_state(active->id, VGA_SWITCHEROO_OFF); +#if defined(CONFIG_FB) if (new_client->fb_info) - fbcon_remap_all(new_client->fb_info); + fb_switch_outputs(new_client->fb_info); +#endif
What if CONFIG_FB is modular? CONFIG_VGA_SWITCHEROO is bool.
mutex_lock(&vgasr_priv.mux_hw_lock);
ret = vgasr_priv.handler->switchto(new_client->id);
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds