diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-10-22 16:59:29 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-10-22 17:57:59 +0100 |
commit | c51dd18eade425a7e280203b328b66d278fcba1c (patch) | |
tree | e778bb7669aa747b1c428ff563440465b4bbf714 /src | |
parent | bccbbf8a68faf7aac274efd289d4916083b1a1e3 (diff) |
sna: Fix inconsistency in has_coherent_ptr assertion
We occasionally will read from an "incoherent" ptr in the belief that
the clflush hit will be worth it.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/sna_accel.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 954d2345..1977d459 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -1436,10 +1436,12 @@ static inline bool has_coherent_ptr(struct sna *sna, struct sna_pixmap *priv, un if (!priv->cpu_bo) return true; + assert(priv->pixmap->devKind == priv->cpu_bo->pitch); return priv->pixmap->devPrivate.ptr == MAP(priv->cpu_bo->map__cpu); } assert(!priv->move_to_gpu || (flags & MOVE_WRITE) == 0); + assert(priv->pixmap->devKind == priv->gpu_bo->pitch); if (priv->pixmap->devPrivate.ptr == MAP(priv->gpu_bo->map__cpu)) { assert(priv->mapped == MAPPED_CPU); @@ -1447,7 +1449,7 @@ static inline bool has_coherent_ptr(struct sna *sna, struct sna_pixmap *priv, un if (priv->gpu_bo->tiling != I915_TILING_NONE) return false; - return kgem_bo_can_map__cpu(&sna->kgem, priv->gpu_bo, flags & MOVE_WRITE); + return flags & MOVE_READ || kgem_bo_can_map__cpu(&sna->kgem, priv->gpu_bo, flags & MOVE_WRITE); } if (priv->pixmap->devPrivate.ptr == MAP(priv->gpu_bo->map__gtt)) { @@ -2027,6 +2029,7 @@ skip_inplace_map: assert(priv->move_to_gpu == NULL || (flags & MOVE_WRITE) == 0); assert(!priv->mapped); + assert(priv->gpu_bo->tiling == I915_TILING_NONE); ptr = kgem_bo_map__cpu(&sna->kgem, priv->gpu_bo); if (ptr != NULL) { |