diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-06-19 00:37:12 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-06-19 00:40:04 +0100 |
commit | 38472fcc53c5dceb98b96458183e6729b8311a43 (patch) | |
tree | 49ddd92d6d343c47c2e433025574bd3a83a7a9bb /src/sna/sna_io.c | |
parent | 8cdfb8c24c8b49c88451714d80293c66d63e8c01 (diff) |
sna: Double check that the source is busy before performing indirect reads
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_io.c')
-rw-r--r-- | src/sna/sna_io.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c index 01b8d2c0..8d045484 100644 --- a/src/sna/sna_io.c +++ b/src/sna/sna_io.c @@ -122,7 +122,7 @@ static bool download_inplace(struct kgem *kgem, struct kgem_bo *bo) if (FORCE_INPLACE) return FORCE_INPLACE > 0; - return !kgem_bo_is_busy(bo) || bo->tiling == I915_TILING_NONE; + return !__kgem_bo_is_busy(kgem, bo) || bo->tiling == I915_TILING_NONE; } void sna_read_boxes(struct sna *sna, @@ -1158,21 +1158,23 @@ bool sna_replace(struct sna *sna, { struct kgem_bo *bo = *_bo; struct kgem *kgem = &sna->kgem; + bool busy; void *dst; - DBG(("%s(handle=%d, %dx%d, bpp=%d, tiling=%d)\n", + busy = __kgem_bo_is_busy(kgem, bo); + DBG(("%s(handle=%d, %dx%d, bpp=%d, tiling=%d) busy?=%d\n", __FUNCTION__, bo->handle, pixmap->drawable.width, pixmap->drawable.height, pixmap->drawable.bitsPerPixel, - bo->tiling)); + bo->tiling, busy)); assert(!bo->flush); - if ((!kgem_bo_can_map(kgem, bo) || kgem_bo_is_busy(bo)) && + if ((busy || !kgem_bo_can_map(kgem, bo)) && indirect_replace(sna, pixmap, bo, src, stride)) return true; - if (kgem_bo_is_busy(bo)) { + if (busy) { struct kgem_bo *new_bo; new_bo = kgem_create_2d(kgem, |