drm/xe: add a flag to bypass multi-tile config from MTCFG reg
authorKoby Elbaz <kelbaz@habana.ai>
Thu, 5 Oct 2023 15:06:16 +0000 (11:06 -0400)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:42:58 +0000 (11:42 -0500)
Skip reading this register as it is not relevant in the new devices.

Signed-off-by: Koby Elbaz <kelbaz@habana.ai>
Reviewed-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Moti Haimovski <mhaimovski@habana.ai>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_device_types.h
drivers/gpu/drm/xe/xe_mmio.c
drivers/gpu/drm/xe/xe_pci.c

index f7c7d44a64652f07333eaa4227427ca768fe14ba..a9bf9c784b7c578cd747c1d84151477fb3201cea 100644 (file)
@@ -243,6 +243,8 @@ struct xe_device {
                u8 has_llc:1;
                /** @has_range_tlb_invalidation: Has range based TLB invalidations */
                u8 has_range_tlb_invalidation:1;
+               /** @bypass_mtcfg: Bypass Multi-Tile configuration from MTCFG register */
+               u8 bypass_mtcfg:1;
        } info;
 
        /** @irq: device interrupt state */
index 3ccc0af4430be4b1dc9da7f850b95fe7c454b1bb..054ad752303f6eb3390a3b8c37e9601b8eab8fb3 100644 (file)
@@ -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;
index 0efe01885cf8beb60d4a2166a0b01e51f3f1064a..f8e813e174580f7f3fd12e76a24e94f8ad1993a4 100644 (file)
@@ -56,6 +56,7 @@ struct xe_device_desc {
        u8 require_force_probe:1;
        u8 is_dgfx:1;
        u8 has_llc:1;
+       u8 bypass_mtcfg:1;
 };
 
 #define PLATFORM(x)            \
@@ -553,6 +554,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;