Hi,
due to kernel interface changes between 2.6.10 and 2.6.11, the version of DRM included in the r300_driver CVS tree won't compile on my 2.6.11-rc4 kernel.
The attached patch fixes the problem for me (it compiles and seems to work too). Could it be merged into CVS so r300_driver users/hackers upgrade to 2.6.11 and later?
Cheers, Lorenzo
Index: r300_driver/drm/linux-core/drm_compat.h =================================================================== RCS file: /cvsroot/r300/r300_driver/drm/linux-core/drm_compat.h,v retrieving revision 1.1 diff -u -r1.1 drm_compat.h --- r300_driver/drm/linux-core/drm_compat.h 23 Oct 2004 12:43:44 -0000 1.1 +++ r300_driver/drm/linux-core/drm_compat.h 2 Mar 2005 17:59:47 -0000 @@ -191,6 +191,31 @@ } #endif +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,10) +typedef struct { + void (*free_memory)(struct agp_memory *); + struct agp_memory * (*allocate_memory)(size_t, u32); + int (*bind_memory)(struct agp_memory *, off_t); + int (*unbind_memory)(struct agp_memory *); + void (*enable)(u32); + int (*acquire)(void); + void (*release)(void); + int (*copy_info)(struct agp_kern_info *); +} drm_agp_t; + +static const drm_agp_t drm_agp_stub = { + &agp_free_memory, + &agp_allocate_memory, + &agp_bind_memory, + &agp_unbind_memory, + &agp_enable, + &agp_backend_acquire, + &agp_backend_release, + &agp_copy_info +}; + +#endif + extern const drm_agp_t drm_agp_entry; /* old architectures */ Index: r300_driver/drm/linux-core/drm_memory.h =================================================================== RCS file: /cvsroot/r300/r300_driver/drm/linux-core/drm_memory.h,v retrieving revision 1.1 diff -u -r1.1 drm_memory.h --- r300_driver/drm/linux-core/drm_memory.h 23 Oct 2004 12:43:44 -0000 1.1 +++ r300_driver/drm/linux-core/drm_memory.h 2 Mar 2005 17:59:47 -0000 @@ -137,7 +137,12 @@ static inline unsigned long drm_follow_page(void *vaddr) { pgd_t *pgd = pgd_offset_k((unsigned long)vaddr); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11) pmd_t *pmd = pmd_offset(pgd, (unsigned long)vaddr); +#else + pud_t *pud = pud_offset(pgd, (unsigned long)vaddr); + pmd_t *pmd = pmd_offset(pud, (unsigned long)vaddr); +#endif pte_t *ptep = pte_offset_kernel(pmd, (unsigned long)vaddr); return pte_pfn(*ptep) << PAGE_SHIFT; }