Skip to content

Commit f3a3fd2

Browse files
committed
drm/xe/oa: Print hwe to OA unit mapping
Print hwe to OA unit mapping to dmesg, to help debug for current and new platforms. v2: Separate out xe_oa_print_gt_oa_units() (Umesh) Signed-off-by: Ashutosh Dixit <[email protected]> Reviewed-by: Umesh Nerlige Ramappa <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e04dac1 commit f3a3fd2

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

drivers/gpu/drm/xe/xe_oa.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2603,6 +2603,36 @@ static int xe_oa_init_gt(struct xe_gt *gt)
26032603
return 0;
26042604
}
26052605

2606+
static void xe_oa_print_gt_oa_units(struct xe_gt *gt)
2607+
{
2608+
enum xe_hw_engine_id hwe_id;
2609+
struct xe_hw_engine *hwe;
2610+
struct xe_oa_unit *u;
2611+
char buf[256];
2612+
int i, n;
2613+
2614+
for (i = 0; i < gt->oa.num_oa_units; i++) {
2615+
u = &gt->oa.oa_unit[i];
2616+
buf[0] = '\0';
2617+
n = 0;
2618+
2619+
for_each_hw_engine(hwe, gt, hwe_id)
2620+
if (xe_oa_unit_id(hwe) == u->oa_unit_id)
2621+
n += scnprintf(buf + n, sizeof(buf) - n, "%s ", hwe->name);
2622+
2623+
xe_gt_dbg(gt, "oa_unit %d, type %d, Engines: %s\n", u->oa_unit_id, u->type, buf);
2624+
}
2625+
}
2626+
2627+
static void xe_oa_print_oa_units(struct xe_oa *oa)
2628+
{
2629+
struct xe_gt *gt;
2630+
int gt_id;
2631+
2632+
for_each_gt(gt, oa->xe, gt_id)
2633+
xe_oa_print_gt_oa_units(gt);
2634+
}
2635+
26062636
static int xe_oa_init_oa_units(struct xe_oa *oa)
26072637
{
26082638
struct xe_gt *gt;
@@ -2619,6 +2649,8 @@ static int xe_oa_init_oa_units(struct xe_oa *oa)
26192649
return ret;
26202650
}
26212651

2652+
xe_oa_print_oa_units(oa);
2653+
26222654
return 0;
26232655
}
26242656

0 commit comments

Comments
 (0)