1 --- X11-driver-firegl-8.10.19/lib/modules/fglrx/build_mod/agpgart_be.c.orig 2005-01-31 19:50:00.000000000 +0200
2 +++ X11-driver-firegl-8.10.19/lib/modules/fglrx/build_mod/agpgart_be.c 2005-03-02 22:19:25.000000000 +0200
4 #define firegl_pci_find_class(class,from) pci_find_class(class,from)
7 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
8 +#define firegl_pci_find_class(class,from) pci_get_class(class,from)
10 +#define firegl_pci_find_class(class,from) pci_find_class(class,from)
13 int agp_backend_acquire(void)
15 if (agp_bridge.type == NOT_SUPPORTED) {
16 @@ -4075,6 +4081,13 @@
21 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
22 + // the reference count has been increased in agp_backend_initialize.
24 + pci_dev_put(device);
28 * PASS3: Figure out the 8X/4X setting and enable the
29 * target (our motherboard chipset).
30 @@ -5283,6 +5296,12 @@
34 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
35 + // the reference count has been increased in agp_backend_initialize.
37 + pci_dev_put(device);
40 return(0); /* success */
43 @@ -7428,6 +7447,11 @@
47 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
48 + // decrease the reference count.
49 + pci_dev_put(agp_bridge.dev);
52 if (agp_bridge.needs_scratch_page == TRUE) {
53 agp_bridge.scratch_page = agp_bridge.agp_alloc_page();
55 --- X11-driver-firegl-8.10.19/lib/modules/fglrx/build_mod/firegl_public.c.orig 2005-02-10 04:15:00.000000000 +0200
56 +++ X11-driver-firegl-8.10.19/lib/modules/fglrx/build_mod/firegl_public.c 2005-03-02 22:21:42.000000000 +0200
57 @@ -1664,13 +1664,22 @@
59 unsigned long pte_linear;
61 +#if LINUX_VERSION_CODE > 0x02060a /* KERNEL_VERSION(2,6,11) */
68 pte_linear = VMALLOC_VMADDR(virtual_addr); // convert to pte linear address (x86 => nop)
69 pgd_p = pgd_offset(mm, pte_linear);
70 +#if LINUX_VERSION_CODE > 0x02060a /* KERNEL_VERSION(2,6,11) */
71 + pud_p = pud_offset(pgd_p, pte_linear);
72 + pmd_p = pmd_offset(pud_p, pte_linear);
74 pmd_p = pmd_offset(pgd_p, pte_linear);
77 #ifndef FGL_ATOMIC_PTE
78 #if LINUX_VERSION_CODE > 0x020500
79 pte_p = pte_offset_kernel(pmd_p, pte_linear);
81 unsigned long address)
84 +#if LINUX_VERSION_CODE > 0x02060a /* KERNEL_VERSION(2,6,11) */
90 @@ -2200,7 +2212,12 @@
91 /* alternatively we could generate a NOPAGE_OOM "out of memory" */
93 /* locate medium level page table (x86 => nop) */
94 +#if LINUX_VERSION_CODE > 0x02060a /* KERNEL_VERSION(2,6,11) */
95 + pud_p = pud_offset(pgd_p, pte_linear);
96 + pmd_p = pmd_offset(pud_p, pte_linear);
98 pmd_p = pmd_offset(pgd_p, pte_linear);
100 if (!pmd_present(*pmd_p))
102 __KE_ERROR("FATAL ERROR: User queue buffer not present! (pmd)\n");
103 @@ -2564,13 +2581,21 @@
105 unsigned long pte_linear;
107 +#if LINUX_VERSION_CODE > 0x02060a /* KERNEL_VERSION(2,6,11) */
114 pte_linear = VMALLOC_VMADDR(virtual_addr); // convert to pte linear address (x86 => nop)
115 pgd_p = pgd_offset(vma->vm_mm, pte_linear);
116 +#if LINUX_VERSION_CODE > 0x02060a /* KERNEL_VERSION(2,6,11) */
117 + pud_p = pud_offset(pgd_p, pte_linear);
118 + pmd_p = pmd_offset(pud_p, pte_linear);
120 pmd_p = pmd_offset(pgd_p, pte_linear);
122 #ifndef FGL_ATOMIC_PTE
123 #if LINUX_VERSION_CODE > 0x020500
124 pte_p = pte_offset_kernel(pmd_p, pte_linear);
125 @@ -2719,13 +2744,13 @@
126 #endif /* __ia64__ */
127 vma->vm_flags |= VM_IO; /* not in core dump */
129 - if (remap_page_range(FGL_VMA_API_PASS
130 + if (remap_pfn_range(FGL_VMA_API_PASS
132 - __ke_vm_offset(vma),
133 + __ke_vm_offset(vma) >> PAGE_SHIFT,
134 vma->vm_end - vma->vm_start,
137 - __KE_DEBUG("remap_page_range failed\n");
138 + __KE_DEBUG("remap_pfn_range failed\n");
141 vma->vm_flags |= VM_SHM | VM_RESERVED; /* Don't swap */
142 @@ -2786,13 +2811,13 @@
144 if (__ke_vm_offset(vma) >= __pa(high_memory))
145 vma->vm_flags |= VM_IO; /* not in core dump */
146 - if (remap_page_range(FGL_VMA_API_PASS
147 + if (remap_pfn_range(FGL_VMA_API_PASS
149 - __ke_vm_offset(vma),
150 + __ke_vm_offset(vma) >> PAGE_SHIFT,
151 vma->vm_end - vma->vm_start,
154 - __KE_DEBUG("remap_page_range failed\n");
155 + __KE_DEBUG("remap_pfn_range failed\n");
159 @@ -2823,13 +2848,13 @@
161 if (__ke_vm_offset(vma) >= __pa(high_memory))
162 vma->vm_flags |= VM_IO; /* not in core dump */
163 - if (remap_page_range(FGL_VMA_API_PASS
164 + if (remap_pfn_range(FGL_VMA_API_PASS
166 - __ke_vm_offset(vma),
167 + __ke_vm_offset(vma) >> PAGE_SHIFT,
168 vma->vm_end - vma->vm_start,
171 - __KE_DEBUG("remap_page_range failed\n");
172 + __KE_DEBUG("remap_pfn_range failed\n");
176 @@ -2873,6 +2898,37 @@
178 #if LINUX_VERSION_CODE >= 0x020400
180 +#if LINUX_VERSION_CODE >= 0x02060b
183 + void (*free_memory)(struct agp_memory *);
184 + struct agp_memory * (*allocate_memory)(size_t, u32);
185 + int (*bind_memory)(struct agp_memory *, off_t);
186 + int (*unbind_memory)(struct agp_memory *);
187 + void (*enable)(u32);
188 + int (*acquire)(void);
189 + void (*release)(void);
190 + int (*copy_info)(struct agp_kern_info *);
193 +static const drm_agp_t drm_agp = {
195 + &agp_allocate_memory,
197 + &agp_unbind_memory,
199 + &agp_backend_acquire,
200 + &agp_backend_release,
203 +#undef DRM_AGP_MODULE_GET
204 +#undef DRM_AGP_MODULE_PUT
206 +#define DRM_AGP_MODULE_GET &drm_agp
207 +#define DRM_AGP_MODULE_PUT
211 static const drm_agp_t *drm_agp_module_stub = NULL;
213 #define AGP_FUNCTIONS 8