summaryrefslogtreecommitdiff
path: root/lib/drmtest.h
diff options
context:
space:
mode:
authorZbigniew Kempczyński <zbigniew.kempczynski@intel.com>2019-10-24 14:05:14 +0300
committerArkadiusz Hiler <arkadiusz.hiler@intel.com>2019-12-04 13:26:53 +0200
commit8616126e809bbd94df7581599e4ee030742c3781 (patch)
tree3062f264e09629da6611dce61cee53bb87dbdcb5 /lib/drmtest.h
parent97fe403ac98b82d33280850b5ba18ee22686a678 (diff)
Introduce device selection lsgpu tool
Tool uses device selection API to scan and display GPU devices. It can be used to check filter correctness as well as order of applying the filters (.igtrc, IGT_DEVICE and --device argument). v2 (Arek): * don't print chip as it's no longer there * make it a second patch, before any alterations to igt_core or drmtest * use only a single filter v3 (Arek): * use igt_load_igtrc() (Petri) * add usage example (Chris) * general logic cleanup LONG EXAMPLE: $ ./build/tools/lsgpu --help usage: lsgpu [options] Options: -p, --print-details Print devices with details -v, --list-vendors List recognized vendors -l, --list-filter-types List registered device filters types -d, --device filter Device filter, can be given multiple times -h, --help Show this help message and exit $ ./build/tools/lsgpu sys:/sys/devices/pci0000:00/0000:00:02.0/drm/card0 subsystem : drm drm card : /dev/dri/card0 parent : sys:/sys/devices/pci0000:00/0000:00:02.0 sys:/sys/devices/pci0000:00/0000:00:02.0/drm/renderD128 subsystem : drm drm render : /dev/dri/renderD128 parent : sys:/sys/devices/pci0000:00/0000:00:02.0 sys:/sys/devices/platform/vgem/drm/card1 subsystem : drm drm card : /dev/dri/card1 parent : sys:/sys/devices/platform/vgem sys:/sys/devices/platform/vgem/drm/renderD129 subsystem : drm drm render : /dev/dri/renderD129 parent : sys:/sys/devices/platform/vgem sys:/sys/devices/pci0000:00/0000:00:02.0 subsystem : pci drm card : /dev/dri/card0 drm render : /dev/dri/renderD128 vendor : 8086 device : 5927 sys:/sys/devices/platform/vgem subsystem : platform drm card : /dev/dri/card1 drm render : /dev/dri/renderD129 $ ./build/tools/lsgpu -l Filter types: --- filter syntax --- sys sys:/sys/devices/pci0000:00/0000:00:02.0 find device by its sysfs path drm drm:/dev/dri/* path find drm device by /dev/dri/* node pci pci:[vendor=%04x/name][,device=%04x][,card=%d] vendor is hex number or vendor name $ ./build/tools/lsgpu -d pci:vendor=Intel Notice: Using --device filters === Device filter === pci:vendor=Intel === Testing device open === Device detail: subsystem : pci drm card : /dev/dri/card0 drm render : /dev/dri/renderD128 Device /dev/dri/card0 successfully opened Device /dev/dri/renderD128 successfully opened ------------------------------------------- $ ./build/tools/lsgpu -d pci:vendor=intel Notice: Using --device filters === Device filter === pci:vendor=intel === Testing device open === Device detail: subsystem : pci drm card : /dev/dri/card0 drm render : /dev/dri/renderD128 Device /dev/dri/card0 successfully opened Device /dev/dri/renderD128 successfully opened ------------------------------------------- $ ./build/tools/lsgpu -d pci:vendor=intel -p Notice: Using --device filters === Device filter === pci:vendor=intel === Testing device open === Device detail: subsystem : pci drm card : /dev/dri/card0 drm render : /dev/dri/renderD128 Device /dev/dri/card0 successfully opened Device /dev/dri/renderD128 successfully opened ========== pci:/sys/devices/pci0000:00/0000:00:02.0 ========== card device : /dev/dri/card0 render device : /dev/dri/renderD128 [properties] DEVPATH : /devices/pci0000:00/0000:00:02.0 DRIVER : i915 FWUPD_GUID : 0x8086:0x5927 ID_MODEL_FROM_DATABASE : Iris Plus Graphics 650 ID_PCI_CLASS_FROM_DATABASE : Display controller ID_PCI_INTERFACE_FROM_DATABASE : VGA controller ID_PCI_SUBCLASS_FROM_DATABASE : VGA compatible controller ID_VENDOR_FROM_DATABASE : Intel Corporation MODALIAS : pci:v00008086d00005927sv00008086sd00002068bc03sc00i00 PCI_CLASS : 30000 PCI_ID : 8086:5927 PCI_SLOT_NAME : 0000:00:02.0 PCI_SUBSYS_ID : 8086:2068 SUBSYSTEM : pci USEC_INITIALIZED : 22881171 [attributes] ari_enabled : 0 boot_vga : 1 broken_parity_status : 0 class : 0x030000 consistent_dma_mask_bits : 39 current_link_speed : Unknown speed current_link_width : 0 d3cold_allowed : 1 device : 0x5927 dma_mask_bits : 39 driver_override : (null) enable : 1 firmware_node : LNXVIDEO:00 index : 1 irq : 129 label : CPU local_cpulist : 0-3 local_cpus : f max_link_speed : Unknown speed max_link_width : 255 msi_bus : 1 numa_node : -1 revision : 0x06 subsystem : pci subsystem_device : 0x2068 subsystem_vendor : 0x8086 vendor : 0x8086 ------------------------------------------- Cc: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'lib/drmtest.h')
0 files changed, 0 insertions, 0 deletions