summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-08-03 14:54:31 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-08-04 09:51:26 +0100
commita5bf389908934aa4f9493a4a35b18e4aec9c8103 (patch)
tree5bee2bd95d4585b2c73088151646d4bb6c89f45c
parent5287660aafe45859c07874c22dca99c1ff5e555a (diff)
sna: Mark the entire userptr proxy chain as flush/non-reusable
Fixes cache bookkeepping when mixing userptr uploads. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/kgem.c1
-rw-r--r--src/sna/kgem.h5
-rw-r--r--src/sna/sna_accel.c6
3 files changed, 6 insertions, 6 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 29a5dfc9..8d59a2ec 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1909,6 +1909,7 @@ search_snoop_cache(struct kgem *kgem, unsigned int num_pages, unsigned flags)
assert(bo->refcnt == 0);
assert(bo->snoop);
assert(!bo->scanout);
+ assert(!bo->purged);
assert(bo->proxy == NULL);
assert(bo->tiling == I915_TILING_NONE);
assert(bo->rq == NULL);
diff --git a/src/sna/kgem.h b/src/sna/kgem.h
index 95f0f7b2..4ea8596f 100644
--- a/src/sna/kgem.h
+++ b/src/sna/kgem.h
@@ -647,8 +647,11 @@ static inline bool __kgem_bo_is_busy(struct kgem *kgem, struct kgem_bo *bo)
static inline void kgem_bo_mark_unreusable(struct kgem_bo *bo)
{
- while (bo->proxy)
+ while (bo->proxy) {
+ bo->flush = true;
bo = bo->proxy;
+ }
+ bo->flush = true;
bo->reusable = false;
}
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 7fef4f27..040c0093 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -874,9 +874,8 @@ fallback:
sna_pixmap_destroy(pixmap);
goto fallback;
}
- priv->cpu_bo->flush = true;
priv->cpu_bo->pitch = pitch;
- priv->cpu_bo->reusable = false;
+ kgem_bo_mark_unreusable(priv->cpu_bo);
sna_accel_watch_flush(sna, 1);
#ifdef DEBUG_MEMORY
sna->debug_memory.cpu_bo_allocs++;
@@ -4036,7 +4035,6 @@ try_upload_blt(PixmapPtr pixmap, RegionRec *region,
if (src_bo == NULL)
return false;
- src_bo->flush = true;
src_bo->pitch = stride;
kgem_bo_mark_unreusable(src_bo);
@@ -5300,7 +5298,6 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
src_pixmap->devKind * src_pixmap->drawable.height,
true);
if (src_bo) {
- src_bo->flush = true;
src_bo->pitch = src_pixmap->devKind;
kgem_bo_mark_unreusable(src_bo);
@@ -14512,7 +14509,6 @@ sna_get_image_blt(PixmapPtr pixmap,
pitch * (region->extents.y2 - region->extents.y1),
false);
if (dst_bo) {
- dst_bo->flush = true;
dst_bo->pitch = pitch;
kgem_bo_mark_unreusable(dst_bo);