tree ac5d9520a6272c589446e555a1295962e43cae75
parent ffbbf7a3ccdcac7526296a55968e5dac0626fd9e
author Dave Airlie <[EMAIL PROTECTED](none)> Sat, 20 Aug 2005 17:43:33 +1000
committer Dave Airlie <[EMAIL PROTECTED]> Sat, 20 Aug 2005 17:43:33 +1000

drm: fixes for powerpc

Remove a bogus check on whether an area is memory (we need a better interface)
also change pgprot flags for powerpc
don't check on x86-64 either

From: Paul Mackerras <[EMAIL PROTECTED]>
Signed-off-by: Dave Airlie <[EMAIL PROTECTED]>

 drivers/char/drm/drm_bufs.c |    4 ++--
 drivers/char/drm/drm_vm.c   |   16 ++++++++--------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/char/drm/drm_bufs.c b/drivers/char/drm/drm_bufs.c
--- a/drivers/char/drm/drm_bufs.c
+++ b/drivers/char/drm/drm_bufs.c
@@ -152,7 +152,7 @@ int drm_addmap(drm_device_t * dev, unsig
        switch ( map->type ) {
        case _DRM_REGISTERS:
        case _DRM_FRAME_BUFFER:
-#if !defined(__sparc__) && !defined(__alpha__) && !defined(__ia64__)
+#if !defined(__sparc__) && !defined(__alpha__) && !defined(__ia64__) && 
!defined(__powerpc64__) && !defined(__x86_64__)
                if ( map->offset + map->size < map->offset ||
                     map->offset < virt_to_phys(high_memory) ) {
                        drm_free( map, sizeof(*map), DRM_MEM_MAPS );
@@ -309,7 +309,7 @@ int drm_addmap_ioctl(struct inode *inode
        if (put_user(handle, &argp->handle))
                return -EFAULT;
        return 0;
-       }
+}
 
 
 /**
diff --git a/drivers/char/drm/drm_vm.c b/drivers/char/drm/drm_vm.c
--- a/drivers/char/drm/drm_vm.c
+++ b/drivers/char/drm/drm_vm.c
@@ -578,17 +578,17 @@ int drm_mmap(struct file *filp, struct v
                 /* fall through to _DRM_FRAME_BUFFER... */        
        case _DRM_FRAME_BUFFER:
        case _DRM_REGISTERS:
-               if (map->offset >= __pa(high_memory)) {
 #if defined(__i386__) || defined(__x86_64__)
-                       if (boot_cpu_data.x86 > 3 && map->type != _DRM_AGP) {
-                               pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
-                               pgprot_val(vma->vm_page_prot) &= ~_PAGE_PWT;
-                       }
+               if (boot_cpu_data.x86 > 3 && map->type != _DRM_AGP) {
+                       pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
+                       pgprot_val(vma->vm_page_prot) &= ~_PAGE_PWT;
+               }
 #elif defined(__powerpc__)
-                       pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE | 
_PAGE_GUARDED;
+               pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE;
+               if (map->type == _DRM_REGISTERS)
+                       pgprot_val(vma->vm_page_prot) |= _PAGE_GUARDED;
 #endif
-                       vma->vm_flags |= VM_IO; /* not in core dump */
-               }
+               vma->vm_flags |= VM_IO; /* not in core dump */
 #if defined(__ia64__)
                if (efi_range_is_wc(vma->vm_start, vma->vm_end -
                                    vma->vm_start))
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to