NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: xsrc/42262: Thinkpad T500 Intel GM45 Express X doesn't like i915drm



Hi,

It appears agp_i810_borrow does some sanity checks, so that only the
base of the agp aperture can be mapped - i915_drm tries to map the
status page at some other location, which is rejected by agp_i810_borrow.

The attached patch should allow anywhere in the aperture to be mapped.
(Please test with the previous patch too)

-- 
Thanks,
Jeremy
Index: agp_i810.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/agp_i810.c,v
retrieving revision 1.64
diff -u -p -r1.64 agp_i810.c
--- agp_i810.c  4 May 2009 11:05:45 -0000       1.64
+++ agp_i810.c  14 Nov 2009 00:36:22 -0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: agp_i810.c,v 1.64 2009/05/04 11:05:45 markd Exp $      */
+/*     $NetBSD: agp_i810.c,v 1.63 2009/02/19 05:58:37 markd Exp $      */
 
 /*-
  * Copyright (c) 2000 Doug Rabson
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: agp_i810.c,v 1.64 2009/05/04 11:05:45 markd Exp 
$");
+__KERNEL_RCSID(0, "$NetBSD: agp_i810.c,v 1.63 2009/02/19 05:58:37 markd Exp 
$");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -84,6 +84,7 @@ struct agp_i810_softc {
 
 /* XXX hack, see below */
 static bus_addr_t agp_i810_vga_regbase;
+static bus_size_t agp_i810_vga_regsize;
 static bus_space_handle_t agp_i810_vga_bsh;
 
 static u_int32_t agp_i810_get_aperture(struct agp_softc *);
@@ -385,6 +385,7 @@ agp_i810_attach(device_t parent, device_
         * of VGA chip registers
         */
        agp_i810_vga_regbase = mmadr;
+       agp_i810_vga_regsize = mmadrsize;
        agp_i810_vga_bsh = isc->bsh;
 
        return agp_i810_init(sc);
@@ -398,7 +399,8 @@ int
 agp_i810_borrow(bus_addr_t base, bus_space_handle_t *hdlp)
 {
 
-       if (!agp_i810_vga_regbase || base != agp_i810_vga_regbase)
+       if (!agp_i810_vga_regbase || base < agp_i810_vga_regbase
+               || base > agp_i810_vga_regbase + agp_i810_vga_regsize)
                return 0;
        *hdlp = agp_i810_vga_bsh;
        return 1;


Home | Main Index | Thread Index | Old Index