summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem_ww.h
diff options
context:
space:
mode:
authorThomas Hellström <thomas.hellstrom@linux.intel.com>2021-06-17 08:30:08 +0200
committerMatthew Auld <matthew.auld@intel.com>2021-06-17 14:22:59 +0100
commit5c43ec5d538a5fa1736d298e63a3f8ac03009eea (patch)
tree0b01805eb8b062df55f1f693e020737901e7ccf3 /drivers/gpu/drm/i915/i915_gem_ww.h
parent1c4dbe056dab0b7c2a2f42f4d393cc7b9bdb98ad (diff)
downloadlinux-5c43ec5d538a5fa1736d298e63a3f8ac03009eea.tar.gz
linux-5c43ec5d538a5fa1736d298e63a3f8ac03009eea.tar.bz2
linux-5c43ec5d538a5fa1736d298e63a3f8ac03009eea.zip
drm/i915: Break out dma_resv ww locking utilities to separate files
As we're about to add more ww-related functionality, break out the dma_resv ww locking utilities to their own files Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Signed-off-by: Matthew Auld <matthew.auld@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210617063018.92802-3-thomas.hellstrom@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_ww.h')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_ww.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_ww.h b/drivers/gpu/drm/i915/i915_gem_ww.h
new file mode 100644
index 000000000000..f2d8769e4118
--- /dev/null
+++ b/drivers/gpu/drm/i915/i915_gem_ww.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2020 Intel Corporation
+ */
+#ifndef __I915_GEM_WW_H__
+#define __I915_GEM_WW_H__
+
+#include <drm/drm_drv.h>
+
+struct i915_gem_ww_ctx {
+ struct ww_acquire_ctx ctx;
+ struct list_head obj_list;
+ struct drm_i915_gem_object *contended;
+ bool intr;
+};
+
+void i915_gem_ww_ctx_init(struct i915_gem_ww_ctx *ctx, bool intr);
+void i915_gem_ww_ctx_fini(struct i915_gem_ww_ctx *ctx);
+int __must_check i915_gem_ww_ctx_backoff(struct i915_gem_ww_ctx *ctx);
+void i915_gem_ww_unlock_single(struct drm_i915_gem_object *obj);
+#endif