diff mbox series

[v4,01/11] drm/i915: Move display and media IP version to runtime info

Message ID 20220902060342.151824-2-radhakrishna.sripada@intel.com (mailing list archive)
State New, archived
Headers show
Series Initial Meteorlake Support | expand

Commit Message

Sripada, Radhakrishna Sept. 2, 2022, 6:03 a.m. UTC
Future platforms can read the IP version from a register and the
IP version numbers need not be hard coded in device info. Move the
ip version for media and display to runtime info.

On platforms where hard coding of IP version is required, update
the IP version in __runtime under device_info.

v2:
 - Avoid name collision for ip versions(Jani)

Suggested-by: Jani Nikula <jani.nikula@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h          | 14 ++++-----
 drivers/gpu/drm/i915/i915_pci.c          | 38 ++++++++++++------------
 drivers/gpu/drm/i915/intel_device_info.c | 28 ++++++++++-------
 drivers/gpu/drm/i915/intel_device_info.h | 15 ++++++----
 4 files changed, 53 insertions(+), 42 deletions(-)

Comments

kernel test robot Sept. 2, 2022, 4:49 p.m. UTC | #1
Hi Radhakrishna,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on drm-tip/drm-tip]
[also build test ERROR on next-20220901]
[cannot apply to drm-intel/for-linux-next drm/drm-next drm-misc/drm-misc-next linus/master v6.0-rc3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Radhakrishna-Sripada/Initial-Meteorlake-Support/20220902-140730
base:   git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20220903/202209030003.YLxzpG2i-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-5) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/159b13997e25c824f0404a44fd47e559eb56b97d
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Radhakrishna-Sripada/Initial-Meteorlake-Support/20220902-140730
        git checkout 159b13997e25c824f0404a44fd47e559eb56b97d
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from drivers/gpu/drm/i915/i915_gem.c:1267:
   drivers/gpu/drm/i915/selftests/mock_gem_device.c: In function 'mock_gem_device':
>> drivers/gpu/drm/i915/selftests/mock_gem_device.c:175:37: error: 'struct <anonymous>' has no member named 'ver'
     175 |         RUNTIME_INFO(i915)->graphics.ver = -1;
         |                                     ^


vim +175 drivers/gpu/drm/i915/selftests/mock_gem_device.c

