mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
drm/xe: Move primary GT allocation from xe_tile_init_early to xe_tile_init
During the early days of the Xe driver, there were cases where we accessed some fields in the primary GT's xe_gt structure before the GT itself was formally initialized; this required that the structure itself be allocated during xe_tile_init_early(). A lot of refactoring of the device probe has happened since that time and there's no longer a need to allocate the primary GT early. Move the allocation into xe_info_init() where GT initialization happens and where we're doing the allocation of the media GT. v2: - Only make this change after a separate patch to perform VF GMD_ID lookup with a dummy GT instead of xe_root_mmio_gt(). Cc: Michal Wajdeczko <michal.wajdeczko@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://lore.kernel.org/r/20251013200944.2499947-33-matthew.d.roper@intel.com Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
This commit is contained in:
@@ -774,6 +774,10 @@ static int xe_info_init(struct xe_device *xe,
|
||||
for_each_tile(tile, xe, id) {
|
||||
int err;
|
||||
|
||||
tile->primary_gt = xe_gt_alloc(tile);
|
||||
if (IS_ERR(tile->primary_gt))
|
||||
return PTR_ERR(tile->primary_gt);
|
||||
|
||||
gt = tile->primary_gt;
|
||||
gt->info.type = XE_GT_TYPE_MAIN;
|
||||
gt->info.id = tile->id * xe->info.max_gt_per_tile;
|
||||
|
||||
@@ -157,10 +157,6 @@ int xe_tile_init_early(struct xe_tile *tile, struct xe_device *xe, u8 id)
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
tile->primary_gt = xe_gt_alloc(tile);
|
||||
if (IS_ERR(tile->primary_gt))
|
||||
return PTR_ERR(tile->primary_gt);
|
||||
|
||||
xe_pcode_init(tile);
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user