linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dbaryshkov@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-fbdev-devel@lists.sourceforge.net
Subject: Re: [PATCH] Fix FB console blanking
Date: Mon, 24 Nov 2008 19:50:20 +0300	[thread overview]
Message-ID: <492ADB4C.4050109@gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0811241740390.12405@anakin>

Geert Uytterhoeven wrote:
> On Mon, 24 Nov 2008, Dmitry Baryshkov wrote:
>> 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.

> 
> Thanks!
> 
>> 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).

> 
>> Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
>> ---
>>  drivers/video/console/fbcon.c |    9 +++------
>>  1 files changed, 3 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
>> index 9cbff84..2f2f0f9 100644
>> --- a/drivers/video/console/fbcon.c
>> +++ b/drivers/video/console/fbcon.c
>> @@ -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)
> 
> 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


-- 
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=/

      reply	other threads:[~2008-11-24 16:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-24 16:07 [PATCH] Fix FB console blanking Dmitry Baryshkov
2008-11-24 16:41 ` Geert Uytterhoeven
2008-11-24 16:50   ` Dmitry Baryshkov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=492ADB4C.4050109@gmail.com \
    --to=dbaryshkov@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).