All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacob Gorm Hansen <jacobg@diku.dk>
To: xen-devel <xen-devel@lists.sourceforge.net>
Subject: Updated fglrx patch for ATI Radeon and Xen
Date: Wed, 16 Mar 2005 19:51:47 -0800	[thread overview]
Message-ID: <4238FED3.4040507@diku.dk> (raw)

[-- Attachment #1: Type: text/plain, Size: 559 bytes --]

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

[-- Attachment #2: fglrx_xen.patch --]
[-- Type: text/plain, Size: 3375 bytes --]

--- 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__




                 reply	other threads:[~2005-03-17  3:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4238FED3.4040507@diku.dk \
    --to=jacobg@diku.dk \
    --cc=xen-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.