Commit Graph

76 Commits

Author SHA1 Message Date
Peter Edwards
ad50c14e4d Recognise the 82845G AGP bridge, and poke it appropriately at
attach/detach time.

Assigning the default behaviour to this particular device is
incorrect, corrupting the video BIOS aperture, and breaking
VESA support in the kernel and XFree86.

Reviewed By:	dfr
MFC after:	1 week
PR:		kern/62906
2004-03-13 16:06:32 +00:00
Poul-Henning Kamp
dc08ffec87 Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
2004-02-21 21:10:55 +00:00
Poul-Henning Kamp
c9c7976f7f Device megapatch 1/6:
Free approx 86 major numbers with a mostly automatically generated patch.

A number of strategic drivers have been left behind by caution, and a few
because they still (ab)use their major number.
2004-02-21 19:42:58 +00:00
Poul-Henning Kamp
96cf36028e This is not a D_TTY driver. 2004-02-15 10:08:09 +00:00
Eric Anholt
a6cb9d8e99 - Disable AGP on ALI chipsets if aperture size is 0.
- Fail in agp_alloc_gatt if the aperture size is 0 instead of panicing in
  contigmalloc.

Reported by:	Bjoern Fischer <bfischer@Techfak.Uni-Bielefeld.DE>
Reviewed by:	jhb
MFC after:	1 week
2003-11-11 21:49:18 +00:00
John Baldwin
9f9ccd206d Add simple support for AGP 3.0 including enabling 8x mode. The simple
part of the support is that it still assumes one master and one target
where as AGP 3.0 actually supports multiple devices on the bus.

Submitted by:	Keith Whitwell <keith@tungstengraphics.com>
Sponsored by:	The Weather Channel
2003-10-23 18:08:56 +00:00
John Baldwin
65c3981023 Use a switch statement on the devid instead of if-else for determing which
code to use to see if the onboard video has been disabled or not.

Submitted by:	Keith Whitwell <keith@tungstengraphics.com>
2003-10-23 17:48:30 +00:00
Eric Anholt
7efb14ccd3 Make the i810 AGP device create a "drmsub" child device. This will be attached
to by the DRM for i8xx devices.

Submitted by:	Keith Whitwell <keith@tungstengraphics.com>
2003-10-02 19:49:15 +00:00
Eric Anholt
f704d34677 Fix a typo in r1.8: The GTLB enable/flush bit is 1<<7, not 1<<8.
PR:		kern/56297
Submitted by:	Dan Angelescu <mrhsaacdoh@yahoo.com>
2003-09-17 02:58:17 +00:00
Matthew N. Dodd
6b312d762d PCI header files live in dev/pci. 2003-08-23 19:32:18 +00:00
Matthew N. Dodd
34345c0870 AGP GART driver for NVIDIA nForce/nForce2 chipsets. 2003-08-23 18:00:31 +00:00
Warner Losh
19b7ffd1b8 Prefer new location of pci include files (which have only been in the
tree for two or more years now), except in a few places where there's
code to be compatible with older versions of FreeBSD.
2003-08-22 07:20:27 +00:00
John Baldwin
fcccbacd7e Sort the list of PCI ID's in numerical order and fix a whitespace bogon. 2003-06-27 18:17:06 +00:00
Matthew N. Dodd
829ecb807f Add a PCI ID for the Apollo Pro 133A.
PR:		 kern/46983
Submitted by:	 David Holm <david@realityrift.com>
2003-06-23 11:15:22 +00:00
Matthew N. Dodd
b02d3a97f8 Add PCI IDs for the i82855 and i82875P AGP bridges.
PR:		 i386/53136, i386/51802
Submitted by:	 Kyunghwan Kim <redjade@atropos.snu.ac.kr>, Norikatsu Shigemura <nork@FreeBSD.org>
2003-06-23 11:09:45 +00:00
Alan Cox
f873ed0327 Add vm object locking. 2003-06-19 02:01:33 +00:00
Alan Cox
d7ae6bd221 Add vm object locking. 2003-06-13 08:11:14 +00:00
David E. O'Brien
f4636c5959 Use __FBSDID(). 2003-06-11 06:34:30 +00:00
John Baldwin
4fb8dd97a7 Fix support for 256 MB aperture sizes on chipsets such as the 845 and
865.  The APSIZE register has a variable-sized field of enabled bits.
To figure out how many bits a specific host bridge supports, write the
maximum width and see how many bits are set in the hardware.  We then
use this mask for setting and getting the aperture size.  Prior to this,
the agp(4) driver would treat an aperture size of 256 MB as 128 MB and
would not allocate enough physical memory for the GART as a result.

