diff mbox series

[RFC,091/162] drm/i915: Store gt in memory region

Message ID 20201127120718.454037-92-matthew.auld@intel.com (mailing list archive)
State New, archived
Headers show
Series DG1 + LMEM enabling | expand

Commit Message

Matthew Auld Nov. 27, 2020, 12:06 p.m. UTC
From: Prathap Kumar Valsan <prathap.kumar.valsan@intel.com>

Store pointer to gt closest to its memory region so that we can access
the engines corresponding to that gt via memory region.

Signed-off-by: Prathap Kumar Valsan <prathap.kumar.valsan@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/intel_memory_region.c | 1 +
 drivers/gpu/drm/i915/intel_memory_region.h | 1 +
 2 files changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_memory_region.c b/drivers/gpu/drm/i915/intel_memory_region.c
index dca1e367ab98..6f40748901da 100644
--- a/drivers/gpu/drm/i915/intel_memory_region.c
+++ b/drivers/gpu/drm/i915/intel_memory_region.c
@@ -298,6 +298,7 @@  int intel_memory_regions_hw_probe(struct drm_i915_private *i915)
 		mem->id = i;
 		mem->type = type;
 		mem->instance = instance;
+		mem->gt = &i915->gt;
 
 		i915->mm.regions[i] = mem;
 	}
diff --git a/drivers/gpu/drm/i915/intel_memory_region.h b/drivers/gpu/drm/i915/intel_memory_region.h
index c047cf7c5e7c..15dcb57b4b5a 100644
--- a/drivers/gpu/drm/i915/intel_memory_region.h
+++ b/drivers/gpu/drm/i915/intel_memory_region.h
@@ -91,6 +91,7 @@  struct intel_memory_region {
 	u16 instance;
 	enum intel_region_id id;
 	char name[8];
+	struct intel_gt *gt; /* GT closest to this region. */
 
 	dma_addr_t remap_addr;