summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEmil Velikov <emil.velikov@collabora.com>2018-06-25 18:07:49 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2018-07-24 16:27:50 +0100
commit33b035722b8fb30509d893597f1891c00e5c80f9 (patch)
treef97ab921ce3386f064f5419f8d5c9f090066eb01 /tests
parentc64dc00fd96740d2846be1f43956151d75c441eb (diff)
tests/drmdevice: add a couple of printf headers
Add a few printf statements, which should make the output easier to parse. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Tested-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Diffstat (limited to 'tests')
-rw-r--r--tests/drmdevice.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/drmdevice.c b/tests/drmdevice.c
index 9dd5098a..0d75836f 100644
--- a/tests/drmdevice.c
+++ b/tests/drmdevice.c
@@ -112,12 +112,15 @@ main(void)
drmDevicePtr device;
int fd, ret, max_devices;
+ printf("--- Checking the number of DRM device available ---\n");
max_devices = drmGetDevices2(0, NULL, 0);
if (max_devices <= 0) {
printf("drmGetDevices2() has returned %d\n", max_devices);
return -1;
}
+ printf("--- Devices reported %d ---\n", max_devices);
+
devices = calloc(max_devices, sizeof(drmDevicePtr));
if (devices == NULL) {
@@ -125,6 +128,7 @@ main(void)
return -1;
}
+ printf("--- Retrieving devices information (PCI device revision is ignored) ---\n");
ret = drmGetDevices2(0, devices, max_devices);
if (ret < 0) {
printf("drmGetDevices2() returned an error %d\n", ret);
@@ -137,13 +141,14 @@ main(void)
for (int j = 0; j < DRM_NODE_MAX; j++) {
if (devices[i]->available_nodes & 1 << j) {
- printf("Opening device %d node %s\n", i, devices[i]->nodes[j]);
+ printf("--- Opening device node %s ---\n", devices[i]->nodes[j]);
fd = open(devices[i]->nodes[j], O_RDONLY | O_CLOEXEC, 0);
if (fd < 0) {
printf("Failed - %s (%d)\n", strerror(errno), errno);
continue;
}
+ printf("--- Retrieving device info, for node %s ---\n", devices[i]->nodes[j]);
if (drmGetDevice2(fd, DRM_DEVICE_GET_PCI_REVISION, &device) == 0) {
print_device_info(device, i, true);
drmFreeDevice(&device);