fbdevhw: Use displayWidth for fbdev virtual width when appropriate.

The fbdev API doesn't allow setting the pitch explicitly, so we have to set
the virtual width to the pitch we're using for drawing. This fixes corruption
after changing the virtual width with RandR.
This commit is contained in:
Michel Dänzer 2006-12-31 17:23:31 +01:00
parent c385bcf0bd
commit d077c0da47

View File

@ -183,7 +183,8 @@ print_xfree_mode(char *txt, DisplayModePtr mode)
static void
xfree2fbdev_fblayout(ScrnInfoPtr pScrn, struct fb_var_screeninfo *var)
{
var->xres_virtual = pScrn->virtualX;
var->xres_virtual = pScrn->displayWidth ? pScrn->displayWidth :
pScrn->virtualX;
var->yres_virtual = pScrn->virtualY;
var->bits_per_pixel = pScrn->bitsPerPixel;
var->red.length = pScrn->weight.red;