Commit Graph

25 Commits

Author SHA1 Message Date
Pedro F. Giffuni
4ec642f1d6 dev/agp: use our nitems() macro when it is avaliable through param.h.
Consistently capitalize the macros used in the driver.

No functional change.
2016-04-19 23:31:35 +00:00
Tijl Coosemans
4e612cddb9 In agp(4) avoid the need to flush all cpu caches with wbinvd between
updating the GTT and flushing the AGP TLB by storing the GTT in
write-combining memory.

On x86 flushing the AGP TLB is done by an I/O operation or a store to a
MMIO register in uncacheable memory.  Both cases imply that WC buffers are
flushed so no memory barriers are needed.

On powerpc there is no WC memory type.  It maps to uncacheable memory and
two stores to uncacheable memory, such as to the GTT and then to an MMIO
register, are strongly ordered, so no memory barriers are needed either.

MFC after:	1 month
2014-11-02 11:26:37 +00:00
Antoine Brodin
dfa4d7fdb9 Remove unneeded semicolons.
Reviewed by:	md5 of the object files
2013-01-01 18:16:49 +00:00
Eitan Adler
9e93aa2336 Remove unneeded header from agp: opt_bus.h
Tested with "make universe"

Approved by:	cperciva
MFC after:	1 week
2012-11-15 18:49:17 +00:00
Eitan Adler
a8de37b024 This isn't functionally identical. In some cases a hint to disable
unit 0 would in fact disable all units.

This reverts r241856

Approved by: cperciva (implicit)
2012-10-22 13:06:09 +00:00
Eitan Adler
76b7512247 Now that device disabling is generic, remove extraneous code from the
device drivers that used to provide this feature.

Reviewed by:	des
Approved by:	cperciva
MFC after:	1 week
2012-10-22 03:41:14 +00:00
Robert Noland
45d0290a5d vm_offset_t is unsigned and therefore can not be negative.
Avoid unnessecary compares.

Found with:	Coverity Prevent(tm)
CID:		2362,4215,4214,4209,4208,2363,4211,4210,4213,4212

MFC after:	3 days
2009-03-20 18:30:20 +00:00
Warner Losh
cd6d5177a7 Fix prototypes to be consistent. 2009-03-09 13:27:33 +00:00
Jung-uk Kim
7dcbc463ef Add support for AMD64 Family 10h processors.
PR:		kern/128331
MFC after:	3 days
2009-01-12 16:07:03 +00:00
John Baldwin
dbac8ff400 Move the agp(4) driver from sys/pci to sys/dev/agp. __FreeBSD_version was
bumped to 800004 to note the change though userland apps should not be
affected since they use <sys/agpio.h> rather than the headers in
sys/dev/agp.

Discussed with:	anholt
Repocopy by:	simon
2007-11-12 21:51:38 +00:00
John Baldwin
f82a1d4987 Split agp_generic_detach() up into two routines: agp_free_cdev() destroys
/dev/agpgart and agp_free_res() frees resources like the BAR for the
aperture.  Splitting this up lets chipset-specific detach routines
manipulate the aperture during their detach routines without panicing.

MFC after:	1 week
Reviewed by:	anholt
2007-10-30 22:09:16 +00:00
Jung-uk Kim
2a9dc1317c Fix style(9) nits. 2006-10-09 20:26:32 +00:00
Jung-uk Kim
b5d9e49dcc Fix 32-bit PTE in the GART table.
Noticed by:	jmg
2006-10-09 20:24:49 +00:00
Jung-uk Kim
668e25a26c Use aperture base address from north bridge. Some BIOS does not encode
misc. control registers correctly and it is inconsistent with north bridge.
In fact, there are too many broken BIOS implementations out there and we
cannot fix every possible combination but at least it is consistent with
what we advertise with ioctl(2).
2006-08-21 19:10:58 +00:00
Jung-uk Kim
08945e887f Move SiS 760 to where it belongs.
PR:		98094
Submitted by:	Mike M < mmcgus at yahoo dot com >
2006-05-30 18:41:26 +00:00
John Baldwin
c626f1fe9a Change the various AGP drivers that attach to the Host-PCI bridge device to
attach to the hostb driver instead.  This means that agp can now be loaded
at runtime (in theory at least).  Also, the drivers no longer have to
explicity call device_verbose() to cancel out any earlier calls to
device_quiet() by the hostb(4) driver (this shows a limitation in new-bus,
drivers really shouldn't be doing device_quiet() until they know they are
going to drive that device, i.e. in attach).
2005-12-20 21:12:26 +00:00
Jung-uk Kim
5c0619a7f0 0xb1881106 seems to be an AGP bridge and some BIOSes incorrectly handle
the bridge.  Therefore, we give the same treatment as we did for nForce3-250
and ULi chipsets.  VIA AGPv3 code was copied from agp_via.c.
2005-11-14 21:54:20 +00:00
Jung-uk Kim
d8e205ef93 - Add a work-around for nForce3-250. Aperture base address encoded in misc.
control register and AGP bridge seems to be inconsistent with some BIOS.
Instead of relying on BIOS settings, we just take the initial aperture size
and encode them for both miscellaneous control register and AGP bridge.
Some idea was borrowed from agp_nvidia.c.

- Add preliminary ULi M1689 chipset support.  The idea was taken from Linux
because hardware and documentation are unavailable.  Not tested.

- Add more VIA chipset PCI IDs taken from Linux driver.

Approved by:	anholt (mentor)
Tested by:	Adam Gregoire <ebola at psychoholics dot org>
		Ganael Laplanche <ganael.laplanche at martymac dot com>
		K Wieland <kwieland at wustl dot edu>
2005-09-27 20:57:50 +00:00
David E. O'Brien
fd92279bef Add nForce3-250. 2005-04-08 18:04:39 +00:00
David E. O'Brien
824a5e96dc nVidia AGP chipsets beyond nForce2 are AMD64-specific.
So move the AGP support to there.

Submitted by:	Jung-uk Kim <jkim@niksun.com>
2005-04-02 01:10:09 +00:00
Warner Losh
d701c91325 Return BUS_PROBE_DEFAULT instead of 0. 2005-02-24 21:32:56 +00:00
Eric Anholt
9271f7b6d5 Correct the SiS 755 PCI ID. Confirmed against Linux code.
PR:		kern/76411
Submitted by:	Jonathan Fosburgh, jonathan at fosburgh dot org
Obtained from:	Jung-uk Kim, jkim at niksun.com
2005-02-14 07:30:04 +00:00
Eric Anholt
161cb1a5c6 Add PCI ID for VIA K8T800Pro chipset. Tested with agptest and X with DRI
enabled, but not 3D.
2004-10-05 04:40:32 +00:00
David E. O'Brien
f49f2ca64e Unconditionally support the AMD64 GART HW. 2004-08-19 20:58:24 +00:00
David E. O'Brien
3c749e3fb1 AMD64 on-CPU GART support.
This also applies to AMD64 HW running 'i386' OS.

Submitted by:	Jung-uk Kim <jkim@niksun.com>
Integration by:	obrien
2004-08-16 12:25:48 +00:00