summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2006-12-31 17:23:31 +0100
committerKeith Packard <keithp@neko.keithp.com>2007-03-26 20:32:20 -0700
commitd7bcad9c694a13c702e429d8364035850d8f8bb7 (patch)
treeb109743425ac26b259336002f726cbbf4d68a3b1 /hw
parent28af734cb7f2e5e40f6524411f77eba0e3960a8d (diff)
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. (cherry picked from commit d077c0da470ab7291e8d838eaace57b066477d6f)
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/fbdevhw/fbdevhw.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c
index 83b0dc156..a9288a753 100644
--- a/hw/xfree86/fbdevhw/fbdevhw.c
+++ b/hw/xfree86/fbdevhw/fbdevhw.c
@@ -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;