#if defined(HAVE_LIBDRM)
-static int
+static bool
drm_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id)
{
drmDevicePtr device;
- int ret;
+ bool ret;
if (drmGetDevice2(fd, 0, &device) == 0) {
if (device->bustype == DRM_BUS_PCI) {
*vendor_id = device->deviceinfo.pci->vendor_id;
*chip_id = device->deviceinfo.pci->device_id;
- ret = 1;
+ ret = true;
}
else {
log_(_LOADER_DEBUG, "MESA-LOADER: device is not located on the PCI bus\n");
- ret = 0;
+ ret = false;
}
drmFreeDevice(&device);
}
else {
log_(_LOADER_WARNING, "MESA-LOADER: failed to retrieve device information\n");
- ret = 0;
+ ret = false;
}
return ret;
#endif
-int
+bool
loader_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id)
{
#if HAVE_LIBDRM
- if (drm_get_pci_id_for_fd(fd, vendor_id, chip_id))
- return 1;
+ return drm_get_pci_id_for_fd(fd, vendor_id, chip_id);
#endif
- return 0;
+ return false;
}
char *