Commit 43ba44a1 authored by Jani Nikula's avatar Jani Nikula

drm/i915: move graphics.ver and graphics.rel to runtime info

If it's modified runtime, it's runtime info.

mock_gem_device() is the only one that modifies them. If that could be
fixed, we wouldn't have to do this.
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarMaarten Lankhort <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/6bdf6cc0d67e3ed8042d2b92303351111147ba47.1660910433.git.jani.nikula@intel.com
parent 2c93e7b7
...@@ -856,9 +856,9 @@ static inline struct intel_gt *to_gt(struct drm_i915_private *i915) ...@@ -856,9 +856,9 @@ static inline struct intel_gt *to_gt(struct drm_i915_private *i915)
#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) (RUNTIME_INFO(i915)->graphics.ver)
#define GRAPHICS_VER_FULL(i915) IP_VER(INTEL_INFO(i915)->graphics.ver, \ #define GRAPHICS_VER_FULL(i915) IP_VER(RUNTIME_INFO(i915)->graphics.ver, \
INTEL_INFO(i915)->graphics.rel) RUNTIME_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))
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#define PLATFORM(x) .platform = (x) #define PLATFORM(x) .platform = (x)
#define GEN(x) \ #define GEN(x) \
.graphics.ver = (x), \ .__runtime.graphics.ver = (x), \
.media.ver = (x), \ .media.ver = (x), \
.display.ver = (x) .display.ver = (x)
...@@ -919,7 +919,7 @@ static const struct intel_device_info rkl_info = { ...@@ -919,7 +919,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, .__runtime.graphics.rel = 10,
PLATFORM(INTEL_DG1), PLATFORM(INTEL_DG1),
.display.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C) | BIT(PIPE_D), .display.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C) | BIT(PIPE_D),
.require_force_probe = 1, .require_force_probe = 1,
...@@ -1006,8 +1006,8 @@ static const struct intel_device_info adl_p_info = { ...@@ -1006,8 +1006,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, \ .__runtime.graphics.ver = 12, \
.graphics.rel = 50, \ .__runtime.graphics.rel = 50, \
XE_HP_PAGE_SIZES, \ XE_HP_PAGE_SIZES, \
.dma_mask_size = 46, \ .dma_mask_size = 46, \
.has_3d_pipeline = 1, \ .has_3d_pipeline = 1, \
...@@ -1053,7 +1053,7 @@ static const struct intel_device_info xehpsdv_info = { ...@@ -1053,7 +1053,7 @@ static const struct intel_device_info xehpsdv_info = {
XE_HP_FEATURES, \ XE_HP_FEATURES, \
XE_HPM_FEATURES, \ XE_HPM_FEATURES, \
DGFX_FEATURES, \ DGFX_FEATURES, \
.graphics.rel = 55, \ .__runtime.graphics.rel = 55, \
.media.rel = 55, \ .media.rel = 55, \
PLATFORM(INTEL_DG2), \ PLATFORM(INTEL_DG2), \
.has_4tile = 1, \ .has_4tile = 1, \
...@@ -1096,7 +1096,7 @@ static const struct intel_device_info pvc_info = { ...@@ -1096,7 +1096,7 @@ static const struct intel_device_info pvc_info = {
XE_HPC_FEATURES, XE_HPC_FEATURES,
XE_HPM_FEATURES, XE_HPM_FEATURES,
DGFX_FEATURES, DGFX_FEATURES,
.graphics.rel = 60, .__runtime.graphics.rel = 60,
.media.rel = 60, .media.rel = 60,
PLATFORM(INTEL_PONTEVECCHIO), PLATFORM(INTEL_PONTEVECCHIO),
.display = { 0 }, .display = { 0 },
...@@ -1122,8 +1122,8 @@ static const struct intel_device_info mtl_info = { ...@@ -1122,8 +1122,8 @@ static const struct intel_device_info mtl_info = {
* Real graphics IP version will be obtained from hardware GMD_ID * Real graphics IP version will be obtained from hardware GMD_ID
* register. Value provided here is just for sanity checking. * register. Value provided here is just for sanity checking.
*/ */
.graphics.ver = 12, .__runtime.graphics.ver = 12,
.graphics.rel = 70, .__runtime.graphics.rel = 70,
.media.ver = 13, .media.ver = 13,
PLATFORM(INTEL_METEORLAKE), PLATFORM(INTEL_METEORLAKE),
.display.has_modular_fia = 1, .display.has_modular_fia = 1,
...@@ -1280,7 +1280,7 @@ bool i915_pci_resource_valid(struct pci_dev *pdev, int bar) ...@@ -1280,7 +1280,7 @@ bool i915_pci_resource_valid(struct pci_dev *pdev, int bar)
static bool intel_mmio_bar_valid(struct pci_dev *pdev, struct intel_device_info *intel_info) static bool intel_mmio_bar_valid(struct pci_dev *pdev, struct intel_device_info *intel_info)
{ {
int gttmmaddr_bar = intel_info->graphics.ver == 2 ? GEN2_GTTMMADR_BAR : GTTMMADR_BAR; int gttmmaddr_bar = intel_info->__runtime.graphics.ver == 2 ? GEN2_GTTMMADR_BAR : GTTMMADR_BAR;
return i915_pci_resource_valid(pdev, gttmmaddr_bar); return i915_pci_resource_valid(pdev, gttmmaddr_bar);
} }
......
...@@ -92,11 +92,11 @@ void intel_device_info_print(const struct intel_device_info *info, ...@@ -92,11 +92,11 @@ void intel_device_info_print(const struct intel_device_info *info,
const struct intel_runtime_info *runtime, const struct intel_runtime_info *runtime,
struct drm_printer *p) struct drm_printer *p)
{ {
if (info->graphics.rel) if (runtime->graphics.rel)
drm_printf(p, "graphics version: %u.%02u\n", info->graphics.ver, drm_printf(p, "graphics version: %u.%02u\n", runtime->graphics.ver,
info->graphics.rel); runtime->graphics.rel);
else else
drm_printf(p, "graphics version: %u\n", info->graphics.ver); drm_printf(p, "graphics version: %u\n", runtime->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);
......
...@@ -203,6 +203,8 @@ struct ip_version { ...@@ -203,6 +203,8 @@ struct ip_version {
}; };
struct intel_runtime_info { struct intel_runtime_info {
struct ip_version graphics;
/* /*
* Platform mask is used for optimizing or-ed IS_PLATFORM calls into * Platform mask is used for optimizing or-ed IS_PLATFORM calls into
* single runtime conditionals, and also to provide groundwork for * single runtime conditionals, and also to provide groundwork for
...@@ -224,7 +226,6 @@ struct intel_runtime_info { ...@@ -224,7 +226,6 @@ struct intel_runtime_info {
}; };
struct intel_device_info { struct intel_device_info {
struct ip_version graphics;
struct ip_version media; struct ip_version media;
intel_engine_mask_t platform_engine_mask; /* Engines supported by the HW */ intel_engine_mask_t platform_engine_mask; /* Engines supported by the HW */
......
...@@ -172,7 +172,7 @@ struct drm_i915_private *mock_gem_device(void) ...@@ -172,7 +172,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; RUNTIME_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