Lines Matching defs:device
3 * User-level interface to DRM device
676 * domain, b is bus, d is device, f is function.
767 * Open the DRM device, creating it if necessary.
769 * \param dev major and minor numbers of the device.
770 * \param minor minor number of the device.
775 * Assembles the device name from \p minor and opens it, creating the device
814 /* Check if the device node exists and create it if necessary. */
859 /* Check if the device node is not what we expect it to be, and recreate it
886 * Open the DRM device
888 * \param minor device minor number.
889 * \param create allow to create the device if set.
894 * Calls drmOpenDevice() if \p create is set, otherwise assembles the device
1016 * Open the device by bus ID.
1019 * \param type device node type.
1025 * comparing the device bus ID with the one supplied.
1079 * Open the device by name.
1082 * \param type the device node type.
1167 * Open the DRM device.
1169 * Looks up the specified name and bus ID, and opens the device found. The
1187 * Open the DRM device with specified type.
1189 * Looks up the specified name and bus ID, and opens the device found. The
1194 * \param type the device node type to open, PRIMARY, CONTROL or RENDER
1370 * revision 1.1.x = added drmCommand entry points for device extensions
1425 * Get the bus ID of the device.
1456 * Set the bus ID of the device.
1681 * Close the device.
2196 * Acquire the AGP device.
2216 * Release the AGP device.
2550 * Get hardware device ID.
2644 fprintf(stderr, "%s: no device\n", label);
2735 * \param devnum device number.
3015 * Send a device-specific command.
3040 * Send a device-specific read command.
3069 * Send a device-specific write command.
3098 * Send a device-specific read-write command.
3243 * discover the device file name. */
3266 snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device/drm",
3277 * only device nodes in /dev/dri/ */
3373 snprintf(buf, sizeof(buf), "/sys/dev/char/%d:%d/device/drm", maj, min);
3414 * only device nodes in /dev/dri/ */
3563 snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device", maj, min);
3566 /* Try to get the parent (underlying) device type */
3591 snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device", maj, min);
3625 * If it does not, the next DRM device will create card#X and
3776 drmPciDeviceInfoPtr device,
3782 "device",
3808 device->revision_id = ignore_revision ? 0xff : data[0] & 0xff;
3809 device->vendor_id = data[1] & 0xffff;
3810 device->device_id = data[2] & 0xffff;
3811 device->subvendor_id = data[3] & 0xffff;
3812 device->subdevice_id = data[4] & 0xffff;
3818 drmPciDeviceInfoPtr device)
3838 device->vendor_id = config[0] | (config[1] << 8);
3839 device->device_id = config[2] | (config[3] << 8);
3840 device->revision_id = config[8];
3841 device->subvendor_id = config[44] | (config[45] << 8);
3842 device->subdevice_id = config[46] | (config[47] << 8);
3849 drmPciDeviceInfoPtr device,
3854 return parse_separate_sysfs_files(maj, min, device, true);
3856 if (parse_separate_sysfs_files(maj, min, device, false))
3857 return parse_config_sysfs_file(maj, min, device);
3878 device->vendor_id = pinfo.vendor_id;
3879 device->device_id = pinfo.device_id;
3880 device->revision_id = pinfo.revision_id;
3881 device->subvendor_id = pinfo.subvendor_id;
3882 device->subdevice_id = pinfo.subdevice_id;
3920 device->vendor_id = results[0].pc_vendor;
3921 device->device_id = results[0].pc_device;
3922 device->subvendor_id = results[0].pc_subvendor;
3923 device->subdevice_id = results[0].pc_subdevice;
3924 device->revision_id = results[0].pc_revid;
3933 static void drmFreePlatformDevice(drmDevicePtr device)
3935 if (device->deviceinfo.platform) {
3936 if (device->deviceinfo.platform->compatible) {
3937 char **compatible = device->deviceinfo.platform->compatible;
3944 free(device->deviceinfo.platform->compatible);
3949 static void drmFreeHost1xDevice(drmDevicePtr device)
3951 if (device->deviceinfo.host1x) {
3952 if (device->deviceinfo.host1x->compatible) {
3953 char **compatible = device->deviceinfo.host1x->compatible;
3960 free(device->deviceinfo.host1x->compatible);
3965 drm_public void drmFreeDevice(drmDevicePtr *device)
3967 if (device == NULL)
3970 if (*device) {
3971 switch ((*device)->bustype) {
3973 drmFreePlatformDevice(*device);
3977 drmFreeHost1xDevice(*device);
3982 free(*device);
3983 *device = NULL;
4003 drmDevicePtr device;
4010 size = sizeof(*device) + extra + bus_size + device_size;
4012 device = calloc(1, size);
4013 if (!device)
4016 device->available_nodes = 1 << type;
4018 ptr = (char *)device + sizeof(*device);
4019 device->nodes = (char **)ptr;
4024 device->nodes[i] = ptr;
4028 memcpy(device->nodes[type], node, max_node_length);
4032 return device;
4035 static int drmProcessPciDevice(drmDevicePtr *device,
4057 // Fetch the device info if the user has requested it
4067 *device = dev;
4082 snprintf(path, len, "/sys/dev/char/%d:%d/device", maj, min);
4193 static int drmProcessUsbDevice(drmDevicePtr *device, const char *node,
4223 *device = dev;
4237 snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device", maj, min);
4242 /* If the device lacks OF data, pick the MODALIAS info */
4274 snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device", maj, min);
4281 /* Assume one entry if the device lack OF data */
4293 /* If the device lacks OF data, pick the MODALIAS info */
4327 static int drmProcessPlatformDevice(drmDevicePtr *device,
4358 *device = dev;
4367 static int drmProcessHost1xDevice(drmDevicePtr *device,
4398 *device = dev;
4408 process_device(drmDevicePtr *device, const char *d_name,
4438 return drmProcessPciDevice(device, node, node_type, maj, min,
4441 return drmProcessUsbDevice(device, node, node_type, maj, min,
4444 return drmProcessPlatformDevice(device, node, node_type, maj, min,
4447 return drmProcessHost1xDevice(device, node, node_type, maj, min,
4484 drm_device_has_rdev(drmDevicePtr device, dev_t find_rdev)
4489 if (device->available_nodes & 1 << i) {
4490 if (stat(device->nodes[i], &sbuf) == 0 &&
4506 * Get information about a device from its dev_t identifier
4508 * \param find_rdev dev_t identifier of the device
4510 * \param device the address of a drmDevicePtr where the information
4515 drm_public int drmGetDeviceFromDevId(dev_t find_rdev, uint32_t flags, drmDevicePtr *device)
4519 * DRI device nodes on OpenBSD are not in their own directory, they reside
4529 if (device == NULL)
4560 *device = d;
4575 if (device == NULL)
4611 *device = NULL;
4618 *device = local_devices[i];
4624 if (*device == NULL)
4631 * Get information about the opened drm device
4633 * \param fd file descriptor of the drm device
4635 * \param device the address of a drmDevicePtr where the information
4640 * \note Unlike drmGetDevice it does not retrieve the pci device revision field
4643 drm_public int drmGetDevice2(int fd, uint32_t flags, drmDevicePtr *device)
4656 return drmGetDeviceFromDevId(sbuf.st_rdev, flags, device);
4660 * Get information about the opened drm device
4662 * \param fd file descriptor of the drm device
4663 * \param device the address of a drmDevicePtr where the information
4668 drm_public int drmGetDevice(int fd, drmDevicePtr *device)
4670 return drmGetDevice2(fd, DRM_DEVICE_GET_PCI_REVISION, device);
4678 * can be NULL to get the device number first
4686 * \note Unlike drmGetDevices it does not retrieve the pci device revision field
4693 drmDevicePtr device;
4707 ret = process_device(&device, dent->d_name, -1, devices != NULL, flags);
4717 local_devices[i] = device;
4749 * can be NULL to get the device number first