Subject: Re: port-i386/34986
To: None <port-i386-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: Blair Sadewitz <blair.sadewitz@gmail.com>
List: netbsd-bugs
Date: 11/30/2006 13:50:02
The following reply was made to PR port-i386/34986; it has been noted by GNATS.

From: "Blair Sadewitz" <blair.sadewitz@gmail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: port-i386/34986
Date: Thu, 30 Nov 2006 08:49:19 -0500

 I installed the i386 port and found that DVMT does not have to be
 disabled, at least on the 945G, if agp(4) is used.  However,
 Xorg/Xfree86 (tested with 6.9.0 and 4.6.0, respectively) still hang if
 the aperture is set to 128M instead of 256M in the BIOS.  This is
 because the aperture detection in this code:
 
         } else {        /* CHIP_I915 */
                 u_int16_t msac;
 
                 reg = pci_conf_read(sc->as_pc, sc->as_tag, AGP_I915_MSAC);
                 msac = (u_int16_t)(reg >> 16);
                 if (msac & AGP_I915_MSAC_APER_128M)
                         return 128 * 1024 * 1024;
                 else
                         return 256 * 1024 * 1024;
         }
 
 In agp_i810_get_aperture() does not work because intel violates its
 own spec; the MSAC bit is not set according to the aperture.
 
 On amd64, by default agp(4) is not used, so there are even more
 problems. I tried enabling agp(4) on  amd64, but I get strange
 corruption of scrolling xterms and a white block for a cursor (ARGB
 cursor memory not being allocated correctly).
 
 On FreeBSD, they use this driver on amd64, and it presumably works.
 Someone with the capabilities to sync this code with FreeBSD's driver
 really should, because there have been a few fixes of crtiical
 problems.  Note that they also do not use the "Evil hack" for
 PGTBL_CTL getting overwritten; I replaced this code with their sanity
 checking code in the same place and never had a problem with crashes,
 etc.  My BIOS has an option to fix the amount of allocated memory and
 aperture size, but the code never seems to detect this properly,
 otherwise I would simply forego using agp(4).  Currently, I can do
 this, but obviously I won't get enough video memory to use Xv, so this
 is not an acceptable solution.  Moreover, not all BIOSes--such as
 those on laptops--apparently have this feature (if it even does
 anything).
 
 Again, for someone who fully understands how this driver works,
 synching it to the FreeBSD driver shouldn't be hard and would be
 welcome by myself and I'm sure many others. Agp.c may have to be
 updated as well.  Details are available in FreeBSD's CVS log.
 
 Regards,
 
 -Blair