[PATCH 16/43] drm/xe/stolen: Convert register access to use xe_mmio

Lucas De Marchi lucas.demarchi at intel.com
Fri Sep 6 23:17:58 UTC 2024


On Tue, Sep 03, 2024 at 05:21:17PM GMT, Matt Roper wrote:
>Stop using GT pointers for register access.


Reviewed-by: Lucas De Marchi <lucas.demarchi at intel.com>


Lucas De Marchi

>
>Signed-off-by: Matt Roper <matthew.d.roper at intel.com>
>---
> drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
>diff --git a/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c b/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c
>index f7113cf6109d..423856cc18d4 100644
>--- a/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c
>+++ b/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c
>@@ -60,7 +60,7 @@ bool xe_ttm_stolen_cpu_access_needs_ggtt(struct xe_device *xe)
> static s64 detect_bar2_dgfx(struct xe_device *xe, struct xe_ttm_stolen_mgr *mgr)
> {
> 	struct xe_tile *tile = xe_device_get_root_tile(xe);
>-	struct xe_gt *mmio = xe_root_mmio_gt(xe);
>+	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> 	struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
> 	u64 stolen_size;
> 	u64 tile_offset;
>@@ -94,7 +94,7 @@ static u32 get_wopcm_size(struct xe_device *xe)
> 	u32 wopcm_size;
> 	u64 val;
>
>-	val = xe_mmio_read64_2x32(xe_root_mmio_gt(xe), STOLEN_RESERVED);
>+	val = xe_mmio_read64_2x32(xe_root_tile_mmio(xe), STOLEN_RESERVED);
> 	val = REG_FIELD_GET64(WOPCM_SIZE_MASK, val);
>
> 	switch (val) {
>@@ -119,7 +119,7 @@ static u32 detect_bar2_integrated(struct xe_device *xe, struct xe_ttm_stolen_mgr
> 	u32 stolen_size, wopcm_size;
> 	u32 ggc, gms;
>
>-	ggc = xe_mmio_read32(xe_root_mmio_gt(xe), GGC);
>+	ggc = xe_mmio_read32(xe_root_tile_mmio(xe), GGC);
>
> 	/*
> 	 * Check GGMS: it should be fixed 0x3 (8MB), which corresponds to the
>@@ -159,7 +159,7 @@ static u32 detect_bar2_integrated(struct xe_device *xe, struct xe_ttm_stolen_mgr
> 	stolen_size -= wopcm_size;
>
> 	if (media_gt && XE_WA(media_gt, 14019821291)) {
>-		u64 gscpsmi_base = xe_mmio_read64_2x32(media_gt, GSCPSMI_BASE)
>+		u64 gscpsmi_base = xe_mmio_read64_2x32(&media_gt->mmio, GSCPSMI_BASE)
> 			& ~GENMASK_ULL(5, 0);
>
> 		/*
>-- 
>2.45.2
>


More information about the Intel-xe mailing list