aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/r128_cce.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-08-25 06:23:09 -0400
committerDave Airlie <airlied@optimus.(none)>2007-10-14 20:38:20 -0400
commit6c340eac0285f3d62406d2d902d0e96fbf2a5dc0 (patch)
treea92039951cb7eaced306cfff2bad6af0ac5257ad /drivers/char/drm/r128_cce.c
parent20caafa6ecb2487d9b223aa33e7cc704f912a758 (diff)
drm: Replace filp in ioctl arguments with drm_file *file_priv.
As a fallout, replace filp storage with file_priv storage for "unique identifier of a client" all over the DRM. There is a 1:1 mapping, so this should be a noop. This could be a minor performance improvement, as everyth on Linux dereferenced filp to get file_priv anyway, while only the mmap ioct went the other direction. Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/r128_cce.c')
-rw-r--r--drivers/char/drm/r128_cce.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/char/drm/r128_cce.c b/drivers/char/drm/r128_cce.c
index 15e873627d53..4dc8acc6eb61 100644
--- a/drivers/char/drm/r128_cce.c
+++ b/drivers/char/drm/r128_cce.c
@@ -632,7 +632,7 @@ int r128_cce_init(DRM_IOCTL_ARGS)
632 632
633 DRM_DEBUG("\n"); 633 DRM_DEBUG("\n");
634 634
635 LOCK_TEST_WITH_RETURN(dev, filp); 635 LOCK_TEST_WITH_RETURN(dev, file_priv);
636 636
637 DRM_COPY_FROM_USER_IOCTL(init, (drm_r128_init_t __user *) data, 637 DRM_COPY_FROM_USER_IOCTL(init, (drm_r128_init_t __user *) data,
638 sizeof(init)); 638 sizeof(init));
@@ -653,7 +653,7 @@ int r128_cce_start(DRM_IOCTL_ARGS)
653 drm_r128_private_t *dev_priv = dev->dev_private; 653 drm_r128_private_t *dev_priv = dev->dev_private;
654 DRM_DEBUG("\n"); 654 DRM_DEBUG("\n");
655 655
656 LOCK_TEST_WITH_RETURN(dev, filp); 656 LOCK_TEST_WITH_RETURN(dev, file_priv);
657 657
658 if (dev_priv->cce_running || dev_priv->cce_mode == R128_PM4_NONPM4) { 658 if (dev_priv->cce_running || dev_priv->cce_mode == R128_PM4_NONPM4) {
659 DRM_DEBUG("%s while CCE running\n", __FUNCTION__); 659 DRM_DEBUG("%s while CCE running\n", __FUNCTION__);
@@ -676,7 +676,7 @@ int r128_cce_stop(DRM_IOCTL_ARGS)
676 int ret; 676 int ret;
677 DRM_DEBUG("\n"); 677 DRM_DEBUG("\n");
678 678
679 LOCK_TEST_WITH_RETURN(dev, filp); 679 LOCK_TEST_WITH_RETURN(dev, file_priv);
680 680
681 DRM_COPY_FROM_USER_IOCTL(stop, (drm_r128_cce_stop_t __user *) data, 681 DRM_COPY_FROM_USER_IOCTL(stop, (drm_r128_cce_stop_t __user *) data,
682 sizeof(stop)); 682 sizeof(stop));
@@ -717,7 +717,7 @@ int r128_cce_reset(DRM_IOCTL_ARGS)
717 drm_r128_private_t *dev_priv = dev->dev_private; 717 drm_r128_private_t *dev_priv = dev->dev_private;
718 DRM_DEBUG("\n"); 718 DRM_DEBUG("\n");
719 719
720 LOCK_TEST_WITH_RETURN(dev, filp); 720 LOCK_TEST_WITH_RETURN(dev, file_priv);
721 721
722 if (!dev_priv) { 722 if (!dev_priv) {
723 DRM_DEBUG("%s called before init done\n", __FUNCTION__); 723 DRM_DEBUG("%s called before init done\n", __FUNCTION__);
@@ -738,7 +738,7 @@ int r128_cce_idle(DRM_IOCTL_ARGS)
738 drm_r128_private_t *dev_priv = dev->dev_private; 738 drm_r128_private_t *dev_priv = dev->dev_private;
739 DRM_DEBUG("\n"); 739 DRM_DEBUG("\n");
740 740
741 LOCK_TEST_WITH_RETURN(dev, filp); 741 LOCK_TEST_WITH_RETURN(dev, file_priv);
742 742
743 if (dev_priv->cce_running) { 743 if (dev_priv->cce_running) {
744 r128_do_cce_flush(dev_priv); 744 r128_do_cce_flush(dev_priv);
@@ -752,7 +752,7 @@ int r128_engine_reset(DRM_IOCTL_ARGS)
752 DRM_DEVICE; 752 DRM_DEVICE;
753 DRM_DEBUG("\n"); 753 DRM_DEBUG("\n");
754 754
755 LOCK_TEST_WITH_RETURN(dev, filp); 755 LOCK_TEST_WITH_RETURN(dev, file_priv);
756 756
757 return r128_do_engine_reset(dev); 757 return r128_do_engine_reset(dev);
758} 758}
@@ -828,7 +828,7 @@ static struct drm_buf *r128_freelist_get(struct drm_device * dev)
828 for (i = 0; i < dma->buf_count; i++) { 828 for (i = 0; i < dma->buf_count; i++) {
829 buf = dma->buflist[i]; 829 buf = dma->buflist[i];
830 buf_priv = buf->dev_private; 830 buf_priv = buf->dev_private;
831 if (buf->filp == 0) 831 if (buf->file_priv == 0)
832 return buf; 832 return buf;
833 } 833 }
834 834
@@ -886,7 +886,9 @@ int r128_wait_ring(drm_r128_private_t * dev_priv, int n)
886 return -EBUSY; 886 return -EBUSY;
887} 887}
888 888
889static int r128_cce_get_buffers(DRMFILE filp, struct drm_device * dev, struct drm_dma * d) 889static int r128_cce_get_buffers(struct drm_device * dev,
890 struct drm_file *file_priv,
891 struct drm_dma * d)
890{ 892{
891 int i; 893 int i;
892 struct drm_buf *buf; 894 struct drm_buf *buf;
@@ -896,7 +898,7 @@ static int r128_cce_get_buffers(DRMFILE filp, struct drm_device * dev, struct dr
896 if (!buf) 898 if (!buf)
897 return -EAGAIN; 899 return -EAGAIN;
898 900
899 buf->filp = filp; 901 buf->file_priv = file_priv;
900 902
901 if (DRM_COPY_TO_USER(&d->request_indices[i], &buf->idx, 903 if (DRM_COPY_TO_USER(&d->request_indices[i], &buf->idx,
902 sizeof(buf->idx))) 904 sizeof(buf->idx)))
@@ -918,7 +920,7 @@ int r128_cce_buffers(DRM_IOCTL_ARGS)
918 struct drm_dma __user *argp = (void __user *)data; 920 struct drm_dma __user *argp = (void __user *)data;
919 struct drm_dma d; 921 struct drm_dma d;
920 922
921 LOCK_TEST_WITH_RETURN(dev, filp); 923 LOCK_TEST_WITH_RETURN(dev, file_priv);
922 924
923 DRM_COPY_FROM_USER_IOCTL(d, argp, sizeof(d)); 925 DRM_COPY_FROM_USER_IOCTL(d, argp, sizeof(d));
924 926
@@ -941,7 +943,7 @@ int r128_cce_buffers(DRM_IOCTL_ARGS)
941 d.granted_count = 0; 943 d.granted_count = 0;
942 944
943 if (d.request_count) { 945 if (d.request_count) {
944 ret = r128_cce_get_buffers(filp, dev, &d); 946 ret = r128_cce_get_buffers(dev, file_priv, &d);
945 } 947 }
946 948
947 DRM_COPY_TO_USER_IOCTL(argp, d, sizeof(d)); 949 DRM_COPY_TO_USER_IOCTL(argp, d, sizeof(d));