intel_device_info.h 6.1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
/*
 * Copyright © 2014-2017 Intel Corporation
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 *
 */

#ifndef _INTEL_DEVICE_INFO_H_
#define _INTEL_DEVICE_INFO_H_

28 29
#include <uapi/drm/i915_drm.h>

30 31
#include "display/intel_display.h"

32 33 34 35
#include "gt/intel_engine_types.h"
#include "gt/intel_context_types.h"
#include "gt/intel_sseu.h"

36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
struct drm_printer;
struct drm_i915_private;

/* Keep in gen based order, and chronological order within a gen */
enum intel_platform {
	INTEL_PLATFORM_UNINITIALIZED = 0,
	/* gen2 */
	INTEL_I830,
	INTEL_I845G,
	INTEL_I85X,
	INTEL_I865G,
	/* gen3 */
	INTEL_I915G,
	INTEL_I915GM,
	INTEL_I945G,
	INTEL_I945GM,
	INTEL_G33,
	INTEL_PINEVIEW,
	/* gen4 */
	INTEL_I965G,
	INTEL_I965GM,
	INTEL_G45,
	INTEL_GM45,
	/* gen5 */
	INTEL_IRONLAKE,
	/* gen6 */
	INTEL_SANDYBRIDGE,
	/* gen7 */
	INTEL_IVYBRIDGE,
	INTEL_VALLEYVIEW,
	INTEL_HASWELL,
	/* gen8 */
	INTEL_BROADWELL,
	INTEL_CHERRYVIEW,
	/* gen9 */
	INTEL_SKYLAKE,
	INTEL_BROXTON,
	INTEL_KABYLAKE,
	INTEL_GEMINILAKE,
	INTEL_COFFEELAKE,
76
	INTEL_COMETLAKE,
77 78
	/* gen10 */
	INTEL_CANNONLAKE,
79 80
	/* gen11 */
	INTEL_ICELAKE,
81
	INTEL_ELKHARTLAKE,
82
	INTEL_JASPERLAKE,
83 84
	/* gen12 */
	INTEL_TIGERLAKE,
85
	INTEL_ROCKETLAKE,
86
	INTEL_DG1,
87
	INTEL_ALDERLAKE_S,
88 89 90
	INTEL_MAX_PLATFORMS
};

91 92 93 94 95 96 97 98 99 100 101 102 103 104
/*
 * Subplatform bits share the same namespace per parent platform. In other words
 * it is fine for the same bit to be used on multiple parent platforms.
 */

#define INTEL_SUBPLATFORM_BITS (3)

/* HSW/BDW/SKL/KBL/CFL */
#define INTEL_SUBPLATFORM_ULT	(0)
#define INTEL_SUBPLATFORM_ULX	(1)

/* CNL/ICL */
#define INTEL_SUBPLATFORM_PORTF	(0)

105
enum intel_ppgtt_type {
106 107 108 109 110
	INTEL_PPGTT_NONE = I915_GEM_PPGTT_NONE,
	INTEL_PPGTT_ALIASING = I915_GEM_PPGTT_ALIASING,
	INTEL_PPGTT_FULL = I915_GEM_PPGTT_FULL,
};

111 112 113
#define DEV_INFO_FOR_EACH_FLAG(func) \
	func(is_mobile); \
	func(is_lp); \
114
	func(require_force_probe); \
115
	func(is_dgfx); \
116 117
	/* Keep has_* in alphabetical order */ \
	func(has_64bit_reloc); \
118
	func(gpu_reset_clobbers_display); \
119 120
	func(has_reset_engine); \
	func(has_fpga_dbg); \
121
	func(has_global_mocs); \
122
	func(has_gt_uc); \
123 124 125
	func(has_l3_dpf); \
	func(has_llc); \
	func(has_logical_ring_contexts); \
126
	func(has_logical_ring_elsq); \
127
	func(has_master_unit_irq); \
128 129 130
	func(has_pooled_eu); \
	func(has_rc6); \
	func(has_rc6p); \
131
	func(has_rps); \
132 133
	func(has_runtime_pm); \
	func(has_snoop); \
134
	func(has_coherent_ggtt); \
135
	func(unfenced_needs_alignment); \
