Since we map multiple PCI-IDs to a single static device info, we cannot store the PCI-ID inside the static struct. But since we want to keep the PCI-ID easily accessible, we do want to copy it into the drm_i915_private, hence use intel_device_runtime_info. add/remove: 0/0 grow/shrink: 3/0 up/down: 6/0 (6) Function old new delta intel_device_info_dump 78 82 +4 intel_device_info_runtime_init 2380 2381 +1 capture 6173 6174 +1 Total: Before=1331297, After=1331303, chg +0.00% Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> --- drivers/gpu/drm/i915/i915_drv.c | 4 +++- drivers/gpu/drm/i915/i915_drv.h | 2 +- drivers/gpu/drm/i915/intel_device_info.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index e3cf7c9721e3..af2ddf5c7d59 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -887,6 +887,7 @@ static int i915_driver_init_early(struct drm_i915_private *dev_priv, const struct intel_device_static_info *match_info = (const struct intel_device_static_info *)ent->driver_data; struct intel_device_static_info *device_info; + struct intel_device_runtime_info *info = &dev_priv->device_runtime; int ret = 0; if (i915_inject_load_failure()) @@ -895,7 +896,8 @@ static int i915_driver_init_early(struct drm_i915_private *dev_priv, /* Setup the write-once "constant" device info */ device_info = mkwrite_device_info(dev_priv); memcpy(device_info, match_info, sizeof(*device_info)); - device_info->device_id = dev_priv->drm.pdev->device; + + info->device_id = dev_priv->drm.pdev->device; BUILD_BUG_ON(INTEL_MAX_PLATFORMS > sizeof(device_info->platform_mask) * BITS_PER_BYTE); diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 0f0ecf77b546..270adb157186 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -2549,7 +2549,7 @@ runtime_info(const struct drm_i915_private *dev_priv) #define RUNTIME_INFO(dev_priv) runtime_info((dev_priv)) #define INTEL_GEN(dev_priv) (DEVICE_INFO(dev_priv)->gen) -#define INTEL_DEVID(dev_priv) (DEVICE_INFO(dev_priv)->device_id) +#define INTEL_DEVID(dev_priv) (RUNTIME_INFO(dev_priv)->device_id) #define REVID_FOREVER 0xff #define INTEL_REVID(dev_priv) ((dev_priv)->drm.pdev->revision) diff --git a/drivers/gpu/drm/i915/intel_device_info.h b/drivers/gpu/drm/i915/intel_device_info.h index 4ffdac07760f..8a570f75d67e 100644 --- a/drivers/gpu/drm/i915/intel_device_info.h +++ b/drivers/gpu/drm/i915/intel_device_info.h @@ -126,7 +126,6 @@ struct sseu_dev_info { }; struct intel_device_static_info { - u16 device_id; u16 gen_mask; u8 gen; @@ -169,6 +168,7 @@ struct intel_device_static_info { struct intel_device_runtime_info { /* device info probed at runtime */ u32 edram; /* Cannot be determined by PCIID, only from a register. */ + u16 device_id; }; struct intel_driver_caps { -- 2.16.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx