intel_device_info.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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 "intel_display.h"
  27. struct drm_printer;
  28. struct drm_i915_private;
  29. /* Keep in gen based order, and chronological order within a gen */
  30. enum intel_platform {
  31. INTEL_PLATFORM_UNINITIALIZED = 0,
  32. /* gen2 */
  33. INTEL_I830,
  34. INTEL_I845G,
  35. INTEL_I85X,
  36. INTEL_I865G,
  37. /* gen3 */
  38. INTEL_I915G,
  39. INTEL_I915GM,
  40. INTEL_I945G,
  41. INTEL_I945GM,
  42. INTEL_G33,
  43. INTEL_PINEVIEW,
  44. /* gen4 */
  45. INTEL_I965G,
  46. INTEL_I965GM,
  47. INTEL_G45,
  48. INTEL_GM45,
  49. /* gen5 */
  50. INTEL_IRONLAKE,
  51. /* gen6 */
  52. INTEL_SANDYBRIDGE,
  53. /* gen7 */
  54. INTEL_IVYBRIDGE,
  55. INTEL_VALLEYVIEW,
  56. INTEL_HASWELL,
  57. /* gen8 */
  58. INTEL_BROADWELL,
  59. INTEL_CHERRYVIEW,
  60. /* gen9 */
  61. INTEL_SKYLAKE,
  62. INTEL_BROXTON,
  63. INTEL_KABYLAKE,
  64. INTEL_GEMINILAKE,
  65. INTEL_COFFEELAKE,
  66. /* gen10 */
  67. INTEL_CANNONLAKE,
  68. INTEL_MAX_PLATFORMS
  69. };
  70. #define DEV_INFO_FOR_EACH_FLAG(func) \
  71. func(is_mobile); \
  72. func(is_lp); \
  73. func(is_alpha_support); \
  74. /* Keep has_* in alphabetical order */ \
  75. func(has_64bit_reloc); \
  76. func(has_aliasing_ppgtt); \
  77. func(has_csr); \
  78. func(has_ddi); \
  79. func(has_dp_mst); \
  80. func(has_reset_engine); \
  81. func(has_fbc); \
  82. func(has_fpga_dbg); \
  83. func(has_full_ppgtt); \
  84. func(has_full_48bit_ppgtt); \
  85. func(has_gmch_display); \
  86. func(has_guc); \
  87. func(has_guc_ct); \
  88. func(has_hotplug); \
  89. func(has_l3_dpf); \
  90. func(has_llc); \
  91. func(has_logical_ring_contexts); \
  92. func(has_logical_ring_preemption); \
  93. func(has_overlay); \
  94. func(has_pooled_eu); \
  95. func(has_psr); \
  96. func(has_rc6); \
  97. func(has_rc6p); \
  98. func(has_resource_streamer); \
  99. func(has_runtime_pm); \
  100. func(has_snoop); \
  101. func(unfenced_needs_alignment); \
  102. func(cursor_needs_physical); \
  103. func(hws_needs_physical); \
  104. func(overlay_needs_physical); \
  105. func(supports_tv); \
  106. func(has_ipc);
  107. struct sseu_dev_info {
  108. u8 slice_mask;
  109. u8 subslice_mask;
  110. u8 eu_total;
  111. u8 eu_per_subslice;
  112. u8 min_eu_in_pool;
  113. /* For each slice, which subslice(s) has(have) 7 EUs (bitfield)? */
  114. u8 subslice_7eu[3];
  115. u8 has_slice_pg:1;
  116. u8 has_subslice_pg:1;
  117. u8 has_eu_pg:1;
  118. };
  119. struct intel_device_info {
  120. u16 device_id;
  121. u16 gen_mask;
  122. u8 gen;
  123. u8 gt; /* GT number, 0 if undefined */
  124. u8 num_rings;
  125. u8 ring_mask; /* Rings supported by the HW */
  126. enum intel_platform platform;
  127. u32 platform_mask;
  128. u32 display_mmio_offset;
  129. u8 num_pipes;
  130. u8 num_sprites[I915_MAX_PIPES];
  131. u8 num_scalers[I915_MAX_PIPES];
  132. unsigned int page_sizes; /* page sizes supported by the HW */
  133. #define DEFINE_FLAG(name) u8 name:1
  134. DEV_INFO_FOR_EACH_FLAG(DEFINE_FLAG);
  135. #undef DEFINE_FLAG
  136. u16 ddb_size; /* in blocks */
  137. /* Register offsets for the various display pipes and transcoders */
  138. int pipe_offsets[I915_MAX_TRANSCODERS];
  139. int trans_offsets[I915_MAX_TRANSCODERS];
  140. int palette_offsets[I915_MAX_PIPES];
  141. int cursor_offsets[I915_MAX_PIPES];
  142. /* Slice/subslice/EU info */
  143. struct sseu_dev_info sseu;
  144. u32 cs_timestamp_frequency_khz;
  145. struct color_luts {
  146. u16 degamma_lut_size;
  147. u16 gamma_lut_size;
  148. } color;
  149. };
  150. static inline unsigned int sseu_subslice_total(const struct sseu_dev_info *sseu)
  151. {
  152. return hweight8(sseu->slice_mask) * hweight8(sseu->subslice_mask);
  153. }
  154. const char *intel_platform_name(enum intel_platform platform);
  155. void intel_device_info_runtime_init(struct intel_device_info *info);
  156. void intel_device_info_dump(const struct intel_device_info *info,
  157. struct drm_printer *p);
  158. void intel_device_info_dump_flags(const struct intel_device_info *info,
  159. struct drm_printer *p);
  160. void intel_device_info_dump_runtime(const struct intel_device_info *info,
  161. struct drm_printer *p);
  162. #endif