136 137 138 139
	func(hws_needs_physical);

#define DEV_INFO_DISPLAY_FOR_EACH_FLAG(func) \
	/* Keep in alphabetical order */ \
140
	func(cursor_needs_physical); \
141 142 143
	func(has_csr); \
	func(has_ddi); \
	func(has_dp_mst); \
144
	func(has_dsb); \
145
	func(has_dsc); \
146
	func(has_fbc); \
R
Rodrigo Vivi 已提交
147
	func(has_gmch); \
148
	func(has_hdcp); \
149
	func(has_hotplug); \
M
Matt Roper 已提交
150
	func(has_hti); \
151
	func(has_ipc); \
A
Anusha Srivatsa 已提交
152
	func(has_modular_fia); \
153 154
	func(has_overlay); \
	func(has_psr); \
155
	func(has_psr_hw_tracking); \
156
	func(overlay_needs_physical); \
157
	func(supports_tv);
158 159 160 161 162 163

struct intel_device_info {
	u16 gen_mask;

	u8 gen;
	u8 gt; /* GT number, 0 if undefined */
164
	intel_engine_mask_t platform_engine_mask; /* Engines supported by the HW */
165 166 167

	enum intel_platform platform;

168 169
	unsigned int dma_mask_size; /* available DMA address bits */

170 171 172
	enum intel_ppgtt_type ppgtt_type;
	unsigned int ppgtt_size; /* log2, e.g. 31/32/48 bits */

173
	unsigned int page_sizes; /* page sizes supported by the HW */
174 175

	u32 memory_regions; /* regions supported by the HW */
176

177 178
	u32 display_mmio_offset;

179
	u8 pipe_mask;
180
	u8 cpu_transcoder_mask;
181

182 183
	u8 abox_mask;

184 185 186
#define DEFINE_FLAG(name) u8 name:1
	DEV_INFO_FOR_EACH_FLAG(DEFINE_FLAG);
#undef DEFINE_FLAG
187 188 189 190 191 192 193

	struct {
#define DEFINE_FLAG(name) u8 name:1
		DEV_INFO_DISPLAY_FOR_EACH_FLAG(DEFINE_FLAG);
#undef DEFINE_FLAG
	} display;

194
	u16 ddb_size; /* in blocks */
195
	u8 num_supported_dbuf_slices; /* number of DBuf slices */
196 197 198 199 200 201

	/* Register offsets for the various display pipes and transcoders */
	int pipe_offsets[I915_MAX_TRANSCODERS];
	int trans_offsets[I915_MAX_TRANSCODERS];
	int cursor_offsets[I915_MAX_PIPES];

202
	struct color_luts {
203 204
		u32 degamma_lut_size;
		u32 gamma_lut_size;
205 206
		u32 degamma_lut_tests;
		u32 gamma_lut_tests;
207 208 209 210
	} color;
};

struct intel_runtime_info {
211 212 213 214 215 216 217 218 219 220
	/*
	 * Platform mask is used for optimizing or-ed IS_PLATFORM calls into
	 * into single runtime conditionals, and also to provide groundwork
	 * for future per platform, or per SKU build optimizations.
	 *
	 * Array can be extended when necessary if the corresponding
	 * BUILD_BUG_ON is hit.
	 */
	u32 platform_mask[2];

221 222 223 224 225
	u16 device_id;

	u8 num_sprites[I915_MAX_PIPES];
	u8 num_scalers[I915_MAX_PIPES];

226
	u32 rawclk_freq;
227 228
};

229 230
struct intel_driver_caps {
	unsigned int scheduler;
231
	bool has_logical_contexts:1;
232 233
};

234 235
const char *intel_platform_name(enum intel_platform platform);

236
void intel_device_info_subplatform_init(struct drm_i915_private *dev_priv);
237
void intel_device_info_runtime_init(struct drm_i915_private *dev_priv);
238 239

void intel_device_info_print_static(const struct intel_device_info *info,
240
				    struct drm_printer *p);
241
void intel_device_info_print_runtime(const struct intel_runtime_info *info,
242
				     struct drm_printer *p);
243

244 245 246
void intel_driver_caps_print(const struct intel_driver_caps *caps,
			     struct drm_printer *p);

247
#endif