summaryrefslogtreecommitdiff
path: root/xf86drm.h
diff options
context:
space:
mode:
authorEmil Velikov <emil.velikov@collabora.com>2016-11-10 17:26:50 +0000
committerEmil Velikov <emil.l.velikov@gmail.com>2016-11-22 13:54:23 +0000
commit37d790f7d449874d0bf199d9ca9871d12b4d599a (patch)
tree1522aa7863dc4e8cc9ff02f690978cb88dfcd419 /xf86drm.h
parent7e0bc3bf1c247e1d53733d0e2e2ada52d29b5327 (diff)
xf86drm: introduce drmGetDeviceNameFromFd2
The original version considered only card devices, while this will pick the device/node name regardless - card, control, renderD, other... Current implementation is "linux" specific, in such that it relies on sysfs/uevent file. At the same time this gives us the flexibility to support any nodes even future ones, as long as they're within DRM_MAJOR. Shamelessly copied from mesa, latter by: Gary Wong <gtw@gnu.org> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Diffstat (limited to 'xf86drm.h')
-rw-r--r--xf86drm.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/xf86drm.h b/xf86drm.h
index 481d882a..4da6bd3c 100644
--- a/xf86drm.h
+++ b/xf86drm.h
@@ -753,6 +753,11 @@ typedef struct _drmEventContext {
extern int drmHandleEvent(int fd, drmEventContextPtr evctx);
extern char *drmGetDeviceNameFromFd(int fd);
+
+/* Improved version of drmGetDeviceNameFromFd which attributes for any type of
+ * device/node - card, control or renderD.
+ */
+extern char *drmGetDeviceNameFromFd2(int fd);
extern int drmGetNodeTypeFromFd(int fd);
extern int drmPrimeHandleToFD(int fd, uint32_t handle, uint32_t flags, int *prime_fd);