summaryrefslogtreecommitdiff
path: root/hw/xfree86/fbdevhw/fbdevhw.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2006-12-31 17:23:31 +0100
committerMichel Dänzer <michel@tungstengraphics.com>2006-12-31 17:23:31 +0100
commitd077c0da470ab7291e8d838eaace57b066477d6f (patch)
tree450598f56bf9744d85004c6b10dbaf4b74b8ba32 /hw/xfree86/fbdevhw/fbdevhw.c
parentc385bcf0bde38dd869f7065f859dd4b4126f5690 (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.
Diffstat (limited to 'hw/xfree86/fbdevhw/fbdevhw.c')
-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;