bec68cc9ea42d8 Tvrtko Ursulin         2022-03-19  119  
66d9cb5d805af7 Chris Wilson           2017-02-13  120  struct drm_i915_private *mock_gem_device(void)
66d9cb5d805af7 Chris Wilson           2017-02-13  121  {
01b9d4e21148c8 Joerg Roedel           2020-06-25  122  #if IS_ENABLED(CONFIG_IOMMU_API) && defined(CONFIG_INTEL_IOMMU)
9f9f4101fc98db Chris Wilson           2020-09-16  123  	static struct dev_iommu fake_iommu = { .priv = (void *)-1 };
01b9d4e21148c8 Joerg Roedel           2020-06-25  124  #endif
9f9f4101fc98db Chris Wilson           2020-09-16  125  	struct drm_i915_private *i915;
9f9f4101fc98db Chris Wilson           2020-09-16  126  	struct pci_dev *pdev;
d148738923fdb5 Thomas Hellström       2021-06-02  127  	int ret;
66d9cb5d805af7 Chris Wilson           2017-02-13  128  
7fb81e9d80738e Daniel Vetter          2020-03-23  129  	pdev = kzalloc(sizeof(*pdev), GFP_KERNEL);
66d9cb5d805af7 Chris Wilson           2017-02-13  130  	if (!pdev)
7fb81e9d80738e Daniel Vetter          2020-03-23  131  		return NULL;
66d9cb5d805af7 Chris Wilson           2017-02-13  132  	device_initialize(&pdev->dev);
29f31623d7a830 Chris Wilson           2017-05-18  133  	pdev->class = PCI_BASE_CLASS_DISPLAY << 16;
66d9cb5d805af7 Chris Wilson           2017-02-13  134  	pdev->dev.release = release_dev;
66d9cb5d805af7 Chris Wilson           2017-02-13  135  	dev_set_name(&pdev->dev, "mock");
d58f0083d39a17 Chris Wilson           2019-01-07  136  	dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
66d9cb5d805af7 Chris Wilson           2017-02-13  137  
764d2997ec0edb Arnd Bergmann          2017-10-05  138  #if IS_ENABLED(CONFIG_IOMMU_API) && defined(CONFIG_INTEL_IOMMU)
9f9f4101fc98db Chris Wilson           2020-09-16  139  	/* HACK to disable iommu for the fake device; force identity mapping */
9f9f4101fc98db Chris Wilson           2020-09-16  140  	pdev->dev.iommu = &fake_iommu;
f46f156ea7704a Chris Wilson           2017-09-18  141  #endif
cd01269d11a352 Daniel Vetter          2020-09-19  142  	if (!devres_open_group(&pdev->dev, NULL, GFP_KERNEL)) {
cd01269d11a352 Daniel Vetter          2020-09-19  143  		put_device(&pdev->dev);
cd01269d11a352 Daniel Vetter          2020-09-19  144  		return NULL;
cd01269d11a352 Daniel Vetter          2020-09-19  145  	}
cd01269d11a352 Daniel Vetter          2020-09-19  146  
cd01269d11a352 Daniel Vetter          2020-09-19  147  	i915 = devm_drm_dev_alloc(&pdev->dev, &mock_driver,
cd01269d11a352 Daniel Vetter          2020-09-19  148  				  struct drm_i915_private, drm);
cd01269d11a352 Daniel Vetter          2020-09-19  149  	if (IS_ERR(i915)) {
cd01269d11a352 Daniel Vetter          2020-09-19  150  		pr_err("Failed to allocate mock GEM device: err=%ld\n", PTR_ERR(i915));
cd01269d11a352 Daniel Vetter          2020-09-19  151  		devres_release_group(&pdev->dev, NULL);
cd01269d11a352 Daniel Vetter          2020-09-19  152  		put_device(&pdev->dev);
cd01269d11a352 Daniel Vetter          2020-09-19  153  
cd01269d11a352 Daniel Vetter          2020-09-19  154  		return NULL;
cd01269d11a352 Daniel Vetter          2020-09-19  155  	}
b5891fb520f742 Chris Wilson           2017-09-14  156  
bd780f37a3617d Chris Wilson           2019-01-14  157  	pci_set_drvdata(pdev, i915);
bd780f37a3617d Chris Wilson           2019-01-14  158  
1a0c19248a2f69 Chris Wilson           2017-07-18  159  	dev_pm_domain_set(&pdev->dev, &pm_domain);
1a0c19248a2f69 Chris Wilson           2017-07-18  160  	pm_runtime_enable(&pdev->dev);
66d9cb5d805af7 Chris Wilson           2017-02-13  161  	pm_runtime_dont_use_autosuspend(&pdev->dev);
07e070e1e3b24e Chris Wilson           2018-07-06  162  	if (pm_runtime_enabled(&pdev->dev))
1a0c19248a2f69 Chris Wilson           2017-07-18  163  		WARN_ON(pm_runtime_get_sync(&pdev->dev));
66d9cb5d805af7 Chris Wilson           2017-02-13  164  
66d9cb5d805af7 Chris Wilson           2017-02-13  165  
c499f6cb5ea470 Chris Wilson           2020-07-28  166  	i915_params_copy(&i915->params, &i915_modparams);
c499f6cb5ea470 Chris Wilson           2020-07-28  167  
69c663554452e6 Daniele Ceraolo Spurio 2019-06-13  168  	intel_runtime_pm_init_early(&i915->runtime_pm);
985a0256df3290 Ville Syrjälä          2022-02-04  169  	/* wakeref tracking has significant overhead */
985a0256df3290 Ville Syrjälä          2022-02-04  170  	i915->runtime_pm.no_wakeref_tracking = true;
d5b6c275d04aac Daniele Ceraolo Spurio 2019-06-13  171  
3b5bb0a37665ce Chris Wilson           2017-02-13  172  	/* Using the global GTT may ask questions about KMS users, so prepare */
3b5bb0a37665ce Chris Wilson           2017-02-13  173  	drm_mode_config_init(&i915->drm);
3b5bb0a37665ce Chris Wilson           2017-02-13  174  
43ba44a176a420 Jani Nikula            2022-08-19 @175  	RUNTIME_INFO(i915)->graphics.ver = -1;
66d9cb5d805af7 Chris Wilson           2017-02-13  176  
9d0bad177af9fd Jani Nikula            2022-08-19  177  	RUNTIME_INFO(i915)->page_sizes =
f1f3f98272b9bb Matthew Auld           2017-10-06  178  		I915_GTT_PAGE_SIZE_4K |
a883241c392200 Matthew Auld           2017-10-06  179  		I915_GTT_PAGE_SIZE_64K |
a883241c392200 Matthew Auld           2017-10-06  180  		I915_GTT_PAGE_SIZE_2M;
2a9654b2cdd8f9 Matthew Auld           2017-10-06  181  
f81f30b305d2c7 Jani Nikula            2022-08-19  182  	RUNTIME_INFO(i915)->memory_regions = REGION_SMEM;
3fc794f27fec8f Chris Wilson           2019-10-26  183  	intel_memory_regions_hw_probe(i915);
da1184cd41d4c6 Matthew Auld           2019-10-18  184  
9a7fc952717ea6 Tvrtko Ursulin         2021-11-11  185  	spin_lock_init(&i915->gpu_error.lock);
9a7fc952717ea6 Tvrtko Ursulin         2021-11-11  186  
9c52d1c816baa5 Chris Wilson           2017-11-10  187  	i915_gem_init__mm(i915);
bec68cc9ea42d8 Tvrtko Ursulin         2022-03-19  188  	intel_root_gt_init_early(i915);
030def2cc91f51 Michał Winiarski       2021-12-14  189  	mock_uncore_init(&i915->uncore, i915);
8c2699fad60e3f Andi Shyti             2021-12-14  190  	atomic_inc(&to_gt(i915)->wakeref.count); /* disable; no hw support */
8c2699fad60e3f Andi Shyti             2021-12-14  191  	to_gt(i915)->awake = -ENODEV;
bec68cc9ea42d8 Tvrtko Ursulin         2022-03-19  192  	mock_gt_probe(i915);
66d9cb5d805af7 Chris Wilson           2017-02-13  193  
d148738923fdb5 Thomas Hellström       2021-06-02  194  	ret = intel_region_ttm_device_init(i915);
d148738923fdb5 Thomas Hellström       2021-06-02  195  	if (ret)
d148738923fdb5 Thomas Hellström       2021-06-02  196  		goto err_ttm;
d148738923fdb5 Thomas Hellström       2021-06-02  197  
0daf0113cff688 Chris Wilson           2017-02-13  198  	i915->wq = alloc_ordered_workqueue("mock", 0);
0daf0113cff688 Chris Wilson           2017-02-13  199  	if (!i915->wq)
19553d57dcddf6 Chris Wilson           2017-12-09  200  		goto err_drv;
0daf0113cff688 Chris Wilson           2017-02-13  201  
5f09a9c8ab6b16 Chris Wilson           2017-06-20  202  	mock_init_contexts(i915);
0daf0113cff688 Chris Wilson           2017-02-13  203  
cdeea858d8df98 Andi Shyti             2021-12-19  204  	/* allocate the ggtt */
cdeea858d8df98 Andi Shyti             2021-12-19  205  	ret = intel_gt_assign_ggtt(to_gt(i915));
cdeea858d8df98 Andi Shyti             2021-12-19  206  	if (ret)
cdeea858d8df98 Andi Shyti             2021-12-19  207  		goto err_unlock;
cdeea858d8df98 Andi Shyti             2021-12-19  208  
cdeea858d8df98 Andi Shyti             2021-12-19  209  	mock_init_ggtt(to_gt(i915));
cdeea858d8df98 Andi Shyti             2021-12-19  210  	to_gt(i915)->vm = i915_vm_get(&to_gt(i915)->ggtt->vm);
3b5bb0a37665ce Chris Wilson           2017-02-13  211  
488e29fedc1f2b Jani Nikula            2022-08-19  212  	RUNTIME_INFO(i915)->platform_engine_mask = BIT(0);
8c2699fad60e3f Andi Shyti             2021-12-14  213  	to_gt(i915)->info.engine_mask = BIT(0);
4a774ee35c9f57 Chris Wilson           2018-05-23  214  
8c2699fad60e3f Andi Shyti             2021-12-14  215  	to_gt(i915)->engine[RCS0] = mock_engine(i915, "mock", RCS0);
8c2699fad60e3f Andi Shyti             2021-12-14  216  	if (!to_gt(i915)->engine[RCS0])
11334c6aad9500 Chris Wilson           2019-04-26  217  		goto err_unlock;
11334c6aad9500 Chris Wilson           2019-04-26  218  
8c2699fad60e3f Andi Shyti             2021-12-14  219  	if (mock_engine_init(to_gt(i915)->engine[RCS0]))
4a774ee35c9f57 Chris Wilson           2018-05-23  220  		goto err_context;
0daf0113cff688 Chris Wilson           2017-02-13  221  
8c2699fad60e3f Andi Shyti             2021-12-14  222  	__clear_bit(I915_WEDGED, &to_gt(i915)->reset.flags);
cbb153c50ebe4f Chris Wilson           2019-08-08  223  	intel_engines_driver_register(i915);
1d7a99f5148fdc Chris Wilson           2018-05-08  224  
7fb81e9d80738e Daniel Vetter          2020-03-23  225  	i915->do_release = true;
d148738923fdb5 Thomas Hellström       2021-06-02  226  	ida_init(&i915->selftest.mock_region_instances);
7fb81e9d80738e Daniel Vetter          2020-03-23  227  
66d9cb5d805af7 Chris Wilson           2017-02-13  228  	return i915;
66d9cb5d805af7 Chris Wilson           2017-02-13  229  
4a774ee35c9f57 Chris Wilson           2018-05-23  230  err_context:
8c2699fad60e3f Andi Shyti             2021-12-14  231  	intel_gt_driver_remove(to_gt(i915));
1d7a99f5148fdc Chris Wilson           2018-05-08  232  err_unlock:
0daf0113cff688 Chris Wilson           2017-02-13  233  	destroy_workqueue(i915->wq);
19553d57dcddf6 Chris Wilson           2017-12-09  234  err_drv:
d148738923fdb5 Thomas Hellström       2021-06-02  235  	intel_region_ttm_device_fini(i915);
d148738923fdb5 Thomas Hellström       2021-06-02  236  err_ttm:
bec68cc9ea42d8 Tvrtko Ursulin         2022-03-19  237  	intel_gt_driver_late_release_all(i915);
3fc794f27fec8f Chris Wilson           2019-10-26  238  	intel_memory_regions_driver_release(i915);
19553d57dcddf6 Chris Wilson           2017-12-09  239  	drm_mode_config_cleanup(&i915->drm);
82be0d7540b104 Daniel Vetter          2020-09-18  240  	mock_destroy_device(i915);
7fb81e9d80738e Daniel Vetter          2020-03-23  241  
66d9cb5d805af7 Chris Wilson           2017-02-13  242  	return NULL;
66d9cb5d805af7 Chris Wilson           2017-02-13  243  }
82be0d7540b104 Daniel Vetter          2020-09-18  244
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index c9cca165bf5d..f85a470397a5 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -469,19 +469,19 @@  static inline struct intel_gt *to_gt(struct drm_i915_private *i915)
 
 #define IP_VER(ver, rel)		((ver) << 8 | (rel))
 
