aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/r128_cce.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/drm/r128_cce.c')
-rw-r--r--drivers/char/drm/r128_cce.c41
1 files changed, 20 insertions, 21 deletions
diff --git a/drivers/char/drm/r128_cce.c b/drivers/char/drm/r128_cce.c
index 1014602c43a7..b163ed09bd81 100644
--- a/drivers/char/drm/r128_cce.c
+++ b/drivers/char/drm/r128_cce.c
@@ -81,7 +81,7 @@ static u32 r128_cce_microcode[] = {
81 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 81 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
82}; 82};
83 83
84static int R128_READ_PLL(drm_device_t * dev, int addr) 84static int R128_READ_PLL(struct drm_device * dev, int addr)
85{ 85{
86 drm_r128_private_t *dev_priv = dev->dev_private; 86 drm_r128_private_t *dev_priv = dev->dev_private;
87 87
@@ -271,7 +271,7 @@ static void r128_do_cce_stop(drm_r128_private_t * dev_priv)
271 271
272/* Reset the engine. This will stop the CCE if it is running. 272/* Reset the engine. This will stop the CCE if it is running.
273 */ 273 */
274static int r128_do_engine_reset(drm_device_t * dev) 274static int r128_do_engine_reset(struct drm_device * dev)
275{ 275{
276 drm_r128_private_t *dev_priv = dev->dev_private; 276 drm_r128_private_t *dev_priv = dev->dev_private;
277 u32 clock_cntl_index, mclk_cntl, gen_reset_cntl; 277 u32 clock_cntl_index, mclk_cntl, gen_reset_cntl;
@@ -308,7 +308,7 @@ static int r128_do_engine_reset(drm_device_t * dev)
308 return 0; 308 return 0;
309} 309}
310 310
311static void r128_cce_init_ring_buffer(drm_device_t * dev, 311static void r128_cce_init_ring_buffer(struct drm_device * dev,
312 drm_r128_private_t * dev_priv) 312 drm_r128_private_t * dev_priv)
313{ 313{
314 u32 ring_start; 314 u32 ring_start;
@@ -347,7 +347,7 @@ static void r128_cce_init_ring_buffer(drm_device_t * dev,
347 R128_WRITE(R128_BUS_CNTL, tmp); 347 R128_WRITE(R128_BUS_CNTL, tmp);
348} 348}
349 349
350static int r128_do_init_cce(drm_device_t * dev, drm_r128_init_t * init) 350static int r128_do_init_cce(struct drm_device * dev, drm_r128_init_t * init)
351{ 351{
352 drm_r128_private_t *dev_priv; 352 drm_r128_private_t *dev_priv;
353 353
@@ -456,8 +456,7 @@ static int r128_do_init_cce(drm_device_t * dev, drm_r128_init_t * init)
456 dev_priv->span_pitch_offset_c = (((dev_priv->depth_pitch / 8) << 21) | 456 dev_priv->span_pitch_offset_c = (((dev_priv->depth_pitch / 8) << 21) |
457 (dev_priv->span_offset >> 5)); 457 (dev_priv->span_offset >> 5));
458 458
459 DRM_GETSAREA(); 459 dev_priv->sarea = drm_getsarea(dev);
460
461 if (!dev_priv->sarea) { 460 if (!dev_priv->sarea) {
462 DRM_ERROR("could not find sarea!\n"); 461 DRM_ERROR("could not find sarea!\n");
463 dev->dev_private = (void *)dev_priv; 462 dev->dev_private = (void *)dev_priv;
@@ -585,7 +584,7 @@ static int r128_do_init_cce(drm_device_t * dev, drm_r128_init_t * init)
585 return 0; 584 return 0;
586} 585}
587 586
588int r128_do_cleanup_cce(drm_device_t * dev) 587int r128_do_cleanup_cce(struct drm_device * dev)
589{ 588{
590 589
591 /* Make sure interrupts are disabled here because the uninstall ioctl 590 /* Make sure interrupts are disabled here because the uninstall ioctl
@@ -770,11 +769,11 @@ int r128_fullscreen(DRM_IOCTL_ARGS)
770#define R128_BUFFER_FREE 0 769#define R128_BUFFER_FREE 0
771 770
772#if 0 771#if 0
773static int r128_freelist_init(drm_device_t * dev) 772static int r128_freelist_init(struct drm_device * dev)
774{ 773{
775 drm_device_dma_t *dma = dev->dma; 774 struct drm_device_dma *dma = dev->dma;
776 drm_r128_private_t *dev_priv = dev->dev_private; 775 drm_r128_private_t *dev_priv = dev->dev_private;
777 drm_buf_t *buf; 776 struct drm_buf *buf;
778 drm_r128_buf_priv_t *buf_priv; 777 drm_r128_buf_priv_t *buf_priv;
779 drm_r128_freelist_t *entry; 778 drm_r128_freelist_t *entry;
780 int i; 779 int i;
@@ -816,12 +815,12 @@ static int r128_freelist_init(drm_device_t * dev)
816} 815}
817#endif 816#endif
818 817
819static drm_buf_t *r128_freelist_get(drm_device_t * dev) 818static struct drm_buf *r128_freelist_get(struct drm_device * dev)
820{ 819{
821 drm_device_dma_t *dma = dev->dma; 820 struct drm_device_dma *dma = dev->dma;
822 drm_r128_private_t *dev_priv = dev->dev_private; 821 drm_r128_private_t *dev_priv = dev->dev_private;
823 drm_r128_buf_priv_t *buf_priv; 822 drm_r128_buf_priv_t *buf_priv;
824 drm_buf_t *buf; 823 struct drm_buf *buf;
825 int i, t; 824 int i, t;
826 825
827 /* FIXME: Optimize -- use freelist code */ 826 /* FIXME: Optimize -- use freelist code */
@@ -854,13 +853,13 @@ static drm_buf_t *r128_freelist_get(drm_device_t * dev)
854 return NULL; 853 return NULL;
855} 854}
856 855
857void r128_freelist_reset(drm_device_t * dev) 856void r128_freelist_reset(struct drm_device * dev)
858{ 857{
859 drm_device_dma_t *dma = dev->dma; 858 struct drm_device_dma *dma = dev->dma;
860 int i; 859 int i;
861 860
862 for (i = 0; i < dma->buf_count; i++) { 861 for (i = 0; i < dma->buf_count; i++) {
863 drm_buf_t *buf = dma->buflist[i]; 862 struct drm_buf *buf = dma->buflist[i];
864 drm_r128_buf_priv_t *buf_priv = buf->dev_private; 863 drm_r128_buf_priv_t *buf_priv = buf->dev_private;
865 buf_priv->age = 0; 864 buf_priv->age = 0;
866 } 865 }
@@ -887,10 +886,10 @@ int r128_wait_ring(drm_r128_private_t * dev_priv, int n)
887 return DRM_ERR(EBUSY); 886 return DRM_ERR(EBUSY);
888} 887}
889 888
890static int r128_cce_get_buffers(DRMFILE filp, drm_device_t * dev, drm_dma_t * d) 889static int r128_cce_get_buffers(DRMFILE filp, struct drm_device * dev, struct drm_dma * d)
891{ 890{
892 int i; 891 int i;
893 drm_buf_t *buf; 892 struct drm_buf *buf;
894 893
895 for (i = d->granted_count; i < d->request_count; i++) { 894 for (i = d->granted_count; i < d->request_count; i++) {
896 buf = r128_freelist_get(dev); 895 buf = r128_freelist_get(dev);
@@ -914,10 +913,10 @@ static int r128_cce_get_buffers(DRMFILE filp, drm_device_t * dev, drm_dma_t * d)
914int r128_cce_buffers(DRM_IOCTL_ARGS) 913int r128_cce_buffers(DRM_IOCTL_ARGS)
915{ 914{
916 DRM_DEVICE; 915 DRM_DEVICE;
917 drm_device_dma_t *dma = dev->dma; 916 struct drm_device_dma *dma = dev->dma;
918 int ret = 0; 917 int ret = 0;
919 drm_dma_t __user *argp = (void __user *)data; 918 struct drm_dma __user *argp = (void __user *)data;
920 drm_dma_t d; 919 struct drm_dma d;
921 920
922 LOCK_TEST_WITH_RETURN(dev, filp); 921 LOCK_TEST_WITH_RETURN(dev, filp);
923 922