]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/drm/r128_cce.c
drm: cleanup DRM_DEBUG() parameters
[linux-2.6-omap-h63xx.git] / drivers / char / drm / r128_cce.c
index 15e873627d53780716caf59a9ca9d405c96df567..892e0a58984669ccbfdce83aba673e23fadb7cb1 100644 (file)
@@ -1,4 +1,4 @@
-/* r128_cce.c -- ATI Rage 128 driver -*- linux-c -*- 
+/* r128_cce.c -- ATI Rage 128 driver -*- linux-c -*-
  * Created: Wed Apr  5 19:24:19 2000 by kevin@precisioninsight.com
  */
 /*
@@ -625,21 +625,17 @@ int r128_do_cleanup_cce(struct drm_device * dev)
        return 0;
 }
 
-int r128_cce_init(DRM_IOCTL_ARGS)
+int r128_cce_init(struct drm_device *dev, void *data, struct drm_file *file_priv)
 {
-       DRM_DEVICE;
-       drm_r128_init_t init;
+       drm_r128_init_t *init = data;
 
        DRM_DEBUG("\n");
 
-       LOCK_TEST_WITH_RETURN(dev, filp);
+       LOCK_TEST_WITH_RETURN(dev, file_priv);
 
-       DRM_COPY_FROM_USER_IOCTL(init, (drm_r128_init_t __user *) data,
-                                sizeof(init));
-
-       switch (init.func) {
+       switch (init->func) {
        case R128_INIT_CCE:
-               return r128_do_init_cce(dev, &init);
+               return r128_do_init_cce(dev, init);
        case R128_CLEANUP_CCE:
                return r128_do_cleanup_cce(dev);
        }
@@ -647,16 +643,15 @@ int r128_cce_init(DRM_IOCTL_ARGS)
        return -EINVAL;
 }
 
-int r128_cce_start(DRM_IOCTL_ARGS)
+int r128_cce_start(struct drm_device *dev, void *data, struct drm_file *file_priv)
 {
-       DRM_DEVICE;
        drm_r128_private_t *dev_priv = dev->dev_private;
        DRM_DEBUG("\n");
 
-       LOCK_TEST_WITH_RETURN(dev, filp);
+       LOCK_TEST_WITH_RETURN(dev, file_priv);
 
        if (dev_priv->cce_running || dev_priv->cce_mode == R128_PM4_NONPM4) {
-               DRM_DEBUG("%s while CCE running\n", __FUNCTION__);
+               DRM_DEBUG("while CCE running\n");
                return 0;
        }
 
@@ -668,30 +663,26 @@ int r128_cce_start(DRM_IOCTL_ARGS)
 /* Stop the CCE.  The engine must have been idled before calling this
  * routine.
  */
