1 /* SPDX-License-Identifier: MIT */
3 * Copyright © 2019 Intel Corporation
6 #ifndef __INTEL_GT_TYPES__
7 #define __INTEL_GT_TYPES__
9 #include <linux/ktime.h>
10 #include <linux/list.h>
11 #include <linux/mutex.h>
12 #include <linux/notifier.h>
13 #include <linux/spinlock.h>
14 #include <linux/types.h>
16 #include "uc/intel_uc.h"
19 #include "intel_reset_types.h"
20 #include "intel_wakeref.h"
22 struct drm_i915_private;
24 struct intel_engine_cs;
27 struct intel_hangcheck {
28 /* For hangcheck timer */
29 #define DRM_I915_HANGCHECK_PERIOD 1500 /* in ms */
30 #define DRM_I915_HANGCHECK_JIFFIES msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD)
32 struct delayed_work work;
36 struct drm_i915_private *i915;
37 struct intel_uncore *uncore;
38 struct i915_ggtt *ggtt;
42 struct intel_gt_timelines {
43 struct mutex mutex; /* protects list */
44 struct list_head active_list;
46 /* Pack multiple timelines' seqnos into the same page */
48 struct list_head hwsp_free_list;
51 struct list_head active_rings;
53 struct intel_wakeref wakeref;
55 struct list_head closed_vma;
56 spinlock_t closed_lock; /* guards the list of closed_vma */
58 struct intel_hangcheck hangcheck;
59 struct intel_reset reset;
62 * Is the GPU currently considered idle, or busy executing
63 * userspace requests? Whilst idle, we allow runtime power
64 * management to power down the hardware and display clocks.
65 * In order to reduce the effect on performance, there
66 * is a slight delay before we do so.
68 intel_wakeref_t awake;
70 struct blocking_notifier_head pm_notifications;
72 ktime_t last_init_time;
74 struct i915_vma *scratch;
81 struct intel_engine_cs *engine[I915_NUM_ENGINES];
82 struct intel_engine_cs *engine_class[MAX_ENGINE_CLASS + 1]
83 [MAX_ENGINE_INSTANCE + 1];
86 enum intel_gt_scratch_field {
88 INTEL_GT_SCRATCH_FIELD_DEFAULT = 0,
91 INTEL_GT_SCRATCH_FIELD_CLEAR_SLM_WA = 128,
94 INTEL_GT_SCRATCH_FIELD_RENDER_FLUSH = 128,
97 INTEL_GT_SCRATCH_FIELD_COHERENTL3_WA = 256,
101 #endif /* __INTEL_GT_TYPES_H__ */