MFC after:	3 days
Sponsored by:	The Weather Channel
Approved by:	re (rwatson)
2003-05-27 20:13:44 +00:00
John Baldwin
ebca65b627 Grr, fix compile. The bane of trying to split out patches into two
commits.

Reported by:	Lukas Ertl <l.ertl@univie.ac.at>
With hat:	re
Pointy hat to:	jhb
2003-05-27 19:42:18 +00:00
John Baldwin
e9ff34a5e2 Add support for the Intel 865 chipset.
MFC after:	3 days
Sponsored by:	The Weather Channel
Approved by:	re (murray)
2003-05-27 18:23:56 +00:00
Matthew N. Dodd
f246e4a17f - Express hard dependencies on bus (pci, isa, pccard) and
network layer (ether).
- Don't abuse module names to facilitate ifconfig module loading;
  such abuse isn't really needed.  (And if we do need type information
  associated with a module then we should make it explicit and not
  use hacks.)
2003-04-15 06:37:30 +00:00
Murray Stokely
887938c12f Fix typo.
PR:		kern/50504
Submitted by:	Alex Semenyaka <alexs@snark.ratmir.ru>
MFC after:	3 days
2003-04-07 10:06:48 +00:00
Jake Burkholder
227f9a1c58 - Add vm_paddr_t, a physical address type. This is required for systems
where physical addresses larger than virtual addresses, such as i386s
  with PAE.
- Use this to represent physical addresses in the MI vm system and in the
  i386 pmap code.  This also changes the paddr parameter to d_mmap_t.
- Fix printf formats to handle physical addresses >4G in the i386 memory
  detection code, and due to kvtop returning vm_paddr_t instead of u_long.

Note that this is a name change only; vm_paddr_t is still the same as
vm_offset_t on all currently supported platforms.

Sponsored by:	DARPA, Network Associates Laboratories
Discussed with:	re, phk (cdevsw change)
2003-03-25 00:07:06 +00:00
Søren Schmidt
64eca1e1f2 Add pci id# for the sis648 2003-03-13 07:55:53 +00:00
Poul-Henning Kamp
7ac40f5f59 Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by:    re(scottl)
2003-03-03 12:15:54 +00:00
Maxime Henrion
07159f9c56 Cleanup of the d_mmap_t interface.
- Get rid of the useless atop() / pmap_phys_address() detour.  The
  device mmap handlers must now give back the physical address
  without atop()'ing it.
- Don't borrow the physical address of the mapping in the returned
  int.  Now we properly pass a vm_offset_t * and expect it to be
  filled by the mmap handler when the mapping was successful.  The
  mmap handler must now return 0 when successful, any other value
  is considered as an error.  Previously, returning -1 was the only
  way to fail.  This change thus accidentally fixes some devices
  which were bogusly returning errno constants which would have been
  considered as addresses by the device pager.
- Garbage collect the poorly named pmap_phys_address() now that it's
  no longer used.
- Convert all the d_mmap_t consumers to the new API.

I'm still not sure wheter we need a __FreeBSD_version bump for this,
since and we didn't guarantee API/ABI stability until 5.1-RELEASE.

