Re: [Dri-devel] Re: Improved DRM support for cant_use_aperture

David Mosberger (davidm@napali.hpl.hp.com)
Mon, 12 May 2003 13:40:30 -0700


OK, could you try with this patch applied on top of my previous patch?
Checking against KERNEL_VERSION(2,5,68) ensures that we have the new
(4-wargument) vmap() call and the "#ifndef PAGE_AGP" part ensures that
things will compile fine until the kernel's asm/agp.h gets updated.

--david

===== drivers/char/drm/drm_memory.h 1.16 vs edited =====
--- 1.16/drivers/char/drm/drm_memory.h Sat May 10 01:32:08 2003
+++ edited/drivers/char/drm/drm_memory.h Mon May 12 13:37:57 2003
@@ -42,7 +42,12 @@
*/
#define DEBUG_MEMORY 0

-#if __REALLY_HAVE_AGP
+/* Need at least kernel v2.5.68 to get the 4-argument version of vmap(). */
+#if __REALLY_HAVE_AGP && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,68))
+
+#ifndef PAGE_AGP
+# define PAGE_AGP PAGE_KERNEL_NOCACHE
+#endif

/*
* Find the drm_map that covers the range [offset, offset+size).
@@ -127,7 +132,7 @@
{
int remap_aperture = 0;

-#if __REALLY_HAVE_AGP
+#if __REALLY_HAVE_AGP && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,68))
if (dev->agp->cant_use_aperture) {
drm_map_t *map = drm_lookup_map(offset, size, dev);

@@ -146,7 +151,7 @@
{
int remap_aperture = 0;

-#if __REALLY_HAVE_AGP
+#if __REALLY_HAVE_AGP && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,68))
if (dev->agp->cant_use_aperture) {
drm_map_t *map = drm_lookup_map(offset, size, dev);

@@ -163,7 +168,7 @@
static inline void drm_ioremapfree(void *pt, unsigned long size, drm_device_t *dev)
{
int unmap_aperture = 0;
-#if __REALLY_HAVE_AGP
+#if __REALLY_HAVE_AGP && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,68))
/*
* This is a bit ugly. It would be much cleaner if the DRM API would use separate
* routines for handling mappings in the AGP space. Hopefully this can be done in

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