Skip to contentSkip to conversation

Fix FB console blanking

PATCH In review Dmitry Baryshkov 2 participants 3 messages Nov 24, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix FB console blanking

The commit aef7db4bd5a3b6068dfa05919a3d685199eed116 fixed the problem with recursive locking in fb blanking code if blank is caused by user setting the /sys/class/graphics/fb*/blank. However this broke the fbcon timeout blanking.

Restore fbcon blanking and at the same time apply the proper fix for the above problem: if fbcon_blank is called with FBINFO_FLAG_USEREVENT, we are already called through notification from fb_blank, thus we don't have to blank the fb again.

---
 drivers/video/console/fbcon.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
drivers/video/console/fbcon.c +3 -6
index 9cbff84..2f2f0f9 100644
@@ -2400,16 +2400,13 @@ static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch)
 
  	if (!fbcon_is_inactive(vc, info)) {
 		if (ops->blank_state != blank) {
-			int ret = 1;
-
 			ops->blank_state = blank;
 			fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW);
 			ops->cursor_flash = (!blank);
 
-			if (info->fbops->fb_blank)
-				ret = info->fbops->fb_blank(blank, info);
-			if (ret)
-				fbcon_generic_blank(vc, info, blank);
+			if (!(info->flags & FBINFO_MISC_USEREVENT))
+				if (fb_blank(info, blank))
+					fbcon_generic_blank(vc, info, blank);
 		}
 
 		if (!blank)
Signature · 8 lines
1.5.6.5


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
#1 lore raw
Quoted 4 lines · Dmitry Baryshkov

The commit aef7db4bd5a3b6068dfa05919a3d685199eed116 fixed the problem with recursive locking in fb blanking code if blank is caused by user setting the /sys/class/graphics/fb*/blank. However this broke the fbcon timeout blanking.

Can you please explain a bit more about what `broken' means? What happens, how can I reproduce it?

Thanks!

Quoted 4 lines

Restore fbcon blanking and at the same time apply the proper fix for the above problem: if fbcon_blank is called with FBINFO_FLAG_USEREVENT, we are already called through notification from fb_blank, thus we don't have to blank the fb again.

Is it just an issue of blanking again if the display is already blanked?

Quoted 19 lines
---
 drivers/video/console/fbcon.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
drivers/video/console/fbcon.c +0 -2
index 9cbff84..2f2f0f9 100644
@@ -2400,16 +2400,13 @@ static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch)
 
  	if (!fbcon_is_inactive(vc, info)) {
 		if (ops->blank_state != blank) {
-			int ret = 1;
-
 			ops->blank_state = blank;
 			fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW);
 			ops->cursor_flash = (!blank);
 

drivers/video/console/fbcon.c static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch) · line 2412

Quoted 10 lines
drivers/video/console/fbcon.c +3 -4
-			if (info->fbops->fb_blank)
-				ret = info->fbops->fb_blank(blank, info);
-			if (ret)
-				fbcon_generic_blank(vc, info, blank);
+			if (!(info->flags & FBINFO_MISC_USEREVENT))
+				if (fb_blank(info, blank))
+					fbcon_generic_blank(vc, info, blank);
 		}
 
 		if (!blank)

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

#2 lore raw
Quoted 8 lines · Geert Uytterhoeven
Quoted 4 lines · Dmitry Baryshkov

The commit aef7db4bd5a3b6068dfa05919a3d685199eed116 fixed the problem with recursive locking in fb blanking code if blank is caused by user setting the /sys/class/graphics/fb*/blank. However this broke the fbcon timeout blanking.

Can you please explain a bit more about what `broken' means? What happens, how can I reproduce it?

If you use a driver that defines ->fb_blank operation and at the same time that driver relies on other driver (e.g. backlight or lcd class) to blank the screen, when the fbcon times out and tries to blank the fb, it will call only fb driver blanker and won't notify the other driver. Thus FB output is disabled, but the screen isn't blanked.

Quoted 9 lines

Thanks!

Quoted 4 lines

Restore fbcon blanking and at the same time apply the proper fix for the above problem: if fbcon_blank is called with FBINFO_FLAG_USEREVENT, we are already called through notification from fb_blank, thus we don't have to blank the fb again.

Is it just an issue of blanking again if the display is already blanked?

Yes. (at least the original problem that I stumbled upon).

Quoted 41 lines
Quoted 20 lines
---
 drivers/video/console/fbcon.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
drivers/video/console/fbcon.c +0 -2
index 9cbff84..2f2f0f9 100644
@@ -2400,16 +2400,13 @@ static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch)
 
  	if (!fbcon_is_inactive(vc, info)) {
 		if (ops->blank_state != blank) {
-			int ret = 1;
-
 			ops->blank_state = blank;
 			fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW);
 			ops->cursor_flash = (!blank);
 

drivers/video/console/fbcon.c static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch) · line 2412

Quoted 10 lines
drivers/video/console/fbcon.c +3 -4
-			if (info->fbops->fb_blank)
-				ret = info->fbops->fb_blank(blank, info);
-			if (ret)
-				fbcon_generic_blank(vc, info, blank);
+			if (!(info->flags & FBINFO_MISC_USEREVENT))
+				if (fb_blank(info, blank))
+					fbcon_generic_blank(vc, info, blank);
 		}
 
 		if (!blank)

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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

Signature · 9 lines
With best wishes
Dmitry


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/