Discussed with:		alc, phk, jake
Reviewed by:		peter
Compile-tested on:	LINT (i386), GENERIC (alpha and sparc64)
Runtime-tested on:	i386
2003-02-25 03:21:22 +00:00
Warner Losh
a163d034fa Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00
Eric Anholt
05d1e23aa7 Split the arch-specific AGP files into the appropriate files.* and do the same
for the agp module, and add agp to the list of modules to compile for alpha.
Add an alpha_mb() to agp_flush_cache for alpha -- it's not correct but may
improve the situation, and it's what linux and NetBSD do.
2003-02-14 06:33:52 +00:00
Eric Anholt
11c6a5f80d Remove an extra agp_flush_cache(). The i810 case that needs it already has it. 2003-02-14 06:31:45 +00:00
Eric Anholt
27afae53db Add agpreg.h missed in commit to agp_i810 (adding i85x/i86x AGP support). 2003-02-13 19:24:19 +00:00
Eric Anholt
7978e21002 Add Intel 85x/86x AGP support.
Submitted by:	David Dawes <dawes@xfree86.org>
2003-02-13 07:17:39 +00:00
Alfred Perlstein
44956c9863 Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
2003-01-21 08:56:16 +00:00
Eric Anholt
55dbef54ca Add support for the Intel 82820 UP-only AGP bridge.
PR:		41466
Submitted by:	NIIMI Satoshi <sa2c@sa2c.net>
MFC after:	1 week
2003-01-11 20:08:28 +00:00
Alan Cox
e7863f186a - Hold the page queues lock around vm_page_wakeup(). 2002-12-23 21:47:46 +00:00
Maxime Henrion
7617255f4a Remove a bunch of #include "opt_pci.h". 2002-11-13 17:40:15 +00:00
Marcel Moolenaar
18e0cd7dde Fix previous commit: Don't cast integral types to pointers to
print them with %p. Cast to unsigned long and print with %#lx.

Discussed with: bde
2002-10-15 01:50:09 +00:00
Marcel Moolenaar
a9945062b7 Make this compile on 64-bit architectures (e.g. ia64) by not assuming
pointers (but more precisely vm_offset_t) can be printed with %x. Use
%p instead and cast the argument to caddr_t.
2002-10-12 20:40:36 +00:00
Eric Anholt
d5157cd692 Correct an indentation.
Noticed by:	phk
2002-10-03 06:10:54 +00:00
Eric Anholt
81ac2d2606 Fix i810 after i830 commit.
Submitted by:	David Dawes <dawes@XFree86.Org>
2002-09-15 08:43:23 +00:00
Eric Anholt
ea3796796a Fix an i830/i845 test that shouldn't get hit in normal use and remove a printf.
Submitted by:	David Dawes <dawes@XFree86.Org>
2002-09-13 04:17:28 +00:00
Eric Anholt
3080733f2e Add AGP support for Intel i830M and i845 thanks to patches from moto kawasaki
<kawasaki@mbg.sphere.ne.jp> and David Dawes <dawes@XFree86.org>.
2002-09-12 04:23:18 +00:00
Bruce Evans
7e9e7dc4ed Include <sys/lockmgr.h> for old lock interfaces instead of depending on
namespace pollution in <sys/lock.h>.
2002-08-27 11:51:55 +00:00
Alan Cox
fff6062ab6 o Retire vm_page_zero_fill() and vm_page_zero_fill_area(). Ever since
pmap_zero_page() and pmap_zero_page_area() were modified to accept
   a struct vm_page * instead of a physical address, vm_page_zero_fill()
   and vm_page_zero_fill_area() have served no purpose.
2002-08-25 00:22:31 +00:00
Alan Cox
fab965bf7e o Use the VM_ALLOC_WIRED flag instead of calling vm_page_wire(). 2002-08-10 18:42:13 +00:00
Alan Cox
5ec699cdac o If the page returned by vm_page_grab(VM_ALLOC_ZERO) isn't prezeroed,
zero it.

Reviewed by:	dfr, peter
2002-07-21 04:07:26 +00:00
John Baldwin
8034890757 - Use more correct values to initialize the AGP controller during setup.
The value we use is still questionable for 440BX chipsets.
- When flushing the TLB just toggle the bit in question instead of writing
  a magic value that could trash other unrelated bits.
2002-07-17 02:52:01 +00:00
Alan Cox
613f5495ed o Lock page queue accesses by vm_page_wire(). 2002-07-14 20:40:32 +00:00
Alan Cox
1f54526952 o Complete the locking of page queue accesses by vm_page_unwire().
o Assert that the page queues lock is held in vm_page_unwire().
 o Make vm_page_lock_queues() and vm_page_unlock_queues() visible
   to kernel loadable modules.
2002-07-13 20:55:21 +00:00
Coleman Kane
9264fbc80a Fix some nits in AMD AGP driver. Remove excess malloc and move a bzero
out of the way, so it won't cause trouble.

Submitted by:	Frank Mayher <frank@exit.com>
MFC after: 1 week
2002-04-15 18:57:26 +00:00