diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2011-12-05 20:58:45 +0100 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2011-12-06 18:22:55 +0100 |
commit | fb35176958bba2f86d6d466ccb7baadcff806512 (patch) | |
tree | acfe9b68ae78d2bf6836b82c332b049fc58521ec | |
parent | 3c2486e05e98f2ff8f4e3d2633d91e14140a676e (diff) |
vmwgfx: Don't register back buffers as "hw_is_dri2_fronts" v2
That is reserved for dri2 front or fake front pixmaps that need
immediate flushing of software contents to hardware.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
-rw-r--r-- | vmwgfx/vmwgfx_dri2.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/vmwgfx/vmwgfx_dri2.c b/vmwgfx/vmwgfx_dri2.c index 3f9d00a..bf6e178 100644 --- a/vmwgfx/vmwgfx_dri2.c +++ b/vmwgfx/vmwgfx_dri2.c @@ -182,14 +182,16 @@ dri2_do_create_buffer(DrawablePtr pDraw, DRI2Buffer2Ptr buffer, unsigned int for return FALSE; srf = vpix->hw; + private->refcount++; + private->dri2_depth = depth; /* * Compiz workaround. See vmwgfx_dirty(); */ - vpix->hw_is_dri2_fronts++; - private->refcount++; - private->dri2_depth = depth; + if (buffer->attachment == DRI2BufferFrontLeft || + buffer->attachment == DRI2BufferFakeFrontLeft) + vpix->hw_is_dri2_fronts++; } private->srf = srf; @@ -211,6 +213,7 @@ dri2_do_destroy_buffer(DrawablePtr pDraw, DRI2BufferPtr buffer) BufferPrivatePtr private = buffer->driverPrivate; struct xa_surface *srf = private->srf; ScreenPtr pScreen = pDraw->pScreen; + struct vmwgfx_saa_pixmap *vpix = vmwgfx_saa_pixmap(private->pPixmap); if (--private->refcount == 0 && srf) { xa_surface_destroy(srf); @@ -220,11 +223,11 @@ dri2_do_destroy_buffer(DrawablePtr pDraw, DRI2BufferPtr buffer) * Compiz workaround. See vmwgfx_dirty(); */ - if (private->refcount == 1) { - struct vmwgfx_saa_pixmap *vpix = vmwgfx_saa_pixmap(private->pPixmap); - if (--vpix->hw_is_dri2_fronts == 0) - WSBMLISTDELINIT(&vpix->sync_x_head); - } + if ((buffer->attachment == DRI2BufferFrontLeft || + buffer->attachment == DRI2BufferFakeFrontLeft) && + private->refcount == 1 && + --vpix->hw_is_dri2_fronts == 0) + WSBMLISTDELINIT(&vpix->sync_x_head); private->srf = NULL; pScreen->DestroyPixmap(private->pPixmap); |