aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/via_video.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-09-02 22:06:45 -0400
committerDave Airlie <airlied@optimus.(none)>2007-10-14 20:38:20 -0400
commitc153f45f9b7e30289157bba3ff5682291df16caa (patch)
tree33f21e1ebd83ec548751f3d490afe6230ab99972 /drivers/char/drm/via_video.c
parentb589ee5943a9610ebaea6e4e3433f2ae4d812b0b (diff)
drm: Replace DRM_IOCTL_ARGS with (dev, data, file_priv) and remove DRM_DEVICE.
The data is now in kernel space, copied in/out as appropriate according to t This results in DRM_COPY_{TO,FROM}_USER going away, and error paths to deal with those failures. This also means that XFree86 4.2.0 support for i810 DR is lost. Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/via_video.c')
-rw-r--r--drivers/char/drm/via_video.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/char/drm/via_video.c b/drivers/char/drm/via_video.c
index 300ac61b09ed..c15e75b54cb1 100644
--- a/drivers/char/drm/via_video.c
+++ b/drivers/char/drm/via_video.c
@@ -65,10 +65,9 @@ void via_release_futex(drm_via_private_t * dev_priv, int context)
65 } 65 }
66} 66}
67 67
68int via_decoder_futex(DRM_IOCTL_ARGS) 68int via_decoder_futex(struct drm_device *dev, void *data, struct drm_file *file_priv)
69{ 69{
70 DRM_DEVICE; 70 drm_via_futex_t *fx = data;
71 drm_via_futex_t fx;
72 volatile int *lock; 71 volatile int *lock;
73 drm_via_private_t *dev_priv = (drm_via_private_t *) dev->dev_private; 72 drm_via_private_t *dev_priv = (drm_via_private_t *) dev->dev_private;
74 drm_via_sarea_t *sAPriv = dev_priv->sarea_priv; 73 drm_via_sarea_t *sAPriv = dev_priv->sarea_priv;
@@ -76,21 +75,18 @@ int via_decoder_futex(DRM_IOCTL_ARGS)
76 75
77 DRM_DEBUG("%s\n", __FUNCTION__); 76 DRM_DEBUG("%s\n", __FUNCTION__);
78 77
79 DRM_COPY_FROM_USER_IOCTL(fx, (drm_via_futex_t __user *) data, 78 if (fx->lock > VIA_NR_XVMC_LOCKS)
80 sizeof(fx));
81
82 if (fx.lock > VIA_NR_XVMC_LOCKS)
83 return -EFAULT; 79 return -EFAULT;
84 80
85 lock = (volatile int *)XVMCLOCKPTR(sAPriv, fx.lock); 81 lock = (volatile int *)XVMCLOCKPTR(sAPriv, fx->lock);
86 82
87 switch (fx.func) { 83 switch (fx->func) {
88 case VIA_FUTEX_WAIT: 84 case VIA_FUTEX_WAIT:
89 DRM_WAIT_ON(ret, dev_priv->decoder_queue[fx.lock], 85 DRM_WAIT_ON(ret, dev_priv->decoder_queue[fx->lock],
90 (fx.ms / 10) * (DRM_HZ / 100), *lock != fx.val); 86 (fx->ms / 10) * (DRM_HZ / 100), *lock != fx->val);
91 return ret; 87 return ret;
92 case VIA_FUTEX_WAKE: 88 case VIA_FUTEX_WAKE:
93 DRM_WAKEUP(&(dev_priv->decoder_queue[fx.lock])); 89 DRM_WAKEUP(&(dev_priv->decoder_queue[fx->lock]));
94 return 0; 90 return 0;
95 } 91 }
96 return 0; 92 return 0;