[Intel-xe] [PATCH 09/26] drm/xe: Clarify 'gt' retrieval for primary tile

Lucas De Marchi lucas.demarchi at intel.com
Wed May 17 05:07:58 UTC 2023


On Wed, May 10, 2023 at 08:47:05PM -0700, Matt Roper wrote:
>There are a bunch of places in the driver where we need to perform
>non-GT MMIO against the platform's primary tile (display code, top-level
>interrupt enable/disable, driver initialization, etc.).  Rename
>'to_gt()' to 'xe_primary_mmio_gt()' to clarify that we're trying to get
>a primary MMIO handle for these top-level operations.
>
>In the future we need to move away from xe_gt as the target for MMIO
>operations (most of which are completely unrelated to GT).
>
>Signed-off-by: Matt Roper <matthew.d.roper at intel.com>
>---
> drivers/gpu/drm/xe/compat-i915-headers/intel_uncore.h | 2 +-
> drivers/gpu/drm/xe/xe_device.c                        | 2 +-
> drivers/gpu/drm/xe/xe_device.h                        | 9 +++++++--
> drivers/gpu/drm/xe/xe_irq.c                           | 6 +++---
> drivers/gpu/drm/xe/xe_mmio.c                          | 8 ++++----
> drivers/gpu/drm/xe/xe_query.c                         | 2 +-
> drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c                | 4 ++--
> 7 files changed, 19 insertions(+), 14 deletions(-)
>
>diff --git a/drivers/gpu/drm/xe/compat-i915-headers/intel_uncore.h b/drivers/gpu/drm/xe/compat-i915-headers/intel_uncore.h
>index 14f195fe275d..6eff72311773 100644
>--- a/drivers/gpu/drm/xe/compat-i915-headers/intel_uncore.h
>+++ b/drivers/gpu/drm/xe/compat-i915-headers/intel_uncore.h
>@@ -14,7 +14,7 @@ static inline struct xe_gt *__fake_uncore_to_gt(struct fake_uncore *uncore)
> {
> 	struct xe_device *xe = container_of(uncore, struct xe_device, uncore);
>
>-	return to_gt(xe);
>+	return xe_primary_mmio_gt(xe);

nit: this contrasts with the name chosen in the first patch:
xe_device_get_root_tile(). I think it would be good to be consistent.

xe_primary_mmio_gt(xe)
xe_root_tile(xe)
?

xe_device_get_primary_mmio_gt(xe)
xe_device_get_root_tile(xe)
?

The latter seems a bit too long for me.

Maybe also consolidate on primary vs root?

> }
>
> static inline u32 intel_uncore_read(struct fake_uncore *uncore,
>diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
>index 038074a90584..c93c8895862f 100644
>--- a/drivers/gpu/drm/xe/xe_device.c
>+++ b/drivers/gpu/drm/xe/xe_device.c
>@@ -397,7 +397,7 @@ static void device_kill_persistent_engines(struct xe_device *xe,
>
> void xe_device_wmb(struct xe_device *xe)
> {
>-	struct xe_gt *gt = xe_device_get_gt(xe, 0);
>+	struct xe_gt *gt = xe_primary_mmio_gt(xe);
>
> 	wmb();
> 	if (IS_DGFX(xe))
>diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
>index 745dbb16d417..fc2655484dfd 100644
>--- a/drivers/gpu/drm/xe/xe_device.h
>+++ b/drivers/gpu/drm/xe/xe_device.h
>@@ -66,9 +66,14 @@ static inline struct xe_gt *xe_device_get_gt(struct xe_device *xe, u8 gt_id)
> }
>
> /*
>- * FIXME: Placeholder until multi-gt lands. Once that lands, kill this function.
>+ * Provide a GT structure suitable for performing non-GT MMIO operations against
>+ * the primary tile.  Primarily intended for early tile initialization, display
>+ * handling, top-most interrupt enable/disable, etc.
>+ *
>+ * FIXME: Fix the driver design so that 'gt' isn't the target of all MMIO
>+ * operations.

again... not sure I agree with the statement here as we may fall into a
situation that it's harder to figure out what should be used for what
mmio. I may need to get used to this after looking at the final result.

Lucas De Marchi


More information about the Intel-xe mailing list