aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJordan Crouse <jcrouse@codeaurora.org>2010-05-27 15:40:26 -0400
committerDave Airlie <airlied@redhat.com>2010-05-31 20:07:56 -0400
commit4b7fb9b5746554d460e7bc986341d4b2db01e0b6 (patch)
tree4cb249ecf0a5b45b02221f1ff9324e0bca6cc52d
parentdcdb167402cbdca1d021bdfa5f63995ee0a79317 (diff)
drm: Add __arm defines to DRM
Add __arm defines to specify behavior specific for an ARM processor. Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/drm_bufs.c2
-rw-r--r--drivers/gpu/drm/drm_vm.c14
2 files changed, 14 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c
index 7783035871e..4fcbc445a8e 100644
--- a/drivers/gpu/drm/drm_bufs.c
+++ b/drivers/gpu/drm/drm_bufs.c
@@ -176,7 +176,7 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset,
176 switch (map->type) { 176 switch (map->type) {
177 case _DRM_REGISTERS: 177 case _DRM_REGISTERS:
178 case _DRM_FRAME_BUFFER: 178 case _DRM_FRAME_BUFFER:
179#if !defined(__sparc__) && !defined(__alpha__) && !defined(__ia64__) && !defined(__powerpc64__) && !defined(__x86_64__) 179#if !defined(__sparc__) && !defined(__alpha__) && !defined(__ia64__) && !defined(__powerpc64__) && !defined(__x86_64__) && !defined(__arm__)
180 if (map->offset + (map->size-1) < map->offset || 180 if (map->offset + (map->size-1) < map->offset ||
181 map->offset < virt_to_phys(high_memory)) { 181 map->offset < virt_to_phys(high_memory)) {
182 kfree(map); 182 kfree(map);
diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c
index c3b13fb41d0..3778360ecee 100644
--- a/drivers/gpu/drm/drm_vm.c
+++ b/drivers/gpu/drm/drm_vm.c
@@ -61,7 +61,7 @@ static pgprot_t drm_io_prot(uint32_t map_type, struct vm_area_struct *vma)
61 tmp = pgprot_writecombine(tmp); 61 tmp = pgprot_writecombine(tmp);
62 else 62 else
63 tmp = pgprot_noncached(tmp); 63 tmp = pgprot_noncached(tmp);
64#elif defined(__sparc__) 64#elif defined(__sparc__) || defined(__arm__)
65 tmp = pgprot_noncached(tmp); 65 tmp = pgprot_noncached(tmp);
66#endif 66#endif
67 return tmp; 67 return tmp;
@@ -601,6 +601,7 @@ int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
601 } 601 }
602 602
603 switch (map->type) { 603 switch (map->type) {
604#if !defined(__arm__)
604 case _DRM_AGP: 605 case _DRM_AGP:
605 if (drm_core_has_AGP(dev) && dev->agp->cant_use_aperture) { 606 if (drm_core_has_AGP(dev) && dev->agp->cant_use_aperture) {
606 /* 607 /*
@@ -615,20 +616,31 @@ int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
615 break; 616 break;
616 } 617 }
617 /* fall through to _DRM_FRAME_BUFFER... */ 618 /* fall through to _DRM_FRAME_BUFFER... */
619#endif
618 case _DRM_FRAME_BUFFER: 620 case _DRM_FRAME_BUFFER:
619 case _DRM_REGISTERS: 621 case _DRM_REGISTERS:
620 offset = dev->driver->get_reg_ofs(dev); 622 offset = dev->driver->get_reg_ofs(dev);
621 vma->vm_flags |= VM_IO; /* not in core dump */ 623 vma->vm_flags |= VM_IO; /* not in core dump */
622 vma->vm_page_prot = drm_io_prot(map->type, vma); 624 vma->vm_page_prot = drm_io_prot(map->type, vma);
625#if !defined(__arm__)
623 if (io_remap_pfn_range(vma, vma->vm_start, 626 if (io_remap_pfn_range(vma, vma->vm_start,
624 (map->offset + offset) >> PAGE_SHIFT, 627 (map->offset + offset) >> PAGE_SHIFT,
625 vma->vm_end - vma->vm_start, 628 vma->vm_end - vma->vm_start,
626 vma->vm_page_prot)) 629 vma->vm_page_prot))
627 return -EAGAIN; 630 return -EAGAIN;
631#else
632 if (remap_pfn_range(vma, vma->vm_start,
633 (map->offset + offset) >> PAGE_SHIFT,
634 vma->vm_end - vma->vm_start,
635 vma->vm_page_prot))
636 return -EAGAIN;
637#endif
638
628 DRM_DEBUG(" Type = %d; start = 0x%lx, end = 0x%lx," 639 DRM_DEBUG(" Type = %d; start = 0x%lx, end = 0x%lx,"
629 " offset = 0x%llx\n", 640 " offset = 0x%llx\n",
630 map->type, 641 map->type,
631 vma->vm_start, vma->vm_end, (unsigned long long)(map->offset + offset)); 642 vma->vm_start, vma->vm_end, (unsigned long long)(map->offset + offset));
643
632 vma->vm_ops = &drm_vm_ops; 644 vma->vm_ops = &drm_vm_ops;
633 break; 645 break;
634 case _DRM_CONSISTENT: 646 case _DRM_CONSISTENT: