[Spice-devel] [PATCH xf86-video-qxl 2/2] Fix allocating a too large fb

Hans de Goede hdegoede at redhat.com
Mon Sep 13 13:14:22 PDT 2010


We were allocating a fb of max-width * max-width pixels rather then
max-height * max-width pixels, this patch fixes this.
---
 src/qxl_driver.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index 8492792..6967e80 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -973,7 +973,10 @@ qxl_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
     if (!miSetPixmapDepths())
 	goto out;
 
-    qxl->fb = xcalloc(pScrn->virtualX * pScrn->displayWidth, 4);
+    /* Note we this before setting pScrn->virtualY to match our current
+       mode, so as to allocate a buffer large enough for the largest mode.
+       FIXME: add support for resizing the framebuffer on modeset. */
+    qxl->fb = xcalloc(pScrn->virtualY * pScrn->displayWidth, 4);
     if (!qxl->fb)
 	goto out;
 
-- 
1.7.2.2



More information about the Spice-devel mailing list