Re: [linux-fbdev] Re: [PATCH] ATI Mach64 Framebuffer bug

From: Geert Uytterhoeven (geert@linux-m68k.org)
Date: Tue May 30 2000 - 01:19:06 EST


On Mon, 29 May 2000, James Simmons wrote:
> On Mon, 29 May 2000, Yuri Per wrote:
> > Check "con == info->display_fg->vc_num" is not compatible with current
> > implentation of the display driver high level part. Code in
> > drivers/char/console.c changes console palette before performing the
> > switch. With the current check palette for the new foreground console
> > somehow becomes loaded before saving palette for the old foreground
> > console.
>
> Your right. I never noticed it until now. The palette is set before the
> actual switch happens. Consider the case where we are switching from 8
> bpp palette mode to a 16 bpp truecolor mode. So the console system sets
> the new color palette for the 8 bit mode. Then in the driver specific
> switch the fbdev driver sets it again but this time for the 16 bpp mode.
> For many video cards the way the palette is set depends on the video mode.

This explains why the palette was sometimes wrong when switching to a 16, 24
or 32 bpp VC with atyfb. I knew it happened sometimes, but it wasn't
reproducible that simple and I had no idea what was really wrong.

> So in console.c we should have
>
> if (redraw) {
> set_origin(currcons);
> - set_palette(currcons);
> if (sw->con_switch(vc_cons[currcons].d) && vcmode !=
> KD_GRAPHICS)
> + sw->con_set_palette(vc_cons[currcons].d,color_table);
> /* Update the screen contents */
> do_update_region(currcons, origin,
> screenbuf_size/2);
> }
>
> Since in set_palette we have
>
> void set_palette(int currcons)
> {
> if (vcmode != KD_GRAPHICS)
> sw->con_set_palette(vc_cons[currcons].d, color_table);
> }
>
> but we already checked for vcmode != KD_GRAPHICS in redraw_screen so we
> can call sw->con_set_palette. This means that all fbdev drivers DON'T need
> to set the palette on a VT switch. This is very nice :)

Sounds good!

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

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:23 EST