st/xorg: Add support for EXA_MIXED_PIXMAPS and EXA_SUPPORTS_PREPARE_AUX.
authorMichel Dänzer <daenzer@vmware.com>
Tue, 8 Sep 2009 16:08:24 +0000 (18:08 +0200)
committerMichel Dänzer <daenzer@vmware.com>
Tue, 8 Sep 2009 16:08:24 +0000 (18:08 +0200)
Also make sure not to leak malloced memory when switching pixmaps to texture
based.

src/gallium/state_trackers/xorg/xorg_dri2.c
src/gallium/state_trackers/xorg/xorg_exa.c

index 6431a0fe25452eff4cdacf6c8f197b11bb37e8fb..8a362596c751d21fd4af8b7b846d12562305eda5 100644 (file)
@@ -118,6 +118,7 @@ driDoCreateBuffer(DrawablePtr pDraw, DRI2BufferPtr buffer, unsigned int format)
     }
 
     if (!tex) {
+       exaMoveInPixmap(private->pPixmap);
        xorg_exa_set_shared_usage(private->pPixmap);
        pScreen->ModifyPixmapHeader(private->pPixmap, 0, 0, 0, 0, 0, NULL);
        tex = xorg_exa_get_texture(private->pPixmap);
index a17a71f23a8a50439f416ba7b04d9fdc85f469a1..1a183de6db6e4cea54f268dc300551ea9fa8e163 100644 (file)
@@ -563,6 +563,9 @@ ExaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height,
                               pPixmap->devKind, 0, 0);
                exa->scrn->transfer_unmap(exa->scrn, transfer);
                exa->scrn->tex_transfer_destroy(transfer);
+
+               xfree(pPixmap->devPrivate.ptr);
+               pPixmap->devPrivate.ptr = NULL;
            }
        }
 #ifdef DRM_MODE_FEATURE_DIRTYFB
@@ -645,6 +648,12 @@ xorg_exa_init(ScrnInfoPtr pScrn)
    pExa->pixmapOffsetAlign = 0;
    pExa->pixmapPitchAlign  = 1;
    pExa->flags             = EXA_OFFSCREEN_PIXMAPS | EXA_HANDLES_PIXMAPS;
+#ifdef EXA_SUPPORTS_PREPARE_AUX
+   pExa->flags            |= EXA_SUPPORTS_PREPARE_AUX;
+#endif
+#ifdef EXA_MIXED_PIXMAPS
+   pExa->flags            |= EXA_MIXED_PIXMAPS;
+#endif
    pExa->maxX              = 8191; /* FIXME */
    pExa->maxY              = 8191; /* FIXME */