Re: Improved DRM support for cant_use_aperture platforms

David Mosberger (davidm@napali.hpl.hp.com)
Tue, 13 May 2003 00:43:15 -0700


>>>>> On 13 May 2003 02:34:41 +0200, Michel Dänzer <michel@daenzer.net> said:

>> It should be possible to add vmap() and vunmap() to kernel/vmalloc.c
>> on older kernels. I think those are the only dependencies

Michel> There are a couple more, like pte_offset_kernel(), pte_pfn(),
Michel> pfn_to_page() and flush_tlb_kernel_range(). Getting this working with
Michel> 2.4 seems like a lot of work and/or ugly. :\

Actually, it turns out I'm really not well positioned to do this,
because the ia64 agp patch for 2.4 looks very different from the 2.5
and your tree looks rather different from the DRM stuff that's in the
official Linux tree (correct me if I'm wrong here).

Anyhow, this should get you close to compiling (and working,
hopefully), modulo vmap/vunmap:

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
# define pte_offset_kernel(dir, address) pte_offset(dir, address)
# define pte_pfn(pte) (pte_page(pte) - mem_map)
# define flush_tlb_kernel_range(s,e) flush_tlb_all()
#endif

The above definition of pte_pfn() is not truly platform-independent,
but I believe it works on all platforms that support AGP. The problem
is that we can't just use page_address(), because the physical address
in the PTE may not be a valid memory address (it could be an I/O
address).

--david
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/