-#define GRAPHICS_VER(i915)		(RUNTIME_INFO(i915)->graphics.ver)
-#define GRAPHICS_VER_FULL(i915)		IP_VER(RUNTIME_INFO(i915)->graphics.ver, \
-					       RUNTIME_INFO(i915)->graphics.rel)
+#define GRAPHICS_VER(i915)		(RUNTIME_INFO(i915)->graphics.version.ver)
+#define GRAPHICS_VER_FULL(i915)		IP_VER(RUNTIME_INFO(i915)->graphics.version.ver, \
+					       RUNTIME_INFO(i915)->graphics.version.rel)
 #define IS_GRAPHICS_VER(i915, from, until) \
 	(GRAPHICS_VER(i915) >= (from) && GRAPHICS_VER(i915) <= (until))
 
-#define MEDIA_VER(i915)			(INTEL_INFO(i915)->media.ver)
-#define MEDIA_VER_FULL(i915)		IP_VER(INTEL_INFO(i915)->media.ver, \
-					       INTEL_INFO(i915)->media.rel)
+#define MEDIA_VER(i915)			(RUNTIME_INFO(i915)->media.version.ver)
+#define MEDIA_VER_FULL(i915)		IP_VER(RUNTIME_INFO(i915)->media.version.ver, \
+					       RUNTIME_INFO(i915)->media.version.rel)
 #define IS_MEDIA_VER(i915, from, until) \
 	(MEDIA_VER(i915) >= (from) && MEDIA_VER(i915) <= (until))
 
