intel_device_info.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  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. #ifndef _INTEL_DEVICE_INFO_H_
  25. #define _INTEL_DEVICE_INFO_H_
  26. #include <uapi/drm/i915_drm.h>
  27. #include "intel_step.h"
  28. #include "gt/intel_engine_types.h"
  29. #include "gt/intel_context_types.h"
  30. #include "gt/intel_sseu.h"
  31. #include "gem/i915_gem_object_types.h"
  32. struct drm_printer;
  33. struct drm_i915_private;
  34. struct intel_gt_definition;
  35. /* Keep in gen based order, and chronological order within a gen */
  36. enum intel_platform {
  37. INTEL_PLATFORM_UNINITIALIZED = 0,
  38. /* gen2 */
  39. INTEL_I830,
  40. INTEL_I845G,
  41. INTEL_I85X,
  42. INTEL_I865G,
  43. /* gen3 */
  44. INTEL_I915G,
  45. INTEL_I915GM,
  46. INTEL_I945G,
  47. INTEL_I945GM,
  48. INTEL_G33,
  49. INTEL_PINEVIEW,
  50. /* gen4 */
  51. INTEL_I965G,
  52. INTEL_I965GM,
  53. INTEL_G45,
  54. INTEL_GM45,
  55. /* gen5 */
  56. INTEL_IRONLAKE,
  57. /* gen6 */
  58. INTEL_SANDYBRIDGE,
  59. /* gen7 */
  60. INTEL_IVYBRIDGE,
  61. INTEL_VALLEYVIEW,
  62. INTEL_HASWELL,
  63. /* gen8 */
  64. INTEL_BROADWELL,
  65. INTEL_CHERRYVIEW,
  66. /* gen9 */
  67. INTEL_SKYLAKE,
  68. INTEL_BROXTON,
  69. INTEL_KABYLAKE,
  70. INTEL_GEMINILAKE,
  71. INTEL_COFFEELAKE,
  72. INTEL_COMETLAKE,
  73. /* gen11 */
  74. INTEL_ICELAKE,
  75. INTEL_ELKHARTLAKE,
  76. INTEL_JASPERLAKE,
  77. /* gen12 */
  78. INTEL_TIGERLAKE,
  79. INTEL_ROCKETLAKE,
  80. INTEL_DG1,
  81. INTEL_ALDERLAKE_S,
  82. INTEL_ALDERLAKE_P,
  83. INTEL_DG2,
  84. INTEL_METEORLAKE,
  85. INTEL_MAX_PLATFORMS
  86. };
  87. /*
  88. * Subplatform bits share the same namespace per parent platform. In other words
  89. * it is fine for the same bit to be used on multiple parent platforms.
  90. * Devices can belong to multiple subplatforms if needed, so it's possible to set
  91. * multiple bits for same device.
  92. */
  93. #define INTEL_SUBPLATFORM_BITS (4)
  94. #define INTEL_SUBPLATFORM_MASK (BIT(INTEL_SUBPLATFORM_BITS) - 1)
  95. /* HSW/BDW/SKL/KBL/CFL */
  96. #define INTEL_SUBPLATFORM_ULT (0)
  97. #define INTEL_SUBPLATFORM_ULX (1)
  98. /* ICL */
  99. #define INTEL_SUBPLATFORM_PORTF (0)
  100. /* TGL */
  101. #define INTEL_SUBPLATFORM_UY (0)
  102. /* DG2 */
  103. #define INTEL_SUBPLATFORM_G10 0
  104. #define INTEL_SUBPLATFORM_G11 1
  105. #define INTEL_SUBPLATFORM_G12 2
  106. #define INTEL_SUBPLATFORM_D 3
  107. /* ADL */
  108. #define INTEL_SUBPLATFORM_RPL 0
  109. /* ADL-P */
  110. /*
  111. * As #define INTEL_SUBPLATFORM_RPL 0 will apply
  112. * here too, SUBPLATFORM_N will have different
  113. * bit set
  114. */
  115. #define INTEL_SUBPLATFORM_N 1
  116. #define INTEL_SUBPLATFORM_RPLU 2
  117. /* MTL */
  118. #define INTEL_SUBPLATFORM_ARL_H 0
  119. #define INTEL_SUBPLATFORM_ARL_U 1
  120. #define INTEL_SUBPLATFORM_ARL_S 2
  121. enum intel_ppgtt_type {
  122. INTEL_PPGTT_NONE = I915_GEM_PPGTT_NONE,
  123. INTEL_PPGTT_ALIASING = I915_GEM_PPGTT_ALIASING,
  124. INTEL_PPGTT_FULL = I915_GEM_PPGTT_FULL,
  125. };
  126. #define DEV_INFO_FOR_EACH_FLAG(func) \
  127. func(is_mobile); \
  128. func(require_force_probe); \
  129. func(is_dgfx); \
  130. /* Keep has_* in alphabetical order */ \
  131. func(has_64bit_reloc); \
  132. func(has_64k_pages); \
  133. func(gpu_reset_clobbers_display); \
  134. func(has_reset_engine); \
  135. func(has_3d_pipeline); \
  136. func(has_flat_ccs); \
  137. func(has_global_mocs); \
  138. func(has_gmd_id); \
  139. func(has_gt_uc); \
  140. func(has_heci_pxp); \
  141. func(has_heci_gscfi); \
  142. func(has_guc_deprivilege); \
  143. func(has_guc_tlb_invalidation); \
  144. func(has_l3_ccs_read); \
  145. func(has_l3_dpf); \
  146. func(has_llc); \
  147. func(has_logical_ring_contexts); \
  148. func(has_logical_ring_elsq); \
  149. func(has_media_ratio_mode); \
  150. func(has_mslice_steering); \
  151. func(has_oa_bpc_reporting); \
  152. func(has_oa_slice_contrib_limits); \
  153. func(has_oam); \
  154. func(has_one_eu_per_fuse_bit); \
  155. func(has_pxp); \
  156. func(has_rc6); \
  157. func(has_rc6p); \
  158. func(has_rps); \
  159. func(has_runtime_pm); \
  160. func(has_snoop); \
  161. func(has_coherent_ggtt); \
  162. func(tuning_thread_rr_after_dep); \
  163. func(unfenced_needs_alignment); \
  164. func(hws_needs_physical);
  165. struct intel_ip_version {
  166. u8 ver;
  167. u8 rel;
  168. u8 step;
  169. };
  170. struct intel_runtime_info {
  171. /*
  172. * Single "graphics" IP version that represents
  173. * render, compute and copy behavior.
  174. */
  175. struct {
  176. struct intel_ip_version ip;
  177. } graphics;
  178. struct {
  179. struct intel_ip_version ip;
  180. } media;
  181. /*
  182. * Platform mask is used for optimizing or-ed IS_PLATFORM calls into
  183. * single runtime conditionals, and also to provide groundwork for
  184. * future per platform, or per SKU build optimizations.
  185. *
  186. * Array can be extended when necessary if the corresponding
  187. * BUILD_BUG_ON is hit.
  188. */
  189. u32 platform_mask[2];
  190. u16 device_id;
  191. struct intel_step_info step;
  192. unsigned int page_sizes; /* page sizes supported by the HW */
  193. enum intel_ppgtt_type ppgtt_type;
  194. unsigned int ppgtt_size; /* log2, e.g. 31/32/48 bits */
  195. bool has_pooled_eu;
  196. };
  197. struct intel_device_info {
  198. enum intel_platform platform;
  199. unsigned int dma_mask_size; /* available DMA address bits */
  200. const struct intel_gt_definition *extra_gt_list;
  201. u8 gt; /* GT number, 0 if undefined */
  202. intel_engine_mask_t platform_engine_mask; /* Engines supported by the HW */
  203. u32 memory_regions; /* regions supported by the HW */
  204. #define DEFINE_FLAG(name) u8 name:1
  205. DEV_INFO_FOR_EACH_FLAG(DEFINE_FLAG);
  206. #undef DEFINE_FLAG
  207. /*
  208. * Initial runtime info. Do not access outside of i915_driver_create().
  209. */
  210. const struct intel_runtime_info __runtime;
  211. u32 cachelevel_to_pat[I915_MAX_CACHE_LEVEL];
  212. u32 max_pat_index;
  213. };
  214. struct intel_driver_caps {
  215. unsigned int scheduler;
  216. bool has_logical_contexts:1;
  217. };
  218. const char *intel_platform_name(enum intel_platform platform);
  219. void intel_device_info_driver_create(struct drm_i915_private *i915, u16 device_id,
  220. const struct intel_device_info *match_info);
  221. void intel_device_info_runtime_init_early(struct drm_i915_private *dev_priv);
  222. void intel_device_info_runtime_init(struct drm_i915_private *dev_priv);
  223. void intel_device_info_print(const struct intel_device_info *info,
  224. const struct intel_runtime_info *runtime,
  225. struct drm_printer *p);
  226. void intel_driver_caps_print(const struct intel_driver_caps *caps,
  227. struct drm_printer *p);
  228. #endif