Deleted Added
full compact
25c25
< __FBSDID("$FreeBSD: head/sys/dev/drm/drm_vm.c 182080 2008-08-23 20:59:12Z rnoland $");
---
> __FBSDID("$FreeBSD: head/sys/dev/drm/drm_vm.c 183573 2008-10-03 16:59:11Z rnoland $");
34d33
< #if defined(__FreeBSD__) && __FreeBSD_version >= 500102
37,41d35
< #elif defined(__FreeBSD__)
< int drm_mmap(dev_t kdev, vm_offset_t offset, int prot)
< #elif defined(__NetBSD__) || defined(__OpenBSD__)
< paddr_t drm_mmap(dev_t kdev, off_t offset, int prot)
< #endif
43a38
> struct drm_file *file_priv = NULL;
45,47c40
< drm_file_t *priv;
< drm_map_type_t type;
< #ifdef __FreeBSD__
---
> enum drm_map_type type;
49,51c42
< #else
< paddr_t phys;
< #endif
---
> int error;
53,57c44,50
< DRM_LOCK();
< priv = drm_find_file_by_proc(dev, DRM_CURPROC);
< DRM_UNLOCK();
< if (priv == NULL) {
< DRM_ERROR("can't find authenticator\n");
---
> /* d_mmap gets called twice, we can only reference file_priv during
> * the first call. We need to assume that if error is EBADF the
> * call was succesful and the client is authenticated.
> */
> error = devfs_get_cdevpriv((void **)&file_priv);
> if (error == ENOENT) {
> DRM_ERROR("Could not find authenticator!\n");
61c54
< if (!priv->authenticated)
---
> if (file_priv && !file_priv->authenticated)
74d66
< #if defined(__FreeBSD__) && __FreeBSD_version >= 500102
77,79d68
< #else
< return atop(phys);
< #endif
130d118
< #if defined(__FreeBSD__) && __FreeBSD_version >= 500102
133,135d120
< #else
< return atop(phys);
< #endif