Date: Thu, 12 Jul 2007 13:55:31 -0700 From: Eric Anholt <eric@anholt.net> To: re@freebsd.org, current@freebsd.org Subject: request for approval: G965 AGP support Message-ID: <1184273731.44469.16.camel@vonnegut>
next in thread | raw e-mail | index | archive | help
--=-AXWcD71UA0EuCnCMobb0 Content-Type: multipart/mixed; boundary="=-5YELsow3Fpr9UE+T3E/E" --=-5YELsow3Fpr9UE+T3E/E Content-Type: text/plain Content-Transfer-Encoding: quoted-printable I think I've finally got my G965 AGP support ready to commit. I've tested on the GM965 and in a previous version the 915GM, and with kib@'s DRM fix things are looking good. Proposed commit message: Add support for G965/Q965/GM965/GME965/GME945 AGP. This adds a function to agp.c to set the aperture resource ID if it's not the usual AGP_APBASE. Previously, agp.c had been assuming AGP_APBASE, which resulted in incorrect agp_info, and contortions by agp_i810.c to work around it. Also, add functions to agp.c for default AGP_GET_APERTURE() and AGP_SET_APERTURE(), which return the aperture resource size and disallow aperture size changes. Moving to these for our AGP drivers will likely result in stability improvements. This should fix 855-class aperture size detection. Additionally, refuse to attach agp_i810 when some RAM is above 4GB and the GART can't reference memory that high. This should be very rare. The correct solution would be bus_dma conversion for agp, which is beyond the scope of this change. Other AGP drivers could likely use this change as well. G33/Q35/Q33 AGP support is also included, but disconnected by default due to lack of testing. PR: kern/109724 (855 aperture issue) Submitted by: FUJIMOTO Kou<fujimoto@j.dendai.ac.jp> --=20 Eric Anholt anholt@FreeBSD.org eric@anholt.net eric.anholt@intel.com --=-5YELsow3Fpr9UE+T3E/E Content-Disposition: attachment; filename=agp-i965-6.diff Content-Type: text/x-patch; name=agp-i965-6.diff; charset=UTF-8 Content-Transfer-Encoding: base64 SW5kZXg6IGFncC5jDQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09DQpSQ1MgZmlsZTogL2hvbWUvbmN2cy9zcmMvc3lzL3Bj aS9hZ3AuYyx2DQpyZXRyaWV2aW5nIHJldmlzaW9uIDEu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DQorDQorLyoNCiAgKiBOVklE SUEgbkZvcmNlL25Gb3JjZTIgcmVnaXN0ZXJzDQogICovDQogI2RlZmluZQlBR1BfTlZJRElBXzBf QVBCQVNFCQkweDEwDQo= --=-5YELsow3Fpr9UE+T3E/E-- --=-AXWcD71UA0EuCnCMobb0 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQBGlpU7HUdvYGzw6vcRAmScAJ9XE16Dp6YZMvoQqDi+EN/WMpuT1wCfbz0S O/A4lvsK+ALpDkacjIY7vIQ= =6K8w -----END PGP SIGNATURE----- --=-AXWcD71UA0EuCnCMobb0--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1184273731.44469.16.camel>