Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe: Introduce xe_tile_is_root helper

Instead of looking at the tile->id member provide a small helper
to explicitly express our intentions.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
Link: https://lore.kernel.org/r/20250713103625.1964-4-michal.wajdeczko@intel.com

+10 -2
+2 -1
drivers/gpu/drm/xe/xe_gsc_proxy.c
··· 23 23 #include "xe_map.h" 24 24 #include "xe_mmio.h" 25 25 #include "xe_pm.h" 26 + #include "xe_tile.h" 26 27 27 28 /* 28 29 * GSC proxy: ··· 484 483 } 485 484 486 485 /* no multi-tile devices with this feature yet */ 487 - if (tile->id > 0) { 486 + if (!xe_tile_is_root(tile)) { 488 487 xe_gt_err(gt, "unexpected GSC proxy init on tile %u\n", tile->id); 489 488 return -EINVAL; 490 489 }
+2 -1
drivers/gpu/drm/xe/xe_irq.c
··· 23 23 #include "xe_mmio.h" 24 24 #include "xe_pxp.h" 25 25 #include "xe_sriov.h" 26 + #include "xe_tile.h" 26 27 27 28 /* 28 29 * Interrupt registers for a unit are always consecutive and ordered ··· 553 552 554 553 static void dg1_irq_reset(struct xe_tile *tile) 555 554 { 556 - if (tile->id == 0) 555 + if (xe_tile_is_root(tile)) 557 556 dg1_intr_disable(tile_to_xe(tile)); 558 557 559 558 gt_irq_reset(tile);
+6
drivers/gpu/drm/xe/xe_tile.h
··· 27 27 return NULL; 28 28 } 29 29 #endif 30 + 31 + static inline bool xe_tile_is_root(struct xe_tile *tile) 32 + { 33 + return tile->id == 0; 34 + } 35 + 30 36 #endif