aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Velikov2016-11-10 11:26:50 -0600
committerEmil Velikov2016-11-22 07:54:23 -0600
commit37d790f7d449874d0bf199d9ca9871d12b4d599a (patch)
tree1522aa7863dc4e8cc9ff02f690978cb88dfcd419 /xf86drm.h
parent7e0bc3bf1c247e1d53733d0e2e2ada52d29b5327 (diff)
downloadexternal-libdrm-37d790f7d449874d0bf199d9ca9871d12b4d599a.tar.gz
external-libdrm-37d790f7d449874d0bf199d9ca9871d12b4d599a.tar.xz
external-libdrm-37d790f7d449874d0bf199d9ca9871d12b4d599a.zip
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 {
753extern int drmHandleEvent(int fd, drmEventContextPtr evctx); 753extern int drmHandleEvent(int fd, drmEventContextPtr evctx);
754 754
755extern char *drmGetDeviceNameFromFd(int fd); 755extern char *drmGetDeviceNameFromFd(int fd);
756
757/* Improved version of drmGetDeviceNameFromFd which attributes for any type of
758 * device/node - card, control or renderD.
759 */
760extern char *drmGetDeviceNameFromFd2(int fd);
756extern int drmGetNodeTypeFromFd(int fd); 761extern int drmGetNodeTypeFromFd(int fd);
757 762
758extern int drmPrimeHandleToFD(int fd, uint32_t handle, uint32_t flags, int *prime_fd); 763extern int drmPrimeHandleToFD(int fd, uint32_t handle, uint32_t flags, int *prime_fd);