All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 05/10] drm/i915: Move PCI-ID from static device info to runtime
Date: Fri,  9 Feb 2018 21:16:49 +0000	[thread overview]
Message-ID: <20180209211654.32043-5-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20180209211654.32043-1-chris@chris-wilson.co.uk>

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@chris-wilson.co.uk>
---
 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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2018-02-09 21:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-09 21:16 [PATCH 01/10] drm/i915: Rename intel_device_info and accessors Chris Wilson
2018-02-09 21:16 ` [PATCH 02/10] drm/i915: Store gen_mask inside the static device info Chris Wilson
2018-02-09 21:16 ` [PATCH 03/10] drm/i915: Store platform_mask " Chris Wilson
2018-02-09 21:16 ` [PATCH 04/10] drm/i915: Move EDRAM capability bits to intel_device_runtime_info Chris Wilson
2018-02-09 21:16 ` Chris Wilson [this message]
2018-02-09 21:16 ` [PATCH 06/10] drm/i915: Remove a local writable device_info Chris Wilson
2018-02-09 21:16 ` [PATCH 07/10] drm/i915: Disable dynamic setup of device_info->num_rings Chris Wilson
2018-02-09 21:16 ` [PATCH 08/10] drm/i915: Move SSEU runtime info to intel_device_runtime_info Chris Wilson
2018-02-12 16:48   ` Ville Syrjälä
2018-02-09 21:16 ` [PATCH 09/10] drm/i915: Make a mutable copy of pages_size in intel_driver_caps Chris Wilson
2018-02-09 21:16 ` [PATCH 10/10] drm/i915: Make a mutable copy of intel_device_static_info.has_fbc Chris Wilson
2018-02-12 16:50   ` Ville Syrjälä
2018-02-09 21:37 ` ✗ Fi.CI.BAT: failure for series starting with [01/10] drm/i915: Rename intel_device_info and accessors Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180209211654.32043-5-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.