loader: move "using driver..." message to loader_get_kernel_driver_name
authorEmil Velikov <emil.velikov@collabora.com>
Thu, 5 Mar 2020 14:30:51 +0000 (14:30 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 1 Apr 2020 15:57:22 +0000 (16:57 +0100)
Move the message to the function which fetches the name.

While here use the same DEBUG/WARNING approach like in the PCI case. The
current method spam a tad much, plus isn't consistent.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4084>

src/loader/loader.c

index a2e726465af87726179e56b07cadb35adfbdbcc7..38d8752e26e6c9eca9b801fd685a05d08be74874 100644 (file)
@@ -111,6 +111,8 @@ static char *loader_get_kernel_driver_name(int fd)
    }
 
    driver = strndup(version->name, version->name_len);
+   log_(driver ? _LOADER_DEBUG : _LOADER_WARNING, "using driver %s for %d\n",
+        driver, fd);
 
    drmFreeVersion(version);
    return driver;
@@ -451,8 +453,6 @@ loader_get_driver_for_fd(int fd)
 
    if (!loader_get_pci_id_for_fd(fd, &vendor_id, &chip_id)) {
       driver = loader_get_kernel_driver_name(fd);
-      if (driver)
-         log_(_LOADER_INFO, "using driver %s for %d\n", driver, fd);
       return driver;
    }