[Intel-gfx] [RFC PATCH 091/162] drm/i915: Store gt in memory region

Matthew Auld matthew.auld at intel.com
Fri Nov 27 12:06:07 UTC 2020


From: Prathap Kumar Valsan <prathap.kumar.valsan at 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 at intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin at 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 --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;
 
-- 
2.26.2



More information about the Intel-gfx mailing list