diff mbox series

[RFC,03/15] drm/i915: Cache opregion asls pointer

Message ID 20240108230517.1497504-4-radhakrishna.sripada@intel.com (mailing list archive)
State New, archived
Headers show
Series VBT read Cleanup | expand

Commit Message

Sripada, Radhakrishna Jan. 8, 2024, 11:05 p.m. UTC
Asls offset is used to calculate the relative offset of vbt in ASLE
mailbox. Cache the address read from PCI config space to use later during
vbt extraction.

Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
---
 drivers/gpu/drm/i915/display/intel_opregion.c | 4 +++-
 drivers/gpu/drm/i915/display/intel_opregion.h | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_opregion.c b/drivers/gpu/drm/i915/display/intel_opregion.c
index fa25007fac3a..bd654d773ca7 100644
--- a/drivers/gpu/drm/i915/display/intel_opregion.c
+++ b/drivers/gpu/drm/i915/display/intel_opregion.c
@@ -903,6 +903,7 @@  int intel_opregion_setup(struct drm_i915_private *dev_priv)
 		return -ENOTSUPP;
 	}
 
+	opregion->asls = asls;
 	INIT_WORK(&opregion->asle_work, asle_work);
 
 	base = memremap(asls, OPREGION_SIZE, MEMREMAP_WB);
@@ -987,7 +988,7 @@  int intel_opregion_setup(struct drm_i915_private *dev_priv)
 		    opregion->header->over.minor >= 1) {
 			drm_WARN_ON(&dev_priv->drm, rvda < OPREGION_SIZE);
 
-			rvda += asls;
+			rvda += opregion->asls;
 		}
 
 		opregion->rvda = memremap(rvda, opregion->asle->rvds,
@@ -1262,6 +1263,7 @@  void intel_opregion_cleanup(struct drm_i915_private *i915)
 	opregion->swsci = NULL;
 	opregion->asle = NULL;
 	opregion->asle_ext = NULL;
+	opregion->asls = 0;
 	vbt->vbt = NULL;
 	opregion->lid_state = NULL;
 }
diff --git a/drivers/gpu/drm/i915/display/intel_opregion.h b/drivers/gpu/drm/i915/display/intel_opregion.h
index 7e1c8f1c2da5..03838fa39d0d 100644
--- a/drivers/gpu/drm/i915/display/intel_opregion.h
+++ b/drivers/gpu/drm/i915/display/intel_opregion.h
@@ -48,6 +48,7 @@  struct intel_opregion {
 	struct opregion_asle_ext *asle_ext;
 	void *rvda;
 	u32 *lid_state;
+	u32 asls;
 	struct work_struct asle_work;
 	struct notifier_block acpi_notifier;
 };