1 /* SPDX-License-Identifier: MIT */
3 * Copyright © 2020 Intel Corporation
5 #ifndef __I915_GEM_WW_H__
6 #define __I915_GEM_WW_H__
8 #include <drm/drm_drv.h>
10 struct i915_gem_ww_ctx {
11 struct ww_acquire_ctx ctx;
12 struct list_head obj_list;
13 struct drm_i915_gem_object *contended;
17 void i915_gem_ww_ctx_init(struct i915_gem_ww_ctx *ctx, bool intr);
18 void i915_gem_ww_ctx_fini(struct i915_gem_ww_ctx *ctx);
19 int __must_check i915_gem_ww_ctx_backoff(struct i915_gem_ww_ctx *ctx);
20 void i915_gem_ww_unlock_single(struct drm_i915_gem_object *obj);