mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 02:19:51 +00:00
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>
This commit is contained in:
parent
dcdb167402
commit
4b7fb9b574
2 changed files with 14 additions and 2 deletions
|
@ -176,7 +176,7 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset,
|
||||||
switch (map->type) {
|
switch (map->type) {
|
||||||
case _DRM_REGISTERS:
|
case _DRM_REGISTERS:
|
||||||
case _DRM_FRAME_BUFFER:
|
case _DRM_FRAME_BUFFER:
|
||||||
#if !defined(__sparc__) && !defined(__alpha__) && !defined(__ia64__) && !defined(__powerpc64__) && !defined(__x86_64__)
|
#if !defined(__sparc__) && !defined(__alpha__) && !defined(__ia64__) && !defined(__powerpc64__) && !defined(__x86_64__) && !defined(__arm__)
|
||||||
if (map->offset + (map->size-1) < map->offset ||
|
if (map->offset + (map->size-1) < map->offset ||
|
||||||
map->offset < virt_to_phys(high_memory)) {
|
map->offset < virt_to_phys(high_memory)) {
|
||||||
kfree(map);
|
kfree(map);
|
||||||
|
|
|
@ -61,7 +61,7 @@ static pgprot_t drm_io_prot(uint32_t map_type, struct vm_area_struct *vma)
|
||||||
tmp = pgprot_writecombine(tmp);
|
tmp = pgprot_writecombine(tmp);
|
||||||
else
|
else
|
||||||
tmp = pgprot_noncached(tmp);
|
tmp = pgprot_noncached(tmp);
|
||||||
#elif defined(__sparc__)
|
#elif defined(__sparc__) || defined(__arm__)
|
||||||
tmp = pgprot_noncached(tmp);
|
tmp = pgprot_noncached(tmp);
|
||||||
#endif
|
#endif
|
||||||
return tmp;
|
return tmp;
|
||||||
|
@ -601,6 +601,7 @@ int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (map->type) {
|
switch (map->type) {
|
||||||
|
#if !defined(__arm__)
|
||||||
case _DRM_AGP:
|
case _DRM_AGP:
|
||||||
if (drm_core_has_AGP(dev) && dev->agp->cant_use_aperture) {
|
if (drm_core_has_AGP(dev) && dev->agp->cant_use_aperture) {
|
||||||
/*
|
/*
|
||||||
|
@ -615,20 +616,31 @@ int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* fall through to _DRM_FRAME_BUFFER... */
|
/* fall through to _DRM_FRAME_BUFFER... */
|
||||||
|
#endif
|
||||||
case _DRM_FRAME_BUFFER:
|
case _DRM_FRAME_BUFFER:
|
||||||
case _DRM_REGISTERS:
|
case _DRM_REGISTERS:
|
||||||
offset = dev->driver->get_reg_ofs(dev);
|
offset = dev->driver->get_reg_ofs(dev);
|
||||||
vma->vm_flags |= VM_IO; /* not in core dump */
|
vma->vm_flags |= VM_IO; /* not in core dump */
|
||||||
vma->vm_page_prot = drm_io_prot(map->type, vma);
|
vma->vm_page_prot = drm_io_prot(map->type, vma);
|
||||||
|
#if !defined(__arm__)
|
||||||
if (io_remap_pfn_range(vma, vma->vm_start,
|
if (io_remap_pfn_range(vma, vma->vm_start,
|
||||||
(map->offset + offset) >> PAGE_SHIFT,
|
(map->offset + offset) >> PAGE_SHIFT,
|
||||||
vma->vm_end - vma->vm_start,
|
vma->vm_end - vma->vm_start,
|
||||||
vma->vm_page_prot))
|
vma->vm_page_prot))
|
||||||
return -EAGAIN;
|
return -EAGAIN;
|
||||||
|
#else
|
||||||
|
if (remap_pfn_range(vma, vma->vm_start,
|
||||||
|
(map->offset + offset) >> PAGE_SHIFT,
|
||||||
|
vma->vm_end - vma->vm_start,
|
||||||
|
vma->vm_page_prot))
|
||||||
|
return -EAGAIN;
|
||||||
|
#endif
|
||||||
|
|
||||||
DRM_DEBUG(" Type = %d; start = 0x%lx, end = 0x%lx,"
|
DRM_DEBUG(" Type = %d; start = 0x%lx, end = 0x%lx,"
|
||||||
" offset = 0x%llx\n",
|
" offset = 0x%llx\n",
|
||||||
map->type,
|
map->type,
|
||||||
vma->vm_start, vma->vm_end, (unsigned long long)(map->offset + offset));
|
vma->vm_start, vma->vm_end, (unsigned long long)(map->offset + offset));
|
||||||
|
|
||||||
vma->vm_ops = &drm_vm_ops;
|
vma->vm_ops = &drm_vm_ops;
|
||||||
break;
|
break;
|
||||||
case _DRM_CONSISTENT:
|
case _DRM_CONSISTENT:
|
||||||
|
|
Loading…
Reference in a new issue