diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-06-29 15:04:09 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-06-29 16:08:30 +0100 |
commit | 6ab2a3acf71b5204c399c7649e5601c93a99f25f (patch) | |
tree | 66e3c3c27203410c95119989af4631ca5d377cc6 /src/sna/sna_io.c | |
parent | 9026bb954646c0425360c2236e26c79d097142cd (diff) |
sna: Improve checks for coherent access through CPU mappings
Refactor the CPU mapping tests to a single function, and remember to
test for a pending GPU write (i.e. bo->exec).
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 | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c index 6ab907f5..a4932b8d 100644 --- a/src/sna/sna_io.c +++ b/src/sna/sna_io.c @@ -53,15 +53,12 @@ static inline bool must_tile(struct sna *sna, int width, int height) upload_too_large(sna, width, height)); } -static bool bo_inplace_tiled(struct kgem *kgem, struct kgem_bo *bo) +static bool bo_inplace_tiled(struct kgem *kgem, struct kgem_bo *bo, bool write) { if (bo->tiling != I915_TILING_X) return false; - if (bo->scanout) - return false; - - return bo->domain == DOMAIN_CPU || kgem->has_llc; + return kgem_bo_can_map__cpu(kgem, bo, write); } static bool download_inplace__tiled(struct kgem *kgem, struct kgem_bo *bo) @@ -69,7 +66,7 @@ static bool download_inplace__tiled(struct kgem *kgem, struct kgem_bo *bo) if (!kgem->memcpy_from_tiled_x) return false; - return bo_inplace_tiled(kgem, bo); + return bo_inplace_tiled(kgem, bo, false); } static bool @@ -537,7 +534,7 @@ static bool upload_inplace__tiled(struct kgem *kgem, struct kgem_bo *bo) if (!kgem->memcpy_to_tiled_x) return false; - return bo_inplace_tiled(kgem, bo); + return bo_inplace_tiled(kgem, bo, true); } static bool |