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_engine_types.h"
20 #include "intel_llc_types.h"
21 #include "intel_reset_types.h"
22 #include "intel_rc6_types.h"
23 #include "intel_rps_types.h"
24 #include "intel_wakeref.h"
26 struct drm_i915_private;
28 struct intel_engine_cs;
32 struct drm_i915_private *i915;
33 struct intel_uncore *uncore;
34 struct i915_ggtt *ggtt;
38 struct intel_gt_timelines {
39 spinlock_t lock; /* protects active_list */
40 struct list_head active_list;
42 /* Pack multiple timelines' seqnos into the same page */
44 struct list_head hwsp_free_list;
47 struct intel_gt_requests {
49 * We leave the user IRQ off as much as possible,
50 * but this means that requests will finish and never
51 * be retired once the system goes idle. Set a timer to
52 * fire periodically while the ring is running. When it
53 * fires, go retire requests.
55 struct delayed_work retire_work;
58 struct intel_wakeref wakeref;
59 atomic_t user_wakeref;
61 struct list_head closed_vma;
62 spinlock_t closed_lock; /* guards the list of closed_vma */
64 ktime_t last_init_time;
65 struct intel_reset reset;
68 * Is the GPU currently considered idle, or busy executing
69 * userspace requests? Whilst idle, we allow runtime power
70 * management to power down the hardware and display clocks.
71 * In order to reduce the effect on performance, there
72 * is a slight delay before we do so.
74 intel_wakeref_t awake;
89 struct intel_engine_cs *engine[I915_NUM_ENGINES];
90 struct intel_engine_cs *engine_class[MAX_ENGINE_CLASS + 1]
91 [MAX_ENGINE_INSTANCE + 1];
94 * Default address space (either GGTT or ppGTT depending on arch).
96 * Reserved for exclusive use by the kernel.
98 struct i915_address_space *vm;
100 struct i915_vma *scratch;
103 enum intel_gt_scratch_field {
105 INTEL_GT_SCRATCH_FIELD_DEFAULT = 0,
108 INTEL_GT_SCRATCH_FIELD_RENDER_FLUSH = 128,
111 INTEL_GT_SCRATCH_FIELD_COHERENTL3_WA = 256,
114 INTEL_GT_SCRATCH_FIELD_PERF_CS_GPR = 2048,
117 INTEL_GT_SCRATCH_FIELD_PERF_PREDICATE_RESULT_1 = 2096,
120 #endif /* __INTEL_GT_TYPES_H__ */