diff options
| author | Matt Roper <matthew.d.roper@intel.com> | 2024-09-10 16:47:27 -0700 |
|---|---|---|
| committer | Matt Roper <matthew.d.roper@intel.com> | 2024-09-11 15:17:34 -0700 |
| commit | 1877c88fa9b9bdbce7a65d7cbd2aa4e29bb514af (patch) | |
| tree | 82f24a70fb9c8828684ebc5895d562490fb40604 /drivers | |
| parent | 960a83799f5bb8634755f0593c591c53ff4acee8 (diff) | |
| download | linux-1877c88fa9b9bdbce7a65d7cbd2aa4e29bb514af.tar.gz linux-1877c88fa9b9bdbce7a65d7cbd2aa4e29bb514af.zip | |
drm/xe: Add xe_tile backpointer to xe_mmio
Once MMIO operations stop being (incorrectly) tied to a GT, we'll still
need a backpointer for feature checks, message logging, and tracepoints.
Use a tile backpointer since that may allow the most useful debugging
output, while also providing access to the xe_device.
v2:
- Make backpointer an xe_tile instead of xe_device. (Michal)
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> # v1
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240910234719.3335472-52-matthew.d.roper@intel.com
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/gpu/drm/xe/xe_device_types.h | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/xe/xe_mmio.c | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/xe/xe_pci.c | 2 |
3 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h index e5af3f5fe78c..3a23083ec3cf 100644 --- a/drivers/gpu/drm/xe/xe_device_types.h +++ b/drivers/gpu/drm/xe/xe_device_types.h @@ -115,6 +115,9 @@ struct xe_mem_region { * subregions of the overall IO space). */ struct xe_mmio { + /** @tile: Backpointer to tile, used for tracing */ + struct xe_tile *tile; + /** @regs: Map used to access registers. */ void __iomem *regs; diff --git a/drivers/gpu/drm/xe/xe_mmio.c b/drivers/gpu/drm/xe/xe_mmio.c index d271ff45e90c..47b505aa8282 100644 --- a/drivers/gpu/drm/xe/xe_mmio.c +++ b/drivers/gpu/drm/xe/xe_mmio.c @@ -98,6 +98,7 @@ static void mmio_multi_tile_setup(struct xe_device *xe, size_t tile_mmio_size) for_each_tile(tile, xe, id) { tile->mmio.regs_size = SZ_4M; tile->mmio.regs = regs; + tile->mmio.tile = tile; regs += tile_mmio_size; } } @@ -134,6 +135,7 @@ static void mmio_extension_setup(struct xe_device *xe, size_t tile_mmio_size, for_each_tile(tile, xe, id) { tile->mmio_ext.regs_size = tile_mmio_ext_size; tile->mmio_ext.regs = regs; + tile->mmio_ext.tile = tile; regs += tile_mmio_ext_size; } } @@ -179,6 +181,7 @@ int xe_mmio_init(struct xe_device *xe) /* Setup first tile; other tiles (if present) will be setup later. */ root_tile->mmio.regs_size = SZ_4M; root_tile->mmio.regs = xe->mmio.regs; + root_tile->mmio.tile = root_tile; return devm_add_action_or_reset(xe->drm.dev, mmio_fini, xe); } diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c index 935f56c7f457..d68f5685071d 100644 --- a/drivers/gpu/drm/xe/xe_pci.c +++ b/drivers/gpu/drm/xe/xe_pci.c @@ -713,6 +713,7 @@ static int xe_info_init(struct xe_device *xe, gt->info.engine_mask = graphics_desc->hw_engine_mask; gt->mmio.regs = tile->mmio.regs; gt->mmio.regs_size = tile->mmio.regs_size; + gt->mmio.tile = tile; if (MEDIA_VER(xe) < 13 && media_desc) gt->info.engine_mask |= media_desc->hw_engine_mask; @@ -735,6 +736,7 @@ static int xe_info_init(struct xe_device *xe, gt->mmio.regs_size = tile->mmio.regs_size; gt->mmio.adj_offset = MEDIA_GT_GSI_OFFSET; gt->mmio.adj_limit = MEDIA_GT_GSI_LENGTH; + gt->mmio.tile = tile; /* * FIXME: At the moment multi-tile and standalone media are |
