aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/via_dmablit.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-08-25 05:22:43 -0400
committerDave Airlie <airlied@optimus.(none)>2007-10-14 20:38:19 -0400
commit20caafa6ecb2487d9b223aa33e7cc704f912a758 (patch)
tree7df033fdee81305dad0a67ceba79f51ead7c1b8b /drivers/char/drm/via_dmablit.c
parent23fd50450a34f2558070ceabb0bfebc1c9604af5 (diff)
drm: Remove DRM_ERR OS macro.
This was used to make all ioctl handlers return -errno on linux and errno on *BSD. Instead, just return -errno in shared code, and flip sign on return f shared code to *BSD code. Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/via_dmablit.c')
-rw-r--r--drivers/char/drm/via_dmablit.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/char/drm/via_dmablit.c b/drivers/char/drm/via_dmablit.c
index 3dd1ed3d1bf5..cd204f35eced 100644
--- a/drivers/char/drm/via_dmablit.c
+++ b/drivers/char/drm/via_dmablit.c
@@ -237,7 +237,7 @@ via_lock_all_dma_pages(drm_via_sg_info_t *vsg, drm_via_dmablit_t *xfer)
237 first_pfn + 1; 237 first_pfn + 1;
238 238
239 if (NULL == (vsg->pages = vmalloc(sizeof(struct page *) * vsg->num_pages))) 239 if (NULL == (vsg->pages = vmalloc(sizeof(struct page *) * vsg->num_pages)))
240 return DRM_ERR(ENOMEM); 240 return -ENOMEM;
241 memset(vsg->pages, 0, sizeof(struct page *) * vsg->num_pages); 241 memset(vsg->pages, 0, sizeof(struct page *) * vsg->num_pages);
242 down_read(&current->mm->mmap_sem); 242 down_read(&current->mm->mmap_sem);
243 ret = get_user_pages(current, current->mm, 243 ret = get_user_pages(current, current->mm,
@@ -251,7 +251,7 @@ via_lock_all_dma_pages(drm_via_sg_info_t *vsg, drm_via_dmablit_t *xfer)
251 if (ret < 0) 251 if (ret < 0)
252 return ret; 252 return ret;
253 vsg->state = dr_via_pages_locked; 253 vsg->state = dr_via_pages_locked;
254 return DRM_ERR(EINVAL); 254 return -EINVAL;
255 } 255 }
256 vsg->state = dr_via_pages_locked; 256 vsg->state = dr_via_pages_locked;
257 DRM_DEBUG("DMA pages locked\n"); 257 DRM_DEBUG("DMA pages locked\n");
@@ -274,13 +274,13 @@ via_alloc_desc_pages(drm_via_sg_info_t *vsg)
274 vsg->descriptors_per_page; 274 vsg->descriptors_per_page;
275 275
276 if (NULL == (vsg->desc_pages = kcalloc(vsg->num_desc_pages, sizeof(void *), GFP_KERNEL))) 276 if (NULL == (vsg->desc_pages = kcalloc(vsg->num_desc_pages, sizeof(void *), GFP_KERNEL)))
277 return DRM_ERR(ENOMEM); 277 return -ENOMEM;
278 278
279 vsg->state = dr_via_desc_pages_alloc; 279 vsg->state = dr_via_desc_pages_alloc;
280 for (i=0; i<vsg->num_desc_pages; ++i) { 280 for (i=0; i<vsg->num_desc_pages; ++i) {
281 if (NULL == (vsg->desc_pages[i] = 281 if (NULL == (vsg->desc_pages[i] =
282 (drm_via_descriptor_t *) __get_free_page(GFP_KERNEL))) 282 (drm_via_descriptor_t *) __get_free_page(GFP_KERNEL)))
283 return DRM_ERR(ENOMEM); 283 return -ENOMEM;
284 } 284 }
285 DRM_DEBUG("Allocated %d pages for %d descriptors.\n", vsg->num_desc_pages, 285 DRM_DEBUG("Allocated %d pages for %d descriptors.\n", vsg->num_desc_pages,
286 vsg->num_desc); 286 vsg->num_desc);
@@ -593,7 +593,7 @@ via_build_sg_info(struct drm_device *dev, drm_via_sg_info_t *vsg, drm_via_dmabli
593 593
594 if (xfer->num_lines <= 0 || xfer->line_length <= 0) { 594 if (xfer->num_lines <= 0 || xfer->line_length <= 0) {
595 DRM_ERROR("Zero size bitblt.\n"); 595 DRM_ERROR("Zero size bitblt.\n");
596 return DRM_ERR(EINVAL); 596 return -EINVAL;
597 } 597 }
598 598
599 /* 599 /*
@@ -606,7 +606,7 @@ via_build_sg_info(struct drm_device *dev, drm_via_sg_info_t *vsg, drm_via_dmabli
606 if ((xfer->mem_stride - xfer->line_length) >= PAGE_SIZE) { 606 if ((xfer->mem_stride - xfer->line_length) >= PAGE_SIZE) {
607 DRM_ERROR("Too large system memory stride. Stride: %d, " 607 DRM_ERROR("Too large system memory stride. Stride: %d, "
608 "Length: %d\n", xfer->mem_stride, xfer->line_length); 608 "Length: %d\n", xfer->mem_stride, xfer->line_length);
609 return DRM_ERR(EINVAL); 609 return -EINVAL;
610 } 610 }
611 611
612 if ((xfer->mem_stride == xfer->line_length) && 612 if ((xfer->mem_stride == xfer->line_length) &&
@@ -624,7 +624,7 @@ via_build_sg_info(struct drm_device *dev, drm_via_sg_info_t *vsg, drm_via_dmabli
624 624
625 if (xfer->num_lines > 2048 || (xfer->num_lines*xfer->mem_stride > (2048*2048*4))) { 625 if (xfer->num_lines > 2048 || (xfer->num_lines*xfer->mem_stride > (2048*2048*4))) {
626 DRM_ERROR("Too large PCI DMA bitblt.\n"); 626 DRM_ERROR("Too large PCI DMA bitblt.\n");
627 return DRM_ERR(EINVAL); 627 return -EINVAL;
628 } 628 }
629 629
630 /* 630 /*
@@ -635,7 +635,7 @@ via_build_sg_info(struct drm_device *dev, drm_via_sg_info_t *vsg, drm_via_dmabli
635 if (xfer->mem_stride < xfer->line_length || 635 if (xfer->mem_stride < xfer->line_length ||
636 abs(xfer->fb_stride) < xfer->line_length) { 636 abs(xfer->fb_stride) < xfer->line_length) {
637 DRM_ERROR("Invalid frame-buffer / memory stride.\n"); 637 DRM_ERROR("Invalid frame-buffer / memory stride.\n");
638 return DRM_ERR(EINVAL); 638 return -EINVAL;
639 } 639 }
640 640
641 /* 641 /*
@@ -648,7 +648,7 @@ via_build_sg_info(struct drm_device *dev, drm_via_sg_info_t *vsg, drm_via_dmabli
648 if ((((unsigned long)xfer->mem_addr & 3) != ((unsigned long)xfer->fb_addr & 3)) || 648 if ((((unsigned long)xfer->mem_addr & 3) != ((unsigned long)xfer->fb_addr & 3)) ||
649 ((xfer->num_lines > 1) && ((xfer->mem_stride & 3) != (xfer->fb_stride & 3)))) { 649 ((xfer->num_lines > 1) && ((xfer->mem_stride & 3) != (xfer->fb_stride & 3)))) {
650 DRM_ERROR("Invalid DRM bitblt alignment.\n"); 650 DRM_ERROR("Invalid DRM bitblt alignment.\n");
651 return DRM_ERR(EINVAL); 651 return -EINVAL;
652 } 652 }
653#else 653#else
654 if ((((unsigned long)xfer->mem_addr & 15) || 654 if ((((unsigned long)xfer->mem_addr & 15) ||
@@ -656,7 +656,7 @@ via_build_sg_info(struct drm_device *dev, drm_via_sg_info_t *vsg, drm_via_dmabli
656 ((xfer->num_lines > 1) && 656 ((xfer->num_lines > 1) &&
657 ((xfer->mem_stride & 15) || (xfer->fb_stride & 3)))) { 657 ((xfer->mem_stride & 15) || (xfer->fb_stride & 3)))) {
658 DRM_ERROR("Invalid DRM bitblt alignment.\n"); 658 DRM_ERROR("Invalid DRM bitblt alignment.\n");
659 return DRM_ERR(EINVAL); 659 return -EINVAL;
660 } 660 }
661#endif 661#endif
662 662
@@ -696,7 +696,7 @@ via_dmablit_grab_slot(drm_via_blitq_t *blitq, int engine)
696 696
697 DRM_WAIT_ON(ret, blitq->busy_queue, DRM_HZ, blitq->num_free > 0); 697 DRM_WAIT_ON(ret, blitq->busy_queue, DRM_HZ, blitq->num_free > 0);
698 if (ret) { 698 if (ret) {
699 return (DRM_ERR(EINTR) == ret) ? DRM_ERR(EAGAIN) : ret; 699 return (-EINTR == ret) ? -EAGAIN : ret;
700 } 700 }
701 701
702 spin_lock_irqsave(&blitq->blit_lock, irqsave); 702 spin_lock_irqsave(&blitq->blit_lock, irqsave);
@@ -740,7 +740,7 @@ via_dmablit(struct drm_device *dev, drm_via_dmablit_t *xfer)
740 740
741 if (dev_priv == NULL) { 741 if (dev_priv == NULL) {
742 DRM_ERROR("Called without initialization.\n"); 742 DRM_ERROR("Called without initialization.\n");
743 return DRM_ERR(EINVAL); 743 return -EINVAL;
744 } 744 }
745 745
746 engine = (xfer->to_fb) ? 0 : 1; 746 engine = (xfer->to_fb) ? 0 : 1;
@@ -750,7 +750,7 @@ via_dmablit(struct drm_device *dev, drm_via_dmablit_t *xfer)
750 } 750 }
751 if (NULL == (vsg = kmalloc(sizeof(*vsg), GFP_KERNEL))) { 751 if (NULL == (vsg = kmalloc(sizeof(*vsg), GFP_KERNEL))) {
752 via_dmablit_release_slot(blitq); 752 via_dmablit_release_slot(blitq);
753 return DRM_ERR(ENOMEM); 753 return -ENOMEM;
754 } 754 }
755 if (0 != (ret = via_build_sg_info(dev, vsg, xfer))) { 755 if (0 != (ret = via_build_sg_info(dev, vsg, xfer))) {
756 via_dmablit_release_slot(blitq); 756 via_dmablit_release_slot(blitq);
@@ -790,12 +790,12 @@ via_dma_blit_sync( DRM_IOCTL_ARGS )
790 DRM_COPY_FROM_USER_IOCTL(sync, (drm_via_blitsync_t *)data, sizeof(sync)); 790 DRM_COPY_FROM_USER_IOCTL(sync, (drm_via_blitsync_t *)data, sizeof(sync));
791 791
792 if (sync.engine >= VIA_NUM_BLIT_ENGINES) 792 if (sync.engine >= VIA_NUM_BLIT_ENGINES)
793 return DRM_ERR(EINVAL); 793 return -EINVAL;
794 794
795 err = via_dmablit_sync(dev, sync.sync_handle, sync.engine); 795 err = via_dmablit_sync(dev, sync.sync_handle, sync.engine);
796 796
797 if (DRM_ERR(EINTR) == err) 797 if (-EINTR == err)
798 err = DRM_ERR(EAGAIN); 798 err = -EAGAIN;
799 799
800 return err; 800 return err;
801} 801}