Messages in this thread | | | From | Nathan Hand <> | Date | Wed, 9 Aug 2000 19:23:00 +1000 | Subject | Re: [PATCH] Re: black screen in X, linux-2.4.0-test5 |
| |
On Wed, Aug 09, 2000 at 10:50:10AM +0200, Petr Vandrovec wrote: > > Hmm.I'm looking into vgacon and I just cannot get idea why ordering > of vgacon_switch and vga_set_palette can matter, as vgacon_switch is > simple memcpy() and vga_set_palette just programs palette... Looking > at code again... Oops. Hey, James made a bug... Code in console.c > should read > > if (redraw) { > int updateregion; > > set_origin(currcons); > updateregion = sw->con_switch(vc_cons[currcons].d); > set_palette(currcons); > if (updateregion && (vcmode != KD_GRAPHICS)) > do_update_region(currcons, origin, screenbuf_size / 2); > } > > as con_switch does not return success/failure, but it returns whether > screen was repainted by con_switch (0) or whether update_region should > be invoked (1)... I believe that it will solve your problem. > > If it solves your problem, tell me and I'll resend patch below > to Linus.
It does. I wrote a similar patch earlier today which just forced vgacon to always return 1, but this was a brute force hack. Your patch is clearly more correct.
Linus has entered a different patch which works in char/vt.c and puts explicit set_palette calls before each unblank_screen. I've not yet tried his patch. Other people have said it does work.
I think yours makes more sense though because you say con_switch doesn't return success/failure, but instead whether an update is needed. So set_palette should never have been in the if-block.
I prefer your patch. Please resend to Linus so he can choose the patch he prefers.
> --- linux/drivers/char/console.c Wed Jul 19 00:57:28 2000 > +++ linux/drivers/char/console.c Wed Aug 9 10:44:35 2000 > @@ -586,12 +586,14 @@ > } > > if (redraw) { > + int updateregion; > + > set_origin(currcons); > - if (sw->con_switch(vc_cons[currcons].d) && vcmode != KD_GRAPHICS) { > - /* Update the screen contents */ > - set_palette(currcons); > + updateregion = sw->con_switch(vc_cons[currcons].d); > + set_palette(currcons); > + /* Update the screen contents */ > + if (updateregion && (vcmode != KD_GRAPHICS)) > do_update_region(currcons, origin, screenbuf_size/2); > - } > } > set_cursor(currcons); > if (is_switch) {
- 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/
| |