From: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
Kamil Konieczny <kamil.konieczny@linux.intel.com>,
Andi Shyti <andi.shyti@linux.intel.com>,
Krzysztof Karas <krzysztof.karas@intel.com>,
Krzysztof Niemiec <krzysztof.niemiec@intel.com>,
Sebastian Brzezinka <sebastian.brzezinka@intel.com>,
Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Subject: [PATCH i-g-t 7/7] lib/igt_device_scan: Print GPU upstream port parent/child relations
Date: Wed, 21 Jan 2026 12:42:25 +0100 [thread overview]
Message-ID: <20260121114656.1970684-16-janusz.krzysztofik@linux.intel.com> (raw)
In-Reply-To: <20260121114656.1970684-9-janusz.krzysztofik@linux.intel.com>
In a short listing, information about PCI parents of DRM devices, as well
as about DRM children of PCI GPU devices is now printed. In a long
listing in turn, the latter is also printed. Apply a similar approach to
PCIe bridge upstream ports: print information about their PCI GPU children
and also their codenames in both formats, and inform about upstream ports
of PCIe bridges found on PCI discrete GPU cards in the short format.
Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
---
lib/igt_device_scan.c | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/lib/igt_device_scan.c b/lib/igt_device_scan.c
index e86da001a9..69ea8d2eaf 100644
--- a/lib/igt_device_scan.c
+++ b/lib/igt_device_scan.c
@@ -250,6 +250,8 @@ struct igt_device {
char *codename; /* For grouping by codename */
enum dev_type dev_type; /* For grouping by integrated/discrete */
+ char *pci_gpu; /* Filled for upstream bridge ports */
+
struct igt_list_head link;
};
@@ -1058,6 +1060,9 @@ static void update_or_add_parent(struct udev *udev,
igt_assert(bridge_idev);
bridge_idev->dev_type = DEVTYPE_BRIDGE;
+ bridge_idev->pci_gpu = parent_idev->pci_slot_name;
+ bridge_idev->codename = parent_idev->codename;
+ parent_idev->parent = bridge_idev;
}
static struct igt_device *duplicate_device(struct igt_device *dev) {
@@ -1316,8 +1321,11 @@ igt_devs_print_simple(struct igt_list_head *view,
if (is_pci_subsystem(dev)) {
_pr_simple("vendor", dev->vendor);
_pr_simple("device", dev->device);
- if (dev->dev_type != DEVTYPE_BRIDGE)
- _pr_simple("codename", dev->codename);
+ if (dev->pci_gpu)
+ _pr_simple("GPU device", dev->pci_gpu);
+ _pr_simple("codename", dev->codename);
+ if (dev->parent && dev->parent->pci_slot_name)
+ _pr_simple("upstream port", dev->parent->pci_slot_name);
}
}
printf("\n");
@@ -1469,9 +1477,13 @@ igt_devs_print_detail(struct igt_list_head *view,
igt_list_for_each_entry(dev, view, link) {
printf("========== %s:%s ==========\n",
dev->subsystem, dev->syspath);
- if (!is_drm_subsystem(dev) && dev->dev_type != DEVTYPE_BRIDGE) {
- _print_key_value("card device", dev->drm_card);
- _print_key_value("render device", dev->drm_render);
+ if (!is_drm_subsystem(dev)) {
+ if (dev->dev_type != DEVTYPE_BRIDGE) {
+ _print_key_value("card device", dev->drm_card);
+ _print_key_value("render device", dev->drm_render);
+ } else {
+ _print_key_value("GPU device", dev->pci_gpu);
+ }
_print_key_value("codename", dev->codename);
}
--
2.52.0
next prev parent reply other threads:[~2026-01-21 11:48 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-21 11:42 [PATCH i-g-t 0/7] lsgpu: Report upstream port link bandwidth Janusz Krzysztofik
2026-01-21 11:42 ` [PATCH i-g-t 1/7] lib/igt_device_scan: Don't print fake link bandwidth attributes Janusz Krzysztofik
2026-01-23 11:01 ` Sebastian Brzezinka
2026-01-23 14:10 ` Janusz Krzysztofik
2026-01-23 14:20 ` Sebastian Brzezinka
2026-01-23 14:42 ` Janusz Krzysztofik
2026-01-23 14:59 ` Sebastian Brzezinka
2026-01-21 11:42 ` [PATCH i-g-t 2/7] lib/igt_device_scan: Split out reusable part of update_or_add_parent Janusz Krzysztofik
2026-01-23 11:02 ` Sebastian Brzezinka
2026-01-21 11:42 ` [PATCH i-g-t 3/7] lib/igt_device_scan: Include PCIe bridge upstream port if available Janusz Krzysztofik
2026-01-23 11:02 ` Sebastian Brzezinka
2026-01-23 14:22 ` Janusz Krzysztofik
2026-01-21 11:42 ` [PATCH i-g-t 4/7] lib/igt_device_scan: List PCIe bridge ports after their children Janusz Krzysztofik
2026-01-23 11:02 ` Sebastian Brzezinka
2026-01-21 11:42 ` [PATCH i-g-t 5/7] lib/igt_device_scan: Omit AER statistics data from attributes Janusz Krzysztofik
2026-01-21 11:42 ` [PATCH i-g-t 6/7] lib/igt_device_scan: Don't print bridge not applicable attributes Janusz Krzysztofik
2026-01-23 11:03 ` Sebastian Brzezinka
2026-01-23 14:29 ` Janusz Krzysztofik
2026-01-21 11:42 ` Janusz Krzysztofik [this message]
2026-01-23 11:03 ` [PATCH i-g-t 7/7] lib/igt_device_scan: Print GPU upstream port parent/child relations Sebastian Brzezinka
2026-01-23 14:34 ` Janusz Krzysztofik
2026-01-26 12:56 ` Janusz Krzysztofik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260121114656.1970684-16-janusz.krzysztofik@linux.intel.com \
--to=janusz.krzysztofik@linux.intel.com \
--cc=andi.shyti@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=kamil.konieczny@linux.intel.com \
--cc=krzysztof.karas@intel.com \
--cc=krzysztof.niemiec@intel.com \
--cc=sebastian.brzezinka@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox