Skip to content

Commit d609f60

Browse files
committed
Merge branch 'topic/remove-fbcon-notifiers' into drm-misc-next
topic/remove-fbcon-notifiers: - remove fbdev notifier usage for fbcon, as prep work to clean up the fbcon locking - assorted locking checks in vt/console code - assorted notifier and cleanups in fbdev and backlight code This is the pull request that was sent out, plus the compile fix for sh4 reported by kbuild. Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2 parents bcb7416 + 2443091 commit d609f60

27 files changed

Lines changed: 397 additions & 782 deletions

File tree

‎arch/arm/mach-pxa/am200epd.c‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,17 @@ int __init am200_init(void)
347347
{
348348
int ret;
349349

350-
/* before anything else, we request notification for any fb
351-
* creation events */
350+
/*
351+
* Before anything else, we request notification for any fb
352+
* creation events.
353+
*
354+
* FIXME: This is terrible and needs to be nuked. The notifier is used
355+
* to get at the fb base address from the boot splash fb driver, which
356+
* is then passed to metronomefb. Instaed of metronomfb or this board
357+
* support file here figuring this out on their own.
358+
*
359+
* See also the #ifdef in fbmem.c.
360+
*/
352361
fb_register_client(&am200_fb_notif);
353362

354363
pxa2xx_mfp_config(ARRAY_AND_SIZE(am200_pin_config));

‎drivers/gpu/vga/vga_switcheroo.c‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <linux/debugfs.h>
3636
#include <linux/fb.h>
3737
#include <linux/fs.h>
38+
#include <linux/fbcon.h>
3839
#include <linux/module.h>
3940
#include <linux/pci.h>
4041
#include <linux/pm_domain.h>
@@ -734,14 +735,8 @@ static int vga_switchto_stage2(struct vga_switcheroo_client *new_client)
734735
if (!active->driver_power_control)
735736
set_audio_state(active->id, VGA_SWITCHEROO_OFF);
736737

737-
if (new_client->fb_info) {
738-
struct fb_event event;
739-
740-
console_lock();
741-
event.info = new_client->fb_info;
742-
fb_notifier_call_chain(FB_EVENT_REMAP_ALL_CONSOLE, &event);
743-
console_unlock();
744-
}
738+
if (new_client->fb_info)
739+
fbcon_remap_all(new_client->fb_info);
745740

746741
mutex_lock(&vgasr_priv.mux_hw_lock);
747742
ret = vgasr_priv.handler->switchto(new_client->id);

‎drivers/media/pci/ivtv/ivtvfb.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,11 +1246,7 @@ static int ivtvfb_callback_cleanup(struct device *dev, void *p)
12461246
struct osd_info *oi = itv->osd_info;
12471247

12481248
if (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT) {
1249-
if (unregister_framebuffer(&itv->osd_info->ivtvfb_info)) {
1250-
IVTVFB_WARN("Framebuffer %d is in use, cannot unload\n",
1251-
itv->instance);
1252-
return 0;
1253-
}
1249+
unregister_framebuffer(&itv->osd_info->ivtvfb_info);
12541250
IVTVFB_INFO("Unregister framebuffer %d\n", itv->instance);
12551251
itv->ivtvfb_restore = NULL;
12561252
ivtvfb_blank(FB_BLANK_VSYNC_SUSPEND, &oi->ivtvfb_info);

‎drivers/staging/fbtft/fbtft-core.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,9 @@ int fbtft_unregister_framebuffer(struct fb_info *fb_info)
891891
if (par->fbtftops.unregister_backlight)
892892
par->fbtftops.unregister_backlight(par);
893893
fbtft_sysfs_exit(par);
894-
return unregister_framebuffer(fb_info);
894+
unregister_framebuffer(fb_info);
895+
896+
return 0;
895897
}
896898
EXPORT_SYMBOL(fbtft_unregister_framebuffer);
897899

‎drivers/staging/olpc_dcon/TODO‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
TODO:
2+
- complete rewrite:
3+
1. The underlying fbdev drivers need to be converted into drm kernel
4+
modesetting drivers.
5+
2. The dcon low-power display mode can then be integrated using the
6+
drm damage tracking and self-refresh helpers.
7+
This bolted-on self-refresh support that digs around in fbdev
8+
internals, but isn't properly integrated, is not the correct solution.
29
- see if vx855 gpio API can be made similar enough to cs5535 so we can
310
share more code
411
- convert all uses of the old GPIO API from <linux/gpio.h> to the

‎drivers/staging/olpc_dcon/olpc_dcon.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,7 @@ static bool dcon_blank_fb(struct dcon_priv *dcon, bool blank)
250250
int err;
251251

252252
console_lock();
253-
if (!lock_fb_info(dcon->fbinfo)) {
254-
console_unlock();
255-
dev_err(&dcon->client->dev, "unable to lock framebuffer\n");
256-
return false;
257-
}
253+
lock_fb_info(dcon->fbinfo);
258254

259255
dcon->ignore_fb_events = true;
260256
err = fb_blank(dcon->fbinfo,

‎drivers/tty/vt/vt.c‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3822,6 +3822,8 @@ int con_is_bound(const struct consw *csw)
38223822
{
38233823
int i, bound = 0;
38243824

3825+
WARN_CONSOLE_UNLOCKED();
3826+
38253827
for (i = 0; i < MAX_NR_CONSOLES; i++) {
38263828
if (con_driver_map[i] == csw) {
38273829
bound = 1;
@@ -3833,6 +3835,20 @@ int con_is_bound(const struct consw *csw)
38333835
}
38343836
EXPORT_SYMBOL(con_is_bound);
38353837

3838+
/**
3839+
* con_is_visible - checks whether the current console is visible
3840+
* @vc: virtual console
3841+
*
3842+
* RETURNS: zero if not visible, nonzero if visible
3843+
*/
3844+
bool con_is_visible(const struct vc_data *vc)
3845+
{
3846+
WARN_CONSOLE_UNLOCKED();
3847+
3848+
return *vc->vc_display_fg == vc;
3849+
}
3850+
EXPORT_SYMBOL(con_is_visible);
3851+
38363852
/**
38373853
* con_debug_enter - prepare the console for the kernel debugger
38383854
* @sw: console driver
@@ -4166,6 +4182,8 @@ void do_blank_screen(int entering_gfx)
41664182
struct vc_data *vc = vc_cons[fg_console].d;
41674183
int i;
41684184

4185+
might_sleep();
4186+
41694187
WARN_CONSOLE_UNLOCKED();
41704188

41714189
if (console_blanked) {

‎drivers/video/backlight/backlight.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static int fb_notifier_callback(struct notifier_block *self,
4747
int fb_blank = 0;
4848

4949
/* If we aren't interested in this event, skip it immediately ... */
50-
if (event != FB_EVENT_BLANK && event != FB_EVENT_CONBLANK)
50+
if (event != FB_EVENT_BLANK)
5151
return 0;
5252

5353
bd = container_of(self, struct backlight_device, fb_notif);

‎drivers/video/backlight/lcd.c‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,6 @@ static int fb_notifier_callback(struct notifier_block *self,
3030
struct lcd_device *ld;
3131
struct fb_event *evdata = data;
3232

33-
/* If we aren't interested in this event, skip it immediately ... */
34-
switch (event) {
35-
case FB_EVENT_BLANK:
36-
case FB_EVENT_MODE_CHANGE:
37-
case FB_EVENT_MODE_CHANGE_ALL:
38-
case FB_EARLY_EVENT_BLANK:
39-
case FB_R_EARLY_EVENT_BLANK:
40-
break;
41-
default:
42-
return 0;
43-
}
44-
4533
ld = container_of(self, struct lcd_device, fb_notif);
4634
if (!ld->ops)
4735
return 0;

‎drivers/video/console/dummycon.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ static bool dummycon_putc_called;
3434

3535
void dummycon_register_output_notifier(struct notifier_block *nb)
3636
{
37+
WARN_CONSOLE_UNLOCKED();
38+
3739
raw_notifier_chain_register(&dummycon_output_nh, nb);
3840

3941
if (dummycon_putc_called)
@@ -42,11 +44,15 @@ void dummycon_register_output_notifier(struct notifier_block *nb)
4244

4345
void dummycon_unregister_output_notifier(struct notifier_block *nb)
4446
{
47+
WARN_CONSOLE_UNLOCKED();
48+
4549
raw_notifier_chain_unregister(&dummycon_output_nh, nb);
4650
}
4751

4852
static void dummycon_putc(struct vc_data *vc, int c, int ypos, int xpos)
4953
{
54+
WARN_CONSOLE_UNLOCKED();
55+
5056
dummycon_putc_called = true;
5157
raw_notifier_call_chain(&dummycon_output_nh, 0, NULL);
5258
}

0 commit comments

Comments
 (0)