diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-15 18:14:24 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-15 18:14:24 +0000 |
commit | 6f7bc35d7f956f7c2507eabc874ead1a83c85ddb (patch) | |
tree | c3ab5ccaa24e43ff71eeec563e419dd5d3da41ae /src/sna/kgem.h | |
parent | 475fa67ed320f94df37ec86fe6c5dda886923751 (diff) |
sna: Use indirect uploads rather than teardown existing CPU maps
Allow the snoopable CPU mapping to be used inplace of the GTT map for
untiled bo.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/kgem.h')
-rw-r--r-- | src/sna/kgem.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/sna/kgem.h b/src/sna/kgem.h index 421c84f9..377d21d3 100644 --- a/src/sna/kgem.h +++ b/src/sna/kgem.h @@ -50,6 +50,8 @@ struct kgem_bo { struct list vma; void *map; +#define IS_CPU_MAP(ptr) ((uintptr_t)(ptr) & 1) +#define IS_GTT_MAP(ptr) (ptr && ((uintptr_t)(ptr) & 1) == 0) struct kgem_request *rq; struct drm_i915_gem_exec_object2 *exec; @@ -375,6 +377,16 @@ static inline bool kgem_bo_is_mappable(struct kgem *kgem, return bo->presumed_offset + bo->size <= kgem->aperture_mappable; } +static inline bool kgem_bo_mapped(struct kgem_bo *bo) +{ + DBG_HDR(("%s: map=%p, tiling=%d\n", __FUNCTION__, bo->map, bo->tiling)); + + if (bo->map == NULL) + return false; + + return IS_CPU_MAP(bo->map) == !bo->tiling; +} + static inline bool kgem_bo_is_busy(struct kgem_bo *bo) { DBG_HDR(("%s: domain: %d exec? %d, rq? %d\n", |