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_gt_buffer_pool_types.h"
21 #include "intel_llc_types.h"
22 #include "intel_reset_types.h"
23 #include "intel_rc6_types.h"
24 #include "intel_rps_types.h"
25 #include "intel_wakeref.h"
27 struct drm_i915_private;
29 struct intel_engine_cs;
33 struct drm_i915_private *i915;
34 struct intel_uncore *uncore;
35 struct i915_ggtt *ggtt;
39 struct mutex tlb_invalidate_lock;
41 struct intel_gt_timelines {
42 spinlock_t lock; /* protects active_list */
43 struct list_head active_list;
45 /* Pack multiple timelines' seqnos into the same page */
47 struct list_head hwsp_free_list;
50 struct intel_gt_requests {
52 * We leave the user IRQ off as much as possible,
53 * but this means that requests will finish and never
54 * be retired once the system goes idle. Set a timer to
55 * fire periodically while the ring is running. When it
56 * fires, go retire requests.
58 struct delayed_work retire_work;
61 struct intel_wakeref wakeref;
62 atomic_t user_wakeref;
64 struct list_head closed_vma;
65 spinlock_t closed_lock; /* guards the list of closed_vma */
67 ktime_t last_init_time;
68 struct intel_reset reset;
71 * Is the GPU currently considered idle, or busy executing
72 * userspace requests? Whilst idle, we allow runtime power
73 * management to power down the hardware and display clocks.
74 * In order to reduce the effect on performance, there
75 * is a slight delay before we do so.
77 intel_wakeref_t awake;
92 struct intel_engine_cs *engine[I915_NUM_ENGINES];
93 struct intel_engine_cs *engine_class[MAX_ENGINE_CLASS + 1]
94 [MAX_ENGINE_INSTANCE + 1];
97 * Default address space (either GGTT or ppGTT depending on arch).
99 * Reserved for exclusive use by the kernel.
101 struct i915_address_space *vm;
104 * A pool of objects to use as shadow copies of client batch buffers
105 * when the command parser is enabled. Prevents the client from
106 * modifying the batch contents after software parsing.
108 * Buffers older than 1s are periodically reaped from the pool,
109 * or may be reclaimed by the shrinker before then.
111 struct intel_gt_buffer_pool buffer_pool;
113 struct i915_vma *scratch;
115 struct intel_gt_info {
116 intel_engine_mask_t engine_mask;
119 /* Media engine access to SFC per instance */
122 /* Slice/subslice/EU info */
123 struct sseu_dev_info sseu;
127 enum intel_gt_scratch_field {
129 INTEL_GT_SCRATCH_FIELD_DEFAULT = 0,
132 INTEL_GT_SCRATCH_FIELD_RENDER_FLUSH = 128,
135 INTEL_GT_SCRATCH_FIELD_COHERENTL3_WA = 256,
138 INTEL_GT_SCRATCH_FIELD_PERF_CS_GPR = 2048,
141 INTEL_GT_SCRATCH_FIELD_PERF_PREDICATE_RESULT_1 = 2096,
144 #endif /* __INTEL_GT_TYPES_H__ */