summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPekka Paalanen <pq@iki.fi>2007-07-21 23:13:25 +0300
committerPekka Paalanen <pq@iki.fi>2007-07-21 23:13:25 +0300
commit0844c46759b96d52c4952fceb96f7c6bb74b2ce7 (patch)
tree2c435b4215175d7d766d3ea031431c7a42844664
parentb43b0b2b32a31bcb81042659ffcc95b8975e42cf (diff)
Fix misc ioctl issues, makes Nouveau run.
Debug print fix in drm_release(). Forgotten local variable init in drm_setversion(). Unnecessary put_user() in drm_addmap_ioctl(). ioctl->cmd check broken in drm_ioctl(); workaround.
-rw-r--r--linux-core/drm_bufs.c3
-rw-r--r--linux-core/drm_drv.c10
-rw-r--r--linux-core/drm_fops.c2
-rw-r--r--linux-core/drm_ioctl.c2
4 files changed, 11 insertions, 6 deletions
diff --git a/linux-core/drm_bufs.c b/linux-core/drm_bufs.c
index e8864df0..665bc65d 100644
--- a/linux-core/drm_bufs.c
+++ b/linux-core/drm_bufs.c
@@ -343,8 +343,7 @@ int drm_addmap_ioctl(struct drm_device *dev, void *data,
return err;
/* avoid a warning on 64-bit, this casting isn't very nice, but the API is set so too late */
- if (put_user((void *)(unsigned long)maplist->user_token, &map->handle))
- return -EFAULT;
+ map->handle = (void *)(unsigned long)maplist->user_token;
return 0;
}
diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c
index 8a675790..cc676bda 100644
--- a/linux-core/drm_drv.c
+++ b/linux-core/drm_drv.c
@@ -602,12 +602,18 @@ int drm_ioctl(struct inode *inode, struct file *filp,
retcode = -EINVAL;
goto err_i1;
}
-
+#if 0
+ /*
+ * This check is disabled, because driver private ioctl->cmd
+ * are not the ioctl commands with size and direction bits but
+ * just the indices. The DRM core ioctl->cmd are the proper ioctl
+ * commands. The drivers' ioctl tables need to be fixed.
+ */
if (ioctl->cmd != cmd) {
retcode = -EINVAL;
goto err_i1;
}
-
+#endif
func = ioctl->func;
/* is there a local override? */
if ((nr == DRM_IOCTL_NR(DRM_IOCTL_DMA)) && dev->driver->dma_ioctl)
diff --git a/linux-core/drm_fops.c b/linux-core/drm_fops.c
index 251ee5b5..ab5f4ca5 100644
--- a/linux-core/drm_fops.c
+++ b/linux-core/drm_fops.c
@@ -403,7 +403,7 @@ int drm_release(struct inode *inode, struct file *filp)
*/
DRM_DEBUG("pid = %d, device = 0x%lx, open_count = %d\n",
- current->pid, (long)old_encode_dev(dev),
+ current->pid, (long)old_encode_dev(file_priv->head->device),
dev->open_count);
if (dev->driver->reclaim_buffers_locked && dev->lock.hw_lock) {
diff --git a/linux-core/drm_ioctl.c b/linux-core/drm_ioctl.c
index 717e23c0..f3f757da 100644
--- a/linux-core/drm_ioctl.c
+++ b/linux-core/drm_ioctl.c
@@ -301,7 +301,7 @@ int drm_getstats(struct drm_device *dev, void *data,
int drm_setversion(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
struct drm_set_version *sv = data;
- int if_version, retcode;
+ int if_version, retcode = 0;
if (sv->drm_di_major != -1) {
if (sv->drm_di_major != DRM_IF_MAJOR ||