diff options
Diffstat (limited to 'src/sna')
-rw-r--r-- | src/sna/kgem.c | 5 | ||||
-rw-r--r-- | src/sna/kgem.h | 3 | ||||
-rw-r--r-- | src/sna/sna_accel.c | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 3d8620ac..bc2e66ea 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -3826,8 +3826,10 @@ uint32_t kgem_add_reloc(struct kgem *kgem, kgem->reloc[index].target_handle = bo->handle; kgem->reloc[index].presumed_offset = bo->presumed_offset; - if (read_write_domain & 0x7ff) + if (read_write_domain & 0x7ff) { + assert(!bo->snoop || kgem->can_blt_cpu); kgem_bo_mark_dirty(bo); + } delta += bo->presumed_offset; } else { @@ -3964,6 +3966,7 @@ void *kgem_bo_map(struct kgem *kgem, struct kgem_bo *bo) ptr = bo->map; if (ptr == NULL) { assert(kgem_bo_size(bo) <= kgem->aperture_mappable / 2); + assert(kgem->gen != 21 || bo->tiling != I915_TILING_Y); kgem_trim_vma_cache(kgem, MAP_GTT, bucket(bo)); diff --git a/src/sna/kgem.h b/src/sna/kgem.h index cdbb7cbf..06f39992 100644 --- a/src/sna/kgem.h +++ b/src/sna/kgem.h @@ -519,6 +519,9 @@ static inline bool kgem_bo_can_map(struct kgem *kgem, struct kgem_bo *bo) if (!bo->tiling && kgem->has_llc) return true; + if (kgem->gen == 21 && bo->tiling == I915_TILING_Y) + return false; + return kgem_bo_size(bo) <= kgem->aperture_mappable / 4; } diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 94ed9338..d849bea6 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -1830,6 +1830,7 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable, assert(flags & MOVE_WRITE); if (priv->stride && priv->gpu_bo && + kgem_bo_can_map(&sna->kgem, priv->gpu_bo) && region_inplace(sna, pixmap, region, priv, true)) { assert(priv->gpu_bo->proxy == NULL); if (!__kgem_bo_is_busy(&sna->kgem, priv->gpu_bo)) { @@ -1913,6 +1914,7 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable, } if (operate_inplace(priv, flags) && + kgem_bo_can_map(&sna->kgem, priv->gpu_bo) && region_inplace(sna, pixmap, region, priv, (flags & MOVE_READ) == 0)) { kgem_bo_submit(&sna->kgem, priv->gpu_bo); |