diff options
author | Tvrtko Ursulin <tvrtko.ursulin@intel.com> | 2020-11-16 17:26:52 +0000 |
---|---|---|
committer | Tvrtko Ursulin <tvrtko.ursulin@intel.com> | 2020-11-17 09:30:03 +0000 |
commit | 07b4ced12f9842bee06e0677afe2b65456211718 (patch) | |
tree | bc0287a577602f76b03da39b4aa329a5f09c4af9 /lib/igt_device_scan.h | |
parent | 402e43dacb86f19a5c5ec7cd3dc2fff3b758e966 (diff) |
lsgpu: Add filter type print-out selection
In the previous patch we switched the lsgpu output to a short and user
friendly format but some users will need a shorthand for getting other
types of device selection filters than the defaut drm.
Add some command line switches to enable this:
$ lsgpu
card0 8086:193B drm:/dev/dri/card0
└─renderD128 drm:/dev/dri/renderD128
$ lsgpu --sysfs
card0 8086:193B sys:/sys/devices/pci0000:00/0000:00:02.0/drm/card0
└─renderD128 sys:/sys/devices/pci0000:00/0000:00:02.0/drm/renderD128
$ lsgpu --pci
card0 8086:193B pci:vendor=8086,device=193B,card=0
└─renderD128
v2:
* Fix pci filter format.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Suggested-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Diffstat (limited to 'lib/igt_device_scan.h')
-rw-r--r-- | lib/igt_device_scan.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/igt_device_scan.h b/lib/igt_device_scan.h index 9822c22c..bb4be723 100644 --- a/lib/igt_device_scan.h +++ b/lib/igt_device_scan.h @@ -35,11 +35,22 @@ #include <unistd.h> enum igt_devices_print_type { - IGT_PRINT_SIMPLE, + IGT_PRINT_SIMPLE = 0, IGT_PRINT_DETAIL, IGT_PRINT_USER, /* End user friendly. */ }; +enum igt_devices_print_option { + IGT_PRINT_DRM = 0, + IGT_PRINT_SYSFS, + IGT_PRINT_PCI, +}; + +struct igt_devices_print_format { + enum igt_devices_print_type type; + enum igt_devices_print_option option; +}; + #define INTEGRATED_I915_GPU_PCI_ID "0000:00:02.0" #define PCI_SLOT_NAME_SIZE 12 struct igt_device_card { @@ -51,7 +62,7 @@ struct igt_device_card { void igt_devices_scan(bool force); -void igt_devices_print(enum igt_devices_print_type printtype); +void igt_devices_print(const struct igt_devices_print_format *fmt); void igt_devices_print_vendors(void); void igt_device_print_filter_types(void); |