2019-01-16 22:33:04 +07:00
|
|
|
/*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
* Copyright © 2008-2018 Intel Corporation
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef I915_RESET_H
|
|
|
|
#define I915_RESET_H
|
|
|
|
|
|
|
|
#include <linux/compiler.h>
|
|
|
|
#include <linux/types.h>
|
2019-02-08 22:37:03 +07:00
|
|
|
#include <linux/srcu.h>
|
2019-01-16 22:33:04 +07:00
|
|
|
|
2019-04-25 00:48:39 +07:00
|
|
|
#include "gt/intel_engine_types.h"
|
2019-04-01 23:26:39 +07:00
|
|
|
|
2019-01-16 22:33:04 +07:00
|
|
|
struct drm_i915_private;
|
2019-04-05 18:00:08 +07:00
|
|
|
struct i915_request;
|
2019-01-16 22:33:04 +07:00
|
|
|
struct intel_engine_cs;
|
|
|
|
struct intel_guc;
|
|
|
|
|
|
|
|
__printf(4, 5)
|
|
|
|
void i915_handle_error(struct drm_i915_private *i915,
|
2019-04-01 23:26:39 +07:00
|
|
|
intel_engine_mask_t engine_mask,
|
2019-01-16 22:33:04 +07:00
|
|
|
unsigned long flags,
|
|
|
|
const char *fmt, ...);
|
|
|
|
#define I915_ERROR_CAPTURE BIT(0)
|
|
|
|
|
2019-06-07 18:59:32 +07:00
|
|
|
void i915_check_and_clear_faults(struct drm_i915_private *i915);
|
2019-01-16 22:33:04 +07:00
|
|
|
|
|
|
|
void i915_reset(struct drm_i915_private *i915,
|
2019-04-01 23:26:39 +07:00
|
|
|
intel_engine_mask_t stalled_mask,
|
2019-01-16 22:33:04 +07:00
|
|
|
const char *reason);
|
|
|
|
int i915_reset_engine(struct intel_engine_cs *engine,
|
|
|
|
const char *reason);
|
|
|
|
|
2019-01-25 20:22:28 +07:00
|
|
|
void i915_reset_request(struct i915_request *rq, bool guilty);
|
|
|
|
|
2019-02-08 22:37:03 +07:00
|
|
|
int __must_check i915_reset_trylock(struct drm_i915_private *i915);
|
|
|
|
void i915_reset_unlock(struct drm_i915_private *i915, int tag);
|
|
|
|
|
2019-02-20 21:56:37 +07:00
|
|
|
int i915_terminally_wedged(struct drm_i915_private *i915);
|
|
|
|
|
2019-01-16 22:33:04 +07:00
|
|
|
bool intel_has_gpu_reset(struct drm_i915_private *i915);
|
|
|
|
bool intel_has_reset_engine(struct drm_i915_private *i915);
|
|
|
|
|
2019-04-01 23:26:39 +07:00
|
|
|
int intel_gpu_reset(struct drm_i915_private *i915,
|
|
|
|
intel_engine_mask_t engine_mask);
|
2019-01-16 22:33:04 +07:00
|
|
|
|
|
|
|
int intel_reset_guc(struct drm_i915_private *i915);
|
|
|
|
|
|
|
|
struct i915_wedge_me {
|
|
|
|
struct delayed_work work;
|
|
|
|
struct drm_i915_private *i915;
|
|
|
|
const char *name;
|
|
|
|
};
|
|
|
|
|
|
|
|
void __i915_init_wedge(struct i915_wedge_me *w,
|
|
|
|
struct drm_i915_private *i915,
|
|
|
|
long timeout,
|
|
|
|
const char *name);
|
|
|
|
void __i915_fini_wedge(struct i915_wedge_me *w);
|
|
|
|
|
|
|
|
#define i915_wedge_on_timeout(W, DEV, TIMEOUT) \
|
|
|
|
for (__i915_init_wedge((W), (DEV), (TIMEOUT), __func__); \
|
|
|
|
(W)->i915; \
|
|
|
|
__i915_fini_wedge((W)))
|
|
|
|
|
|
|
|
#endif /* I915_RESET_H */
|