]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/xe: Refactor max_remote_tiles
authorSai Teja Pottumuttu <sai.teja.pottumuttu@intel.com>
Thu, 30 Jan 2025 08:58:04 +0000 (14:28 +0530)
committerMatt Roper <matthew.d.roper@intel.com>
Mon, 3 Feb 2025 21:52:45 +0000 (13:52 -0800)
max_remote_tiles is more related to the platform than the GT IP. Thus
move it to platform descriptor from graphics descriptor. Note that the
FIXME is no more required, thus it can be dropped.

v2: Rebase
v3: Change the position of comment (MattR)

Signed-off-by: Sai Teja Pottumuttu <sai.teja.pottumuttu@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250130085804.4136497-3-sai.teja.pottumuttu@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
drivers/gpu/drm/xe/xe_pci.c
drivers/gpu/drm/xe/xe_pci_types.h

index 38e6ba091ea5f28dae78276d6688fc870a9364ce..cfa1ad7a1f2d3da5a8db9f7763ad68f094400df1 100644 (file)
@@ -56,6 +56,7 @@ struct xe_device_desc {
        enum xe_platform platform;
 
        u8 dma_mask_size;
+       u8 max_remote_tiles:2;
 
        u8 require_force_probe:1;
        u8 is_dgfx:1;
@@ -138,7 +139,6 @@ static const struct xe_graphics_desc graphics_xehpc = {
                BIT(XE_HW_ENGINE_CCS2) | BIT(XE_HW_ENGINE_CCS3),
 
        XE_HP_FEATURES,
-       .max_remote_tiles = 1,
        .va_bits = 57,
        .vm_max_level = 4,
        .vram_flags = XE_VRAM_FLAGS_NEED64K,
@@ -331,6 +331,7 @@ static const __maybe_unused struct xe_device_desc pvc_desc = {
        .dma_mask_size = 52,
        .has_display = false,
        .has_heci_gscfi = 1,
+       .max_remote_tiles = 1,
        .require_force_probe = true,
 };
 
@@ -641,6 +642,7 @@ static int xe_info_init_early(struct xe_device *xe,
        xe->info.probe_display = IS_ENABLED(CONFIG_DRM_XE_DISPLAY) &&
                                 xe_modparam.probe_display &&
                                 desc->has_display;
+       xe->info.tile_count = 1 + desc->max_remote_tiles;
 
        err = xe_tile_init_early(xe_device_get_root_tile(xe), xe, 0);
        if (err)
@@ -707,17 +709,6 @@ static int xe_info_init(struct xe_device *xe,
        xe->info.has_range_tlb_invalidation = graphics_desc->has_range_tlb_invalidation;
        xe->info.has_usm = graphics_desc->has_usm;
 
-       /*
-        * All platforms have at least one primary GT.  Any platform with media
-        * version 13 or higher has an additional dedicated media GT.  And
-        * depending on the graphics IP there may be additional "remote tiles."
-        * All of these together determine the overall GT count.
-        *
-        * FIXME: 'tile_count' here is misnamed since the rest of the driver
-        * treats it as the number of GTs rather than just the number of tiles.
-        */
-       xe->info.tile_count = 1 + graphics_desc->max_remote_tiles;
-
        for_each_remote_tile(tile, xe, id) {
                int err;
 
@@ -726,6 +717,12 @@ static int xe_info_init(struct xe_device *xe,
                        return err;
        }
 
+       /*
+        * All platforms have at least one primary GT.  Any platform with media
+        * version 13 or higher has an additional dedicated media GT.  And
+        * depending on the graphics IP there may be additional "remote tiles."
+        * All of these together determine the overall GT count.
+        */
        for_each_tile(tile, xe, id) {
                gt = tile->primary_gt;
                gt->info.id = xe->info.gt_count++;
index 7437415a54d5421d29c2f4952bcc1845cd12b3c7..b96423844952664ce38592c12a68d680a97e8d6a 100644 (file)
@@ -19,8 +19,6 @@ struct xe_graphics_desc {
 
        u64 hw_engine_mask;     /* hardware engines provided by graphics IP */
 
-       u8 max_remote_tiles:2;
-
        u8 has_asid:1;
        u8 has_atomic_enable_pte_bit:1;
        u8 has_flat_ccs:1;