diff options
author | Rob Clark <rob@ti.com> | 2012-04-20 15:40:51 -0500 |
---|---|---|
committer | Rob Clark <rob@ti.com> | 2012-04-20 19:17:08 -0500 |
commit | 834f6469c312b0e46921aad563f137ca5b2f1b14 (patch) | |
tree | b07084a7354559306cfd89db733d13cc80df2224 | |
parent | 0bdd370ab720a191d9716821d9cfea1dfa141c92 (diff) |
dri2: don't attempt to re-allocate scanout buffer
The scanout buffer is already contiguous (scanout capable), and
re-allocating it causes pOMAP->scanout to be a dangling pointer.
-rw-r--r-- | src/omap_dri2.c | 11 | ||||
-rw-r--r-- | src/omap_driver.h | 5 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/omap_dri2.c b/src/omap_dri2.c index 3e5878f..db422ef 100644 --- a/src/omap_dri2.c +++ b/src/omap_dri2.c @@ -153,13 +153,16 @@ OMAPDRI2CreateBuffer(DrawablePtr pDraw, unsigned int attachment, if (attachment == DRI2BufferFrontLeft) { pPixmap = draw2pix(pDraw); - /* to do flipping, we need a scanout capable (physically contiguous) - * buffer.. this bit of gymnastics ensures that. + /* to do flipping, if we don't have DMM, then we need a scanout + * capable (physically contiguous) buffer.. this bit of gymnastics + * ensures that. * - * TODO we may need to re-allocate and switch back to non-scanout + * TODO we may want to re-allocate and switch back to non-scanout * buffer when client disconnects from drawable.. */ - if (canflip(pDraw)) { + if (canflip(pDraw) && !has_dmm(pOMAP) && + (OMAPPixmapBo(pPixmap) != pOMAP->scanout)) { + /* need to re-allocate pixmap to get a scanout capable buffer */ PixmapPtr pNewPix = createpix(pDraw); diff --git a/src/omap_driver.h b/src/omap_driver.h index d72176b..028545c 100644 --- a/src/omap_driver.h +++ b/src/omap_driver.h @@ -173,6 +173,11 @@ static inline Bool has_video(OMAPPtr pOMAP) pOMAP->pOMAPEXA->PutTextureImage; } +static inline Bool has_dmm(OMAPPtr pOMAP) +{ + return pOMAP->chipset >= 0x4430; +} + /** Return a pointer to the driver's private structure. */ #define OMAPPTR(p) ((OMAPPtr)((p)->driverPrivate)) #define OMAPPTR_FROM_SCREEN(pScreen) \ |