[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Updated fglrx patch for ATI Radeon and Xen


  • To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxxx>
  • From: Jacob Gorm Hansen <jacobg@xxxxxxx>
  • Date: Wed, 16 Mar 2005 19:51:47 -0800
  • Delivery-date: Thu, 17 Mar 2005 03:53:02 +0000
  • List-id: List for Xen developers <xen-devel.lists.sourceforge.net>

hi,

I've cleaned up the patch and updated it to work with the latest 8.10.19 version of the ATI driver. I've tested it on Gentoo with xorg 6.8.0-r5 (just change the ebuild to apply this patch after the other patches in src_unpack()) and seems to work fine, including OpenGL acceleration.

I was unable to get fglrx working with xorg 6.8.2, because they changed to format of the driver modules from .o to .so. Attempts at hacking around this (converting the fglrx X module to .so by hand) were unsuccessful.

The patch is attached.

Best regards,
Jacob
--- orig/agpgart_be.c
+++ mod/agpgart_be.c
@@ -81,6 +81,10 @@
  *   version 1.1.1.8, 2001-10-09, CVS-Tag: LINUX_2_4_13
  */
 
+#ifdef CONFIG_XEN
+#define CONFIG_X86
+#endif
+
 // dual boards problem:
 // MGA G450 (PCI) looks like an AGP board
 #define FGL_FIX
@@ -1177,7 +1181,7 @@
     if (!err)    
 #endif
     {
-       agp_bridge.gatt_table = ioremap_nocache(virt_to_phys(table),
+       agp_bridge.gatt_table = ioremap_nocache(virt_to_bus(table),
                                        (PAGE_SIZE * (1 << page_order)));
     }
        CACHE_FLUSH();
@@ -3214,7 +3218,7 @@
     if (!err)
 #endif
     {
-        page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real), 
+        page_map->remapped = ioremap_nocache(virt_to_bus(page_map->real), 
             PAGE_SIZE);
     }
 
@@ -4687,7 +4691,7 @@
     if (!err)
 #endif
     {
-       page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real), 
+       page_map->remapped = ioremap_nocache(virt_to_bus(page_map->real), 
                                            PAGE_SIZE);
     }
 


--- orig/firegl_public.c
+++ mod/firegl_public.c
@@ -25,13 +25,18 @@
 // ============================================================
 #include <linux/version.h>
 #include <linux/autoconf.h>
+#include <asm/pgtable.h>
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,71)
 #define EXPORT_SYMTAB  1
 #endif
 
+#ifdef CONFIG_XEN
+#define CONFIG_X86
+#endif
+
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,71)
-#if !defined(CONFIG_X86_PC) 
+#if !defined(CONFIG_X86) 
 #if !defined(CONFIG_X86_64)
 #if !defined(CONFIG_X86_VOYAGER)
 #if !defined(CONFIG_X86_NUMAQ)
@@ -2744,13 +2749,13 @@
 #endif /* __ia64__ */
                 vma->vm_flags |= VM_IO; /* not in core dump */
             }
-            if (remap_pfn_range(FGL_VMA_API_PASS
+            if (io_remap_page_range(vma,
                                  vma->vm_start,
-                                 __ke_vm_offset(vma) >> PAGE_SHIFT,
+                                 __ke_vm_offset(vma),
                                  vma->vm_end - vma->vm_start,
                                  vma->vm_page_prot))
             {
-                __KE_DEBUG("remap_pfn_range failed\n");
+                __KE_DEBUG("io_remap_page_range failed\n");
                 return -EAGAIN;
             }
             vma->vm_flags |= VM_SHM | VM_RESERVED; /* Don't swap */
@@ -2811,13 +2816,13 @@
                        {
                                if (__ke_vm_offset(vma) >= __pa(high_memory))
                                        vma->vm_flags |= VM_IO; /* not in core 
dump */
-                               if (remap_pfn_range(FGL_VMA_API_PASS
+                               if (io_remap_page_range(vma,
                                                                         
vma->vm_start,
-                                                                        
__ke_vm_offset(vma) >> PAGE_SHIFT,
+                                                                        
__ke_vm_offset(vma),
                                                                         
vma->vm_end - vma->vm_start,
                                                                         
vma->vm_page_prot))
                                {
-                                       __KE_DEBUG("remap_pfn_range failed\n");
+                                       __KE_DEBUG("io_remap_page_range 
failed\n");
                                        return -EAGAIN;
                                }
 #ifdef __x86_64__
@@ -2848,13 +2853,13 @@
                        {
                                if (__ke_vm_offset(vma) >= __pa(high_memory))
                                        vma->vm_flags |= VM_IO; /* not in core 
dump */
-                               if (remap_pfn_range(FGL_VMA_API_PASS
+                               if (io_remap_page_range(vma,
                                                                         
vma->vm_start,
-                                                                        
__ke_vm_offset(vma) >> PAGE_SHIFT,
+                                                                        
__ke_vm_offset(vma),
                                                                         
vma->vm_end - vma->vm_start,
                                                                         
vma->vm_page_prot))
                                {
-                                       __KE_DEBUG("remap_pfn_range failed\n");
+                                       __KE_DEBUG("io_remap_page_range 
failed\n");
                                        return -EAGAIN;
                                }
 #ifdef __x86_64__




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.