-#define DISPLAY_VER(i915)	(INTEL_INFO(i915)->display.ver)
+#define DISPLAY_VER(i915)	(RUNTIME_INFO(i915)->display.version.ver)
 #define IS_DISPLAY_VER(i915, from, until) \
 	(DISPLAY_VER(i915) >= (from) && DISPLAY_VER(i915) <= (until))
 
diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 26b25d9434d6..f6aaf938c53c 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -34,9 +34,9 @@ 
 
 #define PLATFORM(x) .platform = (x)
 #define GEN(x) \
-	.__runtime.graphics.ver = (x), \
-	.media.ver = (x), \
-	.display.ver = (x)
+	.__runtime.graphics.version.ver = (x), \
+	.__runtime.media.version.ver = (x), \
+	.__runtime.display.version.ver = (x)
 
 #define I845_PIPE_OFFSETS \
 	.display.pipe_offsets = { \
@@ -740,7 +740,7 @@  static const struct intel_device_info bxt_info = {
 static const struct intel_device_info glk_info = {
 	GEN9_LP_FEATURES,
 	PLATFORM(INTEL_GEMINILAKE),
-	.display.ver = 10,
+	.__runtime.display.version.ver = 10,
 	.display.dbuf.size = 1024 - 4, /* 4 blocks for bypass path allocation */
 	GLK_COLORS,
 };
@@ -919,7 +919,7 @@  static const struct intel_device_info rkl_info = {
 static const struct intel_device_info dg1_info = {
 	GEN12_FEATURES,
 	DGFX_FEATURES,
-	.__runtime.graphics.rel = 10,
+	.__runtime.graphics.version.rel = 10,
 	PLATFORM(INTEL_DG1),
 	.__runtime.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C) | BIT(PIPE_D),
 	.require_force_probe = 1,
@@ -962,7 +962,7 @@  static const struct intel_device_info adl_s_info = {
 	.display.has_hotplug = 1,						\
 	.display.has_ipc = 1,							\
 	.display.has_psr = 1,							\
-	.display.ver = 13,							\
+	.__runtime.display.version.ver = 13,							\
 	.__runtime.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C) | BIT(PIPE_D),	\
 	.display.pipe_offsets = {						\
 		[TRANSCODER_A] = PIPE_A_OFFSET,					\
@@ -1006,8 +1006,8 @@  static const struct intel_device_info adl_p_info = {
 		I915_GTT_PAGE_SIZE_2M
 
 #define XE_HP_FEATURES \
-	.__runtime.graphics.ver = 12, \
-	.__runtime.graphics.rel = 50, \
+	.__runtime.graphics.version.ver = 12, \
+	.__runtime.graphics.version.rel = 50, \
 	XE_HP_PAGE_SIZES, \
 	.dma_mask_size = 46, \
 	.has_3d_pipeline = 1, \
@@ -1027,8 +1027,8 @@  static const struct intel_device_info adl_p_info = {
 	.__runtime.ppgtt_type = INTEL_PPGTT_FULL
 
 #define XE_HPM_FEATURES \
-	.media.ver = 12, \
-	.media.rel = 50
+	.__runtime.media.version.ver = 12, \
+	.__runtime.media.version.rel = 50
 
 __maybe_unused
 static const struct intel_device_info xehpsdv_info = {
@@ -1053,8 +1053,8 @@  static const struct intel_device_info xehpsdv_info = {
 	XE_HP_FEATURES, \
 	XE_HPM_FEATURES, \
 	DGFX_FEATURES, \
-	.__runtime.graphics.rel = 55, \
-	.media.rel = 55, \
+	.__runtime.graphics.version.rel = 55, \
+	.__runtime.media.version.rel = 55, \
 	PLATFORM(INTEL_DG2), \
 	.has_4tile = 1, \
 	.has_64k_pages = 1, \
@@ -1097,8 +1097,8 @@  static const struct intel_device_info pvc_info = {
 	XE_HPC_FEATURES,
 	XE_HPM_FEATURES,
 	DGFX_FEATURES,
-	.__runtime.graphics.rel = 60,
-	.media.rel = 60,
+	.__runtime.graphics.version.rel = 60,
+	.__runtime.media.version.rel = 60,
 	PLATFORM(INTEL_PONTEVECCHIO),
 	.display = { 0 },
 	.has_flat_ccs = 0,
@@ -1111,7 +1111,7 @@  static const struct intel_device_info pvc_info = {
 
 #define XE_LPDP_FEATURES	\
 	XE_LPD_FEATURES,	\
-	.display.ver = 14,	\
+	.__runtime.display.version.ver = 14,	\
 	.display.has_cdclk_crawl = 1, \
 	.__runtime.fbc_mask = BIT(INTEL_FBC_A) | BIT(INTEL_FBC_B)
 
@@ -1123,9 +1123,9 @@  static const struct intel_device_info mtl_info = {
 	 * Real graphics IP version will be obtained from hardware GMD_ID
 	 * register.  Value provided here is just for sanity checking.
 	 */
-	.__runtime.graphics.ver = 12,
-	.__runtime.graphics.rel = 70,
-	.media.ver = 13,
+	.__runtime.graphics.version.ver = 12,
+	.__runtime.graphics.version.rel = 70,
+	.__runtime.media.version.ver = 13,
 	PLATFORM(INTEL_METEORLAKE),
 	.display.has_modular_fia = 1,
 	.has_flat_ccs = 0,
@@ -1281,7 +1281,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)
 {
-	int gttmmaddr_bar = intel_info->__runtime.graphics.ver == 2 ? GEN2_GTTMMADR_BAR : GTTMMADR_BAR;
+	int gttmmaddr_bar = intel_info->__runtime.graphics.version.ver == 2 ? GEN2_GTTMMADR_BAR : GTTMMADR_BAR;
 
 	return i915_pci_resource_valid(pdev, gttmmaddr_bar);
 }
diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c
index 0a1f97b35f2b..56f19683dd55 100644
--- a/drivers/gpu/drm/i915/intel_device_info.c
+++ b/drivers/gpu/drm/i915/intel_device_info.c
@@ -92,21 +92,29 @@  void intel_device_info_print(const struct intel_device_info *info,
 			     const struct intel_runtime_info *runtime,
 			     struct drm_printer *p)
 {
-	if (runtime->graphics.rel)
-		drm_printf(p, "graphics version: %u.%02u\n", runtime->graphics.ver,
-			   runtime->graphics.rel);
+	if (runtime->graphics.version.rel)
+		drm_printf(p, "graphics version: %u.%02u\n",
+			   runtime->graphics.version.ver,
+			   runtime->graphics.version.rel);
 	else
-		drm_printf(p, "graphics version: %u\n", runtime->graphics.ver);
+		drm_printf(p, "graphics version: %u\n",
+			   runtime->graphics.version.ver);
 
-	if (info->media.rel)
-		drm_printf(p, "media version: %u.%02u\n", info->media.ver, info->media.rel);
+	if (runtime->media.version.rel)
+		drm_printf(p, "media version: %u.%02u\n",
+			   runtime->media.version.ver,
+			   runtime->media.version.rel);
 	else
-		drm_printf(p, "media version: %u\n", info->media.ver);
+		drm_printf(p, "media version: %u\n",
+			   runtime->media.version.ver);
 
-	if (info->display.rel)
-		drm_printf(p, "display version: %u.%02u\n", info->display.ver, info->display.rel);
+	if (runtime->display.version.rel)
+		drm_printf(p, "display version: %u.%02u\n",
+			   runtime->display.version.ver,
+			   runtime->display.version.rel);
 	else
-		drm_printf(p, "display version: %u\n", info->display.ver);
+		drm_printf(p, "display version: %u\n",
+			   runtime->display.version.ver);
 
 	drm_printf(p, "gt: %d\n", info->gt);
 	drm_printf(p, "memory-regions: %x\n", runtime->memory_regions);
diff --git a/drivers/gpu/drm/i915/intel_device_info.h b/drivers/gpu/drm/i915/intel_device_info.h
index 6904ad03ca19..d36cf25f1d5f 100644
--- a/drivers/gpu/drm/i915/intel_device_info.h
+++ b/drivers/gpu/drm/i915/intel_device_info.h
@@ -200,7 +200,15 @@  struct ip_version {
 };
 
 struct intel_runtime_info {
-	struct ip_version graphics;
+	struct {
+		struct ip_version version;
+	} graphics;
+	struct {
+		struct ip_version version;
+	} media;
+	struct {
+		struct ip_version version;
+	} display;
 
 	/*
 	 * Platform mask is used for optimizing or-ed IS_PLATFORM calls into
@@ -246,8 +254,6 @@  struct intel_runtime_info {
 };
 
 struct intel_device_info {
-	struct ip_version media;
-
 	enum intel_platform platform;
 
 	unsigned int dma_mask_size; /* available DMA address bits */
@@ -259,9 +265,6 @@  struct intel_device_info {
 #undef DEFINE_FLAG
 
 	struct {
-		u8 ver;
-		u8 rel;
-
 		u8 abox_mask;
 
 		struct {