drmdevice: convert the tabbed output into a tree
Making the output a little bit easier to parse by human beings. v2: Add extra whitespace (Eric) Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Tested-by: Robert Foss <robert.foss@collabora.com> (v1) Reviewed-by: Robert Foss <robert.foss@collabora.com> (v1) Reviewed-by: Eric Engestrom <eric@engestrom.ch> (v1)main
parent
33b035722b
commit
8a3a8c15e2
|
@ -36,67 +36,66 @@ static void
|
||||||
print_device_info(drmDevicePtr device, int i, bool print_revision)
|
print_device_info(drmDevicePtr device, int i, bool print_revision)
|
||||||
{
|
{
|
||||||
printf("device[%i]\n", i);
|
printf("device[%i]\n", i);
|
||||||
printf("\tavailable_nodes %04x\n", device->available_nodes);
|
printf("+-> available_nodes %#04x\n", device->available_nodes);
|
||||||
printf("\tnodes\n");
|
printf("+-> nodes\n");
|
||||||
for (int j = 0; j < DRM_NODE_MAX; j++)
|
for (int j = 0; j < DRM_NODE_MAX; j++)
|
||||||
if (device->available_nodes & 1 << j)
|
if (device->available_nodes & 1 << j)
|
||||||
printf("\t\tnodes[%d] %s\n", j, device->nodes[j]);
|
printf("| +-> nodes[%d] %s\n", j, device->nodes[j]);
|
||||||
|
|
||||||
printf("\tbustype %04x\n", device->bustype);
|
printf("+-> bustype %04x\n", device->bustype);
|
||||||
printf("\tbusinfo\n");
|
|
||||||
if (device->bustype == DRM_BUS_PCI) {
|
if (device->bustype == DRM_BUS_PCI) {
|
||||||
printf("\t\tpci\n");
|
printf("| +-> pci\n");
|
||||||
printf("\t\t\tdomain\t%04x\n",device->businfo.pci->domain);
|
printf("| +-> domain %04x\n",device->businfo.pci->domain);
|
||||||
printf("\t\t\tbus\t%02x\n", device->businfo.pci->bus);
|
printf("| +-> bus %02x\n", device->businfo.pci->bus);
|
||||||
printf("\t\t\tdev\t%02x\n", device->businfo.pci->dev);
|
printf("| +-> dev %02x\n", device->businfo.pci->dev);
|
||||||
printf("\t\t\tfunc\t%1u\n", device->businfo.pci->func);
|
printf("| +-> func %1u\n", device->businfo.pci->func);
|
||||||
|
|
||||||
printf("\tdeviceinfo\n");
|
printf("+-> deviceinfo\n");
|
||||||
printf("\t\tpci\n");
|
printf(" +-> pci\n");
|
||||||
printf("\t\t\tvendor_id\t%04x\n", device->deviceinfo.pci->vendor_id);
|
printf(" +-> vendor_id %04x\n", device->deviceinfo.pci->vendor_id);
|
||||||
printf("\t\t\tdevice_id\t%04x\n", device->deviceinfo.pci->device_id);
|
printf(" +-> device_id %04x\n", device->deviceinfo.pci->device_id);
|
||||||
printf("\t\t\tsubvendor_id\t%04x\n", device->deviceinfo.pci->subvendor_id);
|
printf(" +-> subvendor_id %04x\n", device->deviceinfo.pci->subvendor_id);
|
||||||
printf("\t\t\tsubdevice_id\t%04x\n", device->deviceinfo.pci->subdevice_id);
|
printf(" +-> subdevice_id %04x\n", device->deviceinfo.pci->subdevice_id);
|
||||||
if (print_revision)
|
if (print_revision)
|
||||||
printf("\t\t\trevision_id\t%02x\n", device->deviceinfo.pci->revision_id);
|
printf(" +-> revision_id %02x\n", device->deviceinfo.pci->revision_id);
|
||||||
else
|
else
|
||||||
printf("\t\t\trevision_id\tIGNORED\n");
|
printf(" +-> revision_id IGNORED\n");
|
||||||
|
|
||||||
} else if (device->bustype == DRM_BUS_USB) {
|
} else if (device->bustype == DRM_BUS_USB) {
|
||||||
printf("\t\tusb\n");
|
printf("| +-> usb\n");
|
||||||
printf("\t\t\tbus\t%03u\n", device->businfo.usb->bus);
|
printf("| +-> bus %03u\n", device->businfo.usb->bus);
|
||||||
printf("\t\t\tdev\t%03u\n", device->businfo.usb->dev);
|
printf("| +-> dev %03u\n", device->businfo.usb->dev);
|
||||||
|
|
||||||
printf("\tdeviceinfo\n");
|
printf("+-> deviceinfo\n");
|
||||||
printf("\t\tusb\n");
|
printf(" +-> usb\n");
|
||||||
printf("\t\t\tvendor\t%04x\n", device->deviceinfo.usb->vendor);
|
printf(" +-> vendor %04x\n", device->deviceinfo.usb->vendor);
|
||||||
printf("\t\t\tproduct\t%04x\n", device->deviceinfo.usb->product);
|
printf(" +-> product %04x\n", device->deviceinfo.usb->product);
|
||||||
} else if (device->bustype == DRM_BUS_PLATFORM) {
|
} else if (device->bustype == DRM_BUS_PLATFORM) {
|
||||||
char **compatible = device->deviceinfo.platform->compatible;
|
char **compatible = device->deviceinfo.platform->compatible;
|
||||||
|
|
||||||
printf("\t\tplatform\n");
|
printf("| +-> platform\n");
|
||||||
printf("\t\t\tfullname\t%s\n", device->businfo.platform->fullname);
|
printf("| +-> fullname\t%s\n", device->businfo.platform->fullname);
|
||||||
|
|
||||||
printf("\tdeviceinfo\n");
|
printf("+-> deviceinfo\n");
|
||||||
printf("\t\tplatform\n");
|
printf(" +-> platform\n");
|
||||||
printf("\t\t\tcompatible\n");
|
printf(" +-> compatible\n");
|
||||||
|
|
||||||
while (*compatible) {
|
while (*compatible) {
|
||||||
printf("\t\t\t\t%s\n", *compatible);
|
printf(" %s\n", *compatible);
|
||||||
compatible++;
|
compatible++;
|
||||||
}
|
}
|
||||||
} else if (device->bustype == DRM_BUS_HOST1X) {
|
} else if (device->bustype == DRM_BUS_HOST1X) {
|
||||||
char **compatible = device->deviceinfo.platform->compatible;
|
char **compatible = device->deviceinfo.platform->compatible;
|
||||||
|
|
||||||
printf("\t\thost1x\n");
|
printf("| +-> host1x\n");
|
||||||
printf("\t\t\tfullname\t%s\n", device->businfo.host1x->fullname);
|
printf("| +-> fullname\t%s\n", device->businfo.host1x->fullname);
|
||||||
|
|
||||||
printf("\tdeviceinfo\n");
|
printf("+-> deviceinfo\n");
|
||||||
printf("\t\tplatform\n");
|
printf(" +-> platform\n");
|
||||||
printf("\t\t\tcompatible\n");
|
printf(" +-> compatible\n");
|
||||||
|
|
||||||
while (*compatible) {
|
while (*compatible) {
|
||||||
printf("\t\t\t\t%s\n", *compatible);
|
printf(" %s\n", *compatible);
|
||||||
compatible++;
|
compatible++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue