drm/i915: Add struct to hold IP version

Adding a structure to standardize access to IP versioning as future
platforms will have this information populated at runtime.

The constant platform display version is not using this new struct but
the runtime variant will definitely use it.

Cc: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
Cc: Matt Atwood <matthew.s.atwood@intel.com>
Signed-off-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
Reviewed-by: default avatarCaz Yokoyama <caz.yokoyama@intel.com>
Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211020002353.193893-1-jose.souza@intel.com
parent 57d9898b
...@@ -807,7 +807,7 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -807,7 +807,7 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
return PTR_ERR(i915); return PTR_ERR(i915);
/* Disable nuclear pageflip by default on pre-ILK */ /* Disable nuclear pageflip by default on pre-ILK */
if (!i915->params.nuclear_pageflip && match_info->graphics_ver < 5) if (!i915->params.nuclear_pageflip && match_info->graphics.ver < 5)
i915->drm.driver_features &= ~DRIVER_ATOMIC; i915->drm.driver_features &= ~DRIVER_ATOMIC;
/* /*
......
...@@ -1325,15 +1325,15 @@ static inline struct drm_i915_private *pdev_to_i915(struct pci_dev *pdev) ...@@ -1325,15 +1325,15 @@ static inline struct drm_i915_private *pdev_to_i915(struct pci_dev *pdev)
#define IP_VER(ver, rel) ((ver) << 8 | (rel)) #define IP_VER(ver, rel) ((ver) << 8 | (rel))
#define GRAPHICS_VER(i915) (INTEL_INFO(i915)->graphics_ver) #define GRAPHICS_VER(i915) (INTEL_INFO(i915)->graphics.ver)
#define GRAPHICS_VER_FULL(i915) IP_VER(INTEL_INFO(i915)->graphics_ver, \ #define GRAPHICS_VER_FULL(i915) IP_VER(INTEL_INFO(i915)->graphics.ver, \
INTEL_INFO(i915)->graphics_rel) INTEL_INFO(i915)->graphics.rel)
#define IS_GRAPHICS_VER(i915, from, until) \ #define IS_GRAPHICS_VER(i915, from, until) \
(GRAPHICS_VER(i915) >= (from) && GRAPHICS_VER(i915) <= (until)) (GRAPHICS_VER(i915) >= (from) && GRAPHICS_VER(i915) <= (until))
#define MEDIA_VER(i915) (INTEL_INFO(i915)->media_ver) #define MEDIA_VER(i915) (INTEL_INFO(i915)->media.ver)
#define MEDIA_VER_FULL(i915) IP_VER(INTEL_INFO(i915)->media_ver, \ #define MEDIA_VER_FULL(i915) IP_VER(INTEL_INFO(i915)->media.arch, \
INTEL_INFO(i915)->media_rel) INTEL_INFO(i915)->media.rel)
#define IS_MEDIA_VER(i915, from, until) \ #define IS_MEDIA_VER(i915, from, until) \
(MEDIA_VER(i915) >= (from) && MEDIA_VER(i915) <= (until)) (MEDIA_VER(i915) >= (from) && MEDIA_VER(i915) <= (until))
......
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
#define PLATFORM(x) .platform = (x) #define PLATFORM(x) .platform = (x)
#define GEN(x) \ #define GEN(x) \
.graphics_ver = (x), \ .graphics.ver = (x), \
.media_ver = (x), \ .media.ver = (x), \
.display.ver = (x) .display.ver = (x)
#define I845_PIPE_OFFSETS \ #define I845_PIPE_OFFSETS \
...@@ -899,7 +899,7 @@ static const struct intel_device_info rkl_info = { ...@@ -899,7 +899,7 @@ static const struct intel_device_info rkl_info = {
static const struct intel_device_info dg1_info = { static const struct intel_device_info dg1_info = {
GEN12_FEATURES, GEN12_FEATURES,
DGFX_FEATURES, DGFX_FEATURES,
.graphics_rel = 10, .graphics.rel = 10,
PLATFORM(INTEL_DG1), PLATFORM(INTEL_DG1),
.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C) | BIT(PIPE_D), .pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C) | BIT(PIPE_D),
.require_force_probe = 1, .require_force_probe = 1,
...@@ -986,8 +986,8 @@ static const struct intel_device_info adl_p_info = { ...@@ -986,8 +986,8 @@ static const struct intel_device_info adl_p_info = {
I915_GTT_PAGE_SIZE_2M I915_GTT_PAGE_SIZE_2M
#define XE_HP_FEATURES \ #define XE_HP_FEATURES \
.graphics_ver = 12, \ .graphics.ver = 12, \
.graphics_rel = 50, \ .graphics.rel = 50, \
XE_HP_PAGE_SIZES, \ XE_HP_PAGE_SIZES, \
.dma_mask_size = 46, \ .dma_mask_size = 46, \
.has_64bit_reloc = 1, \ .has_64bit_reloc = 1, \
...@@ -1005,8 +1005,8 @@ static const struct intel_device_info adl_p_info = { ...@@ -1005,8 +1005,8 @@ static const struct intel_device_info adl_p_info = {
.ppgtt_type = INTEL_PPGTT_FULL .ppgtt_type = INTEL_PPGTT_FULL
#define XE_HPM_FEATURES \ #define XE_HPM_FEATURES \
.media_ver = 12, \ .media.ver = 12, \
.media_rel = 50 .media.rel = 50
__maybe_unused __maybe_unused
static const struct intel_device_info xehpsdv_info = { static const struct intel_device_info xehpsdv_info = {
...@@ -1030,8 +1030,8 @@ static const struct intel_device_info dg2_info = { ...@@ -1030,8 +1030,8 @@ static const struct intel_device_info dg2_info = {
XE_HPM_FEATURES, XE_HPM_FEATURES,
XE_LPD_FEATURES, XE_LPD_FEATURES,
DGFX_FEATURES, DGFX_FEATURES,
.graphics_rel = 55, .graphics.rel = 55,
.media_rel = 55, .media.rel = 55,
PLATFORM(INTEL_DG2), PLATFORM(INTEL_DG2),
.platform_engine_mask = .platform_engine_mask =
BIT(RCS0) | BIT(BCS0) | BIT(RCS0) | BIT(BCS0) |
......
...@@ -97,17 +97,22 @@ static const char *iommu_name(void) ...@@ -97,17 +97,22 @@ static const char *iommu_name(void)
void intel_device_info_print_static(const struct intel_device_info *info, void intel_device_info_print_static(const struct intel_device_info *info,
struct drm_printer *p) struct drm_printer *p)
{ {
if (info->graphics_rel) if (info->graphics.rel)
drm_printf(p, "graphics version: %u.%02u\n", info->graphics_ver, info->graphics_rel); drm_printf(p, "graphics version: %u.%02u\n", info->graphics.ver,
info->graphics.rel);
else else
drm_printf(p, "graphics version: %u\n", info->graphics_ver); drm_printf(p, "graphics version: %u\n", info->graphics.ver);
if (info->media_rel) if (info->media.rel)
drm_printf(p, "media version: %u.%02u\n", info->media_ver, info->media_rel); drm_printf(p, "media version: %u.%02u\n", info->media.ver, info->media.rel);
else else
drm_printf(p, "media version: %u\n", info->media_ver); drm_printf(p, "media version: %u\n", info->media.ver);
if (info->display.rel)
drm_printf(p, "display version: %u.%02u\n", info->display.ver, info->display.rel);
else
drm_printf(p, "display version: %u\n", info->display.ver);
drm_printf(p, "display version: %u\n", info->display.ver);
drm_printf(p, "gt: %d\n", info->gt); drm_printf(p, "gt: %d\n", info->gt);
drm_printf(p, "iommu: %s\n", iommu_name()); drm_printf(p, "iommu: %s\n", iommu_name());
drm_printf(p, "memory-regions: %x\n", info->memory_regions); drm_printf(p, "memory-regions: %x\n", info->memory_regions);
......
...@@ -166,11 +166,14 @@ enum intel_ppgtt_type { ...@@ -166,11 +166,14 @@ enum intel_ppgtt_type {
func(overlay_needs_physical); \ func(overlay_needs_physical); \
func(supports_tv); func(supports_tv);
struct ip_version {
u8 ver;
u8 rel;
};
struct intel_device_info { struct intel_device_info {
u8 graphics_ver; struct ip_version graphics;
u8 graphics_rel; struct ip_version media;
u8 media_ver;
u8 media_rel;
intel_engine_mask_t platform_engine_mask; /* Engines supported by the HW */ intel_engine_mask_t platform_engine_mask; /* Engines supported by the HW */
...@@ -200,6 +203,7 @@ struct intel_device_info { ...@@ -200,6 +203,7 @@ struct intel_device_info {
struct { struct {
u8 ver; u8 ver;
u8 rel;
#define DEFINE_FLAG(name) u8 name:1 #define DEFINE_FLAG(name) u8 name:1
DEV_INFO_DISPLAY_FOR_EACH_FLAG(DEFINE_FLAG); DEV_INFO_DISPLAY_FOR_EACH_FLAG(DEFINE_FLAG);
......
...@@ -165,7 +165,7 @@ struct drm_i915_private *mock_gem_device(void) ...@@ -165,7 +165,7 @@ struct drm_i915_private *mock_gem_device(void)
/* Using the global GTT may ask questions about KMS users, so prepare */ /* Using the global GTT may ask questions about KMS users, so prepare */
drm_mode_config_init(&i915->drm); drm_mode_config_init(&i915->drm);
mkwrite_device_info(i915)->graphics_ver = -1; mkwrite_device_info(i915)->graphics.ver = -1;
mkwrite_device_info(i915)->page_sizes = mkwrite_device_info(i915)->page_sizes =
I915_GTT_PAGE_SIZE_4K | I915_GTT_PAGE_SIZE_4K |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment