Skip to contentSkip to conversation

mvista.com rsync linuxppc-2.5 -- drivers/char/drm/drm_memory.h:145: `radeon_mem_stats' undeclared (first use in this function)

DISCUSSION Miles Lane 2 participants 3 messages May 7, 2003 Char and misc drivers

lore
Share & tools
lore

Miles Lane

author
#0 lore raw
Gnu C                  3.2.2
Gnu make               3.80
util-linux             2.11x
mount                  2.11x
module-init-tools      0.9.11a
e2fsprogs              1.32
pcmcia-cs              3.2.3
PPP                    2.4.1
Linux C Library        2.3.1
Dynamic linker (ldd)   2.3.1
Procps                 3.1.6
Net-tools              1.60
Console-tools          0.2.3
Sh-utils               4.5.7

gcc -Wp,-MD,drivers/char/drm/.radeon_drv.o.d -D__KERNEL__ -Iinclude
-Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -Iarch/ppc -msoft-float -pipe -ffixed-r2 -Wno-uninitialized -mmultiple -mstring -fomit-frame-pointer -nostdinc -iwithprefix include
-DKBUILD_BASENAME=radeon_drv -DKBUILD_MODNAME=radeon -c -o
drivers/char/drm/radeon_drv.o drivers/char/drm/radeon_drv.c In file included from drivers/char/drm/radeon_drv.c:49:
drivers/char/drm/drm_memory.h: In function `radeon_ioremap_agp':
drivers/char/drm/drm_memory.h:145: `radeon_mem_stats' undeclared (first use in this function)
drivers/char/drm/drm_memory.h:145: (Each undeclared identifier is reported only once
drivers/char/drm/drm_memory.h:145: for each function it appears in.) drivers/char/drm/drm_memory.h:157: `radeon_mem_lock' undeclared (first use in this function)
drivers/char/drm/drm_memory.h: In function `radeon_ioremap_agp_free':
drivers/char/drm/drm_memory.h:212: `radeon_mem_stats' undeclared (first use in this function)
drivers/char/drm/drm_memory.h:216: `radeon_mem_lock' undeclared (first use in this function)
make[3]: *** [drivers/char/drm/radeon_drv.o] Error 1

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#1 lore raw
Quoted 14 lines · Miles Lane
   gcc -Wp,-MD,drivers/char/drm/.radeon_drv.o.d -D__KERNEL__ -Iinclude
(quoted diff) +0 -3
-Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing
-fno-common -Iarch/ppc -msoft-float -pipe -ffixed-r2 -Wno-uninitialized
-mmultiple -mstring -fomit-frame-pointer -nostdinc -iwithprefix include
    -DKBUILD_BASENAME=radeon_drv -DKBUILD_MODNAME=radeon -c -o

drivers/char/drm/radeon_drv.o drivers/char/drm/radeon_drv.c In file included from drivers/char/drm/radeon_drv.c:49:
drivers/char/drm/drm_memory.h: In function `radeon_ioremap_agp':
drivers/char/drm/drm_memory.h:145: `radeon_mem_stats' undeclared (first use in this function)
drivers/char/drm/drm_memory.h:145: (Each undeclared identifier is reported only once
drivers/char/drm/drm_memory.h:145: for each function it appears in.)

Quoted 8 lines

drivers/char/drm/drm_memory.h:157: `radeon_mem_lock' undeclared (first use in this function)
drivers/char/drm/drm_memory.h: In function `radeon_ioremap_agp_free':
drivers/char/drm/drm_memory.h:212: `radeon_mem_stats' undeclared (first use in this function)
drivers/char/drm/drm_memory.h:216: `radeon_mem_lock' undeclared (first use in this function)
make[3]: *** [drivers/char/drm/radeon_drv.o] Error 1

I've fixed this in my local DRI tree and can come up with a patch for linuxppc-2.5 if nobody beats me to it.

--
Earthling Michel Dänzer \ Debian (powerpc), XFree86 and DRI developer
Software libre enthusiast \ http://svcs.affero.net/rm.php?r=daenzer

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#2 lore raw
Quoted 18 lines · Michel Dänzer
Quoted 17 lines · Miles Lane
   gcc -Wp,-MD,drivers/char/drm/.radeon_drv.o.d -D__KERNEL__ -Iinclude
(quoted diff) +0 -3
-Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing
-fno-common -Iarch/ppc -msoft-float -pipe -ffixed-r2 -Wno-uninitialized
-mmultiple -mstring -fomit-frame-pointer -nostdinc -iwithprefix include
    -DKBUILD_BASENAME=radeon_drv -DKBUILD_MODNAME=radeon -c -o

drivers/char/drm/radeon_drv.o drivers/char/drm/radeon_drv.c In file included from drivers/char/drm/radeon_drv.c:49:
drivers/char/drm/drm_memory.h: In function `radeon_ioremap_agp':
drivers/char/drm/drm_memory.h:145: `radeon_mem_stats' undeclared (first use in this function)
drivers/char/drm/drm_memory.h:145: (Each undeclared identifier is reported only once
drivers/char/drm/drm_memory.h:145: for each function it appears in.) drivers/char/drm/drm_memory.h:157: `radeon_mem_lock' undeclared (first use in this function)
drivers/char/drm/drm_memory.h: In function `radeon_ioremap_agp_free':

Quoted 8 lines
Quoted 5 lines

drivers/char/drm/drm_memory.h:212: `radeon_mem_stats' undeclared (first use in this function)
drivers/char/drm/drm_memory.h:216: `radeon_mem_lock' undeclared (first use in this function)
make[3]: *** [drivers/char/drm/radeon_drv.o] Error 1

I've fixed this in my local DRI tree and can come up with a patch for linuxppc-2.5 if nobody beats me to it.

Voilà.

--
Earthling Michel Dänzer \ Debian (powerpc), XFree86 and DRI developer
Software libre enthusiast \ http://svcs.affero.net/rm.php?r=daenzer

drivers/char/drm/drm_memory.h +33 -71
diff -up -r linuxppc-2.5/drivers/char/drm/drm_memory.h linuxppc-2.5.68/drivers/char/drm/drm_memory.h
@@ -123,6 +123,37 @@ void *DRM(ioremap)(unsigned long offset,
 	return ioremap(offset, size);
 }
 
+void *DRM(ioremap_nocache)(unsigned long offset, unsigned long size)
+{
+	return ioremap_nocache(offset, size);
+}
+
+void DRM(ioremapfree)(void *pt, unsigned long size)
+{
+	iounmap(pt);
+}
+
+#if __REALLY_HAVE_AGP
+agp_memory *DRM(alloc_agp)(int pages, u32 type)
+{
+	return DRM(agp_allocate_memory)(pages, type);
+}
+
+int DRM(free_agp)(agp_memory *handle, int pages)
+{
+	return DRM(agp_free_memory)(handle) ? 0 : -EINVAL;
+}
+
+int DRM(bind_agp)(agp_memory *handle, unsigned int start)
+{
+	return DRM(agp_bind_memory)(handle, start);
+}
+
+int DRM(unbind_agp)(agp_memory *handle)
+{
+	return DRM(agp_unbind_memory)(handle);
+}
+
 #ifdef CONFIG_ALL_PPC
 /* PPC specific routine used by ioremap_agp, to be replaced by some
  * more generic implementation
@@ -137,12 +168,7 @@ void *DRM(ioremap_agp)(unsigned long off
 	unsigned int flags = _PAGE_NO_CACHE|_PAGE_KERNEL|_PAGE_PRESENT|_PAGE_RW|_PAGE_DIRTY;
 	int err, i;
 
-	printk("drm: ioremap_agp, offset: 0x%08lx, size: 0x%08lx\n", offset, size);
-
-#if __REALLY_HAVE_AGP
 	if (!size) {
-		DRM_MEM_ERROR(DRM_MEM_MAPPINGS,
-			      "Mapping 0 bytes at 0x%08lx\n", offset);
 		return NULL;
 	}
 
@@ -154,10 +180,6 @@ void *DRM(ioremap_agp)(unsigned long off
 	 */
 	area = get_vm_area(size, VM_IOREMAP);
 	if (area == 0) {
-		spin_lock(&DRM(mem_lock));
-		++DRM(mem_stats)[DRM_MEM_MAPPINGS].fail_count;
-		spin_unlock(&DRM(mem_lock));
-		printk("->NULL\n");
 		return NULL;
 	}
 	pt = (void *)VMALLOC_VMADDR(area->addr);
@@ -175,86 +197,26 @@ void *DRM(ioremap_agp)(unsigned long off
                                 break;
 		}
 		if (!agpmem) {
-			printk("drm: not matching AGP page in ioremap_agp\n");
 			err = 1;
 			break;
 		}
 		index = (baddr - agpmem->bound) >> PAGE_SHIFT;
+		get_page(virt_to_page(__va(agpmem->memory->memory[index])));
 		err = map_page(((unsigned long)pt)+i, agpmem->memory->memory[index], flags);
 	}
 	if (err) {
 		vfree((void *)pt);
-		spin_lock(&DRM(mem_lock));
-		++DRM(mem_stats)[DRM_MEM_MAPPINGS].fail_count;
-		spin_unlock(&DRM(mem_lock));
-		printk("->NULL\n");
 		return NULL;
 	}
 
-	spin_lock(&DRM(mem_lock));
-	++DRM(mem_stats)[DRM_MEM_MAPPINGS].succeed_count;
-	DRM(mem_stats)[DRM_MEM_MAPPINGS].bytes_allocated += size;
-	spin_unlock(&DRM(mem_lock));
-	printk("->pt=0x%p\n", pt);
 	return pt;
-#else
-	return NULL;
-#endif
 }
 
 void DRM(ioremap_agp_free)(void *pt, unsigned long size)
 {
-	int alloc_count;
-	int free_count;
-
-	if (!pt)
-		DRM_MEM_ERROR(DRM_MEM_MAPPINGS,
-			      "Attempt to free NULL pointer\n");
-	else
-		vfree(pt);
-
-	spin_lock(&DRM(mem_lock));
-	DRM(mem_stats)[DRM_MEM_MAPPINGS].bytes_freed += size;
-	free_count  = ++DRM(mem_stats)[DRM_MEM_MAPPINGS].free_count;
-	alloc_count =	DRM(mem_stats)[DRM_MEM_MAPPINGS].succeed_count;
-	spin_unlock(&DRM(mem_lock));
-	if (free_count > alloc_count) {
-		DRM_MEM_ERROR(DRM_MEM_MAPPINGS,
-			      "Excess frees: %d frees, %d allocs\n",
-			      free_count, alloc_count);
-	}
+	vfree(pt);
 }
 #endif	/* CONFIG_ALL_PPC */
 
-void *DRM(ioremap_nocache)(unsigned long offset, unsigned long size)
-{
-	return ioremap_nocache(offset, size);
-}
-
-void DRM(ioremapfree)(void *pt, unsigned long size)
-{
-	iounmap(pt);
-}
-
-#if __REALLY_HAVE_AGP
-agp_memory *DRM(alloc_agp)(int pages, u32 type)
-{
-	return DRM(agp_allocate_memory)(pages, type);
-}
-
-int DRM(free_agp)(agp_memory *handle, int pages)
-{
-	return DRM(agp_free_memory)(handle) ? 0 : -EINVAL;
-}
-
-int DRM(bind_agp)(agp_memory *handle, unsigned int start)
-{
-	return DRM(agp_bind_memory)(handle, start);
-}
-
-int DRM(unbind_agp)(agp_memory *handle)
-{
-	return DRM(agp_unbind_memory)(handle);
-}
 #endif /* agp */
 #endif /* debug_memory */
drivers/char/drm/drm_memory_debug.h +101 -0

105 lines not on this page · raw message

drivers/char/drm/radeon_cp.c +1 -11
diff -up -r linuxppc-2.5/drivers/char/drm/radeon_cp.c linuxppc-2.5.68/drivers/char/drm/radeon_cp.c
@@ -35,9 +35,7 @@
 #include "radeon_drv.h"
 
 #define RADEON_FIFO_DEBUG	0
-#if __REALLY_HAVE_AGP && defined(CONFIG_ALL_PPC)
-extern unsigned long agp_special_page;
-#endif
+
 
 /* CP microcode (from ATI) */
 static u32 R200_cp_microcode[][2] = {
@@ -890,14 +888,6 @@ static void radeon_cp_init_ring_buffer(
 
 #if __REALLY_HAVE_AGP
 	if ( !dev_priv->is_pci ) {
-#if __REALLY_HAVE_AGP && defined(CONFIG_ALL_PPC)
-		if (_machine == _MACH_Pmac) {
-			dev_priv->ring.head = (__volatile__ u32 *) agp_special_page;
-			SET_RING_HEAD( &dev_priv->ring, cur_read_ptr );
-			RADEON_WRITE( RADEON_CP_RB_RPTR_ADDR,
-				    __pa( dev_priv->ring.head ) );
-		} else
-#endif
 		RADEON_WRITE( RADEON_CP_RB_RPTR_ADDR,
 			      dev_priv->ring_rptr->offset
 			      - dev->agp->base