From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jacob Gorm Hansen Subject: Updated fglrx patch for ATI Radeon and Xen Date: Wed, 16 Mar 2005 19:51:47 -0800 Message-ID: <4238FED3.4040507@diku.dk> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------020805080803010601030802" Sender: xen-devel-admin@lists.sourceforge.net Errors-To: xen-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: xen-devel List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------020805080803010601030802 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------020805080803010601030802 Content-Type: text/plain; name="fglrx_xen.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="fglrx_xen.patch" --- 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 #include +#include #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__ --------------020805080803010601030802-- ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click