drm/i915/gt: Use intel_gt as the primary object for handling resets
[linux-2.6-block.git] / drivers / gpu / drm / i915 / gt / intel_gt.h
CommitLineData
24635c51
TU
1/* SPDX-License-Identifier: MIT */
2/*
3 * Copyright © 2019 Intel Corporation
4 */
5
6#ifndef __INTEL_GT__
7#define __INTEL_GT__
8
eaf522f6 9#include "intel_engine_types.h"
24635c51 10#include "intel_gt_types.h"
cb823ed9 11#include "intel_reset.h"
24635c51 12
724e9564
TU
13struct drm_i915_private;
14
15void intel_gt_init_early(struct intel_gt *gt, struct drm_i915_private *i915);
d8a44248 16void intel_gt_init_hw(struct drm_i915_private *i915);
24635c51 17
cb823ed9
CW
18void intel_gt_cleanup_early(struct intel_gt *gt);
19
eaf522f6
TU
20void intel_gt_check_and_clear_faults(struct intel_gt *gt);
21void intel_gt_clear_error_registers(struct intel_gt *gt,
22 intel_engine_mask_t engine_mask);
23
a1c8a09e 24void intel_gt_flush_ggtt_writes(struct intel_gt *gt);
baea429d 25void intel_gt_chipset_flush(struct intel_gt *gt);
a1c8a09e 26
cb823ed9
CW
27void intel_gt_init_hangcheck(struct intel_gt *gt);
28
db56f974
TU
29int intel_gt_init_scratch(struct intel_gt *gt, unsigned int size);
30void intel_gt_fini_scratch(struct intel_gt *gt);
31
46c5847e
LL
32static inline u32 intel_gt_scratch_offset(const struct intel_gt *gt,
33 enum intel_gt_scratch_field field)
db56f974 34{
46c5847e 35 return i915_ggtt_offset(gt->scratch) + field;
db56f974
TU
36}
37
cb823ed9
CW
38static inline bool intel_gt_is_wedged(struct intel_gt *gt)
39{
40 return __intel_reset_failed(&gt->reset);
41}
42
43void intel_gt_queue_hangcheck(struct intel_gt *gt);
44
24635c51 45#endif /* __INTEL_GT_H__ */