sna: Avoid allocating temporary storage for TearFree rotations
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 16 Jan 2014 11:08:05 +0000 (11:08 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 16 Jan 2014 12:18:28 +0000 (12:18 +0000)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
src/sna/sna_display.c

index 5bce764..10ee9e4 100644 (file)
@@ -4307,12 +4307,18 @@ sna_crtc_redisplay__composite(xf86CrtcPtr crtc, RegionPtr region, struct kgem_bo
        DBG(("%s: compositing transformed damage boxes\n", __FUNCTION__));
 
        pixmap = sna_pixmap_create_unattached(screen,
-                                             crtc->mode.HDisplay,
-                                             crtc->mode.VDisplay,
-                                             sna->front->drawable.depth);
+                                             0, 0, sna->front->drawable.depth);
        if (pixmap == NullPixmap)
                return;
 
+       if (!screen->ModifyPixmapHeader(pixmap,
+                                       crtc->mode.HDisplay,
+                                       crtc->mode.VDisplay,
+                                       sna->front->drawable.depth,
+                                       sna->front->drawable.bitsPerPixel,
+                                       bo->pitch, NULL))
+               goto free_pixmap;
+
        if (!sna_pixmap_attach_to_bo(pixmap, bo))
                goto free_pixmap;