Here are a few small fixes to get r300 going on ia64.  Thanks to Stephane for 
pointing out the resource size mismatch.  The patch just fixes that (PCI 
resources in Linux are 'unsigned long' at the moment, not 'unsigned int') and 
adds the checking for write combining regions I posted earlier since I don't 
think that's been applied.

Thanks,
Jesse
Index: drm/linux-core/drmP.h
===================================================================
RCS file: /cvsroot/r300/r300_driver/drm/linux-core/drmP.h,v
retrieving revision 1.2
diff -u -r1.2 drmP.h
--- drm/linux-core/drmP.h       2 Mar 2005 03:54:27 -0000       1.2
+++ drm/linux-core/drmP.h       8 Mar 2005 18:40:03 -0000
@@ -55,6 +55,9 @@
 #include <linux/smp_lock.h>    /* For (un)lock_kernel */
 #include <linux/mm.h>
 #include <linux/pagemap.h>
+#ifdef __ia64__
+#include <linux/efi.h>
+#endif
 #if defined(__alpha__) || defined(__powerpc__)
 #include <asm/pgtable.h>       /* For pte_wrprotect */
 #endif
@@ -850,7 +853,7 @@
                      unsigned int cmd, unsigned long arg);
 extern int drm_rmmap(struct inode *inode, struct file *filp,
                     unsigned int cmd, unsigned long arg);
-extern int drm_initmap(drm_device_t * dev, unsigned int offset,
+extern int drm_initmap(drm_device_t * dev, unsigned long offset,
                       unsigned int size, unsigned int resource, int type,
                       int flags);
 extern int drm_addbufs(struct inode *inode, struct file *filp,
Index: drm/linux-core/drm_bufs.c
===================================================================
RCS file: /cvsroot/r300/r300_driver/drm/linux-core/drm_bufs.c,v
retrieving revision 1.2
diff -u -r1.2 drm_bufs.c
--- drm/linux-core/drm_bufs.c   2 Mar 2005 03:54:27 -0000       1.2
+++ drm/linux-core/drm_bufs.c   8 Mar 2005 18:40:03 -0000
@@ -53,7 +53,7 @@
  * type.  Adds the map to the map list drm_device::maplist. Adds MTRR's where
  * applicable and if supported by the kernel.
  */
-int drm_initmap(drm_device_t * dev, unsigned int offset, unsigned int size,
+int drm_initmap(drm_device_t * dev, unsigned long offset, unsigned int size,
                unsigned int resource, int type, int flags)
 {
        drm_map_t *map;
@@ -63,7 +63,7 @@
 
        if ((offset & (~PAGE_MASK)) || (size & (~PAGE_MASK)))
                return -EINVAL;
-#if !defined(__sparc__) && !defined(__alpha__)
+#if !defined(__sparc__) && !defined(__alpha__) && !defined(__ia64__)
        if (offset + size < offset || offset < virt_to_phys(high_memory))
                return -EINVAL;
 #endif
Index: drm/linux-core/drm_vm.c
===================================================================
RCS file: /cvsroot/r300/r300_driver/drm/linux-core/drm_vm.c,v
retrieving revision 1.2
diff -u -r1.2 drm_vm.c
--- drm/linux-core/drm_vm.c     2 Mar 2005 03:54:27 -0000       1.2
+++ drm/linux-core/drm_vm.c     8 Mar 2005 18:40:03 -0000
@@ -639,9 +639,13 @@
                        vma->vm_flags |= VM_IO; /* not in core dump */
                }
 #if defined(__ia64__)
-               if (map->type != _DRM_AGP)
+               if (efi_range_is_wc(vma->vm_start, vma->vm_end -
+                                   vma->vm_start) && (map->type != _DRM_AGP))
                        vma->vm_page_prot =
-                           pgprot_writecombine(vma->vm_page_prot);
+                               pgprot_writecombine(vma->vm_page_prot);
+               else
+                       vma->vm_page_prot =
+                               pgprot_noncached(vma->vm_page_prot);
 #endif
                offset = dev->driver->get_reg_ofs(dev);
 #ifdef __sparc__

Reply via email to