diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-08-04 18:32:30 +0300 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-08-04 22:19:58 +0300 |
commit | 20dfbde463c84d5e0eb32b9f3f84992eb583a698 (patch) | |
tree | 4d0f0fc885324666e062870bf419ac9d3d6728db /drivers/gpu/drm/i915/i915_gem_evict.c | |
parent | de18003328d1dcf845c451945461e55bb8801fd6 (diff) | |
download | linux-20dfbde463c84d5e0eb32b9f3f84992eb583a698.tar.xz |
drm/i915: Wrap vma->pin_count accessors with small inline helpers
In the next few patches, the VMA pinning API is overhauled and to reduce
the churn we pull out the update to the accessors into a prep patch.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1470324762-2545-14-git-send-email-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_evict.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_evict.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c index ef12ecd2b182..7be425826539 100644 --- a/drivers/gpu/drm/i915/i915_gem_evict.c +++ b/drivers/gpu/drm/i915/i915_gem_evict.c @@ -49,7 +49,7 @@ gpu_is_idle(struct drm_i915_private *dev_priv) static bool mark_free(struct i915_vma *vma, struct list_head *unwind) { - if (vma->pin_count) + if (i915_vma_is_pinned(vma)) return false; if (WARN_ON(!list_empty(&vma->exec_list))) @@ -183,7 +183,7 @@ found: */ list_for_each_entry_safe(vma, next, &eviction_list, exec_list) { if (drm_mm_scan_remove_block(&vma->node)) - vma->pin_count++; + __i915_vma_pin(vma); else list_del_init(&vma->exec_list); } @@ -195,7 +195,7 @@ found: exec_list); list_del_init(&vma->exec_list); - vma->pin_count--; + __i915_vma_unpin(vma); if (ret == 0) ret = i915_vma_unbind(vma); } @@ -220,8 +220,8 @@ i915_gem_evict_for_vma(struct i915_vma *target) vma = container_of(node, typeof(*vma), node); - if (vma->pin_count) { - if (!vma->exec_entry || (vma->pin_count > 1)) + if (i915_vma_is_pinned(vma)) { + if (!vma->exec_entry || i915_vma_pin_count(vma) > 1) /* Object is pinned for some other use */ return -EBUSY; @@ -281,7 +281,7 @@ int i915_gem_evict_vm(struct i915_address_space *vm, bool do_idle) } list_for_each_entry_safe(vma, next, &vm->inactive_list, vm_link) - if (vma->pin_count == 0) + if (!i915_vma_is_pinned(vma)) WARN_ON(i915_vma_unbind(vma)); return 0; |