{
struct kgem_bo *bo;
uint32_t name;
-
- if ((draw->height << 16 | draw->width) != get_private(back)->size)
- return;
-
- get_private(back)->stale = false;
-
- bo = get_private(back)->bo;
- assert(bo->refcnt);
- DBG(("%s: back buffer handle=%d, scanout?=%d, refcnt=%d\n",
- __FUNCTION__, bo->handle, bo->active_scanout, get_private(back)->refcnt));
- if (bo->active_scanout == 0) {
- DBG(("%s: reuse unattached back\n", __FUNCTION__));
- return;
+ bool reuse;
+
+ reuse = (draw->height << 16 | draw->width) == get_private(back)->size;
+ if (reuse) {
+ bo = get_private(back)->bo;
+ assert(bo->refcnt);
+ DBG(("%s: back buffer handle=%d, scanout?=%d, refcnt=%d\n",
+ __FUNCTION__, bo->handle, bo->active_scanout, get_private(back)->refcnt));
+ if (bo->active_scanout == 0) {
+ DBG(("%s: reuse unattached back\n", __FUNCTION__));
+ get_private(back)->stale = false;
+ return;
+ }
}
bo = NULL;
}
assert(bo->active_scanout == 0);
- if (info) {
+ if (info && reuse) {
bool found = false;
struct dri_bo *c;
assert(bo != get_private(back)->bo);
kgem_bo_destroy(&sna->kgem, get_private(back)->bo);
+
get_private(back)->bo = bo;
+ get_private(back)->size = draw->height << 16 | draw->width;
+ back->pitch = bo->pitch;
back->name = name;
+
+ get_private(back)->stale = false;
}
struct dri2_window {
sna_shadow_set_crtc(sna, crtc, get_private(back)->bo);
DamageRegionProcessPending(&win->drawable);
- if (get_private(front)->size == (draw->height << 16 | draw->width)) {
- front->attachment = DRI2BufferBackLeft;
- get_private(front)->stale = true;
- } else
- front->attachment = -1;
+ front->attachment = DRI2BufferBackLeft;
+ get_private(front)->stale = true;
+
back->attachment = DRI2BufferFrontLeft;
if (get_private(back)->proxy == NULL) {
get_private(back)->proxy = sna_dri2_reference_buffer(sna_pixmap_get_buffer(pixmap));