Lines Matching refs:ww

9 void i915_gem_ww_ctx_init(struct i915_gem_ww_ctx *ww, bool intr)  in i915_gem_ww_ctx_init()  argument
11 ww_acquire_init(&ww->ctx, &reservation_ww_class); in i915_gem_ww_ctx_init()
12 INIT_LIST_HEAD(&ww->obj_list); in i915_gem_ww_ctx_init()
13 ww->intr = intr; in i915_gem_ww_ctx_init()
14 ww->contended = NULL; in i915_gem_ww_ctx_init()
17 static void i915_gem_ww_ctx_unlock_all(struct i915_gem_ww_ctx *ww) in i915_gem_ww_ctx_unlock_all() argument
21 while ((obj = list_first_entry_or_null(&ww->obj_list, struct drm_i915_gem_object, obj_link))) { in i915_gem_ww_ctx_unlock_all()
35 void i915_gem_ww_ctx_fini(struct i915_gem_ww_ctx *ww) in i915_gem_ww_ctx_fini() argument
37 i915_gem_ww_ctx_unlock_all(ww); in i915_gem_ww_ctx_fini()
38 WARN_ON(ww->contended); in i915_gem_ww_ctx_fini()
39 ww_acquire_fini(&ww->ctx); in i915_gem_ww_ctx_fini()
42 int __must_check i915_gem_ww_ctx_backoff(struct i915_gem_ww_ctx *ww) in i915_gem_ww_ctx_backoff() argument
46 if (WARN_ON(!ww->contended)) in i915_gem_ww_ctx_backoff()
49 i915_gem_ww_ctx_unlock_all(ww); in i915_gem_ww_ctx_backoff()
50 if (ww->intr) in i915_gem_ww_ctx_backoff()
51 ret = dma_resv_lock_slow_interruptible(ww->contended->base.resv, &ww->ctx); in i915_gem_ww_ctx_backoff()
53 dma_resv_lock_slow(ww->contended->base.resv, &ww->ctx); in i915_gem_ww_ctx_backoff()
56 list_add_tail(&ww->contended->obj_link, &ww->obj_list); in i915_gem_ww_ctx_backoff()
58 i915_gem_object_put(ww->contended); in i915_gem_ww_ctx_backoff()
60 ww->contended = NULL; in i915_gem_ww_ctx_backoff()