diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-12-25 09:40:46 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-12-25 11:20:40 +0000 |
commit | f7593a995a829978ce81397dde5c9ea6f9bb7681 (patch) | |
tree | ce4b4d05805804fc0d219e440c598f725aab234b /src/sna/kgem.h | |
parent | aff32e3e08fce3c7b8dab3a25c96d69c409471fc (diff) |
sna: Move the is-mappable check into the callers of region_inplace()
As they slightly differ in their requirements.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/kgem.h')
-rw-r--r-- | src/sna/kgem.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/sna/kgem.h b/src/sna/kgem.h index 3e69be5b..7f2ebaf1 100644 --- a/src/sna/kgem.h +++ b/src/sna/kgem.h @@ -361,6 +361,21 @@ static inline bool kgem_bo_is_busy(struct kgem_bo *bo) return bo->rq; } +static inline bool kgem_bo_map_will_stall(struct kgem *kgem, struct kgem_bo *bo) +{ + DBG(("%s? handle=%d, domain=%d, offset=%x, size=%x\n", + __FUNCTION__, bo->handle, + bo->domain, bo->presumed_offset, bo->size)); + + if (kgem_bo_is_busy(bo)) + return true; + + if (bo->presumed_offset == 0) + return !list_is_empty(&kgem->requests); + + return !kgem_bo_is_mappable(kgem, bo); +} + static inline bool kgem_bo_is_dirty(struct kgem_bo *bo) { if (bo == NULL) @@ -370,6 +385,7 @@ static inline bool kgem_bo_is_dirty(struct kgem_bo *bo) bo = bo->proxy; return bo->dirty; } + static inline void kgem_bo_mark_dirty(struct kgem_bo *bo) { if (bo->proxy) |