drm/i915/tgl: Define MOCS entries for Tigerlake
[linux-block.git] / drivers / gpu / drm / i915 / intel_device_info.h
CommitLineData
b978520d
MW
1/*
2 * Copyright © 2014-2017 Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
22 *
23 */
24
25#ifndef _INTEL_DEVICE_INFO_H_
26#define _INTEL_DEVICE_INFO_H_
27
4bdafb9d
CW
28#include <uapi/drm/i915_drm.h>
29
df0566a6
JN
30#include "display/intel_display.h"
31
112ed2d3
CW
32#include "gt/intel_engine_types.h"
33#include "gt/intel_context_types.h"
34#include "gt/intel_sseu.h"
35
b978520d
MW
36struct drm_printer;
37struct drm_i915_private;
38
39/* Keep in gen based order, and chronological order within a gen */
40enum intel_platform {
41 INTEL_PLATFORM_UNINITIALIZED = 0,
42 /* gen2 */
43 INTEL_I830,
44 INTEL_I845G,
45 INTEL_I85X,
46 INTEL_I865G,
47 /* gen3 */
48 INTEL_I915G,
49 INTEL_I915GM,
50 INTEL_I945G,
51 INTEL_I945GM,
52 INTEL_G33,
53 INTEL_PINEVIEW,
54 /* gen4 */
55 INTEL_I965G,
56 INTEL_I965GM,
57 INTEL_G45,
58 INTEL_GM45,
59 /* gen5 */
60 INTEL_IRONLAKE,
61 /* gen6 */
62 INTEL_SANDYBRIDGE,
63 /* gen7 */
64 INTEL_IVYBRIDGE,
65 INTEL_VALLEYVIEW,
66 INTEL_HASWELL,
67 /* gen8 */
68 INTEL_BROADWELL,
69 INTEL_CHERRYVIEW,
70 /* gen9 */
71 INTEL_SKYLAKE,
72 INTEL_BROXTON,
73 INTEL_KABYLAKE,
74 INTEL_GEMINILAKE,
75 INTEL_COFFEELAKE,
76 /* gen10 */
77 INTEL_CANNONLAKE,
41231001
RV
78 /* gen11 */
79 INTEL_ICELAKE,
897f2961 80 INTEL_ELKHARTLAKE,
abd3a0fe
DCS
81 /* gen12 */
82 INTEL_TIGERLAKE,
b978520d
MW
83 INTEL_MAX_PLATFORMS
84};
85
805446c8
TU
86/*
87 * Subplatform bits share the same namespace per parent platform. In other words
88 * it is fine for the same bit to be used on multiple parent platforms.
89 */
90
91#define INTEL_SUBPLATFORM_BITS (3)
92
93/* HSW/BDW/SKL/KBL/CFL */
94#define INTEL_SUBPLATFORM_ULT (0)
95#define INTEL_SUBPLATFORM_ULX (1)
805446c8
TU
96
97/* CNL/ICL */
98#define INTEL_SUBPLATFORM_PORTF (0)
99
cbecbcca 100enum intel_ppgtt_type {
4bdafb9d
CW
101 INTEL_PPGTT_NONE = I915_GEM_PPGTT_NONE,
102 INTEL_PPGTT_ALIASING = I915_GEM_PPGTT_ALIASING,
103 INTEL_PPGTT_FULL = I915_GEM_PPGTT_FULL,
4bdafb9d
CW
104};
105
b978520d
MW
106#define DEV_INFO_FOR_EACH_FLAG(func) \
107 func(is_mobile); \
108 func(is_lp); \
7ef5ef5c 109 func(require_force_probe); \
b978520d
MW
110 /* Keep has_* in alphabetical order */ \
111 func(has_64bit_reloc); \
55277e1f 112 func(gpu_reset_clobbers_display); \
b978520d 113 func(has_reset_engine); \
b978520d 114 func(has_fpga_dbg); \
702668e6 115 func(has_gt_uc); \
b978520d
MW
116 func(has_l3_dpf); \
117 func(has_llc); \
118 func(has_logical_ring_contexts); \
05f0addd 119 func(has_logical_ring_elsq); \
b978520d 120 func(has_logical_ring_preemption); \
b978520d 121 func(has_pooled_eu); \
b978520d
MW
122 func(has_rc6); \
123 func(has_rc6p); \
91cbdb83 124 func(has_rps); \
b978520d
MW
125 func(has_runtime_pm); \
126 func(has_snoop); \
900ccf30 127 func(has_coherent_ggtt); \
b978520d 128 func(unfenced_needs_alignment); \
d53db442
JRS
129 func(hws_needs_physical);
130
131#define DEV_INFO_DISPLAY_FOR_EACH_FLAG(func) \
132 /* Keep in alphabetical order */ \
b978520d 133 func(cursor_needs_physical); \
d53db442
JRS
134 func(has_csr); \
135 func(has_ddi); \
136 func(has_dp_mst); \
137 func(has_fbc); \
b2ae318a 138 func(has_gmch); \
d53db442
JRS
139 func(has_hotplug); \
140 func(has_ipc); \
0caf6257 141 func(has_modular_fia); \
d53db442
JRS
142 func(has_overlay); \
143 func(has_psr); \
b978520d 144 func(overlay_needs_physical); \
d53db442 145 func(supports_tv);
b978520d 146
b978520d 147struct intel_device_info {
b978520d
MW
148 u16 gen_mask;
149
150 u8 gen;
151 u8 gt; /* GT number, 0 if undefined */
8a68d464 152 intel_engine_mask_t engine_mask; /* Engines supported by the HW */
b978520d
MW
153
154 enum intel_platform platform;
b978520d 155
cbecbcca
CW
156 enum intel_ppgtt_type ppgtt_type;
157 unsigned int ppgtt_size; /* log2, e.g. 31/32/48 bits */
158
4552f50a
TU
159 unsigned int page_sizes; /* page sizes supported by the HW */
160
b978520d
MW
161 u32 display_mmio_offset;
162
163 u8 num_pipes;
b978520d 164
b978520d
MW
165#define DEFINE_FLAG(name) u8 name:1
166 DEV_INFO_FOR_EACH_FLAG(DEFINE_FLAG);
167#undef DEFINE_FLAG
d53db442
JRS
168
169 struct {
170#define DEFINE_FLAG(name) u8 name:1
171 DEV_INFO_DISPLAY_FOR_EACH_FLAG(DEFINE_FLAG);
172#undef DEFINE_FLAG
173 } display;
174
b978520d
MW
175 u16 ddb_size; /* in blocks */
176
177 /* Register offsets for the various display pipes and transcoders */
178 int pipe_offsets[I915_MAX_TRANSCODERS];
179 int trans_offsets[I915_MAX_TRANSCODERS];
b978520d
MW
180 int cursor_offsets[I915_MAX_PIPES];
181
0258404f 182 struct color_luts {
89a72304
SS
183 u32 degamma_lut_size;
184 u32 gamma_lut_size;
e4c0d531
MR
185 u32 degamma_lut_tests;
186 u32 gamma_lut_tests;
0258404f
JN
187 } color;
188};
189
190struct intel_runtime_info {
805446c8
TU
191 /*
192 * Platform mask is used for optimizing or-ed IS_PLATFORM calls into
193 * into single runtime conditionals, and also to provide groundwork
194 * for future per platform, or per SKU build optimizations.
195 *
196 * Array can be extended when necessary if the corresponding
197 * BUILD_BUG_ON is hit.
198 */
199 u32 platform_mask[2];
200
0258404f
JN
201 u16 device_id;
202
203 u8 num_sprites[I915_MAX_PIPES];
204 u8 num_scalers[I915_MAX_PIPES];
205
8a68d464 206 u8 num_engines;
0258404f 207
b978520d
MW
208 /* Slice/subslice/EU info */
209 struct sseu_dev_info sseu;
210
211 u32 cs_timestamp_frequency_khz;
212
57b19d55
OM
213 /* Media engine access to SFC per instance */
214 u8 vdbox_sfc_access;
b978520d
MW
215};
216
3fed1808
CW
217struct intel_driver_caps {
218 unsigned int scheduler;
481827b4 219 bool has_logical_contexts:1;
3fed1808
CW
220};
221
b978520d
MW
222const char *intel_platform_name(enum intel_platform platform);
223
805446c8 224void intel_device_info_subplatform_init(struct drm_i915_private *dev_priv);
1400cc7e 225void intel_device_info_runtime_init(struct drm_i915_private *dev_priv);
b978520d
MW
226void intel_device_info_dump_flags(const struct intel_device_info *info,
227 struct drm_printer *p);
0258404f 228void intel_device_info_dump_runtime(const struct intel_runtime_info *info,
5fbbe8d4 229 struct drm_printer *p);
79e9cd5f
LL
230void intel_device_info_dump_topology(const struct sseu_dev_info *sseu,
231 struct drm_printer *p);
b978520d 232
26376a7e
OM
233void intel_device_info_init_mmio(struct drm_i915_private *dev_priv);
234
3fed1808
CW
235void intel_driver_caps_print(const struct intel_driver_caps *caps,
236 struct drm_printer *p);
237
b978520d 238#endif