aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Reding2016-12-21 17:39:36 -0600
committerThierry Reding2017-01-20 09:25:53 -0600
commitf8484ccbd12ba33ea5b3895efb7a39d986271be0 (patch)
tree842d2450df0e3f9751d0c9253f4eab1342e36e89 /xf86drm.h
parent2e57bba870399926e1a0d0be3f4918a0a8432474 (diff)
downloadexternal-libdrm-f8484ccbd12ba33ea5b3895efb7a39d986271be0.tar.gz
external-libdrm-f8484ccbd12ba33ea5b3895efb7a39d986271be0.tar.xz
external-libdrm-f8484ccbd12ba33ea5b3895efb7a39d986271be0.zip
xf86drm: Add USB support
Allow DRM/KMS devices hosted on USB to be detected by the drmDevice infrastructure. v4: - continue on error to process USB devices v3: - guard Linux-specific sysfs parsing code with #ifdef __linux__ v2: - make sysfs_uevent_get() more flexible using a format string Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'xf86drm.h')
-rw-r--r--xf86drm.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/xf86drm.h b/xf86drm.h
index b340fc46..65d53219 100644
--- a/xf86drm.h
+++ b/xf86drm.h
@@ -767,6 +767,7 @@ extern char *drmGetPrimaryDeviceNameFromFd(int fd);
767extern char *drmGetRenderDeviceNameFromFd(int fd); 767extern char *drmGetRenderDeviceNameFromFd(int fd);
768 768
769#define DRM_BUS_PCI 0 769#define DRM_BUS_PCI 0
770#define DRM_BUS_USB 1
770 771
771typedef struct _drmPciBusInfo { 772typedef struct _drmPciBusInfo {
772 uint16_t domain; 773 uint16_t domain;
@@ -783,15 +784,27 @@ typedef struct _drmPciDeviceInfo {
783 uint8_t revision_id; 784 uint8_t revision_id;
784} drmPciDeviceInfo, *drmPciDeviceInfoPtr; 785} drmPciDeviceInfo, *drmPciDeviceInfoPtr;
785 786
787typedef struct _drmUsbBusInfo {
788 uint8_t bus;
789 uint8_t dev;
790} drmUsbBusInfo, *drmUsbBusInfoPtr;
791
792typedef struct _drmUsbDeviceInfo {
793 uint16_t vendor;
794 uint16_t product;
795} drmUsbDeviceInfo, *drmUsbDeviceInfoPtr;
796
786typedef struct _drmDevice { 797typedef struct _drmDevice {
787 char **nodes; /* DRM_NODE_MAX sized array */ 798 char **nodes; /* DRM_NODE_MAX sized array */
788 int available_nodes; /* DRM_NODE_* bitmask */ 799 int available_nodes; /* DRM_NODE_* bitmask */
789 int bustype; 800 int bustype;
790 union { 801 union {
791 drmPciBusInfoPtr pci; 802 drmPciBusInfoPtr pci;
803 drmUsbBusInfoPtr usb;
792 } businfo; 804 } businfo;
793 union { 805 union {
794 drmPciDeviceInfoPtr pci; 806 drmPciDeviceInfoPtr pci;
807 drmUsbDeviceInfoPtr usb;
795 } deviceinfo; 808 } deviceinfo;
796} drmDevice, *drmDevicePtr; 809} drmDevice, *drmDevicePtr;
797 810