Skip to content

Commit 76293a8

Browse files
committed
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 <[email protected]> Reviewed-by: Piotr Piórkowski <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 73c0e80 commit 76293a8

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

drivers/gpu/drm/xe/xe_gsc_proxy.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "xe_map.h"
2424
#include "xe_mmio.h"
2525
#include "xe_pm.h"
26+
#include "xe_tile.h"
2627

2728
/*
2829
* GSC proxy:
@@ -483,7 +484,7 @@ int xe_gsc_proxy_init(struct xe_gsc *gsc)
483484
}
484485

485486
/* no multi-tile devices with this feature yet */
486-
if (tile->id > 0) {
487+
if (!xe_tile_is_root(tile)) {
487488
xe_gt_err(gt, "unexpected GSC proxy init on tile %u\n", tile->id);
488489
return -EINVAL;
489490
}

drivers/gpu/drm/xe/xe_irq.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "xe_mmio.h"
2424
#include "xe_pxp.h"
2525
#include "xe_sriov.h"
26+
#include "xe_tile.h"
2627

2728
/*
2829
* Interrupt registers for a unit are always consecutive and ordered
@@ -552,7 +553,7 @@ static void xelp_irq_reset(struct xe_tile *tile)
552553

553554
static void dg1_irq_reset(struct xe_tile *tile)
554555
{
555-
if (tile->id == 0)
556+
if (xe_tile_is_root(tile))
556557
dg1_intr_disable(tile_to_xe(tile));
557558

558559
gt_irq_reset(tile);

drivers/gpu/drm/xe/xe_tile.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,10 @@ static inline struct drm_pagemap *xe_tile_local_pagemap(struct xe_tile *tile)
2727
return NULL;
2828
}
2929
#endif
30+
31+
static inline bool xe_tile_is_root(struct xe_tile *tile)
32+
{
33+
return tile->id == 0;
34+
}
35+
3036
#endif

0 commit comments

Comments
 (0)