summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_driver.c
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2022-08-19 14:02:36 +0200
committerJani Nikula <jani.nikula@intel.com>2022-08-24 10:45:15 +0200
commit2c93e7b7f545d2cca0e9e220ad7e6e1ac793ed39 (patch)
tree234bc8207156a9cbc22e6b9d095b2b1e48e3e746 /drivers/gpu/drm/i915/i915_driver.c
parentdrm/i915: combine device info printing into one (diff)
downloadlinux-2c93e7b7f545d2cca0e9e220ad7e6e1ac793ed39.tar.xz
linux-2c93e7b7f545d2cca0e9e220ad7e6e1ac793ed39.zip
drm/i915: add initial runtime info into device info
Add initial runtime info that we can copy to runtime info at i915 creation time. This lets us define the initial values for runtime info statically while making it possible to change them runtime. This will be the new home for the current "const" device info members that are modified runtime anyway. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Maarten Lankhort <maarten.lankhorst@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/a77c6db2da20d401f47a0a5e87356b9b3f6292df.1660910433.git.jani.nikula@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/i915_driver.c')
-rw-r--r--drivers/gpu/drm/i915/i915_driver.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
index 563797d5e6e1..1332c70370a6 100644
--- a/drivers/gpu/drm/i915/i915_driver.c
+++ b/drivers/gpu/drm/i915/i915_driver.c
@@ -814,6 +814,7 @@ i915_driver_create(struct pci_dev *pdev, const struct pci_device_id *ent)
const struct intel_device_info *match_info =
(struct intel_device_info *)ent->driver_data;
struct intel_device_info *device_info;
+ struct intel_runtime_info *runtime;
struct drm_i915_private *i915;
i915 = devm_drm_dev_alloc(&pdev->dev, &i915_drm_driver,
@@ -829,7 +830,11 @@ i915_driver_create(struct pci_dev *pdev, const struct pci_device_id *ent)
/* Setup the write-once "constant" device info */
device_info = mkwrite_device_info(i915);
memcpy(device_info, match_info, sizeof(*device_info));
- RUNTIME_INFO(i915)->device_id = pdev->device;
+
+ /* Initialize initial runtime info from static const data and pdev. */
+ runtime = RUNTIME_INFO(i915);
+ memcpy(runtime, &INTEL_INFO(i915)->__runtime, sizeof(*runtime));
+ runtime->device_id = pdev->device;
return i915;
}