Hi all, This patch series removes the fbcon notifier. It also contains the beginnings of trying to understand how locking in this area works. The super short summary of locking rules is that everything in fbcon needs to be protected by the monolithic console_lock, including the setup code. So not really an option to pull the kms modeset code out from underneath that, at least not without rewriting half the console layer. Or I'm not yet seeing clear enough. The other side is that fbdev userspace access vs. fbcon locking is totally broken. For context of this series I'm just going to quote the commit message that started this all: commit 6104c37094e729f3d4ce65797002112735d49cd1 Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Tue Aug 1 17:32:07 2017 +0200 fbcon: Make fbcon a built-time depency for fbdev There's a bunch of folks who're trying to make printk less contended and faster, but there's a problem: printk uses the console_lock, and the console lock has become the BKL for all things fbdev/fbcon, which in turn pulled in half the drm subsystem under that lock. That's awkward. There reasons for that is probably just a historical accident: - fbcon is a runtime option of fbdev, i.e. at runtime you can pick whether your fbdev driver instances are used as kernel consoles. Unfortunately this wasn't implemented with some module option, but through some module loading magic: As long as you don't load fbcon.ko, there's no fbdev console support, but loading it (in any order wrt fbdev drivers) will create console instances for all fbdev drivers. - This was implemented through a notifier chain. fbcon.ko enumerates all fbdev instances at load time and also registers itself as listener in the fbdev notifier. The fbdev core tries to register new fbdev instances with fbcon using the notifier. - On top of that the modifier chain is also used at runtime by the fbdev subsystem to e.g. control backlights for panels. - The problem is that the notifier puts a mutex locking context between fbdev and fbcon, which mixes up the locking contexts for both the runtime usage and the register time usage to notify fbcon. And at runtime fbcon (through the fbdev core) might call into the notifier from a printk critical section while console_lock is held. - This means console_lock must be an outer lock for the entire fbdev subsystem, which also means it must be acquired when registering a new framebuffer driver as the outermost lock since we might call into fbcon (through the notifier) which would result in a locking inversion if fbcon would acquire the console_lock from its notifier callback (which it needs to register the console). - console_lock can be held anywhere, since printk can be called anywhere, and through the above story, plus drm/kms being an fbdev driver, we pull in a shocking amount of locking hiercharchy underneath the console_lock. Which makes cleaning up printk really hard (not even splitting console_lock into an rwsem is all that useful due to this). There's various ways to address this, but the cleanest would be to make fbcon a compile-time option, where fbdev directly calls the fbcon register functions from register_framebuffer, or dummy static inline versions if fbcon is disabled. Maybe augmented with a runtime knob to disable fbcon, if that's needed (for debugging perhaps). But this could break some users who rely on the magic "loading fbcon.ko enables/disables fbdev framebuffers at runtime" thing, even if that's unlikely. Hence we must be careful: 1. Create a compile-time dependency between fbcon and fbdev in the least minimal way. This is what this patch does. 2. Wait at least 1 year to give possible users time to scream about how we broke their setup. Unlikely, since all distros make fbcon compile-in, and embedded platforms only compile stuff they know they need anyway. But still. 3. Convert the notifier to direct functions calls, with dummy static inlines if fbcon is disabled. We'll still need the fb notifier for the other uses (like backlights), but we can probably move it into the fb core (atm it must be built-into vmlinux). 4. Push console_lock down the call-chain, until it is down in console_register again. 5. Finally start to clean up and rework the printk/console locking. For context of this saga see commit 50e244cc793d511b86adea24972f3a7264cae114 Author: Alan Cox <alan@linux.intel.com> Date: Fri Jan 25 10:28:15 2013 +1000 fb: rework locking to fix lock ordering on takeover plus the pile of commits on top that tried to make this all work without terminally upsetting lockdep. We've uncovered all this when console_lock lockdep annotations where added in commit daee779718a319ff9f83e1ba3339334ac650bb22 Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Sat Sep 22 19:52:11 2012 +0200 console: implement lockdep support for console_lock On the patch itself: - Switch CONFIG_FRAMEBUFFER_CONSOLE to be a boolean, using the overall CONFIG_FB tristate to decided whether it should be a module or built-in. - At first I thought I could force the build depency with just a dummy symbol that fbcon.ko exports and fb.ko uses. But that leads to a module depency cycle (it works fine when built-in). Since this tight binding is the entire goal the simplest solution is to move all the fbcon modules (and there's a bunch of optinal source-files which are each modules of their own, for no good reason) into the overall fb.ko core module. That's a bit more than what I would have liked to do in this patch, but oh well. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Comments, review and testing much appreciated, as always. Wrt long-term plans: I'm not sure where this will lead just yet, or whether it'll lead anywhere at all. But I think removing the notifier indirection is definitely a step into the right direction. Cheers, Daniel Daniel Vetter (33): dummycon: Sprinkle locking checks fbdev: locking check for fb_set_suspend vt: might_sleep() annotation for do_blank_screen vt: More locking checks fbdev/sa1100fb: Remove dead code fbdev/cyber2000: Remove struct display fbdev/aty128fb: Remove dead code fbcon: s/struct display/struct fbcon_display/ fbcon: Remove fbcon_has_exited fbcon: call fbcon_fb_(un)registered directly fbdev/sh_mobile: remove sh_mobile_lcdc_display_notify fbdev/omap: sysfs files can't disappear before the device is gone fbdev: sysfs files can't disappear before the device is gone staging/olpc: lock_fb_info can't fail fbdev/atyfb: lock_fb_info can't fail fbdev: lock_fb_info cannot fail fbcon: call fbcon_fb_bind directly fbdev: make unregister/unlink functions not fail fbdev: unify unlink_framebufer paths fbdev/sh_mob: Remove fb notifier callback fbdev: directly call fbcon_suspended/resumed fbcon: Call fbcon_mode_deleted/new_modelist directly fbdev: Call fbcon_get_requirement directly Revert "backlight/fbcon: Add FB_EVENT_CONBLANK" fbcon: directly call fbcon_fb_blanked fbmem: pull fbcon_fb_blanked out of fb_blank fbdev: remove FBINFO_MISC_USEREVENT around fb_blank fb: Flatten control flow in fb_set_var fbcon: replace FB_EVENT_MODE_CHANGE/_ALL with direct calls vgaswitcheroo: call fbcon_remap_all directly fbcon: Call con2fb_map functions directly fbcon: Document what I learned about fbcon locking staging/olpc_dcon: Add drm conversion to TODO drivers/gpu/vga/vga_switcheroo.c | 11 +- drivers/staging/olpc_dcon/TODO | 7 + drivers/staging/olpc_dcon/olpc_dcon.c | 6 +- drivers/tty/vt/vt.c | 18 + drivers/video/backlight/backlight.c | 2 +- drivers/video/backlight/lcd.c | 2 - drivers/video/console/dummycon.c | 6 + drivers/video/fbdev/aty/aty128fb.c | 64 --- drivers/video/fbdev/aty/atyfb_base.c | 3 +- drivers/video/fbdev/core/fbcmap.c | 6 +- drivers/video/fbdev/core/fbcon.c | 303 ++++++-------- drivers/video/fbdev/core/fbcon.h | 6 +- drivers/video/fbdev/core/fbmem.c | 374 ++++++------------ drivers/video/fbdev/core/fbsysfs.c | 20 +- drivers/video/fbdev/cyber2000fb.c | 1 - .../video/fbdev/omap2/omapfb/omapfb-sysfs.c | 21 +- drivers/video/fbdev/sa1100fb.c | 25 -- drivers/video/fbdev/sh_mobile_lcdcfb.c | 112 +----- drivers/video/fbdev/sh_mobile_lcdcfb.h | 5 - include/linux/console_struct.h | 5 +- include/linux/fb.h | 40 +- include/linux/fbcon.h | 30 ++ 22 files changed, 342 insertions(+), 725 deletions(-) -- 2.20.1
As part of trying to understand the locking (or lack thereof) in the fbcon/vt/fbdev maze, annotate everything. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Kees Cook <keescook@chromium.org> Cc: Nicolas Pitre <nicolas.pitre@linaro.org> --- drivers/video/console/dummycon.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/video/console/dummycon.c b/drivers/video/console/dummycon.c index 45ad925ad5f8..2352b4c37826 100644 --- a/drivers/video/console/dummycon.c +++ b/drivers/video/console/dummycon.c @@ -33,6 +33,8 @@ static bool dummycon_putc_called; void dummycon_register_output_notifier(struct notifier_block *nb) { + WARN_CONSOLE_UNLOCKED(); + raw_notifier_chain_register(&dummycon_output_nh, nb); if (dummycon_putc_called) @@ -41,11 +43,15 @@ void dummycon_register_output_notifier(struct notifier_block *nb) void dummycon_unregister_output_notifier(struct notifier_block *nb) { + WARN_CONSOLE_UNLOCKED(); + raw_notifier_chain_unregister(&dummycon_output_nh, nb); } static void dummycon_putc(struct vc_data *vc, int c, int ypos, int xpos) { + WARN_CONSOLE_UNLOCKED(); + dummycon_putc_called = true; raw_notifier_call_chain(&dummycon_output_nh, 0, NULL); } -- 2.20.1
Just drive-by, nothing systematic yet. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Peter Rosin <peda@axentia.se> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Manfred Schlaegl <manfred.schlaegl@ginzinger.com> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: Kees Cook <keescook@chromium.org> --- drivers/video/fbdev/core/fbmem.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 4721491e6c8c..fc3d34a8ea5b 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1964,6 +1964,8 @@ void fb_set_suspend(struct fb_info *info, int state) { struct fb_event event; + WARN_CONSOLE_UNLOCKED(); + event.info = info; if (state) { fb_notifier_call_chain(FB_EVENT_SUSPEND, &event); -- 2.20.1
For symmetry reasons with do_unblank_screen, except without the oops_in_progress special case. Just a drive-by annotation while I'm trying to untangle the fbcon vs. fbdev screen blank/unblank maze. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Nicolas Pitre <nicolas.pitre@linaro.org> Cc: Adam Borowski <kilobyte@angband.pl> Cc: Martin Hostettler <textshell@uchuujin.de> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Mikulas Patocka <mpatocka@redhat.com> --- drivers/tty/vt/vt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 650c66886c80..8b4b3a49ec33 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -4158,6 +4158,8 @@ void do_blank_screen(int entering_gfx) struct vc_data *vc = vc_cons[fg_console].d; int i; + might_sleep(); + WARN_CONSOLE_UNLOCKED(); if (console_blanked) { -- 2.20.1
I honestly have no idea what the subtle differences between con_is_visible, con_is_fg (internal to vt.c) and con_is_bound are. But it looks like both vc->vc_display_fg and con_driver_map are protected by the console_lock, so probably better if we hold that when checking this. To do that I had to deinline the con_is_visible function. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Nicolas Pitre <nicolas.pitre@linaro.org> Cc: Martin Hostettler <textshell@uchuujin.de> Cc: Adam Borowski <kilobyte@angband.pl> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Mikulas Patocka <mpatocka@redhat.com> --- drivers/tty/vt/vt.c | 16 ++++++++++++++++ include/linux/console_struct.h | 5 +---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 8b4b3a49ec33..0ed234ac5a6b 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -3814,6 +3814,8 @@ int con_is_bound(const struct consw *csw) { int i, bound = 0; + WARN_CONSOLE_UNLOCKED(); + for (i = 0; i < MAX_NR_CONSOLES; i++) { if (con_driver_map[i] == csw) { bound = 1; @@ -3825,6 +3827,20 @@ int con_is_bound(const struct consw *csw) } EXPORT_SYMBOL(con_is_bound); +/** + * con_is_visible - checks whether the current console is visible + * @vc: virtual console + * + * RETURNS: zero if not visible, nonzero if visible + */ +bool con_is_visible(const struct vc_data *vc) +{ + WARN_CONSOLE_UNLOCKED(); + + return *vc->vc_display_fg == vc; +} +EXPORT_SYMBOL(con_is_visible); + /** * con_debug_enter - prepare the console for the kernel debugger * @sw: console driver diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index ed798e114663..24d4c16e3ae0 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h @@ -168,9 +168,6 @@ extern void vc_SAK(struct work_struct *work); #define CUR_DEFAULT CUR_UNDERLINE -static inline bool con_is_visible(const struct vc_data *vc) -{ - return *vc->vc_display_fg == vc; -} +bool con_is_visible(const struct vc_data *vc); #endif /* _LINUX_CONSOLE_STRUCT_H */ -- 2.20.1
I honestly have no idea what the subtle differences between con_is_visible, con_is_fg (internal to vt.c) and con_is_bound are. But it looks like both vc->vc_display_fg and con_driver_map are protected by the console_lock, so probably better if we hold that when checking this. To do that I had to deinline the con_is_visible function. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Nicolas Pitre <nicolas.pitre@linaro.org> Cc: Martin Hostettler <textshell@uchuujin.de> Cc: Adam Borowski <kilobyte@angband.pl> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Mikulas Patocka <mpatocka@redhat.com> --- drivers/tty/vt/vt.c | 16 ++++++++++++++++ include/linux/console_struct.h | 5 +---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 8b4b3a49ec33..0ed234ac5a6b 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -3814,6 +3814,8 @@ int con_is_bound(const struct consw *csw) { int i, bound = 0; + WARN_CONSOLE_UNLOCKED(); + for (i = 0; i < MAX_NR_CONSOLES; i++) { if (con_driver_map[i] == csw) { bound = 1; @@ -3825,6 +3827,20 @@ int con_is_bound(const struct consw *csw) } EXPORT_SYMBOL(con_is_bound); +/** + * con_is_visible - checks whether the current console is visible + * @vc: virtual console + * + * RETURNS: zero if not visible, nonzero if visible + */ +bool con_is_visible(const struct vc_data *vc) +{ + WARN_CONSOLE_UNLOCKED(); + + return *vc->vc_display_fg == vc; +} +EXPORT_SYMBOL(con_is_visible); + /** * con_debug_enter - prepare the console for the kernel debugger * @sw: console driver diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index ed798e114663..24d4c16e3ae0 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h @@ -168,9 +168,6 @@ extern void vc_SAK(struct work_struct *work); #define CUR_DEFAULT CUR_UNDERLINE -static inline bool con_is_visible(const struct vc_data *vc) -{ - return *vc->vc_display_fg == vc; -} +bool con_is_visible(const struct vc_data *vc); #endif /* _LINUX_CONSOLE_STRUCT_H */ -- 2.20.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Motivated because it contains a struct display, which is a fbcon internal data structure that I want to rename. It seems to have been formerly used in drivers, but that's very long time ago. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> --- drivers/video/fbdev/sa1100fb.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/drivers/video/fbdev/sa1100fb.c b/drivers/video/fbdev/sa1100fb.c index 15ae50063296..f7f8dee044b1 100644 --- a/drivers/video/fbdev/sa1100fb.c +++ b/drivers/video/fbdev/sa1100fb.c @@ -974,35 +974,10 @@ static void sa1100fb_task(struct work_struct *w) */ static unsigned int sa1100fb_min_dma_period(struct sa1100fb_info *fbi) { -#if 0 - unsigned int min_period = (unsigned int)-1; - int i; - - for (i = 0; i < MAX_NR_CONSOLES; i++) { - struct display *disp = &fb_display[i]; - unsigned int period; - - /* - * Do we own this display? - */ - if (disp->fb_info != &fbi->fb) - continue; - - /* - * Ok, calculate its DMA period - */ - period = sa1100fb_display_dma_period(&disp->var); - if (period < min_period) - min_period = period; - } - - return min_period; -#else /* * FIXME: we need to verify _all_ consoles. */ return sa1100fb_display_dma_period(&fbi->fb.var); -#endif } /* -- 2.20.1
Motivated because it contains a struct display, which is a fbcon internal data structure that I want to rename. It seems to have been formerly used in drivers, but that's very long time ago. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> --- drivers/video/fbdev/sa1100fb.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/drivers/video/fbdev/sa1100fb.c b/drivers/video/fbdev/sa1100fb.c index 15ae50063296..f7f8dee044b1 100644 --- a/drivers/video/fbdev/sa1100fb.c +++ b/drivers/video/fbdev/sa1100fb.c @@ -974,35 +974,10 @@ static void sa1100fb_task(struct work_struct *w) */ static unsigned int sa1100fb_min_dma_period(struct sa1100fb_info *fbi) { -#if 0 - unsigned int min_period = (unsigned int)-1; - int i; - - for (i = 0; i < MAX_NR_CONSOLES; i++) { - struct display *disp = &fb_display[i]; - unsigned int period; - - /* - * Do we own this display? - */ - if (disp->fb_info != &fbi->fb) - continue; - - /* - * Ok, calculate its DMA period - */ - period = sa1100fb_display_dma_period(&disp->var); - if (period < min_period) - min_period = period; - } - - return min_period; -#else /* * FIXME: we need to verify _all_ consoles. */ return sa1100fb_display_dma_period(&fbi->fb.var); -#endif } /* -- 2.20.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Entirely unused. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Russell King <linux@armlinux.org.uk> Cc: linux-arm-kernel@lists.infradead.org --- drivers/video/fbdev/cyber2000fb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/video/fbdev/cyber2000fb.c b/drivers/video/fbdev/cyber2000fb.c index 9a5751cb4e16..452ef07b3a06 100644 --- a/drivers/video/fbdev/cyber2000fb.c +++ b/drivers/video/fbdev/cyber2000fb.c @@ -61,7 +61,6 @@ struct cfb_info { struct fb_info fb; struct display_switch *dispsw; - struct display *display; unsigned char __iomem *region; unsigned char __iomem *regs; u_int id; -- 2.20.1
Entirely unused. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Russell King <linux@armlinux.org.uk> Cc: linux-arm-kernel@lists.infradead.org --- drivers/video/fbdev/cyber2000fb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/video/fbdev/cyber2000fb.c b/drivers/video/fbdev/cyber2000fb.c index 9a5751cb4e16..452ef07b3a06 100644 --- a/drivers/video/fbdev/cyber2000fb.c +++ b/drivers/video/fbdev/cyber2000fb.c @@ -61,7 +61,6 @@ struct cfb_info { struct fb_info fb; struct display_switch *dispsw; - struct display *display; unsigned char __iomem *region; unsigned char __iomem *regs; u_int id; -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Motivated because it contains a struct display, which is a fbcon internal data structure that I want to rename. It seems to have been formerly used in drivers, but that's very long time ago. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Paul Mackerras <paulus@samba.org> Cc: linux-fbdev@vger.kernel.org --- drivers/video/fbdev/aty/aty128fb.c | 64 ------------------------------ 1 file changed, 64 deletions(-) diff --git a/drivers/video/fbdev/aty/aty128fb.c b/drivers/video/fbdev/aty/aty128fb.c index 6cc46867ff57..c022ad7a49c2 100644 --- a/drivers/video/fbdev/aty/aty128fb.c +++ b/drivers/video/fbdev/aty/aty128fb.c @@ -2349,70 +2349,6 @@ static int aty128fb_ioctl(struct fb_info *info, u_int cmd, u_long arg) return -EINVAL; } -#if 0 - /* - * Accelerated functions - */ - -static inline void aty128_rectcopy(int srcx, int srcy, int dstx, int dsty, - u_int width, u_int height, - struct fb_info_aty128 *par) -{ - u32 save_dp_datatype, save_dp_cntl, dstval; - - if (!width || !height) - return; - - dstval = depth_to_dst(par->current_par.crtc.depth); - if (dstval == DST_24BPP) { - srcx *= 3; - dstx *= 3; - width *= 3; - } else if (dstval == -EINVAL) { - printk("aty128fb: invalid depth or RGBA\n"); - return; - } - - wait_for_fifo(2, par); - save_dp_datatype = aty_ld_le32(DP_DATATYPE); - save_dp_cntl = aty_ld_le32(DP_CNTL); - - wait_for_fifo(6, par); - aty_st_le32(SRC_Y_X, (srcy << 16) | srcx); - aty_st_le32(DP_MIX, ROP3_SRCCOPY | DP_SRC_RECT); - aty_st_le32(DP_CNTL, DST_X_LEFT_TO_RIGHT | DST_Y_TOP_TO_BOTTOM); - aty_st_le32(DP_DATATYPE, save_dp_datatype | dstval | SRC_DSTCOLOR); - - aty_st_le32(DST_Y_X, (dsty << 16) | dstx); - aty_st_le32(DST_HEIGHT_WIDTH, (height << 16) | width); - - par->blitter_may_be_busy = 1; - - wait_for_fifo(2, par); - aty_st_le32(DP_DATATYPE, save_dp_datatype); - aty_st_le32(DP_CNTL, save_dp_cntl); -} - - - /* - * Text mode accelerated functions - */ - -static void fbcon_aty128_bmove(struct display *p, int sy, int sx, int dy, - int dx, int height, int width) -{ - sx *= fontwidth(p); - sy *= fontheight(p); - dx *= fontwidth(p); - dy *= fontheight(p); - width *= fontwidth(p); - height *= fontheight(p); - - aty128_rectcopy(sx, sy, dx, dy, width, height, - (struct fb_info_aty128 *)p->fb_info); -} -#endif /* 0 */ - static void aty128_set_suspend(struct aty128fb_par *par, int suspend) { u32 pmgt; -- 2.20.1
Motivated because it contains a struct display, which is a fbcon internal data structure that I want to rename. It seems to have been formerly used in drivers, but that's very long time ago. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Paul Mackerras <paulus@samba.org> Cc: linux-fbdev@vger.kernel.org --- drivers/video/fbdev/aty/aty128fb.c | 64 ------------------------------ 1 file changed, 64 deletions(-) diff --git a/drivers/video/fbdev/aty/aty128fb.c b/drivers/video/fbdev/aty/aty128fb.c index 6cc46867ff57..c022ad7a49c2 100644 --- a/drivers/video/fbdev/aty/aty128fb.c +++ b/drivers/video/fbdev/aty/aty128fb.c @@ -2349,70 +2349,6 @@ static int aty128fb_ioctl(struct fb_info *info, u_int cmd, u_long arg) return -EINVAL; } -#if 0 - /* - * Accelerated functions - */ - -static inline void aty128_rectcopy(int srcx, int srcy, int dstx, int dsty, - u_int width, u_int height, - struct fb_info_aty128 *par) -{ - u32 save_dp_datatype, save_dp_cntl, dstval; - - if (!width || !height) - return; - - dstval = depth_to_dst(par->current_par.crtc.depth); - if (dstval = DST_24BPP) { - srcx *= 3; - dstx *= 3; - width *= 3; - } else if (dstval = -EINVAL) { - printk("aty128fb: invalid depth or RGBA\n"); - return; - } - - wait_for_fifo(2, par); - save_dp_datatype = aty_ld_le32(DP_DATATYPE); - save_dp_cntl = aty_ld_le32(DP_CNTL); - - wait_for_fifo(6, par); - aty_st_le32(SRC_Y_X, (srcy << 16) | srcx); - aty_st_le32(DP_MIX, ROP3_SRCCOPY | DP_SRC_RECT); - aty_st_le32(DP_CNTL, DST_X_LEFT_TO_RIGHT | DST_Y_TOP_TO_BOTTOM); - aty_st_le32(DP_DATATYPE, save_dp_datatype | dstval | SRC_DSTCOLOR); - - aty_st_le32(DST_Y_X, (dsty << 16) | dstx); - aty_st_le32(DST_HEIGHT_WIDTH, (height << 16) | width); - - par->blitter_may_be_busy = 1; - - wait_for_fifo(2, par); - aty_st_le32(DP_DATATYPE, save_dp_datatype); - aty_st_le32(DP_CNTL, save_dp_cntl); -} - - - /* - * Text mode accelerated functions - */ - -static void fbcon_aty128_bmove(struct display *p, int sy, int sx, int dy, - int dx, int height, int width) -{ - sx *= fontwidth(p); - sy *= fontheight(p); - dx *= fontwidth(p); - dy *= fontheight(p); - width *= fontwidth(p); - height *= fontheight(p); - - aty128_rectcopy(sx, sy, dx, dy, width, height, - (struct fb_info_aty128 *)p->fb_info); -} -#endif /* 0 */ - static void aty128_set_suspend(struct aty128fb_par *par, int suspend) { u32 pmgt; -- 2.20.1
This was formerly used in fbdev drivers (not sure why, predates most git history), but now it's entirely an fbcon internal thing. Give it a more specific name. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Kees Cook <keescook@chromium.org> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Konstantin Khorenko <khorenko@virtuozzo.com> Cc: Peter Rosin <peda@axentia.se> Cc: Yisheng Xie <ysxie@foxmail.com> --- drivers/video/fbdev/core/fbcon.c | 74 ++++++++++++++++---------------- drivers/video/fbdev/core/fbcon.h | 6 +-- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index cd059a801662..2b2082615ca1 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -93,7 +93,7 @@ enum { FBCON_LOGO_DONTSHOW = -3 /* do not show the logo */ }; -static struct display fb_display[MAX_NR_CONSOLES]; +static struct fbcon_display fb_display[MAX_NR_CONSOLES]; static signed char con2fb_map[MAX_NR_CONSOLES]; static signed char con2fb_map_boot[MAX_NR_CONSOLES]; @@ -185,11 +185,11 @@ static __inline__ void ywrap_up(struct vc_data *vc, int count); static __inline__ void ywrap_down(struct vc_data *vc, int count); static __inline__ void ypan_up(struct vc_data *vc, int count); static __inline__ void ypan_down(struct vc_data *vc, int count); -static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int sx, +static void fbcon_bmove_rec(struct vc_data *vc, struct fbcon_display *p, int sy, int sx, int dy, int dx, int height, int width, u_int y_break); static void fbcon_set_disp(struct fb_info *info, struct fb_var_screeninfo *var, int unit); -static void fbcon_redraw_move(struct vc_data *vc, struct display *p, +static void fbcon_redraw_move(struct vc_data *vc, struct fbcon_display *p, int line, int count, int dy); static void fbcon_modechanged(struct fb_info *info); static void fbcon_set_all_vcs(struct fb_info *info); @@ -220,7 +220,7 @@ static void fbcon_rotate(struct fb_info *info, u32 rotate) fb_info = registered_fb[con2fb_map[ops->currcon]]; if (info == fb_info) { - struct display *p = &fb_display[ops->currcon]; + struct fbcon_display *p = &fb_display[ops->currcon]; if (rotate < 4) p->con_rotate = rotate; @@ -235,7 +235,7 @@ static void fbcon_rotate_all(struct fb_info *info, u32 rotate) { struct fbcon_ops *ops = info->fbcon_par; struct vc_data *vc; - struct display *p; + struct fbcon_display *p; int i; if (!ops || ops->currcon < 0 || rotate > 3) @@ -900,7 +900,7 @@ static int set_con2fb_map(int unit, int newidx, int user) * Low Level Operations */ /* NOTE: fbcon cannot be __init: it may be called from do_take_over_console later */ -static int var_to_display(struct display *disp, +static int var_to_display(struct fbcon_display *disp, struct fb_var_screeninfo *var, struct fb_info *info) { @@ -925,7 +925,7 @@ static int var_to_display(struct display *disp, } static void display_to_var(struct fb_var_screeninfo *var, - struct display *disp) + struct fbcon_display *disp) { fb_videomode_to_var(var, disp->mode); var->xres_virtual = disp->xres_virtual; @@ -946,7 +946,7 @@ static void display_to_var(struct fb_var_screeninfo *var, static const char *fbcon_startup(void) { const char *display_desc = "frame buffer device"; - struct display *p = &fb_display[fg_console]; + struct fbcon_display *p = &fb_display[fg_console]; struct vc_data *vc = vc_cons[fg_console].d; const struct font_desc *font = NULL; struct module *owner; @@ -1060,7 +1060,7 @@ static void fbcon_init(struct vc_data *vc, int init) struct fbcon_ops *ops; struct vc_data **default_mode = vc->vc_display_fg; struct vc_data *svc = *default_mode; - struct display *t, *p = &fb_display[vc->vc_num]; + struct fbcon_display *t, *p = &fb_display[vc->vc_num]; int logo = 1, new_rows, new_cols, rows, cols, charcnt = 256; int cap, ret; @@ -1203,7 +1203,7 @@ static void fbcon_init(struct vc_data *vc, int init) ops->p = &fb_display[fg_console]; } -static void fbcon_free_font(struct display *p, bool freefont) +static void fbcon_free_font(struct fbcon_display *p, bool freefont) { if (freefont && p->userfont && p->fontdata && (--REFCOUNT(p->fontdata) == 0)) kfree(p->fontdata - FONT_EXTRA_WORDS * sizeof(int)); @@ -1215,7 +1215,7 @@ static void set_vc_hi_font(struct vc_data *vc, bool set); static void fbcon_deinit(struct vc_data *vc) { - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; struct fb_info *info; struct fbcon_ops *ops; int idx; @@ -1288,7 +1288,7 @@ static void fbcon_clear(struct vc_data *vc, int sy, int sx, int height, struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; struct fbcon_ops *ops = info->fbcon_par; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; u_int y_break; if (fbcon_is_inactive(vc, info)) @@ -1324,7 +1324,7 @@ static void fbcon_putcs(struct vc_data *vc, const unsigned short *s, int count, int ypos, int xpos) { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; struct fbcon_ops *ops = info->fbcon_par; if (!fbcon_is_inactive(vc, info)) @@ -1388,7 +1388,7 @@ static int scrollback_current = 0; static void fbcon_set_disp(struct fb_info *info, struct fb_var_screeninfo *var, int unit) { - struct display *p, *t; + struct fbcon_display *p, *t; struct vc_data **default_mode, *vc; struct vc_data *svc; struct fbcon_ops *ops = info->fbcon_par; @@ -1457,7 +1457,7 @@ static __inline__ void ywrap_up(struct vc_data *vc, int count) { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; struct fbcon_ops *ops = info->fbcon_par; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; p->yscroll += count; if (p->yscroll >= p->vrows) /* Deal with wrap */ @@ -1476,7 +1476,7 @@ static __inline__ void ywrap_down(struct vc_data *vc, int count) { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; struct fbcon_ops *ops = info->fbcon_par; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; p->yscroll -= count; if (p->yscroll < 0) /* Deal with wrap */ @@ -1494,7 +1494,7 @@ static __inline__ void ywrap_down(struct vc_data *vc, int count) static __inline__ void ypan_up(struct vc_data *vc, int count) { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; struct fbcon_ops *ops = info->fbcon_par; p->yscroll += count; @@ -1519,7 +1519,7 @@ static __inline__ void ypan_up_redraw(struct vc_data *vc, int t, int count) { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; struct fbcon_ops *ops = info->fbcon_par; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; p->yscroll += count; @@ -1542,7 +1542,7 @@ static __inline__ void ypan_up_redraw(struct vc_data *vc, int t, int count) static __inline__ void ypan_down(struct vc_data *vc, int count) { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; struct fbcon_ops *ops = info->fbcon_par; p->yscroll -= count; @@ -1567,7 +1567,7 @@ static __inline__ void ypan_down_redraw(struct vc_data *vc, int t, int count) { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; struct fbcon_ops *ops = info->fbcon_par; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; p->yscroll -= count; @@ -1587,7 +1587,7 @@ static __inline__ void ypan_down_redraw(struct vc_data *vc, int t, int count) scrollback_current = 0; } -static void fbcon_redraw_softback(struct vc_data *vc, struct display *p, +static void fbcon_redraw_softback(struct vc_data *vc, struct fbcon_display *p, long delta) { int count = vc->vc_rows; @@ -1680,7 +1680,7 @@ static void fbcon_redraw_softback(struct vc_data *vc, struct display *p, } } -static void fbcon_redraw_move(struct vc_data *vc, struct display *p, +static void fbcon_redraw_move(struct vc_data *vc, struct fbcon_display *p, int line, int count, int dy) { unsigned short *s = (unsigned short *) @@ -1715,7 +1715,7 @@ static void fbcon_redraw_move(struct vc_data *vc, struct display *p, } static void fbcon_redraw_blit(struct vc_data *vc, struct fb_info *info, - struct display *p, int line, int count, int ycount) + struct fbcon_display *p, int line, int count, int ycount) { int offset = ycount * vc->vc_cols; unsigned short *d = (unsigned short *) @@ -1764,7 +1764,7 @@ static void fbcon_redraw_blit(struct vc_data *vc, struct fb_info *info, } } -static void fbcon_redraw(struct vc_data *vc, struct display *p, +static void fbcon_redraw(struct vc_data *vc, struct fbcon_display *p, int line, int count, int offset) { unsigned short *d = (unsigned short *) @@ -1848,7 +1848,7 @@ static bool fbcon_scroll(struct vc_data *vc, unsigned int t, unsigned int b, enum con_scroll dir, unsigned int count) { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; int scroll_partial = info->flags & FBINFO_PARTIAL_PAN_OK; if (fbcon_is_inactive(vc, info)) @@ -2052,7 +2052,7 @@ static void fbcon_bmove(struct vc_data *vc, int sy, int sx, int dy, int dx, int height, int width) { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; if (fbcon_is_inactive(vc, info)) return; @@ -2071,7 +2071,7 @@ static void fbcon_bmove(struct vc_data *vc, int sy, int sx, int dy, int dx, p->vrows - p->yscroll); } -static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int sx, +static void fbcon_bmove_rec(struct vc_data *vc, struct fbcon_display *p, int sy, int sx, int dy, int dx, int height, int width, u_int y_break) { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; @@ -2113,7 +2113,7 @@ static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int s height, width); } -static void updatescrollmode(struct display *p, +static void updatescrollmode(struct fbcon_display *p, struct fb_info *info, struct vc_data *vc) { @@ -2165,7 +2165,7 @@ static int fbcon_resize(struct vc_data *vc, unsigned int width, { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; struct fbcon_ops *ops = info->fbcon_par; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; struct fb_var_screeninfo var = info->var; int x_diff, y_diff, virt_w, virt_h, virt_fw, virt_fh; @@ -2210,7 +2210,7 @@ static int fbcon_switch(struct vc_data *vc) { struct fb_info *info, *old_info = NULL; struct fbcon_ops *ops; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; struct fb_var_screeninfo var; int i, ret, prev_console, charcnt = 256; @@ -2553,7 +2553,7 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; struct fbcon_ops *ops = info->fbcon_par; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; int resize; int cnt; char *old_data = NULL; @@ -2601,7 +2601,7 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, static int fbcon_copy_font(struct vc_data *vc, int con) { - struct display *od = &fb_display[con]; + struct fbcon_display *od = &fb_display[con]; struct console_font *f = &vc->vc_font; if (od->fontdata == f->data) @@ -2826,7 +2826,7 @@ static void fbcon_scrolldelta(struct vc_data *vc, int lines) { struct fb_info *info = registered_fb[con2fb_map[fg_console]]; struct fbcon_ops *ops = info->fbcon_par; - struct display *disp = &fb_display[fg_console]; + struct fbcon_display *disp = &fb_display[fg_console]; int offset, limit, scrollback_old; if (softback_top) { @@ -2947,7 +2947,7 @@ static void fbcon_modechanged(struct fb_info *info) { struct fbcon_ops *ops = info->fbcon_par; struct vc_data *vc; - struct display *p; + struct fbcon_display *p; int rows, cols; if (!ops || ops->currcon < 0) @@ -2987,7 +2987,7 @@ static void fbcon_set_all_vcs(struct fb_info *info) { struct fbcon_ops *ops = info->fbcon_par; struct vc_data *vc; - struct display *p; + struct fbcon_display *p; int i, rows, cols, fg = -1; if (!ops || ops->currcon < 0) @@ -3022,7 +3022,7 @@ static int fbcon_mode_deleted(struct fb_info *info, struct fb_videomode *mode) { struct fb_info *fb_info; - struct display *p; + struct fbcon_display *p; int i, j, found = 0; /* before deletion, ensure that mode is not in use */ @@ -3294,7 +3294,7 @@ static void fbcon_get_requirement(struct fb_info *info, struct fb_blit_caps *caps) { struct vc_data *vc; - struct display *p; + struct fbcon_display *p; if (caps->flags) { int i, charcnt; diff --git a/drivers/video/fbdev/core/fbcon.h b/drivers/video/fbdev/core/fbcon.h index 21912a3ba32f..20dea853765f 100644 --- a/drivers/video/fbdev/core/fbcon.h +++ b/drivers/video/fbdev/core/fbcon.h @@ -25,7 +25,7 @@ * low-level frame buffer device */ -struct display { +struct fbcon_display { /* Filled in by the low-level console driver */ const u_char *fontdata; int userfont; /* != 0 if fontdata kmalloc()ed */ @@ -68,7 +68,7 @@ struct fbcon_ops { struct fb_var_screeninfo var; /* copy of the current fb_var_screeninfo */ struct timer_list cursor_timer; /* Cursor timer */ struct fb_cursor cursor_state; - struct display *p; + struct fbcon_display *p; struct fb_info *info; int currcon; /* Current VC. */ int cur_blink_jiffies; @@ -225,7 +225,7 @@ extern int soft_cursor(struct fb_info *info, struct fb_cursor *cursor); #define FBCON_ATTRIBUTE_REVERSE 2 #define FBCON_ATTRIBUTE_BOLD 4 -static inline int real_y(struct display *p, int ypos) +static inline int real_y(struct fbcon_display *p, int ypos) { int rows = p->vrows; -- 2.20.1
This was formerly used in fbdev drivers (not sure why, predates most git history), but now it's entirely an fbcon internal thing. Give it a more specific name. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Kees Cook <keescook@chromium.org> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Konstantin Khorenko <khorenko@virtuozzo.com> Cc: Peter Rosin <peda@axentia.se> Cc: Yisheng Xie <ysxie@foxmail.com> --- drivers/video/fbdev/core/fbcon.c | 74 ++++++++++++++++---------------- drivers/video/fbdev/core/fbcon.h | 6 +-- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index cd059a801662..2b2082615ca1 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -93,7 +93,7 @@ enum { FBCON_LOGO_DONTSHOW = -3 /* do not show the logo */ }; -static struct display fb_display[MAX_NR_CONSOLES]; +static struct fbcon_display fb_display[MAX_NR_CONSOLES]; static signed char con2fb_map[MAX_NR_CONSOLES]; static signed char con2fb_map_boot[MAX_NR_CONSOLES]; @@ -185,11 +185,11 @@ static __inline__ void ywrap_up(struct vc_data *vc, int count); static __inline__ void ywrap_down(struct vc_data *vc, int count); static __inline__ void ypan_up(struct vc_data *vc, int count); static __inline__ void ypan_down(struct vc_data *vc, int count); -static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int sx, +static void fbcon_bmove_rec(struct vc_data *vc, struct fbcon_display *p, int sy, int sx, int dy, int dx, int height, int width, u_int y_break); static void fbcon_set_disp(struct fb_info *info, struct fb_var_screeninfo *var, int unit); -static void fbcon_redraw_move(struct vc_data *vc, struct display *p, +static void fbcon_redraw_move(struct vc_data *vc, struct fbcon_display *p, int line, int count, int dy); static void fbcon_modechanged(struct fb_info *info); static void fbcon_set_all_vcs(struct fb_info *info); @@ -220,7 +220,7 @@ static void fbcon_rotate(struct fb_info *info, u32 rotate) fb_info = registered_fb[con2fb_map[ops->currcon]]; if (info == fb_info) { - struct display *p = &fb_display[ops->currcon]; + struct fbcon_display *p = &fb_display[ops->currcon]; if (rotate < 4) p->con_rotate = rotate; @@ -235,7 +235,7 @@ static void fbcon_rotate_all(struct fb_info *info, u32 rotate) { struct fbcon_ops *ops = info->fbcon_par; struct vc_data *vc; - struct display *p; + struct fbcon_display *p; int i; if (!ops || ops->currcon < 0 || rotate > 3) @@ -900,7 +900,7 @@ static int set_con2fb_map(int unit, int newidx, int user) * Low Level Operations */ /* NOTE: fbcon cannot be __init: it may be called from do_take_over_console later */ -static int var_to_display(struct display *disp, +static int var_to_display(struct fbcon_display *disp, struct fb_var_screeninfo *var, struct fb_info *info) { @@ -925,7 +925,7 @@ static int var_to_display(struct display *disp, } static void display_to_var(struct fb_var_screeninfo *var, - struct display *disp) + struct fbcon_display *disp) { fb_videomode_to_var(var, disp->mode); var->xres_virtual = disp->xres_virtual; @@ -946,7 +946,7 @@ static void display_to_var(struct fb_var_screeninfo *var, static const char *fbcon_startup(void) { const char *display_desc = "frame buffer device"; - struct display *p = &fb_display[fg_console]; + struct fbcon_display *p = &fb_display[fg_console]; struct vc_data *vc = vc_cons[fg_console].d; const struct font_desc *font = NULL; struct module *owner; @@ -1060,7 +1060,7 @@ static void fbcon_init(struct vc_data *vc, int init) struct fbcon_ops *ops; struct vc_data **default_mode = vc->vc_display_fg; struct vc_data *svc = *default_mode; - struct display *t, *p = &fb_display[vc->vc_num]; + struct fbcon_display *t, *p = &fb_display[vc->vc_num]; int logo = 1, new_rows, new_cols, rows, cols, charcnt = 256; int cap, ret; @@ -1203,7 +1203,7 @@ static void fbcon_init(struct vc_data *vc, int init) ops->p = &fb_display[fg_console]; } -static void fbcon_free_font(struct display *p, bool freefont) +static void fbcon_free_font(struct fbcon_display *p, bool freefont) { if (freefont && p->userfont && p->fontdata && (--REFCOUNT(p->fontdata) == 0)) kfree(p->fontdata - FONT_EXTRA_WORDS * sizeof(int)); @@ -1215,7 +1215,7 @@ static void set_vc_hi_font(struct vc_data *vc, bool set); static void fbcon_deinit(struct vc_data *vc) { - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; struct fb_info *info; struct fbcon_ops *ops; int idx; @@ -1288,7 +1288,7 @@ static void fbcon_clear(struct vc_data *vc, int sy, int sx, int height, struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; struct fbcon_ops *ops = info->fbcon_par; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; u_int y_break; if (fbcon_is_inactive(vc, info)) @@ -1324,7 +1324,7 @@ static void fbcon_putcs(struct vc_data *vc, const unsigned short *s, int count, int ypos, int xpos) { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; struct fbcon_ops *ops = info->fbcon_par; if (!fbcon_is_inactive(vc, info)) @@ -1388,7 +1388,7 @@ static int scrollback_current = 0; static void fbcon_set_disp(struct fb_info *info, struct fb_var_screeninfo *var, int unit) { - struct display *p, *t; + struct fbcon_display *p, *t; struct vc_data **default_mode, *vc; struct vc_data *svc; struct fbcon_ops *ops = info->fbcon_par; @@ -1457,7 +1457,7 @@ static __inline__ void ywrap_up(struct vc_data *vc, int count) { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; struct fbcon_ops *ops = info->fbcon_par; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; p->yscroll += count; if (p->yscroll >= p->vrows) /* Deal with wrap */ @@ -1476,7 +1476,7 @@ static __inline__ void ywrap_down(struct vc_data *vc, int count) { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; struct fbcon_ops *ops = info->fbcon_par; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; p->yscroll -= count; if (p->yscroll < 0) /* Deal with wrap */ @@ -1494,7 +1494,7 @@ static __inline__ void ywrap_down(struct vc_data *vc, int count) static __inline__ void ypan_up(struct vc_data *vc, int count) { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; struct fbcon_ops *ops = info->fbcon_par; p->yscroll += count; @@ -1519,7 +1519,7 @@ static __inline__ void ypan_up_redraw(struct vc_data *vc, int t, int count) { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; struct fbcon_ops *ops = info->fbcon_par; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; p->yscroll += count; @@ -1542,7 +1542,7 @@ static __inline__ void ypan_up_redraw(struct vc_data *vc, int t, int count) static __inline__ void ypan_down(struct vc_data *vc, int count) { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; struct fbcon_ops *ops = info->fbcon_par; p->yscroll -= count; @@ -1567,7 +1567,7 @@ static __inline__ void ypan_down_redraw(struct vc_data *vc, int t, int count) { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; struct fbcon_ops *ops = info->fbcon_par; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; p->yscroll -= count; @@ -1587,7 +1587,7 @@ static __inline__ void ypan_down_redraw(struct vc_data *vc, int t, int count) scrollback_current = 0; } -static void fbcon_redraw_softback(struct vc_data *vc, struct display *p, +static void fbcon_redraw_softback(struct vc_data *vc, struct fbcon_display *p, long delta) { int count = vc->vc_rows; @@ -1680,7 +1680,7 @@ static void fbcon_redraw_softback(struct vc_data *vc, struct display *p, } } -static void fbcon_redraw_move(struct vc_data *vc, struct display *p, +static void fbcon_redraw_move(struct vc_data *vc, struct fbcon_display *p, int line, int count, int dy) { unsigned short *s = (unsigned short *) @@ -1715,7 +1715,7 @@ static void fbcon_redraw_move(struct vc_data *vc, struct display *p, } static void fbcon_redraw_blit(struct vc_data *vc, struct fb_info *info, - struct display *p, int line, int count, int ycount) + struct fbcon_display *p, int line, int count, int ycount) { int offset = ycount * vc->vc_cols; unsigned short *d = (unsigned short *) @@ -1764,7 +1764,7 @@ static void fbcon_redraw_blit(struct vc_data *vc, struct fb_info *info, } } -static void fbcon_redraw(struct vc_data *vc, struct display *p, +static void fbcon_redraw(struct vc_data *vc, struct fbcon_display *p, int line, int count, int offset) { unsigned short *d = (unsigned short *) @@ -1848,7 +1848,7 @@ static bool fbcon_scroll(struct vc_data *vc, unsigned int t, unsigned int b, enum con_scroll dir, unsigned int count) { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; int scroll_partial = info->flags & FBINFO_PARTIAL_PAN_OK; if (fbcon_is_inactive(vc, info)) @@ -2052,7 +2052,7 @@ static void fbcon_bmove(struct vc_data *vc, int sy, int sx, int dy, int dx, int height, int width) { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; if (fbcon_is_inactive(vc, info)) return; @@ -2071,7 +2071,7 @@ static void fbcon_bmove(struct vc_data *vc, int sy, int sx, int dy, int dx, p->vrows - p->yscroll); } -static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int sx, +static void fbcon_bmove_rec(struct vc_data *vc, struct fbcon_display *p, int sy, int sx, int dy, int dx, int height, int width, u_int y_break) { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; @@ -2113,7 +2113,7 @@ static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int s height, width); } -static void updatescrollmode(struct display *p, +static void updatescrollmode(struct fbcon_display *p, struct fb_info *info, struct vc_data *vc) { @@ -2165,7 +2165,7 @@ static int fbcon_resize(struct vc_data *vc, unsigned int width, { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; struct fbcon_ops *ops = info->fbcon_par; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; struct fb_var_screeninfo var = info->var; int x_diff, y_diff, virt_w, virt_h, virt_fw, virt_fh; @@ -2210,7 +2210,7 @@ static int fbcon_switch(struct vc_data *vc) { struct fb_info *info, *old_info = NULL; struct fbcon_ops *ops; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; struct fb_var_screeninfo var; int i, ret, prev_console, charcnt = 256; @@ -2553,7 +2553,7 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; struct fbcon_ops *ops = info->fbcon_par; - struct display *p = &fb_display[vc->vc_num]; + struct fbcon_display *p = &fb_display[vc->vc_num]; int resize; int cnt; char *old_data = NULL; @@ -2601,7 +2601,7 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, static int fbcon_copy_font(struct vc_data *vc, int con) { - struct display *od = &fb_display[con]; + struct fbcon_display *od = &fb_display[con]; struct console_font *f = &vc->vc_font; if (od->fontdata == f->data) @@ -2826,7 +2826,7 @@ static void fbcon_scrolldelta(struct vc_data *vc, int lines) { struct fb_info *info = registered_fb[con2fb_map[fg_console]]; struct fbcon_ops *ops = info->fbcon_par; - struct display *disp = &fb_display[fg_console]; + struct fbcon_display *disp = &fb_display[fg_console]; int offset, limit, scrollback_old; if (softback_top) { @@ -2947,7 +2947,7 @@ static void fbcon_modechanged(struct fb_info *info) { struct fbcon_ops *ops = info->fbcon_par; struct vc_data *vc; - struct display *p; + struct fbcon_display *p; int rows, cols; if (!ops || ops->currcon < 0) @@ -2987,7 +2987,7 @@ static void fbcon_set_all_vcs(struct fb_info *info) { struct fbcon_ops *ops = info->fbcon_par; struct vc_data *vc; - struct display *p; + struct fbcon_display *p; int i, rows, cols, fg = -1; if (!ops || ops->currcon < 0) @@ -3022,7 +3022,7 @@ static int fbcon_mode_deleted(struct fb_info *info, struct fb_videomode *mode) { struct fb_info *fb_info; - struct display *p; + struct fbcon_display *p; int i, j, found = 0; /* before deletion, ensure that mode is not in use */ @@ -3294,7 +3294,7 @@ static void fbcon_get_requirement(struct fb_info *info, struct fb_blit_caps *caps) { struct vc_data *vc; - struct display *p; + struct fbcon_display *p; if (caps->flags) { int i, charcnt; diff --git a/drivers/video/fbdev/core/fbcon.h b/drivers/video/fbdev/core/fbcon.h index 21912a3ba32f..20dea853765f 100644 --- a/drivers/video/fbdev/core/fbcon.h +++ b/drivers/video/fbdev/core/fbcon.h @@ -25,7 +25,7 @@ * low-level frame buffer device */ -struct display { +struct fbcon_display { /* Filled in by the low-level console driver */ const u_char *fontdata; int userfont; /* != 0 if fontdata kmalloc()ed */ @@ -68,7 +68,7 @@ struct fbcon_ops { struct fb_var_screeninfo var; /* copy of the current fb_var_screeninfo */ struct timer_list cursor_timer; /* Cursor timer */ struct fb_cursor cursor_state; - struct display *p; + struct fbcon_display *p; struct fb_info *info; int currcon; /* Current VC. */ int cur_blink_jiffies; @@ -225,7 +225,7 @@ extern int soft_cursor(struct fb_info *info, struct fb_cursor *cursor); #define FBCON_ATTRIBUTE_REVERSE 2 #define FBCON_ATTRIBUTE_BOLD 4 -static inline int real_y(struct display *p, int ypos) +static inline int real_y(struct fbcon_display *p, int ypos) { int rows = p->vrows; -- 2.20.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
This is unused code since commit 6104c37094e729f3d4ce65797002112735d49cd1 Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Tue Aug 1 17:32:07 2017 +0200 fbcon: Make fbcon a built-time depency for fbdev when fbcon was made a compile-time static dependency of fbdev. We can't exit fbcon anymore without exiting fbdev first, which only works if all fbdev drivers have unloaded already. Hence this is all dead code. v2: I missed that fbcon_exit is also called from con_deinit stuff, and there fbcon_has_exited prevents double-cleanup. But we can fix that by properly resetting con2fb_map[] to all -1, which is used everywhere else to indicate "no fb_info allocate to this console". With that change the double-cleanup (which resulted in a module refcount underflow, among other things) is prevented. Aside: con2fb_map is a signed char, so don't register more than 128 fb_info or hilarity will ensue. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Hans de Goede <hdegoede@redhat.com> Cc: "Noralf Trønnes" <noralf@tronnes.org> Cc: Yisheng Xie <ysxie@foxmail.com> Cc: Konstantin Khorenko <khorenko@virtuozzo.com> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Kees Cook <keescook@chromium.org> --- drivers/video/fbdev/core/fbcon.c | 33 +------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 2b2082615ca1..a1be589b692f 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -112,7 +112,6 @@ static int softback_lines; static int first_fb_vc; static int last_fb_vc = MAX_NR_CONSOLES - 1; static int fbcon_is_default = 1; -static int fbcon_has_exited; static int primary_device = -1; static int fbcon_has_console_bind; @@ -1050,7 +1049,6 @@ static const char *fbcon_startup(void) info->var.bits_per_pixel); fbcon_add_cursor_timer(info); - fbcon_has_exited = 0; return display_desc; } @@ -3336,14 +3334,6 @@ static int fbcon_event_notify(struct notifier_block *self, struct fb_blit_caps *caps; int idx, ret = 0; - /* - * ignore all events except driver registration and deregistration - * if fbcon is not active - */ - if (fbcon_has_exited && !(action == FB_EVENT_FB_REGISTERED || - action == FB_EVENT_FB_UNREGISTERED)) - goto done; - switch(action) { case FB_EVENT_SUSPEND: fbcon_suspended(info); @@ -3396,7 +3386,6 @@ static int fbcon_event_notify(struct notifier_block *self, fbcon_remap_all(idx); break; } -done: return ret; } @@ -3443,9 +3432,6 @@ static ssize_t store_rotate(struct device *device, int rotate, idx; char **last = NULL; - if (fbcon_has_exited) - return count; - console_lock(); idx = con2fb_map[fg_console]; @@ -3468,9 +3454,6 @@ static ssize_t store_rotate_all(struct device *device, int rotate, idx; char **last = NULL; - if (fbcon_has_exited) - return count; - console_lock(); idx = con2fb_map[fg_console]; @@ -3491,9 +3474,6 @@ static ssize_t show_rotate(struct device *device, struct fb_info *info; int rotate = 0, idx; - if (fbcon_has_exited) - return 0; - console_lock(); idx = con2fb_map[fg_console]; @@ -3514,9 +3494,6 @@ static ssize_t show_cursor_blink(struct device *device, struct fbcon_ops *ops; int idx, blink = -1; - if (fbcon_has_exited) - return 0; - console_lock(); idx = con2fb_map[fg_console]; @@ -3543,9 +3520,6 @@ static ssize_t store_cursor_blink(struct device *device, int blink, idx; char **last = NULL; - if (fbcon_has_exited) - return count; - console_lock(); idx = con2fb_map[fg_console]; @@ -3668,9 +3642,6 @@ static void fbcon_exit(void) struct fb_info *info; int i, j, mapped; - if (fbcon_has_exited) - return; - #ifdef CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER if (deferred_takeover) { dummycon_unregister_output_notifier(&fbcon_output_nb); @@ -3695,7 +3666,7 @@ static void fbcon_exit(void) for (j = first_fb_vc; j <= last_fb_vc; j++) { if (con2fb_map[j] == i) { mapped = 1; - break; + con2fb_map[j] = -1; } } @@ -3718,8 +3689,6 @@ static void fbcon_exit(void) info->queue.func = NULL; } } - - fbcon_has_exited = 1; } void __init fb_console_init(void) -- 2.20.1
This is unused code since commit 6104c37094e729f3d4ce65797002112735d49cd1 Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Tue Aug 1 17:32:07 2017 +0200 fbcon: Make fbcon a built-time depency for fbdev when fbcon was made a compile-time static dependency of fbdev. We can't exit fbcon anymore without exiting fbdev first, which only works if all fbdev drivers have unloaded already. Hence this is all dead code. v2: I missed that fbcon_exit is also called from con_deinit stuff, and there fbcon_has_exited prevents double-cleanup. But we can fix that by properly resetting con2fb_map[] to all -1, which is used everywhere else to indicate "no fb_info allocate to this console". With that change the double-cleanup (which resulted in a module refcount underflow, among other things) is prevented. Aside: con2fb_map is a signed char, so don't register more than 128 fb_info or hilarity will ensue. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Hans de Goede <hdegoede@redhat.com> Cc: "Noralf Trønnes" <noralf@tronnes.org> Cc: Yisheng Xie <ysxie@foxmail.com> Cc: Konstantin Khorenko <khorenko@virtuozzo.com> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Kees Cook <keescook@chromium.org> --- drivers/video/fbdev/core/fbcon.c | 33 +------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 2b2082615ca1..a1be589b692f 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -112,7 +112,6 @@ static int softback_lines; static int first_fb_vc; static int last_fb_vc = MAX_NR_CONSOLES - 1; static int fbcon_is_default = 1; -static int fbcon_has_exited; static int primary_device = -1; static int fbcon_has_console_bind; @@ -1050,7 +1049,6 @@ static const char *fbcon_startup(void) info->var.bits_per_pixel); fbcon_add_cursor_timer(info); - fbcon_has_exited = 0; return display_desc; } @@ -3336,14 +3334,6 @@ static int fbcon_event_notify(struct notifier_block *self, struct fb_blit_caps *caps; int idx, ret = 0; - /* - * ignore all events except driver registration and deregistration - * if fbcon is not active - */ - if (fbcon_has_exited && !(action == FB_EVENT_FB_REGISTERED || - action == FB_EVENT_FB_UNREGISTERED)) - goto done; - switch(action) { case FB_EVENT_SUSPEND: fbcon_suspended(info); @@ -3396,7 +3386,6 @@ static int fbcon_event_notify(struct notifier_block *self, fbcon_remap_all(idx); break; } -done: return ret; } @@ -3443,9 +3432,6 @@ static ssize_t store_rotate(struct device *device, int rotate, idx; char **last = NULL; - if (fbcon_has_exited) - return count; - console_lock(); idx = con2fb_map[fg_console]; @@ -3468,9 +3454,6 @@ static ssize_t store_rotate_all(struct device *device, int rotate, idx; char **last = NULL; - if (fbcon_has_exited) - return count; - console_lock(); idx = con2fb_map[fg_console]; @@ -3491,9 +3474,6 @@ static ssize_t show_rotate(struct device *device, struct fb_info *info; int rotate = 0, idx; - if (fbcon_has_exited) - return 0; - console_lock(); idx = con2fb_map[fg_console]; @@ -3514,9 +3494,6 @@ static ssize_t show_cursor_blink(struct device *device, struct fbcon_ops *ops; int idx, blink = -1; - if (fbcon_has_exited) - return 0; - console_lock(); idx = con2fb_map[fg_console]; @@ -3543,9 +3520,6 @@ static ssize_t store_cursor_blink(struct device *device, int blink, idx; char **last = NULL; - if (fbcon_has_exited) - return count; - console_lock(); idx = con2fb_map[fg_console]; @@ -3668,9 +3642,6 @@ static void fbcon_exit(void) struct fb_info *info; int i, j, mapped; - if (fbcon_has_exited) - return; - #ifdef CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER if (deferred_takeover) { dummycon_unregister_output_notifier(&fbcon_output_nb); @@ -3695,7 +3666,7 @@ static void fbcon_exit(void) for (j = first_fb_vc; j <= last_fb_vc; j++) { if (con2fb_map[j] == i) { mapped = 1; - break; + con2fb_map[j] = -1; } } @@ -3718,8 +3689,6 @@ static void fbcon_exit(void) info->queue.func = NULL; } } - - fbcon_has_exited = 1; } void __init fb_console_init(void) -- 2.20.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
With commit 6104c37094e729f3d4ce65797002112735d49cd1 Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Tue Aug 1 17:32:07 2017 +0200 fbcon: Make fbcon a built-time depency for fbdev we have a static dependency between fbcon and fbdev, and we can replace the indirection through the notifier chain with a function call. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: "Noralf Trønnes" <noralf@tronnes.org> Cc: Yisheng Xie <ysxie@foxmail.com> Cc: Peter Rosin <peda@axentia.se> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: linux-fbdev@vger.kernel.org --- drivers/video/fbdev/core/fbcon.c | 14 +++----------- drivers/video/fbdev/core/fbmem.c | 9 ++------- include/linux/fb.h | 4 ---- include/linux/fbcon.h | 4 ++++ 4 files changed, 9 insertions(+), 22 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index a1be589b692f..95af6bd783e8 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -3115,14 +3115,14 @@ static int fbcon_fb_unbind(int idx) } /* called with console_lock held */ -static int fbcon_fb_unregistered(struct fb_info *info) +void fbcon_fb_unregistered(struct fb_info *info) { int i, idx; WARN_CONSOLE_UNLOCKED(); if (deferred_takeover) - return 0; + return; idx = info->node; for (i = first_fb_vc; i <= last_fb_vc; i++) { @@ -3151,8 +3151,6 @@ static int fbcon_fb_unregistered(struct fb_info *info) if (!num_registered_fb) do_unregister_con_driver(&fb_con); - - return 0; } /* called with console_lock held */ @@ -3211,7 +3209,7 @@ static inline void fbcon_select_primary(struct fb_info *info) #endif /* CONFIG_FRAMEBUFFER_DETECT_PRIMARY */ /* called with console_lock held */ -static int fbcon_fb_registered(struct fb_info *info) +int fbcon_fb_registered(struct fb_info *info) { int ret = 0, i, idx; @@ -3355,12 +3353,6 @@ static int fbcon_event_notify(struct notifier_block *self, idx = info->node; ret = fbcon_fb_unbind(idx); break; - case FB_EVENT_FB_REGISTERED: - ret = fbcon_fb_registered(info); - break; - case FB_EVENT_FB_UNREGISTERED: - ret = fbcon_fb_unregistered(info); - break; case FB_EVENT_SET_CONSOLE_MAP: /* called with console lock held */ con2fb = event->data; diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index fc3d34a8ea5b..ae2db31eeba7 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1660,7 +1660,6 @@ MODULE_PARM_DESC(lockless_register_fb, static int do_register_framebuffer(struct fb_info *fb_info) { int i, ret; - struct fb_event event; struct fb_videomode mode; if (fb_check_foreignness(fb_info)) @@ -1723,7 +1722,6 @@ static int do_register_framebuffer(struct fb_info *fb_info) fb_add_videomode(&mode, &fb_info->modelist); registered_fb[i] = fb_info; - event.info = fb_info; if (!lockless_register_fb) console_lock(); else @@ -1732,9 +1730,8 @@ static int do_register_framebuffer(struct fb_info *fb_info) ret = -ENODEV; goto unlock_console; } - ret = 0; - fb_notifier_call_chain(FB_EVENT_FB_REGISTERED, &event); + ret = fbcon_fb_registered(fb_info); unlock_fb_info(fb_info); unlock_console: if (!lockless_register_fb) @@ -1771,7 +1768,6 @@ static int __unlink_framebuffer(struct fb_info *fb_info); static int do_unregister_framebuffer(struct fb_info *fb_info) { - struct fb_event event; int ret; ret = unbind_console(fb_info); @@ -1789,9 +1785,8 @@ static int do_unregister_framebuffer(struct fb_info *fb_info) registered_fb[fb_info->node] = NULL; num_registered_fb--; fb_cleanup_device(fb_info); - event.info = fb_info; console_lock(); - fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event); + fbcon_fb_unregistered(fb_info); console_unlock(); /* this may free fb info */ diff --git a/include/linux/fb.h b/include/linux/fb.h index f52ef0ad6781..701abaf79c87 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -136,10 +136,6 @@ struct fb_cursor_user { #define FB_EVENT_RESUME 0x03 /* An entry from the modelist was removed */ #define FB_EVENT_MODE_DELETE 0x04 -/* A driver registered itself */ -#define FB_EVENT_FB_REGISTERED 0x05 -/* A driver unregistered itself */ -#define FB_EVENT_FB_UNREGISTERED 0x06 /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ #define FB_EVENT_GET_CONSOLE_MAP 0x07 /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h index f68a7db14165..94a71e9e1257 100644 --- a/include/linux/fbcon.h +++ b/include/linux/fbcon.h @@ -4,9 +4,13 @@ #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); #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) {} #endif #endif /* _LINUX_FBCON_H */ -- 2.20.1
With commit 6104c37094e729f3d4ce65797002112735d49cd1 Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Tue Aug 1 17:32:07 2017 +0200 fbcon: Make fbcon a built-time depency for fbdev we have a static dependency between fbcon and fbdev, and we can replace the indirection through the notifier chain with a function call. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: "Noralf Trønnes" <noralf@tronnes.org> Cc: Yisheng Xie <ysxie@foxmail.com> Cc: Peter Rosin <peda@axentia.se> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: linux-fbdev@vger.kernel.org --- drivers/video/fbdev/core/fbcon.c | 14 +++----------- drivers/video/fbdev/core/fbmem.c | 9 ++------- include/linux/fb.h | 4 ---- include/linux/fbcon.h | 4 ++++ 4 files changed, 9 insertions(+), 22 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index a1be589b692f..95af6bd783e8 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -3115,14 +3115,14 @@ static int fbcon_fb_unbind(int idx) } /* called with console_lock held */ -static int fbcon_fb_unregistered(struct fb_info *info) +void fbcon_fb_unregistered(struct fb_info *info) { int i, idx; WARN_CONSOLE_UNLOCKED(); if (deferred_takeover) - return 0; + return; idx = info->node; for (i = first_fb_vc; i <= last_fb_vc; i++) { @@ -3151,8 +3151,6 @@ static int fbcon_fb_unregistered(struct fb_info *info) if (!num_registered_fb) do_unregister_con_driver(&fb_con); - - return 0; } /* called with console_lock held */ @@ -3211,7 +3209,7 @@ static inline void fbcon_select_primary(struct fb_info *info) #endif /* CONFIG_FRAMEBUFFER_DETECT_PRIMARY */ /* called with console_lock held */ -static int fbcon_fb_registered(struct fb_info *info) +int fbcon_fb_registered(struct fb_info *info) { int ret = 0, i, idx; @@ -3355,12 +3353,6 @@ static int fbcon_event_notify(struct notifier_block *self, idx = info->node; ret = fbcon_fb_unbind(idx); break; - case FB_EVENT_FB_REGISTERED: - ret = fbcon_fb_registered(info); - break; - case FB_EVENT_FB_UNREGISTERED: - ret = fbcon_fb_unregistered(info); - break; case FB_EVENT_SET_CONSOLE_MAP: /* called with console lock held */ con2fb = event->data; diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index fc3d34a8ea5b..ae2db31eeba7 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1660,7 +1660,6 @@ MODULE_PARM_DESC(lockless_register_fb, static int do_register_framebuffer(struct fb_info *fb_info) { int i, ret; - struct fb_event event; struct fb_videomode mode; if (fb_check_foreignness(fb_info)) @@ -1723,7 +1722,6 @@ static int do_register_framebuffer(struct fb_info *fb_info) fb_add_videomode(&mode, &fb_info->modelist); registered_fb[i] = fb_info; - event.info = fb_info; if (!lockless_register_fb) console_lock(); else @@ -1732,9 +1730,8 @@ static int do_register_framebuffer(struct fb_info *fb_info) ret = -ENODEV; goto unlock_console; } - ret = 0; - fb_notifier_call_chain(FB_EVENT_FB_REGISTERED, &event); + ret = fbcon_fb_registered(fb_info); unlock_fb_info(fb_info); unlock_console: if (!lockless_register_fb) @@ -1771,7 +1768,6 @@ static int __unlink_framebuffer(struct fb_info *fb_info); static int do_unregister_framebuffer(struct fb_info *fb_info) { - struct fb_event event; int ret; ret = unbind_console(fb_info); @@ -1789,9 +1785,8 @@ static int do_unregister_framebuffer(struct fb_info *fb_info) registered_fb[fb_info->node] = NULL; num_registered_fb--; fb_cleanup_device(fb_info); - event.info = fb_info; console_lock(); - fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event); + fbcon_fb_unregistered(fb_info); console_unlock(); /* this may free fb info */ diff --git a/include/linux/fb.h b/include/linux/fb.h index f52ef0ad6781..701abaf79c87 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -136,10 +136,6 @@ struct fb_cursor_user { #define FB_EVENT_RESUME 0x03 /* An entry from the modelist was removed */ #define FB_EVENT_MODE_DELETE 0x04 -/* A driver registered itself */ -#define FB_EVENT_FB_REGISTERED 0x05 -/* A driver unregistered itself */ -#define FB_EVENT_FB_UNREGISTERED 0x06 /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ #define FB_EVENT_GET_CONSOLE_MAP 0x07 /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h index f68a7db14165..94a71e9e1257 100644 --- a/include/linux/fbcon.h +++ b/include/linux/fbcon.h @@ -4,9 +4,13 @@ #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); #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) {} #endif #endif /* _LINUX_FBCON_H */ -- 2.20.1
It's dead code, and removing it avoids me having to understand what it's doing with lock_fb_info. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> --- drivers/video/fbdev/sh_mobile_lcdcfb.c | 63 -------------------------- drivers/video/fbdev/sh_mobile_lcdcfb.h | 5 -- 2 files changed, 68 deletions(-) diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c index dc46be38c970..c5924f5e98c6 100644 --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c @@ -556,67 +556,6 @@ sh_mobile_lcdc_must_reconfigure(struct sh_mobile_lcdc_chan *ch, static int sh_mobile_lcdc_check_var(struct fb_var_screeninfo *var, struct fb_info *info); -static int sh_mobile_lcdc_display_notify(struct sh_mobile_lcdc_chan *ch, - enum sh_mobile_lcdc_entity_event event, - const struct fb_videomode *mode, - const struct fb_monspecs *monspec) -{ - struct fb_info *info = ch->info; - struct fb_var_screeninfo var; - int ret = 0; - - switch (event) { - case SH_MOBILE_LCDC_EVENT_DISPLAY_CONNECT: - /* HDMI plug in */ - console_lock(); - if (lock_fb_info(info)) { - - - ch->display.width = monspec->max_x * 10; - ch->display.height = monspec->max_y * 10; - - if (!sh_mobile_lcdc_must_reconfigure(ch, mode) && - info->state == FBINFO_STATE_RUNNING) { - /* First activation with the default monitor. - * Just turn on, if we run a resume here, the - * logo disappears. - */ - info->var.width = ch->display.width; - info->var.height = ch->display.height; - sh_mobile_lcdc_display_on(ch); - } else { - /* New monitor or have to wake up */ - fb_set_suspend(info, 0); - } - - - unlock_fb_info(info); - } - console_unlock(); - break; - - case SH_MOBILE_LCDC_EVENT_DISPLAY_DISCONNECT: - /* HDMI disconnect */ - console_lock(); - if (lock_fb_info(info)) { - fb_set_suspend(info, 1); - unlock_fb_info(info); - } - console_unlock(); - break; - - case SH_MOBILE_LCDC_EVENT_DISPLAY_MODE: - /* Validate a proposed new mode */ - fb_videomode_to_var(&var, mode); - var.bits_per_pixel = info->var.bits_per_pixel; - var.grayscale = info->var.grayscale; - ret = sh_mobile_lcdc_check_var(&var, info); - break; - } - - return ret; -} - /* ----------------------------------------------------------------------------- * Format helpers */ @@ -2540,8 +2479,6 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch) unsigned int max_size; unsigned int i; - ch->notify = sh_mobile_lcdc_display_notify; - /* Validate the format. */ format = sh_mobile_format_info(cfg->fourcc); if (format == NULL) { diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.h b/drivers/video/fbdev/sh_mobile_lcdcfb.h index b8e47a8bd8ab..589400372098 100644 --- a/drivers/video/fbdev/sh_mobile_lcdcfb.h +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.h @@ -87,11 +87,6 @@ struct sh_mobile_lcdc_chan { unsigned long base_addr_c; unsigned int line_size; - int (*notify)(struct sh_mobile_lcdc_chan *ch, - enum sh_mobile_lcdc_entity_event event, - const struct fb_videomode *mode, - const struct fb_monspecs *monspec); - /* Backlight */ struct backlight_device *bl; unsigned int bl_brightness; -- 2.20.1
It's dead code, and removing it avoids me having to understand what it's doing with lock_fb_info. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> --- drivers/video/fbdev/sh_mobile_lcdcfb.c | 63 -------------------------- drivers/video/fbdev/sh_mobile_lcdcfb.h | 5 -- 2 files changed, 68 deletions(-) diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c index dc46be38c970..c5924f5e98c6 100644 --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c @@ -556,67 +556,6 @@ sh_mobile_lcdc_must_reconfigure(struct sh_mobile_lcdc_chan *ch, static int sh_mobile_lcdc_check_var(struct fb_var_screeninfo *var, struct fb_info *info); -static int sh_mobile_lcdc_display_notify(struct sh_mobile_lcdc_chan *ch, - enum sh_mobile_lcdc_entity_event event, - const struct fb_videomode *mode, - const struct fb_monspecs *monspec) -{ - struct fb_info *info = ch->info; - struct fb_var_screeninfo var; - int ret = 0; - - switch (event) { - case SH_MOBILE_LCDC_EVENT_DISPLAY_CONNECT: - /* HDMI plug in */ - console_lock(); - if (lock_fb_info(info)) { - - - ch->display.width = monspec->max_x * 10; - ch->display.height = monspec->max_y * 10; - - if (!sh_mobile_lcdc_must_reconfigure(ch, mode) && - info->state == FBINFO_STATE_RUNNING) { - /* First activation with the default monitor. - * Just turn on, if we run a resume here, the - * logo disappears. - */ - info->var.width = ch->display.width; - info->var.height = ch->display.height; - sh_mobile_lcdc_display_on(ch); - } else { - /* New monitor or have to wake up */ - fb_set_suspend(info, 0); - } - - - unlock_fb_info(info); - } - console_unlock(); - break; - - case SH_MOBILE_LCDC_EVENT_DISPLAY_DISCONNECT: - /* HDMI disconnect */ - console_lock(); - if (lock_fb_info(info)) { - fb_set_suspend(info, 1); - unlock_fb_info(info); - } - console_unlock(); - break; - - case SH_MOBILE_LCDC_EVENT_DISPLAY_MODE: - /* Validate a proposed new mode */ - fb_videomode_to_var(&var, mode); - var.bits_per_pixel = info->var.bits_per_pixel; - var.grayscale = info->var.grayscale; - ret = sh_mobile_lcdc_check_var(&var, info); - break; - } - - return ret; -} - /* ----------------------------------------------------------------------------- * Format helpers */ @@ -2540,8 +2479,6 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch) unsigned int max_size; unsigned int i; - ch->notify = sh_mobile_lcdc_display_notify; - /* Validate the format. */ format = sh_mobile_format_info(cfg->fourcc); if (format == NULL) { diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.h b/drivers/video/fbdev/sh_mobile_lcdcfb.h index b8e47a8bd8ab..589400372098 100644 --- a/drivers/video/fbdev/sh_mobile_lcdcfb.h +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.h @@ -87,11 +87,6 @@ struct sh_mobile_lcdc_chan { unsigned long base_addr_c; unsigned int line_size; - int (*notify)(struct sh_mobile_lcdc_chan *ch, - enum sh_mobile_lcdc_entity_event event, - const struct fb_videomode *mode, - const struct fb_monspecs *monspec); - /* Backlight */ struct backlight_device *bl; unsigned int bl_brightness; -- 2.20.1 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Which means lock_fb_info can never fail. Remove the error handling. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> --- .../video/fbdev/omap2/omapfb/omapfb-sysfs.c | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c b/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c index 8087a009c54f..bd0d20283372 100644 --- a/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c +++ b/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c @@ -60,8 +60,7 @@ static ssize_t store_rotate_type(struct device *dev, if (rot_type != OMAP_DSS_ROT_DMA && rot_type != OMAP_DSS_ROT_VRFB) return -EINVAL; - if (!lock_fb_info(fbi)) - return -ENODEV; + lock_fb_info(fbi); r = 0; if (rot_type == ofbi->rotation_type) @@ -112,8 +111,7 @@ static ssize_t store_mirror(struct device *dev, if (r) return r; - if (!lock_fb_info(fbi)) - return -ENODEV; + lock_fb_info(fbi); ofbi->mirror = mirror; @@ -149,8 +147,7 @@ static ssize_t show_overlays(struct device *dev, ssize_t l = 0; int t; - if (!lock_fb_info(fbi)) - return -ENODEV; + lock_fb_info(fbi); omapfb_lock(fbdev); for (t = 0; t < ofbi->num_overlays; t++) { @@ -208,8 +205,7 @@ static ssize_t store_overlays(struct device *dev, struct device_attribute *attr, if (buf[len - 1] == '\n') len = len - 1; - if (!lock_fb_info(fbi)) - return -ENODEV; + lock_fb_info(fbi); omapfb_lock(fbdev); if (len > 0) { @@ -340,8 +336,7 @@ static ssize_t show_overlays_rotate(struct device *dev, ssize_t l = 0; int t; - if (!lock_fb_info(fbi)) - return -ENODEV; + lock_fb_info(fbi); for (t = 0; t < ofbi->num_overlays; t++) { l += snprintf(buf + l, PAGE_SIZE - l, "%s%d", @@ -369,8 +364,7 @@ static ssize_t store_overlays_rotate(struct device *dev, if (buf[len - 1] == '\n') len = len - 1; - if (!lock_fb_info(fbi)) - return -ENODEV; + lock_fb_info(fbi); if (len > 0) { char *p = (char *)buf; @@ -453,8 +447,7 @@ static ssize_t store_size(struct device *dev, struct device_attribute *attr, size = PAGE_ALIGN(size); - if (!lock_fb_info(fbi)) - return -ENODEV; + lock_fb_info(fbi); if (display && display->driver->sync) display->driver->sync(display); -- 2.20.1
Which means lock_fb_info can never fail. Remove the error handling. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Rob Clark <robdclark@gmail.com> --- drivers/video/fbdev/core/fbsysfs.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/video/fbdev/core/fbsysfs.c b/drivers/video/fbdev/core/fbsysfs.c index 44cca39f2b51..5f329278e55f 100644 --- a/drivers/video/fbdev/core/fbsysfs.c +++ b/drivers/video/fbdev/core/fbsysfs.c @@ -179,10 +179,7 @@ static ssize_t store_modes(struct device *device, return -EINVAL; console_lock(); - if (!lock_fb_info(fb_info)) { - console_unlock(); - return -ENODEV; - } + lock_fb_info(fb_info); list_splice(&fb_info->modelist, &old_list); fb_videomode_to_modelist((const struct fb_videomode *)buf, i, @@ -409,10 +406,7 @@ static ssize_t store_fbstate(struct device *device, state = simple_strtoul(buf, &last, 0); console_lock(); - if (!lock_fb_info(fb_info)) { - console_unlock(); - return -ENODEV; - } + lock_fb_info(fb_info); fb_set_suspend(fb_info, (int)state); -- 2.20.1
Which means lock_fb_info can never fail. Remove the error handling. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Rob Clark <robdclark@gmail.com> --- drivers/video/fbdev/core/fbsysfs.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/video/fbdev/core/fbsysfs.c b/drivers/video/fbdev/core/fbsysfs.c index 44cca39f2b51..5f329278e55f 100644 --- a/drivers/video/fbdev/core/fbsysfs.c +++ b/drivers/video/fbdev/core/fbsysfs.c @@ -179,10 +179,7 @@ static ssize_t store_modes(struct device *device, return -EINVAL; console_lock(); - if (!lock_fb_info(fb_info)) { - console_unlock(); - return -ENODEV; - } + lock_fb_info(fb_info); list_splice(&fb_info->modelist, &old_list); fb_videomode_to_modelist((const struct fb_videomode *)buf, i, @@ -409,10 +406,7 @@ static ssize_t store_fbstate(struct device *device, state = simple_strtoul(buf, &last, 0); console_lock(); - if (!lock_fb_info(fb_info)) { - console_unlock(); - return -ENODEV; - } + lock_fb_info(fb_info); fb_set_suspend(fb_info, (int)state); -- 2.20.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Simply because olpc never unregisters the damn thing. It also registers the framebuffer directly by poking around in fbdev core internals, so it's all around rather broken. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Jens Frederich <jfrederich@gmail.com> Cc: Daniel Drake <dsd@laptop.org> Cc: Jon Nettleton <jon.nettleton@gmail.com> --- drivers/staging/olpc_dcon/olpc_dcon.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c b/drivers/staging/olpc_dcon/olpc_dcon.c index 6b714f740ac3..a254238be181 100644 --- a/drivers/staging/olpc_dcon/olpc_dcon.c +++ b/drivers/staging/olpc_dcon/olpc_dcon.c @@ -250,11 +250,7 @@ static bool dcon_blank_fb(struct dcon_priv *dcon, bool blank) int err; console_lock(); - if (!lock_fb_info(dcon->fbinfo)) { - console_unlock(); - dev_err(&dcon->client->dev, "unable to lock framebuffer\n"); - return false; - } + lock_fb_info(dcon->fbinfo); dcon->ignore_fb_events = true; err = fb_blank(dcon->fbinfo, -- 2.20.1
Simply because olpc never unregisters the damn thing. It also registers the framebuffer directly by poking around in fbdev core internals, so it's all around rather broken. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Jens Frederich <jfrederich@gmail.com> Cc: Daniel Drake <dsd@laptop.org> Cc: Jon Nettleton <jon.nettleton@gmail.com> --- drivers/staging/olpc_dcon/olpc_dcon.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c b/drivers/staging/olpc_dcon/olpc_dcon.c index 6b714f740ac3..a254238be181 100644 --- a/drivers/staging/olpc_dcon/olpc_dcon.c +++ b/drivers/staging/olpc_dcon/olpc_dcon.c @@ -250,11 +250,7 @@ static bool dcon_blank_fb(struct dcon_priv *dcon, bool blank) int err; console_lock(); - if (!lock_fb_info(dcon->fbinfo)) { - console_unlock(); - dev_err(&dcon->client->dev, "unable to lock framebuffer\n"); - return false; - } + lock_fb_info(dcon->fbinfo); dcon->ignore_fb_events = true; err = fb_blank(dcon->fbinfo, -- 2.20.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
It's properly protected by reboot_lock. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: "Ville Syrjälä" <syrjala@sci.fi> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> --- drivers/video/fbdev/aty/atyfb_base.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c index b6fe103df145..eebb62d82a23 100644 --- a/drivers/video/fbdev/aty/atyfb_base.c +++ b/drivers/video/fbdev/aty/atyfb_base.c @@ -3916,8 +3916,7 @@ static int atyfb_reboot_notify(struct notifier_block *nb, if (!reboot_info) goto out; - if (!lock_fb_info(reboot_info)) - goto out; + lock_fb_info(reboot_info); par = reboot_info->par; -- 2.20.1
It's properly protected by reboot_lock. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: "Ville Syrjälä" <syrjala@sci.fi> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> --- drivers/video/fbdev/aty/atyfb_base.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c index b6fe103df145..eebb62d82a23 100644 --- a/drivers/video/fbdev/aty/atyfb_base.c +++ b/drivers/video/fbdev/aty/atyfb_base.c @@ -3916,8 +3916,7 @@ static int atyfb_reboot_notify(struct notifier_block *nb, if (!reboot_info) goto out; - if (!lock_fb_info(reboot_info)) - goto out; + lock_fb_info(reboot_info); par = reboot_info->par; -- 2.20.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Ever since commit c47747fde931c02455683bd00ea43eaa62f35b0e Author: Linus Torvalds <torvalds@linux-foundation.org> Date: Wed May 11 14:58:34 2011 -0700 fbmem: make read/write/ioctl use the frame buffer at open time fbdev has gained proper refcounting for the fbinfo attached to any open files, which means that the backing driver (stored in fb_info->fbops) cannot untimely disappear anymore. The only thing that can happen is that the entire device just outright disappears and gets unregistered, but file_fb_info does check for that. Except that it's racy - it only checks once at the start of a file_ops, there's no guarantee that the underlying fbdev won't untimely disappear. Aside: A proper way to fix that race is probably to replicate the srcu trickery we've rolled out in drm. But given that this race has existed since forever it's probably not one we need to fix right away. do_unregister_framebuffer also nowhere clears fb_info->fbops, hence the check in lock_fb_info can't possible catch a disappearing fbdev later on. Long story short: Ever since the above commit the fb_info->fbops checks have essentially become dead code. Remove this all. Aside from the file_ops callbacks, and stuff called from there there's only register/unregister code left. If that goes wrong a driver managed to register/unregister a device instance twice or in the wrong order. That's just a driver bug. v2: - fb_mmap had an open-coded version of the fbinfo->fops check, because it doesn't need the fbinfo->lock. Delete that too. - Use the wrapper function in fb_open/release now, since no difference anymore. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Yisheng Xie <ysxie@foxmail.com> Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: "Noralf Trønnes" <noralf@tronnes.org> Cc: Peter Rosin <peda@axentia.se> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com> Cc: linux-fbdev@vger.kernel.org --- drivers/video/fbdev/core/fbcmap.c | 6 +-- drivers/video/fbdev/core/fbcon.c | 3 +- drivers/video/fbdev/core/fbmem.c | 73 +++++++------------------------ include/linux/fb.h | 5 ++- 4 files changed, 23 insertions(+), 64 deletions(-) diff --git a/drivers/video/fbdev/core/fbcmap.c b/drivers/video/fbdev/core/fbcmap.c index 68a113594808..aac710b2f95f 100644 --- a/drivers/video/fbdev/core/fbcmap.c +++ b/drivers/video/fbdev/core/fbcmap.c @@ -283,11 +283,7 @@ int fb_set_user_cmap(struct fb_cmap_user *cmap, struct fb_info *info) goto out; } umap.start = cmap->start; - if (!lock_fb_info(info)) { - rc = -ENODEV; - goto out; - } - + lock_fb_info(info); rc = fb_set_cmap(&umap, info); unlock_fb_info(info); out: diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 95af6bd783e8..35443add7f7e 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -2360,8 +2360,7 @@ static void fbcon_generic_blank(struct vc_data *vc, struct fb_info *info, } - if (!lock_fb_info(info)) - return; + lock_fb_info(info); event.info = info; event.data = ␣ fb_notifier_call_chain(FB_EVENT_CONBLANK, &event); diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index ae2db31eeba7..1987aba4f5a2 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -80,17 +80,6 @@ static void put_fb_info(struct fb_info *fb_info) fb_info->fbops->fb_destroy(fb_info); } -int lock_fb_info(struct fb_info *info) -{ - mutex_lock(&info->lock); - if (!info->fbops) { - mutex_unlock(&info->lock); - return 0; - } - return 1; -} -EXPORT_SYMBOL(lock_fb_info); - /* * Helpers */ @@ -1121,8 +1110,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, switch (cmd) { case FBIOGET_VSCREENINFO: - if (!lock_fb_info(info)) - return -ENODEV; + lock_fb_info(info); var = info->var; unlock_fb_info(info); @@ -1132,10 +1120,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, if (copy_from_user(&var, argp, sizeof(var))) return -EFAULT; console_lock(); - if (!lock_fb_info(info)) { - console_unlock(); - return -ENODEV; - } + lock_fb_info(info); info->flags |= FBINFO_MISC_USEREVENT; ret = fb_set_var(info, &var); info->flags &= ~FBINFO_MISC_USEREVENT; @@ -1145,8 +1130,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, ret = -EFAULT; break; case FBIOGET_FSCREENINFO: - if (!lock_fb_info(info)) - return -ENODEV; + lock_fb_info(info); fix = info->fix; if (info->flags & FBINFO_HIDE_SMEM_START) fix.smem_start = 0; @@ -1162,8 +1146,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, case FBIOGETCMAP: if (copy_from_user(&cmap, argp, sizeof(cmap))) return -EFAULT; - if (!lock_fb_info(info)) - return -ENODEV; + lock_fb_info(info); cmap_from = info->cmap; unlock_fb_info(info); ret = fb_cmap_to_user(&cmap_from, &cmap); @@ -1172,10 +1155,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, if (copy_from_user(&var, argp, sizeof(var))) return -EFAULT; console_lock(); - if (!lock_fb_info(info)) { - console_unlock(); - return -ENODEV; - } + lock_fb_info(info); ret = fb_pan_display(info, &var); unlock_fb_info(info); console_unlock(); @@ -1192,8 +1172,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, return -EINVAL; con2fb.framebuffer = -1; event.data = &con2fb; - if (!lock_fb_info(info)) - return -ENODEV; + lock_fb_info(info); event.info = info; fb_notifier_call_chain(FB_EVENT_GET_CONSOLE_MAP, &event); unlock_fb_info(info); @@ -1214,10 +1193,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, } event.data = &con2fb; console_lock(); - if (!lock_fb_info(info)) { - console_unlock(); - return -ENODEV; - } + lock_fb_info(info); event.info = info; ret = fb_notifier_call_chain(FB_EVENT_SET_CONSOLE_MAP, &event); unlock_fb_info(info); @@ -1225,10 +1201,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, break; case FBIOBLANK: console_lock(); - if (!lock_fb_info(info)) { - console_unlock(); - return -ENODEV; - } + lock_fb_info(info); info->flags |= FBINFO_MISC_USEREVENT; ret = fb_blank(info, arg); info->flags &= ~FBINFO_MISC_USEREVENT; @@ -1236,8 +1209,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, console_unlock(); break; default: - if (!lock_fb_info(info)) - return -ENODEV; + lock_fb_info(info); fb = info->fbops; if (fb->fb_ioctl) ret = fb->fb_ioctl(info, cmd, arg); @@ -1357,8 +1329,7 @@ static int fb_get_fscreeninfo(struct fb_info *info, unsigned int cmd, { struct fb_fix_screeninfo fix; - if (!lock_fb_info(info)) - return -ENODEV; + lock_fb_info(info); fix = info->fix; if (info->flags & FBINFO_HIDE_SMEM_START) fix.smem_start = 0; @@ -1418,8 +1389,6 @@ fb_mmap(struct file *file, struct vm_area_struct * vma) if (!info) return -ENODEV; fb = info->fbops; - if (!fb) - return -ENODEV; mutex_lock(&info->mm_lock); if (fb->fb_mmap) { int res; @@ -1483,7 +1452,7 @@ __releases(&info->lock) if (IS_ERR(info)) return PTR_ERR(info); - mutex_lock(&info->lock); + lock_fb_info(info); if (!try_module_get(info->fbops->owner)) { res = -ENODEV; goto out; @@ -1499,7 +1468,7 @@ __releases(&info->lock) fb_deferred_io_open(info, inode, file); #endif out: - mutex_unlock(&info->lock); + unlock_fb_info(info); if (res) put_fb_info(info); return res; @@ -1512,11 +1481,11 @@ __releases(&info->lock) { struct fb_info * const info = file->private_data; - mutex_lock(&info->lock); + lock_fb_info(info); if (info->fbops->fb_release) info->fbops->fb_release(info,1); module_put(info->fbops->owner); - mutex_unlock(&info->lock); + unlock_fb_info(info); put_fb_info(info); return 0; } @@ -1726,14 +1695,10 @@ static int do_register_framebuffer(struct fb_info *fb_info) console_lock(); else atomic_inc(&ignore_console_lock_warning); - if (!lock_fb_info(fb_info)) { - ret = -ENODEV; - goto unlock_console; - } - + lock_fb_info(fb_info); ret = fbcon_fb_registered(fb_info); unlock_fb_info(fb_info); -unlock_console: + if (!lockless_register_fb) console_unlock(); else @@ -1751,11 +1716,7 @@ static int unbind_console(struct fb_info *fb_info) return -EINVAL; console_lock(); - if (!lock_fb_info(fb_info)) { - console_unlock(); - return -ENODEV; - } - + lock_fb_info(fb_info); event.info = fb_info; ret = fb_notifier_call_chain(FB_EVENT_FB_UNBIND, &event); unlock_fb_info(fb_info); diff --git a/include/linux/fb.h b/include/linux/fb.h index 701abaf79c87..fd60207c0685 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -656,7 +656,10 @@ extern struct class *fb_class; for (i = 0; i < FB_MAX; i++) \ if (!registered_fb[i]) {} else -extern int lock_fb_info(struct fb_info *info); +static inline void lock_fb_info(struct fb_info *info) +{ + mutex_lock(&info->lock); +} static inline void unlock_fb_info(struct fb_info *info) { -- 2.20.1
Ever since commit c47747fde931c02455683bd00ea43eaa62f35b0e Author: Linus Torvalds <torvalds@linux-foundation.org> Date: Wed May 11 14:58:34 2011 -0700 fbmem: make read/write/ioctl use the frame buffer at open time fbdev has gained proper refcounting for the fbinfo attached to any open files, which means that the backing driver (stored in fb_info->fbops) cannot untimely disappear anymore. The only thing that can happen is that the entire device just outright disappears and gets unregistered, but file_fb_info does check for that. Except that it's racy - it only checks once at the start of a file_ops, there's no guarantee that the underlying fbdev won't untimely disappear. Aside: A proper way to fix that race is probably to replicate the srcu trickery we've rolled out in drm. But given that this race has existed since forever it's probably not one we need to fix right away. do_unregister_framebuffer also nowhere clears fb_info->fbops, hence the check in lock_fb_info can't possible catch a disappearing fbdev later on. Long story short: Ever since the above commit the fb_info->fbops checks have essentially become dead code. Remove this all. Aside from the file_ops callbacks, and stuff called from there there's only register/unregister code left. If that goes wrong a driver managed to register/unregister a device instance twice or in the wrong order. That's just a driver bug. v2: - fb_mmap had an open-coded version of the fbinfo->fops check, because it doesn't need the fbinfo->lock. Delete that too. - Use the wrapper function in fb_open/release now, since no difference anymore. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Yisheng Xie <ysxie@foxmail.com> Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: "Noralf Trønnes" <noralf@tronnes.org> Cc: Peter Rosin <peda@axentia.se> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com> Cc: linux-fbdev@vger.kernel.org --- drivers/video/fbdev/core/fbcmap.c | 6 +-- drivers/video/fbdev/core/fbcon.c | 3 +- drivers/video/fbdev/core/fbmem.c | 73 +++++++------------------------ include/linux/fb.h | 5 ++- 4 files changed, 23 insertions(+), 64 deletions(-) diff --git a/drivers/video/fbdev/core/fbcmap.c b/drivers/video/fbdev/core/fbcmap.c index 68a113594808..aac710b2f95f 100644 --- a/drivers/video/fbdev/core/fbcmap.c +++ b/drivers/video/fbdev/core/fbcmap.c @@ -283,11 +283,7 @@ int fb_set_user_cmap(struct fb_cmap_user *cmap, struct fb_info *info) goto out; } umap.start = cmap->start; - if (!lock_fb_info(info)) { - rc = -ENODEV; - goto out; - } - + lock_fb_info(info); rc = fb_set_cmap(&umap, info); unlock_fb_info(info); out: diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 95af6bd783e8..35443add7f7e 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -2360,8 +2360,7 @@ static void fbcon_generic_blank(struct vc_data *vc, struct fb_info *info, } - if (!lock_fb_info(info)) - return; + lock_fb_info(info); event.info = info; event.data = ␣ fb_notifier_call_chain(FB_EVENT_CONBLANK, &event); diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index ae2db31eeba7..1987aba4f5a2 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -80,17 +80,6 @@ static void put_fb_info(struct fb_info *fb_info) fb_info->fbops->fb_destroy(fb_info); } -int lock_fb_info(struct fb_info *info) -{ - mutex_lock(&info->lock); - if (!info->fbops) { - mutex_unlock(&info->lock); - return 0; - } - return 1; -} -EXPORT_SYMBOL(lock_fb_info); - /* * Helpers */ @@ -1121,8 +1110,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, switch (cmd) { case FBIOGET_VSCREENINFO: - if (!lock_fb_info(info)) - return -ENODEV; + lock_fb_info(info); var = info->var; unlock_fb_info(info); @@ -1132,10 +1120,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, if (copy_from_user(&var, argp, sizeof(var))) return -EFAULT; console_lock(); - if (!lock_fb_info(info)) { - console_unlock(); - return -ENODEV; - } + lock_fb_info(info); info->flags |= FBINFO_MISC_USEREVENT; ret = fb_set_var(info, &var); info->flags &= ~FBINFO_MISC_USEREVENT; @@ -1145,8 +1130,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, ret = -EFAULT; break; case FBIOGET_FSCREENINFO: - if (!lock_fb_info(info)) - return -ENODEV; + lock_fb_info(info); fix = info->fix; if (info->flags & FBINFO_HIDE_SMEM_START) fix.smem_start = 0; @@ -1162,8 +1146,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, case FBIOGETCMAP: if (copy_from_user(&cmap, argp, sizeof(cmap))) return -EFAULT; - if (!lock_fb_info(info)) - return -ENODEV; + lock_fb_info(info); cmap_from = info->cmap; unlock_fb_info(info); ret = fb_cmap_to_user(&cmap_from, &cmap); @@ -1172,10 +1155,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, if (copy_from_user(&var, argp, sizeof(var))) return -EFAULT; console_lock(); - if (!lock_fb_info(info)) { - console_unlock(); - return -ENODEV; - } + lock_fb_info(info); ret = fb_pan_display(info, &var); unlock_fb_info(info); console_unlock(); @@ -1192,8 +1172,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, return -EINVAL; con2fb.framebuffer = -1; event.data = &con2fb; - if (!lock_fb_info(info)) - return -ENODEV; + lock_fb_info(info); event.info = info; fb_notifier_call_chain(FB_EVENT_GET_CONSOLE_MAP, &event); unlock_fb_info(info); @@ -1214,10 +1193,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, } event.data = &con2fb; console_lock(); - if (!lock_fb_info(info)) { - console_unlock(); - return -ENODEV; - } + lock_fb_info(info); event.info = info; ret = fb_notifier_call_chain(FB_EVENT_SET_CONSOLE_MAP, &event); unlock_fb_info(info); @@ -1225,10 +1201,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, break; case FBIOBLANK: console_lock(); - if (!lock_fb_info(info)) { - console_unlock(); - return -ENODEV; - } + lock_fb_info(info); info->flags |= FBINFO_MISC_USEREVENT; ret = fb_blank(info, arg); info->flags &= ~FBINFO_MISC_USEREVENT; @@ -1236,8 +1209,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, console_unlock(); break; default: - if (!lock_fb_info(info)) - return -ENODEV; + lock_fb_info(info); fb = info->fbops; if (fb->fb_ioctl) ret = fb->fb_ioctl(info, cmd, arg); @@ -1357,8 +1329,7 @@ static int fb_get_fscreeninfo(struct fb_info *info, unsigned int cmd, { struct fb_fix_screeninfo fix; - if (!lock_fb_info(info)) - return -ENODEV; + lock_fb_info(info); fix = info->fix; if (info->flags & FBINFO_HIDE_SMEM_START) fix.smem_start = 0; @@ -1418,8 +1389,6 @@ fb_mmap(struct file *file, struct vm_area_struct * vma) if (!info) return -ENODEV; fb = info->fbops; - if (!fb) - return -ENODEV; mutex_lock(&info->mm_lock); if (fb->fb_mmap) { int res; @@ -1483,7 +1452,7 @@ __releases(&info->lock) if (IS_ERR(info)) return PTR_ERR(info); - mutex_lock(&info->lock); + lock_fb_info(info); if (!try_module_get(info->fbops->owner)) { res = -ENODEV; goto out; @@ -1499,7 +1468,7 @@ __releases(&info->lock) fb_deferred_io_open(info, inode, file); #endif out: - mutex_unlock(&info->lock); + unlock_fb_info(info); if (res) put_fb_info(info); return res; @@ -1512,11 +1481,11 @@ __releases(&info->lock) { struct fb_info * const info = file->private_data; - mutex_lock(&info->lock); + lock_fb_info(info); if (info->fbops->fb_release) info->fbops->fb_release(info,1); module_put(info->fbops->owner); - mutex_unlock(&info->lock); + unlock_fb_info(info); put_fb_info(info); return 0; } @@ -1726,14 +1695,10 @@ static int do_register_framebuffer(struct fb_info *fb_info) console_lock(); else atomic_inc(&ignore_console_lock_warning); - if (!lock_fb_info(fb_info)) { - ret = -ENODEV; - goto unlock_console; - } - + lock_fb_info(fb_info); ret = fbcon_fb_registered(fb_info); unlock_fb_info(fb_info); -unlock_console: + if (!lockless_register_fb) console_unlock(); else @@ -1751,11 +1716,7 @@ static int unbind_console(struct fb_info *fb_info) return -EINVAL; console_lock(); - if (!lock_fb_info(fb_info)) { - console_unlock(); - return -ENODEV; - } - + lock_fb_info(fb_info); event.info = fb_info; ret = fb_notifier_call_chain(FB_EVENT_FB_UNBIND, &event); unlock_fb_info(fb_info); diff --git a/include/linux/fb.h b/include/linux/fb.h index 701abaf79c87..fd60207c0685 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -656,7 +656,10 @@ extern struct class *fb_class; for (i = 0; i < FB_MAX; i++) \ if (!registered_fb[i]) {} else -extern int lock_fb_info(struct fb_info *info); +static inline void lock_fb_info(struct fb_info *info) +{ + mutex_lock(&info->lock); +} static inline void unlock_fb_info(struct fb_info *info) { -- 2.20.1
Also remove the error return value. That's all errors for either driver bugs (trying to unbind something that isn't bound), or errors of the new driver that will take over. There's nothing the outgoing driver can do about this anyway, so switch over to void. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: Peter Rosin <peda@axentia.se> Cc: Kees Cook <keescook@chromium.org> Cc: Konstantin Khorenko <khorenko@virtuozzo.com> Cc: Yisheng Xie <ysxie@foxmail.com> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: linux-fbdev@vger.kernel.org --- drivers/video/fbdev/core/fbcon.c | 24 +++++++----------------- drivers/video/fbdev/core/fbmem.c | 7 ++----- include/linux/fb.h | 2 -- include/linux/fbcon.h | 2 ++ 4 files changed, 11 insertions(+), 24 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 35443add7f7e..a8d12914b559 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -3042,7 +3042,7 @@ static int fbcon_mode_deleted(struct fb_info *info, } #ifdef CONFIG_VT_HW_CONSOLE_BINDING -static int fbcon_unbind(void) +static void fbcon_unbind(void) { int ret; @@ -3051,25 +3051,21 @@ static int fbcon_unbind(void) if (!ret) fbcon_has_console_bind = 0; - - return ret; } #else -static inline int fbcon_unbind(void) -{ - return -EINVAL; -} +static inline void fbcon_unbind(void) {} #endif /* CONFIG_VT_HW_CONSOLE_BINDING */ /* called with console_lock held */ -static int fbcon_fb_unbind(int idx) +void fbcon_fb_unbind(struct fb_info *info) { int i, new_idx = -1, ret = 0; + int idx = info->node; WARN_CONSOLE_UNLOCKED(); if (!fbcon_has_console_bind) - return 0; + return; for (i = first_fb_vc; i <= last_fb_vc; i++) { if (con2fb_map[i] != idx && @@ -3102,15 +3098,13 @@ static int fbcon_fb_unbind(int idx) idx, 0); if (ret) { con2fb_map[i] = idx; - return ret; + return; } } } } - ret = fbcon_unbind(); + fbcon_unbind(); } - - return ret; } /* called with console_lock held */ @@ -3348,10 +3342,6 @@ static int fbcon_event_notify(struct notifier_block *self, mode = event->data; ret = fbcon_mode_deleted(info, mode); break; - case FB_EVENT_FB_UNBIND: - idx = info->node; - ret = fbcon_fb_unbind(idx); - break; case FB_EVENT_SET_CONSOLE_MAP: /* called with console lock held */ con2fb = event->data; diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 1987aba4f5a2..156523cc48bf 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1708,8 +1708,6 @@ static int do_register_framebuffer(struct fb_info *fb_info) static int unbind_console(struct fb_info *fb_info) { - struct fb_event event; - int ret; int i = fb_info->node; if (i < 0 || i >= FB_MAX || registered_fb[i] != fb_info) @@ -1717,12 +1715,11 @@ static int unbind_console(struct fb_info *fb_info) console_lock(); lock_fb_info(fb_info); - event.info = fb_info; - ret = fb_notifier_call_chain(FB_EVENT_FB_UNBIND, &event); + fbcon_fb_unbind(fb_info); unlock_fb_info(fb_info); console_unlock(); - return ret; + return 0; } static int __unlink_framebuffer(struct fb_info *fb_info); diff --git a/include/linux/fb.h b/include/linux/fb.h index fd60207c0685..38fae1678939 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -151,8 +151,6 @@ struct fb_cursor_user { #define FB_EVENT_CONBLANK 0x0C /* Get drawing requirements */ #define FB_EVENT_GET_REQ 0x0D -/* Unbind from the console if possible */ -#define FB_EVENT_FB_UNBIND 0x0E /* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga_switcheroo */ #define FB_EVENT_REMAP_ALL_CONSOLE 0x0F /* A hardware display blank early change occurred */ diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h index 94a71e9e1257..38d44fdb6d14 100644 --- a/include/linux/fbcon.h +++ b/include/linux/fbcon.h @@ -6,11 +6,13 @@ 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); #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) {} #endif #endif /* _LINUX_FBCON_H */ -- 2.20.1
Also remove the error return value. That's all errors for either driver bugs (trying to unbind something that isn't bound), or errors of the new driver that will take over. There's nothing the outgoing driver can do about this anyway, so switch over to void. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: Peter Rosin <peda@axentia.se> Cc: Kees Cook <keescook@chromium.org> Cc: Konstantin Khorenko <khorenko@virtuozzo.com> Cc: Yisheng Xie <ysxie@foxmail.com> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: linux-fbdev@vger.kernel.org --- drivers/video/fbdev/core/fbcon.c | 24 +++++++----------------- drivers/video/fbdev/core/fbmem.c | 7 ++----- include/linux/fb.h | 2 -- include/linux/fbcon.h | 2 ++ 4 files changed, 11 insertions(+), 24 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 35443add7f7e..a8d12914b559 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -3042,7 +3042,7 @@ static int fbcon_mode_deleted(struct fb_info *info, } #ifdef CONFIG_VT_HW_CONSOLE_BINDING -static int fbcon_unbind(void) +static void fbcon_unbind(void) { int ret; @@ -3051,25 +3051,21 @@ static int fbcon_unbind(void) if (!ret) fbcon_has_console_bind = 0; - - return ret; } #else -static inline int fbcon_unbind(void) -{ - return -EINVAL; -} +static inline void fbcon_unbind(void) {} #endif /* CONFIG_VT_HW_CONSOLE_BINDING */ /* called with console_lock held */ -static int fbcon_fb_unbind(int idx) +void fbcon_fb_unbind(struct fb_info *info) { int i, new_idx = -1, ret = 0; + int idx = info->node; WARN_CONSOLE_UNLOCKED(); if (!fbcon_has_console_bind) - return 0; + return; for (i = first_fb_vc; i <= last_fb_vc; i++) { if (con2fb_map[i] != idx && @@ -3102,15 +3098,13 @@ static int fbcon_fb_unbind(int idx) idx, 0); if (ret) { con2fb_map[i] = idx; - return ret; + return; } } } } - ret = fbcon_unbind(); + fbcon_unbind(); } - - return ret; } /* called with console_lock held */ @@ -3348,10 +3342,6 @@ static int fbcon_event_notify(struct notifier_block *self, mode = event->data; ret = fbcon_mode_deleted(info, mode); break; - case FB_EVENT_FB_UNBIND: - idx = info->node; - ret = fbcon_fb_unbind(idx); - break; case FB_EVENT_SET_CONSOLE_MAP: /* called with console lock held */ con2fb = event->data; diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 1987aba4f5a2..156523cc48bf 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1708,8 +1708,6 @@ static int do_register_framebuffer(struct fb_info *fb_info) static int unbind_console(struct fb_info *fb_info) { - struct fb_event event; - int ret; int i = fb_info->node; if (i < 0 || i >= FB_MAX || registered_fb[i] != fb_info) @@ -1717,12 +1715,11 @@ static int unbind_console(struct fb_info *fb_info) console_lock(); lock_fb_info(fb_info); - event.info = fb_info; - ret = fb_notifier_call_chain(FB_EVENT_FB_UNBIND, &event); + fbcon_fb_unbind(fb_info); unlock_fb_info(fb_info); console_unlock(); - return ret; + return 0; } static int __unlink_framebuffer(struct fb_info *fb_info); diff --git a/include/linux/fb.h b/include/linux/fb.h index fd60207c0685..38fae1678939 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -151,8 +151,6 @@ struct fb_cursor_user { #define FB_EVENT_CONBLANK 0x0C /* Get drawing requirements */ #define FB_EVENT_GET_REQ 0x0D -/* Unbind from the console if possible */ -#define FB_EVENT_FB_UNBIND 0x0E /* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga_switcheroo */ #define FB_EVENT_REMAP_ALL_CONSOLE 0x0F /* A hardware display blank early change occurred */ diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h index 94a71e9e1257..38d44fdb6d14 100644 --- a/include/linux/fbcon.h +++ b/include/linux/fbcon.h @@ -6,11 +6,13 @@ 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); #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) {} #endif #endif /* _LINUX_FBCON_H */ -- 2.20.1
Also remove the error return value. That's all errors for either driver bugs (trying to unbind something that isn't bound), or errors of the new driver that will take over. There's nothing the outgoing driver can do about this anyway, so switch over to void. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: Peter Rosin <peda@axentia.se> Cc: Kees Cook <keescook@chromium.org> Cc: Konstantin Khorenko <khorenko@virtuozzo.com> Cc: Yisheng Xie <ysxie@foxmail.com> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: linux-fbdev@vger.kernel.org --- drivers/video/fbdev/core/fbcon.c | 24 +++++++----------------- drivers/video/fbdev/core/fbmem.c | 7 ++----- include/linux/fb.h | 2 -- include/linux/fbcon.h | 2 ++ 4 files changed, 11 insertions(+), 24 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 35443add7f7e..a8d12914b559 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -3042,7 +3042,7 @@ static int fbcon_mode_deleted(struct fb_info *info, } #ifdef CONFIG_VT_HW_CONSOLE_BINDING -static int fbcon_unbind(void) +static void fbcon_unbind(void) { int ret; @@ -3051,25 +3051,21 @@ static int fbcon_unbind(void) if (!ret) fbcon_has_console_bind = 0; - - return ret; } #else -static inline int fbcon_unbind(void) -{ - return -EINVAL; -} +static inline void fbcon_unbind(void) {} #endif /* CONFIG_VT_HW_CONSOLE_BINDING */ /* called with console_lock held */ -static int fbcon_fb_unbind(int idx) +void fbcon_fb_unbind(struct fb_info *info) { int i, new_idx = -1, ret = 0; + int idx = info->node; WARN_CONSOLE_UNLOCKED(); if (!fbcon_has_console_bind) - return 0; + return; for (i = first_fb_vc; i <= last_fb_vc; i++) { if (con2fb_map[i] != idx && @@ -3102,15 +3098,13 @@ static int fbcon_fb_unbind(int idx) idx, 0); if (ret) { con2fb_map[i] = idx; - return ret; + return; } } } } - ret = fbcon_unbind(); + fbcon_unbind(); } - - return ret; } /* called with console_lock held */ @@ -3348,10 +3342,6 @@ static int fbcon_event_notify(struct notifier_block *self, mode = event->data; ret = fbcon_mode_deleted(info, mode); break; - case FB_EVENT_FB_UNBIND: - idx = info->node; - ret = fbcon_fb_unbind(idx); - break; case FB_EVENT_SET_CONSOLE_MAP: /* called with console lock held */ con2fb = event->data; diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 1987aba4f5a2..156523cc48bf 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1708,8 +1708,6 @@ static int do_register_framebuffer(struct fb_info *fb_info) static int unbind_console(struct fb_info *fb_info) { - struct fb_event event; - int ret; int i = fb_info->node; if (i < 0 || i >= FB_MAX || registered_fb[i] != fb_info) @@ -1717,12 +1715,11 @@ static int unbind_console(struct fb_info *fb_info) console_lock(); lock_fb_info(fb_info); - event.info = fb_info; - ret = fb_notifier_call_chain(FB_EVENT_FB_UNBIND, &event); + fbcon_fb_unbind(fb_info); unlock_fb_info(fb_info); console_unlock(); - return ret; + return 0; } static int __unlink_framebuffer(struct fb_info *fb_info); diff --git a/include/linux/fb.h b/include/linux/fb.h index fd60207c0685..38fae1678939 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -151,8 +151,6 @@ struct fb_cursor_user { #define FB_EVENT_CONBLANK 0x0C /* Get drawing requirements */ #define FB_EVENT_GET_REQ 0x0D -/* Unbind from the console if possible */ -#define FB_EVENT_FB_UNBIND 0x0E /* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga_switcheroo */ #define FB_EVENT_REMAP_ALL_CONSOLE 0x0F /* A hardware display blank early change occurred */ diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h index 94a71e9e1257..38d44fdb6d14 100644 --- a/include/linux/fbcon.h +++ b/include/linux/fbcon.h @@ -6,11 +6,13 @@ 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); #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) {} #endif #endif /* _LINUX_FBCON_H */ -- 2.20.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Except for driver bugs (which we'll catch with a WARN_ON) this is only to report failures of the new driver taking over the console. There's nothing the outgoing driver can do about that, and no one ever bothered to actually look at these return values. So remove them all. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Peter Rosin <peda@axentia.se> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: linux-fbdev@vger.kernel.org --- drivers/video/fbdev/core/fbmem.c | 73 ++++++++++---------------------- include/linux/fb.h | 4 +- 2 files changed, 25 insertions(+), 52 deletions(-) diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 156523cc48bf..032506576aa0 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1590,13 +1590,13 @@ static bool fb_do_apertures_overlap(struct apertures_struct *gena, return false; } -static int do_unregister_framebuffer(struct fb_info *fb_info); +static void do_unregister_framebuffer(struct fb_info *fb_info); #define VGA_FB_PHYS 0xA0000 -static int do_remove_conflicting_framebuffers(struct apertures_struct *a, - const char *name, bool primary) +static void do_remove_conflicting_framebuffers(struct apertures_struct *a, + const char *name, bool primary) { - int i, ret; + int i; /* check all firmware fbs and kick off if the base addr overlaps */ for_each_registered_fb(i) { @@ -1612,13 +1612,9 @@ static int do_remove_conflicting_framebuffers(struct apertures_struct *a, printk(KERN_INFO "fb%d: switching to %s from %s\n", i, name, registered_fb[i]->fix.id); - ret = do_unregister_framebuffer(registered_fb[i]); - if (ret) - return ret; + do_unregister_framebuffer(registered_fb[i]); } } - - return 0; } static bool lockless_register_fb; @@ -1634,11 +1630,9 @@ static int do_register_framebuffer(struct fb_info *fb_info) if (fb_check_foreignness(fb_info)) return -ENOSYS; - ret = do_remove_conflicting_framebuffers(fb_info->apertures, - fb_info->fix.id, - fb_is_primary_device(fb_info)); - if (ret) - return ret; + do_remove_conflicting_framebuffers(fb_info->apertures, + fb_info->fix.id, + fb_is_primary_device(fb_info)); if (num_registered_fb == FB_MAX) return -ENXIO; @@ -1706,32 +1700,25 @@ static int do_register_framebuffer(struct fb_info *fb_info) return ret; } -static int unbind_console(struct fb_info *fb_info) +static void unbind_console(struct fb_info *fb_info) { int i = fb_info->node; - if (i < 0 || i >= FB_MAX || registered_fb[i] != fb_info) - return -EINVAL; + if (WARN_ON(i < 0 || i >= FB_MAX || registered_fb[i] != fb_info)) + return; console_lock(); lock_fb_info(fb_info); fbcon_fb_unbind(fb_info); unlock_fb_info(fb_info); console_unlock(); - - return 0; } -static int __unlink_framebuffer(struct fb_info *fb_info); +static void __unlink_framebuffer(struct fb_info *fb_info); -static int do_unregister_framebuffer(struct fb_info *fb_info) +static void do_unregister_framebuffer(struct fb_info *fb_info) { - int ret; - - ret = unbind_console(fb_info); - - if (ret) - return -EINVAL; + unbind_console(fb_info); pm_vt_switch_unregister(fb_info->dev); @@ -1749,36 +1736,27 @@ static int do_unregister_framebuffer(struct fb_info *fb_info) /* this may free fb info */ put_fb_info(fb_info); - return 0; } -static int __unlink_framebuffer(struct fb_info *fb_info) +static void __unlink_framebuffer(struct fb_info *fb_info) { int i; i = fb_info->node; - if (i < 0 || i >= FB_MAX || registered_fb[i] != fb_info) - return -EINVAL; + if (WARN_ON(i < 0 || i >= FB_MAX || registered_fb[i] != fb_info)) + return; if (fb_info->dev) { device_destroy(fb_class, MKDEV(FB_MAJOR, i)); fb_info->dev = NULL; } - - return 0; } -int unlink_framebuffer(struct fb_info *fb_info) +void unlink_framebuffer(struct fb_info *fb_info) { - int ret; - - ret = __unlink_framebuffer(fb_info); - if (ret) - return ret; + __unlink_framebuffer(fb_info); unbind_console(fb_info); - - return 0; } EXPORT_SYMBOL(unlink_framebuffer); @@ -1795,7 +1773,6 @@ EXPORT_SYMBOL(unlink_framebuffer); int remove_conflicting_framebuffers(struct apertures_struct *a, const char *name, bool primary) { - int ret; bool do_free = false; if (!a) { @@ -1809,13 +1786,13 @@ int remove_conflicting_framebuffers(struct apertures_struct *a, } mutex_lock(®istration_lock); - ret = do_remove_conflicting_framebuffers(a, name, primary); + do_remove_conflicting_framebuffers(a, name, primary); mutex_unlock(®istration_lock); if (do_free) kfree(a); - return ret; + return 0; } EXPORT_SYMBOL(remove_conflicting_framebuffers); @@ -1891,16 +1868,12 @@ EXPORT_SYMBOL(register_framebuffer); * that the driver implements fb_open() and fb_release() to * check that no processes are using the device. */ -int +void unregister_framebuffer(struct fb_info *fb_info) { - int ret; - mutex_lock(®istration_lock); - ret = do_unregister_framebuffer(fb_info); + do_unregister_framebuffer(fb_info); mutex_unlock(®istration_lock); - - return ret; } EXPORT_SYMBOL(unregister_framebuffer); diff --git a/include/linux/fb.h b/include/linux/fb.h index 38fae1678939..44021e55b15c 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -627,8 +627,8 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf, /* drivers/video/fbmem.c */ extern int register_framebuffer(struct fb_info *fb_info); -extern int unregister_framebuffer(struct fb_info *fb_info); -extern int unlink_framebuffer(struct fb_info *fb_info); +extern void unregister_framebuffer(struct fb_info *fb_info); +extern void unlink_framebuffer(struct fb_info *fb_info); extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, const char *name); extern int remove_conflicting_framebuffers(struct apertures_struct *a, -- 2.20.1
Except for driver bugs (which we'll catch with a WARN_ON) this is only to report failures of the new driver taking over the console. There's nothing the outgoing driver can do about that, and no one ever bothered to actually look at these return values. So remove them all. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Peter Rosin <peda@axentia.se> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: linux-fbdev@vger.kernel.org --- drivers/video/fbdev/core/fbmem.c | 73 ++++++++++---------------------- include/linux/fb.h | 4 +- 2 files changed, 25 insertions(+), 52 deletions(-) diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 156523cc48bf..032506576aa0 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1590,13 +1590,13 @@ static bool fb_do_apertures_overlap(struct apertures_struct *gena, return false; } -static int do_unregister_framebuffer(struct fb_info *fb_info); +static void do_unregister_framebuffer(struct fb_info *fb_info); #define VGA_FB_PHYS 0xA0000 -static int do_remove_conflicting_framebuffers(struct apertures_struct *a, - const char *name, bool primary) +static void do_remove_conflicting_framebuffers(struct apertures_struct *a, + const char *name, bool primary) { - int i, ret; + int i; /* check all firmware fbs and kick off if the base addr overlaps */ for_each_registered_fb(i) { @@ -1612,13 +1612,9 @@ static int do_remove_conflicting_framebuffers(struct apertures_struct *a, printk(KERN_INFO "fb%d: switching to %s from %s\n", i, name, registered_fb[i]->fix.id); - ret = do_unregister_framebuffer(registered_fb[i]); - if (ret) - return ret; + do_unregister_framebuffer(registered_fb[i]); } } - - return 0; } static bool lockless_register_fb; @@ -1634,11 +1630,9 @@ static int do_register_framebuffer(struct fb_info *fb_info) if (fb_check_foreignness(fb_info)) return -ENOSYS; - ret = do_remove_conflicting_framebuffers(fb_info->apertures, - fb_info->fix.id, - fb_is_primary_device(fb_info)); - if (ret) - return ret; + do_remove_conflicting_framebuffers(fb_info->apertures, + fb_info->fix.id, + fb_is_primary_device(fb_info)); if (num_registered_fb = FB_MAX) return -ENXIO; @@ -1706,32 +1700,25 @@ static int do_register_framebuffer(struct fb_info *fb_info) return ret; } -static int unbind_console(struct fb_info *fb_info) +static void unbind_console(struct fb_info *fb_info) { int i = fb_info->node; - if (i < 0 || i >= FB_MAX || registered_fb[i] != fb_info) - return -EINVAL; + if (WARN_ON(i < 0 || i >= FB_MAX || registered_fb[i] != fb_info)) + return; console_lock(); lock_fb_info(fb_info); fbcon_fb_unbind(fb_info); unlock_fb_info(fb_info); console_unlock(); - - return 0; } -static int __unlink_framebuffer(struct fb_info *fb_info); +static void __unlink_framebuffer(struct fb_info *fb_info); -static int do_unregister_framebuffer(struct fb_info *fb_info) +static void do_unregister_framebuffer(struct fb_info *fb_info) { - int ret; - - ret = unbind_console(fb_info); - - if (ret) - return -EINVAL; + unbind_console(fb_info); pm_vt_switch_unregister(fb_info->dev); @@ -1749,36 +1736,27 @@ static int do_unregister_framebuffer(struct fb_info *fb_info) /* this may free fb info */ put_fb_info(fb_info); - return 0; } -static int __unlink_framebuffer(struct fb_info *fb_info) +static void __unlink_framebuffer(struct fb_info *fb_info) { int i; i = fb_info->node; - if (i < 0 || i >= FB_MAX || registered_fb[i] != fb_info) - return -EINVAL; + if (WARN_ON(i < 0 || i >= FB_MAX || registered_fb[i] != fb_info)) + return; if (fb_info->dev) { device_destroy(fb_class, MKDEV(FB_MAJOR, i)); fb_info->dev = NULL; } - - return 0; } -int unlink_framebuffer(struct fb_info *fb_info) +void unlink_framebuffer(struct fb_info *fb_info) { - int ret; - - ret = __unlink_framebuffer(fb_info); - if (ret) - return ret; + __unlink_framebuffer(fb_info); unbind_console(fb_info); - - return 0; } EXPORT_SYMBOL(unlink_framebuffer); @@ -1795,7 +1773,6 @@ EXPORT_SYMBOL(unlink_framebuffer); int remove_conflicting_framebuffers(struct apertures_struct *a, const char *name, bool primary) { - int ret; bool do_free = false; if (!a) { @@ -1809,13 +1786,13 @@ int remove_conflicting_framebuffers(struct apertures_struct *a, } mutex_lock(®istration_lock); - ret = do_remove_conflicting_framebuffers(a, name, primary); + do_remove_conflicting_framebuffers(a, name, primary); mutex_unlock(®istration_lock); if (do_free) kfree(a); - return ret; + return 0; } EXPORT_SYMBOL(remove_conflicting_framebuffers); @@ -1891,16 +1868,12 @@ EXPORT_SYMBOL(register_framebuffer); * that the driver implements fb_open() and fb_release() to * check that no processes are using the device. */ -int +void unregister_framebuffer(struct fb_info *fb_info) { - int ret; - mutex_lock(®istration_lock); - ret = do_unregister_framebuffer(fb_info); + do_unregister_framebuffer(fb_info); mutex_unlock(®istration_lock); - - return ret; } EXPORT_SYMBOL(unregister_framebuffer); diff --git a/include/linux/fb.h b/include/linux/fb.h index 38fae1678939..44021e55b15c 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -627,8 +627,8 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf, /* drivers/video/fbmem.c */ extern int register_framebuffer(struct fb_info *fb_info); -extern int unregister_framebuffer(struct fb_info *fb_info); -extern int unlink_framebuffer(struct fb_info *fb_info); +extern void unregister_framebuffer(struct fb_info *fb_info); +extern void unlink_framebuffer(struct fb_info *fb_info); extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, const char *name); extern int remove_conflicting_framebuffers(struct apertures_struct *a, -- 2.20.1
Except for driver bugs (which we'll catch with a WARN_ON) this is only to report failures of the new driver taking over the console. There's nothing the outgoing driver can do about that, and no one ever bothered to actually look at these return values. So remove them all. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Peter Rosin <peda@axentia.se> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: linux-fbdev@vger.kernel.org --- drivers/video/fbdev/core/fbmem.c | 73 ++++++++++---------------------- include/linux/fb.h | 4 +- 2 files changed, 25 insertions(+), 52 deletions(-) diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 156523cc48bf..032506576aa0 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1590,13 +1590,13 @@ static bool fb_do_apertures_overlap(struct apertures_struct *gena, return false; } -static int do_unregister_framebuffer(struct fb_info *fb_info); +static void do_unregister_framebuffer(struct fb_info *fb_info); #define VGA_FB_PHYS 0xA0000 -static int do_remove_conflicting_framebuffers(struct apertures_struct *a, - const char *name, bool primary) +static void do_remove_conflicting_framebuffers(struct apertures_struct *a, + const char *name, bool primary) { - int i, ret; + int i; /* check all firmware fbs and kick off if the base addr overlaps */ for_each_registered_fb(i) { @@ -1612,13 +1612,9 @@ static int do_remove_conflicting_framebuffers(struct apertures_struct *a, printk(KERN_INFO "fb%d: switching to %s from %s\n", i, name, registered_fb[i]->fix.id); - ret = do_unregister_framebuffer(registered_fb[i]); - if (ret) - return ret; + do_unregister_framebuffer(registered_fb[i]); } } - - return 0; } static bool lockless_register_fb; @@ -1634,11 +1630,9 @@ static int do_register_framebuffer(struct fb_info *fb_info) if (fb_check_foreignness(fb_info)) return -ENOSYS; - ret = do_remove_conflicting_framebuffers(fb_info->apertures, - fb_info->fix.id, - fb_is_primary_device(fb_info)); - if (ret) - return ret; + do_remove_conflicting_framebuffers(fb_info->apertures, + fb_info->fix.id, + fb_is_primary_device(fb_info)); if (num_registered_fb == FB_MAX) return -ENXIO; @@ -1706,32 +1700,25 @@ static int do_register_framebuffer(struct fb_info *fb_info) return ret; } -static int unbind_console(struct fb_info *fb_info) +static void unbind_console(struct fb_info *fb_info) { int i = fb_info->node; - if (i < 0 || i >= FB_MAX || registered_fb[i] != fb_info) - return -EINVAL; + if (WARN_ON(i < 0 || i >= FB_MAX || registered_fb[i] != fb_info)) + return; console_lock(); lock_fb_info(fb_info); fbcon_fb_unbind(fb_info); unlock_fb_info(fb_info); console_unlock(); - - return 0; } -static int __unlink_framebuffer(struct fb_info *fb_info); +static void __unlink_framebuffer(struct fb_info *fb_info); -static int do_unregister_framebuffer(struct fb_info *fb_info) +static void do_unregister_framebuffer(struct fb_info *fb_info) { - int ret; - - ret = unbind_console(fb_info); - - if (ret) - return -EINVAL; + unbind_console(fb_info); pm_vt_switch_unregister(fb_info->dev); @@ -1749,36 +1736,27 @@ static int do_unregister_framebuffer(struct fb_info *fb_info) /* this may free fb info */ put_fb_info(fb_info); - return 0; } -static int __unlink_framebuffer(struct fb_info *fb_info) +static void __unlink_framebuffer(struct fb_info *fb_info) { int i; i = fb_info->node; - if (i < 0 || i >= FB_MAX || registered_fb[i] != fb_info) - return -EINVAL; + if (WARN_ON(i < 0 || i >= FB_MAX || registered_fb[i] != fb_info)) + return; if (fb_info->dev) { device_destroy(fb_class, MKDEV(FB_MAJOR, i)); fb_info->dev = NULL; } - - return 0; } -int unlink_framebuffer(struct fb_info *fb_info) +void unlink_framebuffer(struct fb_info *fb_info) { - int ret; - - ret = __unlink_framebuffer(fb_info); - if (ret) - return ret; + __unlink_framebuffer(fb_info); unbind_console(fb_info); - - return 0; } EXPORT_SYMBOL(unlink_framebuffer); @@ -1795,7 +1773,6 @@ EXPORT_SYMBOL(unlink_framebuffer); int remove_conflicting_framebuffers(struct apertures_struct *a, const char *name, bool primary) { - int ret; bool do_free = false; if (!a) { @@ -1809,13 +1786,13 @@ int remove_conflicting_framebuffers(struct apertures_struct *a, } mutex_lock(®istration_lock); - ret = do_remove_conflicting_framebuffers(a, name, primary); + do_remove_conflicting_framebuffers(a, name, primary); mutex_unlock(®istration_lock); if (do_free) kfree(a); - return ret; + return 0; } EXPORT_SYMBOL(remove_conflicting_framebuffers); @@ -1891,16 +1868,12 @@ EXPORT_SYMBOL(register_framebuffer); * that the driver implements fb_open() and fb_release() to * check that no processes are using the device. */ -int +void unregister_framebuffer(struct fb_info *fb_info) { - int ret; - mutex_lock(®istration_lock); - ret = do_unregister_framebuffer(fb_info); + do_unregister_framebuffer(fb_info); mutex_unlock(®istration_lock); - - return ret; } EXPORT_SYMBOL(unregister_framebuffer); diff --git a/include/linux/fb.h b/include/linux/fb.h index 38fae1678939..44021e55b15c 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -627,8 +627,8 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf, /* drivers/video/fbmem.c */ extern int register_framebuffer(struct fb_info *fb_info); -extern int unregister_framebuffer(struct fb_info *fb_info); -extern int unlink_framebuffer(struct fb_info *fb_info); +extern void unregister_framebuffer(struct fb_info *fb_info); +extern void unlink_framebuffer(struct fb_info *fb_info); extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, const char *name); extern int remove_conflicting_framebuffers(struct apertures_struct *a, -- 2.20.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
For some reasons the pm_vt_switch_unregister call was missing from the direct unregister_framebuffer path. Fix this. v2: fbinfo->dev is used to decided whether unlink_framebuffer has been called already. I botched that in v1. Make this all clearer by inlining __unlink_framebuffer. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Peter Rosin <peda@axentia.se> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Mikulas Patocka <mpatocka@redhat.com> --- drivers/video/fbdev/core/fbmem.c | 47 ++++++++++++++------------------ 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 032506576aa0..f059b0b1a030 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1714,15 +1714,30 @@ static void unbind_console(struct fb_info *fb_info) console_unlock(); } -static void __unlink_framebuffer(struct fb_info *fb_info); - -static void do_unregister_framebuffer(struct fb_info *fb_info) +void unlink_framebuffer(struct fb_info *fb_info) { - unbind_console(fb_info); + int i; + + i = fb_info->node; + if (WARN_ON(i < 0 || i >= FB_MAX || registered_fb[i] != fb_info)) + return; + + if (!fb_info->dev) + return; + + device_destroy(fb_class, MKDEV(FB_MAJOR, i)); pm_vt_switch_unregister(fb_info->dev); - __unlink_framebuffer(fb_info); + unbind_console(fb_info); + + fb_info->dev = NULL; +} +EXPORT_SYMBOL(unlink_framebuffer); + +static void do_unregister_framebuffer(struct fb_info *fb_info) +{ + unlink_framebuffer(fb_info); if (fb_info->pixmap.addr && (fb_info->pixmap.flags & FB_PIXMAP_DEFAULT)) kfree(fb_info->pixmap.addr); @@ -1738,28 +1753,6 @@ static void do_unregister_framebuffer(struct fb_info *fb_info) put_fb_info(fb_info); } -static void __unlink_framebuffer(struct fb_info *fb_info) -{ - int i; - - i = fb_info->node; - if (WARN_ON(i < 0 || i >= FB_MAX || registered_fb[i] != fb_info)) - return; - - if (fb_info->dev) { - device_destroy(fb_class, MKDEV(FB_MAJOR, i)); - fb_info->dev = NULL; - } -} - -void unlink_framebuffer(struct fb_info *fb_info) -{ - __unlink_framebuffer(fb_info); - - unbind_console(fb_info); -} -EXPORT_SYMBOL(unlink_framebuffer); - /** * remove_conflicting_framebuffers - remove firmware-configured framebuffers * @a: memory range, users of which are to be removed -- 2.20.1
This seems to be entirely defunct: - The FB_EVEN_SUSPEND/RESUME events are only sent out by fb_set_suspend. Which is supposed to be called by drivers in their suspend/resume hooks, and not itself call into drivers. Luckily sh_mob doesn't call fb_set_suspend, so this seems to do nothing useful. - The notify hook calls sh_mobile_fb_reconfig() which in turn can call into the fb notifier. Or attempt too, since that would deadlock. So looks like leftover hacks from when this was originally introduced in commit 6011bdeaa6089d49c02de69f05980da7bad314ab Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Date: Wed Jul 21 10:13:21 2010 +0000 fbdev: sh-mobile: HDMI support for SH-Mobile SoCs So let's just remove it. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Markus Elfring <elfring@users.sourceforge.net> Cc: Geert Uytterhoeven <geert+renesas@glider.be> Cc: Wolfram Sang <wsa+renesas@sang-engineering.com> --- drivers/video/fbdev/sh_mobile_lcdcfb.c | 38 -------------------------- 1 file changed, 38 deletions(-) diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c index c5924f5e98c6..0d7a044852d7 100644 --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c @@ -213,7 +213,6 @@ struct sh_mobile_lcdc_priv { struct sh_mobile_lcdc_chan ch[2]; struct sh_mobile_lcdc_overlay overlays[4]; - struct notifier_block notifier; int started; int forced_fourcc; /* 2 channel LCDC must share fourcc setting */ }; @@ -2258,37 +2257,6 @@ static const struct dev_pm_ops sh_mobile_lcdc_dev_pm_ops = { * Framebuffer notifier */ -/* locking: called with info->lock held */ -static int sh_mobile_lcdc_notify(struct notifier_block *nb, - unsigned long action, void *data) -{ - struct fb_event *event = data; - struct fb_info *info = event->info; - struct sh_mobile_lcdc_chan *ch = info->par; - - if (&ch->lcdc->notifier != nb) - return NOTIFY_DONE; - - dev_dbg(info->dev, "%s(): action = %lu, data = %p\n", - __func__, action, event->data); - - switch(action) { - case FB_EVENT_SUSPEND: - sh_mobile_lcdc_display_off(ch); - sh_mobile_lcdc_stop(ch->lcdc); - break; - case FB_EVENT_RESUME: - mutex_lock(&ch->open_lock); - sh_mobile_fb_reconfig(info); - mutex_unlock(&ch->open_lock); - - sh_mobile_lcdc_display_on(ch); - sh_mobile_lcdc_start(ch->lcdc); - } - - return NOTIFY_OK; -} - /* ----------------------------------------------------------------------------- * Probe/remove and driver init/exit */ @@ -2316,8 +2284,6 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev) struct sh_mobile_lcdc_priv *priv = platform_get_drvdata(pdev); unsigned int i; - fb_unregister_client(&priv->notifier); - for (i = 0; i < ARRAY_SIZE(priv->overlays); i++) sh_mobile_lcdc_overlay_fb_unregister(&priv->overlays[i]); for (i = 0; i < ARRAY_SIZE(priv->ch); i++) @@ -2707,10 +2673,6 @@ static int sh_mobile_lcdc_probe(struct platform_device *pdev) goto err1; } - /* Failure ignored */ - priv->notifier.notifier_call = sh_mobile_lcdc_notify; - fb_register_client(&priv->notifier); - return 0; err1: sh_mobile_lcdc_remove(pdev); -- 2.20.1
With the sh_mobile notifier removed we can just directly call the fbcon code here. v2: Remove now unused local variable. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Kees Cook <keescook@chromium.org> Cc: Konstantin Khorenko <khorenko@virtuozzo.com> Cc: Yisheng Xie <ysxie@foxmail.com> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Peter Rosin <peda@axentia.se> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: linux-fbdev@vger.kernel.org --- drivers/video/fbdev/core/fbcon.c | 10 ++-------- drivers/video/fbdev/core/fbmem.c | 7 ++----- include/linux/fb.h | 8 -------- include/linux/fbcon.h | 4 ++++ 4 files changed, 8 insertions(+), 21 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index a8d12914b559..b056d1190788 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -2915,7 +2915,7 @@ static int fbcon_set_origin(struct vc_data *vc) return 0; } -static void fbcon_suspended(struct fb_info *info) +void fbcon_suspended(struct fb_info *info) { struct vc_data *vc = NULL; struct fbcon_ops *ops = info->fbcon_par; @@ -2928,7 +2928,7 @@ static void fbcon_suspended(struct fb_info *info) fbcon_cursor(vc, CM_ERASE); } -static void fbcon_resumed(struct fb_info *info) +void fbcon_resumed(struct fb_info *info) { struct vc_data *vc; struct fbcon_ops *ops = info->fbcon_par; @@ -3326,12 +3326,6 @@ static int fbcon_event_notify(struct notifier_block *self, int idx, ret = 0; switch(action) { - case FB_EVENT_SUSPEND: - fbcon_suspended(info); - break; - case FB_EVENT_RESUME: - fbcon_resumed(info); - break; case FB_EVENT_MODE_CHANGE: fbcon_modechanged(info); break; diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index f059b0b1a030..7c55846ee5fc 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1881,17 +1881,14 @@ EXPORT_SYMBOL(unregister_framebuffer); */ void fb_set_suspend(struct fb_info *info, int state) { - struct fb_event event; - WARN_CONSOLE_UNLOCKED(); - event.info = info; if (state) { - fb_notifier_call_chain(FB_EVENT_SUSPEND, &event); + fbcon_suspended(info); info->state = FBINFO_STATE_SUSPENDED; } else { info->state = FBINFO_STATE_RUNNING; - fb_notifier_call_chain(FB_EVENT_RESUME, &event); + fbcon_resumed(info); } } EXPORT_SYMBOL(fb_set_suspend); diff --git a/include/linux/fb.h b/include/linux/fb.h index 44021e55b15c..a78bbd372cfd 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -126,14 +126,6 @@ struct fb_cursor_user { /* The resolution of the passed in fb_info about to change */ #define FB_EVENT_MODE_CHANGE 0x01 -/* The display on this fb_info is being suspended, no access to the - * framebuffer is allowed any more after that call returns - */ -#define FB_EVENT_SUSPEND 0x02 -/* The display on this fb_info was resumed, you can restore the display - * if you own it - */ -#define FB_EVENT_RESUME 0x03 /* An entry from the modelist was removed */ #define FB_EVENT_MODE_DELETE 0x04 /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h index 38d44fdb6d14..61a22e6c0c64 100644 --- a/include/linux/fbcon.h +++ b/include/linux/fbcon.h @@ -7,12 +7,16 @@ 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); #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(void) {} +static inline void fbcon_resumed(void) {} #endif #endif /* _LINUX_FBCON_H */ -- 2.20.1
With the sh_mobile notifier removed we can just directly call the fbcon code here. v2: Remove now unused local variable. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Kees Cook <keescook@chromium.org> Cc: Konstantin Khorenko <khorenko@virtuozzo.com> Cc: Yisheng Xie <ysxie@foxmail.com> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Peter Rosin <peda@axentia.se> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: linux-fbdev@vger.kernel.org --- drivers/video/fbdev/core/fbcon.c | 10 ++-------- drivers/video/fbdev/core/fbmem.c | 7 ++----- include/linux/fb.h | 8 -------- include/linux/fbcon.h | 4 ++++ 4 files changed, 8 insertions(+), 21 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index a8d12914b559..b056d1190788 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -2915,7 +2915,7 @@ static int fbcon_set_origin(struct vc_data *vc) return 0; } -static void fbcon_suspended(struct fb_info *info) +void fbcon_suspended(struct fb_info *info) { struct vc_data *vc = NULL; struct fbcon_ops *ops = info->fbcon_par; @@ -2928,7 +2928,7 @@ static void fbcon_suspended(struct fb_info *info) fbcon_cursor(vc, CM_ERASE); } -static void fbcon_resumed(struct fb_info *info) +void fbcon_resumed(struct fb_info *info) { struct vc_data *vc; struct fbcon_ops *ops = info->fbcon_par; @@ -3326,12 +3326,6 @@ static int fbcon_event_notify(struct notifier_block *self, int idx, ret = 0; switch(action) { - case FB_EVENT_SUSPEND: - fbcon_suspended(info); - break; - case FB_EVENT_RESUME: - fbcon_resumed(info); - break; case FB_EVENT_MODE_CHANGE: fbcon_modechanged(info); break; diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index f059b0b1a030..7c55846ee5fc 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1881,17 +1881,14 @@ EXPORT_SYMBOL(unregister_framebuffer); */ void fb_set_suspend(struct fb_info *info, int state) { - struct fb_event event; - WARN_CONSOLE_UNLOCKED(); - event.info = info; if (state) { - fb_notifier_call_chain(FB_EVENT_SUSPEND, &event); + fbcon_suspended(info); info->state = FBINFO_STATE_SUSPENDED; } else { info->state = FBINFO_STATE_RUNNING; - fb_notifier_call_chain(FB_EVENT_RESUME, &event); + fbcon_resumed(info); } } EXPORT_SYMBOL(fb_set_suspend); diff --git a/include/linux/fb.h b/include/linux/fb.h index 44021e55b15c..a78bbd372cfd 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -126,14 +126,6 @@ struct fb_cursor_user { /* The resolution of the passed in fb_info about to change */ #define FB_EVENT_MODE_CHANGE 0x01 -/* The display on this fb_info is being suspended, no access to the - * framebuffer is allowed any more after that call returns - */ -#define FB_EVENT_SUSPEND 0x02 -/* The display on this fb_info was resumed, you can restore the display - * if you own it - */ -#define FB_EVENT_RESUME 0x03 /* An entry from the modelist was removed */ #define FB_EVENT_MODE_DELETE 0x04 /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h index 38d44fdb6d14..61a22e6c0c64 100644 --- a/include/linux/fbcon.h +++ b/include/linux/fbcon.h @@ -7,12 +7,16 @@ 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); #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(void) {} +static inline void fbcon_resumed(void) {} #endif #endif /* _LINUX_FBCON_H */ -- 2.20.1
I'm not entirely clear on what new_modelist actually does, it seems exclusively for a sysfs interface. Which in the end does amount to a normal fb_set_par to check the mode, but then takes a different path in both fbmem.c and fbcon.c. I have no idea why these 2 paths are different, but then I also don't really want to find out. So just do the simple conversion to a direct function call. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: Kees Cook <keescook@chromium.org> Cc: Peter Rosin <peda@axentia.se> Cc: Yisheng Xie <ysxie@foxmail.com> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: linux-fbdev@vger.kernel.org --- drivers/video/fbdev/core/fbcon.c | 14 +++----------- drivers/video/fbdev/core/fbmem.c | 22 +++++++--------------- include/linux/fb.h | 5 ----- include/linux/fbcon.h | 6 ++++++ 4 files changed, 16 insertions(+), 31 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index b056d1190788..5635acb4b11c 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -3015,8 +3015,8 @@ static void fbcon_set_all_vcs(struct fb_info *info) fbcon_modechanged(info); } -static int fbcon_mode_deleted(struct fb_info *info, - struct fb_videomode *mode) +int fbcon_mode_deleted(struct fb_info *info, + struct fb_videomode *mode) { struct fb_info *fb_info; struct fbcon_display *p; @@ -3258,7 +3258,7 @@ static void fbcon_fb_blanked(struct fb_info *info, int blank) ops->blank_state = blank; } -static void fbcon_new_modelist(struct fb_info *info) +void fbcon_new_modelist(struct fb_info *info) { int i; struct vc_data *vc; @@ -3320,7 +3320,6 @@ static int fbcon_event_notify(struct notifier_block *self, { struct fb_event *event = data; struct fb_info *info = event->info; - struct fb_videomode *mode; struct fb_con2fbmap *con2fb; struct fb_blit_caps *caps; int idx, ret = 0; @@ -3332,10 +3331,6 @@ static int fbcon_event_notify(struct notifier_block *self, case FB_EVENT_MODE_CHANGE_ALL: fbcon_set_all_vcs(info); break; - case FB_EVENT_MODE_DELETE: - mode = event->data; - ret = fbcon_mode_deleted(info, mode); - break; case FB_EVENT_SET_CONSOLE_MAP: /* called with console lock held */ con2fb = event->data; @@ -3349,9 +3344,6 @@ static int fbcon_event_notify(struct notifier_block *self, case FB_EVENT_BLANK: fbcon_fb_blanked(info, *(int *)event->data); break; - case FB_EVENT_NEW_MODELIST: - fbcon_new_modelist(info); - break; case FB_EVENT_GET_REQ: caps = event->data; fbcon_get_requirement(info, caps); diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 7c55846ee5fc..96d280228746 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -966,16 +966,11 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) /* make sure we don't delete the videomode of current var */ ret = fb_mode_is_equal(&mode1, &mode2); - if (!ret) { - struct fb_event event; - - event.info = info; - event.data = &mode1; - ret = fb_notifier_call_chain(FB_EVENT_MODE_DELETE, &event); - } + if (!ret) + fbcon_mode_deleted(info, &mode1); if (!ret) - fb_delete_videomode(&mode1, &info->modelist); + fb_delete_videomode(&mode1, &info->modelist); ret = (ret) ? -EINVAL : 0; @@ -1956,7 +1951,6 @@ subsys_initcall(fbmem_init); int fb_new_modelist(struct fb_info *info) { - struct fb_event event; struct fb_var_screeninfo var = info->var; struct list_head *pos, *n; struct fb_modelist *modelist; @@ -1976,14 +1970,12 @@ int fb_new_modelist(struct fb_info *info) } } - err = 1; + if (list_empty(&info->modelist)) + return 1; - if (!list_empty(&info->modelist)) { - event.info = info; - err = fb_notifier_call_chain(FB_EVENT_NEW_MODELIST, &event); - } + fbcon_new_modelist(info); - return err; + return 0; } MODULE_LICENSE("GPL"); diff --git a/include/linux/fb.h b/include/linux/fb.h index a78bbd372cfd..e6595a381792 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -126,8 +126,6 @@ struct fb_cursor_user { /* The resolution of the passed in fb_info about to change */ #define FB_EVENT_MODE_CHANGE 0x01 -/* An entry from the modelist was removed */ -#define FB_EVENT_MODE_DELETE 0x04 /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ #define FB_EVENT_GET_CONSOLE_MAP 0x07 /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ @@ -135,9 +133,6 @@ struct fb_cursor_user { /* A hardware display blank change occurred */ #define FB_EVENT_BLANK 0x09 /* Private modelist is to be replaced */ -#define FB_EVENT_NEW_MODELIST 0x0A -/* The resolution of the passed in fb_info about to change and - all vc's should be changed */ #define FB_EVENT_MODE_CHANGE_ALL 0x0B /* A software display blank change occurred */ #define FB_EVENT_CONBLANK 0x0C diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h index 61a22e6c0c64..42b06848b459 100644 --- a/include/linux/fbcon.h +++ b/include/linux/fbcon.h @@ -9,6 +9,9 @@ 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_new_modelist(struct fb_info *info); #else static inline void fb_console_init(void) {} static inline void fb_console_exit(void) {} @@ -17,6 +20,9 @@ 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(void) {} static inline void fbcon_resumed(void) {} +int fbcon_mode_deleted(struct fb_info *info, + struct fb_videomode *mode) { return 0; } +void fbcon_new_modelist(struct fb_info *info) {} #endif #endif /* _LINUX_FBCON_H */ -- 2.20.1
I'm not entirely clear on what new_modelist actually does, it seems exclusively for a sysfs interface. Which in the end does amount to a normal fb_set_par to check the mode, but then takes a different path in both fbmem.c and fbcon.c. I have no idea why these 2 paths are different, but then I also don't really want to find out. So just do the simple conversion to a direct function call. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: Kees Cook <keescook@chromium.org> Cc: Peter Rosin <peda@axentia.se> Cc: Yisheng Xie <ysxie@foxmail.com> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: linux-fbdev@vger.kernel.org --- drivers/video/fbdev/core/fbcon.c | 14 +++----------- drivers/video/fbdev/core/fbmem.c | 22 +++++++--------------- include/linux/fb.h | 5 ----- include/linux/fbcon.h | 6 ++++++ 4 files changed, 16 insertions(+), 31 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index b056d1190788..5635acb4b11c 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -3015,8 +3015,8 @@ static void fbcon_set_all_vcs(struct fb_info *info) fbcon_modechanged(info); } -static int fbcon_mode_deleted(struct fb_info *info, - struct fb_videomode *mode) +int fbcon_mode_deleted(struct fb_info *info, + struct fb_videomode *mode) { struct fb_info *fb_info; struct fbcon_display *p; @@ -3258,7 +3258,7 @@ static void fbcon_fb_blanked(struct fb_info *info, int blank) ops->blank_state = blank; } -static void fbcon_new_modelist(struct fb_info *info) +void fbcon_new_modelist(struct fb_info *info) { int i; struct vc_data *vc; @@ -3320,7 +3320,6 @@ static int fbcon_event_notify(struct notifier_block *self, { struct fb_event *event = data; struct fb_info *info = event->info; - struct fb_videomode *mode; struct fb_con2fbmap *con2fb; struct fb_blit_caps *caps; int idx, ret = 0; @@ -3332,10 +3331,6 @@ static int fbcon_event_notify(struct notifier_block *self, case FB_EVENT_MODE_CHANGE_ALL: fbcon_set_all_vcs(info); break; - case FB_EVENT_MODE_DELETE: - mode = event->data; - ret = fbcon_mode_deleted(info, mode); - break; case FB_EVENT_SET_CONSOLE_MAP: /* called with console lock held */ con2fb = event->data; @@ -3349,9 +3344,6 @@ static int fbcon_event_notify(struct notifier_block *self, case FB_EVENT_BLANK: fbcon_fb_blanked(info, *(int *)event->data); break; - case FB_EVENT_NEW_MODELIST: - fbcon_new_modelist(info); - break; case FB_EVENT_GET_REQ: caps = event->data; fbcon_get_requirement(info, caps); diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 7c55846ee5fc..96d280228746 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -966,16 +966,11 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) /* make sure we don't delete the videomode of current var */ ret = fb_mode_is_equal(&mode1, &mode2); - if (!ret) { - struct fb_event event; - - event.info = info; - event.data = &mode1; - ret = fb_notifier_call_chain(FB_EVENT_MODE_DELETE, &event); - } + if (!ret) + fbcon_mode_deleted(info, &mode1); if (!ret) - fb_delete_videomode(&mode1, &info->modelist); + fb_delete_videomode(&mode1, &info->modelist); ret = (ret) ? -EINVAL : 0; @@ -1956,7 +1951,6 @@ subsys_initcall(fbmem_init); int fb_new_modelist(struct fb_info *info) { - struct fb_event event; struct fb_var_screeninfo var = info->var; struct list_head *pos, *n; struct fb_modelist *modelist; @@ -1976,14 +1970,12 @@ int fb_new_modelist(struct fb_info *info) } } - err = 1; + if (list_empty(&info->modelist)) + return 1; - if (!list_empty(&info->modelist)) { - event.info = info; - err = fb_notifier_call_chain(FB_EVENT_NEW_MODELIST, &event); - } + fbcon_new_modelist(info); - return err; + return 0; } MODULE_LICENSE("GPL"); diff --git a/include/linux/fb.h b/include/linux/fb.h index a78bbd372cfd..e6595a381792 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -126,8 +126,6 @@ struct fb_cursor_user { /* The resolution of the passed in fb_info about to change */ #define FB_EVENT_MODE_CHANGE 0x01 -/* An entry from the modelist was removed */ -#define FB_EVENT_MODE_DELETE 0x04 /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ #define FB_EVENT_GET_CONSOLE_MAP 0x07 /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ @@ -135,9 +133,6 @@ struct fb_cursor_user { /* A hardware display blank change occurred */ #define FB_EVENT_BLANK 0x09 /* Private modelist is to be replaced */ -#define FB_EVENT_NEW_MODELIST 0x0A -/* The resolution of the passed in fb_info about to change and - all vc's should be changed */ #define FB_EVENT_MODE_CHANGE_ALL 0x0B /* A software display blank change occurred */ #define FB_EVENT_CONBLANK 0x0C diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h index 61a22e6c0c64..42b06848b459 100644 --- a/include/linux/fbcon.h +++ b/include/linux/fbcon.h @@ -9,6 +9,9 @@ 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_new_modelist(struct fb_info *info); #else static inline void fb_console_init(void) {} static inline void fb_console_exit(void) {} @@ -17,6 +20,9 @@ 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(void) {} static inline void fbcon_resumed(void) {} +int fbcon_mode_deleted(struct fb_info *info, + struct fb_videomode *mode) { return 0; } +void fbcon_new_modelist(struct fb_info *info) {} #endif #endif /* _LINUX_FBCON_H */ -- 2.20.1
Pretty simple case really. v2: Forgot to remove a break; Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Hans de Goede <hdegoede@redhat.com> Cc: "Steven Rostedt (VMware)" <rostedt@goodmis.org> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Kees Cook <keescook@chromium.org> Cc: Yisheng Xie <ysxie@foxmail.com> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Peter Rosin <peda@axentia.se> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: linux-fbdev@vger.kernel.org --- drivers/video/fbdev/core/fbcon.c | 9 ++------- drivers/video/fbdev/core/fbmem.c | 5 +---- include/linux/fb.h | 2 -- include/linux/fbcon.h | 4 ++++ 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 5635acb4b11c..58b876718d81 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -3279,8 +3279,8 @@ void fbcon_new_modelist(struct fb_info *info) } } -static void fbcon_get_requirement(struct fb_info *info, - struct fb_blit_caps *caps) +void fbcon_get_requirement(struct fb_info *info, + struct fb_blit_caps *caps) { struct vc_data *vc; struct fbcon_display *p; @@ -3321,7 +3321,6 @@ static int fbcon_event_notify(struct notifier_block *self, struct fb_event *event = data; struct fb_info *info = event->info; struct fb_con2fbmap *con2fb; - struct fb_blit_caps *caps; int idx, ret = 0; switch(action) { @@ -3344,10 +3343,6 @@ static int fbcon_event_notify(struct notifier_block *self, case FB_EVENT_BLANK: fbcon_fb_blanked(info, *(int *)event->data); break; - case FB_EVENT_GET_REQ: - caps = event->data; - fbcon_get_requirement(info, caps); - break; case FB_EVENT_REMAP_ALL_CONSOLE: idx = info->node; fbcon_remap_all(idx); diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 96d280228746..d428d08c358a 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -932,16 +932,13 @@ EXPORT_SYMBOL(fb_pan_display); static int fb_check_caps(struct fb_info *info, struct fb_var_screeninfo *var, u32 activate) { - struct fb_event event; struct fb_blit_caps caps, fbcaps; int err = 0; memset(&caps, 0, sizeof(caps)); memset(&fbcaps, 0, sizeof(fbcaps)); caps.flags = (activate & FB_ACTIVATE_ALL) ? 1 : 0; - event.info = info; - event.data = ∩︀ - fb_notifier_call_chain(FB_EVENT_GET_REQ, &event); + fbcon_get_requirement(info, &caps); info->fbops->fb_get_caps(info, &fbcaps, var); if (((fbcaps.x ^ caps.x) & caps.x) || diff --git a/include/linux/fb.h b/include/linux/fb.h index e6595a381792..e76185244593 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -136,8 +136,6 @@ struct fb_cursor_user { #define FB_EVENT_MODE_CHANGE_ALL 0x0B /* A software display blank change occurred */ #define FB_EVENT_CONBLANK 0x0C -/* Get drawing requirements */ -#define FB_EVENT_GET_REQ 0x0D /* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga_switcheroo */ #define FB_EVENT_REMAP_ALL_CONSOLE 0x0F /* A hardware display blank early change occurred */ diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h index 42b06848b459..7f0a530a913c 100644 --- a/include/linux/fbcon.h +++ b/include/linux/fbcon.h @@ -12,6 +12,8 @@ void fbcon_resumed(struct fb_info *info); int fbcon_mode_deleted(struct fb_info *info, struct fb_videomode *mode); void fbcon_new_modelist(struct fb_info *info); +void fbcon_get_requirement(struct fb_info *info, + struct fb_blit_caps *caps); #else static inline void fb_console_init(void) {} static inline void fb_console_exit(void) {} @@ -23,6 +25,8 @@ static inline void fbcon_resumed(void) {} int fbcon_mode_deleted(struct fb_info *info, struct fb_videomode *mode) { return 0; } void fbcon_new_modelist(struct fb_info *info) {} +void fbcon_get_requirement(struct fb_info *info, + struct fb_blit_caps *caps) {} #endif #endif /* _LINUX_FBCON_H */ -- 2.20.1
Pretty simple case really. v2: Forgot to remove a break; Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Hans de Goede <hdegoede@redhat.com> Cc: "Steven Rostedt (VMware)" <rostedt@goodmis.org> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Kees Cook <keescook@chromium.org> Cc: Yisheng Xie <ysxie@foxmail.com> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Peter Rosin <peda@axentia.se> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: linux-fbdev@vger.kernel.org --- drivers/video/fbdev/core/fbcon.c | 9 ++------- drivers/video/fbdev/core/fbmem.c | 5 +---- include/linux/fb.h | 2 -- include/linux/fbcon.h | 4 ++++ 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 5635acb4b11c..58b876718d81 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -3279,8 +3279,8 @@ void fbcon_new_modelist(struct fb_info *info) } } -static void fbcon_get_requirement(struct fb_info *info, - struct fb_blit_caps *caps) +void fbcon_get_requirement(struct fb_info *info, + struct fb_blit_caps *caps) { struct vc_data *vc; struct fbcon_display *p; @@ -3321,7 +3321,6 @@ static int fbcon_event_notify(struct notifier_block *self, struct fb_event *event = data; struct fb_info *info = event->info; struct fb_con2fbmap *con2fb; - struct fb_blit_caps *caps; int idx, ret = 0; switch(action) { @@ -3344,10 +3343,6 @@ static int fbcon_event_notify(struct notifier_block *self, case FB_EVENT_BLANK: fbcon_fb_blanked(info, *(int *)event->data); break; - case FB_EVENT_GET_REQ: - caps = event->data; - fbcon_get_requirement(info, caps); - break; case FB_EVENT_REMAP_ALL_CONSOLE: idx = info->node; fbcon_remap_all(idx); diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 96d280228746..d428d08c358a 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -932,16 +932,13 @@ EXPORT_SYMBOL(fb_pan_display); static int fb_check_caps(struct fb_info *info, struct fb_var_screeninfo *var, u32 activate) { - struct fb_event event; struct fb_blit_caps caps, fbcaps; int err = 0; memset(&caps, 0, sizeof(caps)); memset(&fbcaps, 0, sizeof(fbcaps)); caps.flags = (activate & FB_ACTIVATE_ALL) ? 1 : 0; - event.info = info; - event.data = ∩︀ - fb_notifier_call_chain(FB_EVENT_GET_REQ, &event); + fbcon_get_requirement(info, &caps); info->fbops->fb_get_caps(info, &fbcaps, var); if (((fbcaps.x ^ caps.x) & caps.x) || diff --git a/include/linux/fb.h b/include/linux/fb.h index e6595a381792..e76185244593 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -136,8 +136,6 @@ struct fb_cursor_user { #define FB_EVENT_MODE_CHANGE_ALL 0x0B /* A software display blank change occurred */ #define FB_EVENT_CONBLANK 0x0C -/* Get drawing requirements */ -#define FB_EVENT_GET_REQ 0x0D /* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga_switcheroo */ #define FB_EVENT_REMAP_ALL_CONSOLE 0x0F /* A hardware display blank early change occurred */ diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h index 42b06848b459..7f0a530a913c 100644 --- a/include/linux/fbcon.h +++ b/include/linux/fbcon.h @@ -12,6 +12,8 @@ void fbcon_resumed(struct fb_info *info); int fbcon_mode_deleted(struct fb_info *info, struct fb_videomode *mode); void fbcon_new_modelist(struct fb_info *info); +void fbcon_get_requirement(struct fb_info *info, + struct fb_blit_caps *caps); #else static inline void fb_console_init(void) {} static inline void fb_console_exit(void) {} @@ -23,6 +25,8 @@ static inline void fbcon_resumed(void) {} int fbcon_mode_deleted(struct fb_info *info, struct fb_videomode *mode) { return 0; } void fbcon_new_modelist(struct fb_info *info) {} +void fbcon_get_requirement(struct fb_info *info, + struct fb_blit_caps *caps) {} #endif #endif /* _LINUX_FBCON_H */ -- 2.20.1
This reverts commit 994efacdf9a087b52f71e620b58dfa526b0cf928. The justification is that if hw blanking fails (i.e. fbops->fb_blank) fails, then we still want to shut down the backlight. Which is exactly _not_ what fb_blank() does and so rather inconsistent if we end up with different behaviour between fbcon and direct fbdev usage. Given that the entire notifier maze is getting in the way anyway I figured it's simplest to revert this not well justified commit. Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Lee Jones <lee.jones@linaro.org> Cc: Daniel Thompson <daniel.thompson@linaro.org> Cc: Jingoo Han <jingoohan1@gmail.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Yisheng Xie <ysxie@foxmail.com> Cc: linux-fbdev@vger.kernel.org --- drivers/video/backlight/backlight.c | 2 +- drivers/video/fbdev/core/fbcon.c | 9 --------- include/linux/fb.h | 4 +--- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index deb824bef6e2..c55590ec0057 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -46,7 +46,7 @@ static int fb_notifier_callback(struct notifier_block *self, int fb_blank = 0; /* If we aren't interested in this event, skip it immediately ... */ - if (event != FB_EVENT_BLANK && event != FB_EVENT_CONBLANK) + if (event != FB_EVENT_BLANK) return 0; bd = container_of(self, struct backlight_device, fb_notif); diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 58b876718d81..1549056a848e 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -2346,8 +2346,6 @@ static int fbcon_switch(struct vc_data *vc) static void fbcon_generic_blank(struct vc_data *vc, struct fb_info *info, int blank) { - struct fb_event event; - if (blank) { unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; @@ -2358,13 +2356,6 @@ static void fbcon_generic_blank(struct vc_data *vc, struct fb_info *info, fbcon_clear(vc, 0, 0, vc->vc_rows, vc->vc_cols); vc->vc_video_erase_char = oldc; } - - - lock_fb_info(info); - event.info = info; - event.data = ␣ - fb_notifier_call_chain(FB_EVENT_CONBLANK, &event); - unlock_fb_info(info); } static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch) diff --git a/include/linux/fb.h b/include/linux/fb.h index e76185244593..4b9b882f8f52 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -130,12 +130,10 @@ struct fb_cursor_user { #define FB_EVENT_GET_CONSOLE_MAP 0x07 /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ #define FB_EVENT_SET_CONSOLE_MAP 0x08 -/* A hardware display blank change occurred */ +/* A display blank is requested */ #define FB_EVENT_BLANK 0x09 /* Private modelist is to be replaced */ #define FB_EVENT_MODE_CHANGE_ALL 0x0B -/* A software display blank change occurred */ -#define FB_EVENT_CONBLANK 0x0C /* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga_switcheroo */ #define FB_EVENT_REMAP_ALL_CONSOLE 0x0F /* A hardware display blank early change occurred */ -- 2.20.1
This reverts commit 994efacdf9a087b52f71e620b58dfa526b0cf928. The justification is that if hw blanking fails (i.e. fbops->fb_blank) fails, then we still want to shut down the backlight. Which is exactly _not_ what fb_blank() does and so rather inconsistent if we end up with different behaviour between fbcon and direct fbdev usage. Given that the entire notifier maze is getting in the way anyway I figured it's simplest to revert this not well justified commit. Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Lee Jones <lee.jones@linaro.org> Cc: Daniel Thompson <daniel.thompson@linaro.org> Cc: Jingoo Han <jingoohan1@gmail.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Yisheng Xie <ysxie@foxmail.com> Cc: linux-fbdev@vger.kernel.org --- drivers/video/backlight/backlight.c | 2 +- drivers/video/fbdev/core/fbcon.c | 9 --------- include/linux/fb.h | 4 +--- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index deb824bef6e2..c55590ec0057 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -46,7 +46,7 @@ static int fb_notifier_callback(struct notifier_block *self, int fb_blank = 0; /* If we aren't interested in this event, skip it immediately ... */ - if (event != FB_EVENT_BLANK && event != FB_EVENT_CONBLANK) + if (event != FB_EVENT_BLANK) return 0; bd = container_of(self, struct backlight_device, fb_notif); diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 58b876718d81..1549056a848e 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -2346,8 +2346,6 @@ static int fbcon_switch(struct vc_data *vc) static void fbcon_generic_blank(struct vc_data *vc, struct fb_info *info, int blank) { - struct fb_event event; - if (blank) { unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; @@ -2358,13 +2356,6 @@ static void fbcon_generic_blank(struct vc_data *vc, struct fb_info *info, fbcon_clear(vc, 0, 0, vc->vc_rows, vc->vc_cols); vc->vc_video_erase_char = oldc; } - - - lock_fb_info(info); - event.info = info; - event.data = ␣ - fb_notifier_call_chain(FB_EVENT_CONBLANK, &event); - unlock_fb_info(info); } static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch) diff --git a/include/linux/fb.h b/include/linux/fb.h index e76185244593..4b9b882f8f52 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -130,12 +130,10 @@ struct fb_cursor_user { #define FB_EVENT_GET_CONSOLE_MAP 0x07 /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ #define FB_EVENT_SET_CONSOLE_MAP 0x08 -/* A hardware display blank change occurred */ +/* A display blank is requested */ #define FB_EVENT_BLANK 0x09 /* Private modelist is to be replaced */ #define FB_EVENT_MODE_CHANGE_ALL 0x0B -/* A software display blank change occurred */ -#define FB_EVENT_CONBLANK 0x0C /* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga_switcheroo */ #define FB_EVENT_REMAP_ALL_CONSOLE 0x0F /* A hardware display blank early change occurred */ -- 2.20.1
We cant remove FB_EVENT_BLANK because that's still used by the backlight and lcd code, but that's kinda fine: No recursion between fbdev core code and fbcon code possible for that case. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Yisheng Xie <ysxie@foxmail.com> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Peter Rosin <peda@axentia.se> Cc: Mikulas Patocka <mpatocka@redhat.com> --- drivers/video/fbdev/core/fbcon.c | 5 +---- drivers/video/fbdev/core/fbmem.c | 1 + include/linux/fbcon.h | 2 ++ 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 1549056a848e..f85d794a3bee 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -3227,7 +3227,7 @@ int fbcon_fb_registered(struct fb_info *info) return ret; } -static void fbcon_fb_blanked(struct fb_info *info, int blank) +void fbcon_fb_blanked(struct fb_info *info, int blank) { struct fbcon_ops *ops = info->fbcon_par; struct vc_data *vc; @@ -3331,9 +3331,6 @@ static int fbcon_event_notify(struct notifier_block *self, con2fb = event->data; con2fb->framebuffer = con2fb_map[con2fb->console - 1]; break; - case FB_EVENT_BLANK: - fbcon_fb_blanked(info, *(int *)event->data); - break; case FB_EVENT_REMAP_ALL_CONSOLE: idx = info->node; fbcon_remap_all(idx); diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index d428d08c358a..9932130bf728 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1068,6 +1068,7 @@ fb_blank(struct fb_info *info, int blank) event.data = ␣ early_ret = fb_notifier_call_chain(FB_EARLY_EVENT_BLANK, &event); + fbcon_fb_blanked(info, blank); if (info->fbops->fb_blank) ret = info->fbops->fb_blank(blank, info); diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h index 7f0a530a913c..90e196c835dd 100644 --- a/include/linux/fbcon.h +++ b/include/linux/fbcon.h @@ -14,6 +14,7 @@ int fbcon_mode_deleted(struct fb_info *info, 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); #else static inline void fb_console_init(void) {} static inline void fb_console_exit(void) {} @@ -27,6 +28,7 @@ int fbcon_mode_deleted(struct fb_info *info, 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) {} #endif #endif /* _LINUX_FBCON_H */ -- 2.20.1
There's a callchain of: fbcon_fb_blaned -> do_(un)blank_screen -> consw->con_blank -> fbcon_blank -> fb_blank Things don't go horribly wrong because the BKL console_lock safes the day, but that's about it. And the seeming recursion is broken in 2 ways: - Starting from the fbdev ioctl we set FBINFO_MISC_USEREVENT, which tells the fbcon_blank code to not call fb_blank. This was required to not deadlock when recursing on the fb_notifier_chain mutex. - Starting from the con_blank hook we're getting saved by the console_blanked checks in do_blank/unblank_screen. Or at least that's my theory. Anyway, recursion isn't awesome, so let's stop it. Breaking the recursion avoids the need to be in the FBINFO_MISC_USEREVENT critical section, so lets move it out of that too. The astute reader will notice that fb_blank seems to require lock_fb_info(), which the fbcon code seems to ignore. I have no idea how to fix that problem, so let's keep ignoring it. v2: I forgot the sysfs blanking code. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Peter Rosin <peda@axentia.se> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: Rob Clark <robdclark@gmail.com> --- drivers/video/fbdev/core/fbmem.c | 4 +++- drivers/video/fbdev/core/fbsysfs.c | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 9932130bf728..7f95c7e80155 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1068,7 +1068,6 @@ fb_blank(struct fb_info *info, int blank) event.data = ␣ early_ret = fb_notifier_call_chain(FB_EARLY_EVENT_BLANK, &event); - fbcon_fb_blanked(info, blank); if (info->fbops->fb_blank) ret = info->fbops->fb_blank(blank, info); @@ -1198,6 +1197,9 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, info->flags |= FBINFO_MISC_USEREVENT; ret = fb_blank(info, arg); info->flags &= ~FBINFO_MISC_USEREVENT; + + /* might again call into fb_blank */ + fbcon_fb_blanked(info, arg); unlock_fb_info(info); console_unlock(); break; diff --git a/drivers/video/fbdev/core/fbsysfs.c b/drivers/video/fbdev/core/fbsysfs.c index 5f329278e55f..252d4f52d2a5 100644 --- a/drivers/video/fbdev/core/fbsysfs.c +++ b/drivers/video/fbdev/core/fbsysfs.c @@ -18,6 +18,7 @@ #include <linux/kernel.h> #include <linux/slab.h> #include <linux/fb.h> +#include <linux/fbcon.h> #include <linux/console.h> #include <linux/module.h> @@ -305,12 +306,15 @@ static ssize_t store_blank(struct device *device, { struct fb_info *fb_info = dev_get_drvdata(device); char *last = NULL; - int err; + int err, arg; + arg = simple_strtoul(buf, &last, 0); console_lock(); fb_info->flags |= FBINFO_MISC_USEREVENT; - err = fb_blank(fb_info, simple_strtoul(buf, &last, 0)); + err = fb_blank(fb_info, arg); fb_info->flags &= ~FBINFO_MISC_USEREVENT; + /* might again call into fb_blank */ + fbcon_fb_blanked(fb_info, arg); console_unlock(); if (err < 0) return err; -- 2.20.1
With the recursion broken in the previous patch we can drop the FBINFO_MISC_USEREVENT flag around calls to fb_blank - recursion prevention was it's only job. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Yisheng Xie <ysxie@foxmail.com> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Peter Rosin <peda@axentia.se> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: Rob Clark <robdclark@gmail.com> --- drivers/video/fbdev/core/fbcon.c | 5 ++--- drivers/video/fbdev/core/fbmem.c | 3 --- drivers/video/fbdev/core/fbsysfs.c | 2 -- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index f85d794a3bee..c1a7476e980f 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -2382,9 +2382,8 @@ static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch) fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW); ops->cursor_flash = (!blank); - if (!(info->flags & FBINFO_MISC_USEREVENT)) - if (fb_blank(info, blank)) - fbcon_generic_blank(vc, info, blank); + if (fb_blank(info, blank)) + fbcon_generic_blank(vc, info, blank); } if (!blank) diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 7f95c7e80155..65a075ccac4a 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1194,10 +1194,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, case FBIOBLANK: console_lock(); lock_fb_info(info); - info->flags |= FBINFO_MISC_USEREVENT; ret = fb_blank(info, arg); - info->flags &= ~FBINFO_MISC_USEREVENT; - /* might again call into fb_blank */ fbcon_fb_blanked(info, arg); unlock_fb_info(info); diff --git a/drivers/video/fbdev/core/fbsysfs.c b/drivers/video/fbdev/core/fbsysfs.c index 252d4f52d2a5..882b471d619e 100644 --- a/drivers/video/fbdev/core/fbsysfs.c +++ b/drivers/video/fbdev/core/fbsysfs.c @@ -310,9 +310,7 @@ static ssize_t store_blank(struct device *device, arg = simple_strtoul(buf, &last, 0); console_lock(); - fb_info->flags |= FBINFO_MISC_USEREVENT; err = fb_blank(fb_info, arg); - fb_info->flags &= ~FBINFO_MISC_USEREVENT; /* might again call into fb_blank */ fbcon_fb_blanked(fb_info, arg); console_unlock(); -- 2.20.1
Instead of wiring almost everything down to the very last line using goto soup (but not consistently, where would the fun be otherwise) drop out early when checks fail. This allows us to flatten the huge indent levels to just 1. Aside: If a driver doesn't set ->fb_check_var, then FB_ACTIVATE_NOW does nothing. This bug exists ever since this code was extracted as a common helper in 2002, hence I decided against fixing it. Everyone just better have a fb_check_var to make sure things work correctly. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Peter Rosin <peda@axentia.se> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Mikulas Patocka <mpatocka@redhat.com> --- drivers/video/fbdev/core/fbmem.c | 126 +++++++++++++++---------------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 65a075ccac4a..cbd58ba8a59d 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -954,6 +954,9 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) { int flags = info->flags; int ret = 0; + u32 activate; + struct fb_var_screeninfo old_var; + struct fb_videomode mode; if (var->activate & FB_ACTIVATE_INV_MODE) { struct fb_videomode mode1, mode2; @@ -970,87 +973,84 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) fb_delete_videomode(&mode1, &info->modelist); - ret = (ret) ? -EINVAL : 0; - goto done; + return ret ? -EINVAL : 0; } - if ((var->activate & FB_ACTIVATE_FORCE) || - memcmp(&info->var, var, sizeof(struct fb_var_screeninfo))) { - u32 activate = var->activate; + if (!(var->activate & FB_ACTIVATE_FORCE) && + !memcmp(&info->var, var, sizeof(struct fb_var_screeninfo))) + return 0; - /* When using FOURCC mode, make sure the red, green, blue and - * transp fields are set to 0. - */ - if ((info->fix.capabilities & FB_CAP_FOURCC) && - var->grayscale > 1) { - if (var->red.offset || var->green.offset || - var->blue.offset || var->transp.offset || - var->red.length || var->green.length || - var->blue.length || var->transp.length || - var->red.msb_right || var->green.msb_right || - var->blue.msb_right || var->transp.msb_right) - return -EINVAL; - } + activate = var->activate; - if (!info->fbops->fb_check_var) { - *var = info->var; - goto done; - } + /* When using FOURCC mode, make sure the red, green, blue and + * transp fields are set to 0. + */ + if ((info->fix.capabilities & FB_CAP_FOURCC) && + var->grayscale > 1) { + if (var->red.offset || var->green.offset || + var->blue.offset || var->transp.offset || + var->red.length || var->green.length || + var->blue.length || var->transp.length || + var->red.msb_right || var->green.msb_right || + var->blue.msb_right || var->transp.msb_right) + return -EINVAL; + } + + if (!info->fbops->fb_check_var) { + *var = info->var; + return 0; + } - ret = info->fbops->fb_check_var(var, info); + ret = info->fbops->fb_check_var(var, info); - if (ret) - goto done; + if (ret) + return ret; - if ((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) { - struct fb_var_screeninfo old_var; - struct fb_videomode mode; + if ((var->activate & FB_ACTIVATE_MASK) != FB_ACTIVATE_NOW) + return 0; - if (info->fbops->fb_get_caps) { - ret = fb_check_caps(info, var, activate); + if (info->fbops->fb_get_caps) { + ret = fb_check_caps(info, var, activate); - if (ret) - goto done; - } + if (ret) + return ret; + } - old_var = info->var; - info->var = *var; + old_var = info->var; + info->var = *var; - if (info->fbops->fb_set_par) { - ret = info->fbops->fb_set_par(info); + if (info->fbops->fb_set_par) { + ret = info->fbops->fb_set_par(info); - if (ret) { - info->var = old_var; - printk(KERN_WARNING "detected " - "fb_set_par error, " - "error code: %d\n", ret); - goto done; - } - } + if (ret) { + info->var = old_var; + printk(KERN_WARNING "detected " + "fb_set_par error, " + "error code: %d\n", ret); + return ret; + } + } - fb_pan_display(info, &info->var); - fb_set_cmap(&info->cmap, info); - fb_var_to_videomode(&mode, &info->var); + fb_pan_display(info, &info->var); + fb_set_cmap(&info->cmap, info); + fb_var_to_videomode(&mode, &info->var); - if (info->modelist.prev && info->modelist.next && - !list_empty(&info->modelist)) - ret = fb_add_videomode(&mode, &info->modelist); + if (info->modelist.prev && info->modelist.next && + !list_empty(&info->modelist)) + ret = fb_add_videomode(&mode, &info->modelist); - if (!ret && (flags & FBINFO_MISC_USEREVENT)) { - struct fb_event event; - int evnt = (activate & FB_ACTIVATE_ALL) ? - FB_EVENT_MODE_CHANGE_ALL : - FB_EVENT_MODE_CHANGE; + if (!ret && (flags & FBINFO_MISC_USEREVENT)) { + struct fb_event event; + int evnt = (activate & FB_ACTIVATE_ALL) ? + FB_EVENT_MODE_CHANGE_ALL : + FB_EVENT_MODE_CHANGE; - info->flags &= ~FBINFO_MISC_USEREVENT; - event.info = info; - event.data = &mode; - fb_notifier_call_chain(evnt, &event); - } - } + info->flags &= ~FBINFO_MISC_USEREVENT; + event.info = info; + event.data = &mode; + fb_notifier_call_chain(evnt, &event); } - done: return ret; } EXPORT_SYMBOL(fb_set_var); -- 2.20.1
Create a new wrapper function for this, feels like there's some refactoring room here between the two modes. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Lee Jones <lee.jones@linaro.org> Cc: Daniel Thompson <daniel.thompson@linaro.org> Cc: Jingoo Han <jingoohan1@gmail.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Yisheng Xie <ysxie@foxmail.com> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Peter Rosin <peda@axentia.se> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: linux-fbdev@vger.kernel.org --- drivers/video/backlight/lcd.c | 2 -- drivers/video/fbdev/core/fbcon.c | 15 +++++++++------ drivers/video/fbdev/core/fbmem.c | 13 ++----------- drivers/video/fbdev/sh_mobile_lcdcfb.c | 11 +---------- include/linux/fb.h | 4 ---- include/linux/fbcon.h | 2 ++ 6 files changed, 14 insertions(+), 33 deletions(-) diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c index 4b40c6a4d441..16298041b141 100644 --- a/drivers/video/backlight/lcd.c +++ b/drivers/video/backlight/lcd.c @@ -32,8 +32,6 @@ static int fb_notifier_callback(struct notifier_block *self, /* If we aren't interested in this event, skip it immediately ... */ switch (event) { case FB_EVENT_BLANK: - case FB_EVENT_MODE_CHANGE: - case FB_EVENT_MODE_CHANGE_ALL: case FB_EARLY_EVENT_BLANK: case FB_R_EARLY_EVENT_BLANK: break; diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index c1a7476e980f..8cc62d340387 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -3005,6 +3005,15 @@ static void fbcon_set_all_vcs(struct fb_info *info) fbcon_modechanged(info); } + +void fbcon_update_vcs(struct fb_info *info, bool all) +{ + if (all) + fbcon_set_all_vcs(info); + else + fbcon_modechanged(info); +} + int fbcon_mode_deleted(struct fb_info *info, struct fb_videomode *mode) { @@ -3314,12 +3323,6 @@ static int fbcon_event_notify(struct notifier_block *self, int idx, ret = 0; switch(action) { - case FB_EVENT_MODE_CHANGE: - fbcon_modechanged(info); - break; - case FB_EVENT_MODE_CHANGE_ALL: - fbcon_set_all_vcs(info); - break; case FB_EVENT_SET_CONSOLE_MAP: /* called with console lock held */ con2fb = event->data; diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index cbd58ba8a59d..55b88163edc2 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1039,17 +1039,8 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) !list_empty(&info->modelist)) ret = fb_add_videomode(&mode, &info->modelist); - if (!ret && (flags & FBINFO_MISC_USEREVENT)) { - struct fb_event event; - int evnt = (activate & FB_ACTIVATE_ALL) ? - FB_EVENT_MODE_CHANGE_ALL : - FB_EVENT_MODE_CHANGE; - - info->flags &= ~FBINFO_MISC_USEREVENT; - event.info = info; - event.data = &mode; - fb_notifier_call_chain(evnt, &event); - } + if (!ret && (flags & FBINFO_MISC_USEREVENT)) + fbcon_update_vcs(info, activate & FB_ACTIVATE_ALL); return ret; } diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c index 0d7a044852d7..bb1a610d0363 100644 --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c @@ -1776,8 +1776,6 @@ static void sh_mobile_fb_reconfig(struct fb_info *info) struct sh_mobile_lcdc_chan *ch = info->par; struct fb_var_screeninfo var; struct fb_videomode mode; - struct fb_event event; - int evnt = FB_EVENT_MODE_CHANGE_ALL; if (ch->use_count > 1 || (ch->use_count == 1 && !info->fbcon_par)) /* More framebuffer users are active */ @@ -1799,14 +1797,7 @@ static void sh_mobile_fb_reconfig(struct fb_info *info) /* Couldn't reconfigure, hopefully, can continue as before */ return; - /* - * fb_set_var() calls the notifier change internally, only if - * FBINFO_MISC_USEREVENT flag is set. Since we do not want to fake a - * user event, we have to call the chain ourselves. - */ - event.info = info; - event.data = &ch->display.mode; - fb_notifier_call_chain(evnt, &event); + fbcon_update_vcs(info, true); } /* diff --git a/include/linux/fb.h b/include/linux/fb.h index 4b9b882f8f52..54d6bee09121 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -124,16 +124,12 @@ struct fb_cursor_user { * Register/unregister for framebuffer events */ -/* The resolution of the passed in fb_info about to change */ -#define FB_EVENT_MODE_CHANGE 0x01 /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ #define FB_EVENT_GET_CONSOLE_MAP 0x07 /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ #define FB_EVENT_SET_CONSOLE_MAP 0x08 /* A display blank is requested */ #define FB_EVENT_BLANK 0x09 -/* Private modelist is to be replaced */ -#define FB_EVENT_MODE_CHANGE_ALL 0x0B /* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga_switcheroo */ #define FB_EVENT_REMAP_ALL_CONSOLE 0x0F /* A hardware display blank early change occurred */ diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h index 90e196c835dd..daaa97b0c9e6 100644 --- a/include/linux/fbcon.h +++ b/include/linux/fbcon.h @@ -15,6 +15,7 @@ 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); +void fbcon_update_vcs(struct fb_info *info, bool all); #else static inline void fb_console_init(void) {} static inline void fb_console_exit(void) {} @@ -29,6 +30,7 @@ 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) {} +void fbcon_update_vcs(struct fb_info *info, bool all) {} #endif #endif /* _LINUX_FBCON_H */ -- 2.20.1
Create a new wrapper function for this, feels like there's some refactoring room here between the two modes. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Lee Jones <lee.jones@linaro.org> Cc: Daniel Thompson <daniel.thompson@linaro.org> Cc: Jingoo Han <jingoohan1@gmail.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Yisheng Xie <ysxie@foxmail.com> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Peter Rosin <peda@axentia.se> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: linux-fbdev@vger.kernel.org --- drivers/video/backlight/lcd.c | 2 -- drivers/video/fbdev/core/fbcon.c | 15 +++++++++------ drivers/video/fbdev/core/fbmem.c | 13 ++----------- drivers/video/fbdev/sh_mobile_lcdcfb.c | 11 +---------- include/linux/fb.h | 4 ---- include/linux/fbcon.h | 2 ++ 6 files changed, 14 insertions(+), 33 deletions(-) diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c index 4b40c6a4d441..16298041b141 100644 --- a/drivers/video/backlight/lcd.c +++ b/drivers/video/backlight/lcd.c @@ -32,8 +32,6 @@ static int fb_notifier_callback(struct notifier_block *self, /* If we aren't interested in this event, skip it immediately ... */ switch (event) { case FB_EVENT_BLANK: - case FB_EVENT_MODE_CHANGE: - case FB_EVENT_MODE_CHANGE_ALL: case FB_EARLY_EVENT_BLANK: case FB_R_EARLY_EVENT_BLANK: break; diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index c1a7476e980f..8cc62d340387 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -3005,6 +3005,15 @@ static void fbcon_set_all_vcs(struct fb_info *info) fbcon_modechanged(info); } + +void fbcon_update_vcs(struct fb_info *info, bool all) +{ + if (all) + fbcon_set_all_vcs(info); + else + fbcon_modechanged(info); +} + int fbcon_mode_deleted(struct fb_info *info, struct fb_videomode *mode) { @@ -3314,12 +3323,6 @@ static int fbcon_event_notify(struct notifier_block *self, int idx, ret = 0; switch(action) { - case FB_EVENT_MODE_CHANGE: - fbcon_modechanged(info); - break; - case FB_EVENT_MODE_CHANGE_ALL: - fbcon_set_all_vcs(info); - break; case FB_EVENT_SET_CONSOLE_MAP: /* called with console lock held */ con2fb = event->data; diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index cbd58ba8a59d..55b88163edc2 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1039,17 +1039,8 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) !list_empty(&info->modelist)) ret = fb_add_videomode(&mode, &info->modelist); - if (!ret && (flags & FBINFO_MISC_USEREVENT)) { - struct fb_event event; - int evnt = (activate & FB_ACTIVATE_ALL) ? - FB_EVENT_MODE_CHANGE_ALL : - FB_EVENT_MODE_CHANGE; - - info->flags &= ~FBINFO_MISC_USEREVENT; - event.info = info; - event.data = &mode; - fb_notifier_call_chain(evnt, &event); - } + if (!ret && (flags & FBINFO_MISC_USEREVENT)) + fbcon_update_vcs(info, activate & FB_ACTIVATE_ALL); return ret; } diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c index 0d7a044852d7..bb1a610d0363 100644 --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c @@ -1776,8 +1776,6 @@ static void sh_mobile_fb_reconfig(struct fb_info *info) struct sh_mobile_lcdc_chan *ch = info->par; struct fb_var_screeninfo var; struct fb_videomode mode; - struct fb_event event; - int evnt = FB_EVENT_MODE_CHANGE_ALL; if (ch->use_count > 1 || (ch->use_count = 1 && !info->fbcon_par)) /* More framebuffer users are active */ @@ -1799,14 +1797,7 @@ static void sh_mobile_fb_reconfig(struct fb_info *info) /* Couldn't reconfigure, hopefully, can continue as before */ return; - /* - * fb_set_var() calls the notifier change internally, only if - * FBINFO_MISC_USEREVENT flag is set. Since we do not want to fake a - * user event, we have to call the chain ourselves. - */ - event.info = info; - event.data = &ch->display.mode; - fb_notifier_call_chain(evnt, &event); + fbcon_update_vcs(info, true); } /* diff --git a/include/linux/fb.h b/include/linux/fb.h index 4b9b882f8f52..54d6bee09121 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -124,16 +124,12 @@ struct fb_cursor_user { * Register/unregister for framebuffer events */ -/* The resolution of the passed in fb_info about to change */ -#define FB_EVENT_MODE_CHANGE 0x01 /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ #define FB_EVENT_GET_CONSOLE_MAP 0x07 /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ #define FB_EVENT_SET_CONSOLE_MAP 0x08 /* A display blank is requested */ #define FB_EVENT_BLANK 0x09 -/* Private modelist is to be replaced */ -#define FB_EVENT_MODE_CHANGE_ALL 0x0B /* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga_switcheroo */ #define FB_EVENT_REMAP_ALL_CONSOLE 0x0F /* A hardware display blank early change occurred */ diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h index 90e196c835dd..daaa97b0c9e6 100644 --- a/include/linux/fbcon.h +++ b/include/linux/fbcon.h @@ -15,6 +15,7 @@ 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); +void fbcon_update_vcs(struct fb_info *info, bool all); #else static inline void fb_console_init(void) {} static inline void fb_console_exit(void) {} @@ -29,6 +30,7 @@ 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) {} +void fbcon_update_vcs(struct fb_info *info, bool all) {} #endif #endif /* _LINUX_FBCON_H */ -- 2.20.1
While at it, clean up the interface a bit and push the console locking into fbcon.c. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Lukas Wunner <lukas@wunner.de> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <maxime.ripard@bootlin.com> Cc: Sean Paul <sean@poorly.run> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Yisheng Xie <ysxie@foxmail.com> Cc: linux-fbdev@vger.kernel.org --- drivers/gpu/vga/vga_switcheroo.c | 11 +++-------- drivers/video/fbdev/core/fbcon.c | 13 +++++-------- include/linux/fb.h | 2 -- include/linux/fbcon.h | 2 ++ 4 files changed, 10 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c index a132c37d7334..65d7541c413a 100644 --- a/drivers/gpu/vga/vga_switcheroo.c +++ b/drivers/gpu/vga/vga_switcheroo.c @@ -35,6 +35,7 @@ #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> @@ -736,14 +737,8 @@ 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 (new_client->fb_info) { - struct fb_event event; - - console_lock(); - event.info = new_client->fb_info; - fb_notifier_call_chain(FB_EVENT_REMAP_ALL_CONSOLE, &event); - console_unlock(); - } + if (new_client->fb_info) + fbcon_remap_all(new_client->fb_info); mutex_lock(&vgasr_priv.mux_hw_lock); ret = vgasr_priv.handler->switchto(new_client->id); diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 8cc62d340387..fd604ffb3c05 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -3146,16 +3146,16 @@ void fbcon_fb_unregistered(struct fb_info *info) } /* called with console_lock held */ -static void fbcon_remap_all(int idx) +void fbcon_remap_all(struct fb_info *info) { - int i; - - WARN_CONSOLE_UNLOCKED(); + int i, idx = info->node; + console_lock(); if (deferred_takeover) { for (i = first_fb_vc; i <= last_fb_vc; i++) con2fb_map_boot[i] = idx; fbcon_map_override(); + console_unlock(); return; } @@ -3168,6 +3168,7 @@ static void fbcon_remap_all(int idx) first_fb_vc + 1, last_fb_vc + 1); info_idx = idx; } + console_unlock(); } #ifdef CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY @@ -3333,10 +3334,6 @@ static int fbcon_event_notify(struct notifier_block *self, con2fb = event->data; con2fb->framebuffer = con2fb_map[con2fb->console - 1]; break; - case FB_EVENT_REMAP_ALL_CONSOLE: - idx = info->node; - fbcon_remap_all(idx); - break; } return ret; } diff --git a/include/linux/fb.h b/include/linux/fb.h index 54d6bee09121..acd8daa23002 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -130,8 +130,6 @@ struct fb_cursor_user { #define FB_EVENT_SET_CONSOLE_MAP 0x08 /* A display blank is requested */ #define FB_EVENT_BLANK 0x09 -/* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga_switcheroo */ -#define FB_EVENT_REMAP_ALL_CONSOLE 0x0F /* A hardware display blank early change occurred */ #define FB_EARLY_EVENT_BLANK 0x10 /* A hardware display blank revert early change occurred */ diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h index daaa97b0c9e6..3f854e803746 100644 --- a/include/linux/fbcon.h +++ b/include/linux/fbcon.h @@ -16,6 +16,7 @@ void fbcon_get_requirement(struct fb_info *info, struct fb_blit_caps *caps); void fbcon_fb_blanked(struct fb_info *info, int blank); void fbcon_update_vcs(struct fb_info *info, bool all); +void fbcon_remap_all(struct fb_info *info); #else static inline void fb_console_init(void) {} static inline void fb_console_exit(void) {} @@ -31,6 +32,7 @@ void fbcon_get_requirement(struct fb_info *info, struct fb_blit_caps *caps) {} void fbcon_fb_blanked(struct fb_info *info, int blank) {} void fbcon_update_vcs(struct fb_info *info, bool all) {} +void fbcon_remap_all(struct fb_info *info) {} #endif #endif /* _LINUX_FBCON_H */ -- 2.20.1
While at it, clean up the interface a bit and push the console locking into fbcon.c. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Lukas Wunner <lukas@wunner.de> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <maxime.ripard@bootlin.com> Cc: Sean Paul <sean@poorly.run> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Yisheng Xie <ysxie@foxmail.com> Cc: linux-fbdev@vger.kernel.org --- drivers/gpu/vga/vga_switcheroo.c | 11 +++-------- drivers/video/fbdev/core/fbcon.c | 13 +++++-------- include/linux/fb.h | 2 -- include/linux/fbcon.h | 2 ++ 4 files changed, 10 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c index a132c37d7334..65d7541c413a 100644 --- a/drivers/gpu/vga/vga_switcheroo.c +++ b/drivers/gpu/vga/vga_switcheroo.c @@ -35,6 +35,7 @@ #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> @@ -736,14 +737,8 @@ 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 (new_client->fb_info) { - struct fb_event event; - - console_lock(); - event.info = new_client->fb_info; - fb_notifier_call_chain(FB_EVENT_REMAP_ALL_CONSOLE, &event); - console_unlock(); - } + if (new_client->fb_info) + fbcon_remap_all(new_client->fb_info); mutex_lock(&vgasr_priv.mux_hw_lock); ret = vgasr_priv.handler->switchto(new_client->id); diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 8cc62d340387..fd604ffb3c05 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -3146,16 +3146,16 @@ void fbcon_fb_unregistered(struct fb_info *info) } /* called with console_lock held */ -static void fbcon_remap_all(int idx) +void fbcon_remap_all(struct fb_info *info) { - int i; - - WARN_CONSOLE_UNLOCKED(); + int i, idx = info->node; + console_lock(); if (deferred_takeover) { for (i = first_fb_vc; i <= last_fb_vc; i++) con2fb_map_boot[i] = idx; fbcon_map_override(); + console_unlock(); return; } @@ -3168,6 +3168,7 @@ static void fbcon_remap_all(int idx) first_fb_vc + 1, last_fb_vc + 1); info_idx = idx; } + console_unlock(); } #ifdef CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY @@ -3333,10 +3334,6 @@ static int fbcon_event_notify(struct notifier_block *self, con2fb = event->data; con2fb->framebuffer = con2fb_map[con2fb->console - 1]; break; - case FB_EVENT_REMAP_ALL_CONSOLE: - idx = info->node; - fbcon_remap_all(idx); - break; } return ret; } diff --git a/include/linux/fb.h b/include/linux/fb.h index 54d6bee09121..acd8daa23002 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -130,8 +130,6 @@ struct fb_cursor_user { #define FB_EVENT_SET_CONSOLE_MAP 0x08 /* A display blank is requested */ #define FB_EVENT_BLANK 0x09 -/* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga_switcheroo */ -#define FB_EVENT_REMAP_ALL_CONSOLE 0x0F /* A hardware display blank early change occurred */ #define FB_EARLY_EVENT_BLANK 0x10 /* A hardware display blank revert early change occurred */ diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h index daaa97b0c9e6..3f854e803746 100644 --- a/include/linux/fbcon.h +++ b/include/linux/fbcon.h @@ -16,6 +16,7 @@ void fbcon_get_requirement(struct fb_info *info, struct fb_blit_caps *caps); void fbcon_fb_blanked(struct fb_info *info, int blank); void fbcon_update_vcs(struct fb_info *info, bool all); +void fbcon_remap_all(struct fb_info *info); #else static inline void fb_console_init(void) {} static inline void fb_console_exit(void) {} @@ -31,6 +32,7 @@ void fbcon_get_requirement(struct fb_info *info, struct fb_blit_caps *caps) {} void fbcon_fb_blanked(struct fb_info *info, int blank) {} void fbcon_update_vcs(struct fb_info *info, bool all) {} +void fbcon_remap_all(struct fb_info *info) {} #endif #endif /* _LINUX_FBCON_H */ -- 2.20.1
These are actually fbcon ioctls which just happen to be exposed through /dev/fb*. They completely ignore which fb_info they're called on, and I think the userspace tool even hardcodes to /dev/fb0. Hence just forward the entire thing to fbcon.c wholesale. Note that this patch drops the fb_lock/unlock on the set side. Since the ioctl can operate on any fb (as passed in through con2fb.framebuffer) this is bogus. Also note that fbcon.c in general never calls fb_lock on anything, so this has been badly broken already. With this the last user of the fbcon notifier callback is gone, and we can garbage collect that too. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Yisheng Xie <ysxie@foxmail.com> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Peter Rosin <peda@axentia.se> Cc: Mikulas Patocka <mpatocka@redhat.com> --- drivers/video/fbdev/core/fbcon.c | 62 +++++++++++++++++++------------- drivers/video/fbdev/core/fbmem.c | 34 ++---------------- include/linux/fbcon.h | 4 +++ 3 files changed, 43 insertions(+), 57 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index fd604ffb3c05..b40b56702c61 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -3315,29 +3315,47 @@ void fbcon_get_requirement(struct fb_info *info, } } -static int fbcon_event_notify(struct notifier_block *self, - unsigned long action, void *data) -{ - struct fb_event *event = data; - struct fb_info *info = event->info; - struct fb_con2fbmap *con2fb; - int idx, ret = 0; - - switch(action) { - case FB_EVENT_SET_CONSOLE_MAP: - /* called with console lock held */ - con2fb = event->data; - ret = set_con2fb_map(con2fb->console - 1, - con2fb->framebuffer, 1); - break; - case FB_EVENT_GET_CONSOLE_MAP: - con2fb = event->data; - con2fb->framebuffer = con2fb_map[con2fb->console - 1]; - break; +int fbcon_set_con2fb_map_ioctl(void __user *argp) +{ + struct fb_con2fbmap con2fb; + int ret; + + if (copy_from_user(&con2fb, argp, sizeof(con2fb))) + return -EFAULT; + if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES) + return -EINVAL; + if (con2fb.framebuffer >= FB_MAX) + return -EINVAL; + if (!registered_fb[con2fb.framebuffer]) + request_module("fb%d", con2fb.framebuffer); + if (!registered_fb[con2fb.framebuffer]) { + return -EINVAL; } + + console_lock(); + ret = set_con2fb_map(con2fb.console - 1, + con2fb.framebuffer, 1); + console_unlock(); + return ret; } +int fbcon_get_con2fb_map_ioctl(void __user *argp) +{ + struct fb_con2fbmap con2fb; + + if (copy_from_user(&con2fb, argp, sizeof(con2fb))) + return -EFAULT; + if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES) + return -EINVAL; + + console_lock(); + con2fb.framebuffer = con2fb_map[con2fb.console - 1]; + console_unlock(); + + return copy_to_user(argp, &con2fb, sizeof(con2fb)) ? -EFAULT : 0; +} + /* * The console `switch' structure for the frame buffer based console */ @@ -3369,10 +3387,6 @@ static const struct consw fb_con = { .con_debug_leave = fbcon_debug_leave, }; -static struct notifier_block fbcon_event_notifier = { - .notifier_call = fbcon_event_notify, -}; - static ssize_t store_rotate(struct device *device, struct device_attribute *attr, const char *buf, size_t count) @@ -3645,7 +3659,6 @@ void __init fb_console_init(void) int i; console_lock(); - fb_register_client(&fbcon_event_notifier); fbcon_device = device_create(fb_class, NULL, MKDEV(0, 0), NULL, "fbcon"); @@ -3681,7 +3694,6 @@ static void __exit fbcon_deinit_device(void) void __exit fb_console_exit(void) { console_lock(); - fb_unregister_client(&fbcon_event_notifier); fbcon_deinit_device(); device_destroy(fb_class, MKDEV(0, 0)); fbcon_exit(); diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 55b88163edc2..c5cf02e68e25 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1084,10 +1084,8 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, struct fb_ops *fb; struct fb_var_screeninfo var; struct fb_fix_screeninfo fix; - struct fb_con2fbmap con2fb; struct fb_cmap cmap_from; struct fb_cmap_user cmap; - struct fb_event event; void __user *argp = (void __user *)arg; long ret = 0; @@ -1149,38 +1147,10 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, ret = -EINVAL; break; case FBIOGET_CON2FBMAP: - if (copy_from_user(&con2fb, argp, sizeof(con2fb))) - return -EFAULT; - if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES) - return -EINVAL; - con2fb.framebuffer = -1; - event.data = &con2fb; - lock_fb_info(info); - event.info = info; - fb_notifier_call_chain(FB_EVENT_GET_CONSOLE_MAP, &event); - unlock_fb_info(info); - ret = copy_to_user(argp, &con2fb, sizeof(con2fb)) ? -EFAULT : 0; + ret = fbcon_get_con2fb_map_ioctl(argp); break; case FBIOPUT_CON2FBMAP: - if (copy_from_user(&con2fb, argp, sizeof(con2fb))) - return -EFAULT; - if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES) - return -EINVAL; - if (con2fb.framebuffer >= FB_MAX) - return -EINVAL; - if (!registered_fb[con2fb.framebuffer]) - request_module("fb%d", con2fb.framebuffer); - if (!registered_fb[con2fb.framebuffer]) { - ret = -EINVAL; - break; - } - event.data = &con2fb; - console_lock(); - lock_fb_info(info); - event.info = info; - ret = fb_notifier_call_chain(FB_EVENT_SET_CONSOLE_MAP, &event); - unlock_fb_info(info); - console_unlock(); + ret = fbcon_set_con2fb_map_ioctl(argp); break; case FBIOBLANK: console_lock(); diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h index 3f854e803746..8dfd1aa40483 100644 --- a/include/linux/fbcon.h +++ b/include/linux/fbcon.h @@ -17,6 +17,8 @@ void fbcon_get_requirement(struct fb_info *info, void fbcon_fb_blanked(struct fb_info *info, int blank); 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) {} @@ -33,6 +35,8 @@ void fbcon_get_requirement(struct fb_info *info, void fbcon_fb_blanked(struct fb_info *info, int blank) {} 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) { return 0; } +int fbcon_get_con2fb_map_ioctl(void __user *argp) { return 0; } #endif #endif /* _LINUX_FBCON_H */ -- 2.20.1
It's not pretty. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Yisheng Xie <ysxie@foxmail.com> --- drivers/video/fbdev/core/fbcon.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index b40b56702c61..cbbcf7a795f2 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -87,6 +87,25 @@ # define DPRINTK(fmt, args...) #endif +/* + * FIXME: Locking + * + * - fbcon state itself is protected by the console_lock, and the code does a + * pretty good job at making sure that lock is held everywhere it's needed. + * + * - access to the registered_fb array is entirely unprotected. This should use + * proper object lifetime handling, i.e. get/put_fb_info. This also means + * switching from indices to proper pointers for fb_info everywhere. + * + * - fbcon doesn't bother with fb_lock/unlock at all. This is buggy, since it + * means concurrent access to the same fbdev from both fbcon and userspace + * will blow up. To fix this all fbcon calls from fbmem.c need to be moved out + * of fb_lock/unlock protected sections, since otherwise we'll recurse and + * deadlock eventually. Aside: Due to these deadlock issues the fbdev code in + * fbmem.c cannot use locking asserts, and there's lots of callers which get + * the rules wrong, e.g. fbsysfs.c entirely missed fb_lock/unlock calls too. + */ + enum { FBCON_LOGO_CANSHOW = -1, /* the logo can be shown */ FBCON_LOGO_DRAW = -2, /* draw the logo to a console */ -- 2.20.1
this driver is pretty horrible from a design pov, and needs a complete overhaul. Concrete thing that annoys me is that it looks at registered_fb, which is an internal thing to fbmem.c and fbcon.c. And ofc it gets the lifetime rules all wrong (it should at least use get/put_fb_info). Looking at the history, there's been an attempt at dropping this from staging in 2016, but that had to be reverted. Since then not real effort except the usual stream of trivial patches, and fbdev has been formally closed for any new hw support. Time to try again and drop this? Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Jens Frederich <jfrederich@gmail.com> Cc: Daniel Drake <dsd@laptop.org> Cc: Jon Nettleton <jon.nettleton@gmail.com> --- drivers/staging/olpc_dcon/TODO | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/staging/olpc_dcon/TODO b/drivers/staging/olpc_dcon/TODO index 665a0b061719..fe09efbc7f77 100644 --- a/drivers/staging/olpc_dcon/TODO +++ b/drivers/staging/olpc_dcon/TODO @@ -1,4 +1,11 @@ TODO: + - complete rewrite: + 1. The underlying fbdev drivers need to be converted into drm kernel + modesetting drivers. + 2. The dcon low-power display mode can then be integrated using the + drm damage tracking and self-refresh helpers. + This bolted-on self-refresh support that digs around in fbdev + internals, but isn't properly integrated, is not the correct solution. - see if vx855 gpio API can be made similar enough to cs5535 so we can share more code - convert all uses of the old GPIO API from <linux/gpio.h> to the -- 2.20.1
== Series Details == Series: fbcon notifier begone! URL : https://patchwork.freedesktop.org/series/60843/ State : warning == Summary == $ dim checkpatch origin/drm-tip 055b00c0fe75 dummycon: Sprinkle locking checks -:45: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 23 lines checked 4e37022aa93c fbdev: locking check for fb_set_suspend -:34: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 8 lines checked 9a1b9bd2fe54 vt: might_sleep() annotation for do_blank_screen -:32: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 8 lines checked 0b0436a4cf45 vt: More locking checks -:70: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 38 lines checked c4874367788b fbdev/sa1100fb: Remove dead code -:52: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 35 lines checked 05d067aaf0c6 fbdev/cyber2000: Remove struct display -:23: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 7 lines checked 952fc4d78a9a fbdev/aty128fb: Remove dead code -:88: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 70 lines checked a43b8f82dead fbcon: s/struct display/struct fbcon_display/ -:270: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #270: FILE: drivers/video/fbdev/core/fbcon.c:2117: +static void updatescrollmode(struct fbcon_display *p, struct fb_info *info, -:384: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 1 checks, 317 lines checked d4f5dc8d37ec fbcon: Remove fbcon_has_exited -:11: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 6104c37094e7 ("fbcon: Make fbcon a built-time depency for fbdev")' #11: commit 6104c37094e729f3d4ce65797002112735d49cd1 -:162: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 1 errors, 1 warnings, 0 checks, 105 lines checked 35546ee18ade fbcon: call fbcon_fb_(un)registered directly -:11: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 6104c37094e7 ("fbcon: Make fbcon a built-time depency for fbdev")' #11: commit 6104c37094e729f3d4ce65797002112735d49cd1 -:168: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 1 errors, 1 warnings, 0 checks, 108 lines checked fecd97482aa7 fbdev/sh_mobile: remove sh_mobile_lcdc_display_notify fc2648b2ee9c fbdev/omap: sysfs files can't disappear before the device is gone c8c698e0756d fbdev: sysfs files can't disappear before the device is gone 235cf63d6d1d staging/olpc: lock_fb_info can't fail d7b435d6fd4e fbdev/atyfb: lock_fb_info can't fail 5b5267d29e9b fbdev: lock_fb_info cannot fail -:11: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit c47747fde931 ("fbmem: make read/write/ioctl use the frame buffer at open time")' #11: commit c47747fde931c02455683bd00ea43eaa62f35b0e -:307: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 1 errors, 1 warnings, 0 checks, 212 lines checked f3e57d9fc39b fbcon: call fbcon_fb_bind directly -:160: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 107 lines checked 1d4a7a51b9bd fbdev: make unregister/unlink functions not fail -:209: CHECK:AVOID_EXTERNS: extern prototypes should be avoided in .h files #209: FILE: include/linux/fb.h:630: +extern void unregister_framebuffer(struct fb_info *fb_info); -:210: CHECK:AVOID_EXTERNS: extern prototypes should be avoided in .h files #210: FILE: include/linux/fb.h:631: +extern void unlink_framebuffer(struct fb_info *fb_info); -:213: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 2 checks, 174 lines checked bc6430295335 fbdev: unify unlink_framebufer paths -:92: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 63 lines checked c7f216feeeb6 fbdev/sh_mob: Remove fb notifier callback -:21: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 6011bdeaa608 ("fbdev: sh-mobile: HDMI support for SH-Mobile SoCs")' #21: commit 6011bdeaa6089d49c02de69f05980da7bad314ab -:105: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 1 errors, 1 warnings, 0 checks, 62 lines checked dd9bf1dec0f3 fbdev: directly call fbcon_suspended/resumed -:126: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 77 lines checked 584850e84e28 fbcon: Call fbcon_mode_deleted/new_modelist directly -:175: ERROR:OPEN_BRACE: open brace '{' following function definitions go on the next line #175: FILE: include/linux/fbcon.h:23: +int fbcon_mode_deleted(struct fb_info *info, + struct fb_videomode *mode) { return 0; } -:180: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 1 errors, 1 warnings, 0 checks, 123 lines checked b77db88cab5e fbdev: Call fbcon_get_requirement directly -:112: ERROR:OPEN_BRACE: open brace '{' following function definitions go on the next line #112: FILE: include/linux/fbcon.h:28: +void fbcon_get_requirement(struct fb_info *info, + struct fb_blit_caps *caps) {} -:116: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 1 errors, 1 warnings, 0 checks, 68 lines checked 04d78e43249a Revert "backlight/fbcon: Add FB_EVENT_CONBLANK" -:83: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 42 lines checked f68577706206 fbcon: directly call fbcon_fb_blanked -:76: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 38 lines checked 416fd80b5fa6 fbmem: pull fbcon_fb_blanked out of fb_blank -:84: WARNING:CONSIDER_KSTRTO: simple_strtoul is obsolete, use kstrtoul instead #84: FILE: drivers/video/fbdev/core/fbsysfs.c:311: + arg = simple_strtoul(buf, &last, 0); -:94: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 2 warnings, 0 checks, 40 lines checked f3db74aa6af7 fbdev: remove FBINFO_MISC_USEREVENT around fb_blank -:67: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 30 lines checked fe0d240ac210 fb: Flatten control flow in fb_set_var -:141: WARNING:PREFER_PR_LEVEL: Prefer [subsystem eg: netdev]_warn([subsystem]dev, ... then dev_warn(dev, ... then pr_warn(... to printk(KERN_WARNING ... #141: FILE: drivers/video/fbdev/core/fbmem.c:1027: + printk(KERN_WARNING "detected " -:188: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 2 warnings, 0 checks, 156 lines checked 982d2147a85c fbcon: replace FB_EVENT_MODE_CHANGE/_ALL with direct calls -:46: CHECK:LINE_SPACING: Please don't use multiple blank lines #46: FILE: drivers/video/fbdev/core/fbcon.c:3008: + -:164: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 1 checks, 107 lines checked 03c8d586c1a7 vgaswitcheroo: call fbcon_remap_all directly -:126: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 82 lines checked 771b9daec03d fbcon: Call con2fb_map functions directly -:73: WARNING:BRACES: braces {} are not necessary for single statement blocks #73: FILE: drivers/video/fbdev/core/fbcon.c:3331: + if (!registered_fb[con2fb.framebuffer]) { + return -EINVAL; } -:208: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 2 warnings, 0 checks, 156 lines checked 4f6362b7429b fbcon: Document what I learned about fbcon locking -:43: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 25 lines checked 67c24914765c staging/olpc_dcon: Add drm conversion to TODO -:38: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 11 lines checked _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[-- Attachment #1.1: Type: text/plain, Size: 3795 bytes --] Hi Am 20.05.19 um 10:21 schrieb Daniel Vetter: ... > diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c > index fc3d34a8ea5b..ae2db31eeba7 100644 > --- a/drivers/video/fbdev/core/fbmem.c > +++ b/drivers/video/fbdev/core/fbmem.c > @@ -1660,7 +1660,6 @@ MODULE_PARM_DESC(lockless_register_fb, > static int do_register_framebuffer(struct fb_info *fb_info) > { > int i, ret; > - struct fb_event event; > struct fb_videomode mode; > > if (fb_check_foreignness(fb_info)) > @@ -1723,7 +1722,6 @@ static int do_register_framebuffer(struct fb_info *fb_info) > fb_add_videomode(&mode, &fb_info->modelist); > registered_fb[i] = fb_info; > > - event.info = fb_info; > if (!lockless_register_fb) > console_lock(); > else > @@ -1732,9 +1730,8 @@ static int do_register_framebuffer(struct fb_info *fb_info) > ret = -ENODEV; > goto unlock_console; > } > - ret = 0; > > - fb_notifier_call_chain(FB_EVENT_FB_REGISTERED, &event); > + ret = fbcon_fb_registered(fb_info); What about backlight drivers? [1] Apparently these also use the notifiers. [2] From my understanding, backlight drivers would stop working with this change. Best regards Thomas [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/video/backlight [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/video/backlight/backlight.c#n40 > unlock_fb_info(fb_info); > unlock_console: > if (!lockless_register_fb) > @@ -1771,7 +1768,6 @@ static int __unlink_framebuffer(struct fb_info *fb_info); > > static int do_unregister_framebuffer(struct fb_info *fb_info) > { > - struct fb_event event; > int ret; > > ret = unbind_console(fb_info); > @@ -1789,9 +1785,8 @@ static int do_unregister_framebuffer(struct fb_info *fb_info) > registered_fb[fb_info->node] = NULL; > num_registered_fb--; > fb_cleanup_device(fb_info); > - event.info = fb_info; > console_lock(); > - fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event); > + fbcon_fb_unregistered(fb_info); > console_unlock(); > > /* this may free fb info */ > diff --git a/include/linux/fb.h b/include/linux/fb.h > index f52ef0ad6781..701abaf79c87 100644 > --- a/include/linux/fb.h > +++ b/include/linux/fb.h > @@ -136,10 +136,6 @@ struct fb_cursor_user { > #define FB_EVENT_RESUME 0x03 > /* An entry from the modelist was removed */ > #define FB_EVENT_MODE_DELETE 0x04 > -/* A driver registered itself */ > -#define FB_EVENT_FB_REGISTERED 0x05 > -/* A driver unregistered itself */ > -#define FB_EVENT_FB_UNREGISTERED 0x06 > /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ > #define FB_EVENT_GET_CONSOLE_MAP 0x07 > /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ > diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h > index f68a7db14165..94a71e9e1257 100644 > --- a/include/linux/fbcon.h > +++ b/include/linux/fbcon.h > @@ -4,9 +4,13 @@ > #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); > #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) {} > #endif > > #endif /* _LINUX_FBCON_H */ > -- Thomas Zimmermann Graphics Driver Developer SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg) [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #1.1: Type: text/plain, Size: 3795 bytes --] Hi Am 20.05.19 um 10:21 schrieb Daniel Vetter: ... > diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c > index fc3d34a8ea5b..ae2db31eeba7 100644 > --- a/drivers/video/fbdev/core/fbmem.c > +++ b/drivers/video/fbdev/core/fbmem.c > @@ -1660,7 +1660,6 @@ MODULE_PARM_DESC(lockless_register_fb, > static int do_register_framebuffer(struct fb_info *fb_info) > { > int i, ret; > - struct fb_event event; > struct fb_videomode mode; > > if (fb_check_foreignness(fb_info)) > @@ -1723,7 +1722,6 @@ static int do_register_framebuffer(struct fb_info *fb_info) > fb_add_videomode(&mode, &fb_info->modelist); > registered_fb[i] = fb_info; > > - event.info = fb_info; > if (!lockless_register_fb) > console_lock(); > else > @@ -1732,9 +1730,8 @@ static int do_register_framebuffer(struct fb_info *fb_info) > ret = -ENODEV; > goto unlock_console; > } > - ret = 0; > > - fb_notifier_call_chain(FB_EVENT_FB_REGISTERED, &event); > + ret = fbcon_fb_registered(fb_info); What about backlight drivers? [1] Apparently these also use the notifiers. [2] From my understanding, backlight drivers would stop working with this change. Best regards Thomas [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/video/backlight [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/video/backlight/backlight.c#n40 > unlock_fb_info(fb_info); > unlock_console: > if (!lockless_register_fb) > @@ -1771,7 +1768,6 @@ static int __unlink_framebuffer(struct fb_info *fb_info); > > static int do_unregister_framebuffer(struct fb_info *fb_info) > { > - struct fb_event event; > int ret; > > ret = unbind_console(fb_info); > @@ -1789,9 +1785,8 @@ static int do_unregister_framebuffer(struct fb_info *fb_info) > registered_fb[fb_info->node] = NULL; > num_registered_fb--; > fb_cleanup_device(fb_info); > - event.info = fb_info; > console_lock(); > - fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event); > + fbcon_fb_unregistered(fb_info); > console_unlock(); > > /* this may free fb info */ > diff --git a/include/linux/fb.h b/include/linux/fb.h > index f52ef0ad6781..701abaf79c87 100644 > --- a/include/linux/fb.h > +++ b/include/linux/fb.h > @@ -136,10 +136,6 @@ struct fb_cursor_user { > #define FB_EVENT_RESUME 0x03 > /* An entry from the modelist was removed */ > #define FB_EVENT_MODE_DELETE 0x04 > -/* A driver registered itself */ > -#define FB_EVENT_FB_REGISTERED 0x05 > -/* A driver unregistered itself */ > -#define FB_EVENT_FB_UNREGISTERED 0x06 > /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ > #define FB_EVENT_GET_CONSOLE_MAP 0x07 > /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ > diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h > index f68a7db14165..94a71e9e1257 100644 > --- a/include/linux/fbcon.h > +++ b/include/linux/fbcon.h > @@ -4,9 +4,13 @@ > #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); > #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) {} > #endif > > #endif /* _LINUX_FBCON_H */ > -- Thomas Zimmermann Graphics Driver Developer SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg) [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --]
On Mon, May 20, 2019 at 10:22:13AM +0200, Daniel Vetter wrote:
> --- a/drivers/video/fbdev/core/fbcon.c
> +++ b/drivers/video/fbdev/core/fbcon.c
> @@ -3146,16 +3146,16 @@ void fbcon_fb_unregistered(struct fb_info *info)
> }
>
> /* called with console_lock held */
> -static void fbcon_remap_all(int idx)
That comment needs to be removed as well.
Not an expert on fbcon code but this looks sane to me, so in case it helps:
Acked-by: Lukas Wunner <lukas@wunner.de>
Thanks,
Lukas
On Mon, May 20, 2019 at 10:22:13AM +0200, Daniel Vetter wrote:
> --- a/drivers/video/fbdev/core/fbcon.c
> +++ b/drivers/video/fbdev/core/fbcon.c
> @@ -3146,16 +3146,16 @@ void fbcon_fb_unregistered(struct fb_info *info)
> }
>
> /* called with console_lock held */
> -static void fbcon_remap_all(int idx)
That comment needs to be removed as well.
Not an expert on fbcon code but this looks sane to me, so in case it helps:
Acked-by: Lukas Wunner <lukas@wunner.de>
Thanks,
Lukas
[-- Attachment #1.1: Type: text/plain, Size: 4093 bytes --] Hi Am 20.05.19 um 10:33 schrieb Thomas Zimmermann: > Hi > > Am 20.05.19 um 10:21 schrieb Daniel Vetter: > ... >> diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c >> index fc3d34a8ea5b..ae2db31eeba7 100644 >> --- a/drivers/video/fbdev/core/fbmem.c >> +++ b/drivers/video/fbdev/core/fbmem.c >> @@ -1660,7 +1660,6 @@ MODULE_PARM_DESC(lockless_register_fb, >> static int do_register_framebuffer(struct fb_info *fb_info) >> { >> int i, ret; >> - struct fb_event event; >> struct fb_videomode mode; >> >> if (fb_check_foreignness(fb_info)) >> @@ -1723,7 +1722,6 @@ static int do_register_framebuffer(struct fb_info *fb_info) >> fb_add_videomode(&mode, &fb_info->modelist); >> registered_fb[i] = fb_info; >> >> - event.info = fb_info; >> if (!lockless_register_fb) >> console_lock(); >> else >> @@ -1732,9 +1730,8 @@ static int do_register_framebuffer(struct fb_info *fb_info) >> ret = -ENODEV; >> goto unlock_console; >> } >> - ret = 0; >> >> - fb_notifier_call_chain(FB_EVENT_FB_REGISTERED, &event); >> + ret = fbcon_fb_registered(fb_info); > > What about backlight drivers? [1] Apparently these also use the > notifiers. [2] From my understanding, backlight drivers would stop > working with this change. I just saw that backlight drivers only care about blanking and unblanking. Never mind then. Best regards Thomas > > Best regards > Thomas > > [1] > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/video/backlight > [2] > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/video/backlight/backlight.c#n40 > >> unlock_fb_info(fb_info); >> unlock_console: >> if (!lockless_register_fb) >> @@ -1771,7 +1768,6 @@ static int __unlink_framebuffer(struct fb_info *fb_info); >> >> static int do_unregister_framebuffer(struct fb_info *fb_info) >> { >> - struct fb_event event; >> int ret; >> >> ret = unbind_console(fb_info); >> @@ -1789,9 +1785,8 @@ static int do_unregister_framebuffer(struct fb_info *fb_info) >> registered_fb[fb_info->node] = NULL; >> num_registered_fb--; >> fb_cleanup_device(fb_info); >> - event.info = fb_info; >> console_lock(); >> - fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event); >> + fbcon_fb_unregistered(fb_info); >> console_unlock(); >> >> /* this may free fb info */ >> diff --git a/include/linux/fb.h b/include/linux/fb.h >> index f52ef0ad6781..701abaf79c87 100644 >> --- a/include/linux/fb.h >> +++ b/include/linux/fb.h >> @@ -136,10 +136,6 @@ struct fb_cursor_user { >> #define FB_EVENT_RESUME 0x03 >> /* An entry from the modelist was removed */ >> #define FB_EVENT_MODE_DELETE 0x04 >> -/* A driver registered itself */ >> -#define FB_EVENT_FB_REGISTERED 0x05 >> -/* A driver unregistered itself */ >> -#define FB_EVENT_FB_UNREGISTERED 0x06 >> /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ >> #define FB_EVENT_GET_CONSOLE_MAP 0x07 >> /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ >> diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h >> index f68a7db14165..94a71e9e1257 100644 >> --- a/include/linux/fbcon.h >> +++ b/include/linux/fbcon.h >> @@ -4,9 +4,13 @@ >> #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); >> #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) {} >> #endif >> >> #endif /* _LINUX_FBCON_H */ >> > -- Thomas Zimmermann Graphics Driver Developer SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg) [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #1.1: Type: text/plain, Size: 4093 bytes --] Hi Am 20.05.19 um 10:33 schrieb Thomas Zimmermann: > Hi > > Am 20.05.19 um 10:21 schrieb Daniel Vetter: > ... >> diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c >> index fc3d34a8ea5b..ae2db31eeba7 100644 >> --- a/drivers/video/fbdev/core/fbmem.c >> +++ b/drivers/video/fbdev/core/fbmem.c >> @@ -1660,7 +1660,6 @@ MODULE_PARM_DESC(lockless_register_fb, >> static int do_register_framebuffer(struct fb_info *fb_info) >> { >> int i, ret; >> - struct fb_event event; >> struct fb_videomode mode; >> >> if (fb_check_foreignness(fb_info)) >> @@ -1723,7 +1722,6 @@ static int do_register_framebuffer(struct fb_info *fb_info) >> fb_add_videomode(&mode, &fb_info->modelist); >> registered_fb[i] = fb_info; >> >> - event.info = fb_info; >> if (!lockless_register_fb) >> console_lock(); >> else >> @@ -1732,9 +1730,8 @@ static int do_register_framebuffer(struct fb_info *fb_info) >> ret = -ENODEV; >> goto unlock_console; >> } >> - ret = 0; >> >> - fb_notifier_call_chain(FB_EVENT_FB_REGISTERED, &event); >> + ret = fbcon_fb_registered(fb_info); > > What about backlight drivers? [1] Apparently these also use the > notifiers. [2] From my understanding, backlight drivers would stop > working with this change. I just saw that backlight drivers only care about blanking and unblanking. Never mind then. Best regards Thomas > > Best regards > Thomas > > [1] > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/video/backlight > [2] > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/video/backlight/backlight.c#n40 > >> unlock_fb_info(fb_info); >> unlock_console: >> if (!lockless_register_fb) >> @@ -1771,7 +1768,6 @@ static int __unlink_framebuffer(struct fb_info *fb_info); >> >> static int do_unregister_framebuffer(struct fb_info *fb_info) >> { >> - struct fb_event event; >> int ret; >> >> ret = unbind_console(fb_info); >> @@ -1789,9 +1785,8 @@ static int do_unregister_framebuffer(struct fb_info *fb_info) >> registered_fb[fb_info->node] = NULL; >> num_registered_fb--; >> fb_cleanup_device(fb_info); >> - event.info = fb_info; >> console_lock(); >> - fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event); >> + fbcon_fb_unregistered(fb_info); >> console_unlock(); >> >> /* this may free fb info */ >> diff --git a/include/linux/fb.h b/include/linux/fb.h >> index f52ef0ad6781..701abaf79c87 100644 >> --- a/include/linux/fb.h >> +++ b/include/linux/fb.h >> @@ -136,10 +136,6 @@ struct fb_cursor_user { >> #define FB_EVENT_RESUME 0x03 >> /* An entry from the modelist was removed */ >> #define FB_EVENT_MODE_DELETE 0x04 >> -/* A driver registered itself */ >> -#define FB_EVENT_FB_REGISTERED 0x05 >> -/* A driver unregistered itself */ >> -#define FB_EVENT_FB_UNREGISTERED 0x06 >> /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ >> #define FB_EVENT_GET_CONSOLE_MAP 0x07 >> /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ >> diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h >> index f68a7db14165..94a71e9e1257 100644 >> --- a/include/linux/fbcon.h >> +++ b/include/linux/fbcon.h >> @@ -4,9 +4,13 @@ >> #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); >> #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) {} >> #endif >> >> #endif /* _LINUX_FBCON_H */ >> > -- Thomas Zimmermann Graphics Driver Developer SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg) [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --]
== Series Details == Series: fbcon notifier begone! URL : https://patchwork.freedesktop.org/series/60843/ State : failure == Summary == CI Bug Log - changes from CI_DRM_6097 -> Patchwork_13041 ==================================================== Summary ------- **FAILURE** Serious unknown changes coming with Patchwork_13041 absolutely need to be verified manually. If you think the reported changes have nothing to do with the changes introduced in Patchwork_13041, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI. External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/ Possible new issues ------------------- Here are the unknown changes that may have been introduced in Patchwork_13041: ### IGT changes ### #### Possible regressions #### * igt@core_auth@basic-auth: - fi-kbl-r: [PASS][1] -> [DMESG-WARN][2] [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-kbl-r/igt@core_auth@basic-auth.html [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-kbl-r/igt@core_auth@basic-auth.html - fi-bwr-2160: [PASS][3] -> [DMESG-WARN][4] [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-bwr-2160/igt@core_auth@basic-auth.html [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-bwr-2160/igt@core_auth@basic-auth.html - fi-bdw-5557u: [PASS][5] -> [DMESG-WARN][6] [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-bdw-5557u/igt@core_auth@basic-auth.html [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-bdw-5557u/igt@core_auth@basic-auth.html - fi-skl-guc: [PASS][7] -> [DMESG-WARN][8] [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-skl-guc/igt@core_auth@basic-auth.html [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-skl-guc/igt@core_auth@basic-auth.html - fi-kbl-7567u: [PASS][9] -> [DMESG-WARN][10] [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-kbl-7567u/igt@core_auth@basic-auth.html [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-kbl-7567u/igt@core_auth@basic-auth.html - fi-kbl-8809g: [PASS][11] -> [DMESG-WARN][12] [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-kbl-8809g/igt@core_auth@basic-auth.html [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-kbl-8809g/igt@core_auth@basic-auth.html - fi-skl-6600u: [PASS][13] -> [DMESG-WARN][14] [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-skl-6600u/igt@core_auth@basic-auth.html [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-skl-6600u/igt@core_auth@basic-auth.html - fi-hsw-4770: [PASS][15] -> [DMESG-WARN][16] [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-hsw-4770/igt@core_auth@basic-auth.html [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-hsw-4770/igt@core_auth@basic-auth.html - fi-byt-j1900: [PASS][17] -> [DMESG-WARN][18] [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-byt-j1900/igt@core_auth@basic-auth.html [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-byt-j1900/igt@core_auth@basic-auth.html - fi-cfl-8700k: [PASS][19] -> [DMESG-WARN][20] [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-cfl-8700k/igt@core_auth@basic-auth.html [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-cfl-8700k/igt@core_auth@basic-auth.html - fi-whl-u: [PASS][21] -> [DMESG-WARN][22] [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-whl-u/igt@core_auth@basic-auth.html [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-whl-u/igt@core_auth@basic-auth.html - fi-apl-guc: [PASS][23] -> [DMESG-WARN][24] [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-apl-guc/igt@core_auth@basic-auth.html [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-apl-guc/igt@core_auth@basic-auth.html - fi-skl-6700k2: [PASS][25] -> [DMESG-WARN][26] [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-skl-6700k2/igt@core_auth@basic-auth.html [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-skl-6700k2/igt@core_auth@basic-auth.html - fi-ivb-3770: [PASS][27] -> [DMESG-WARN][28] [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-ivb-3770/igt@core_auth@basic-auth.html [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-ivb-3770/igt@core_auth@basic-auth.html - fi-bxt-dsi: [PASS][29] -> [DMESG-WARN][30] [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-bxt-dsi/igt@core_auth@basic-auth.html [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-bxt-dsi/igt@core_auth@basic-auth.html - fi-skl-iommu: [PASS][31] -> [DMESG-WARN][32] [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-skl-iommu/igt@core_auth@basic-auth.html [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-skl-iommu/igt@core_auth@basic-auth.html - fi-cfl-guc: [PASS][33] -> [DMESG-WARN][34] [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-cfl-guc/igt@core_auth@basic-auth.html [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-cfl-guc/igt@core_auth@basic-auth.html - fi-bxt-j4205: [PASS][35] -> [DMESG-WARN][36] [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-bxt-j4205/igt@core_auth@basic-auth.html [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-bxt-j4205/igt@core_auth@basic-auth.html - fi-bsw-n3050: [PASS][37] -> [DMESG-WARN][38] [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-bsw-n3050/igt@core_auth@basic-auth.html [38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-bsw-n3050/igt@core_auth@basic-auth.html - fi-hsw-peppy: [PASS][39] -> [DMESG-WARN][40] [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-hsw-peppy/igt@core_auth@basic-auth.html [40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-hsw-peppy/igt@core_auth@basic-auth.html - fi-glk-dsi: [PASS][41] -> [DMESG-WARN][42] [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-glk-dsi/igt@core_auth@basic-auth.html [42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-glk-dsi/igt@core_auth@basic-auth.html - fi-cfl-8109u: [PASS][43] -> [DMESG-WARN][44] [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-cfl-8109u/igt@core_auth@basic-auth.html [44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-cfl-8109u/igt@core_auth@basic-auth.html - fi-bdw-gvtdvm: [PASS][45] -> [DMESG-WARN][46] [45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-bdw-gvtdvm/igt@core_auth@basic-auth.html [46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-bdw-gvtdvm/igt@core_auth@basic-auth.html - fi-kbl-7500u: [PASS][47] -> [DMESG-WARN][48] [47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-kbl-7500u/igt@core_auth@basic-auth.html [48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-kbl-7500u/igt@core_auth@basic-auth.html - fi-icl-u2: [PASS][49] -> [DMESG-WARN][50] [49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-icl-u2/igt@core_auth@basic-auth.html [50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-icl-u2/igt@core_auth@basic-auth.html - fi-pnv-d510: NOTRUN -> [DMESG-WARN][51] [51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-pnv-d510/igt@core_auth@basic-auth.html - fi-snb-2520m: [PASS][52] -> [DMESG-WARN][53] [52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-snb-2520m/igt@core_auth@basic-auth.html [53]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-snb-2520m/igt@core_auth@basic-auth.html - fi-skl-lmem: [PASS][54] -> [DMESG-WARN][55] [54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-skl-lmem/igt@core_auth@basic-auth.html [55]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-skl-lmem/igt@core_auth@basic-auth.html - fi-byt-n2820: [PASS][56] -> [DMESG-WARN][57] [56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-byt-n2820/igt@core_auth@basic-auth.html [57]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-byt-n2820/igt@core_auth@basic-auth.html - fi-skl-6770hq: [PASS][58] -> [DMESG-WARN][59] [58]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-skl-6770hq/igt@core_auth@basic-auth.html [59]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-skl-6770hq/igt@core_auth@basic-auth.html - fi-elk-e7500: [PASS][60] -> [DMESG-WARN][61] [60]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-elk-e7500/igt@core_auth@basic-auth.html [61]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-elk-e7500/igt@core_auth@basic-auth.html - fi-ilk-650: [PASS][62] -> [DMESG-WARN][63] [62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-ilk-650/igt@core_auth@basic-auth.html [63]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-ilk-650/igt@core_auth@basic-auth.html - fi-bsw-kefka: [PASS][64] -> [DMESG-WARN][65] [64]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-bsw-kefka/igt@core_auth@basic-auth.html [65]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-bsw-kefka/igt@core_auth@basic-auth.html - fi-snb-2600: [PASS][66] -> [DMESG-WARN][67] [66]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-snb-2600/igt@core_auth@basic-auth.html [67]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-snb-2600/igt@core_auth@basic-auth.html - fi-skl-6260u: [PASS][68] -> [DMESG-WARN][69] [68]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-skl-6260u/igt@core_auth@basic-auth.html [69]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-skl-6260u/igt@core_auth@basic-auth.html - fi-hsw-4770r: [PASS][70] -> [DMESG-WARN][71] [70]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-hsw-4770r/igt@core_auth@basic-auth.html [71]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-hsw-4770r/igt@core_auth@basic-auth.html - fi-skl-gvtdvm: [PASS][72] -> [DMESG-WARN][73] [72]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-skl-gvtdvm/igt@core_auth@basic-auth.html [73]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-skl-gvtdvm/igt@core_auth@basic-auth.html - fi-kbl-x1275: [PASS][74] -> [DMESG-WARN][75] [74]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-kbl-x1275/igt@core_auth@basic-auth.html [75]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-kbl-x1275/igt@core_auth@basic-auth.html - fi-blb-e6850: [PASS][76] -> [DMESG-WARN][77] [76]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-blb-e6850/igt@core_auth@basic-auth.html [77]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-blb-e6850/igt@core_auth@basic-auth.html * igt@runner@aborted: - fi-ilk-650: NOTRUN -> [FAIL][78] [78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-ilk-650/igt@runner@aborted.html - fi-pnv-d510: NOTRUN -> [FAIL][79] [79]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-pnv-d510/igt@runner@aborted.html - fi-bdw-gvtdvm: NOTRUN -> [FAIL][80] [80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-bdw-gvtdvm/igt@runner@aborted.html - fi-cfl-8109u: NOTRUN -> [FAIL][81] [81]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-cfl-8109u/igt@runner@aborted.html - fi-hsw-peppy: NOTRUN -> [FAIL][82] [82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-hsw-peppy/igt@runner@aborted.html - fi-icl-u2: NOTRUN -> [FAIL][83] [83]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-icl-u2/igt@runner@aborted.html - fi-snb-2520m: NOTRUN -> [FAIL][84] [84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-snb-2520m/igt@runner@aborted.html - fi-hsw-4770: NOTRUN -> [FAIL][85] [85]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-hsw-4770/igt@runner@aborted.html - fi-kbl-7500u: NOTRUN -> [FAIL][86] [86]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-kbl-7500u/igt@runner@aborted.html - fi-bxt-j4205: NOTRUN -> [FAIL][87] [87]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-bxt-j4205/igt@runner@aborted.html - fi-whl-u: NOTRUN -> [FAIL][88] [88]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-whl-u/igt@runner@aborted.html - fi-ivb-3770: NOTRUN -> [FAIL][89] [89]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-ivb-3770/igt@runner@aborted.html - fi-bxt-dsi: NOTRUN -> [FAIL][90] [90]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-bxt-dsi/igt@runner@aborted.html - fi-byt-j1900: NOTRUN -> [FAIL][91] [91]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-byt-j1900/igt@runner@aborted.html - fi-cfl-guc: NOTRUN -> [FAIL][92] [92]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-cfl-guc/igt@runner@aborted.html - fi-kbl-7567u: NOTRUN -> [FAIL][93] [93]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-kbl-7567u/igt@runner@aborted.html - fi-bsw-n3050: NOTRUN -> [FAIL][94] [94]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-bsw-n3050/igt@runner@aborted.html - fi-blb-e6850: NOTRUN -> [FAIL][95] [95]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-blb-e6850/igt@runner@aborted.html - fi-kbl-x1275: NOTRUN -> [FAIL][96] [96]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-kbl-x1275/igt@runner@aborted.html - fi-bsw-kefka: NOTRUN -> [FAIL][97] [97]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-bsw-kefka/igt@runner@aborted.html - fi-cfl-8700k: NOTRUN -> [FAIL][98] [98]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-cfl-8700k/igt@runner@aborted.html - fi-hsw-4770r: NOTRUN -> [FAIL][99] [99]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-hsw-4770r/igt@runner@aborted.html - fi-kbl-8809g: NOTRUN -> [FAIL][100] [100]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-kbl-8809g/igt@runner@aborted.html - fi-kbl-r: NOTRUN -> [FAIL][101] [101]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-kbl-r/igt@runner@aborted.html - fi-bdw-5557u: NOTRUN -> [FAIL][102] [102]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-bdw-5557u/igt@runner@aborted.html - fi-byt-n2820: NOTRUN -> [FAIL][103] [103]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-byt-n2820/igt@runner@aborted.html - fi-snb-2600: NOTRUN -> [FAIL][104] [104]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-snb-2600/igt@runner@aborted.html - fi-elk-e7500: NOTRUN -> [FAIL][105] [105]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-elk-e7500/igt@runner@aborted.html #### Warnings #### * igt@runner@aborted: - fi-apl-guc: [FAIL][106] ([fdo#110622]) -> [FAIL][107] [106]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-apl-guc/igt@runner@aborted.html [107]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-apl-guc/igt@runner@aborted.html #### Suppressed #### The following results come from untrusted machines, tests, or statuses. They do not affect the overall result. * igt@core_auth@basic-auth: - {fi-icl-dsi}: [PASS][108] -> [DMESG-WARN][109] [108]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-icl-dsi/igt@core_auth@basic-auth.html [109]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-icl-dsi/igt@core_auth@basic-auth.html - {fi-cml-u2}: [PASS][110] -> [DMESG-WARN][111] [110]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-cml-u2/igt@core_auth@basic-auth.html [111]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-cml-u2/igt@core_auth@basic-auth.html - {fi-cml-u}: [PASS][112] -> [DMESG-WARN][113] [112]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-cml-u/igt@core_auth@basic-auth.html [113]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-cml-u/igt@core_auth@basic-auth.html - {fi-icl-y}: [PASS][114] -> [DMESG-WARN][115] [114]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-icl-y/igt@core_auth@basic-auth.html [115]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-icl-y/igt@core_auth@basic-auth.html * igt@runner@aborted: - {fi-cml-u2}: NOTRUN -> [FAIL][116] [116]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-cml-u2/igt@runner@aborted.html - {fi-cml-u}: NOTRUN -> [FAIL][117] [117]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-cml-u/igt@runner@aborted.html - {fi-icl-y}: NOTRUN -> [FAIL][118] [118]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-icl-y/igt@runner@aborted.html - {fi-icl-dsi}: NOTRUN -> [FAIL][119] [119]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-icl-dsi/igt@runner@aborted.html Known issues ------------ Here are the changes found in Patchwork_13041 that come from known issues: ### IGT changes ### #### Warnings #### * igt@runner@aborted: - fi-skl-iommu: [FAIL][120] ([fdo#104108] / [fdo#108602]) -> [FAIL][121] ([fdo#104108]) [120]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-skl-iommu/igt@runner@aborted.html [121]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/fi-skl-iommu/igt@runner@aborted.html {name}: This element is suppressed. This means it is ignored when computing the status of the difference (SUCCESS, WARNING, or FAILURE). [fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108 [fdo#108602]: https://bugs.freedesktop.org/show_bug.cgi?id=108602 [fdo#110622]: https://bugs.freedesktop.org/show_bug.cgi?id=110622 Participating hosts (52 -> 44) ------------------------------ Additional (1): fi-pnv-d510 Missing (9): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-gdg-551 fi-icl-u3 fi-byt-clapper fi-bdw-samus Build changes ------------- * Linux: CI_DRM_6097 -> Patchwork_13041 CI_DRM_6097: 3f2d6a47d9eec66594887b1e9718bc1a29aa6a77 @ git://anongit.freedesktop.org/gfx-ci/linux IGT_4996: 6fe5d254ec1b9b47d61408e1b49a7339876bf1e7 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools Patchwork_13041: 67c24914765cf6ca70d31058350a8becfae10f50 @ git://anongit.freedesktop.org/gfx-ci/linux == Linux commits == 67c24914765c staging/olpc_dcon: Add drm conversion to TODO 4f6362b7429b fbcon: Document what I learned about fbcon locking 771b9daec03d fbcon: Call con2fb_map functions directly 03c8d586c1a7 vgaswitcheroo: call fbcon_remap_all directly 982d2147a85c fbcon: replace FB_EVENT_MODE_CHANGE/_ALL with direct calls fe0d240ac210 fb: Flatten control flow in fb_set_var f3db74aa6af7 fbdev: remove FBINFO_MISC_USEREVENT around fb_blank 416fd80b5fa6 fbmem: pull fbcon_fb_blanked out of fb_blank f68577706206 fbcon: directly call fbcon_fb_blanked 04d78e43249a Revert "backlight/fbcon: Add FB_EVENT_CONBLANK" b77db88cab5e fbdev: Call fbcon_get_requirement directly 584850e84e28 fbcon: Call fbcon_mode_deleted/new_modelist directly dd9bf1dec0f3 fbdev: directly call fbcon_suspended/resumed c7f216feeeb6 fbdev/sh_mob: Remove fb notifier callback bc6430295335 fbdev: unify unlink_framebufer paths 1d4a7a51b9bd fbdev: make unregister/unlink functions not fail f3e57d9fc39b fbcon: call fbcon_fb_bind d == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13041/ _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
== Series Details == Series: fbcon notifier begone! URL : https://patchwork.freedesktop.org/series/60843/ State : warning == Summary == $ dim sparse origin/drm-tip Sparse version: v0.5.2 Commit: dummycon: Sprinkle locking checks Okay! Commit: fbdev: locking check for fb_set_suspend Okay! Commit: vt: might_sleep() annotation for do_blank_screen Okay! Commit: vt: More locking checks Okay! Commit: fbdev/sa1100fb: Remove dead code Okay! Commit: fbdev/cyber2000: Remove struct display Okay! Commit: fbdev/aty128fb: Remove dead code Okay! Commit: fbcon: s/struct display/struct fbcon_display/ Okay! Commit: fbcon: Remove fbcon_has_exited Okay! Commit: fbcon: call fbcon_fb_(un)registered directly Okay! Commit: fbdev/sh_mobile: remove sh_mobile_lcdc_display_notify Okay! Commit: fbdev/omap: sysfs files can't disappear before the device is gone Okay! Commit: fbdev: sysfs files can't disappear before the device is gone Okay! Commit: staging/olpc: lock_fb_info can't fail Okay! Commit: fbdev/atyfb: lock_fb_info can't fail Okay! Commit: fbdev: lock_fb_info cannot fail Okay! Commit: fbcon: call fbcon_fb_bind directly Okay! Commit: fbdev: make unregister/unlink functions not fail Okay! Commit: fbdev: unify unlink_framebufer paths Okay! Commit: fbdev/sh_mob: Remove fb notifier callback Okay! Commit: fbdev: directly call fbcon_suspended/resumed Okay! Commit: fbcon: Call fbcon_mode_deleted/new_modelist directly Okay! Commit: fbdev: Call fbcon_get_requirement directly Okay! Commit: Revert "backlight/fbcon: Add FB_EVENT_CONBLANK" Okay! Commit: fbcon: directly call fbcon_fb_blanked Okay! Commit: fbmem: pull fbcon_fb_blanked out of fb_blank Okay! Commit: fbdev: remove FBINFO_MISC_USEREVENT around fb_blank Okay! Commit: fb: Flatten control flow in fb_set_var Okay! Commit: fbcon: replace FB_EVENT_MODE_CHANGE/_ALL with direct calls Okay! _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
On Mon, May 20, 2019 at 10:25 AM Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> It's dead code, and removing it avoids me having to understand
> what it's doing with lock_fb_info.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
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
On Mon, May 20, 2019 at 10:22 AM Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> This seems to be entirely defunct:
>
> - The FB_EVEN_SUSPEND/RESUME events are only sent out by
> fb_set_suspend. Which is supposed to be called by drivers in their
> suspend/resume hooks, and not itself call into drivers. Luckily
> sh_mob doesn't call fb_set_suspend, so this seems to do nothing
> useful.
>
> - The notify hook calls sh_mobile_fb_reconfig() which in turn can
> call into the fb notifier. Or attempt too, since that would
> deadlock.
>
> So looks like leftover hacks from when this was originally introduced
> in
>
> commit 6011bdeaa6089d49c02de69f05980da7bad314ab
> Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> Date: Wed Jul 21 10:13:21 2010 +0000
>
> fbdev: sh-mobile: HDMI support for SH-Mobile SoCs
>
> So let's just remove it.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Display still works fine on Armadillo800-EVA, before and after system
suspend/resume, so:
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
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
On Mon, May 20, 2019 at 11:06 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote: > > On Mon, May 20, 2019 at 10:22 AM Daniel Vetter <daniel.vetter@ffwll.ch> wrote: > > This seems to be entirely defunct: > > > > - The FB_EVEN_SUSPEND/RESUME events are only sent out by > > fb_set_suspend. Which is supposed to be called by drivers in their > > suspend/resume hooks, and not itself call into drivers. Luckily > > sh_mob doesn't call fb_set_suspend, so this seems to do nothing > > useful. > > > > - The notify hook calls sh_mobile_fb_reconfig() which in turn can > > call into the fb notifier. Or attempt too, since that would > > deadlock. > > > > So looks like leftover hacks from when this was originally introduced > > in > > > > commit 6011bdeaa6089d49c02de69f05980da7bad314ab > > Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de> > > Date: Wed Jul 21 10:13:21 2010 +0000 > > > > fbdev: sh-mobile: HDMI support for SH-Mobile SoCs > > > > So let's just remove it. > > > > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> > > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> > > Display still works fine on Armadillo800-EVA, before and after system > suspend/resume, so: > > Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> I'm impressed, I honestly think I do not fully understand what the shmob driver is doing here, so thank you very much for giving this a spin! Cheers, Daniel > > 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 -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Hi Daniel.
While browsing this nice patch series I stumbled upon a detail.
On Mon, May 20, 2019 at 10:21:53AM +0200, Daniel Vetter wrote:
> With
>
> commit 6104c37094e729f3d4ce65797002112735d49cd1
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date: Tue Aug 1 17:32:07 2017 +0200
>
> fbcon: Make fbcon a built-time depency for fbdev
>
> we have a static dependency between fbcon and fbdev, and we can
> replace the indirection through the notifier chain with a function
> call.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: "Noralf Trønnes" <noralf@tronnes.org>
> Cc: Yisheng Xie <ysxie@foxmail.com>
> Cc: Peter Rosin <peda@axentia.se>
> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Mikulas Patocka <mpatocka@redhat.com>
> Cc: linux-fbdev@vger.kernel.org
> ---
> diff --git a/include/linux/fb.h b/include/linux/fb.h
> index f52ef0ad6781..701abaf79c87 100644
> --- a/include/linux/fb.h
> +++ b/include/linux/fb.h
> @@ -136,10 +136,6 @@ struct fb_cursor_user {
> #define FB_EVENT_RESUME 0x03
> /* An entry from the modelist was removed */
> #define FB_EVENT_MODE_DELETE 0x04
> -/* A driver registered itself */
> -#define FB_EVENT_FB_REGISTERED 0x05
> -/* A driver unregistered itself */
> -#define FB_EVENT_FB_UNREGISTERED 0x06
> /* CONSOLE-SPECIFIC: get console to framebuffer mapping */
> #define FB_EVENT_GET_CONSOLE_MAP 0x07
> /* CONSOLE-SPECIFIC: set console to framebuffer mapping */
This breaks build of arch/arm/mach-pxa/am200epd.c thats uses
FB_EVENT_FB_*REGISTERED:
if (event == FB_EVENT_FB_REGISTERED)
return am200_share_video_mem(info);
else if (event == FB_EVENT_FB_UNREGISTERED)
return am200_unshare_video_mem(info);
Found while grepping for "FB_EVENT" so this is not a build
error I triggered.
Sam
Hi Daniel.
While browsing this nice patch series I stumbled upon a detail.
On Mon, May 20, 2019 at 10:21:53AM +0200, Daniel Vetter wrote:
> With
>
> commit 6104c37094e729f3d4ce65797002112735d49cd1
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date: Tue Aug 1 17:32:07 2017 +0200
>
> fbcon: Make fbcon a built-time depency for fbdev
>
> we have a static dependency between fbcon and fbdev, and we can
> replace the indirection through the notifier chain with a function
> call.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: "Noralf Trønnes" <noralf@tronnes.org>
> Cc: Yisheng Xie <ysxie@foxmail.com>
> Cc: Peter Rosin <peda@axentia.se>
> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Mikulas Patocka <mpatocka@redhat.com>
> Cc: linux-fbdev@vger.kernel.org
> ---
> diff --git a/include/linux/fb.h b/include/linux/fb.h
> index f52ef0ad6781..701abaf79c87 100644
> --- a/include/linux/fb.h
> +++ b/include/linux/fb.h
> @@ -136,10 +136,6 @@ struct fb_cursor_user {
> #define FB_EVENT_RESUME 0x03
> /* An entry from the modelist was removed */
> #define FB_EVENT_MODE_DELETE 0x04
> -/* A driver registered itself */
> -#define FB_EVENT_FB_REGISTERED 0x05
> -/* A driver unregistered itself */
> -#define FB_EVENT_FB_UNREGISTERED 0x06
> /* CONSOLE-SPECIFIC: get console to framebuffer mapping */
> #define FB_EVENT_GET_CONSOLE_MAP 0x07
> /* CONSOLE-SPECIFIC: set console to framebuffer mapping */
This breaks build of arch/arm/mach-pxa/am200epd.c thats uses
FB_EVENT_FB_*REGISTERED:
if (event = FB_EVENT_FB_REGISTERED)
return am200_share_video_mem(info);
else if (event = FB_EVENT_FB_UNREGISTERED)
return am200_unshare_video_mem(info);
Found while grepping for "FB_EVENT" so this is not a build
error I triggered.
Sam
Hi Daniel. While browsing this nice patch series I stumbled upon a detail. On Mon, May 20, 2019 at 10:21:53AM +0200, Daniel Vetter wrote: > With > > commit 6104c37094e729f3d4ce65797002112735d49cd1 > Author: Daniel Vetter <daniel.vetter@ffwll.ch> > Date: Tue Aug 1 17:32:07 2017 +0200 > > fbcon: Make fbcon a built-time depency for fbdev > > we have a static dependency between fbcon and fbdev, and we can > replace the indirection through the notifier chain with a function > call. > > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> > Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch> > Cc: Hans de Goede <hdegoede@redhat.com> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Cc: "Noralf Trønnes" <noralf@tronnes.org> > Cc: Yisheng Xie <ysxie@foxmail.com> > Cc: Peter Rosin <peda@axentia.se> > Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> > Cc: Thomas Zimmermann <tzimmermann@suse.de> > Cc: Mikulas Patocka <mpatocka@redhat.com> > Cc: linux-fbdev@vger.kernel.org > --- > diff --git a/include/linux/fb.h b/include/linux/fb.h > index f52ef0ad6781..701abaf79c87 100644 > --- a/include/linux/fb.h > +++ b/include/linux/fb.h > @@ -136,10 +136,6 @@ struct fb_cursor_user { > #define FB_EVENT_RESUME 0x03 > /* An entry from the modelist was removed */ > #define FB_EVENT_MODE_DELETE 0x04 > -/* A driver registered itself */ > -#define FB_EVENT_FB_REGISTERED 0x05 > -/* A driver unregistered itself */ > -#define FB_EVENT_FB_UNREGISTERED 0x06 > /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ > #define FB_EVENT_GET_CONSOLE_MAP 0x07 > /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ This breaks build of arch/arm/mach-pxa/am200epd.c thats uses FB_EVENT_FB_*REGISTERED: if (event == FB_EVENT_FB_REGISTERED) return am200_share_video_mem(info); else if (event == FB_EVENT_FB_UNREGISTERED) return am200_unshare_video_mem(info); Found while grepping for "FB_EVENT" so this is not a build error I triggered. Sam _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Daniel. > With the recursion broken in the previous patch we can drop the > FBINFO_MISC_USEREVENT flag around calls to fb_blank - recursion > prevention was it's only job. > When grepping for FBINFO_MISC_USEREVENT I get a few hits not addressed in the patch below: drivers/video/fbdev/core/fbcon.c: if (!(info->flags & FBINFO_MISC_USEREVENT)) drivers/video/fbdev/core/fbmem.c: if (!ret && (flags & FBINFO_MISC_USEREVENT)) { drivers/video/fbdev/core/fbmem.c: info->flags &= ~FBINFO_MISC_USEREVENT; drivers/video/fbdev/core/fbmem.c: info->flags |= FBINFO_MISC_USEREVENT; drivers/video/fbdev/core/fbmem.c: info->flags &= ~FBINFO_MISC_USEREVENT; drivers/video/fbdev/core/fbmem.c: info->flags |= FBINFO_MISC_USEREVENT; drivers/video/fbdev/core/fbmem.c: info->flags &= ~FBINFO_MISC_USEREVENT; drivers/video/fbdev/core/fbsysfs.c: fb_info->flags |= FBINFO_MISC_USEREVENT; drivers/video/fbdev/core/fbsysfs.c: fb_info->flags &= ~FBINFO_MISC_USEREVENT; drivers/video/fbdev/core/fbsysfs.c: fb_info->flags |= FBINFO_MISC_USEREVENT; drivers/video/fbdev/core/fbsysfs.c: fb_info->flags &= ~FBINFO_MISC_USEREVENT; drivers/video/fbdev/ps3fb.c: info->flags |= FBINFO_MISC_USEREVENT; drivers/video/fbdev/ps3fb.c: info->flags &= ~FBINFO_MISC_USEREVENT; drivers/video/fbdev/sh_mobile_lcdcfb.c: * FBINFO_MISC_USEREVENT flag is set. Since we do not want to fake a include/linux/fb.h:#define FBINFO_MISC_USEREVENT 0x10000 /* event request The use in ps3fb looks like a candidate for removal and this file is not touch in this patch series, so I guess I did not miss it. As I did not apply the full series maybe some of the other users was already taken care of. Sam > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch> > Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> > Cc: Hans de Goede <hdegoede@redhat.com> > Cc: Yisheng Xie <ysxie@foxmail.com> > Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> > Cc: Peter Rosin <peda@axentia.se> > Cc: Mikulas Patocka <mpatocka@redhat.com> > Cc: Rob Clark <robdclark@gmail.com> > --- > drivers/video/fbdev/core/fbcon.c | 5 ++--- > drivers/video/fbdev/core/fbmem.c | 3 --- > drivers/video/fbdev/core/fbsysfs.c | 2 -- > 3 files changed, 2 insertions(+), 8 deletions(-) > > diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c > index f85d794a3bee..c1a7476e980f 100644 > --- a/drivers/video/fbdev/core/fbcon.c > +++ b/drivers/video/fbdev/core/fbcon.c > @@ -2382,9 +2382,8 @@ static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch) > fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW); > ops->cursor_flash = (!blank); > > - if (!(info->flags & FBINFO_MISC_USEREVENT)) > - if (fb_blank(info, blank)) > - fbcon_generic_blank(vc, info, blank); > + if (fb_blank(info, blank)) > + fbcon_generic_blank(vc, info, blank); > } > > if (!blank) > diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c > index 7f95c7e80155..65a075ccac4a 100644 > --- a/drivers/video/fbdev/core/fbmem.c > +++ b/drivers/video/fbdev/core/fbmem.c > @@ -1194,10 +1194,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, > case FBIOBLANK: > console_lock(); > lock_fb_info(info); > - info->flags |= FBINFO_MISC_USEREVENT; > ret = fb_blank(info, arg); > - info->flags &= ~FBINFO_MISC_USEREVENT; > - > /* might again call into fb_blank */ > fbcon_fb_blanked(info, arg); > unlock_fb_info(info); > diff --git a/drivers/video/fbdev/core/fbsysfs.c b/drivers/video/fbdev/core/fbsysfs.c > index 252d4f52d2a5..882b471d619e 100644 > --- a/drivers/video/fbdev/core/fbsysfs.c > +++ b/drivers/video/fbdev/core/fbsysfs.c > @@ -310,9 +310,7 @@ static ssize_t store_blank(struct device *device, > > arg = simple_strtoul(buf, &last, 0); > console_lock(); > - fb_info->flags |= FBINFO_MISC_USEREVENT; > err = fb_blank(fb_info, arg); > - fb_info->flags &= ~FBINFO_MISC_USEREVENT; > /* might again call into fb_blank */ > fbcon_fb_blanked(fb_info, arg); > console_unlock(); > -- > 2.20.1 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Daniel. > With the recursion broken in the previous patch we can drop the > FBINFO_MISC_USEREVENT flag around calls to fb_blank - recursion > prevention was it's only job. > When grepping for FBINFO_MISC_USEREVENT I get a few hits not addressed in the patch below: drivers/video/fbdev/core/fbcon.c: if (!(info->flags & FBINFO_MISC_USEREVENT)) drivers/video/fbdev/core/fbmem.c: if (!ret && (flags & FBINFO_MISC_USEREVENT)) { drivers/video/fbdev/core/fbmem.c: info->flags &= ~FBINFO_MISC_USEREVENT; drivers/video/fbdev/core/fbmem.c: info->flags |= FBINFO_MISC_USEREVENT; drivers/video/fbdev/core/fbmem.c: info->flags &= ~FBINFO_MISC_USEREVENT; drivers/video/fbdev/core/fbmem.c: info->flags |= FBINFO_MISC_USEREVENT; drivers/video/fbdev/core/fbmem.c: info->flags &= ~FBINFO_MISC_USEREVENT; drivers/video/fbdev/core/fbsysfs.c: fb_info->flags |= FBINFO_MISC_USEREVENT; drivers/video/fbdev/core/fbsysfs.c: fb_info->flags &= ~FBINFO_MISC_USEREVENT; drivers/video/fbdev/core/fbsysfs.c: fb_info->flags |= FBINFO_MISC_USEREVENT; drivers/video/fbdev/core/fbsysfs.c: fb_info->flags &= ~FBINFO_MISC_USEREVENT; drivers/video/fbdev/ps3fb.c: info->flags |= FBINFO_MISC_USEREVENT; drivers/video/fbdev/ps3fb.c: info->flags &= ~FBINFO_MISC_USEREVENT; drivers/video/fbdev/sh_mobile_lcdcfb.c: * FBINFO_MISC_USEREVENT flag is set. Since we do not want to fake a include/linux/fb.h:#define FBINFO_MISC_USEREVENT 0x10000 /* event request The use in ps3fb looks like a candidate for removal and this file is not touch in this patch series, so I guess I did not miss it. As I did not apply the full series maybe some of the other users was already taken care of. Sam > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch> > Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> > Cc: Hans de Goede <hdegoede@redhat.com> > Cc: Yisheng Xie <ysxie@foxmail.com> > Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> > Cc: Peter Rosin <peda@axentia.se> > Cc: Mikulas Patocka <mpatocka@redhat.com> > Cc: Rob Clark <robdclark@gmail.com> > --- > drivers/video/fbdev/core/fbcon.c | 5 ++--- > drivers/video/fbdev/core/fbmem.c | 3 --- > drivers/video/fbdev/core/fbsysfs.c | 2 -- > 3 files changed, 2 insertions(+), 8 deletions(-) > > diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c > index f85d794a3bee..c1a7476e980f 100644 > --- a/drivers/video/fbdev/core/fbcon.c > +++ b/drivers/video/fbdev/core/fbcon.c > @@ -2382,9 +2382,8 @@ static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch) > fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW); > ops->cursor_flash = (!blank); > > - if (!(info->flags & FBINFO_MISC_USEREVENT)) > - if (fb_blank(info, blank)) > - fbcon_generic_blank(vc, info, blank); > + if (fb_blank(info, blank)) > + fbcon_generic_blank(vc, info, blank); > } > > if (!blank) > diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c > index 7f95c7e80155..65a075ccac4a 100644 > --- a/drivers/video/fbdev/core/fbmem.c > +++ b/drivers/video/fbdev/core/fbmem.c > @@ -1194,10 +1194,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, > case FBIOBLANK: > console_lock(); > lock_fb_info(info); > - info->flags |= FBINFO_MISC_USEREVENT; > ret = fb_blank(info, arg); > - info->flags &= ~FBINFO_MISC_USEREVENT; > - > /* might again call into fb_blank */ > fbcon_fb_blanked(info, arg); > unlock_fb_info(info); > diff --git a/drivers/video/fbdev/core/fbsysfs.c b/drivers/video/fbdev/core/fbsysfs.c > index 252d4f52d2a5..882b471d619e 100644 > --- a/drivers/video/fbdev/core/fbsysfs.c > +++ b/drivers/video/fbdev/core/fbsysfs.c > @@ -310,9 +310,7 @@ static ssize_t store_blank(struct device *device, > > arg = simple_strtoul(buf, &last, 0); > console_lock(); > - fb_info->flags |= FBINFO_MISC_USEREVENT; > err = fb_blank(fb_info, arg); > - fb_info->flags &= ~FBINFO_MISC_USEREVENT; > /* might again call into fb_blank */ > fbcon_fb_blanked(fb_info, arg); > console_unlock(); > -- > 2.20.1 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
On Mon, May 20, 2019 at 7:08 PM Sam Ravnborg <sam@ravnborg.org> wrote: > > Hi Daniel. > > While browsing this nice patch series I stumbled upon a detail. > > On Mon, May 20, 2019 at 10:21:53AM +0200, Daniel Vetter wrote: > > With > > > > commit 6104c37094e729f3d4ce65797002112735d49cd1 > > Author: Daniel Vetter <daniel.vetter@ffwll.ch> > > Date: Tue Aug 1 17:32:07 2017 +0200 > > > > fbcon: Make fbcon a built-time depency for fbdev > > > > we have a static dependency between fbcon and fbdev, and we can > > replace the indirection through the notifier chain with a function > > call. > > > > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> > > Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> > > Cc: Daniel Vetter <daniel.vetter@ffwll.ch> > > Cc: Hans de Goede <hdegoede@redhat.com> > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > > Cc: "Noralf Trønnes" <noralf@tronnes.org> > > Cc: Yisheng Xie <ysxie@foxmail.com> > > Cc: Peter Rosin <peda@axentia.se> > > Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> > > Cc: Thomas Zimmermann <tzimmermann@suse.de> > > Cc: Mikulas Patocka <mpatocka@redhat.com> > > Cc: linux-fbdev@vger.kernel.org > > --- > > diff --git a/include/linux/fb.h b/include/linux/fb.h > > index f52ef0ad6781..701abaf79c87 100644 > > --- a/include/linux/fb.h > > +++ b/include/linux/fb.h > > @@ -136,10 +136,6 @@ struct fb_cursor_user { > > #define FB_EVENT_RESUME 0x03 > > /* An entry from the modelist was removed */ > > #define FB_EVENT_MODE_DELETE 0x04 > > -/* A driver registered itself */ > > -#define FB_EVENT_FB_REGISTERED 0x05 > > -/* A driver unregistered itself */ > > -#define FB_EVENT_FB_UNREGISTERED 0x06 > > /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ > > #define FB_EVENT_GET_CONSOLE_MAP 0x07 > > /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ > > This breaks build of arch/arm/mach-pxa/am200epd.c thats uses > FB_EVENT_FB_*REGISTERED: > > > if (event == FB_EVENT_FB_REGISTERED) > return am200_share_video_mem(info); > else if (event == FB_EVENT_FB_UNREGISTERED) > return am200_unshare_video_mem(info); > > > Found while grepping for "FB_EVENT" so this is not a build > error I triggered. Oh this is glorious :-/ Thanks a lot for spotting this, I guess I need to hack around on metronomefb a bit ... -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
On Mon, May 20, 2019 at 7:08 PM Sam Ravnborg <sam@ravnborg.org> wrote: > > Hi Daniel. > > While browsing this nice patch series I stumbled upon a detail. > > On Mon, May 20, 2019 at 10:21:53AM +0200, Daniel Vetter wrote: > > With > > > > commit 6104c37094e729f3d4ce65797002112735d49cd1 > > Author: Daniel Vetter <daniel.vetter@ffwll.ch> > > Date: Tue Aug 1 17:32:07 2017 +0200 > > > > fbcon: Make fbcon a built-time depency for fbdev > > > > we have a static dependency between fbcon and fbdev, and we can > > replace the indirection through the notifier chain with a function > > call. > > > > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> > > Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> > > Cc: Daniel Vetter <daniel.vetter@ffwll.ch> > > Cc: Hans de Goede <hdegoede@redhat.com> > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > > Cc: "Noralf Trønnes" <noralf@tronnes.org> > > Cc: Yisheng Xie <ysxie@foxmail.com> > > Cc: Peter Rosin <peda@axentia.se> > > Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> > > Cc: Thomas Zimmermann <tzimmermann@suse.de> > > Cc: Mikulas Patocka <mpatocka@redhat.com> > > Cc: linux-fbdev@vger.kernel.org > > --- > > diff --git a/include/linux/fb.h b/include/linux/fb.h > > index f52ef0ad6781..701abaf79c87 100644 > > --- a/include/linux/fb.h > > +++ b/include/linux/fb.h > > @@ -136,10 +136,6 @@ struct fb_cursor_user { > > #define FB_EVENT_RESUME 0x03 > > /* An entry from the modelist was removed */ > > #define FB_EVENT_MODE_DELETE 0x04 > > -/* A driver registered itself */ > > -#define FB_EVENT_FB_REGISTERED 0x05 > > -/* A driver unregistered itself */ > > -#define FB_EVENT_FB_UNREGISTERED 0x06 > > /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ > > #define FB_EVENT_GET_CONSOLE_MAP 0x07 > > /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ > > This breaks build of arch/arm/mach-pxa/am200epd.c thats uses > FB_EVENT_FB_*REGISTERED: > > > if (event == FB_EVENT_FB_REGISTERED) > return am200_share_video_mem(info); > else if (event == FB_EVENT_FB_UNREGISTERED) > return am200_unshare_video_mem(info); > > > Found while grepping for "FB_EVENT" so this is not a build > error I triggered. Oh this is glorious :-/ Thanks a lot for spotting this, I guess I need to hack around on metronomefb a bit ... -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
On Mon, May 20, 2019 at 7:20 PM Sam Ravnborg <sam@ravnborg.org> wrote: > > Hi Daniel. > > > With the recursion broken in the previous patch we can drop the > > FBINFO_MISC_USEREVENT flag around calls to fb_blank - recursion > > prevention was it's only job. > > > When grepping for FBINFO_MISC_USEREVENT I get a few hits not addressed > in the patch below: > > drivers/video/fbdev/core/fbcon.c: if (!(info->flags & FBINFO_MISC_USEREVENT)) > drivers/video/fbdev/core/fbmem.c: if (!ret && (flags & FBINFO_MISC_USEREVENT)) { > drivers/video/fbdev/core/fbmem.c: info->flags &= ~FBINFO_MISC_USEREVENT; > drivers/video/fbdev/core/fbmem.c: info->flags |= FBINFO_MISC_USEREVENT; > drivers/video/fbdev/core/fbmem.c: info->flags &= ~FBINFO_MISC_USEREVENT; > drivers/video/fbdev/core/fbmem.c: info->flags |= FBINFO_MISC_USEREVENT; > drivers/video/fbdev/core/fbmem.c: info->flags &= ~FBINFO_MISC_USEREVENT; > drivers/video/fbdev/core/fbsysfs.c: fb_info->flags |= FBINFO_MISC_USEREVENT; > drivers/video/fbdev/core/fbsysfs.c: fb_info->flags &= ~FBINFO_MISC_USEREVENT; > drivers/video/fbdev/core/fbsysfs.c: fb_info->flags |= FBINFO_MISC_USEREVENT; > drivers/video/fbdev/core/fbsysfs.c: fb_info->flags &= ~FBINFO_MISC_USEREVENT; > drivers/video/fbdev/ps3fb.c: info->flags |= FBINFO_MISC_USEREVENT; > drivers/video/fbdev/ps3fb.c: info->flags &= ~FBINFO_MISC_USEREVENT; > drivers/video/fbdev/sh_mobile_lcdcfb.c: * FBINFO_MISC_USEREVENT flag is set. Since we do not want to fake a > include/linux/fb.h:#define FBINFO_MISC_USEREVENT 0x10000 /* event request > > The use in ps3fb looks like a candidate for removal and this file is not > touch in this patch series, so I guess I did not miss it. > > As I did not apply the full series maybe some of the other users was > already taken care of. It's also used to break recursion around fb_set_par and fb_set_pan. Untangling that one would be possible, but also requires untangling some locking, so a lot more work. If you chase all the call paths then you'll noticed that the users still left have no overlap with the ones I'm removing here. -Daniel > > > Sam > > > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> > > Cc: Daniel Vetter <daniel.vetter@ffwll.ch> > > Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> > > Cc: Hans de Goede <hdegoede@redhat.com> > > Cc: Yisheng Xie <ysxie@foxmail.com> > > Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> > > Cc: Peter Rosin <peda@axentia.se> > > Cc: Mikulas Patocka <mpatocka@redhat.com> > > Cc: Rob Clark <robdclark@gmail.com> > > --- > > drivers/video/fbdev/core/fbcon.c | 5 ++--- > > drivers/video/fbdev/core/fbmem.c | 3 --- > > drivers/video/fbdev/core/fbsysfs.c | 2 -- > > 3 files changed, 2 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c > > index f85d794a3bee..c1a7476e980f 100644 > > --- a/drivers/video/fbdev/core/fbcon.c > > +++ b/drivers/video/fbdev/core/fbcon.c > > @@ -2382,9 +2382,8 @@ static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch) > > fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW); > > ops->cursor_flash = (!blank); > > > > - if (!(info->flags & FBINFO_MISC_USEREVENT)) > > - if (fb_blank(info, blank)) > > - fbcon_generic_blank(vc, info, blank); > > + if (fb_blank(info, blank)) > > + fbcon_generic_blank(vc, info, blank); > > } > > > > if (!blank) > > diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c > > index 7f95c7e80155..65a075ccac4a 100644 > > --- a/drivers/video/fbdev/core/fbmem.c > > +++ b/drivers/video/fbdev/core/fbmem.c > > @@ -1194,10 +1194,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, > > case FBIOBLANK: > > console_lock(); > > lock_fb_info(info); > > - info->flags |= FBINFO_MISC_USEREVENT; > > ret = fb_blank(info, arg); > > - info->flags &= ~FBINFO_MISC_USEREVENT; > > - > > /* might again call into fb_blank */ > > fbcon_fb_blanked(info, arg); > > unlock_fb_info(info); > > diff --git a/drivers/video/fbdev/core/fbsysfs.c b/drivers/video/fbdev/core/fbsysfs.c > > index 252d4f52d2a5..882b471d619e 100644 > > --- a/drivers/video/fbdev/core/fbsysfs.c > > +++ b/drivers/video/fbdev/core/fbsysfs.c > > @@ -310,9 +310,7 @@ static ssize_t store_blank(struct device *device, > > > > arg = simple_strtoul(buf, &last, 0); > > console_lock(); > > - fb_info->flags |= FBINFO_MISC_USEREVENT; > > err = fb_blank(fb_info, arg); > > - fb_info->flags &= ~FBINFO_MISC_USEREVENT; > > /* might again call into fb_blank */ > > fbcon_fb_blanked(fb_info, arg); > > console_unlock(); > > -- > > 2.20.1 > > > > _______________________________________________ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
On Mon, May 20, 2019 at 7:20 PM Sam Ravnborg <sam@ravnborg.org> wrote: > > Hi Daniel. > > > With the recursion broken in the previous patch we can drop the > > FBINFO_MISC_USEREVENT flag around calls to fb_blank - recursion > > prevention was it's only job. > > > When grepping for FBINFO_MISC_USEREVENT I get a few hits not addressed > in the patch below: > > drivers/video/fbdev/core/fbcon.c: if (!(info->flags & FBINFO_MISC_USEREVENT)) > drivers/video/fbdev/core/fbmem.c: if (!ret && (flags & FBINFO_MISC_USEREVENT)) { > drivers/video/fbdev/core/fbmem.c: info->flags &= ~FBINFO_MISC_USEREVENT; > drivers/video/fbdev/core/fbmem.c: info->flags |= FBINFO_MISC_USEREVENT; > drivers/video/fbdev/core/fbmem.c: info->flags &= ~FBINFO_MISC_USEREVENT; > drivers/video/fbdev/core/fbmem.c: info->flags |= FBINFO_MISC_USEREVENT; > drivers/video/fbdev/core/fbmem.c: info->flags &= ~FBINFO_MISC_USEREVENT; > drivers/video/fbdev/core/fbsysfs.c: fb_info->flags |= FBINFO_MISC_USEREVENT; > drivers/video/fbdev/core/fbsysfs.c: fb_info->flags &= ~FBINFO_MISC_USEREVENT; > drivers/video/fbdev/core/fbsysfs.c: fb_info->flags |= FBINFO_MISC_USEREVENT; > drivers/video/fbdev/core/fbsysfs.c: fb_info->flags &= ~FBINFO_MISC_USEREVENT; > drivers/video/fbdev/ps3fb.c: info->flags |= FBINFO_MISC_USEREVENT; > drivers/video/fbdev/ps3fb.c: info->flags &= ~FBINFO_MISC_USEREVENT; > drivers/video/fbdev/sh_mobile_lcdcfb.c: * FBINFO_MISC_USEREVENT flag is set. Since we do not want to fake a > include/linux/fb.h:#define FBINFO_MISC_USEREVENT 0x10000 /* event request > > The use in ps3fb looks like a candidate for removal and this file is not > touch in this patch series, so I guess I did not miss it. > > As I did not apply the full series maybe some of the other users was > already taken care of. It's also used to break recursion around fb_set_par and fb_set_pan. Untangling that one would be possible, but also requires untangling some locking, so a lot more work. If you chase all the call paths then you'll noticed that the users still left have no overlap with the ones I'm removing here. -Daniel > > > Sam > > > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> > > Cc: Daniel Vetter <daniel.vetter@ffwll.ch> > > Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> > > Cc: Hans de Goede <hdegoede@redhat.com> > > Cc: Yisheng Xie <ysxie@foxmail.com> > > Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> > > Cc: Peter Rosin <peda@axentia.se> > > Cc: Mikulas Patocka <mpatocka@redhat.com> > > Cc: Rob Clark <robdclark@gmail.com> > > --- > > drivers/video/fbdev/core/fbcon.c | 5 ++--- > > drivers/video/fbdev/core/fbmem.c | 3 --- > > drivers/video/fbdev/core/fbsysfs.c | 2 -- > > 3 files changed, 2 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c > > index f85d794a3bee..c1a7476e980f 100644 > > --- a/drivers/video/fbdev/core/fbcon.c > > +++ b/drivers/video/fbdev/core/fbcon.c > > @@ -2382,9 +2382,8 @@ static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch) > > fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW); > > ops->cursor_flash = (!blank); > > > > - if (!(info->flags & FBINFO_MISC_USEREVENT)) > > - if (fb_blank(info, blank)) > > - fbcon_generic_blank(vc, info, blank); > > + if (fb_blank(info, blank)) > > + fbcon_generic_blank(vc, info, blank); > > } > > > > if (!blank) > > diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c > > index 7f95c7e80155..65a075ccac4a 100644 > > --- a/drivers/video/fbdev/core/fbmem.c > > +++ b/drivers/video/fbdev/core/fbmem.c > > @@ -1194,10 +1194,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, > > case FBIOBLANK: > > console_lock(); > > lock_fb_info(info); > > - info->flags |= FBINFO_MISC_USEREVENT; > > ret = fb_blank(info, arg); > > - info->flags &= ~FBINFO_MISC_USEREVENT; > > - > > /* might again call into fb_blank */ > > fbcon_fb_blanked(info, arg); > > unlock_fb_info(info); > > diff --git a/drivers/video/fbdev/core/fbsysfs.c b/drivers/video/fbdev/core/fbsysfs.c > > index 252d4f52d2a5..882b471d619e 100644 > > --- a/drivers/video/fbdev/core/fbsysfs.c > > +++ b/drivers/video/fbdev/core/fbsysfs.c > > @@ -310,9 +310,7 @@ static ssize_t store_blank(struct device *device, > > > > arg = simple_strtoul(buf, &last, 0); > > console_lock(); > > - fb_info->flags |= FBINFO_MISC_USEREVENT; > > err = fb_blank(fb_info, arg); > > - fb_info->flags &= ~FBINFO_MISC_USEREVENT; > > /* might again call into fb_blank */ > > fbcon_fb_blanked(fb_info, arg); > > console_unlock(); > > -- > > 2.20.1 > > > > _______________________________________________ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Hi Daniel.
On Mon, May 20, 2019 at 07:29:52PM +0200, Daniel Vetter wrote:
> On Mon, May 20, 2019 at 7:20 PM Sam Ravnborg <sam@ravnborg.org> wrote:
> >
> > Hi Daniel.
> >
> > > With the recursion broken in the previous patch we can drop the
> > > FBINFO_MISC_USEREVENT flag around calls to fb_blank - recursion
> > > prevention was it's only job.
> > >
> > When grepping for FBINFO_MISC_USEREVENT I get a few hits not addressed
> > in the patch below:
> >
> > drivers/video/fbdev/core/fbcon.c: if (!(info->flags & FBINFO_MISC_USEREVENT))
> > drivers/video/fbdev/core/fbmem.c: if (!ret && (flags & FBINFO_MISC_USEREVENT)) {
> > drivers/video/fbdev/core/fbmem.c: info->flags &= ~FBINFO_MISC_USEREVENT;
> > drivers/video/fbdev/core/fbmem.c: info->flags |= FBINFO_MISC_USEREVENT;
> > drivers/video/fbdev/core/fbmem.c: info->flags &= ~FBINFO_MISC_USEREVENT;
> > drivers/video/fbdev/core/fbmem.c: info->flags |= FBINFO_MISC_USEREVENT;
> > drivers/video/fbdev/core/fbmem.c: info->flags &= ~FBINFO_MISC_USEREVENT;
> > drivers/video/fbdev/core/fbsysfs.c: fb_info->flags |= FBINFO_MISC_USEREVENT;
> > drivers/video/fbdev/core/fbsysfs.c: fb_info->flags &= ~FBINFO_MISC_USEREVENT;
> > drivers/video/fbdev/core/fbsysfs.c: fb_info->flags |= FBINFO_MISC_USEREVENT;
> > drivers/video/fbdev/core/fbsysfs.c: fb_info->flags &= ~FBINFO_MISC_USEREVENT;
> > drivers/video/fbdev/ps3fb.c: info->flags |= FBINFO_MISC_USEREVENT;
> > drivers/video/fbdev/ps3fb.c: info->flags &= ~FBINFO_MISC_USEREVENT;
> > drivers/video/fbdev/sh_mobile_lcdcfb.c: * FBINFO_MISC_USEREVENT flag is set. Since we do not want to fake a
> > include/linux/fb.h:#define FBINFO_MISC_USEREVENT 0x10000 /* event request
> >
> > The use in ps3fb looks like a candidate for removal and this file is not
> > touch in this patch series, so I guess I did not miss it.
> >
> > As I did not apply the full series maybe some of the other users was
> > already taken care of.
>
> It's also used to break recursion around fb_set_par and fb_set_pan.
> Untangling that one would be possible, but also requires untangling
> some locking, so a lot more work. If you chase all the call paths then
> you'll noticed that the users still left have no overlap with the ones
> I'm removing here.
Now you spell it out it is obvious. I guess I never read more than fb_
and missed that we are dealing with different calls.
Thanks for the quick feedback, and sorry for the noise.
Sam
[-- Attachment #1: Type: text/plain, Size: 3463 bytes --] Hi Daniel, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v5.2-rc1 next-20190520] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Daniel-Vetter/fbcon-notifier-begone/20190521-021841 config: x86_64-randconfig-x004-201920 (attached as .config) compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 If you fix the issue, kindly add following tag Reported-by: kbuild test robot <lkp@intel.com> All errors (new ones prefixed by >>): drivers/video/fbdev/neofb.c: In function 'neofb_remove': >> drivers/video/fbdev/neofb.c:2130:7: error: void value not ignored as it ought to be if (unregister_framebuffer(info)) ^~~~~~~~~~~~~~~~~~~~~~ vim +2130 drivers/video/fbdev/neofb.c ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2117 48c68c4f drivers/video/neofb.c Greg Kroah-Hartman 2012-12-21 2118 static void neofb_remove(struct pci_dev *dev) ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2119 { ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2120 struct fb_info *info = pci_get_drvdata(dev); ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2121 ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2122 DBG("neofb_remove"); ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2123 ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2124 if (info) { ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2125 /* ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2126 * If unregister_framebuffer fails, then ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2127 * we will be leaving hooks that could cause ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2128 * oopsen laying around. ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2129 */ ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 @2130 if (unregister_framebuffer(info)) ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2131 printk(KERN_WARNING ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2132 "neofb: danger danger! Oopsen imminent!\n"); ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2133 ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2134 neo_unmap_video(info); ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2135 fb_destroy_modedb(info->monspecs.modedb); ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2136 neo_unmap_mmio(info); ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2137 neo_free_fb_info(info); ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2138 } ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2139 } ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2140 :::::: The code at line 2130 was first introduced by commit :::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2 :::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org> :::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation [-- Attachment #2: .config.gz --] [-- Type: application/gzip, Size: 30860 bytes --]
[-- Attachment #1: Type: text/plain, Size: 3463 bytes --] Hi Daniel, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v5.2-rc1 next-20190520] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Daniel-Vetter/fbcon-notifier-begone/20190521-021841 config: x86_64-randconfig-x004-201920 (attached as .config) compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 If you fix the issue, kindly add following tag Reported-by: kbuild test robot <lkp@intel.com> All errors (new ones prefixed by >>): drivers/video/fbdev/neofb.c: In function 'neofb_remove': >> drivers/video/fbdev/neofb.c:2130:7: error: void value not ignored as it ought to be if (unregister_framebuffer(info)) ^~~~~~~~~~~~~~~~~~~~~~ vim +2130 drivers/video/fbdev/neofb.c ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2117 48c68c4f drivers/video/neofb.c Greg Kroah-Hartman 2012-12-21 2118 static void neofb_remove(struct pci_dev *dev) ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2119 { ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2120 struct fb_info *info = pci_get_drvdata(dev); ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2121 ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2122 DBG("neofb_remove"); ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2123 ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2124 if (info) { ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2125 /* ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2126 * If unregister_framebuffer fails, then ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2127 * we will be leaving hooks that could cause ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2128 * oopsen laying around. ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2129 */ ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 @2130 if (unregister_framebuffer(info)) ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2131 printk(KERN_WARNING ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2132 "neofb: danger danger! Oopsen imminent!\n"); ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2133 ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2134 neo_unmap_video(info); ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2135 fb_destroy_modedb(info->monspecs.modedb); ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2136 neo_unmap_mmio(info); ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2137 neo_free_fb_info(info); ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2138 } ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2139 } ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2140 :::::: The code at line 2130 was first introduced by commit :::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2 :::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org> :::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation [-- Attachment #2: .config.gz --] [-- Type: application/gzip, Size: 30860 bytes --]
[-- Attachment #1: Type: text/plain, Size: 3463 bytes --] Hi Daniel, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v5.2-rc1 next-20190520] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Daniel-Vetter/fbcon-notifier-begone/20190521-021841 config: x86_64-randconfig-x004-201920 (attached as .config) compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 If you fix the issue, kindly add following tag Reported-by: kbuild test robot <lkp@intel.com> All errors (new ones prefixed by >>): drivers/video/fbdev/neofb.c: In function 'neofb_remove': >> drivers/video/fbdev/neofb.c:2130:7: error: void value not ignored as it ought to be if (unregister_framebuffer(info)) ^~~~~~~~~~~~~~~~~~~~~~ vim +2130 drivers/video/fbdev/neofb.c ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2117 48c68c4f drivers/video/neofb.c Greg Kroah-Hartman 2012-12-21 2118 static void neofb_remove(struct pci_dev *dev) ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2119 { ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2120 struct fb_info *info = pci_get_drvdata(dev); ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2121 ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2122 DBG("neofb_remove"); ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2123 ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2124 if (info) { ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2125 /* ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2126 * If unregister_framebuffer fails, then ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2127 * we will be leaving hooks that could cause ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2128 * oopsen laying around. ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2129 */ ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 @2130 if (unregister_framebuffer(info)) ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2131 printk(KERN_WARNING ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2132 "neofb: danger danger! Oopsen imminent!\n"); ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2133 ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2134 neo_unmap_video(info); ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2135 fb_destroy_modedb(info->monspecs.modedb); ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2136 neo_unmap_mmio(info); ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2137 neo_free_fb_info(info); ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2138 } ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2139 } ^1da177e drivers/video/neofb.c Linus Torvalds 2005-04-16 2140 :::::: The code at line 2130 was first introduced by commit :::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2 :::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org> :::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation [-- Attachment #2: .config.gz --] [-- Type: application/gzip, Size: 30860 bytes --]
[-- Attachment #1: Type: text/plain, Size: 2394 bytes --] Hi Daniel, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v5.2-rc1 next-20190520] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Daniel-Vetter/fbcon-notifier-begone/20190521-021841 config: x86_64-randconfig-x006-201920 (attached as .config) compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 If you fix the issue, kindly add following tag Reported-by: kbuild test robot <lkp@intel.com> All errors (new ones prefixed by >>): drivers/video/fbdev/core/fbmem.c: In function 'fb_set_suspend': >> drivers/video/fbdev/core/fbmem.c:1908:3: error: too many arguments to function 'fbcon_suspended' fbcon_suspended(info); ^~~~~~~~~~~~~~~ In file included from drivers/video/fbdev/core/fbmem.c:35:0: include/linux/fbcon.h:18:20: note: declared here static inline void fbcon_suspended(void) {} ^~~~~~~~~~~~~~~ >> drivers/video/fbdev/core/fbmem.c:1912:3: error: too many arguments to function 'fbcon_resumed' fbcon_resumed(info); ^~~~~~~~~~~~~ In file included from drivers/video/fbdev/core/fbmem.c:35:0: include/linux/fbcon.h:19:20: note: declared here static inline void fbcon_resumed(void) {} ^~~~~~~~~~~~~ vim +/fbcon_suspended +1908 drivers/video/fbdev/core/fbmem.c 1893 1894 /** 1895 * fb_set_suspend - low level driver signals suspend 1896 * @info: framebuffer affected 1897 * @state: 0 = resuming, !=0 = suspending 1898 * 1899 * This is meant to be used by low level drivers to 1900 * signal suspend/resume to the core & clients. 1901 * It must be called with the console semaphore held 1902 */ 1903 void fb_set_suspend(struct fb_info *info, int state) 1904 { 1905 WARN_CONSOLE_UNLOCKED(); 1906 1907 if (state) { > 1908 fbcon_suspended(info); 1909 info->state = FBINFO_STATE_SUSPENDED; 1910 } else { 1911 info->state = FBINFO_STATE_RUNNING; > 1912 fbcon_resumed(info); 1913 } 1914 } 1915 EXPORT_SYMBOL(fb_set_suspend); 1916 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation [-- Attachment #2: .config.gz --] [-- Type: application/gzip, Size: 26895 bytes --]
[-- Attachment #1: Type: text/plain, Size: 2394 bytes --] Hi Daniel, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v5.2-rc1 next-20190520] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Daniel-Vetter/fbcon-notifier-begone/20190521-021841 config: x86_64-randconfig-x006-201920 (attached as .config) compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 If you fix the issue, kindly add following tag Reported-by: kbuild test robot <lkp@intel.com> All errors (new ones prefixed by >>): drivers/video/fbdev/core/fbmem.c: In function 'fb_set_suspend': >> drivers/video/fbdev/core/fbmem.c:1908:3: error: too many arguments to function 'fbcon_suspended' fbcon_suspended(info); ^~~~~~~~~~~~~~~ In file included from drivers/video/fbdev/core/fbmem.c:35:0: include/linux/fbcon.h:18:20: note: declared here static inline void fbcon_suspended(void) {} ^~~~~~~~~~~~~~~ >> drivers/video/fbdev/core/fbmem.c:1912:3: error: too many arguments to function 'fbcon_resumed' fbcon_resumed(info); ^~~~~~~~~~~~~ In file included from drivers/video/fbdev/core/fbmem.c:35:0: include/linux/fbcon.h:19:20: note: declared here static inline void fbcon_resumed(void) {} ^~~~~~~~~~~~~ vim +/fbcon_suspended +1908 drivers/video/fbdev/core/fbmem.c 1893 1894 /** 1895 * fb_set_suspend - low level driver signals suspend 1896 * @info: framebuffer affected 1897 * @state: 0 = resuming, !=0 = suspending 1898 * 1899 * This is meant to be used by low level drivers to 1900 * signal suspend/resume to the core & clients. 1901 * It must be called with the console semaphore held 1902 */ 1903 void fb_set_suspend(struct fb_info *info, int state) 1904 { 1905 WARN_CONSOLE_UNLOCKED(); 1906 1907 if (state) { > 1908 fbcon_suspended(info); 1909 info->state = FBINFO_STATE_SUSPENDED; 1910 } else { 1911 info->state = FBINFO_STATE_RUNNING; > 1912 fbcon_resumed(info); 1913 } 1914 } 1915 EXPORT_SYMBOL(fb_set_suspend); 1916 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation [-- Attachment #2: .config.gz --] [-- Type: application/gzip, Size: 26895 bytes --]
[-- Attachment #1: Type: text/plain, Size: 2394 bytes --] Hi Daniel, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v5.2-rc1 next-20190520] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Daniel-Vetter/fbcon-notifier-begone/20190521-021841 config: x86_64-randconfig-x006-201920 (attached as .config) compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 If you fix the issue, kindly add following tag Reported-by: kbuild test robot <lkp@intel.com> All errors (new ones prefixed by >>): drivers/video/fbdev/core/fbmem.c: In function 'fb_set_suspend': >> drivers/video/fbdev/core/fbmem.c:1908:3: error: too many arguments to function 'fbcon_suspended' fbcon_suspended(info); ^~~~~~~~~~~~~~~ In file included from drivers/video/fbdev/core/fbmem.c:35:0: include/linux/fbcon.h:18:20: note: declared here static inline void fbcon_suspended(void) {} ^~~~~~~~~~~~~~~ >> drivers/video/fbdev/core/fbmem.c:1912:3: error: too many arguments to function 'fbcon_resumed' fbcon_resumed(info); ^~~~~~~~~~~~~ In file included from drivers/video/fbdev/core/fbmem.c:35:0: include/linux/fbcon.h:19:20: note: declared here static inline void fbcon_resumed(void) {} ^~~~~~~~~~~~~ vim +/fbcon_suspended +1908 drivers/video/fbdev/core/fbmem.c 1893 1894 /** 1895 * fb_set_suspend - low level driver signals suspend 1896 * @info: framebuffer affected 1897 * @state: 0 = resuming, !=0 = suspending 1898 * 1899 * This is meant to be used by low level drivers to 1900 * signal suspend/resume to the core & clients. 1901 * It must be called with the console semaphore held 1902 */ 1903 void fb_set_suspend(struct fb_info *info, int state) 1904 { 1905 WARN_CONSOLE_UNLOCKED(); 1906 1907 if (state) { > 1908 fbcon_suspended(info); 1909 info->state = FBINFO_STATE_SUSPENDED; 1910 } else { 1911 info->state = FBINFO_STATE_RUNNING; > 1912 fbcon_resumed(info); 1913 } 1914 } 1915 EXPORT_SYMBOL(fb_set_suspend); 1916 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation [-- Attachment #2: .config.gz --] [-- Type: application/gzip, Size: 26895 bytes --] [-- Attachment #3: Type: text/plain, Size: 159 bytes --] _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[-- Attachment #1: Type: text/plain, Size: 3216 bytes --] Hi Daniel, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v5.2-rc1 next-20190520] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Daniel-Vetter/fbcon-notifier-begone/20190521-021841 config: x86_64-randconfig-x003-201920 (attached as .config) compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 If you fix the issue, kindly add following tag Reported-by: kbuild test robot <lkp@intel.com> All errors (new ones prefixed by >>): drivers/video/fbdev/savage/savagefb_driver.c: In function 'savagefb_remove': >> drivers/video/fbdev/savage/savagefb_driver.c:2341:7: error: void value not ignored as it ought to be if (unregister_framebuffer(info)) ^~~~~~~~~~~~~~~~~~~~~~ vim +2341 drivers/video/fbdev/savage/savagefb_driver.c ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2328 48c68c4f drivers/video/savage/savagefb_driver.c Greg Kroah-Hartman 2012-12-21 2329 static void savagefb_remove(struct pci_dev *dev) ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2330 { b8901b09 drivers/video/savage/savagefb_driver.c Antonino A. Daplas 2006-01-09 2331 struct fb_info *info = pci_get_drvdata(dev); ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2332 ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2333 DBG("savagefb_remove"); ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2334 ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2335 if (info) { ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2336 /* ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2337 * If unregister_framebuffer fails, then ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2338 * we will be leaving hooks that could cause ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2339 * oopsen laying around. ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2340 */ ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 @2341 if (unregister_framebuffer(info)) ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2342 printk(KERN_WARNING "savagefb: danger danger! " ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2343 "Oopsen imminent!\n"); ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2344 :::::: The code at line 2341 was first introduced by commit :::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2 :::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org> :::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation [-- Attachment #2: .config.gz --] [-- Type: application/gzip, Size: 35839 bytes --]
[-- Attachment #1: Type: text/plain, Size: 3216 bytes --] Hi Daniel, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v5.2-rc1 next-20190520] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Daniel-Vetter/fbcon-notifier-begone/20190521-021841 config: x86_64-randconfig-x003-201920 (attached as .config) compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 If you fix the issue, kindly add following tag Reported-by: kbuild test robot <lkp@intel.com> All errors (new ones prefixed by >>): drivers/video/fbdev/savage/savagefb_driver.c: In function 'savagefb_remove': >> drivers/video/fbdev/savage/savagefb_driver.c:2341:7: error: void value not ignored as it ought to be if (unregister_framebuffer(info)) ^~~~~~~~~~~~~~~~~~~~~~ vim +2341 drivers/video/fbdev/savage/savagefb_driver.c ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2328 48c68c4f drivers/video/savage/savagefb_driver.c Greg Kroah-Hartman 2012-12-21 2329 static void savagefb_remove(struct pci_dev *dev) ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2330 { b8901b09 drivers/video/savage/savagefb_driver.c Antonino A. Daplas 2006-01-09 2331 struct fb_info *info = pci_get_drvdata(dev); ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2332 ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2333 DBG("savagefb_remove"); ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2334 ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2335 if (info) { ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2336 /* ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2337 * If unregister_framebuffer fails, then ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2338 * we will be leaving hooks that could cause ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2339 * oopsen laying around. ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2340 */ ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 @2341 if (unregister_framebuffer(info)) ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2342 printk(KERN_WARNING "savagefb: danger danger! " ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2343 "Oopsen imminent!\n"); ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2344 :::::: The code at line 2341 was first introduced by commit :::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2 :::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org> :::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation [-- Attachment #2: .config.gz --] [-- Type: application/gzip, Size: 35839 bytes --]
[-- Attachment #1: Type: text/plain, Size: 3216 bytes --] Hi Daniel, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v5.2-rc1 next-20190520] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Daniel-Vetter/fbcon-notifier-begone/20190521-021841 config: x86_64-randconfig-x003-201920 (attached as .config) compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 If you fix the issue, kindly add following tag Reported-by: kbuild test robot <lkp@intel.com> All errors (new ones prefixed by >>): drivers/video/fbdev/savage/savagefb_driver.c: In function 'savagefb_remove': >> drivers/video/fbdev/savage/savagefb_driver.c:2341:7: error: void value not ignored as it ought to be if (unregister_framebuffer(info)) ^~~~~~~~~~~~~~~~~~~~~~ vim +2341 drivers/video/fbdev/savage/savagefb_driver.c ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2328 48c68c4f drivers/video/savage/savagefb_driver.c Greg Kroah-Hartman 2012-12-21 2329 static void savagefb_remove(struct pci_dev *dev) ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2330 { b8901b09 drivers/video/savage/savagefb_driver.c Antonino A. Daplas 2006-01-09 2331 struct fb_info *info = pci_get_drvdata(dev); ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2332 ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2333 DBG("savagefb_remove"); ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2334 ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2335 if (info) { ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2336 /* ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2337 * If unregister_framebuffer fails, then ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2338 * we will be leaving hooks that could cause ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2339 * oopsen laying around. ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2340 */ ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 @2341 if (unregister_framebuffer(info)) ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2342 printk(KERN_WARNING "savagefb: danger danger! " ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2343 "Oopsen imminent!\n"); ^1da177e drivers/video/savage/savagefb_driver.c Linus Torvalds 2005-04-16 2344 :::::: The code at line 2341 was first introduced by commit :::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2 :::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org> :::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation [-- Attachment #2: .config.gz --] [-- Type: application/gzip, Size: 35839 bytes --] [-- Attachment #3: Type: text/plain, Size: 159 bytes --] _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[-- Attachment #1: Type: text/plain, Size: 3059 bytes --] Hi Daniel, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v5.2-rc1 next-20190520] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Daniel-Vetter/fbcon-notifier-begone/20190521-021841 config: sparc64-allyesconfig (attached as .config) compiler: sparc64-linux-gcc (GCC) 8.1.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree GCC_VERSION=8.1.0 make.cross ARCH=sparc64 If you fix the issue, kindly add following tag Reported-by: kbuild test robot <lkp@intel.com> All errors (new ones prefixed by >>): drivers/video/fbdev/core/fbcon.c: In function 'fbcon_set_con2fb_map_ioctl': >> drivers/video/fbdev/core/fbcon.c:3323:6: error: implicit declaration of function 'copy_from_user'; did you mean 'copy_creds'? [-Werror=implicit-function-declaration] if (copy_from_user(&con2fb, argp, sizeof(con2fb))) ^~~~~~~~~~~~~~ copy_creds drivers/video/fbdev/core/fbcon.c: In function 'fbcon_get_con2fb_map_ioctl': >> drivers/video/fbdev/core/fbcon.c:3356:9: error: implicit declaration of function 'copy_to_user'; did you mean 'cpu_to_mem'? [-Werror=implicit-function-declaration] return copy_to_user(argp, &con2fb, sizeof(con2fb)) ? -EFAULT : 0; ^~~~~~~~~~~~ cpu_to_mem cc1: some warnings being treated as errors vim +3323 drivers/video/fbdev/core/fbcon.c 3317 3318 int fbcon_set_con2fb_map_ioctl(void __user *argp) 3319 { 3320 struct fb_con2fbmap con2fb; 3321 int ret; 3322 > 3323 if (copy_from_user(&con2fb, argp, sizeof(con2fb))) 3324 return -EFAULT; 3325 if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES) 3326 return -EINVAL; 3327 if (con2fb.framebuffer >= FB_MAX) 3328 return -EINVAL; 3329 if (!registered_fb[con2fb.framebuffer]) 3330 request_module("fb%d", con2fb.framebuffer); 3331 if (!registered_fb[con2fb.framebuffer]) { 3332 return -EINVAL; 3333 } 3334 3335 console_lock(); 3336 ret = set_con2fb_map(con2fb.console - 1, 3337 con2fb.framebuffer, 1); 3338 console_unlock(); 3339 3340 return ret; 3341 } 3342 3343 int fbcon_get_con2fb_map_ioctl(void __user *argp) 3344 { 3345 struct fb_con2fbmap con2fb; 3346 3347 if (copy_from_user(&con2fb, argp, sizeof(con2fb))) 3348 return -EFAULT; 3349 if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES) 3350 return -EINVAL; 3351 3352 console_lock(); 3353 con2fb.framebuffer = con2fb_map[con2fb.console - 1]; 3354 console_unlock(); 3355 > 3356 return copy_to_user(argp, &con2fb, sizeof(con2fb)) ? -EFAULT : 0; 3357 } 3358 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation [-- Attachment #2: .config.gz --] [-- Type: application/gzip, Size: 58532 bytes --]
[-- Attachment #1: Type: text/plain, Size: 3059 bytes --] Hi Daniel, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v5.2-rc1 next-20190520] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Daniel-Vetter/fbcon-notifier-begone/20190521-021841 config: sparc64-allyesconfig (attached as .config) compiler: sparc64-linux-gcc (GCC) 8.1.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree GCC_VERSION=8.1.0 make.cross ARCH=sparc64 If you fix the issue, kindly add following tag Reported-by: kbuild test robot <lkp@intel.com> All errors (new ones prefixed by >>): drivers/video/fbdev/core/fbcon.c: In function 'fbcon_set_con2fb_map_ioctl': >> drivers/video/fbdev/core/fbcon.c:3323:6: error: implicit declaration of function 'copy_from_user'; did you mean 'copy_creds'? [-Werror=implicit-function-declaration] if (copy_from_user(&con2fb, argp, sizeof(con2fb))) ^~~~~~~~~~~~~~ copy_creds drivers/video/fbdev/core/fbcon.c: In function 'fbcon_get_con2fb_map_ioctl': >> drivers/video/fbdev/core/fbcon.c:3356:9: error: implicit declaration of function 'copy_to_user'; did you mean 'cpu_to_mem'? [-Werror=implicit-function-declaration] return copy_to_user(argp, &con2fb, sizeof(con2fb)) ? -EFAULT : 0; ^~~~~~~~~~~~ cpu_to_mem cc1: some warnings being treated as errors vim +3323 drivers/video/fbdev/core/fbcon.c 3317 3318 int fbcon_set_con2fb_map_ioctl(void __user *argp) 3319 { 3320 struct fb_con2fbmap con2fb; 3321 int ret; 3322 > 3323 if (copy_from_user(&con2fb, argp, sizeof(con2fb))) 3324 return -EFAULT; 3325 if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES) 3326 return -EINVAL; 3327 if (con2fb.framebuffer >= FB_MAX) 3328 return -EINVAL; 3329 if (!registered_fb[con2fb.framebuffer]) 3330 request_module("fb%d", con2fb.framebuffer); 3331 if (!registered_fb[con2fb.framebuffer]) { 3332 return -EINVAL; 3333 } 3334 3335 console_lock(); 3336 ret = set_con2fb_map(con2fb.console - 1, 3337 con2fb.framebuffer, 1); 3338 console_unlock(); 3339 3340 return ret; 3341 } 3342 3343 int fbcon_get_con2fb_map_ioctl(void __user *argp) 3344 { 3345 struct fb_con2fbmap con2fb; 3346 3347 if (copy_from_user(&con2fb, argp, sizeof(con2fb))) 3348 return -EFAULT; 3349 if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES) 3350 return -EINVAL; 3351 3352 console_lock(); 3353 con2fb.framebuffer = con2fb_map[con2fb.console - 1]; 3354 console_unlock(); 3355 > 3356 return copy_to_user(argp, &con2fb, sizeof(con2fb)) ? -EFAULT : 0; 3357 } 3358 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation [-- Attachment #2: .config.gz --] [-- Type: application/gzip, Size: 58532 bytes --] [-- Attachment #3: Type: text/plain, Size: 159 bytes --] _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[-- Attachment #1: Type: text/plain, Size: 2566 bytes --] Hi Daniel, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v5.2-rc1 next-20190520] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Daniel-Vetter/fbcon-notifier-begone/20190521-021841 config: alpha-allyesconfig (attached as .config) compiler: alpha-linux-gcc (GCC) 8.1.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree GCC_VERSION=8.1.0 make.cross ARCH=alpha If you fix the issue, kindly add following tag Reported-by: kbuild test robot <lkp@intel.com> All errors (new ones prefixed by >>): drivers/video/fbdev/core/fbcon.c: In function 'fbcon_set_con2fb_map_ioctl': >> drivers/video/fbdev/core/fbcon.c:3323:6: error: implicit declaration of function 'copy_from_user'; did you mean 'sg_copy_from_buffer'? [-Werror=implicit-function-declaration] if (copy_from_user(&con2fb, argp, sizeof(con2fb))) ^~~~~~~~~~~~~~ sg_copy_from_buffer drivers/video/fbdev/core/fbcon.c: In function 'fbcon_get_con2fb_map_ioctl': drivers/video/fbdev/core/fbcon.c:3356:9: error: implicit declaration of function 'copy_to_user'; did you mean 'cpu_to_mem'? [-Werror=implicit-function-declaration] return copy_to_user(argp, &con2fb, sizeof(con2fb)) ? -EFAULT : 0; ^~~~~~~~~~~~ cpu_to_mem cc1: some warnings being treated as errors vim +3323 drivers/video/fbdev/core/fbcon.c 3317 3318 int fbcon_set_con2fb_map_ioctl(void __user *argp) 3319 { 3320 struct fb_con2fbmap con2fb; 3321 int ret; 3322 > 3323 if (copy_from_user(&con2fb, argp, sizeof(con2fb))) 3324 return -EFAULT; 3325 if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES) 3326 return -EINVAL; 3327 if (con2fb.framebuffer >= FB_MAX) 3328 return -EINVAL; 3329 if (!registered_fb[con2fb.framebuffer]) 3330 request_module("fb%d", con2fb.framebuffer); 3331 if (!registered_fb[con2fb.framebuffer]) { 3332 return -EINVAL; 3333 } 3334 3335 console_lock(); 3336 ret = set_con2fb_map(con2fb.console - 1, 3337 con2fb.framebuffer, 1); 3338 console_unlock(); 3339 3340 return ret; 3341 } 3342 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation [-- Attachment #2: .config.gz --] [-- Type: application/gzip, Size: 57907 bytes --]
[-- Attachment #1: Type: text/plain, Size: 2566 bytes --] Hi Daniel, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v5.2-rc1 next-20190520] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Daniel-Vetter/fbcon-notifier-begone/20190521-021841 config: alpha-allyesconfig (attached as .config) compiler: alpha-linux-gcc (GCC) 8.1.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree GCC_VERSION=8.1.0 make.cross ARCH=alpha If you fix the issue, kindly add following tag Reported-by: kbuild test robot <lkp@intel.com> All errors (new ones prefixed by >>): drivers/video/fbdev/core/fbcon.c: In function 'fbcon_set_con2fb_map_ioctl': >> drivers/video/fbdev/core/fbcon.c:3323:6: error: implicit declaration of function 'copy_from_user'; did you mean 'sg_copy_from_buffer'? [-Werror=implicit-function-declaration] if (copy_from_user(&con2fb, argp, sizeof(con2fb))) ^~~~~~~~~~~~~~ sg_copy_from_buffer drivers/video/fbdev/core/fbcon.c: In function 'fbcon_get_con2fb_map_ioctl': drivers/video/fbdev/core/fbcon.c:3356:9: error: implicit declaration of function 'copy_to_user'; did you mean 'cpu_to_mem'? [-Werror=implicit-function-declaration] return copy_to_user(argp, &con2fb, sizeof(con2fb)) ? -EFAULT : 0; ^~~~~~~~~~~~ cpu_to_mem cc1: some warnings being treated as errors vim +3323 drivers/video/fbdev/core/fbcon.c 3317 3318 int fbcon_set_con2fb_map_ioctl(void __user *argp) 3319 { 3320 struct fb_con2fbmap con2fb; 3321 int ret; 3322 > 3323 if (copy_from_user(&con2fb, argp, sizeof(con2fb))) 3324 return -EFAULT; 3325 if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES) 3326 return -EINVAL; 3327 if (con2fb.framebuffer >= FB_MAX) 3328 return -EINVAL; 3329 if (!registered_fb[con2fb.framebuffer]) 3330 request_module("fb%d", con2fb.framebuffer); 3331 if (!registered_fb[con2fb.framebuffer]) { 3332 return -EINVAL; 3333 } 3334 3335 console_lock(); 3336 ret = set_con2fb_map(con2fb.console - 1, 3337 con2fb.framebuffer, 1); 3338 console_unlock(); 3339 3340 return ret; 3341 } 3342 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation [-- Attachment #2: .config.gz --] [-- Type: application/gzip, Size: 57907 bytes --] [-- Attachment #3: Type: text/plain, Size: 159 bytes --] _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Daniel, I love your patch! Perhaps something to improve: [auto build test WARNING on linus/master] [also build test WARNING on v5.2-rc1 next-20190520] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Daniel-Vetter/fbcon-notifier-begone/20190521-021841 reproduce: # apt-get install sparse make ARCH=x86_64 allmodconfig make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' If you fix the issue, kindly add following tag Reported-by: kbuild test robot <lkp@intel.com> sparse warnings: (new ones prefixed by >>) >> drivers/staging/fbtft/fbtft-core.c:894:38: sparse: sparse: incorrect type in return expression (different base types) @@ expected int @@ got vint @@ >> drivers/staging/fbtft/fbtft-core.c:894:38: sparse: expected int >> drivers/staging/fbtft/fbtft-core.c:894:38: sparse: got void -- >> drivers/media/pci/ivtv/ivtvfb.c:1261:43: sparse: sparse: incorrect type in conditional (non-scalar type) >> drivers/media/pci/ivtv/ivtvfb.c:1261:43: sparse: got void -- >> drivers/video/fbdev/neofb.c:2130:43: sparse: sparse: incorrect type in conditional (non-scalar type) >> drivers/video/fbdev/neofb.c:2130:43: sparse: got void -- >> drivers/video/fbdev/savage/savagefb_driver.c:2341:43: sparse: sparse: incorrect type in conditional (non-scalar type) >> drivers/video/fbdev/savage/savagefb_driver.c:2341:43: sparse: got void vim +894 drivers/staging/fbtft/fbtft-core.c c296d5f9 Thomas Petazzoni 2014-12-31 877 c296d5f9 Thomas Petazzoni 2014-12-31 878 /** c296d5f9 Thomas Petazzoni 2014-12-31 879 * fbtft_unregister_framebuffer - releases a tft frame buffer device c296d5f9 Thomas Petazzoni 2014-12-31 880 * @fb_info: frame buffer info structure c296d5f9 Thomas Petazzoni 2014-12-31 881 * c296d5f9 Thomas Petazzoni 2014-12-31 882 * Frees SPI driverdata if needed c296d5f9 Thomas Petazzoni 2014-12-31 883 * Frees gpios. c296d5f9 Thomas Petazzoni 2014-12-31 884 * Unregisters frame buffer device. c296d5f9 Thomas Petazzoni 2014-12-31 885 * c296d5f9 Thomas Petazzoni 2014-12-31 886 */ c296d5f9 Thomas Petazzoni 2014-12-31 887 int fbtft_unregister_framebuffer(struct fb_info *fb_info) c296d5f9 Thomas Petazzoni 2014-12-31 888 { c296d5f9 Thomas Petazzoni 2014-12-31 889 struct fbtft_par *par = fb_info->par; c296d5f9 Thomas Petazzoni 2014-12-31 890 c296d5f9 Thomas Petazzoni 2014-12-31 891 if (par->fbtftops.unregister_backlight) c296d5f9 Thomas Petazzoni 2014-12-31 892 par->fbtftops.unregister_backlight(par); c296d5f9 Thomas Petazzoni 2014-12-31 893 fbtft_sysfs_exit(par); 11107ffe Aya Mahfouz 2015-02-27 @894 return unregister_framebuffer(fb_info); c296d5f9 Thomas Petazzoni 2014-12-31 895 } c296d5f9 Thomas Petazzoni 2014-12-31 896 EXPORT_SYMBOL(fbtft_unregister_framebuffer); c296d5f9 Thomas Petazzoni 2014-12-31 897 :::::: The code at line 894 was first introduced by commit :::::: 11107ffe2cd1c1dc5948713fc08a1372185be0d5 staging: fbtft: remove unused variable :::::: TO: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> :::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Hi Daniel, I love your patch! Perhaps something to improve: [auto build test WARNING on linus/master] [also build test WARNING on v5.2-rc1 next-20190520] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Daniel-Vetter/fbcon-notifier-begone/20190521-021841 reproduce: # apt-get install sparse make ARCH=x86_64 allmodconfig make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' If you fix the issue, kindly add following tag Reported-by: kbuild test robot <lkp@intel.com> sparse warnings: (new ones prefixed by >>) >> drivers/staging/fbtft/fbtft-core.c:894:38: sparse: sparse: incorrect type in return expression (different base types) @@ expected int @@ got vint @@ >> drivers/staging/fbtft/fbtft-core.c:894:38: sparse: expected int >> drivers/staging/fbtft/fbtft-core.c:894:38: sparse: got void -- >> drivers/media/pci/ivtv/ivtvfb.c:1261:43: sparse: sparse: incorrect type in conditional (non-scalar type) >> drivers/media/pci/ivtv/ivtvfb.c:1261:43: sparse: got void -- >> drivers/video/fbdev/neofb.c:2130:43: sparse: sparse: incorrect type in conditional (non-scalar type) >> drivers/video/fbdev/neofb.c:2130:43: sparse: got void -- >> drivers/video/fbdev/savage/savagefb_driver.c:2341:43: sparse: sparse: incorrect type in conditional (non-scalar type) >> drivers/video/fbdev/savage/savagefb_driver.c:2341:43: sparse: got void vim +894 drivers/staging/fbtft/fbtft-core.c c296d5f9 Thomas Petazzoni 2014-12-31 877 c296d5f9 Thomas Petazzoni 2014-12-31 878 /** c296d5f9 Thomas Petazzoni 2014-12-31 879 * fbtft_unregister_framebuffer - releases a tft frame buffer device c296d5f9 Thomas Petazzoni 2014-12-31 880 * @fb_info: frame buffer info structure c296d5f9 Thomas Petazzoni 2014-12-31 881 * c296d5f9 Thomas Petazzoni 2014-12-31 882 * Frees SPI driverdata if needed c296d5f9 Thomas Petazzoni 2014-12-31 883 * Frees gpios. c296d5f9 Thomas Petazzoni 2014-12-31 884 * Unregisters frame buffer device. c296d5f9 Thomas Petazzoni 2014-12-31 885 * c296d5f9 Thomas Petazzoni 2014-12-31 886 */ c296d5f9 Thomas Petazzoni 2014-12-31 887 int fbtft_unregister_framebuffer(struct fb_info *fb_info) c296d5f9 Thomas Petazzoni 2014-12-31 888 { c296d5f9 Thomas Petazzoni 2014-12-31 889 struct fbtft_par *par = fb_info->par; c296d5f9 Thomas Petazzoni 2014-12-31 890 c296d5f9 Thomas Petazzoni 2014-12-31 891 if (par->fbtftops.unregister_backlight) c296d5f9 Thomas Petazzoni 2014-12-31 892 par->fbtftops.unregister_backlight(par); c296d5f9 Thomas Petazzoni 2014-12-31 893 fbtft_sysfs_exit(par); 11107ffe Aya Mahfouz 2015-02-27 @894 return unregister_framebuffer(fb_info); c296d5f9 Thomas Petazzoni 2014-12-31 895 } c296d5f9 Thomas Petazzoni 2014-12-31 896 EXPORT_SYMBOL(fbtft_unregister_framebuffer); c296d5f9 Thomas Petazzoni 2014-12-31 897 :::::: The code at line 894 was first introduced by commit :::::: 11107ffe2cd1c1dc5948713fc08a1372185be0d5 staging: fbtft: remove unused variable :::::: TO: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> :::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Hi Daniel, I love your patch! Perhaps something to improve: [auto build test WARNING on linus/master] [also build test WARNING on v5.2-rc1 next-20190520] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Daniel-Vetter/fbcon-notifier-begone/20190521-021841 reproduce: # apt-get install sparse make ARCH=x86_64 allmodconfig make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' If you fix the issue, kindly add following tag Reported-by: kbuild test robot <lkp@intel.com> sparse warnings: (new ones prefixed by >>) >> drivers/staging/fbtft/fbtft-core.c:894:38: sparse: sparse: incorrect type in return expression (different base types) @@ expected int @@ got vint @@ >> drivers/staging/fbtft/fbtft-core.c:894:38: sparse: expected int >> drivers/staging/fbtft/fbtft-core.c:894:38: sparse: got void -- >> drivers/media/pci/ivtv/ivtvfb.c:1261:43: sparse: sparse: incorrect type in conditional (non-scalar type) >> drivers/media/pci/ivtv/ivtvfb.c:1261:43: sparse: got void -- >> drivers/video/fbdev/neofb.c:2130:43: sparse: sparse: incorrect type in conditional (non-scalar type) >> drivers/video/fbdev/neofb.c:2130:43: sparse: got void -- >> drivers/video/fbdev/savage/savagefb_driver.c:2341:43: sparse: sparse: incorrect type in conditional (non-scalar type) >> drivers/video/fbdev/savage/savagefb_driver.c:2341:43: sparse: got void vim +894 drivers/staging/fbtft/fbtft-core.c c296d5f9 Thomas Petazzoni 2014-12-31 877 c296d5f9 Thomas Petazzoni 2014-12-31 878 /** c296d5f9 Thomas Petazzoni 2014-12-31 879 * fbtft_unregister_framebuffer - releases a tft frame buffer device c296d5f9 Thomas Petazzoni 2014-12-31 880 * @fb_info: frame buffer info structure c296d5f9 Thomas Petazzoni 2014-12-31 881 * c296d5f9 Thomas Petazzoni 2014-12-31 882 * Frees SPI driverdata if needed c296d5f9 Thomas Petazzoni 2014-12-31 883 * Frees gpios. c296d5f9 Thomas Petazzoni 2014-12-31 884 * Unregisters frame buffer device. c296d5f9 Thomas Petazzoni 2014-12-31 885 * c296d5f9 Thomas Petazzoni 2014-12-31 886 */ c296d5f9 Thomas Petazzoni 2014-12-31 887 int fbtft_unregister_framebuffer(struct fb_info *fb_info) c296d5f9 Thomas Petazzoni 2014-12-31 888 { c296d5f9 Thomas Petazzoni 2014-12-31 889 struct fbtft_par *par = fb_info->par; c296d5f9 Thomas Petazzoni 2014-12-31 890 c296d5f9 Thomas Petazzoni 2014-12-31 891 if (par->fbtftops.unregister_backlight) c296d5f9 Thomas Petazzoni 2014-12-31 892 par->fbtftops.unregister_backlight(par); c296d5f9 Thomas Petazzoni 2014-12-31 893 fbtft_sysfs_exit(par); 11107ffe Aya Mahfouz 2015-02-27 @894 return unregister_framebuffer(fb_info); c296d5f9 Thomas Petazzoni 2014-12-31 895 } c296d5f9 Thomas Petazzoni 2014-12-31 896 EXPORT_SYMBOL(fbtft_unregister_framebuffer); c296d5f9 Thomas Petazzoni 2014-12-31 897 :::::: The code at line 894 was first introduced by commit :::::: 11107ffe2cd1c1dc5948713fc08a1372185be0d5 staging: fbtft: remove unused variable :::::: TO: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> :::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
^Typo in subject.
Op 20-05-2019 om 10:22 schreef Daniel Vetter:
> For some reasons the pm_vt_switch_unregister call was missing from the
> direct unregister_framebuffer path. Fix this.
>
> v2: fbinfo->dev is used to decided whether unlink_framebuffer has been
> called already. I botched that in v1. Make this all clearer by
> inlining __unlink_framebuffer.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
> Cc: Peter Rosin <peda@axentia.se>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Mikulas Patocka <mpatocka@redhat.com>
> ---
> drivers/video/fbdev/core/fbmem.c | 47 ++++++++++++++------------------
> 1 file changed, 20 insertions(+), 27 deletions(-)
>
> diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
> index 032506576aa0..f059b0b1a030 100644
> --- a/drivers/video/fbdev/core/fbmem.c
> +++ b/drivers/video/fbdev/core/fbmem.c
> @@ -1714,15 +1714,30 @@ static void unbind_console(struct fb_info *fb_info)
> console_unlock();
> }
>
> -static void __unlink_framebuffer(struct fb_info *fb_info);
> -
> -static void do_unregister_framebuffer(struct fb_info *fb_info)
> +void unlink_framebuffer(struct fb_info *fb_info)
> {
> - unbind_console(fb_info);
> + int i;
> +
> + i = fb_info->node;
> + if (WARN_ON(i < 0 || i >= FB_MAX || registered_fb[i] != fb_info))
> + return;
> +
> + if (!fb_info->dev)
> + return;
> +
> + device_destroy(fb_class, MKDEV(FB_MAJOR, i));
>
> pm_vt_switch_unregister(fb_info->dev);
>
> - __unlink_framebuffer(fb_info);
> + unbind_console(fb_info);
> +
> + fb_info->dev = NULL;
> +}
> +EXPORT_SYMBOL(unlink_framebuffer);
> +
> +static void do_unregister_framebuffer(struct fb_info *fb_info)
> +{
> + unlink_framebuffer(fb_info);
> if (fb_info->pixmap.addr &&
> (fb_info->pixmap.flags & FB_PIXMAP_DEFAULT))
> kfree(fb_info->pixmap.addr);
> @@ -1738,28 +1753,6 @@ static void do_unregister_framebuffer(struct fb_info *fb_info)
> put_fb_info(fb_info);
> }
>
> -static void __unlink_framebuffer(struct fb_info *fb_info)
> -{
> - int i;
> -
> - i = fb_info->node;
> - if (WARN_ON(i < 0 || i >= FB_MAX || registered_fb[i] != fb_info))
> - return;
> -
> - if (fb_info->dev) {
> - device_destroy(fb_class, MKDEV(FB_MAJOR, i));
> - fb_info->dev = NULL;
> - }
> -}
> -
> -void unlink_framebuffer(struct fb_info *fb_info)
> -{
> - __unlink_framebuffer(fb_info);
> -
> - unbind_console(fb_info);
> -}
> -EXPORT_SYMBOL(unlink_framebuffer);
> -
> /**
> * remove_conflicting_framebuffers - remove firmware-configured framebuffers
> * @a: memory range, users of which are to be removed
Op 20-05-2019 om 10:22 schreef Daniel Vetter: > Create a new wrapper function for this, feels like there's some > refactoring room here between the two modes. > > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> > Cc: Lee Jones <lee.jones@linaro.org> > Cc: Daniel Thompson <daniel.thompson@linaro.org> > Cc: Jingoo Han <jingoohan1@gmail.com> > Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch> > Cc: Hans de Goede <hdegoede@redhat.com> > Cc: Yisheng Xie <ysxie@foxmail.com> > Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> > Cc: Peter Rosin <peda@axentia.se> > Cc: Mikulas Patocka <mpatocka@redhat.com> > Cc: linux-fbdev@vger.kernel.org > --- > drivers/video/backlight/lcd.c | 2 -- > drivers/video/fbdev/core/fbcon.c | 15 +++++++++------ > drivers/video/fbdev/core/fbmem.c | 13 ++----------- > drivers/video/fbdev/sh_mobile_lcdcfb.c | 11 +---------- > include/linux/fb.h | 4 ---- > include/linux/fbcon.h | 2 ++ > 6 files changed, 14 insertions(+), 33 deletions(-) > > diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c > index 4b40c6a4d441..16298041b141 100644 > --- a/drivers/video/backlight/lcd.c > +++ b/drivers/video/backlight/lcd.c > @@ -32,8 +32,6 @@ static int fb_notifier_callback(struct notifier_block *self, > /* If we aren't interested in this event, skip it immediately ... */ > switch (event) { > case FB_EVENT_BLANK: > - case FB_EVENT_MODE_CHANGE: > - case FB_EVENT_MODE_CHANGE_ALL: > case FB_EARLY_EVENT_BLANK: > case FB_R_EARLY_EVENT_BLANK: > break; Below it performs a call to set_mode() if it's none of the blanking events; it can be removed. :) > diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c > index c1a7476e980f..8cc62d340387 100644 > --- a/drivers/video/fbdev/core/fbcon.c > +++ b/drivers/video/fbdev/core/fbcon.c > @@ -3005,6 +3005,15 @@ static void fbcon_set_all_vcs(struct fb_info *info) > fbcon_modechanged(info); > } > > + > +void fbcon_update_vcs(struct fb_info *info, bool all) > +{ > + if (all) > + fbcon_set_all_vcs(info); > + else > + fbcon_modechanged(info); > +} > + > int fbcon_mode_deleted(struct fb_info *info, > struct fb_videomode *mode) > { > @@ -3314,12 +3323,6 @@ static int fbcon_event_notify(struct notifier_block *self, > int idx, ret = 0; > > switch(action) { > - case FB_EVENT_MODE_CHANGE: > - fbcon_modechanged(info); > - break; > - case FB_EVENT_MODE_CHANGE_ALL: > - fbcon_set_all_vcs(info); > - break; > case FB_EVENT_SET_CONSOLE_MAP: > /* called with console lock held */ > con2fb = event->data; > diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c > index cbd58ba8a59d..55b88163edc2 100644 > --- a/drivers/video/fbdev/core/fbmem.c > +++ b/drivers/video/fbdev/core/fbmem.c > @@ -1039,17 +1039,8 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) > !list_empty(&info->modelist)) > ret = fb_add_videomode(&mode, &info->modelist); > > - if (!ret && (flags & FBINFO_MISC_USEREVENT)) { > - struct fb_event event; > - int evnt = (activate & FB_ACTIVATE_ALL) ? > - FB_EVENT_MODE_CHANGE_ALL : > - FB_EVENT_MODE_CHANGE; > - > - info->flags &= ~FBINFO_MISC_USEREVENT; > - event.info = info; > - event.data = &mode; > - fb_notifier_call_chain(evnt, &event); > - } > + if (!ret && (flags & FBINFO_MISC_USEREVENT)) > + fbcon_update_vcs(info, activate & FB_ACTIVATE_ALL); > > return ret; > } > diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c > index 0d7a044852d7..bb1a610d0363 100644 > --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c > +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c > @@ -1776,8 +1776,6 @@ static void sh_mobile_fb_reconfig(struct fb_info *info) > struct sh_mobile_lcdc_chan *ch = info->par; > struct fb_var_screeninfo var; > struct fb_videomode mode; > - struct fb_event event; > - int evnt = FB_EVENT_MODE_CHANGE_ALL; > > if (ch->use_count > 1 || (ch->use_count == 1 && !info->fbcon_par)) > /* More framebuffer users are active */ > @@ -1799,14 +1797,7 @@ static void sh_mobile_fb_reconfig(struct fb_info *info) > /* Couldn't reconfigure, hopefully, can continue as before */ > return; > > - /* > - * fb_set_var() calls the notifier change internally, only if > - * FBINFO_MISC_USEREVENT flag is set. Since we do not want to fake a > - * user event, we have to call the chain ourselves. > - */ > - event.info = info; > - event.data = &ch->display.mode; > - fb_notifier_call_chain(evnt, &event); > + fbcon_update_vcs(info, true); > } > > /* > diff --git a/include/linux/fb.h b/include/linux/fb.h > index 4b9b882f8f52..54d6bee09121 100644 > --- a/include/linux/fb.h > +++ b/include/linux/fb.h > @@ -124,16 +124,12 @@ struct fb_cursor_user { > * Register/unregister for framebuffer events > */ > > -/* The resolution of the passed in fb_info about to change */ > -#define FB_EVENT_MODE_CHANGE 0x01 > /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ > #define FB_EVENT_GET_CONSOLE_MAP 0x07 > /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ > #define FB_EVENT_SET_CONSOLE_MAP 0x08 > /* A display blank is requested */ > #define FB_EVENT_BLANK 0x09 > -/* Private modelist is to be replaced */ > -#define FB_EVENT_MODE_CHANGE_ALL 0x0B > /* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga_switcheroo */ > #define FB_EVENT_REMAP_ALL_CONSOLE 0x0F > /* A hardware display blank early change occurred */ > diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h > index 90e196c835dd..daaa97b0c9e6 100644 > --- a/include/linux/fbcon.h > +++ b/include/linux/fbcon.h > @@ -15,6 +15,7 @@ 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); > +void fbcon_update_vcs(struct fb_info *info, bool all); > #else > static inline void fb_console_init(void) {} > static inline void fb_console_exit(void) {} > @@ -29,6 +30,7 @@ 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) {} > +void fbcon_update_vcs(struct fb_info *info, bool all) {} > #endif > > #endif /* _LINUX_FBCON_H */
Op 20-05-2019 om 10:22 schreef Daniel Vetter: > Create a new wrapper function for this, feels like there's some > refactoring room here between the two modes. > > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> > Cc: Lee Jones <lee.jones@linaro.org> > Cc: Daniel Thompson <daniel.thompson@linaro.org> > Cc: Jingoo Han <jingoohan1@gmail.com> > Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch> > Cc: Hans de Goede <hdegoede@redhat.com> > Cc: Yisheng Xie <ysxie@foxmail.com> > Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> > Cc: Peter Rosin <peda@axentia.se> > Cc: Mikulas Patocka <mpatocka@redhat.com> > Cc: linux-fbdev@vger.kernel.org > --- > drivers/video/backlight/lcd.c | 2 -- > drivers/video/fbdev/core/fbcon.c | 15 +++++++++------ > drivers/video/fbdev/core/fbmem.c | 13 ++----------- > drivers/video/fbdev/sh_mobile_lcdcfb.c | 11 +---------- > include/linux/fb.h | 4 ---- > include/linux/fbcon.h | 2 ++ > 6 files changed, 14 insertions(+), 33 deletions(-) > > diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c > index 4b40c6a4d441..16298041b141 100644 > --- a/drivers/video/backlight/lcd.c > +++ b/drivers/video/backlight/lcd.c > @@ -32,8 +32,6 @@ static int fb_notifier_callback(struct notifier_block *self, > /* If we aren't interested in this event, skip it immediately ... */ > switch (event) { > case FB_EVENT_BLANK: > - case FB_EVENT_MODE_CHANGE: > - case FB_EVENT_MODE_CHANGE_ALL: > case FB_EARLY_EVENT_BLANK: > case FB_R_EARLY_EVENT_BLANK: > break; Below it performs a call to set_mode() if it's none of the blanking events; it can be removed. :) > diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c > index c1a7476e980f..8cc62d340387 100644 > --- a/drivers/video/fbdev/core/fbcon.c > +++ b/drivers/video/fbdev/core/fbcon.c > @@ -3005,6 +3005,15 @@ static void fbcon_set_all_vcs(struct fb_info *info) > fbcon_modechanged(info); > } > > + > +void fbcon_update_vcs(struct fb_info *info, bool all) > +{ > + if (all) > + fbcon_set_all_vcs(info); > + else > + fbcon_modechanged(info); > +} > + > int fbcon_mode_deleted(struct fb_info *info, > struct fb_videomode *mode) > { > @@ -3314,12 +3323,6 @@ static int fbcon_event_notify(struct notifier_block *self, > int idx, ret = 0; > > switch(action) { > - case FB_EVENT_MODE_CHANGE: > - fbcon_modechanged(info); > - break; > - case FB_EVENT_MODE_CHANGE_ALL: > - fbcon_set_all_vcs(info); > - break; > case FB_EVENT_SET_CONSOLE_MAP: > /* called with console lock held */ > con2fb = event->data; > diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c > index cbd58ba8a59d..55b88163edc2 100644 > --- a/drivers/video/fbdev/core/fbmem.c > +++ b/drivers/video/fbdev/core/fbmem.c > @@ -1039,17 +1039,8 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) > !list_empty(&info->modelist)) > ret = fb_add_videomode(&mode, &info->modelist); > > - if (!ret && (flags & FBINFO_MISC_USEREVENT)) { > - struct fb_event event; > - int evnt = (activate & FB_ACTIVATE_ALL) ? > - FB_EVENT_MODE_CHANGE_ALL : > - FB_EVENT_MODE_CHANGE; > - > - info->flags &= ~FBINFO_MISC_USEREVENT; > - event.info = info; > - event.data = &mode; > - fb_notifier_call_chain(evnt, &event); > - } > + if (!ret && (flags & FBINFO_MISC_USEREVENT)) > + fbcon_update_vcs(info, activate & FB_ACTIVATE_ALL); > > return ret; > } > diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c > index 0d7a044852d7..bb1a610d0363 100644 > --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c > +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c > @@ -1776,8 +1776,6 @@ static void sh_mobile_fb_reconfig(struct fb_info *info) > struct sh_mobile_lcdc_chan *ch = info->par; > struct fb_var_screeninfo var; > struct fb_videomode mode; > - struct fb_event event; > - int evnt = FB_EVENT_MODE_CHANGE_ALL; > > if (ch->use_count > 1 || (ch->use_count = 1 && !info->fbcon_par)) > /* More framebuffer users are active */ > @@ -1799,14 +1797,7 @@ static void sh_mobile_fb_reconfig(struct fb_info *info) > /* Couldn't reconfigure, hopefully, can continue as before */ > return; > > - /* > - * fb_set_var() calls the notifier change internally, only if > - * FBINFO_MISC_USEREVENT flag is set. Since we do not want to fake a > - * user event, we have to call the chain ourselves. > - */ > - event.info = info; > - event.data = &ch->display.mode; > - fb_notifier_call_chain(evnt, &event); > + fbcon_update_vcs(info, true); > } > > /* > diff --git a/include/linux/fb.h b/include/linux/fb.h > index 4b9b882f8f52..54d6bee09121 100644 > --- a/include/linux/fb.h > +++ b/include/linux/fb.h > @@ -124,16 +124,12 @@ struct fb_cursor_user { > * Register/unregister for framebuffer events > */ > > -/* The resolution of the passed in fb_info about to change */ > -#define FB_EVENT_MODE_CHANGE 0x01 > /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ > #define FB_EVENT_GET_CONSOLE_MAP 0x07 > /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ > #define FB_EVENT_SET_CONSOLE_MAP 0x08 > /* A display blank is requested */ > #define FB_EVENT_BLANK 0x09 > -/* Private modelist is to be replaced */ > -#define FB_EVENT_MODE_CHANGE_ALL 0x0B > /* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga_switcheroo */ > #define FB_EVENT_REMAP_ALL_CONSOLE 0x0F > /* A hardware display blank early change occurred */ > diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h > index 90e196c835dd..daaa97b0c9e6 100644 > --- a/include/linux/fbcon.h > +++ b/include/linux/fbcon.h > @@ -15,6 +15,7 @@ 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); > +void fbcon_update_vcs(struct fb_info *info, bool all); > #else > static inline void fb_console_init(void) {} > static inline void fb_console_exit(void) {} > @@ -29,6 +30,7 @@ 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) {} > +void fbcon_update_vcs(struct fb_info *info, bool all) {} > #endif > > #endif /* _LINUX_FBCON_H */
Op 20-05-2019 om 10:22 schreef Daniel Vetter:
> It's not pretty.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Yisheng Xie <ysxie@foxmail.com>
> ---
> drivers/video/fbdev/core/fbcon.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
> index b40b56702c61..cbbcf7a795f2 100644
> --- a/drivers/video/fbdev/core/fbcon.c
> +++ b/drivers/video/fbdev/core/fbcon.c
> @@ -87,6 +87,25 @@
> # define DPRINTK(fmt, args...)
> #endif
>
> +/*
> + * FIXME: Locking
> + *
> + * - fbcon state itself is protected by the console_lock, and the code does a
> + * pretty good job at making sure that lock is held everywhere it's needed.
> + *
> + * - access to the registered_fb array is entirely unprotected. This should use
> + * proper object lifetime handling, i.e. get/put_fb_info. This also means
> + * switching from indices to proper pointers for fb_info everywhere.
> + *
> + * - fbcon doesn't bother with fb_lock/unlock at all. This is buggy, since it
> + * means concurrent access to the same fbdev from both fbcon and userspace
> + * will blow up. To fix this all fbcon calls from fbmem.c need to be moved out
> + * of fb_lock/unlock protected sections, since otherwise we'll recurse and
> + * deadlock eventually. Aside: Due to these deadlock issues the fbdev code in
> + * fbmem.c cannot use locking asserts, and there's lots of callers which get
> + * the rules wrong, e.g. fbsysfs.c entirely missed fb_lock/unlock calls too.
> + */
> +
> enum {
> FBCON_LOGO_CANSHOW = -1, /* the logo can be shown */
> FBCON_LOGO_DRAW = -2, /* draw the logo to a console */
I did a casual review, so for whole series with the small nitpicks I had, and any feedback by others, kbuild and the arm mess being fixed up:
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
However, according to reviewer's statement of oversight:
While I have reviewed the patch and believe it to be sound, I do not (unless explicitly stated elsewhere)
make any warranties or guarantees that it will achieve its stated purpose or function properly in any given situation.
:)
~Maarten
On Tue, May 21, 2019 at 12:56:30PM +0200, Maarten Lankhorst wrote: > Op 20-05-2019 om 10:22 schreef Daniel Vetter: > > Create a new wrapper function for this, feels like there's some > > refactoring room here between the two modes. > > > > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> > > Cc: Lee Jones <lee.jones@linaro.org> > > Cc: Daniel Thompson <daniel.thompson@linaro.org> > > Cc: Jingoo Han <jingoohan1@gmail.com> > > Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> > > Cc: Daniel Vetter <daniel.vetter@ffwll.ch> > > Cc: Hans de Goede <hdegoede@redhat.com> > > Cc: Yisheng Xie <ysxie@foxmail.com> > > Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> > > Cc: Peter Rosin <peda@axentia.se> > > Cc: Mikulas Patocka <mpatocka@redhat.com> > > Cc: linux-fbdev@vger.kernel.org > > --- > > drivers/video/backlight/lcd.c | 2 -- > > drivers/video/fbdev/core/fbcon.c | 15 +++++++++------ > > drivers/video/fbdev/core/fbmem.c | 13 ++----------- > > drivers/video/fbdev/sh_mobile_lcdcfb.c | 11 +---------- > > include/linux/fb.h | 4 ---- > > include/linux/fbcon.h | 2 ++ > > 6 files changed, 14 insertions(+), 33 deletions(-) > > > > diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c > > index 4b40c6a4d441..16298041b141 100644 > > --- a/drivers/video/backlight/lcd.c > > +++ b/drivers/video/backlight/lcd.c > > @@ -32,8 +32,6 @@ static int fb_notifier_callback(struct notifier_block *self, > > /* If we aren't interested in this event, skip it immediately ... */ > > switch (event) { > > case FB_EVENT_BLANK: > > - case FB_EVENT_MODE_CHANGE: > > - case FB_EVENT_MODE_CHANGE_ALL: > > case FB_EARLY_EVENT_BLANK: > > case FB_R_EARLY_EVENT_BLANK: > > break; > > Below it performs a call to set_mode() if it's none of the blanking events; it can be removed. :) Oops ... I think I'll insert a patch here to create a new MODESET event for backlights. We still need this one I think (maybe not for kms, but for old fbdev drivers). And maybe a wrapper for fb_backlight_notify on top ... Thanks for spotting this. -Daniel > > > diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c > > index c1a7476e980f..8cc62d340387 100644 > > --- a/drivers/video/fbdev/core/fbcon.c > > +++ b/drivers/video/fbdev/core/fbcon.c > > @@ -3005,6 +3005,15 @@ static void fbcon_set_all_vcs(struct fb_info *info) > > fbcon_modechanged(info); > > } > > > > + > > +void fbcon_update_vcs(struct fb_info *info, bool all) > > +{ > > + if (all) > > + fbcon_set_all_vcs(info); > > + else > > + fbcon_modechanged(info); > > +} > > + > > int fbcon_mode_deleted(struct fb_info *info, > > struct fb_videomode *mode) > > { > > @@ -3314,12 +3323,6 @@ static int fbcon_event_notify(struct notifier_block *self, > > int idx, ret = 0; > > > > switch(action) { > > - case FB_EVENT_MODE_CHANGE: > > - fbcon_modechanged(info); > > - break; > > - case FB_EVENT_MODE_CHANGE_ALL: > > - fbcon_set_all_vcs(info); > > - break; > > case FB_EVENT_SET_CONSOLE_MAP: > > /* called with console lock held */ > > con2fb = event->data; > > diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c > > index cbd58ba8a59d..55b88163edc2 100644 > > --- a/drivers/video/fbdev/core/fbmem.c > > +++ b/drivers/video/fbdev/core/fbmem.c > > @@ -1039,17 +1039,8 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) > > !list_empty(&info->modelist)) > > ret = fb_add_videomode(&mode, &info->modelist); > > > > - if (!ret && (flags & FBINFO_MISC_USEREVENT)) { > > - struct fb_event event; > > - int evnt = (activate & FB_ACTIVATE_ALL) ? > > - FB_EVENT_MODE_CHANGE_ALL : > > - FB_EVENT_MODE_CHANGE; > > - > > - info->flags &= ~FBINFO_MISC_USEREVENT; > > - event.info = info; > > - event.data = &mode; > > - fb_notifier_call_chain(evnt, &event); > > - } > > + if (!ret && (flags & FBINFO_MISC_USEREVENT)) > > + fbcon_update_vcs(info, activate & FB_ACTIVATE_ALL); > > > > return ret; > > } > > diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c > > index 0d7a044852d7..bb1a610d0363 100644 > > --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c > > +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c > > @@ -1776,8 +1776,6 @@ static void sh_mobile_fb_reconfig(struct fb_info *info) > > struct sh_mobile_lcdc_chan *ch = info->par; > > struct fb_var_screeninfo var; > > struct fb_videomode mode; > > - struct fb_event event; > > - int evnt = FB_EVENT_MODE_CHANGE_ALL; > > > > if (ch->use_count > 1 || (ch->use_count == 1 && !info->fbcon_par)) > > /* More framebuffer users are active */ > > @@ -1799,14 +1797,7 @@ static void sh_mobile_fb_reconfig(struct fb_info *info) > > /* Couldn't reconfigure, hopefully, can continue as before */ > > return; > > > > - /* > > - * fb_set_var() calls the notifier change internally, only if > > - * FBINFO_MISC_USEREVENT flag is set. Since we do not want to fake a > > - * user event, we have to call the chain ourselves. > > - */ > > - event.info = info; > > - event.data = &ch->display.mode; > > - fb_notifier_call_chain(evnt, &event); > > + fbcon_update_vcs(info, true); > > } > > > > /* > > diff --git a/include/linux/fb.h b/include/linux/fb.h > > index 4b9b882f8f52..54d6bee09121 100644 > > --- a/include/linux/fb.h > > +++ b/include/linux/fb.h > > @@ -124,16 +124,12 @@ struct fb_cursor_user { > > * Register/unregister for framebuffer events > > */ > > > > -/* The resolution of the passed in fb_info about to change */ > > -#define FB_EVENT_MODE_CHANGE 0x01 > > /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ > > #define FB_EVENT_GET_CONSOLE_MAP 0x07 > > /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ > > #define FB_EVENT_SET_CONSOLE_MAP 0x08 > > /* A display blank is requested */ > > #define FB_EVENT_BLANK 0x09 > > -/* Private modelist is to be replaced */ > > -#define FB_EVENT_MODE_CHANGE_ALL 0x0B > > /* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga_switcheroo */ > > #define FB_EVENT_REMAP_ALL_CONSOLE 0x0F > > /* A hardware display blank early change occurred */ > > diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h > > index 90e196c835dd..daaa97b0c9e6 100644 > > --- a/include/linux/fbcon.h > > +++ b/include/linux/fbcon.h > > @@ -15,6 +15,7 @@ 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); > > +void fbcon_update_vcs(struct fb_info *info, bool all); > > #else > > static inline void fb_console_init(void) {} > > static inline void fb_console_exit(void) {} > > @@ -29,6 +30,7 @@ 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) {} > > +void fbcon_update_vcs(struct fb_info *info, bool all) {} > > #endif > > > > #endif /* _LINUX_FBCON_H */ > > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
On Tue, May 21, 2019 at 12:56:30PM +0200, Maarten Lankhorst wrote: > Op 20-05-2019 om 10:22 schreef Daniel Vetter: > > Create a new wrapper function for this, feels like there's some > > refactoring room here between the two modes. > > > > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> > > Cc: Lee Jones <lee.jones@linaro.org> > > Cc: Daniel Thompson <daniel.thompson@linaro.org> > > Cc: Jingoo Han <jingoohan1@gmail.com> > > Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> > > Cc: Daniel Vetter <daniel.vetter@ffwll.ch> > > Cc: Hans de Goede <hdegoede@redhat.com> > > Cc: Yisheng Xie <ysxie@foxmail.com> > > Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> > > Cc: Peter Rosin <peda@axentia.se> > > Cc: Mikulas Patocka <mpatocka@redhat.com> > > Cc: linux-fbdev@vger.kernel.org > > --- > > drivers/video/backlight/lcd.c | 2 -- > > drivers/video/fbdev/core/fbcon.c | 15 +++++++++------ > > drivers/video/fbdev/core/fbmem.c | 13 ++----------- > > drivers/video/fbdev/sh_mobile_lcdcfb.c | 11 +---------- > > include/linux/fb.h | 4 ---- > > include/linux/fbcon.h | 2 ++ > > 6 files changed, 14 insertions(+), 33 deletions(-) > > > > diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c > > index 4b40c6a4d441..16298041b141 100644 > > --- a/drivers/video/backlight/lcd.c > > +++ b/drivers/video/backlight/lcd.c > > @@ -32,8 +32,6 @@ static int fb_notifier_callback(struct notifier_block *self, > > /* If we aren't interested in this event, skip it immediately ... */ > > switch (event) { > > case FB_EVENT_BLANK: > > - case FB_EVENT_MODE_CHANGE: > > - case FB_EVENT_MODE_CHANGE_ALL: > > case FB_EARLY_EVENT_BLANK: > > case FB_R_EARLY_EVENT_BLANK: > > break; > > Below it performs a call to set_mode() if it's none of the blanking events; it can be removed. :) Oops ... I think I'll insert a patch here to create a new MODESET event for backlights. We still need this one I think (maybe not for kms, but for old fbdev drivers). And maybe a wrapper for fb_backlight_notify on top ... Thanks for spotting this. -Daniel > > > diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c > > index c1a7476e980f..8cc62d340387 100644 > > --- a/drivers/video/fbdev/core/fbcon.c > > +++ b/drivers/video/fbdev/core/fbcon.c > > @@ -3005,6 +3005,15 @@ static void fbcon_set_all_vcs(struct fb_info *info) > > fbcon_modechanged(info); > > } > > > > + > > +void fbcon_update_vcs(struct fb_info *info, bool all) > > +{ > > + if (all) > > + fbcon_set_all_vcs(info); > > + else > > + fbcon_modechanged(info); > > +} > > + > > int fbcon_mode_deleted(struct fb_info *info, > > struct fb_videomode *mode) > > { > > @@ -3314,12 +3323,6 @@ static int fbcon_event_notify(struct notifier_block *self, > > int idx, ret = 0; > > > > switch(action) { > > - case FB_EVENT_MODE_CHANGE: > > - fbcon_modechanged(info); > > - break; > > - case FB_EVENT_MODE_CHANGE_ALL: > > - fbcon_set_all_vcs(info); > > - break; > > case FB_EVENT_SET_CONSOLE_MAP: > > /* called with console lock held */ > > con2fb = event->data; > > diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c > > index cbd58ba8a59d..55b88163edc2 100644 > > --- a/drivers/video/fbdev/core/fbmem.c > > +++ b/drivers/video/fbdev/core/fbmem.c > > @@ -1039,17 +1039,8 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) > > !list_empty(&info->modelist)) > > ret = fb_add_videomode(&mode, &info->modelist); > > > > - if (!ret && (flags & FBINFO_MISC_USEREVENT)) { > > - struct fb_event event; > > - int evnt = (activate & FB_ACTIVATE_ALL) ? > > - FB_EVENT_MODE_CHANGE_ALL : > > - FB_EVENT_MODE_CHANGE; > > - > > - info->flags &= ~FBINFO_MISC_USEREVENT; > > - event.info = info; > > - event.data = &mode; > > - fb_notifier_call_chain(evnt, &event); > > - } > > + if (!ret && (flags & FBINFO_MISC_USEREVENT)) > > + fbcon_update_vcs(info, activate & FB_ACTIVATE_ALL); > > > > return ret; > > } > > diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c > > index 0d7a044852d7..bb1a610d0363 100644 > > --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c > > +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c > > @@ -1776,8 +1776,6 @@ static void sh_mobile_fb_reconfig(struct fb_info *info) > > struct sh_mobile_lcdc_chan *ch = info->par; > > struct fb_var_screeninfo var; > > struct fb_videomode mode; > > - struct fb_event event; > > - int evnt = FB_EVENT_MODE_CHANGE_ALL; > > > > if (ch->use_count > 1 || (ch->use_count = 1 && !info->fbcon_par)) > > /* More framebuffer users are active */ > > @@ -1799,14 +1797,7 @@ static void sh_mobile_fb_reconfig(struct fb_info *info) > > /* Couldn't reconfigure, hopefully, can continue as before */ > > return; > > > > - /* > > - * fb_set_var() calls the notifier change internally, only if > > - * FBINFO_MISC_USEREVENT flag is set. Since we do not want to fake a > > - * user event, we have to call the chain ourselves. > > - */ > > - event.info = info; > > - event.data = &ch->display.mode; > > - fb_notifier_call_chain(evnt, &event); > > + fbcon_update_vcs(info, true); > > } > > > > /* > > diff --git a/include/linux/fb.h b/include/linux/fb.h > > index 4b9b882f8f52..54d6bee09121 100644 > > --- a/include/linux/fb.h > > +++ b/include/linux/fb.h > > @@ -124,16 +124,12 @@ struct fb_cursor_user { > > * Register/unregister for framebuffer events > > */ > > > > -/* The resolution of the passed in fb_info about to change */ > > -#define FB_EVENT_MODE_CHANGE 0x01 > > /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ > > #define FB_EVENT_GET_CONSOLE_MAP 0x07 > > /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ > > #define FB_EVENT_SET_CONSOLE_MAP 0x08 > > /* A display blank is requested */ > > #define FB_EVENT_BLANK 0x09 > > -/* Private modelist is to be replaced */ > > -#define FB_EVENT_MODE_CHANGE_ALL 0x0B > > /* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga_switcheroo */ > > #define FB_EVENT_REMAP_ALL_CONSOLE 0x0F > > /* A hardware display blank early change occurred */ > > diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h > > index 90e196c835dd..daaa97b0c9e6 100644 > > --- a/include/linux/fbcon.h > > +++ b/include/linux/fbcon.h > > @@ -15,6 +15,7 @@ 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); > > +void fbcon_update_vcs(struct fb_info *info, bool all); > > #else > > static inline void fb_console_init(void) {} > > static inline void fb_console_exit(void) {} > > @@ -29,6 +30,7 @@ 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) {} > > +void fbcon_update_vcs(struct fb_info *info, bool all) {} > > #endif > > > > #endif /* _LINUX_FBCON_H */ > > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
On Tue, May 21, 2019 at 12:56:30PM +0200, Maarten Lankhorst wrote: > Op 20-05-2019 om 10:22 schreef Daniel Vetter: > > Create a new wrapper function for this, feels like there's some > > refactoring room here between the two modes. > > > > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> > > Cc: Lee Jones <lee.jones@linaro.org> > > Cc: Daniel Thompson <daniel.thompson@linaro.org> > > Cc: Jingoo Han <jingoohan1@gmail.com> > > Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> > > Cc: Daniel Vetter <daniel.vetter@ffwll.ch> > > Cc: Hans de Goede <hdegoede@redhat.com> > > Cc: Yisheng Xie <ysxie@foxmail.com> > > Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> > > Cc: Peter Rosin <peda@axentia.se> > > Cc: Mikulas Patocka <mpatocka@redhat.com> > > Cc: linux-fbdev@vger.kernel.org > > --- > > drivers/video/backlight/lcd.c | 2 -- > > drivers/video/fbdev/core/fbcon.c | 15 +++++++++------ > > drivers/video/fbdev/core/fbmem.c | 13 ++----------- > > drivers/video/fbdev/sh_mobile_lcdcfb.c | 11 +---------- > > include/linux/fb.h | 4 ---- > > include/linux/fbcon.h | 2 ++ > > 6 files changed, 14 insertions(+), 33 deletions(-) > > > > diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c > > index 4b40c6a4d441..16298041b141 100644 > > --- a/drivers/video/backlight/lcd.c > > +++ b/drivers/video/backlight/lcd.c > > @@ -32,8 +32,6 @@ static int fb_notifier_callback(struct notifier_block *self, > > /* If we aren't interested in this event, skip it immediately ... */ > > switch (event) { > > case FB_EVENT_BLANK: > > - case FB_EVENT_MODE_CHANGE: > > - case FB_EVENT_MODE_CHANGE_ALL: > > case FB_EARLY_EVENT_BLANK: > > case FB_R_EARLY_EVENT_BLANK: > > break; > > Below it performs a call to set_mode() if it's none of the blanking events; it can be removed. :) Oops ... I think I'll insert a patch here to create a new MODESET event for backlights. We still need this one I think (maybe not for kms, but for old fbdev drivers). And maybe a wrapper for fb_backlight_notify on top ... Thanks for spotting this. -Daniel > > > diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c > > index c1a7476e980f..8cc62d340387 100644 > > --- a/drivers/video/fbdev/core/fbcon.c > > +++ b/drivers/video/fbdev/core/fbcon.c > > @@ -3005,6 +3005,15 @@ static void fbcon_set_all_vcs(struct fb_info *info) > > fbcon_modechanged(info); > > } > > > > + > > +void fbcon_update_vcs(struct fb_info *info, bool all) > > +{ > > + if (all) > > + fbcon_set_all_vcs(info); > > + else > > + fbcon_modechanged(info); > > +} > > + > > int fbcon_mode_deleted(struct fb_info *info, > > struct fb_videomode *mode) > > { > > @@ -3314,12 +3323,6 @@ static int fbcon_event_notify(struct notifier_block *self, > > int idx, ret = 0; > > > > switch(action) { > > - case FB_EVENT_MODE_CHANGE: > > - fbcon_modechanged(info); > > - break; > > - case FB_EVENT_MODE_CHANGE_ALL: > > - fbcon_set_all_vcs(info); > > - break; > > case FB_EVENT_SET_CONSOLE_MAP: > > /* called with console lock held */ > > con2fb = event->data; > > diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c > > index cbd58ba8a59d..55b88163edc2 100644 > > --- a/drivers/video/fbdev/core/fbmem.c > > +++ b/drivers/video/fbdev/core/fbmem.c > > @@ -1039,17 +1039,8 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) > > !list_empty(&info->modelist)) > > ret = fb_add_videomode(&mode, &info->modelist); > > > > - if (!ret && (flags & FBINFO_MISC_USEREVENT)) { > > - struct fb_event event; > > - int evnt = (activate & FB_ACTIVATE_ALL) ? > > - FB_EVENT_MODE_CHANGE_ALL : > > - FB_EVENT_MODE_CHANGE; > > - > > - info->flags &= ~FBINFO_MISC_USEREVENT; > > - event.info = info; > > - event.data = &mode; > > - fb_notifier_call_chain(evnt, &event); > > - } > > + if (!ret && (flags & FBINFO_MISC_USEREVENT)) > > + fbcon_update_vcs(info, activate & FB_ACTIVATE_ALL); > > > > return ret; > > } > > diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c > > index 0d7a044852d7..bb1a610d0363 100644 > > --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c > > +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c > > @@ -1776,8 +1776,6 @@ static void sh_mobile_fb_reconfig(struct fb_info *info) > > struct sh_mobile_lcdc_chan *ch = info->par; > > struct fb_var_screeninfo var; > > struct fb_videomode mode; > > - struct fb_event event; > > - int evnt = FB_EVENT_MODE_CHANGE_ALL; > > > > if (ch->use_count > 1 || (ch->use_count == 1 && !info->fbcon_par)) > > /* More framebuffer users are active */ > > @@ -1799,14 +1797,7 @@ static void sh_mobile_fb_reconfig(struct fb_info *info) > > /* Couldn't reconfigure, hopefully, can continue as before */ > > return; > > > > - /* > > - * fb_set_var() calls the notifier change internally, only if > > - * FBINFO_MISC_USEREVENT flag is set. Since we do not want to fake a > > - * user event, we have to call the chain ourselves. > > - */ > > - event.info = info; > > - event.data = &ch->display.mode; > > - fb_notifier_call_chain(evnt, &event); > > + fbcon_update_vcs(info, true); > > } > > > > /* > > diff --git a/include/linux/fb.h b/include/linux/fb.h > > index 4b9b882f8f52..54d6bee09121 100644 > > --- a/include/linux/fb.h > > +++ b/include/linux/fb.h > > @@ -124,16 +124,12 @@ struct fb_cursor_user { > > * Register/unregister for framebuffer events > > */ > > > > -/* The resolution of the passed in fb_info about to change */ > > -#define FB_EVENT_MODE_CHANGE 0x01 > > /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ > > #define FB_EVENT_GET_CONSOLE_MAP 0x07 > > /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ > > #define FB_EVENT_SET_CONSOLE_MAP 0x08 > > /* A display blank is requested */ > > #define FB_EVENT_BLANK 0x09 > > -/* Private modelist is to be replaced */ > > -#define FB_EVENT_MODE_CHANGE_ALL 0x0B > > /* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga_switcheroo */ > > #define FB_EVENT_REMAP_ALL_CONSOLE 0x0F > > /* A hardware display blank early change occurred */ > > diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h > > index 90e196c835dd..daaa97b0c9e6 100644 > > --- a/include/linux/fbcon.h > > +++ b/include/linux/fbcon.h > > @@ -15,6 +15,7 @@ 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); > > +void fbcon_update_vcs(struct fb_info *info, bool all); > > #else > > static inline void fb_console_init(void) {} > > static inline void fb_console_exit(void) {} > > @@ -29,6 +30,7 @@ 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) {} > > +void fbcon_update_vcs(struct fb_info *info, bool all) {} > > #endif > > > > #endif /* _LINUX_FBCON_H */ > > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
This is unused code since commit 6104c37094e729f3d4ce65797002112735d49cd1 Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Tue Aug 1 17:32:07 2017 +0200 fbcon: Make fbcon a built-time depency for fbdev when fbcon was made a compile-time static dependency of fbdev. We can't exit fbcon anymore without exiting fbdev first, which only works if all fbdev drivers have unloaded already. Hence this is all dead code. v2: I missed that fbcon_exit is also called from con_deinit stuff, and there fbcon_has_exited prevents double-cleanup. But we can fix that by properly resetting con2fb_map[] to all -1, which is used everywhere else to indicate "no fb_info allocate to this console". With that change the double-cleanup (which resulted in a module refcount underflow, among other things) is prevented. Aside: con2fb_map is a signed char, so don't register more than 128 fb_info or hilarity will ensue. v3: CI showed me that I still didn't fully understand what's going on here. The leaked references in con2fb_map have been used upon rebinding the fb console in fbcon_init. It worked because fbdev unregistering still cleaned out con2fb_map, and reset it to info_idx. If the last fbdev driver unregistered, then it also reset info_idx, and unregistered the fbcon driver. Imo that's all a bit fragile, so let's keep the con2fb_map reset to -1, and in fbcon_init pick info_idx if we're starting fresh. That means unbinding and rebinding will cleanse the mapping, but why are you doing that if you want to retain the mapping, so should be fine. Also, I think info_idx == -1 is impossible in fbcon_init - we unregister the fbcon in that case. So catch&warn about that. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Hans de Goede <hdegoede@redhat.com> Cc: "Noralf Trønnes" <noralf@tronnes.org> Cc: Yisheng Xie <ysxie@foxmail.com> Cc: Konstantin Khorenko <khorenko@virtuozzo.com> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Kees Cook <keescook@chromium.org> --- drivers/video/fbdev/core/fbcon.c | 39 +++++--------------------------- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 5424051c8e1a..622d336cfc81 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -112,7 +112,6 @@ static int softback_lines; static int first_fb_vc; static int last_fb_vc = MAX_NR_CONSOLES - 1; static int fbcon_is_default = 1; -static int fbcon_has_exited; static int primary_device = -1; static int fbcon_has_console_bind; @@ -1050,7 +1049,6 @@ static const char *fbcon_startup(void) info->var.bits_per_pixel); fbcon_add_cursor_timer(info); - fbcon_has_exited = 0; return display_desc; } @@ -1064,9 +1062,13 @@ static void fbcon_init(struct vc_data *vc, int init) int logo = 1, new_rows, new_cols, rows, cols, charcnt = 256; int cap, ret; - if (info_idx == -1 || info == NULL) + if (WARN_ON(info_idx == -1)) return; + if (con2fb_map[vc->vc_num] == -1) + con2fb_map[vc->vc_num] = info_idx; + + info = registered_fb[con2fb_map[vc->vc_num]]; cap = info->flags; if (logo_shown < 0 && console_loglevel <= CONSOLE_LOGLEVEL_QUIET) @@ -3336,14 +3338,6 @@ static int fbcon_event_notify(struct notifier_block *self, struct fb_blit_caps *caps; int idx, ret = 0; - /* - * ignore all events except driver registration and deregistration - * if fbcon is not active - */ - if (fbcon_has_exited && !(action == FB_EVENT_FB_REGISTERED || - action == FB_EVENT_FB_UNREGISTERED)) - goto done; - switch(action) { case FB_EVENT_SUSPEND: fbcon_suspended(info); @@ -3396,7 +3390,6 @@ static int fbcon_event_notify(struct notifier_block *self, fbcon_remap_all(idx); break; } -done: return ret; } @@ -3443,9 +3436,6 @@ static ssize_t store_rotate(struct device *device, int rotate, idx; char **last = NULL; - if (fbcon_has_exited) - return count; - console_lock(); idx = con2fb_map[fg_console]; @@ -3468,9 +3458,6 @@ static ssize_t store_rotate_all(struct device *device, int rotate, idx; char **last = NULL; - if (fbcon_has_exited) - return count; - console_lock(); idx = con2fb_map[fg_console]; @@ -3491,9 +3478,6 @@ static ssize_t show_rotate(struct device *device, struct fb_info *info; int rotate = 0, idx; - if (fbcon_has_exited) - return 0; - console_lock(); idx = con2fb_map[fg_console]; @@ -3514,9 +3498,6 @@ static ssize_t show_cursor_blink(struct device *device, struct fbcon_ops *ops; int idx, blink = -1; - if (fbcon_has_exited) - return 0; - console_lock(); idx = con2fb_map[fg_console]; @@ -3543,9 +3524,6 @@ static ssize_t store_cursor_blink(struct device *device, int blink, idx; char **last = NULL; - if (fbcon_has_exited) - return count; - console_lock(); idx = con2fb_map[fg_console]; @@ -3668,9 +3646,6 @@ static void fbcon_exit(void) struct fb_info *info; int i, j, mapped; - if (fbcon_has_exited) - return; - #ifdef CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER if (deferred_takeover) { dummycon_unregister_output_notifier(&fbcon_output_nb); @@ -3695,7 +3670,7 @@ static void fbcon_exit(void) for (j = first_fb_vc; j <= last_fb_vc; j++) { if (con2fb_map[j] == i) { mapped = 1; - break; + con2fb_map[j] = -1; } } @@ -3718,8 +3693,6 @@ static void fbcon_exit(void) info->queue.func = NULL; } } - - fbcon_has_exited = 1; } void __init fb_console_init(void) -- 2.20.1
On Mon, May 20, 2019 at 10:37:53AM +0200, Thomas Zimmermann wrote: > Hi > > Am 20.05.19 um 10:33 schrieb Thomas Zimmermann: > > Hi > > > > Am 20.05.19 um 10:21 schrieb Daniel Vetter: > > ... > >> diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c > >> index fc3d34a8ea5b..ae2db31eeba7 100644 > >> --- a/drivers/video/fbdev/core/fbmem.c > >> +++ b/drivers/video/fbdev/core/fbmem.c > >> @@ -1660,7 +1660,6 @@ MODULE_PARM_DESC(lockless_register_fb, > >> static int do_register_framebuffer(struct fb_info *fb_info) > >> { > >> int i, ret; > >> - struct fb_event event; > >> struct fb_videomode mode; > >> > >> if (fb_check_foreignness(fb_info)) > >> @@ -1723,7 +1722,6 @@ static int do_register_framebuffer(struct fb_info *fb_info) > >> fb_add_videomode(&mode, &fb_info->modelist); > >> registered_fb[i] = fb_info; > >> > >> - event.info = fb_info; > >> if (!lockless_register_fb) > >> console_lock(); > >> else > >> @@ -1732,9 +1730,8 @@ static int do_register_framebuffer(struct fb_info *fb_info) > >> ret = -ENODEV; > >> goto unlock_console; > >> } > >> - ret = 0; > >> > >> - fb_notifier_call_chain(FB_EVENT_FB_REGISTERED, &event); > >> + ret = fbcon_fb_registered(fb_info); > > > > What about backlight drivers? [1] Apparently these also use the > > notifiers. [2] From my understanding, backlight drivers would stop > > working with this change. > > I just saw that backlight drivers only care about blanking and > unblanking. Never mind then. I did screw this up for one event for the mode changes. But should be fixed in the next series. I also added a patch to simplify the backlight/lcd notifier, since it doesn't need to filter events anymore after this series - the only events left are the ones backlight cares about. Cheers, Daniel > > Best regards > Thomas > > > > > Best regards > > Thomas > > > > [1] > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/video/backlight > > [2] > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/video/backlight/backlight.c#n40 > > > >> unlock_fb_info(fb_info); > >> unlock_console: > >> if (!lockless_register_fb) > >> @@ -1771,7 +1768,6 @@ static int __unlink_framebuffer(struct fb_info *fb_info); > >> > >> static int do_unregister_framebuffer(struct fb_info *fb_info) > >> { > >> - struct fb_event event; > >> int ret; > >> > >> ret = unbind_console(fb_info); > >> @@ -1789,9 +1785,8 @@ static int do_unregister_framebuffer(struct fb_info *fb_info) > >> registered_fb[fb_info->node] = NULL; > >> num_registered_fb--; > >> fb_cleanup_device(fb_info); > >> - event.info = fb_info; > >> console_lock(); > >> - fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event); > >> + fbcon_fb_unregistered(fb_info); > >> console_unlock(); > >> > >> /* this may free fb info */ > >> diff --git a/include/linux/fb.h b/include/linux/fb.h > >> index f52ef0ad6781..701abaf79c87 100644 > >> --- a/include/linux/fb.h > >> +++ b/include/linux/fb.h > >> @@ -136,10 +136,6 @@ struct fb_cursor_user { > >> #define FB_EVENT_RESUME 0x03 > >> /* An entry from the modelist was removed */ > >> #define FB_EVENT_MODE_DELETE 0x04 > >> -/* A driver registered itself */ > >> -#define FB_EVENT_FB_REGISTERED 0x05 > >> -/* A driver unregistered itself */ > >> -#define FB_EVENT_FB_UNREGISTERED 0x06 > >> /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ > >> #define FB_EVENT_GET_CONSOLE_MAP 0x07 > >> /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ > >> diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h > >> index f68a7db14165..94a71e9e1257 100644 > >> --- a/include/linux/fbcon.h > >> +++ b/include/linux/fbcon.h > >> @@ -4,9 +4,13 @@ > >> #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); > >> #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) {} > >> #endif > >> > >> #endif /* _LINUX_FBCON_H */ > >> > > > > -- > Thomas Zimmermann > Graphics Driver Developer > SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany > GF: Felix Imendörffer, Mary Higgins, Sri Rasiah > HRB 21284 (AG Nürnberg) > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
On Mon, May 20, 2019 at 10:37:53AM +0200, Thomas Zimmermann wrote: > Hi > > Am 20.05.19 um 10:33 schrieb Thomas Zimmermann: > > Hi > > > > Am 20.05.19 um 10:21 schrieb Daniel Vetter: > > ... > >> diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c > >> index fc3d34a8ea5b..ae2db31eeba7 100644 > >> --- a/drivers/video/fbdev/core/fbmem.c > >> +++ b/drivers/video/fbdev/core/fbmem.c > >> @@ -1660,7 +1660,6 @@ MODULE_PARM_DESC(lockless_register_fb, > >> static int do_register_framebuffer(struct fb_info *fb_info) > >> { > >> int i, ret; > >> - struct fb_event event; > >> struct fb_videomode mode; > >> > >> if (fb_check_foreignness(fb_info)) > >> @@ -1723,7 +1722,6 @@ static int do_register_framebuffer(struct fb_info *fb_info) > >> fb_add_videomode(&mode, &fb_info->modelist); > >> registered_fb[i] = fb_info; > >> > >> - event.info = fb_info; > >> if (!lockless_register_fb) > >> console_lock(); > >> else > >> @@ -1732,9 +1730,8 @@ static int do_register_framebuffer(struct fb_info *fb_info) > >> ret = -ENODEV; > >> goto unlock_console; > >> } > >> - ret = 0; > >> > >> - fb_notifier_call_chain(FB_EVENT_FB_REGISTERED, &event); > >> + ret = fbcon_fb_registered(fb_info); > > > > What about backlight drivers? [1] Apparently these also use the > > notifiers. [2] From my understanding, backlight drivers would stop > > working with this change. > > I just saw that backlight drivers only care about blanking and > unblanking. Never mind then. I did screw this up for one event for the mode changes. But should be fixed in the next series. I also added a patch to simplify the backlight/lcd notifier, since it doesn't need to filter events anymore after this series - the only events left are the ones backlight cares about. Cheers, Daniel > > Best regards > Thomas > > > > > Best regards > > Thomas > > > > [1] > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/video/backlight > > [2] > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/video/backlight/backlight.c#n40 > > > >> unlock_fb_info(fb_info); > >> unlock_console: > >> if (!lockless_register_fb) > >> @@ -1771,7 +1768,6 @@ static int __unlink_framebuffer(struct fb_info *fb_info); > >> > >> static int do_unregister_framebuffer(struct fb_info *fb_info) > >> { > >> - struct fb_event event; > >> int ret; > >> > >> ret = unbind_console(fb_info); > >> @@ -1789,9 +1785,8 @@ static int do_unregister_framebuffer(struct fb_info *fb_info) > >> registered_fb[fb_info->node] = NULL; > >> num_registered_fb--; > >> fb_cleanup_device(fb_info); > >> - event.info = fb_info; > >> console_lock(); > >> - fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event); > >> + fbcon_fb_unregistered(fb_info); > >> console_unlock(); > >> > >> /* this may free fb info */ > >> diff --git a/include/linux/fb.h b/include/linux/fb.h > >> index f52ef0ad6781..701abaf79c87 100644 > >> --- a/include/linux/fb.h > >> +++ b/include/linux/fb.h > >> @@ -136,10 +136,6 @@ struct fb_cursor_user { > >> #define FB_EVENT_RESUME 0x03 > >> /* An entry from the modelist was removed */ > >> #define FB_EVENT_MODE_DELETE 0x04 > >> -/* A driver registered itself */ > >> -#define FB_EVENT_FB_REGISTERED 0x05 > >> -/* A driver unregistered itself */ > >> -#define FB_EVENT_FB_UNREGISTERED 0x06 > >> /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ > >> #define FB_EVENT_GET_CONSOLE_MAP 0x07 > >> /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ > >> diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h > >> index f68a7db14165..94a71e9e1257 100644 > >> --- a/include/linux/fbcon.h > >> +++ b/include/linux/fbcon.h > >> @@ -4,9 +4,13 @@ > >> #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); > >> #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) {} > >> #endif > >> > >> #endif /* _LINUX_FBCON_H */ > >> > > > > -- > Thomas Zimmermann > Graphics Driver Developer > SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany > GF: Felix Imendörffer, Mary Higgins, Sri Rasiah > HRB 21284 (AG Nürnberg) > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
== Series Details == Series: fbcon notifier begone! (rev2) URL : https://patchwork.freedesktop.org/series/60843/ State : warning == Summary == $ dim checkpatch origin/drm-tip 6712c9a81334 dummycon: Sprinkle locking checks -:45: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 23 lines checked a807564c5c46 fbdev: locking check for fb_set_suspend -:34: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 8 lines checked 2b0293d8a972 vt: might_sleep() annotation for do_blank_screen -:32: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 8 lines checked 1107db55b24f vt: More locking checks -:70: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 38 lines checked 6b47d5be10cd fbdev/sa1100fb: Remove dead code -:52: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 35 lines checked ce4d9b2fd11a fbdev/cyber2000: Remove struct display -:23: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 7 lines checked 79e09a42593a fbdev/aty128fb: Remove dead code -:88: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 70 lines checked c480f8ae010f fbcon: s/struct display/struct fbcon_display/ -:270: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #270: FILE: drivers/video/fbdev/core/fbcon.c:2117: +static void updatescrollmode(struct fbcon_display *p, struct fb_info *info, -:384: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 1 checks, 317 lines checked b1c755e3bb8f fbcon: Remove fbcon_has_exited -:11: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 6104c37094e7 ("fbcon: Make fbcon a built-time depency for fbdev")' #11: commit 6104c37094e729f3d4ce65797002112735d49cd1 -:83: WARNING:SUSPECT_CODE_INDENT: suspect code indent for conditional statements (8, 12) #83: FILE: drivers/video/fbdev/core/fbcon.c:1065: + if (WARN_ON(info_idx == -1)) return; -:193: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 1 errors, 2 warnings, 0 checks, 119 lines checked 80033c659633 fbcon: call fbcon_fb_(un)registered directly -:11: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 6104c37094e7 ("fbcon: Make fbcon a built-time depency for fbdev")' #11: commit 6104c37094e729f3d4ce65797002112735d49cd1 -:168: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 1 errors, 1 warnings, 0 checks, 108 lines checked 684dfc3fee3d fbdev/sh_mobile: remove sh_mobile_lcdc_display_notify b52f0088fedd fbdev/omap: sysfs files can't disappear before the device is gone b65ada7e2f30 fbdev: sysfs files can't disappear before the device is gone 00c9c79479b0 staging/olpc: lock_fb_info can't fail b5cd1d8e1556 fbdev/atyfb: lock_fb_info can't fail 3b25c5813357 fbdev: lock_fb_info cannot fail -:11: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit c47747fde931 ("fbmem: make read/write/ioctl use the frame buffer at open time")' #11: commit c47747fde931c02455683bd00ea43eaa62f35b0e -:307: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 1 errors, 1 warnings, 0 checks, 212 lines checked c18a204aafc8 fbcon: call fbcon_fb_bind directly -:160: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 107 lines checked 8fac90eead5b fbdev: make unregister/unlink functions not fail -:209: CHECK:AVOID_EXTERNS: extern prototypes should be avoided in .h files #209: FILE: include/linux/fb.h:630: +extern void unregister_framebuffer(struct fb_info *fb_info); -:210: CHECK:AVOID_EXTERNS: extern prototypes should be avoided in .h files #210: FILE: include/linux/fb.h:631: +extern void unlink_framebuffer(struct fb_info *fb_info); -:213: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 2 checks, 174 lines checked 0a4973898b2e fbdev: unify unlink_framebufer paths -:92: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 63 lines checked a391d13a2e4c fbdev/sh_mob: Remove fb notifier callback -:21: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 6011bdeaa608 ("fbdev: sh-mobile: HDMI support for SH-Mobile SoCs")' #21: commit 6011bdeaa6089d49c02de69f05980da7bad314ab -:107: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 1 errors, 1 warnings, 0 checks, 62 lines checked d2190c7ac272 fbdev: directly call fbcon_suspended/resumed -:126: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 77 lines checked cdd591ad9935 fbcon: Call fbcon_mode_deleted/new_modelist directly -:175: ERROR:OPEN_BRACE: open brace '{' following function definitions go on the next line #175: FILE: include/linux/fbcon.h:23: +int fbcon_mode_deleted(struct fb_info *info, + struct fb_videomode *mode) { return 0; } -:180: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 1 errors, 1 warnings, 0 checks, 123 lines checked 16a60c108b07 fbdev: Call fbcon_get_requirement directly -:112: ERROR:OPEN_BRACE: open brace '{' following function definitions go on the next line #112: FILE: include/linux/fbcon.h:28: +void fbcon_get_requirement(struct fb_info *info, + struct fb_blit_caps *caps) {} -:116: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 1 errors, 1 warnings, 0 checks, 68 lines checked e4067cf40df6 Revert "backlight/fbcon: Add FB_EVENT_CONBLANK" -:83: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 42 lines checked b7dc5daa5c88 fbcon: directly call fbcon_fb_blanked -:76: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 38 lines checked bbbe080b70df fbmem: pull fbcon_fb_blanked out of fb_blank -:84: WARNING:CONSIDER_KSTRTO: simple_strtoul is obsolete, use kstrtoul instead #84: FILE: drivers/video/fbdev/core/fbsysfs.c:311: + arg = simple_strtoul(buf, &last, 0); -:94: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 2 warnings, 0 checks, 40 lines checked efc27439fc17 fbdev: remove FBINFO_MISC_USEREVENT around fb_blank -:67: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 30 lines checked 4d7bf4833e17 fb: Flatten control flow in fb_set_var -:141: WARNING:PREFER_PR_LEVEL: Prefer [subsystem eg: netdev]_warn([subsystem]dev, ... then dev_warn(dev, ... then pr_warn(... to printk(KERN_WARNING ... #141: FILE: drivers/video/fbdev/core/fbmem.c:1027: + printk(KERN_WARNING "detected " -:188: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 2 warnings, 0 checks, 156 lines checked a8e1ee647c16 fbcon: replace FB_EVENT_MODE_CHANGE/_ALL with direct calls -:46: CHECK:LINE_SPACING: Please don't use multiple blank lines #46: FILE: drivers/video/fbdev/core/fbcon.c:3012: + -:164: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 1 checks, 107 lines checked a6b267d69013 vgaswitcheroo: call fbcon_remap_all directly -:127: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 82 lines checked 20c0d8a6a167 fbcon: Call con2fb_map functions directly -:73: WARNING:BRACES: braces {} are not necessary for single statement blocks #73: FILE: drivers/video/fbdev/core/fbcon.c:3335: + if (!registered_fb[con2fb.framebuffer]) { + return -EINVAL; } -:208: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 2 warnings, 0 checks, 156 lines checked 99cd5e3bdf8f fbcon: Document what I learned about fbcon locking -:44: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 25 lines checked f3dfc3547c56 staging/olpc_dcon: Add drm conversion to TODO -:38: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>' total: 0 errors, 1 warnings, 0 checks, 11 lines checked _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
== Series Details == Series: fbcon notifier begone! (rev2) URL : https://patchwork.freedesktop.org/series/60843/ State : warning == Summary == $ dim sparse origin/drm-tip Sparse version: v0.5.2 Commit: dummycon: Sprinkle locking checks Okay! Commit: fbdev: locking check for fb_set_suspend Okay! Commit: vt: might_sleep() annotation for do_blank_screen Okay! Commit: vt: More locking checks Okay! Commit: fbdev/sa1100fb: Remove dead code Okay! Commit: fbdev/cyber2000: Remove struct display Okay! Commit: fbdev/aty128fb: Remove dead code Okay! Commit: fbcon: s/struct display/struct fbcon_display/ Okay! Commit: fbcon: Remove fbcon_has_exited Okay! Commit: fbcon: call fbcon_fb_(un)registered directly Okay! Commit: fbdev/sh_mobile: remove sh_mobile_lcdc_display_notify Okay! Commit: fbdev/omap: sysfs files can't disappear before the device is gone Okay! Commit: fbdev: sysfs files can't disappear before the device is gone Okay! Commit: staging/olpc: lock_fb_info can't fail Okay! Commit: fbdev/atyfb: lock_fb_info can't fail Okay! Commit: fbdev: lock_fb_info cannot fail Okay! Commit: fbcon: call fbcon_fb_bind directly Okay! Commit: fbdev: make unregister/unlink functions not fail Okay! Commit: fbdev: unify unlink_framebufer paths Okay! Commit: fbdev/sh_mob: Remove fb notifier callback Okay! Commit: fbdev: directly call fbcon_suspended/resumed Okay! Commit: fbcon: Call fbcon_mode_deleted/new_modelist directly Okay! Commit: fbdev: Call fbcon_get_requirement directly Okay! Commit: Revert "backlight/fbcon: Add FB_EVENT_CONBLANK" Okay! Commit: fbcon: directly call fbcon_fb_blanked Okay! Commit: fbmem: pull fbcon_fb_blanked out of fb_blank Okay! Commit: fbdev: remove FBINFO_MISC_USEREVENT around fb_blank Okay! Commit: fb: Flatten control flow in fb_set_var Okay! Commit: fbcon: replace FB_EVENT_MODE_CHANGE/_ALL with direct calls Okay! Commit: vgaswitcheroo: call fbcon_remap_all directly Okay! Commit: fbcon: Call con2fb_map functions directly Okay! _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
== Series Details == Series: fbcon notifier begone! (rev2) URL : https://patchwork.freedesktop.org/series/60843/ State : failure == Summary == CI Bug Log - changes from CI_DRM_6114 -> Patchwork_13061 ==================================================== Summary ------- **FAILURE** Serious unknown changes coming with Patchwork_13061 absolutely need to be verified manually. If you think the reported changes have nothing to do with the changes introduced in Patchwork_13061, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI. External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/ Possible new issues ------------------- Here are the unknown changes that may have been introduced in Patchwork_13061: ### IGT changes ### #### Possible regressions #### * igt@prime_busy@basic-after-default: - fi-apl-guc: [PASS][1] -> [FAIL][2] [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/fi-apl-guc/igt@prime_busy@basic-after-default.html [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/fi-apl-guc/igt@prime_busy@basic-after-default.html Known issues ------------ Here are the changes found in Patchwork_13061 that come from known issues: ### IGT changes ### #### Issues hit #### * igt@i915_selftest@live_hangcheck: - fi-skl-iommu: [PASS][3] -> [INCOMPLETE][4] ([fdo#108602] / [fdo#108744]) [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/fi-skl-iommu/igt@i915_selftest@live_hangcheck.html [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/fi-skl-iommu/igt@i915_selftest@live_hangcheck.html * igt@kms_chamelium@hdmi-hpd-fast: - fi-kbl-7500u: [PASS][5] -> [FAIL][6] ([fdo#109485]) [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html #### Possible fixes #### * igt@i915_selftest@live_contexts: - fi-bdw-gvtdvm: [DMESG-FAIL][7] ([fdo#110235]) -> [PASS][8] [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/fi-bdw-gvtdvm/igt@i915_selftest@live_contexts.html [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/fi-bdw-gvtdvm/igt@i915_selftest@live_contexts.html - fi-skl-gvtdvm: [DMESG-FAIL][9] ([fdo#110235]) -> [PASS][10] [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/fi-skl-gvtdvm/igt@i915_selftest@live_contexts.html [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/fi-skl-gvtdvm/igt@i915_selftest@live_contexts.html #### Warnings #### * igt@i915_selftest@live_hangcheck: - fi-apl-guc: [FAIL][11] ([fdo#110623]) -> [DMESG-FAIL][12] ([fdo#110620]) [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/fi-apl-guc/igt@i915_selftest@live_hangcheck.html [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/fi-apl-guc/igt@i915_selftest@live_hangcheck.html [fdo#108602]: https://bugs.freedesktop.org/show_bug.cgi?id=108602 [fdo#108744]: https://bugs.freedesktop.org/show_bug.cgi?id=108744 [fdo#109485]: https://bugs.freedesktop.org/show_bug.cgi?id=109485 [fdo#110235]: https://bugs.freedesktop.org/show_bug.cgi?id=110235 [fdo#110620]: https://bugs.freedesktop.org/show_bug.cgi?id=110620 [fdo#110623]: https://bugs.freedesktop.org/show_bug.cgi?id=110623 Participating hosts (53 -> 43) ------------------------------ Missing (10): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-byt-clapper fi-icl-u3 fi-icl-y fi-icl-dsi fi-bdw-samus Build changes ------------- * Linux: CI_DRM_6114 -> Patchwork_13061 CI_DRM_6114: 8691fe536e41c852d3d420ed09b1d5f9916031e7 @ git://anongit.freedesktop.org/gfx-ci/linux IGT_5000: f9961d14d76b3a0fa1296e547f7c065e2f93955c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools Patchwork_13061: f3dfc3547c56a5c790767e8690b5aea45dcdf2b3 @ git://anongit.freedesktop.org/gfx-ci/linux == Linux commits == f3dfc3547c56 staging/olpc_dcon: Add drm conversion to TODO 99cd5e3bdf8f fbcon: Document what I learned about fbcon locking 20c0d8a6a167 fbcon: Call con2fb_map functions directly a6b267d69013 vgaswitcheroo: call fbcon_remap_all directly a8e1ee647c16 fbcon: replace FB_EVENT_MODE_CHANGE/_ALL with direct calls 4d7bf4833e17 fb: Flatten control flow in fb_set_var efc27439fc17 fbdev: remove FBINFO_MISC_USEREVENT around fb_blank bbbe080b70df fbmem: pull fbcon_fb_blanked out of fb_blank b7dc5daa5c88 fbcon: directly call fbcon_fb_blanked e4067cf40df6 Revert "backlight/fbcon: Add FB_EVENT_CONBLANK" 16a60c108b07 fbdev: Call fbcon_get_requirement directly cdd591ad9935 fbcon: Call fbcon_mode_deleted/new_modelist directly d2190c7ac272 fbdev: directly call fbcon_suspended/resumed a391d13a2e4c fbdev/sh_mob: Remove fb notifier callback 0a4973898b2e fbdev: unify unlink_framebufer paths 8fac90eead5b fbdev: make unregister/unlink functions not fail c18a204aafc8 fbcon: call fbcon_fb_bind directly 3b25c5813357 fbdev: lock_fb_info cannot fail b5cd1d8e1556 fbdev/atyfb: lock_fb_info can't fail 00c9c79479b0 staging/olpc: lock_fb_info can't fail b65ada7e2f30 fbdev: sysfs files can't disappear before the device is gone b52f0088fedd fbdev/omap: sysfs files can't disappear before the device is gone 684dfc3fee3d fbdev/sh_mobile: remove sh_mobile_lcdc_display_notify 80033c659633 fbcon: call fbcon_fb_(un)registered directly b1c755e3bb8f fbcon: Remove fbcon_has_exited c480f8ae010f fbcon: s/struct display/struct fbcon_display/ 79e09a42593a fbdev/aty128fb: Remove dead code ce4d9b2fd11a fbdev/cyber2000: Remove struct display 6b47d5be10cd fbdev/sa1100fb: Remove dead code 1107db55b24f vt: More locking checks 2b0293d8a972 vt: might_sleep() annotation for do_blank_screen a807564c5c46 fbdev: locking check for fb_set_suspend 6712c9a81334 dummycon: Sprinkle locking checks == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/ _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
== Series Details == Series: fbcon notifier begone! (rev2) URL : https://patchwork.freedesktop.org/series/60843/ State : success == Summary == CI Bug Log - changes from CI_DRM_6114 -> Patchwork_13061 ==================================================== Summary ------- **SUCCESS** No regressions found. External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/ Known issues ------------ Here are the changes found in Patchwork_13061 that come from known issues: ### IGT changes ### #### Issues hit #### * igt@i915_selftest@live_hangcheck: - fi-skl-iommu: [PASS][1] -> [INCOMPLETE][2] ([fdo#108602] / [fdo#108744]) [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/fi-skl-iommu/igt@i915_selftest@live_hangcheck.html [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/fi-skl-iommu/igt@i915_selftest@live_hangcheck.html * igt@kms_chamelium@hdmi-hpd-fast: - fi-kbl-7500u: [PASS][3] -> [FAIL][4] ([fdo#109485]) [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html * igt@prime_busy@basic-after-default: - fi-apl-guc: [PASS][5] -> [FAIL][6] ([fdo#110722]) [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/fi-apl-guc/igt@prime_busy@basic-after-default.html [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/fi-apl-guc/igt@prime_busy@basic-after-default.html #### Possible fixes #### * igt@i915_selftest@live_contexts: - fi-bdw-gvtdvm: [DMESG-FAIL][7] ([fdo#110235]) -> [PASS][8] [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/fi-bdw-gvtdvm/igt@i915_selftest@live_contexts.html [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/fi-bdw-gvtdvm/igt@i915_selftest@live_contexts.html - fi-skl-gvtdvm: [DMESG-FAIL][9] ([fdo#110235]) -> [PASS][10] [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/fi-skl-gvtdvm/igt@i915_selftest@live_contexts.html [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/fi-skl-gvtdvm/igt@i915_selftest@live_contexts.html #### Warnings #### * igt@i915_selftest@live_hangcheck: - fi-apl-guc: [FAIL][11] ([fdo#110623]) -> [DMESG-FAIL][12] ([fdo#110620]) [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/fi-apl-guc/igt@i915_selftest@live_hangcheck.html [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/fi-apl-guc/igt@i915_selftest@live_hangcheck.html [fdo#108602]: https://bugs.freedesktop.org/show_bug.cgi?id=108602 [fdo#108744]: https://bugs.freedesktop.org/show_bug.cgi?id=108744 [fdo#109485]: https://bugs.freedesktop.org/show_bug.cgi?id=109485 [fdo#110235]: https://bugs.freedesktop.org/show_bug.cgi?id=110235 [fdo#110620]: https://bugs.freedesktop.org/show_bug.cgi?id=110620 [fdo#110623]: https://bugs.freedesktop.org/show_bug.cgi?id=110623 [fdo#110722]: https://bugs.freedesktop.org/show_bug.cgi?id=110722 Participating hosts (53 -> 43) ------------------------------ Missing (10): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-byt-clapper fi-icl-u3 fi-icl-y fi-icl-dsi fi-bdw-samus Build changes ------------- * Linux: CI_DRM_6114 -> Patchwork_13061 CI_DRM_6114: 8691fe536e41c852d3d420ed09b1d5f9916031e7 @ git://anongit.freedesktop.org/gfx-ci/linux IGT_5000: f9961d14d76b3a0fa1296e547f7c065e2f93955c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools Patchwork_13061: f3dfc3547c56a5c790767e8690b5aea45dcdf2b3 @ git://anongit.freedesktop.org/gfx-ci/linux == Linux commits == f3dfc3547c56 staging/olpc_dcon: Add drm conversion to TODO 99cd5e3bdf8f fbcon: Document what I learned about fbcon locking 20c0d8a6a167 fbcon: Call con2fb_map functions directly a6b267d69013 vgaswitcheroo: call fbcon_remap_all directly a8e1ee647c16 fbcon: replace FB_EVENT_MODE_CHANGE/_ALL with direct calls 4d7bf4833e17 fb: Flatten control flow in fb_set_var efc27439fc17 fbdev: remove FBINFO_MISC_USEREVENT around fb_blank bbbe080b70df fbmem: pull fbcon_fb_blanked out of fb_blank b7dc5daa5c88 fbcon: directly call fbcon_fb_blanked e4067cf40df6 Revert "backlight/fbcon: Add FB_EVENT_CONBLANK" 16a60c108b07 fbdev: Call fbcon_get_requirement directly cdd591ad9935 fbcon: Call fbcon_mode_deleted/new_modelist directly d2190c7ac272 fbdev: directly call fbcon_suspended/resumed a391d13a2e4c fbdev/sh_mob: Remove fb notifier callback 0a4973898b2e fbdev: unify unlink_framebufer paths 8fac90eead5b fbdev: make unregister/unlink functions not fail c18a204aafc8 fbcon: call fbcon_fb_bind directly 3b25c5813357 fbdev: lock_fb_info cannot fail b5cd1d8e1556 fbdev/atyfb: lock_fb_info can't fail 00c9c79479b0 staging/olpc: lock_fb_info can't fail b65ada7e2f30 fbdev: sysfs files can't disappear before the device is gone b52f0088fedd fbdev/omap: sysfs files can't disappear before the device is gone 684dfc3fee3d fbdev/sh_mobile: remove sh_mobile_lcdc_display_notify 80033c659633 fbcon: call fbcon_fb_(un)registered directly b1c755e3bb8f fbcon: Remove fbcon_has_exited c480f8ae010f fbcon: s/struct display/struct fbcon_display/ 79e09a42593a fbdev/aty128fb: Remove dead code ce4d9b2fd11a fbdev/cyber2000: Remove struct display 6b47d5be10cd fbdev/sa1100fb: Remove dead code 1107db55b24f vt: More locking checks 2b0293d8a972 vt: might_sleep() annotation for do_blank_screen a807564c5c46 fbdev: locking check for fb_set_suspend 6712c9a81334 dummycon: Sprinkle locking checks == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/ _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Hi Daniel,
On 5/21/19 4:23 PM, Daniel Vetter wrote:
> This is unused code since
>
> commit 6104c37094e729f3d4ce65797002112735d49cd1
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date: Tue Aug 1 17:32:07 2017 +0200
>
> fbcon: Make fbcon a built-time depency for fbdev
>
> when fbcon was made a compile-time static dependency of fbdev. We
> can't exit fbcon anymore without exiting fbdev first, which only works
> if all fbdev drivers have unloaded already. Hence this is all dead
> code.
>
> v2: I missed that fbcon_exit is also called from con_deinit stuff, and
> there fbcon_has_exited prevents double-cleanup. But we can fix that
> by properly resetting con2fb_map[] to all -1, which is used everywhere
> else to indicate "no fb_info allocate to this console". With that
> change the double-cleanup (which resulted in a module refcount underflow,
> among other things) is prevented.
>
> Aside: con2fb_map is a signed char, so don't register more than 128 fb_info
> or hilarity will ensue.
>
> v3: CI showed me that I still didn't fully understand what's going on
> here. The leaked references in con2fb_map have been used upon
> rebinding the fb console in fbcon_init. It worked because fbdev
> unregistering still cleaned out con2fb_map, and reset it to info_idx.
> If the last fbdev driver unregistered, then it also reset info_idx,
> and unregistered the fbcon driver.
>
> Imo that's all a bit fragile, so let's keep the con2fb_map reset to
> -1, and in fbcon_init pick info_idx if we're starting fresh. That
> means unbinding and rebinding will cleanse the mapping, but why are
> you doing that if you want to retain the mapping, so should be fine.
>
> Also, I think info_idx == -1 is impossible in fbcon_init - we
> unregister the fbcon in that case. So catch&warn about that.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: "Noralf Trønnes" <noralf@tronnes.org>
> Cc: Yisheng Xie <ysxie@foxmail.com>
> Cc: Konstantin Khorenko <khorenko@virtuozzo.com>
> Cc: Prarit Bhargava <prarit@redhat.com>
> Cc: Kees Cook <keescook@chromium.org>
> ---
> drivers/video/fbdev/core/fbcon.c | 39 +++++---------------------------
> 1 file changed, 6 insertions(+), 33 deletions(-)
This patch was #09/33 in your patch series, now it is independent change.
Do you want me to apply it now or should I wait for the new version of
the whole series?
[ I looked at all patches in the series and they look fine to me.
After outstanding issues are fixed I'll be happy to apply them all
to fbdev-for-next (I can create immutable branch if needed). ]
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
Hi Daniel, On 5/21/19 4:23 PM, Daniel Vetter wrote: > This is unused code since > > commit 6104c37094e729f3d4ce65797002112735d49cd1 > Author: Daniel Vetter <daniel.vetter@ffwll.ch> > Date: Tue Aug 1 17:32:07 2017 +0200 > > fbcon: Make fbcon a built-time depency for fbdev > > when fbcon was made a compile-time static dependency of fbdev. We > can't exit fbcon anymore without exiting fbdev first, which only works > if all fbdev drivers have unloaded already. Hence this is all dead > code. > > v2: I missed that fbcon_exit is also called from con_deinit stuff, and > there fbcon_has_exited prevents double-cleanup. But we can fix that > by properly resetting con2fb_map[] to all -1, which is used everywhere > else to indicate "no fb_info allocate to this console". With that > change the double-cleanup (which resulted in a module refcount underflow, > among other things) is prevented. > > Aside: con2fb_map is a signed char, so don't register more than 128 fb_info > or hilarity will ensue. > > v3: CI showed me that I still didn't fully understand what's going on > here. The leaked references in con2fb_map have been used upon > rebinding the fb console in fbcon_init. It worked because fbdev > unregistering still cleaned out con2fb_map, and reset it to info_idx. > If the last fbdev driver unregistered, then it also reset info_idx, > and unregistered the fbcon driver. > > Imo that's all a bit fragile, so let's keep the con2fb_map reset to > -1, and in fbcon_init pick info_idx if we're starting fresh. That > means unbinding and rebinding will cleanse the mapping, but why are > you doing that if you want to retain the mapping, so should be fine. > > Also, I think info_idx == -1 is impossible in fbcon_init - we > unregister the fbcon in that case. So catch&warn about that. > > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> > Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch> > Cc: Hans de Goede <hdegoede@redhat.com> > Cc: "Noralf Trønnes" <noralf@tronnes.org> > Cc: Yisheng Xie <ysxie@foxmail.com> > Cc: Konstantin Khorenko <khorenko@virtuozzo.com> > Cc: Prarit Bhargava <prarit@redhat.com> > Cc: Kees Cook <keescook@chromium.org> > --- > drivers/video/fbdev/core/fbcon.c | 39 +++++--------------------------- > 1 file changed, 6 insertions(+), 33 deletions(-) This patch was #09/33 in your patch series, now it is independent change. Do you want me to apply it now or should I wait for the new version of the whole series? [ I looked at all patches in the series and they look fine to me. After outstanding issues are fixed I'll be happy to apply them all to fbdev-for-next (I can create immutable branch if needed). ] Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
On Wed, May 22, 2019 at 12:04 PM Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> wrote: > > > Hi Daniel, > > On 5/21/19 4:23 PM, Daniel Vetter wrote: > > This is unused code since > > > > commit 6104c37094e729f3d4ce65797002112735d49cd1 > > Author: Daniel Vetter <daniel.vetter@ffwll.ch> > > Date: Tue Aug 1 17:32:07 2017 +0200 > > > > fbcon: Make fbcon a built-time depency for fbdev > > > > when fbcon was made a compile-time static dependency of fbdev. We > > can't exit fbcon anymore without exiting fbdev first, which only works > > if all fbdev drivers have unloaded already. Hence this is all dead > > code. > > > > v2: I missed that fbcon_exit is also called from con_deinit stuff, and > > there fbcon_has_exited prevents double-cleanup. But we can fix that > > by properly resetting con2fb_map[] to all -1, which is used everywhere > > else to indicate "no fb_info allocate to this console". With that > > change the double-cleanup (which resulted in a module refcount underflow, > > among other things) is prevented. > > > > Aside: con2fb_map is a signed char, so don't register more than 128 fb_info > > or hilarity will ensue. > > > > v3: CI showed me that I still didn't fully understand what's going on > > here. The leaked references in con2fb_map have been used upon > > rebinding the fb console in fbcon_init. It worked because fbdev > > unregistering still cleaned out con2fb_map, and reset it to info_idx. > > If the last fbdev driver unregistered, then it also reset info_idx, > > and unregistered the fbcon driver. > > > > Imo that's all a bit fragile, so let's keep the con2fb_map reset to > > -1, and in fbcon_init pick info_idx if we're starting fresh. That > > means unbinding and rebinding will cleanse the mapping, but why are > > you doing that if you want to retain the mapping, so should be fine. > > > > Also, I think info_idx == -1 is impossible in fbcon_init - we > > unregister the fbcon in that case. So catch&warn about that. > > > > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> > > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> > > Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> > > Cc: Daniel Vetter <daniel.vetter@ffwll.ch> > > Cc: Hans de Goede <hdegoede@redhat.com> > > Cc: "Noralf Trønnes" <noralf@tronnes.org> > > Cc: Yisheng Xie <ysxie@foxmail.com> > > Cc: Konstantin Khorenko <khorenko@virtuozzo.com> > > Cc: Prarit Bhargava <prarit@redhat.com> > > Cc: Kees Cook <keescook@chromium.org> > > --- > > drivers/video/fbdev/core/fbcon.c | 39 +++++--------------------------- > > 1 file changed, 6 insertions(+), 33 deletions(-) > This patch was #09/33 in your patch series, now it is independent change. > > Do you want me to apply it now or should I wait for the new version of > the whole series? It's an in-reply-to replacement for the totally broken one, so that patchwork picks things up correctly (and therefore our CI). I'm not sure how far that convention is used beyond dri-devel ... I did fix up all the issues pointed out thus far, but I haven't fully appeased our CI just yet. Once that's done I'll resend. Thanks, Daniel > [ I looked at all patches in the series and they look fine to me. > After outstanding issues are fixed I'll be happy to apply them all > to fbdev-for-next (I can create immutable branch if needed). ] > > Best regards, > -- > Bartlomiej Zolnierkiewicz > Samsung R&D Institute Poland > Samsung Electronics -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
== Series Details == Series: fbcon notifier begone! (rev2) URL : https://patchwork.freedesktop.org/series/60843/ State : success == Summary == CI Bug Log - changes from CI_DRM_6114_full -> Patchwork_13061_full ==================================================== Summary ------- **SUCCESS** No regressions found. Known issues ------------ Here are the changes found in Patchwork_13061_full that come from known issues: ### IGT changes ### #### Issues hit #### * igt@gem_eio@reset-stress: - shard-snb: [PASS][1] -> [FAIL][2] ([fdo#109661]) [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/shard-snb1/igt@gem_eio@reset-stress.html [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/shard-snb1/igt@gem_eio@reset-stress.html * igt@gem_pwrite@small-gtt-forwards: - shard-hsw: [PASS][3] -> [INCOMPLETE][4] ([fdo#103540]) [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/shard-hsw7/igt@gem_pwrite@small-gtt-forwards.html [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/shard-hsw1/igt@gem_pwrite@small-gtt-forwards.html * igt@gem_softpin@noreloc-s3: - shard-apl: [PASS][5] -> [DMESG-WARN][6] ([fdo#108566]) +3 similar issues [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/shard-apl2/igt@gem_softpin@noreloc-s3.html [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/shard-apl5/igt@gem_softpin@noreloc-s3.html * igt@i915_pm_rpm@i2c: - shard-skl: [PASS][7] -> [INCOMPLETE][8] ([fdo#107807]) +1 similar issue [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/shard-skl3/igt@i915_pm_rpm@i2c.html [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/shard-skl7/igt@i915_pm_rpm@i2c.html * igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size: - shard-kbl: [PASS][9] -> [FAIL][10] ([fdo#102670]) [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/shard-kbl7/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/shard-kbl4/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html - shard-hsw: [PASS][11] -> [FAIL][12] ([fdo#102670]) [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/shard-hsw7/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/shard-hsw1/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html * igt@kms_flip@flip-vs-suspend-interruptible: - shard-skl: [PASS][13] -> [INCOMPLETE][14] ([fdo#109507]) [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/shard-skl1/igt@kms_flip@flip-vs-suspend-interruptible.html [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/shard-skl5/igt@kms_flip@flip-vs-suspend-interruptible.html * igt@kms_vblank@pipe-a-ts-continuation-suspend: - shard-glk: [PASS][15] -> [INCOMPLETE][16] ([fdo#103359] / [k.org#198133]) [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/shard-glk4/igt@kms_vblank@pipe-a-ts-continuation-suspend.html [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/shard-glk1/igt@kms_vblank@pipe-a-ts-continuation-suspend.html #### Possible fixes #### * igt@gem_eio@in-flight-suspend: - shard-apl: [FAIL][17] -> [PASS][18] [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/shard-apl7/igt@gem_eio@in-flight-suspend.html [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/shard-apl4/igt@gem_eio@in-flight-suspend.html * igt@gem_pwrite@big-gtt-forwards: - shard-glk: [INCOMPLETE][19] ([fdo#103359] / [k.org#198133]) -> [PASS][20] [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/shard-glk5/igt@gem_pwrite@big-gtt-forwards.html [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/shard-glk8/igt@gem_pwrite@big-gtt-forwards.html * igt@i915_pm_rpm@fences: - shard-skl: [INCOMPLETE][21] ([fdo#107807]) -> [PASS][22] [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/shard-skl4/igt@i915_pm_rpm@fences.html [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/shard-skl6/igt@i915_pm_rpm@fences.html * igt@i915_suspend@fence-restore-tiled2untiled: - shard-skl: [INCOMPLETE][23] ([fdo#104108]) -> [PASS][24] [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/shard-skl2/igt@i915_suspend@fence-restore-tiled2untiled.html [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/shard-skl10/igt@i915_suspend@fence-restore-tiled2untiled.html * igt@kms_atomic_interruptible@universal-setplane-primary: - shard-apl: [INCOMPLETE][25] ([fdo#103927]) -> [PASS][26] +1 similar issue [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/shard-apl5/igt@kms_atomic_interruptible@universal-setplane-primary.html [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/shard-apl4/igt@kms_atomic_interruptible@universal-setplane-primary.html * igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size: - shard-skl: [FAIL][27] ([fdo#102670]) -> [PASS][28] [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/shard-skl4/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/shard-skl6/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-indfb-draw-pwrite: - shard-skl: [FAIL][29] ([fdo#108040]) -> [PASS][30] [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/shard-skl3/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-indfb-draw-pwrite.html [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/shard-skl2/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-indfb-draw-pwrite.html * igt@kms_plane_alpha_blend@pipe-b-coverage-7efc: - shard-skl: [FAIL][31] ([fdo#108145] / [fdo#110403]) -> [PASS][32] [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/shard-skl8/igt@kms_plane_alpha_blend@pipe-b-coverage-7efc.html [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/shard-skl8/igt@kms_plane_alpha_blend@pipe-b-coverage-7efc.html * igt@kms_setmode@basic: - shard-apl: [FAIL][33] ([fdo#99912]) -> [PASS][34] [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/shard-apl3/igt@kms_setmode@basic.html [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/shard-apl1/igt@kms_setmode@basic.html * igt@kms_vblank@pipe-c-ts-continuation-suspend: - shard-apl: [DMESG-WARN][35] ([fdo#108566]) -> [PASS][36] +3 similar issues [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6114/shard-apl8/igt@kms_vblank@pipe-c-ts-continuation-suspend.html [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/shard-apl2/igt@kms_vblank@pipe-c-ts-continuation-suspend.html [fdo#102670]: https://bugs.freedesktop.org/show_bug.cgi?id=102670 [fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359 [fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540 [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927 [fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108 [fdo#107807]: https://bugs.freedesktop.org/show_bug.cgi?id=107807 [fdo#108040]: https://bugs.freedesktop.org/show_bug.cgi?id=108040 [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145 [fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566 [fdo#109507]: https://bugs.freedesktop.org/show_bug.cgi?id=109507 [fdo#109661]: https://bugs.freedesktop.org/show_bug.cgi?id=109661 [fdo#110403]: https://bugs.freedesktop.org/show_bug.cgi?id=110403 [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912 [k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133 Participating hosts (10 -> 9) ------------------------------ Missing (1): shard-iclb Build changes ------------- * Linux: CI_DRM_6114 -> Patchwork_13061 CI_DRM_6114: 8691fe536e41c852d3d420ed09b1d5f9916031e7 @ git://anongit.freedesktop.org/gfx-ci/linux IGT_5000: f9961d14d76b3a0fa1296e547f7c065e2f93955c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools Patchwork_13061: f3dfc3547c56a5c790767e8690b5aea45dcdf2b3 @ git://anongit.freedesktop.org/gfx-ci/linux piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13061/ _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx