Hi Geert

Am 25.05.26 um 11:31 schrieb Geert Uytterhoeven:
Hi Thomas,

On Fri, 22 May 2026 at 15:11, Thomas Zimmermann <[email protected]> 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 <[email protected]>
Thanks for your patch, which is now commit 91458b3f2a84bc7b ("fbdev:
Wrap fbcon updates from vga-switcheroo in helper") in fbdev/for-next.

--- 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.

Good point. Fbcon is currently linked into fb.ko, which is build with CONFIG_FB.  Kconfig covers this dependency at [1]. For now, I think we could make it 'depends on FB=y'.  As I mentioned elsewhere, this fb-related logic is only relevant for DRM and supposed to be moved there soon.  That will also resolve any such config issues.

Let me prepare an update for this.

Best regards
Thomas

[1] https://elixir.bootlin.com/linux/v7.0.9/source/drivers/gpu/vga/Kconfig#L7


         mutex_lock(&vgasr_priv.mux_hw_lock);
         ret = vgasr_priv.handler->switchto(new_client->id);
Gr{oetje,eeting}s,

                         Geert


--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)



Reply via email to