-int r128_cce_stop(DRM_IOCTL_ARGS)
+int r128_cce_stop(struct drm_device *dev, void *data, struct drm_file *file_priv)
 {
-       DRM_DEVICE;
        drm_r128_private_t *dev_priv = dev->dev_private;
-       drm_r128_cce_stop_t stop;
+       drm_r128_cce_stop_t *stop = data;
        int ret;
        DRM_DEBUG("\n");
 
-       LOCK_TEST_WITH_RETURN(dev, filp);
-
-       DRM_COPY_FROM_USER_IOCTL(stop, (drm_r128_cce_stop_t __user *) data,
-                                sizeof(stop));
+       LOCK_TEST_WITH_RETURN(dev, file_priv);
 
        /* Flush any pending CCE commands.  This ensures any outstanding
         * commands are exectuted by the engine before we turn it off.
         */
-       if (stop.flush) {
+       if (stop->flush) {
                r128_do_cce_flush(dev_priv);
        }
 
        /* If we fail to make the engine go idle, we return an error
         * code so that the DRM ioctl wrapper can try again.
         */
-       if (stop.idle) {
+       if (stop->idle) {
                ret = r128_do_cce_idle(dev_priv);
                if (ret)
                        return ret;
@@ -711,16 +702,15 @@ int r128_cce_stop(DRM_IOCTL_ARGS)
 
 /* Just reset the CCE ring.  Called as part of an X Server engine reset.
  */
-int r128_cce_reset(DRM_IOCTL_ARGS)
+int r128_cce_reset(struct drm_device *dev, void *data, struct drm_file *file_priv)
 {
-       DRM_DEVICE;
        drm_r128_private_t *dev_priv = dev->dev_private;
        DRM_DEBUG("\n");
 
-       LOCK_TEST_WITH_RETURN(dev, filp);
+       LOCK_TEST_WITH_RETURN(dev, file_priv);
 
        if (!dev_priv) {
-               DRM_DEBUG("%s called before init done\n", __FUNCTION__);
+               DRM_DEBUG("called before init done\n");
                return -EINVAL;
        }
 
@@ -732,13 +722,12 @@ int r128_cce_reset(DRM_IOCTL_ARGS)
        return 0;
 }
 
-int r128_cce_idle(DRM_IOCTL_ARGS)
+int r128_cce_idle(struct drm_device *dev, void *data, struct drm_file *file_priv)
 {
-       DRM_DEVICE;
        drm_r128_private_t *dev_priv = dev->dev_private;
        DRM_DEBUG("\n");
 
-       LOCK_TEST_WITH_RETURN(dev, filp);
+       LOCK_TEST_WITH_RETURN(dev, file_priv);
 
        if (dev_priv->cce_running) {
                r128_do_cce_flush(dev_priv);
@@ -747,17 +736,16 @@ int r128_cce_idle(DRM_IOCTL_ARGS)
        return r128_do_cce_idle(dev_priv);
 }
 
-int r128_engine_reset(DRM_IOCTL_ARGS)
+int r128_engine_reset(struct drm_device *dev, void *data, struct drm_file *file_priv)
 {
-       DRM_DEVICE;
        DRM_DEBUG("\n");
 
-       LOCK_TEST_WITH_RETURN(dev, filp);
+       LOCK_TEST_WITH_RETURN(dev, file_priv);
 
        return r128_do_engine_reset(dev);
 }
 
-int r128_fullscreen(DRM_IOCTL_ARGS)
+int r128_fullscreen(struct drm_device *dev, void *data, struct drm_file *file_priv)
 {
        return -EINVAL;
 }
@@ -828,7 +816,7 @@ static struct drm_buf *r128_freelist_get(struct drm_device * dev)
        for (i = 0; i < dma->buf_count; i++) {
                buf = dma->buflist[i];
                buf_priv = buf->dev_private;
-               if (buf->filp == 0)
+               if (buf->file_priv == 0)
                        return buf;
        }
 
@@ -886,7 +874,9 @@ int r128_wait_ring(drm_r128_private_t * dev_priv, int n)
        return -EBUSY;
 }
 
-static int r128_cce_get_buffers(DRMFILE filp, struct drm_device * dev, struct drm_dma * d)
+static int r128_cce_get_buffers(struct drm_device * dev,
+                               struct drm_file *file_priv,
+                               struct drm_dma * d)
 {
        int i;
        struct drm_buf *buf;
@@ -896,7 +886,7 @@ static int r128_cce_get_buffers(DRMFILE filp, struct drm_device * dev, struct dr
                if (!buf)
                        return -EAGAIN;
 
-               buf->filp = filp;
+               buf->file_priv = file_priv;
 
                if (DRM_COPY_TO_USER(&d->request_indices[i], &buf->idx,
                                     sizeof(buf->idx)))
@@ -910,41 +900,35 @@ static int r128_cce_get_buffers(DRMFILE filp, struct drm_device * dev, struct dr
        return 0;
 }
 
-int r128_cce_buffers(DRM_IOCTL_ARGS)
+int r128_cce_buffers(struct drm_device *dev, void *data, struct drm_file *file_priv)
 {
-       DRM_DEVICE;
        struct drm_device_dma *dma = dev->dma;
        int ret = 0;
-       struct drm_dma __user *argp = (void __user *)data;
-       struct drm_dma d;
+       struct drm_dma *d = data;
 
-       LOCK_TEST_WITH_RETURN(dev, filp);
-
-       DRM_COPY_FROM_USER_IOCTL(d, argp, sizeof(d));
+       LOCK_TEST_WITH_RETURN(dev, file_priv);
 
        /* Please don't send us buffers.
         */
-       if (d.send_count != 0) {
+       if (d->send_count != 0) {
                DRM_ERROR("Process %d trying to send %d buffers via drmDMA\n",
-                         DRM_CURRENTPID, d.send_count);
+                         DRM_CURRENTPID, d->send_count);
                return -EINVAL;
        }
 
        /* We'll send you buffers.
         */
-       if (d.request_count < 0 || d.request_count > dma->buf_count) {
+       if (d->request_count < 0 || d->request_count > dma->buf_count) {
                DRM_ERROR("Process %d trying to get %d buffers (of %d max)\n",
-                         DRM_CURRENTPID, d.request_count, dma->buf_count);
+                         DRM_CURRENTPID, d->request_count, dma->buf_count);
                return -EINVAL;
        }
 
-       d.granted_count = 0;
+       d->granted_count = 0;
 
-       if (d.request_count) {
-               ret = r128_cce_get_buffers(filp, dev, &d);
+       if (d->request_count) {
+               ret = r128_cce_get_buffers(dev, file_priv, d);
        }
 
-       DRM_COPY_TO_USER_IOCTL(argp, d, sizeof(d));
-
        return ret;
 }