On Wed, 2005-11-09 at 00:20 +0100, Peter Teichmann wrote: 
> 
> The framebuffer driver does not set the display width properly if used
> without Shadow, but keeps the old value from the probed built-in mode.
> If the horizontal resolution of the later selected video mode differs,
> this is a problem. The patch below fixes this.
> 
> Peter Teichmann
> 
> 
> diff -urd xc.orig/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c 
> xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c
> --- xc.orig/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c 2005-10-25 
> 23:02:32.000000000 +0200
> +++ xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c      2005-10-25 
> 22:55:14.000000000 +0200
> @@ -672,11 +672,19 @@
>  
>       if(fPtr->rotate==FBDEV_ROTATE_CW || fPtr->rotate==FBDEV_ROTATE_CCW)
>       {
> -       height = pScrn->virtualX;
> -       width = pScrn->displayWidth = pScrn->virtualY;
> +             height = pScrn->virtualX;
> +             width = pScrn->displayWidth = pScrn->virtualY;
>       } else {
> -       height = pScrn->virtualY;
> -       width = pScrn->virtualX;
> +             height = pScrn->virtualY;
> +             width = pScrn->virtualX;

Please get rid of whitespace-only changes like these.


> +     if (!fPtr->shadowFB)
> +     {
> +             int fbbpp;
> +             /* FIXME: this doesn't work for all cases, e.g. when each 
> scanline
> +                     has a padding which is independent from the depth 
> (controlfb) */
> +             fbdevHWGetDepth(pScrn,&fbbpp);
> +             pScrn->displayWidth = fbdevHWGetLineLength(pScrn)/(fbbpp >> 3);
>       }

Why doesn't the same code in FBDevPreInit() work? Because it gets a line
length from a different mode? If so, shouldn't you just move the code
from FBDevPreInit() here?


PS: It might be better if you submitted your patches upstream at
https://bugs.freedesktop.org/ first and only asked for them to be
backported to the Debian packages necessary once they've been applied
upstream.

-- 
Earthling Michel Dänzer      |     Debian (powerpc), X and DRI developer
Libre software enthusiast    |   http://svcs.affero.net/rm.php?r=daenzer

Reply via email to