aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Reding2016-12-21 10:59:04 -0600
committerThierry Reding2017-01-20 09:27:20 -0600
commit7b1f37f474d6bdf09b0a7f17bdb89398dbcf0c74 (patch)
tree58f4d7cbadc43648b2a063ab1b013f50253a4dcf /xf86drm.h
parentf8484ccbd12ba33ea5b3895efb7a39d986271be0 (diff)
downloadexternal-libdrm-7b1f37f474d6bdf09b0a7f17bdb89398dbcf0c74.tar.gz
external-libdrm-7b1f37f474d6bdf09b0a7f17bdb89398dbcf0c74.tar.xz
external-libdrm-7b1f37f474d6bdf09b0a7f17bdb89398dbcf0c74.zip
xf86drm: Add platform and host1x bus support
ARM SoCs usually have their DRM/KMS devices on the platform bus, so add support for that to enable these devices to be used with the drmDevice infrastructure. NVIDIA Tegra SoCs have an additional level in the hierarchy and DRM/KMS devices can also be on the host1x bus. This is mostly equivalent to the platform bus. v4: - continue on error to process platform or host1x device v3: - guard Linux-specific sysfs parsing code with #ifdef __linux__ v2: - be careful not to overflow the full name - read compatible strings into device info Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'xf86drm.h')
-rw-r--r--xf86drm.h30
1 files changed, 28 insertions, 2 deletions
diff --git a/xf86drm.h b/xf86drm.h
index 65d53219..0d927018 100644
--- a/xf86drm.h
+++ b/xf86drm.h
@@ -766,8 +766,10 @@ extern int drmPrimeFDToHandle(int fd, int prime_fd, uint32_t *handle);
766extern char *drmGetPrimaryDeviceNameFromFd(int fd); 766extern 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#define DRM_BUS_USB 1
771#define DRM_BUS_PLATFORM 2
772#define DRM_BUS_HOST1X 3
771 773
772typedef struct _drmPciBusInfo { 774typedef struct _drmPciBusInfo {
773 uint16_t domain; 775 uint16_t domain;
@@ -794,6 +796,26 @@ typedef struct _drmUsbDeviceInfo {
794 uint16_t product; 796 uint16_t product;
795} drmUsbDeviceInfo, *drmUsbDeviceInfoPtr; 797} drmUsbDeviceInfo, *drmUsbDeviceInfoPtr;
796 798
799#define DRM_PLATFORM_DEVICE_NAME_LEN 512
800
801typedef struct _drmPlatformBusInfo {
802 char fullname[DRM_PLATFORM_DEVICE_NAME_LEN];
803} drmPlatformBusInfo, *drmPlatformBusInfoPtr;
804
805typedef struct _drmPlatformDeviceInfo {
806 char **compatible; /* NULL terminated list of compatible strings */
807} drmPlatformDeviceInfo, *drmPlatformDeviceInfoPtr;
808
809#define DRM_HOST1X_DEVICE_NAME_LEN 512
810
811typedef struct _drmHost1xBusInfo {
812 char fullname[DRM_HOST1X_DEVICE_NAME_LEN];
813} drmHost1xBusInfo, *drmHost1xBusInfoPtr;
814
815typedef struct _drmHost1xDeviceInfo {
816 char **compatible; /* NULL terminated list of compatible strings */
817} drmHost1xDeviceInfo, *drmHost1xDeviceInfoPtr;
818
797typedef struct _drmDevice { 819typedef struct _drmDevice {
798 char **nodes; /* DRM_NODE_MAX sized array */ 820 char **nodes; /* DRM_NODE_MAX sized array */
799 int available_nodes; /* DRM_NODE_* bitmask */ 821 int available_nodes; /* DRM_NODE_* bitmask */
@@ -801,10 +823,14 @@ typedef struct _drmDevice {
801 union { 823 union {
802 drmPciBusInfoPtr pci; 824 drmPciBusInfoPtr pci;
803 drmUsbBusInfoPtr usb; 825 drmUsbBusInfoPtr usb;
826 drmPlatformBusInfoPtr platform;
827 drmHost1xBusInfoPtr host1x;
804 } businfo; 828 } businfo;
805 union { 829 union {
806 drmPciDeviceInfoPtr pci; 830 drmPciDeviceInfoPtr pci;
807 drmUsbDeviceInfoPtr usb; 831 drmUsbDeviceInfoPtr usb;
832 drmPlatformDeviceInfoPtr platform;
833 drmHost1xDeviceInfoPtr host1x;
808 } deviceinfo; 834 } deviceinfo;
809} drmDevice, *drmDevicePtr; 835} drmDevice, *drmDevicePtr;
810 836