* [PATCH 0/4] fbdev: Internalize fbcon
@ 2026-05-20 16:00 Thomas Zimmermann
2026-05-20 16:00 ` [PATCH 1/4] fbdev: Wrap user-invoked calls to fb_set_var() in helper Thomas Zimmermann
` (4 more replies)
0 siblings, 5 replies; 16+ messages in thread
From: Thomas Zimmermann @ 2026-05-20 16:00 UTC (permalink / raw)
To: deller, simona, airlied, lukas, maddy, mpe, npiggin, chleroy
Cc: dri-devel, linux-fbdev, linuxppc-dev, Thomas Zimmermann
Turn fbcon into an internal client of fbdev. Manage all interactions
with graphics drivers within fbdev. Add helpers for these tasks and
convert drivers.
Fbdev's PS3 and SH-Mobile drivers update fbcon as part of user-invoked
mode changes. Call the new helpers, which also fix inconsistencies
among the various code paths.
Vga-switcheroo remaps the fbcon terminals when switching physical
outputs. For now, hide this in another helper. The call will later
move into DRM's fbdev emulation.
When all refactoring in place, fbdev manages fbcon interactions by
itself. Remove the public interfaces.
Thomas Zimmermann (4):
fbdev: Wrap user-invoked calls to fb_set_var() in helper
fbdev: Wrap user-invoked calls to fb_blank() in helper
fbdev: Wrap fbcon updates from vga-switcheroo in helper
fbdev: Do not export fbcon from fbdev
MAINTAINERS | 1 -
drivers/gpu/vga/vga_switcheroo.c | 6 +--
drivers/video/fbdev/core/fb_chrdev.c | 12 ++----
drivers/video/fbdev/core/fb_internal.h | 1 +
drivers/video/fbdev/core/fbcon.c | 3 --
drivers/video/fbdev/core/fbcon.h | 50 +++++++++++++++++++++++
drivers/video/fbdev/core/fbmem.c | 35 +++++++++++++++-
drivers/video/fbdev/core/fbsysfs.c | 9 +----
drivers/video/fbdev/ps3fb.c | 5 +--
drivers/video/fbdev/sh_mobile_lcdcfb.c | 5 +--
include/linux/fb.h | 3 ++
include/linux/fbcon.h | 55 --------------------------
12 files changed, 98 insertions(+), 87 deletions(-)
delete mode 100644 include/linux/fbcon.h
base-commit: 121c16f9d8c56ea07263df84ab971cc10870fe88
--
2.54.0
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 1/4] fbdev: Wrap user-invoked calls to fb_set_var() in helper
2026-05-20 16:00 [PATCH 0/4] fbdev: Internalize fbcon Thomas Zimmermann
@ 2026-05-20 16:00 ` Thomas Zimmermann
2026-05-20 18:51 ` Helge Deller
2026-05-25 11:30 ` Claude review: " Claude Code Review Bot
2026-05-20 16:00 ` [PATCH 2/4] fbdev: Wrap user-invoked calls to fb_blank() " Thomas Zimmermann
` (3 subsequent siblings)
4 siblings, 2 replies; 16+ messages in thread
From: Thomas Zimmermann @ 2026-05-20 16:00 UTC (permalink / raw)
To: deller, simona, airlied, lukas, maddy, mpe, npiggin, chleroy
Cc: dri-devel, linux-fbdev, linuxppc-dev, Thomas Zimmermann
Handle fbcon during display updates in fb_set_var_from_user(). Check
with fbcon if the mode change is possible, update hardware state and
finally update fbcon. Update all callers.
Only the FBIOPUT_VSCREENINFO ioctl currently does all steps. Other
mode-changes callers in sysfs and driver code are missing fbcon-related
steps.
With the new helper, ps3fb and sh_mobile_lcdcfb no longer maintain
fbcon state themselves.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
drivers/video/fbdev/core/fb_chrdev.c | 6 +-----
drivers/video/fbdev/core/fbcon.c | 2 --
drivers/video/fbdev/core/fbmem.c | 13 +++++++++++++
drivers/video/fbdev/core/fbsysfs.c | 4 +---
drivers/video/fbdev/ps3fb.c | 5 +----
drivers/video/fbdev/sh_mobile_lcdcfb.c | 5 +----
include/linux/fb.h | 2 ++
7 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/drivers/video/fbdev/core/fb_chrdev.c b/drivers/video/fbdev/core/fb_chrdev.c
index 4ebd16b7e3b8..54f926fb411b 100644
--- a/drivers/video/fbdev/core/fb_chrdev.c
+++ b/drivers/video/fbdev/core/fb_chrdev.c
@@ -85,11 +85,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd,
var.activate &= ~FB_ACTIVATE_KD_TEXT;
console_lock();
lock_fb_info(info);
- ret = fbcon_modechange_possible(info, &var);
- if (!ret)
- ret = fb_set_var(info, &var);
- if (!ret)
- fbcon_update_vcs(info, var.activate & FB_ACTIVATE_ALL);
+ ret = fb_set_var_from_user(info, &var);
unlock_fb_info(info);
console_unlock();
if (!ret && copy_to_user(argp, &var, sizeof(var)))
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index b0e3e765360d..50b84cd32938 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -2699,7 +2699,6 @@ void fbcon_update_vcs(struct fb_info *info, bool all)
else
fbcon_modechanged(info);
}
-EXPORT_SYMBOL(fbcon_update_vcs);
/* let fbcon check if it supports a new screen resolution */
int fbcon_modechange_possible(struct fb_info *info, struct fb_var_screeninfo *var)
@@ -2727,7 +2726,6 @@ int fbcon_modechange_possible(struct fb_info *info, struct fb_var_screeninfo *va
return 0;
}
-EXPORT_SYMBOL_GPL(fbcon_modechange_possible);
int fbcon_mode_deleted(struct fb_info *info,
struct fb_videomode *mode)
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index 30f2b59c47bf..d37a1039e221 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -346,6 +346,19 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
}
EXPORT_SYMBOL(fb_set_var);
+int fb_set_var_from_user(struct fb_info *info, struct fb_var_screeninfo *var)
+{
+ int ret = fbcon_modechange_possible(info, var);
+
+ if (!ret)
+ ret = fb_set_var(info, var);
+ if (!ret)
+ fbcon_update_vcs(info, var->activate & FB_ACTIVATE_ALL);
+
+ return ret;
+}
+EXPORT_SYMBOL(fb_set_var_from_user);
+
static void fb_lcd_notify_blank(struct fb_info *info)
{
int power;
diff --git a/drivers/video/fbdev/core/fbsysfs.c b/drivers/video/fbdev/core/fbsysfs.c
index baa2bae0fb5b..5ece236e6252 100644
--- a/drivers/video/fbdev/core/fbsysfs.c
+++ b/drivers/video/fbdev/core/fbsysfs.c
@@ -19,9 +19,7 @@ static int activate(struct fb_info *fb_info, struct fb_var_screeninfo *var)
var->activate |= FB_ACTIVATE_FORCE;
console_lock();
lock_fb_info(fb_info);
- err = fb_set_var(fb_info, var);
- if (!err)
- fbcon_update_vcs(fb_info, var->activate & FB_ACTIVATE_ALL);
+ err = fb_set_var_from_user(fb_info, var);
unlock_fb_info(fb_info);
console_unlock();
if (err)
diff --git a/drivers/video/fbdev/ps3fb.c b/drivers/video/fbdev/ps3fb.c
index dbcda307f6a6..1376d19b19ae 100644
--- a/drivers/video/fbdev/ps3fb.c
+++ b/drivers/video/fbdev/ps3fb.c
@@ -29,7 +29,6 @@
#include <linux/freezer.h>
#include <linux/uaccess.h>
#include <linux/fb.h>
-#include <linux/fbcon.h>
#include <linux/init.h>
#include <asm/cell-regs.h>
@@ -830,9 +829,7 @@ static int ps3fb_ioctl(struct fb_info *info, unsigned int cmd,
/* Force, in case only special bits changed */
var.activate |= FB_ACTIVATE_FORCE;
par->new_mode_id = val;
- retval = fb_set_var(info, &var);
- if (!retval)
- fbcon_update_vcs(info, var.activate & FB_ACTIVATE_ALL);
+ retval = fb_set_var_from_user(info, &var);
console_unlock();
}
break;
diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c
index 72969fe8e513..e8324b01700f 100644
--- a/drivers/video/fbdev/sh_mobile_lcdcfb.c
+++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c
@@ -15,7 +15,6 @@
#include <linux/ctype.h>
#include <linux/dma-mapping.h>
#include <linux/delay.h>
-#include <linux/fbcon.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/ioctl.h>
@@ -1768,11 +1767,9 @@ static void sh_mobile_fb_reconfig(struct fb_info *info)
var.height = ch->display.height;
var.activate = FB_ACTIVATE_NOW;
- if (fb_set_var(info, &var) < 0)
+ if (fb_set_var_from_user(info, &var) < 0)
/* Couldn't reconfigure, hopefully, can continue as before */
return;
-
- fbcon_update_vcs(info, true);
}
/*
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 5178a33c752c..88680a7cabd5 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -533,6 +533,8 @@ extern int fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var);
extern int fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var);
extern int fb_blank(struct fb_info *info, int blank);
+int fb_set_var_from_user(struct fb_info *info, struct fb_var_screeninfo *var);
+
/*
* Helpers for framebuffers in I/O memory
*/
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 2/4] fbdev: Wrap user-invoked calls to fb_blank() in helper
2026-05-20 16:00 [PATCH 0/4] fbdev: Internalize fbcon Thomas Zimmermann
2026-05-20 16:00 ` [PATCH 1/4] fbdev: Wrap user-invoked calls to fb_set_var() in helper Thomas Zimmermann
@ 2026-05-20 16:00 ` Thomas Zimmermann
2026-05-25 11:30 ` Claude review: " Claude Code Review Bot
2026-05-20 16:00 ` [PATCH 3/4] fbdev: Wrap fbcon updates from vga-switcheroo " Thomas Zimmermann
` (2 subsequent siblings)
4 siblings, 1 reply; 16+ messages in thread
From: Thomas Zimmermann @ 2026-05-20 16:00 UTC (permalink / raw)
To: deller, simona, airlied, lukas, maddy, mpe, npiggin, chleroy
Cc: dri-devel, linux-fbdev, linuxppc-dev, Thomas Zimmermann
Handle fbcon during blanking in fb_blank_from_user(). First blank the
hardware, then blank fbcon. Same for unblanking. Update all callers and
resolve the duplicated logic.
With the new helper, fbdev's sysfb code no longer maintains fbcon state
by itself.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
drivers/video/fbdev/core/fb_chrdev.c | 4 +---
drivers/video/fbdev/core/fb_internal.h | 1 +
drivers/video/fbdev/core/fbmem.c | 10 ++++++++++
drivers/video/fbdev/core/fbsysfs.c | 5 +----
4 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/drivers/video/fbdev/core/fb_chrdev.c b/drivers/video/fbdev/core/fb_chrdev.c
index 54f926fb411b..035e67d2c28f 100644
--- a/drivers/video/fbdev/core/fb_chrdev.c
+++ b/drivers/video/fbdev/core/fb_chrdev.c
@@ -138,9 +138,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd,
return -EINVAL;
console_lock();
lock_fb_info(info);
- ret = fb_blank(info, arg);
- /* might again call into fb_blank */
- fbcon_fb_blanked(info, arg);
+ ret = fb_blank_from_user(info, arg);
unlock_fb_info(info);
console_unlock();
break;
diff --git a/drivers/video/fbdev/core/fb_internal.h b/drivers/video/fbdev/core/fb_internal.h
index 613832d335fe..62e75bf15b9b 100644
--- a/drivers/video/fbdev/core/fb_internal.h
+++ b/drivers/video/fbdev/core/fb_internal.h
@@ -44,6 +44,7 @@ extern struct fb_info *registered_fb[FB_MAX];
extern int num_registered_fb;
struct fb_info *get_fb_info(unsigned int idx);
void put_fb_info(struct fb_info *fb_info);
+int fb_blank_from_user(struct fb_info *info, int blank);
/* fb_procfs.c */
#if defined(CONFIG_FB_DEVICE)
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index d37a1039e221..1a6758653b64 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -422,6 +422,16 @@ int fb_blank(struct fb_info *info, int blank)
}
EXPORT_SYMBOL(fb_blank);
+int fb_blank_from_user(struct fb_info *info, int blank)
+{
+ int ret = fb_blank(info, blank);
+
+ /* might again call into fb_blank */
+ fbcon_fb_blanked(info, blank);
+
+ return ret;
+}
+
static int fb_check_foreignness(struct fb_info *fi)
{
const bool foreign_endian = fi->flags & FBINFO_FOREIGN_ENDIAN;
diff --git a/drivers/video/fbdev/core/fbsysfs.c b/drivers/video/fbdev/core/fbsysfs.c
index 5ece236e6252..d9743ef35355 100644
--- a/drivers/video/fbdev/core/fbsysfs.c
+++ b/drivers/video/fbdev/core/fbsysfs.c
@@ -7,7 +7,6 @@
#include <linux/console.h>
#include <linux/fb.h>
-#include <linux/fbcon.h>
#include <linux/major.h>
#include "fb_internal.h"
@@ -229,9 +228,7 @@ static ssize_t store_blank(struct device *device,
arg = simple_strtoul(buf, &last, 0);
console_lock();
- err = fb_blank(fb_info, arg);
- /* might again call into fb_blank */
- fbcon_fb_blanked(fb_info, arg);
+ err = fb_blank_from_user(fb_info, arg);
console_unlock();
if (err < 0)
return err;
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 3/4] fbdev: Wrap fbcon updates from vga-switcheroo in helper
2026-05-20 16:00 [PATCH 0/4] fbdev: Internalize fbcon Thomas Zimmermann
2026-05-20 16:00 ` [PATCH 1/4] fbdev: Wrap user-invoked calls to fb_set_var() in helper Thomas Zimmermann
2026-05-20 16:00 ` [PATCH 2/4] fbdev: Wrap user-invoked calls to fb_blank() " Thomas Zimmermann
@ 2026-05-20 16:00 ` Thomas Zimmermann
2026-05-20 18:49 ` Helge Deller
2026-05-25 11:30 ` Claude review: " Claude Code Review Bot
2026-05-20 16:00 ` [PATCH 4/4] fbdev: Do not export fbcon from fbdev Thomas Zimmermann
2026-05-25 11:30 ` Claude review: fbdev: Internalize fbcon Claude Code Review Bot
4 siblings, 2 replies; 16+ messages in thread
From: Thomas Zimmermann @ 2026-05-20 16:00 UTC (permalink / raw)
To: deller, simona, airlied, lukas, maddy, mpe, npiggin, chleroy
Cc: dri-devel, linux-fbdev, linuxppc-dev, Thomas Zimmermann
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.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
drivers/gpu/vga/vga_switcheroo.c | 6 +++---
drivers/video/fbdev/core/fbmem.c | 10 ++++++++++
include/linux/fb.h | 1 +
3 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
index 8fe1ae3c71bb..805953d0b941 100644
--- 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 CONFIG_FB
if (new_client->fb_info)
- fbcon_remap_all(new_client->fb_info);
+ fb_switch_outputs(new_client->fb_info);
+#endif
mutex_lock(&vgasr_priv.mux_hw_lock);
ret = vgasr_priv.handler->switchto(new_client->id);
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index 1a6758653b64..ecadbc58abff 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -684,6 +684,16 @@ void fb_set_suspend(struct fb_info *info, int state)
}
EXPORT_SYMBOL(fb_set_suspend);
+/**
+ * fb_switch_outputs - framebuffer got the outputs from vga-switcheroo
+ * @info: framebuffer
+ */
+void fb_switch_outputs(struct fb_info *info)
+{
+ fbcon_remap_all(info);
+}
+EXPORT_SYMBOL(fb_switch_outputs);
+
static int __init fbmem_init(void)
{
int ret;
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 88680a7cabd5..e9a26e82322a 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -608,6 +608,7 @@ void fb_pad_unaligned_buffer(u8 *dst, u32 d_pitch, const u8 *src, u32 idx, u32 h
u32 shift_high, u32 shift_low, u32 mod);
void fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, const u8 *src, u32 s_pitch, u32 height);
extern void fb_set_suspend(struct fb_info *info, int state);
+extern void fb_switch_outputs(struct fb_info *info);
extern int fb_get_color_depth(struct fb_var_screeninfo *var,
struct fb_fix_screeninfo *fix);
extern int fb_get_options(const char *name, char **option);
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 4/4] fbdev: Do not export fbcon from fbdev
2026-05-20 16:00 [PATCH 0/4] fbdev: Internalize fbcon Thomas Zimmermann
` (2 preceding siblings ...)
2026-05-20 16:00 ` [PATCH 3/4] fbdev: Wrap fbcon updates from vga-switcheroo " Thomas Zimmermann
@ 2026-05-20 16:00 ` Thomas Zimmermann
2026-05-25 11:30 ` Claude review: " Claude Code Review Bot
2026-05-25 11:30 ` Claude review: fbdev: Internalize fbcon Claude Code Review Bot
4 siblings, 1 reply; 16+ messages in thread
From: Thomas Zimmermann @ 2026-05-20 16:00 UTC (permalink / raw)
To: deller, simona, airlied, lukas, maddy, mpe, npiggin, chleroy
Cc: dri-devel, linux-fbdev, linuxppc-dev, Thomas Zimmermann
There are no callers of fbcon outside fbdev. Move the declarations
into the internal header.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
MAINTAINERS | 1 -
drivers/video/fbdev/core/fb_chrdev.c | 2 +-
drivers/video/fbdev/core/fbcon.c | 1 -
drivers/video/fbdev/core/fbcon.h | 50 +++++++++++++++++++++++++
drivers/video/fbdev/core/fbmem.c | 2 +-
include/linux/fbcon.h | 55 ----------------------------
6 files changed, 52 insertions(+), 59 deletions(-)
delete mode 100644 include/linux/fbcon.h
diff --git a/MAINTAINERS b/MAINTAINERS
index a80e7f0c25e6..d5058fa2cb54 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -10141,7 +10141,6 @@ F: drivers/video/fbdev/core/fbcon_rotate.h
F: drivers/video/fbdev/core/fbcon_ud.c
F: drivers/video/fbdev/core/softcursor.c
F: drivers/video/fbdev/core/tileblit.c
-F: include/linux/fbcon.h
F: include/linux/font.h
F: lib/fonts/
diff --git a/drivers/video/fbdev/core/fb_chrdev.c b/drivers/video/fbdev/core/fb_chrdev.c
index 035e67d2c28f..ba1d0bc214c5 100644
--- a/drivers/video/fbdev/core/fb_chrdev.c
+++ b/drivers/video/fbdev/core/fb_chrdev.c
@@ -3,10 +3,10 @@
#include <linux/compat.h>
#include <linux/console.h>
#include <linux/fb.h>
-#include <linux/fbcon.h>
#include <linux/major.h>
#include "fb_internal.h"
+#include "fbcon.h"
/*
* We hold a reference to the fb_info in file->private_data,
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index 50b84cd32938..853b52b40d01 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -70,7 +70,6 @@
#include <linux/printk.h>
#include <linux/slab.h>
#include <linux/fb.h>
-#include <linux/fbcon.h>
#include <linux/vt_kern.h>
#include <linux/selection.h>
#include <linux/font.h>
diff --git a/drivers/video/fbdev/core/fbcon.h b/drivers/video/fbdev/core/fbcon.h
index 321cc7f44baa..407d207b14f1 100644
--- a/drivers/video/fbdev/core/fbcon.h
+++ b/drivers/video/fbdev/core/fbcon.h
@@ -11,6 +11,7 @@
#ifndef _VIDEO_FBCON_H
#define _VIDEO_FBCON_H
+#include <linux/compiler_types.h>
#include <linux/font.h>
#include <linux/types.h>
#include <linux/vt_buffer.h>
@@ -19,6 +20,11 @@
#include <asm/io.h>
+struct fb_blit_caps;
+struct fb_info;
+struct fb_var_screeninfo;
+struct fb_videomode;
+
/*
* This is the interface between the low-level console driver and the
* low-level frame buffer device
@@ -233,4 +239,48 @@ static inline int get_attribute(struct fb_info *info, u16 c)
(void) (&_r == &_v); \
(i == FB_ROTATE_UR || i == FB_ROTATE_UD) ? _r : _v; })
+#ifdef CONFIG_FRAMEBUFFER_CONSOLE
+void __init fb_console_init(void);
+void __exit fb_console_exit(void);
+int fbcon_fb_registered(struct fb_info *info);
+void fbcon_fb_unregistered(struct fb_info *info);
+void fbcon_fb_unbind(struct fb_info *info);
+void fbcon_suspended(struct fb_info *info);
+void fbcon_resumed(struct fb_info *info);
+int fbcon_mode_deleted(struct fb_info *info,
+ struct fb_videomode *mode);
+void fbcon_delete_modelist(struct list_head *head);
+void fbcon_new_modelist(struct fb_info *info);
+void fbcon_get_requirement(struct fb_info *info,
+ struct fb_blit_caps *caps);
+void fbcon_fb_blanked(struct fb_info *info, int blank);
+int fbcon_modechange_possible(struct fb_info *info,
+ struct fb_var_screeninfo *var);
+void fbcon_update_vcs(struct fb_info *info, bool all);
+void fbcon_remap_all(struct fb_info *info);
+int fbcon_set_con2fb_map_ioctl(void __user *argp);
+int fbcon_get_con2fb_map_ioctl(void __user *argp);
+#else
+static inline void fb_console_init(void) {}
+static inline void fb_console_exit(void) {}
+static inline int fbcon_fb_registered(struct fb_info *info) { return 0; }
+static inline void fbcon_fb_unregistered(struct fb_info *info) {}
+static inline void fbcon_fb_unbind(struct fb_info *info) {}
+static inline void fbcon_suspended(struct fb_info *info) {}
+static inline void fbcon_resumed(struct fb_info *info) {}
+static inline int fbcon_mode_deleted(struct fb_info *info,
+ struct fb_videomode *mode) { return 0; }
+static inline void fbcon_delete_modelist(struct list_head *head) {}
+static inline void fbcon_new_modelist(struct fb_info *info) {}
+static inline void fbcon_get_requirement(struct fb_info *info,
+ struct fb_blit_caps *caps) {}
+static inline void fbcon_fb_blanked(struct fb_info *info, int blank) {}
+static inline int fbcon_modechange_possible(struct fb_info *info,
+ struct fb_var_screeninfo *var) { return 0; }
+static inline void fbcon_update_vcs(struct fb_info *info, bool all) {}
+static inline void fbcon_remap_all(struct fb_info *info) {}
+static inline int fbcon_set_con2fb_map_ioctl(void __user *argp) { return 0; }
+static inline int fbcon_get_con2fb_map_ioctl(void __user *argp) { return 0; }
+#endif
+
#endif /* _VIDEO_FBCON_H */
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index ecadbc58abff..e5221653ec2b 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -14,13 +14,13 @@
#include <linux/console.h>
#include <linux/export.h>
#include <linux/fb.h>
-#include <linux/fbcon.h>
#include <linux/lcd.h>
#include <linux/leds.h>
#include <video/nomodeset.h>
#include "fb_internal.h"
+#include "fbcon.h"
/*
* Frame buffer device initialization and setup routines
diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h
deleted file mode 100644
index f206370060e1..000000000000
--- a/include/linux/fbcon.h
+++ /dev/null
@@ -1,55 +0,0 @@
-#ifndef _LINUX_FBCON_H
-#define _LINUX_FBCON_H
-
-#include <linux/compiler_types.h>
-
-struct fb_blit_caps;
-struct fb_info;
-struct fb_var_screeninfo;
-struct fb_videomode;
-
-#ifdef CONFIG_FRAMEBUFFER_CONSOLE
-void __init fb_console_init(void);
-void __exit fb_console_exit(void);
-int fbcon_fb_registered(struct fb_info *info);
-void fbcon_fb_unregistered(struct fb_info *info);
-void fbcon_fb_unbind(struct fb_info *info);
-void fbcon_suspended(struct fb_info *info);
-void fbcon_resumed(struct fb_info *info);
-int fbcon_mode_deleted(struct fb_info *info,
- struct fb_videomode *mode);
-void fbcon_delete_modelist(struct list_head *head);
-void fbcon_new_modelist(struct fb_info *info);
-void fbcon_get_requirement(struct fb_info *info,
- struct fb_blit_caps *caps);
-void fbcon_fb_blanked(struct fb_info *info, int blank);
-int fbcon_modechange_possible(struct fb_info *info,
- struct fb_var_screeninfo *var);
-void fbcon_update_vcs(struct fb_info *info, bool all);
-void fbcon_remap_all(struct fb_info *info);
-int fbcon_set_con2fb_map_ioctl(void __user *argp);
-int fbcon_get_con2fb_map_ioctl(void __user *argp);
-#else
-static inline void fb_console_init(void) {}
-static inline void fb_console_exit(void) {}
-static inline int fbcon_fb_registered(struct fb_info *info) { return 0; }
-static inline void fbcon_fb_unregistered(struct fb_info *info) {}
-static inline void fbcon_fb_unbind(struct fb_info *info) {}
-static inline void fbcon_suspended(struct fb_info *info) {}
-static inline void fbcon_resumed(struct fb_info *info) {}
-static inline int fbcon_mode_deleted(struct fb_info *info,
- struct fb_videomode *mode) { return 0; }
-static inline void fbcon_delete_modelist(struct list_head *head) {}
-static inline void fbcon_new_modelist(struct fb_info *info) {}
-static inline void fbcon_get_requirement(struct fb_info *info,
- struct fb_blit_caps *caps) {}
-static inline void fbcon_fb_blanked(struct fb_info *info, int blank) {}
-static inline int fbcon_modechange_possible(struct fb_info *info,
- struct fb_var_screeninfo *var) { return 0; }
-static inline void fbcon_update_vcs(struct fb_info *info, bool all) {}
-static inline void fbcon_remap_all(struct fb_info *info) {}
-static inline int fbcon_set_con2fb_map_ioctl(void __user *argp) { return 0; }
-static inline int fbcon_get_con2fb_map_ioctl(void __user *argp) { return 0; }
-#endif
-
-#endif /* _LINUX_FBCON_H */
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 3/4] fbdev: Wrap fbcon updates from vga-switcheroo in helper
2026-05-20 16:00 ` [PATCH 3/4] fbdev: Wrap fbcon updates from vga-switcheroo " Thomas Zimmermann
@ 2026-05-20 18:49 ` Helge Deller
2026-05-25 11:30 ` Claude review: " Claude Code Review Bot
1 sibling, 0 replies; 16+ messages in thread
From: Helge Deller @ 2026-05-20 18:49 UTC (permalink / raw)
To: Thomas Zimmermann, simona, airlied, lukas, maddy, mpe, npiggin,
chleroy
Cc: dri-devel, linux-fbdev, linuxppc-dev
On 5/20/26 18:00, Thomas Zimmermann 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.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> drivers/gpu/vga/vga_switcheroo.c | 6 +++---
> drivers/video/fbdev/core/fbmem.c | 10 ++++++++++
> include/linux/fb.h | 1 +
> 3 files changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
> index 8fe1ae3c71bb..805953d0b941 100644
> --- 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 CONFIG_FB
I think this should be
#ifdef CONFIG_FB
Helge
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/4] fbdev: Wrap user-invoked calls to fb_set_var() in helper
2026-05-20 16:00 ` [PATCH 1/4] fbdev: Wrap user-invoked calls to fb_set_var() in helper Thomas Zimmermann
@ 2026-05-20 18:51 ` Helge Deller
2026-05-20 21:53 ` Christophe Leroy (CS GROUP)
2026-05-22 12:14 ` Thomas Zimmermann
2026-05-25 11:30 ` Claude review: " Claude Code Review Bot
1 sibling, 2 replies; 16+ messages in thread
From: Helge Deller @ 2026-05-20 18:51 UTC (permalink / raw)
To: Thomas Zimmermann, simona, airlied, lukas, maddy, mpe, npiggin,
chleroy
Cc: dri-devel, linux-fbdev, linuxppc-dev
On 5/20/26 18:00, Thomas Zimmermann wrote:
> Handle fbcon during display updates in fb_set_var_from_user(). Check
> with fbcon if the mode change is possible, update hardware state and
> finally update fbcon. Update all callers.
>
> Only the FBIOPUT_VSCREENINFO ioctl currently does all steps. Other
> mode-changes callers in sysfs and driver code are missing fbcon-related
> steps.
>
> With the new helper, ps3fb and sh_mobile_lcdcfb no longer maintain
> fbcon state themselves.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> drivers/video/fbdev/core/fb_chrdev.c | 6 +-----
> drivers/video/fbdev/core/fbcon.c | 2 --
> drivers/video/fbdev/core/fbmem.c | 13 +++++++++++++
> drivers/video/fbdev/core/fbsysfs.c | 4 +---
> drivers/video/fbdev/ps3fb.c | 5 +----
> drivers/video/fbdev/sh_mobile_lcdcfb.c | 5 +----
> include/linux/fb.h | 2 ++
> 7 files changed, 19 insertions(+), 18 deletions(-)
>
>...
> diff --git a/include/linux/fb.h b/include/linux/fb.h
> index 5178a33c752c..88680a7cabd5 100644
> --- a/include/linux/fb.h
> +++ b/include/linux/fb.h
> @@ -533,6 +533,8 @@ extern int fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var);
> extern int fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var);
> extern int fb_blank(struct fb_info *info, int blank);
>
> +int fb_set_var_from_user(struct fb_info *info, struct fb_var_screeninfo *var);
> +
"extern" int fb_set_var_from_user(...) ?
Other than that the series is a nice cleanup!
Thanks!
Helge
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/4] fbdev: Wrap user-invoked calls to fb_set_var() in helper
2026-05-20 18:51 ` Helge Deller
@ 2026-05-20 21:53 ` Christophe Leroy (CS GROUP)
2026-05-22 12:14 ` Thomas Zimmermann
1 sibling, 0 replies; 16+ messages in thread
From: Christophe Leroy (CS GROUP) @ 2026-05-20 21:53 UTC (permalink / raw)
To: Helge Deller, Thomas Zimmermann, simona, airlied, lukas, maddy,
mpe, npiggin
Cc: dri-devel, linux-fbdev, linuxppc-dev
Le 20/05/2026 à 20:51, Helge Deller a écrit :
> On 5/20/26 18:00, Thomas Zimmermann wrote:
>> Handle fbcon during display updates in fb_set_var_from_user(). Check
>> with fbcon if the mode change is possible, update hardware state and
>> finally update fbcon. Update all callers.
>>
>> Only the FBIOPUT_VSCREENINFO ioctl currently does all steps. Other
>> mode-changes callers in sysfs and driver code are missing fbcon-related
>> steps.
>>
>> With the new helper, ps3fb and sh_mobile_lcdcfb no longer maintain
>> fbcon state themselves.
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> ---
>> drivers/video/fbdev/core/fb_chrdev.c | 6 +-----
>> drivers/video/fbdev/core/fbcon.c | 2 --
>> drivers/video/fbdev/core/fbmem.c | 13 +++++++++++++
>> drivers/video/fbdev/core/fbsysfs.c | 4 +---
>> drivers/video/fbdev/ps3fb.c | 5 +----
>> drivers/video/fbdev/sh_mobile_lcdcfb.c | 5 +----
>> include/linux/fb.h | 2 ++
>> 7 files changed, 19 insertions(+), 18 deletions(-)
>>
>> ...
>> diff --git a/include/linux/fb.h b/include/linux/fb.h
>> index 5178a33c752c..88680a7cabd5 100644
>> --- a/include/linux/fb.h
>> +++ b/include/linux/fb.h
>> @@ -533,6 +533,8 @@ extern int fb_set_var(struct fb_info *info, struct
>> fb_var_screeninfo *var);
>> extern int fb_pan_display(struct fb_info *info, struct
>> fb_var_screeninfo *var);
>> extern int fb_blank(struct fb_info *info, int blank);
>> +int fb_set_var_from_user(struct fb_info *info, struct
>> fb_var_screeninfo *var);
>> +
>
> "extern" int fb_set_var_from_user(...) ?
No, 'extern' is pointless for function prototypes and 'checkpatch
--strict' will complain about it.
See following link, search for extern :
https://docs.kernel.org/dev-tools/checkpatch.html
>
> Other than that the series is a nice cleanup!
>
> Thanks!
> Helge
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/4] fbdev: Wrap user-invoked calls to fb_set_var() in helper
2026-05-20 18:51 ` Helge Deller
2026-05-20 21:53 ` Christophe Leroy (CS GROUP)
@ 2026-05-22 12:14 ` Thomas Zimmermann
1 sibling, 0 replies; 16+ messages in thread
From: Thomas Zimmermann @ 2026-05-22 12:14 UTC (permalink / raw)
To: Helge Deller, simona, airlied, lukas, maddy, mpe, npiggin,
chleroy
Cc: dri-devel, linux-fbdev, linuxppc-dev
Hi
Am 20.05.26 um 20:51 schrieb Helge Deller:
> On 5/20/26 18:00, Thomas Zimmermann wrote:
>> Handle fbcon during display updates in fb_set_var_from_user(). Check
>> with fbcon if the mode change is possible, update hardware state and
>> finally update fbcon. Update all callers.
>>
>> Only the FBIOPUT_VSCREENINFO ioctl currently does all steps. Other
>> mode-changes callers in sysfs and driver code are missing fbcon-related
>> steps.
>>
>> With the new helper, ps3fb and sh_mobile_lcdcfb no longer maintain
>> fbcon state themselves.
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> ---
>> drivers/video/fbdev/core/fb_chrdev.c | 6 +-----
>> drivers/video/fbdev/core/fbcon.c | 2 --
>> drivers/video/fbdev/core/fbmem.c | 13 +++++++++++++
>> drivers/video/fbdev/core/fbsysfs.c | 4 +---
>> drivers/video/fbdev/ps3fb.c | 5 +----
>> drivers/video/fbdev/sh_mobile_lcdcfb.c | 5 +----
>> include/linux/fb.h | 2 ++
>> 7 files changed, 19 insertions(+), 18 deletions(-)
>>
>> ...
>> diff --git a/include/linux/fb.h b/include/linux/fb.h
>> index 5178a33c752c..88680a7cabd5 100644
>> --- a/include/linux/fb.h
>> +++ b/include/linux/fb.h
>> @@ -533,6 +533,8 @@ extern int fb_set_var(struct fb_info *info,
>> struct fb_var_screeninfo *var);
>> extern int fb_pan_display(struct fb_info *info, struct
>> fb_var_screeninfo *var);
>> extern int fb_blank(struct fb_info *info, int blank);
>> +int fb_set_var_from_user(struct fb_info *info, struct
>> fb_var_screeninfo *var);
>> +
>
> "extern" int fb_set_var_from_user(...) ?
As Christophe ointed out, not having extern is correct. I think, if
anything, we should remove the existing externs from the headers.
>
> Other than that the series is a nice cleanup!
Thanks. I'll send you an updated series with the #ifdef fix for patch
3. Sending just fixup patches can confuse the tracker bots and services
(say patchwork), so I'd avoid that.
Best regards
Thomas
>
> Thanks!
> Helge
--
--
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)
^ permalink raw reply [flat|nested] 16+ messages in thread
* Claude review: fbdev: Do not export fbcon from fbdev
2026-05-22 12:28 ` [PATCH v2 4/4] fbdev: Do not export fbcon from fbdev Thomas Zimmermann
@ 2026-05-25 8:52 ` Claude Code Review Bot
0 siblings, 0 replies; 16+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 8:52 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Moves all declarations from `include/linux/fbcon.h` into the existing internal `drivers/video/fbdev/core/fbcon.h`, adds necessary forward declarations and `#include <linux/compiler_types.h>`, then deletes the public header.
The approach of appending to the existing internal `fbcon.h` (which already has internal struct definitions and macros) is correct. The forward declarations for `struct fb_blit_caps`, `struct fb_info`, `struct fb_var_screeninfo`, and `struct fb_videomode` are needed since the internal header didn't previously include `<linux/fb.h>`.
`fbcon.c` already includes the local `"fbcon.h"` (line 85 in current tree), so dropping `<linux/fbcon.h>` (line 73) is safe — the declarations remain visible.
`fb_chrdev.c` and `fbmem.c` correctly switch from `<linux/fbcon.h>` to `"fbcon.h"`.
The `MAINTAINERS` update removing the deleted file is correct.
**No issues.**
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 16+ messages in thread
* Claude review: fbdev: Internalize fbcon
2026-05-20 16:00 [PATCH 0/4] fbdev: Internalize fbcon Thomas Zimmermann
` (3 preceding siblings ...)
2026-05-20 16:00 ` [PATCH 4/4] fbdev: Do not export fbcon from fbdev Thomas Zimmermann
@ 2026-05-25 11:30 ` Claude Code Review Bot
4 siblings, 0 replies; 16+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:30 UTC (permalink / raw)
To: dri-devel-reviews
Overall Series Review
Subject: fbdev: Internalize fbcon
Author: Thomas Zimmermann <tzimmermann@suse.de>
Patches: 9
Reviewed: 2026-05-25T21:30:31.171741
---
This is a well-structured 4-patch series by Thomas Zimmermann that internalizes fbcon as a private implementation detail of fbdev. The goal is clean: wrap the fbcon interactions (mode changes, blanking, VGA switcheroo remapping) behind fbdev helper functions, then move the declarations from the public `include/linux/fbcon.h` into the private `drivers/video/fbdev/core/fbcon.h`.
The series is generally sound and the direction is correct. The helpers consolidate duplicated fbcon call patterns and fix real inconsistencies (e.g., sysfs mode changes not calling `fbcon_modechange_possible`). However, there are two issues worth addressing:
1. **Bug**: Patch 3 uses `#if CONFIG_FB` which, while technically functional for a bool Kconfig symbol, is non-standard kernel style and should be `#ifdef CONFIG_FB`.
2. **Behavioral change in sh_mobile_lcdcfb**: Patch 1 silently changes `fbcon_update_vcs(info, true)` to `fbcon_update_vcs(info, var->activate & FB_ACTIVATE_ALL)` where `var.activate = FB_ACTIVATE_NOW`, making the `all` parameter false instead of true. This may be intentional (consistent with the ioctl path) but should be called out in the commit message.
---
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 16+ messages in thread
* Claude review: fbdev: Wrap user-invoked calls to fb_set_var() in helper
2026-05-20 16:00 ` [PATCH 1/4] fbdev: Wrap user-invoked calls to fb_set_var() in helper Thomas Zimmermann
2026-05-20 18:51 ` Helge Deller
@ 2026-05-25 11:30 ` Claude Code Review Bot
1 sibling, 0 replies; 16+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:30 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
**Correctness**: The new `fb_set_var_from_user()` correctly consolidates the three-step pattern: check with `fbcon_modechange_possible()`, call `fb_set_var()`, then `fbcon_update_vcs()`. This is a clean factoring.
**Behavioral fix for sysfs path**: The `activate()` function in `fbsysfs.c` previously skipped `fbcon_modechange_possible()`. Now it calls it via the helper. This is a fix for an existing inconsistency, as the commit message notes — good.
**Behavioral change in sh_mobile_lcdcfb**: The original code at `sh_mobile_lcdcfb.c:1775`:
```c
var.activate = FB_ACTIVATE_NOW;
...
fbcon_update_vcs(info, true);
```
becomes (via `fb_set_var_from_user`):
```c
fbcon_update_vcs(info, var->activate & FB_ACTIVATE_ALL);
```
Since `FB_ACTIVATE_NOW` is 0 and `FB_ACTIVATE_ALL` is 64, the `all` parameter changes from `true` to `false`. This means only the current VC gets updated rather than all VCs. This may be the intended fix (the cover letter says "fix inconsistencies among the various code paths"), but it's a user-visible behavioral change that should be explicitly mentioned in the commit message.
**EXPORT_SYMBOL**: `fb_set_var_from_user` is exported with `EXPORT_SYMBOL` (not `_GPL`), matching `fb_set_var`. Fine since it's used by `ps3fb` and `sh_mobile_lcdcfb` which can be modules.
**Minor**: The removed `EXPORT_SYMBOL(fbcon_update_vcs)` and `EXPORT_SYMBOL_GPL(fbcon_modechange_possible)` in fbcon.c are now unnecessary since only fbmem.c calls them — this is correct.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 16+ messages in thread
* Claude review: fbdev: Wrap user-invoked calls to fb_blank() in helper
2026-05-20 16:00 ` [PATCH 2/4] fbdev: Wrap user-invoked calls to fb_blank() " Thomas Zimmermann
@ 2026-05-25 11:30 ` Claude Code Review Bot
0 siblings, 0 replies; 16+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:30 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
**Correctness**: The new `fb_blank_from_user()` correctly wraps `fb_blank()` + `fbcon_fb_blanked()`. The pattern is preserved faithfully — `fbcon_fb_blanked` is called regardless of whether `fb_blank` returned an error, matching the original behavior in both the ioctl and sysfs paths.
**Scope**: The function is declared in `fb_internal.h` rather than `fb.h`, which is appropriate since both callers (`fb_chrdev.c`, `fbsysfs.c`) are within the fbdev core. No external drivers need this. Good.
**No concerns** with this patch.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 16+ messages in thread
* Claude review: fbdev: Wrap fbcon updates from vga-switcheroo in helper
2026-05-20 16:00 ` [PATCH 3/4] fbdev: Wrap fbcon updates from vga-switcheroo " Thomas Zimmermann
2026-05-20 18:49 ` Helge Deller
@ 2026-05-25 11:30 ` Claude Code Review Bot
1 sibling, 0 replies; 16+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:30 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
**Bug — `#if CONFIG_FB`**: The patch adds:
```c
+#if CONFIG_FB
if (new_client->fb_info)
- fbcon_remap_all(new_client->fb_info);
+ fb_switch_outputs(new_client->fb_info);
+#endif
```
This should be `#ifdef CONFIG_FB`. While `#if CONFIG_FB` happens to work for bool Kconfig symbols (undefined macros evaluate to 0 in `#if` expressions), it's not standard kernel preprocessor style. The kernel overwhelmingly uses `#ifdef CONFIG_*` for presence checks. `#if CONFIG_FB` could also trigger compiler warnings with `-Wundef` if enabled.
Moreover, looking at the Kconfig:
```
config VGA_SWITCHEROO
depends on (FRAMEBUFFER_CONSOLE=n || FB=y)
```
When `VGA_SWITCHEROO` is enabled, either `FB=y` (so CONFIG_FB is always defined) or `FRAMEBUFFER_CONSOLE=n` (FB may or may not be set). The guard is functionally needed for the `FRAMEBUFFER_CONSOLE=n && FB=n` case (though that seems unlikely given the dependency implies you need *some* display path).
**Design**: The `fb_switch_outputs()` function is a thin wrapper around `fbcon_remap_all()`. The commit message explains this is a stepping stone toward moving the call into DRM's fbdev emulation, which justifies the indirection. The function is exported with `EXPORT_SYMBOL` since `vga_switcheroo` is outside the fbdev core.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 16+ messages in thread
* Claude review: fbdev: Do not export fbcon from fbdev
2026-05-20 16:00 ` [PATCH 4/4] fbdev: Do not export fbcon from fbdev Thomas Zimmermann
@ 2026-05-25 11:30 ` Claude Code Review Bot
0 siblings, 0 replies; 16+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:30 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
**Correctness**: This is a straightforward move of declarations from `include/linux/fbcon.h` to `drivers/video/fbdev/core/fbcon.h`. The content is identical — I confirmed the `#ifdef CONFIG_FRAMEBUFFER_CONSOLE` block and all stub definitions match exactly.
**Internal header**: The declarations are appended to the existing internal `fbcon.h` which already has fbcon-internal definitions (structs, macros for the console driver). Adding the public API declarations here is a reasonable choice.
**New includes**: The patch correctly adds `#include <linux/compiler_types.h>` and forward declarations for `struct fb_blit_caps`, `struct fb_info`, `struct fb_var_screeninfo`, and `struct fb_videomode` — needed since this header no longer transitively gets them from the public header chain.
**MAINTAINERS**: Removing `include/linux/fbcon.h` from the FRAMEBUFFER CONSOLE DRIVER section is correct since the file is deleted.
**No concerns** with this patch.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 16+ messages in thread
* Claude review: fbdev: Do not export fbcon from fbdev
2026-05-27 15:14 ` [PATCH v3 4/4] fbdev: Do not export fbcon from fbdev Thomas Zimmermann
@ 2026-05-28 2:12 ` Claude Code Review Bot
0 siblings, 0 replies; 16+ messages in thread
From: Claude Code Review Bot @ 2026-05-28 2:12 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Clean. The declarations are moved from the public `include/linux/fbcon.h` to the existing private `drivers/video/fbdev/core/fbcon.h`. Since `fbcon.c` already includes the local `"fbcon.h"` (line 84), and `fb_chrdev.c`/`fbmem.c` now include `"fbcon.h"` instead of `<linux/fbcon.h>`, all consumers are covered.
The forward declarations (`struct fb_blit_caps`, `struct fb_info`, etc.) and `#include <linux/compiler_types.h>` are correctly added to the private header to replace what came from the public header.
MAINTAINERS update removing `include/linux/fbcon.h` is correct.
The `EXPORT_SYMBOL` removals for `fbcon_update_vcs` and `fbcon_modechange_possible` happened in patch 1 since their callers moved into fbdev core at that point — correctly sequenced.
---
**Summary**: The series should be fine with the sh_mobile_lcdcfb fix in patch 1 (`var.activate` needs `FB_ACTIVATE_ALL` set to preserve the original "update all VCs" behavior).
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2026-05-28 2:12 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-20 16:00 [PATCH 0/4] fbdev: Internalize fbcon Thomas Zimmermann
2026-05-20 16:00 ` [PATCH 1/4] fbdev: Wrap user-invoked calls to fb_set_var() in helper Thomas Zimmermann
2026-05-20 18:51 ` Helge Deller
2026-05-20 21:53 ` Christophe Leroy (CS GROUP)
2026-05-22 12:14 ` Thomas Zimmermann
2026-05-25 11:30 ` Claude review: " Claude Code Review Bot
2026-05-20 16:00 ` [PATCH 2/4] fbdev: Wrap user-invoked calls to fb_blank() " Thomas Zimmermann
2026-05-25 11:30 ` Claude review: " Claude Code Review Bot
2026-05-20 16:00 ` [PATCH 3/4] fbdev: Wrap fbcon updates from vga-switcheroo " Thomas Zimmermann
2026-05-20 18:49 ` Helge Deller
2026-05-25 11:30 ` Claude review: " Claude Code Review Bot
2026-05-20 16:00 ` [PATCH 4/4] fbdev: Do not export fbcon from fbdev Thomas Zimmermann
2026-05-25 11:30 ` Claude review: " Claude Code Review Bot
2026-05-25 11:30 ` Claude review: fbdev: Internalize fbcon Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-05-22 12:28 [PATCH v2 0/4] " Thomas Zimmermann
2026-05-22 12:28 ` [PATCH v2 4/4] fbdev: Do not export fbcon from fbdev Thomas Zimmermann
2026-05-25 8:52 ` Claude review: " Claude Code Review Bot
2026-05-27 15:14 [PATCH v3 0/4] fbdev: Internalize fbcon Thomas Zimmermann
2026-05-27 15:14 ` [PATCH v3 4/4] fbdev: Do not export fbcon from fbdev Thomas Zimmermann
2026-05-28 2:12 ` Claude review: " Claude Code Review Bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox