aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/via_video.c
diff options
context:
space:
mode:
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;