summaryrefslogtreecommitdiff
path: root/lib/libdrm/xf86drm.h
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2015-12-27 09:16:54 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2015-12-27 09:16:54 +0000
commit46bb4450c74e5481f39141bea53e02c2936456cb (patch)
tree5a06c8b5e50b5ebdfde3615296340a1cf55a370f /lib/libdrm/xf86drm.h
parent5db7cad38be896315e2b897f68d1751d340a2483 (diff)
Merge libdrm 2.4.65
Diffstat (limited to 'lib/libdrm/xf86drm.h')
-rw-r--r--lib/libdrm/xf86drm.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/libdrm/xf86drm.h b/lib/libdrm/xf86drm.h
index 360e04af5..e82ca844c 100644
--- a/lib/libdrm/xf86drm.h
+++ b/lib/libdrm/xf86drm.h
@@ -563,6 +563,8 @@ extern int drmOpen(const char *name, const char *busid);
#define DRM_NODE_PRIMARY 0
#define DRM_NODE_CONTROL 1
#define DRM_NODE_RENDER 2
+#define DRM_NODE_MAX 3
+
extern int drmOpenWithType(const char *name, const char *busid,
int type);
@@ -759,6 +761,38 @@ extern int drmPrimeFDToHandle(int fd, int prime_fd, uint32_t *handle);
extern char *drmGetPrimaryDeviceNameFromFd(int fd);
extern char *drmGetRenderDeviceNameFromFd(int fd);
+#define DRM_BUS_PCI 0
+
+typedef struct _drmPciBusInfo {
+ uint16_t domain;
+ uint8_t bus;
+ uint8_t dev;
+ uint8_t func;
+} drmPciBusInfo, *drmPciBusInfoPtr;
+
+typedef struct _drmPciDeviceInfo {
+ uint16_t vendor_id;
+ uint16_t device_id;
+ uint16_t subvendor_id;
+ uint16_t subdevice_id;
+ uint8_t revision_id;
+} drmPciDeviceInfo, *drmPciDeviceInfoPtr;
+
+typedef struct _drmDevice {
+ char **nodes; /* DRM_NODE_MAX sized array */
+ int available_nodes; /* DRM_NODE_* bitmask */
+ int bustype;
+ union {
+ drmPciBusInfoPtr pci;
+ } businfo;
+ union {
+ drmPciDeviceInfoPtr pci;
+ } deviceinfo;
+} drmDevice, *drmDevicePtr;
+
+extern int drmGetDevices(drmDevicePtr devices[], int max_devices);
+extern void drmFreeDevices(drmDevicePtr devices[], int count);
+
#if defined(__cplusplus)
}
#endif