2 * SPDX-License-Identifier: MIT
4 * Copyright © 2008-2018 Intel Corporation
10 #include <linux/compiler.h>
11 #include <linux/types.h>
12 #include <linux/srcu.h>
14 #include "intel_engine_types.h"
16 struct drm_i915_private;
17 struct intel_engine_cs;
21 void i915_handle_error(struct drm_i915_private *i915,
22 intel_engine_mask_t engine_mask,
24 const char *fmt, ...);
25 #define I915_ERROR_CAPTURE BIT(0)
27 void i915_clear_error_registers(struct drm_i915_private *i915);
29 void i915_reset(struct drm_i915_private *i915,
30 intel_engine_mask_t stalled_mask,
32 int i915_reset_engine(struct intel_engine_cs *engine,
35 void i915_reset_request(struct i915_request *rq, bool guilty);
36 bool i915_reset_flush(struct drm_i915_private *i915);
38 int __must_check i915_reset_trylock(struct drm_i915_private *i915);
39 void i915_reset_unlock(struct drm_i915_private *i915, int tag);
41 int i915_terminally_wedged(struct drm_i915_private *i915);
43 bool intel_has_gpu_reset(struct drm_i915_private *i915);
44 bool intel_has_reset_engine(struct drm_i915_private *i915);
46 int intel_gpu_reset(struct drm_i915_private *i915,
47 intel_engine_mask_t engine_mask);
49 int intel_reset_guc(struct drm_i915_private *i915);
51 struct i915_wedge_me {
52 struct delayed_work work;
53 struct drm_i915_private *i915;
57 void __i915_init_wedge(struct i915_wedge_me *w,
58 struct drm_i915_private *i915,
61 void __i915_fini_wedge(struct i915_wedge_me *w);
63 #define i915_wedge_on_timeout(W, DEV, TIMEOUT) \
64 for (__i915_init_wedge((W), (DEV), (TIMEOUT), __func__); \
66 __i915_fini_wedge((W)))
68 #endif /* I915_RESET_H */