[Spice-devel] [PATCH xf86-video-qxl] Initialize the frame buffer used in dfps mode; this silences a number of valgrind errors.

Jeremy White jwhite at codeweavers.com
Fri Sep 12 12:20:36 PDT 2014


Signed-off-by: Jeremy White <jwhite at codeweavers.com>
---
 src/dfps.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/dfps.c b/src/dfps.c
index 5db34dc..568ba5e 100644
--- a/src/dfps.c
+++ b/src/dfps.c
@@ -312,6 +312,17 @@ static void dfps_set_screen_pixmap (PixmapPtr pixmap)
     pixmap->drawable.pScreen->devPrivate = pixmap;
 }
 
+static void dfps_clear_pixmap(PixmapPtr pixmap, int w, int h)
+{
+    GCPtr pgc;
+    pgc = GetScratchGC(pixmap->drawable.depth, pixmap->drawable.pScreen);
+    if (pgc)
+    {
+        fbFill(&pixmap->drawable, pgc, 0, 0, w, h);
+        FreeScratchGC(pgc);
+    }
+}
+
 static PixmapPtr dfps_create_pixmap (ScreenPtr screen, int w, int h, int depth, unsigned usage)
 {
     PixmapPtr pixmap;
@@ -324,7 +335,10 @@ static PixmapPtr dfps_create_pixmap (ScreenPtr screen, int w, int h, int depth,
 
     pixmap = fbCreatePixmap (screen, w, h, depth, usage);
     if (pixmap)
+    {
+        dfps_clear_pixmap(pixmap, w, h);
         dfps_set_info(pixmap, info);
+    }
     else
         free(info);
 
-- 
1.7.10.4



More information about the Spice-devel mailing list