Lines Matching defs:device
172 drmDevicePtr devices[MAX_DRM_DEVICES], device;
180 device = devices[i];
182 if ((device->available_nodes & (1 << DRM_NODE_RENDER)) &&
183 (device->bustype == DRM_BUS_PLATFORM)) {
186 fd = loader_open_device(device->nodes[DRM_NODE_RENDER]);
215 loader_get_render_node(dev_t device)
220 if (drmGetDeviceFromDevId(device, 0, &dev_ptr) < 0)
285 static char *drm_construct_id_path_tag(drmDevicePtr device)
289 if (device->bustype == DRM_BUS_PCI) {
291 device->businfo.pci->domain,
292 device->businfo.pci->bus,
293 device->businfo.pci->dev,
294 device->businfo.pci->func) < 0) {
297 } else if (device->bustype == DRM_BUS_PLATFORM ||
298 device->bustype == DRM_BUS_HOST1X) {
301 if (device->bustype == DRM_BUS_PLATFORM)
302 fullname = device->businfo.platform->fullname;
304 fullname = device->businfo.host1x->fullname;
328 static bool drm_device_matches_tag(drmDevicePtr device, const char *prime_tag)
330 char *tag = drm_construct_id_path_tag(device);
344 drmDevicePtr device;
347 if (drmGetDevice2(fd, 0, &device) != 0)
350 tag = drm_construct_id_path_tag(device);
351 drmFreeDevice(&device);
436 loader_get_render_node(dev_t device)
453 drmDevicePtr device;
455 if (drmGetDevice2(fd, 0, &device) != 0) {
456 log_(_LOADER_WARNING, "MESA-LOADER: failed to retrieve device information\n");
460 if (device->bustype != DRM_BUS_PCI) {
461 drmFreeDevice(&device);
462 log_(_LOADER_DEBUG, "MESA-LOADER: device is not located on the PCI bus\n");
466 *vendor_id = device->deviceinfo.pci->vendor_id;
467 *chip_id = device->deviceinfo.pci->device_id;
468 drmFreeDevice(&device);
477 snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device/%s", maj, min, field);
481 /* Probably non-PCI device. */
504 *chip_id = loader_get_linux_pci_field(maj, min, "device");