diff options
author | Dave Airlie <airlied@linux.ie> | 2005-01-24 01:05:07 +0000 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2005-01-24 01:05:07 +0000 |
commit | 311da0f2124104dfac5fe59bf0ffd7fd88280945 (patch) | |
tree | 81d6d8e8fcb85dce0a9de25653b94605b3135e9e | |
parent | 3df805bd4ab492537e3aa0b9ac5ae99491ee38d6 (diff) |
hopefully fix drm_core setversion ioctl... pointed out by Eric on irc
-rw-r--r-- | linux-core/drm_ioctl.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/linux-core/drm_ioctl.c b/linux-core/drm_ioctl.c index b90e081d..b8ed5a70 100644 --- a/linux-core/drm_ioctl.c +++ b/linux-core/drm_ioctl.c @@ -324,13 +324,15 @@ int drm_setversion(DRM_IOCTL_ARGS) drm_set_version_t retv; int if_version; drm_set_version_t __user *argp = (void __user *)data; - + drm_version_t version; + DRM_COPY_FROM_USER_IOCTL(sv, argp, sizeof(sv)); + dev->driver->version(&version); retv.drm_di_major = DRM_IF_MAJOR; retv.drm_di_minor = DRM_IF_MINOR; - retv.drm_dd_major = DRIVER_MAJOR; - retv.drm_dd_minor = DRIVER_MINOR; + retv.drm_dd_major = version.version_major; + retv.drm_dd_minor = version.version_minor; DRM_COPY_TO_USER_IOCTL(argp, retv, sizeof(sv)); @@ -349,8 +351,8 @@ int drm_setversion(DRM_IOCTL_ARGS) } if (sv.drm_dd_major != -1) { - if (sv.drm_dd_major != DRIVER_MAJOR || - sv.drm_dd_minor < 0 || sv.drm_dd_minor > DRIVER_MINOR) + if (sv.drm_dd_major != version.version_major || + sv.drm_dd_minor < 0 || sv.drm_dd_minor > version.version_minor) return EINVAL; if (dev->driver->set_version) |