Lines Matching +full:use +full:- +full:guard +full:- +full:pages
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
28 #include <linux/io-mapping.h>
53 return !i915_active_is_idle(&vma->active); in i915_vma_is_active()
68 return _i915_vma_move_to_active(vma, rq, &rq->fence, flags); in i915_vma_move_to_active()
71 #define __i915_vma_flags(v) ((unsigned long *)&(v)->flags.counter)
80 return i915_is_dpt(vma->vm); in i915_vma_is_dpt()
125 return !list_empty(&vma->closed_link); in i915_vma_is_closed()
128 /* Internal use only. */
131 return vma->node.size - 2 * vma->guard; in __i915_vma_size()
135 * i915_vma_size - Obtain the va range size of the vma
146 GEM_BUG_ON(!drm_mm_node_allocated(&vma->node)); in i915_vma_size()
150 /* Internal use only. */
153 /* The actual start of the vma->pages is after the guard pages. */ in __i915_vma_offset()
154 return vma->node.start + vma->guard; in __i915_vma_offset()
158 * i915_vma_offset - Obtain the va offset of the vma
163 * should use to access the bound data.
169 GEM_BUG_ON(!drm_mm_node_allocated(&vma->node)); in i915_vma_offset()
176 GEM_BUG_ON(!drm_mm_node_allocated(&vma->node)); in i915_ggtt_offset()
179 i915_vma_size(vma) - 1)); in i915_ggtt_offset()
185 return i915_vm_to_ggtt(vma->vm)->pin_bias; in i915_ggtt_pin_bias()
190 i915_gem_object_get(vma->obj); in i915_vma_get()
196 if (likely(kref_get_unless_zero(&vma->obj->base.refcount))) in i915_vma_tryget()
204 i915_gem_object_put(vma->obj); in i915_vma_put()
216 cmp = ptrdiff(vma->vm, vm); in i915_vma_compare()
221 cmp = vma->gtt_view.type; in i915_vma_compare()
225 cmp -= view->type; in i915_vma_compare()
232 * different views using it as a "type" and also use a compact (no in i915_vma_compare()
248 return memcmp(&vma->gtt_view.partial, &view->partial, view->type); in i915_vma_compare()
276 #define assert_vma_held(vma) dma_resv_assert_held((vma)->obj->base.resv)
280 dma_resv_lock(vma->obj->base.resv, NULL); in i915_vma_lock()
285 dma_resv_unlock(vma->obj->base.resv); in i915_vma_unlock()
300 err = i915_gem_object_lock(vma->obj, &ww); in i915_vma_pin()
303 if (err == -EDEADLK) { in i915_vma_pin()
318 return atomic_read(&vma->flags) & I915_VMA_PIN_MASK; in i915_vma_pin_count()
328 atomic_inc(&vma->flags); in __i915_vma_pin()
335 atomic_dec(&vma->flags); in __i915_vma_unpin()
340 GEM_BUG_ON(!drm_mm_node_allocated(&vma->node)); in i915_vma_unpin()
347 return atomic_read(&vma->flags) & where; in i915_vma_is_bound()
353 return drm_mm_node_allocated(node) && node->color != color; in i915_node_color_differs()
357 * i915_vma_pin_iomap - calls ioremap_wc to map the GGTT VMA via the aperture
370 * i915_vma_unpin_iomap - unpins the mapping returned from i915_vma_iomap
381 * i915_vma_pin_fence - pin fencing state
402 GEM_BUG_ON(atomic_read(&vma->fence->pin_count) <= 0); in __i915_vma_unpin_fence()
403 atomic_dec(&vma->fence->pin_count); in __i915_vma_unpin_fence()
407 * i915_vma_unpin_fence - unpin fencing state
417 if (vma->fence) in i915_vma_unpin_fence()
423 return vma->fence ? vma->fence->id : -1; in i915_vma_fence_id()
448 * for_each_ggtt_vma - Iterate over the GGTT VMA belonging to an object.
457 list_for_each_entry(V, &(OBJ)->vma.list, obj_link) \
469 return i915_active_wait(&vma->active); in i915_vma_sync()
473 * i915_vma_get_current_resource - Get the current resource of the vma
484 return i915_vma_resource_get(vma->resource); in i915_vma_get_current_resource()