diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-07-20 00:20:09 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-07-20 00:21:53 +0100 |
commit | 65a09436e6aef9fe0518e322f92e601d5d3f46c1 (patch) | |
tree | 30a48c01b86ae68c30bb65e245c663e158973532 /src | |
parent | e386ba86ea487a2db62d80a0e60f176e052d6406 (diff) |
sna/dri: Fix the strict blitting check not to assume the dst is the front buffer
In order to allow the case for copying onto a target other than the
front buffer, such as the fake front buffer for example.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/sna_dri.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c index 3cceebee..94721ba8 100644 --- a/src/sna/sna_dri.c +++ b/src/sna/sna_dri.c @@ -911,17 +911,18 @@ can_blit(struct sna *sna, if (draw->type == DRAWABLE_PIXMAP) return true; -#ifdef STRICT_BLIT - if (get_private(dst)->pixmap != get_drawable_pixmap(draw)) { - DBG(("%s: reject as dst pixmap=%ld, but expecting pixmap=%ld\n", - __FUNCTION__, - get_private(dst)->pixmap ? get_private(dst)->pixmap->drawable.serialNumber : 0, - get_drawable_pixmap(draw)->drawable.serialNumber)); - return false; + if (STRICT_BLIT && dst->attachment == DRI2BufferFrontLeft) { + if (get_private(dst)->pixmap != get_drawable_pixmap(draw)) { + DBG(("%s: reject as dst pixmap=%ld, but expecting pixmap=%ld\n", + __FUNCTION__, + get_private(dst)->pixmap ? get_private(dst)->pixmap->drawable.serialNumber : 0, + get_drawable_pixmap(draw)->drawable.serialNumber)); + return false; + } + + assert(sna_pixmap(get_private(dst)->pixmap)->flush); } - assert(sna_pixmap(get_private(dst)->pixmap)->flush); -#endif assert(get_private(dst)->bo->flush); assert(get_private(src)->bo->flush); @@ -994,11 +995,11 @@ sna_dri_copy_region(DrawablePtr draw, dst = get_private(dst_buffer)->bo; if (dst_buffer->attachment == DRI2BufferFrontLeft) { copy = (void *)sna_dri_copy_to_front; -#ifndef STRICT_BLIT - dst = sna_pixmap_get_bo(pixmap); - if (dst == NULL) - return; -#endif + if (!STRICT_BLIT) { + dst = sna_pixmap_get_bo(pixmap); + if (dst == NULL) + return; + } } DBG(("%s: dst -- attachment=%d, name=%d, handle=%d [screen=%d]\n", @@ -1011,11 +1012,11 @@ sna_dri_copy_region(DrawablePtr draw, if (src_buffer->attachment == DRI2BufferFrontLeft) { assert(copy == sna_dri_copy); copy = sna_dri_copy_from_front; -#ifndef STRICT_BLIT - src = sna_pixmap_get_bo(pixmap); - if (src == NULL) - return; -#endif + if (!STRICT_BLIT) { + src = sna_pixmap_get_bo(pixmap); + if (src == NULL) + return; + } } DBG(("%s: src -- attachment=%d, name=%d, handle=%d\n", |