public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1 of 2] fbcon: bgcolor fix
@ 2008-07-01 15:38 Stefano Stabellini
  2008-07-01 15:51 ` Jan Engelhardt
  0 siblings, 1 reply; 3+ messages in thread
From: Stefano Stabellini @ 2008-07-01 15:38 UTC (permalink / raw)
  To: linux-kernel; +Cc: Stefano Stabellini

The forth bit of the background color is the blink property bit, not the
intensity bit, as for the foreground color.
Therefore it shouldn't be included in the background color.

Signed-off-by: stefano.stabellini@eu.citrix.com

---
 drivers/video/console/fbcon.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h
index 0135e03..beb6a74 100644
--- a/drivers/video/console/fbcon.h
+++ b/drivers/video/console/fbcon.h
@@ -92,7 +92,7 @@ struct fbcon_ops {
 #define attr_fgcol(fgshift,s)    \
 	(((s) >> (fgshift)) & 0x0f)
 #define attr_bgcol(bgshift,s)    \
-	(((s) >> (bgshift)) & 0x0f)
+	(((s) >> (bgshift)) & 0x07)
 
 /* Monochrome */
 #define attr_bold(s) \
-- 
1.5.4.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1 of 2] fbcon: bgcolor fix
  2008-07-01 15:38 [PATCH 1 of 2] fbcon: bgcolor fix Stefano Stabellini
@ 2008-07-01 15:51 ` Jan Engelhardt
  2008-07-01 16:28   ` Stefano Stabellini
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Engelhardt @ 2008-07-01 15:51 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: linux-kernel


On Tuesday 2008-07-01 17:38, Stefano Stabellini wrote:

>The forth bit of the background color is the blink property bit, not the
>intensity bit, as for the foreground color.
>Therefore it shouldn't be included in the background color.

I'm a bit skeptical, though I have not tried this.
ISTR fb has the power to render full 8 bits background
in addition to blinking.

>--- a/drivers/video/console/fbcon.h
>+++ b/drivers/video/console/fbcon.h
>@@ -92,7 +92,7 @@ struct fbcon_ops {
> #define attr_fgcol(fgshift,s)    \
> 	(((s) >> (fgshift)) & 0x0f)
> #define attr_bgcol(bgshift,s)    \
>-	(((s) >> (bgshift)) & 0x0f)
>+	(((s) >> (bgshift)) & 0x07)
> 
> /* Monochrome */
> #define attr_bold(s) \

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1 of 2] fbcon: bgcolor fix
  2008-07-01 15:51 ` Jan Engelhardt
@ 2008-07-01 16:28   ` Stefano Stabellini
  0 siblings, 0 replies; 3+ messages in thread
From: Stefano Stabellini @ 2008-07-01 16:28 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: linux-kernel

Jan Engelhardt wrote:

> On Tuesday 2008-07-01 17:38, Stefano Stabellini wrote:
> 
>> The forth bit of the background color is the blink property bit, not the
>> intensity bit, as for the foreground color.
>> Therefore it shouldn't be included in the background color.
> 
> I'm a bit skeptical, though I have not tried this.


If you look at the build_attr function in drivers/char/vt.c you can see 
that the blink attribute is stored as the forth bit of the background color.

I tried the patches with both an ncurses application and manually using:

echo -en '\E[5m'

and they seems to work fine.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-07-01 16:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-01 15:38 [PATCH 1 of 2] fbcon: bgcolor fix Stefano Stabellini
2008-07-01 15:51 ` Jan Engelhardt
2008-07-01 16:28   ` Stefano Stabellini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox