[Intel-xe] [PATCH 3/6] drm/xe: add a flag to bypass multi-tile config from MTCFG reg
Koby Elbaz
kelbaz at habana.ai
Wed Sep 13 09:57:57 UTC 2023
Skip reading this register as it is not relevant in the new devices.
Signed-off-by: Koby Elbaz <kelbaz at habana.ai>
Reviewed-by: Ofir Bitton <obitton at habana.ai>
Reviewed-by: Moti Haimovski <mhaimovski at habana.ai>
---
drivers/gpu/drm/xe/xe_device_types.h | 2 ++
drivers/gpu/drm/xe/xe_mmio.c | 24 +++++++++++++-----------
drivers/gpu/drm/xe/xe_pci.c | 2 ++
3 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
index 5890b63639e7..7b8852c5ea4c 100644
--- a/drivers/gpu/drm/xe/xe_device_types.h
+++ b/drivers/gpu/drm/xe/xe_device_types.h
@@ -250,6 +250,8 @@ struct xe_device {
u8 has_link_copy_engine:1;
/** @enable_display: display enabled */
u8 enable_display:1;
+ /** @bypass_mtcfg: Bypass Multi-Tile configuration from MTCFG register */
+ u8 bypass_mtcfg:1;
#if IS_ENABLED(CONFIG_DRM_XE_DISPLAY)
const struct intel_display_device_info *display;
diff --git a/drivers/gpu/drm/xe/xe_mmio.c b/drivers/gpu/drm/xe/xe_mmio.c
index 3ccc0af4430b..054ad752303f 100644
--- a/drivers/gpu/drm/xe/xe_mmio.c
+++ b/drivers/gpu/drm/xe/xe_mmio.c
@@ -318,26 +318,28 @@ int xe_mmio_probe_vram(struct xe_device *xe)
static void xe_mmio_probe_tiles(struct xe_device *xe)
{
+ u8 adj_tile_count = xe->info.tile_count;
struct xe_gt *gt = xe_root_mmio_gt(xe);
u32 mtcfg;
- u8 adj_tile_count;
u8 id;
if (xe->info.tile_count == 1)
return;
- mtcfg = xe_mmio_read64_2x32(gt, XEHP_MTCFG_ADDR);
- adj_tile_count = xe->info.tile_count =
- REG_FIELD_GET(TILE_COUNT, mtcfg) + 1;
+ if (!xe->info.bypass_mtcfg) {
+ mtcfg = xe_mmio_read64_2x32(gt, XEHP_MTCFG_ADDR);
+ adj_tile_count = xe->info.tile_count =
+ REG_FIELD_GET(TILE_COUNT, mtcfg) + 1;
- /*
- * FIXME: Needs some work for standalone media, but should be impossible
- * with multi-tile for now.
- */
- xe->info.gt_count = xe->info.tile_count;
+ /*
+ * FIXME: Needs some work for standalone media, but should be impossible
+ * with multi-tile for now.
+ */
+ xe->info.gt_count = xe->info.tile_count;
- drm_info(&xe->drm, "tile_count: %d, adj_tile_count %d\n",
- xe->info.tile_count, adj_tile_count);
+ drm_info(&xe->drm, "tile_count: %d, adj_tile_count %d\n",
+ xe->info.tile_count, adj_tile_count);
+ }
if (xe->info.tile_count > 1) {
const int mmio_bar = 0;
diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
index dc233a1226bd..4e7fbabca6a5 100644
--- a/drivers/gpu/drm/xe/xe_pci.c
+++ b/drivers/gpu/drm/xe/xe_pci.c
@@ -59,6 +59,7 @@ struct xe_device_desc {
u8 has_display:1;
u8 has_llc:1;
+ u8 bypass_mtcfg:1;
};
__diag_push();
@@ -565,6 +566,7 @@ static int xe_info_init(struct xe_device *xe,
xe->info.graphics_name = graphics_desc->name;
xe->info.media_name = media_desc ? media_desc->name : "none";
xe->info.has_llc = desc->has_llc;
+ xe->info.bypass_mtcfg = desc->bypass_mtcfg;
xe->info.dma_mask_size = graphics_desc->dma_mask_size;
xe->info.vram_flags = graphics_desc->vram_flags;
--
2.34.1
More information about the Intel-xe
mailing list