From d077c0da470ab7291e8d838eaace57b066477d6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Sun, 31 Dec 2006 17:23:31 +0100 Subject: [PATCH] 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. --- hw/xfree86/fbdevhw/fbdevhw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;