aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/i830_irq.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/drm/i830_irq.c')
-rw-r--r--drivers/char/drm/i830_irq.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/char/drm/i830_irq.c b/drivers/char/drm/i830_irq.c
index 9c28939e2db3..76403f4b6200 100644
--- a/drivers/char/drm/i830_irq.c
+++ b/drivers/char/drm/i830_irq.c
@@ -114,12 +114,11 @@ static int i830_wait_irq(struct drm_device * dev, int irq_nr)
114 114
115/* Needs the lock as it touches the ring. 115/* Needs the lock as it touches the ring.
116 */ 116 */
117int i830_irq_emit(struct inode *inode, struct drm_file *file_priv, 117int i830_irq_emit(struct drm_device *dev, void *data,
118 unsigned int cmd, unsigned long arg) 118 struct drm_file *file_priv)
119{ 119{
120 struct drm_device *dev = file_priv->head->dev;
121 drm_i830_private_t *dev_priv = dev->dev_private; 120 drm_i830_private_t *dev_priv = dev->dev_private;
122 drm_i830_irq_emit_t emit; 121 drm_i830_irq_emit_t *emit = data;
123 int result; 122 int result;
124 123
125 LOCK_TEST_WITH_RETURN(dev, file_priv); 124 LOCK_TEST_WITH_RETURN(dev, file_priv);
@@ -129,13 +128,9 @@ int i830_irq_emit(struct inode *inode, struct drm_file *file_priv,
129 return -EINVAL; 128 return -EINVAL;
130 } 129 }
131 130
132 if (copy_from_user
133 (&emit, (drm_i830_irq_emit_t __user *) arg, sizeof(emit)))
134 return -EFAULT;
135
136 result = i830_emit_irq(dev); 131 result = i830_emit_irq(dev);
137 132
138 if (copy_to_user(emit.irq_seq, &result, sizeof(int))) { 133 if (copy_to_user(emit->irq_seq, &result, sizeof(int))) {
139 DRM_ERROR("copy_to_user\n"); 134 DRM_ERROR("copy_to_user\n");
140 return -EFAULT; 135 return -EFAULT;
141 } 136 }
@@ -145,23 +140,18 @@ int i830_irq_emit(struct inode *inode, struct drm_file *file_priv,
145 140
146/* Doesn't need the hardware lock. 141/* Doesn't need the hardware lock.
147 */ 142 */
148int i830_irq_wait(struct inode *inode, struct drm_file *file_priv, 143int i830_irq_wait(struct drm_device *dev, void *data,
149 unsigned int cmd, unsigned long arg) 144 struct drm_file *file_priv)
150{ 145{
151 struct drm_device *dev = file_priv->head->dev;
152 drm_i830_private_t *dev_priv = dev->dev_private; 146 drm_i830_private_t *dev_priv = dev->dev_private;
153 drm_i830_irq_wait_t irqwait; 147 drm_i830_irq_wait_t *irqwait = data;
154 148
155 if (!dev_priv) { 149 if (!dev_priv) {
156 DRM_ERROR("%s called with no initialization\n", __FUNCTION__); 150 DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
157 return -EINVAL; 151 return -EINVAL;
158 } 152 }
159 153
160 if (copy_from_user(&irqwait, (drm_i830_irq_wait_t __user *) arg, 154 return i830_wait_irq(dev, irqwait->irq_seq);
161 sizeof(irqwait)))
162 return -EFAULT;
163
164 return i830_wait_irq(dev, irqwait.irq_seq);
165} 155}
166 156
167/* drm_dma.h hooks 157/* drm_dma.h hooks