diff options
author | Thierry Reding <treding@nvidia.com> | 2014-02-12 16:43:29 +0100 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-07-07 16:11:34 -0700 |
commit | 856bb80cea695106a8f6767d00918b38795b51c6 (patch) | |
tree | 70c4e8e07eae881527707bbb015954b133051062 /hw/xfree86/os-support | |
parent | 5a4e15c3f6fb8d674879e54458328e9f595d9451 (diff) |
xfree86: Store kernel driver name in platform device attribute
When opening a DRM device, query the version and store the driver name
as a new attribute for future reference.
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Tested-By: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Tested-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'hw/xfree86/os-support')
-rw-r--r-- | hw/xfree86/os-support/linux/lnx_platform.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/hw/xfree86/os-support/linux/lnx_platform.c b/hw/xfree86/os-support/linux/lnx_platform.c index 308275ab4..0aaedab21 100644 --- a/hw/xfree86/os-support/linux/lnx_platform.c +++ b/hw/xfree86/os-support/linux/lnx_platform.c @@ -24,6 +24,7 @@ static Bool get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) { drmSetVersion sv; + drmVersionPtr v; char *buf; int major, minor, fd; int err = 0; @@ -74,6 +75,17 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) xf86_add_platform_device_attrib(delayed_index, ODEV_ATTRIB_BUSID, buf); drmFreeBusid(buf); + + v = drmGetVersion(fd); + if (!v) { + xf86Msg(X_ERROR, "%s: failed to query DRM version\n", path); + goto out; + } + + xf86_add_platform_device_attrib(delayed_index, ODEV_ATTRIB_DRIVER, + v->name); + drmFreeVersion(v); + out: if (!server_fd) close(fd); |