summaryrefslogtreecommitdiffstats
path: root/xf86drm.h
diff options
context:
space:
mode:
authorfrank <frank.min@amd.com>2015-05-19 23:31:05 +0800
committerAlex Deucher <alexander.deucher@amd.com>2015-05-26 12:34:38 -0400
commitfde4969176822fe54197b6baa78f8b0ef900baba (patch)
treeeb871767cb97b444fb88556913534dabac03d42e /xf86drm.h
parentbb0b97e673c89547f5a8ebe47c6e2268f8bfb85d (diff)
downloadexternal_libdrm-fde4969176822fe54197b6baa78f8b0ef900baba.tar.gz
external_libdrm-fde4969176822fe54197b6baa78f8b0ef900baba.tar.bz2
external_libdrm-fde4969176822fe54197b6baa78f8b0ef900baba.zip
Add device enumeration interface (v4)
Add an interface for enumerating PCI devices on a system. v3: switch to udev/sysfs for the enumeration v4: fix warnings Signed-off-by: Frank Min <frank.min@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Diffstat (limited to 'xf86drm.h')
-rw-r--r--xf86drm.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/xf86drm.h b/xf86drm.h
index 40c55c92e..2610934fe 100644
--- a/xf86drm.h
+++ b/xf86drm.h
@@ -342,6 +342,24 @@ typedef struct _drmSetVersion {
int drm_dd_minor;
} drmSetVersion, *drmSetVersionPtr;
+/**
+ * Structure to a general pci gpu device
+ *
+ * \sa drmGetDevices()
+ *
+*/
+typedef struct _drmPciDevice {
+ uint16_t domain;
+ uint8_t bus;
+ uint8_t dev;
+ uint8_t func;
+ uint16_t vendor_id;
+ uint16_t device_id;
+ uint16_t subvendor_id;
+ uint16_t subdevice_id;
+ uint8_t revision_id;
+} drmPciDevice, *drmPciDevicePtr;
+
#define __drm_dummy_lock(lock) (*(__volatile__ unsigned int *)lock)
#define DRM_LOCK_HELD 0x80000000U /**< Hardware lock is held */
@@ -552,6 +570,7 @@ do { register unsigned int __old __asm("o0"); \
/* General user-level programmer's API: unprivileged */
extern int drmAvailable(void);
extern int drmOpen(const char *name, const char *busid);
+extern int drmGetPciDevices(drmPciDevicePtr devSet, uint16_t vendorId);
#define DRM_NODE_PRIMARY 0
#define DRM_NODE_CONTROL 1