drm/i915: Break out dma_resv ww locking utilities to separate files
[linux-2.6-microblaze.git] / drivers / gpu / drm / i915 / i915_gem_ww.h
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2020 Intel Corporation
4  */
5 #ifndef __I915_GEM_WW_H__
6 #define __I915_GEM_WW_H__
7
8 #include <drm/drm_drv.h>
9
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;
14         bool intr;
15 };
16
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);
21 #endif