In addition to properties and attributes obtained from udev, print functions also list some library specific attributes: drm_card, drm_render and codename. Those not necessarily make sense for PCIe bridge upstream ports that follow their PCI GPU devices on the listing. Skip them.
Signed-off-by: Janusz Krzysztofik <[email protected]> --- lib/igt_device_scan.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/igt_device_scan.c b/lib/igt_device_scan.c index 7c58ab84e8..e86da001a9 100644 --- a/lib/igt_device_scan.c +++ b/lib/igt_device_scan.c @@ -204,6 +204,7 @@ enum dev_type { DEVTYPE_ALL, DEVTYPE_INTEGRATED, DEVTYPE_DISCRETE, + DEVTYPE_BRIDGE, }; #define STR_INTEGRATED "integrated" @@ -1055,6 +1056,8 @@ static void update_or_add_parent(struct udev *udev, bridge_idev = find_or_add_igt_device(udev, bridge_dev, limit_attrs); igt_assert(bridge_idev); + + bridge_idev->dev_type = DEVTYPE_BRIDGE; } static struct igt_device *duplicate_device(struct igt_device *dev) { @@ -1313,7 +1316,8 @@ igt_devs_print_simple(struct igt_list_head *view, if (is_pci_subsystem(dev)) { _pr_simple("vendor", dev->vendor); _pr_simple("device", dev->device); - _pr_simple("codename", dev->codename); + if (dev->dev_type != DEVTYPE_BRIDGE) + _pr_simple("codename", dev->codename); } } printf("\n"); @@ -1465,7 +1469,7 @@ 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)) { + 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); _print_key_value("codename", dev->codename); -- 2.52.0
