From: "Antonino A. Daplas" <adaplas@hotpop.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Petr Stehlik <pstehlik@sophics.cz>,
Linux Frame Buffer Device Development
<linux-fbdev-devel@lists.sourceforge.net>,
"Christian T. Steigies" <cts@debian.org>
Subject: Re: patch fixing background next to penguin logo in monochrome
Date: Mon, 16 Aug 2004 03:11:51 +0000 (UTC)
Date: Thu, 16 Sep 2004 11:10:11 +0800 [thread overview]
Message-ID: <200409161110.12046.adaplas@hotpop.com> (raw)
In-Reply-To: <Pine.GSO.4.58.0408151425000.3409@waterleaf.sonytel.be>
On Sunday 15 August 2004 20:25, Geert Uytterhoeven wrote:
> > This one is a little difficult since there is currently no method to
> > convert monochrome attributes to color and vice versa. The best one can
> > do is to clear all attributes when switching from mono<->color.
> >
> > When switching, one will get plain text only. This is probably better
> > than having text with incorrect attributes.
> >
> > Attached patch is completely untested, but it's the same one in 2.6.
>
> Doesn't help, still the same behavior :-(
>
I looked at the code, and the flow seems to be like this:
fbcon_switch->fb_set_var->changevar->fbcon_setup->update_screen/redraw_screen
However, fbcon_setup() updates conp->vc_can_do_color, so by the time
the redraw_screen function in console.c checks for the vc_can_do_color field,
it always returns equal.
So instead of clearing the buffer attributes in redraw_screen(), we do it
instead in fbcon_setup().
Try the patch below. You might have to apply them manually as I'm using
Suse-9.0 linux kernel, which has the bootsplash code. Also, all the previous
patches need to be reversed.
Tony
PS: If we can change the clear_buffer_attribute to rebuild attributes from
the old buffer instead of just clearing the attributes, that would be perfect.
Is there an easy way to do that?
---
diff -uprN linux-2.4-orig/drivers/video/fbcon.c linux-2.4/drivers/video/fbcon.c
--- linux-2.4-orig/drivers/video/fbcon.c 2004-09-16 10:50:58.093218288 +0800
+++ linux-2.4/drivers/video/fbcon.c 2004-09-16 10:53:12.826735680 +0800
@@ -618,12 +618,25 @@ static void fbcon_font_widths(struct dis
#define fontwidthvalid(p,w) ((p)->dispsw->fontwidthmask & FONTWIDTH(w))
+static void clear_buffer_attributes(struct vc_data *conp)
+{
+ unsigned short *p = (unsigned short *) conp->vc_origin;
+ int count = conp->vc_screenbuf_size/2;
+ int mask = conp->vc_hi_font_mask | 0xff;
+ int erase_char = conp->vc_video_erase_char;
+
+ for (; count > 0; count--, p++) {
+ scr_writew((scr_readw(p)&mask) | (erase_char&~mask), p);
+ }
+}
+
static void fbcon_setup(int con, int init, int logo)
{
struct display *p = &fb_display[con];
struct vc_data *conp = p->conp;
int nr_rows, nr_cols;
int old_rows, old_cols;
+ int old_was_color = conp->vc_can_do_color;
unsigned short *save = NULL, *r, *q;
int i, charcnt = 256;
struct fbcon_font_desc *font;
@@ -803,6 +816,8 @@ static void fbcon_setup(int con, int ini
p->bgcol = 0;
if (!init) {
+ if (old_was_color != conp->vc_can_do_color)
+ clear_buffer_attributes(conp);
if (conp->vc_cols != nr_cols || conp->vc_rows != nr_rows)
vc_resize_con(nr_rows, nr_cols, con);
else if (CON_IS_VISIBLE(conp) &&
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
next prev parent reply other threads:[~2004-08-16 3:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-11 19:56 patch fixing background next to penguin logo in monochrome Petr Stehlik
2004-08-11 22:23 ` Antonino A. Daplas
2004-08-12 12:02 ` Petr Stehlik
2004-08-12 20:01 ` Geert Uytterhoeven
2004-08-12 22:30 ` Antonino A. Daplas
2004-08-12 23:53 ` Antonino A. Daplas
2004-08-13 8:05 ` Geert Uytterhoeven
2004-08-15 0:43 ` Antonino A. Daplas
2004-08-15 12:25 ` Geert Uytterhoeven
2004-08-16 3:11 ` Antonino A. Daplas [this message]
2004-08-17 7:45 ` Geert Uytterhoeven
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=200409161110.12046.adaplas@hotpop.com \
--to=adaplas@hotpop.com \
--cc=adaplas@pol.net \
--cc=cts@debian.org \
--cc=geert@linux-m68k.org \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=pstehlik@sophics.cz \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.