Subject: Re: i815 graphics chip XF4.3.0 / NetBSD 1.6-release
To: David W <djw@spamcop.net>
From: Greg Troxel <gdt@ir.bbn.com>
List: tech-x11
Date: 03/05/2003 09:40:14
I also have a Dell computer with an i815 chip that gave me trouble.

As someone else mentioned, you need agp in the kernel.  I have:
	agp*    at pchb?

But your second error message gets EINVAL, not 'device not
configured', so this is likely ok.

I have this ~working under 4.2.1, but I initially found that X would
not start.  See the agp kernel code - I added printfs to find the
location where ENOMEM is generated.  I don't remember if that got
turned into EINVAL up the call chain.  After this patch, things
mysteriously worked and I forgot about it.

So, I still suspect that something in the agp kernel code is not quite
right.

In sys/dev/pci, patch agp.c (against 1.6 branch from 20021120, I think):

Index: agp.c
===================================================================
RCS file: /FOO-CVS/netbsd/src/sys/dev/pci/agp.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 agp.c
--- agp.c	2003/02/06 13:29:12	1.1.1.2
+++ agp.c	2003/03/05 14:33:29
@@ -515,6 +515,8 @@
 		nseg = (mem->am_size / (contigpages * PAGE_SIZE)) + 1;
 		segs = malloc(nseg * sizeof *segs, M_AGP, M_WAITOK);
 		if (segs == NULL) {
+			printf("%s: can't allocate %d bus_dma_segment_t (size 0x%x)\n",
+			       sc->as_dev.dv_xname, nseg, (int) mem->am_size);
 			lockmgr(&sc->as_lock, LK_RELEASE, 0);
 			return ENOMEM;
 		}
@@ -544,10 +546,13 @@
 	}
 
 	if (contigpages == 0) {
+		printf("%s: contigpages down to 0!\n",
+		       sc->as_dev.dv_xname);
 		lockmgr(&sc->as_lock, LK_RELEASE, 0);
 		return ENOMEM;
 	}
 
+	printf("%s: about to bind individual pages\n", sc->as_dev.dv_xname);
 
 	/*
 	 * Bind the individual pages and flush the chipset's
@@ -583,6 +588,8 @@
 				bus_dmamem_free(sc->as_dmat, mem->am_dmaseg,
 						mem->am_nseg);
 				free(mem->am_dmaseg, M_AGP);
+				printf("%s, error %d in AGP_BIND_PAGE\n",
+				       sc->as_dev.dv_xname, error);
 				lockmgr(&sc->as_lock, LK_RELEASE, 0);
 				return error;
 			}