Skip to content

Commit 79e9cd5

Browse files
drm/i915/debugfs: add rcs topology entry
While the end goal is to make this information available to userspace through a new ioctl, there is no reason we can't display it in a human readable fashion through debugfs. slice0: 3 subslice(s) (0x7): subslice0: 8 EUs (0xff) subslice1: 8 EUs (0xff) subslice2: 8 EUs (0xff) subslice3: 0 EUs (0x0) slice1: 3 subslice(s) (0x7): subslice0: 8 EUs (0xff) subslice1: 8 EUs (0xff) subslice2: 8 EUs (0xff) subslice3: 0 EUs (0x0) slice2: 3 subslice(s) (0x7): subslice0: 8 EUs (0xff) subslice1: 8 EUs (0xff) subslice2: 8 EUs (0xff) subslice3: 0 EUs (0x0) v2: Reformat debugfs printing (Tvrtko) Use the new EU mask helper (Tvrtko) v3: Move printing code to intel_device_info.c to be shared with error state (Michal) v4: Bump u8 to u16 when using sseu_get_eus() (Lionel) Suggested-by: Chris Wilson <[email protected]> Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Tvrtko Ursulin <[email protected]> Acked-by: Chris Wilson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent b3e7f86 commit 79e9cd5

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

drivers/gpu/drm/i915/i915_debugfs.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3201,6 +3201,16 @@ static int i915_engine_info(struct seq_file *m, void *unused)
32013201
return 0;
32023202
}
32033203

3204+
static int i915_rcs_topology(struct seq_file *m, void *unused)
3205+
{
3206+
struct drm_i915_private *dev_priv = node_to_i915(m->private);
3207+
struct drm_printer p = drm_seq_file_printer(m);
3208+
3209+
intel_device_info_dump_topology(&INTEL_INFO(dev_priv)->sseu, &p);
3210+
3211+
return 0;
3212+
}
3213+
32043214
static int i915_shrinker_info(struct seq_file *m, void *unused)
32053215
{
32063216
struct drm_i915_private *i915 = node_to_i915(m->private);
@@ -4733,6 +4743,7 @@ static const struct drm_info_list i915_debugfs_list[] = {
47334743
{"i915_dmc_info", i915_dmc_info, 0},
47344744
{"i915_display_info", i915_display_info, 0},
47354745
{"i915_engine_info", i915_engine_info, 0},
4746+
{"i915_rcs_topology", i915_rcs_topology, 0},
47364747
{"i915_shrinker_info", i915_shrinker_info, 0},
47374748
{"i915_shared_dplls_info", i915_shared_dplls_info, 0},
47384749
{"i915_dp_mst_info", i915_dp_mst_info, 0},

drivers/gpu/drm/i915/intel_device_info.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,30 @@ void intel_device_info_dump(const struct intel_device_info *info,
124124
intel_device_info_dump_flags(info, p);
125125
}
126126

127+
void intel_device_info_dump_topology(const struct sseu_dev_info *sseu,
128+
struct drm_printer *p)
129+
{
130+
int s, ss;
131+
132+
if (sseu->max_slices == 0) {
133+
drm_printf(p, "Unavailable\n");
134+
return;
135+
}
136+
137+
for (s = 0; s < sseu->max_slices; s++) {
138+
drm_printf(p, "slice%d: %u subslice(s) (0x%hhx):\n",
139+
s, hweight8(sseu->subslice_mask[s]),
140+
sseu->subslice_mask[s]);
141+
142+
for (ss = 0; ss < sseu->max_subslices; ss++) {
143+
u16 enabled_eus = sseu_get_eus(sseu, s, ss);
144+
145+
drm_printf(p, "\tsubslice%d: %u EUs (0x%hx)\n",
146+
ss, hweight16(enabled_eus), enabled_eus);
147+
}
148+
}
149+
}
150+
127151
static u16 compute_eu_total(const struct sseu_dev_info *sseu)
128152
{
129153
u16 i, total = 0;

drivers/gpu/drm/i915/intel_device_info.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ void intel_device_info_dump_flags(const struct intel_device_info *info,
244244
struct drm_printer *p);
245245
void intel_device_info_dump_runtime(const struct intel_device_info *info,
246246
struct drm_printer *p);
247+
void intel_device_info_dump_topology(const struct sseu_dev_info *sseu,
248+
struct drm_printer *p);
247249

248250
void intel_driver_caps_print(const struct intel_driver_caps *caps,
249251
struct drm_printer *p);

0 commit comments

Comments
 (0)