diff options
author | Eric Anholt <anholt@freebsd.org> | 2005-08-05 03:50:23 +0000 |
---|---|---|
committer | Eric Anholt <anholt@freebsd.org> | 2005-08-05 03:50:23 +0000 |
commit | c789ea1521ac9e935f2a1c6c043619d89bae9c16 (patch) | |
tree | bb8bcecf000f78f71db8dc70484d7ea82cc0b260 /linux-core/drm_ioctl.c | |
parent | 143622a987745ca2084f7a188e9993ffd5f28fe3 (diff) |
Rename the driver hooks in the DRM to something a little more
understandable: preinit -> load postinit -> (removed) presetup ->
firstopen postsetup -> (removed) open_helper -> open prerelease ->
preclose free_filp_priv -> postclose pretakedown -> lastclose
postcleanup -> unload release -> reclaim_buffers_locked version ->
(removed)
postinit and version were replaced with generic code in the Linux DRM
(drivers now set their version numbers and description in the driver
structure, like on BSD). postsetup wasn't used at all. Fixes the savage
hooks for initializing and tearing down mappings at the right times.
Testing involved at least starting X, running glxgears, killing
glxgears, exiting X, and repeating.
Tested on: FreeBSD (g200, g400, r200, r128) Linux (r200, savage4)
Diffstat (limited to 'linux-core/drm_ioctl.c')
-rw-r--r-- | linux-core/drm_ioctl.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/linux-core/drm_ioctl.c b/linux-core/drm_ioctl.c index 24f6579f..eac89ea6 100644 --- a/linux-core/drm_ioctl.c +++ b/linux-core/drm_ioctl.c @@ -324,23 +324,13 @@ 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)); - /* - * version.name etc need to be initialized to zero. - * If we don't, driver->version() will poke random strings to - * random locations in user space, causing X server segfaults - * that are interesting to debug. --eich - */ - memset(&version, 0, sizeof(version)); - - dev->driver->version(&version); retv.drm_di_major = DRM_IF_MAJOR; retv.drm_di_minor = DRM_IF_MINOR; - retv.drm_dd_major = version.version_major; - retv.drm_dd_minor = version.version_minor; + retv.drm_dd_major = dev->driver->major; + retv.drm_dd_minor = dev->driver->minor; DRM_COPY_TO_USER_IOCTL(argp, retv, sizeof(sv)); @@ -359,8 +349,8 @@ int drm_setversion(DRM_IOCTL_ARGS) } if (sv.drm_dd_major != -1) { - if (sv.drm_dd_major != version.version_major || - sv.drm_dd_minor < 0 || sv.drm_dd_minor > version.version_minor) + if (sv.drm_dd_major != dev->driver->major || + sv.drm_dd_minor < 0 || sv.drm_dd_minor > dev->driver->minor) return EINVAL; if (dev->driver->set_version) |