summaryrefslogtreecommitdiffstats
path: root/sys/dev/agp/agp.c
Commit message (Collapse)AuthorAgeFilesLines
* Clear busy state on the pages which are after the one that failed the bindkib2008-12-231-3/+5
| | | | | | | | attempt. Reported and tested by: ganbold Reviewed by: rnoland MFC after: 2 weeks
* Replace all calls to minor() with dev2unit().ed2008-09-271-1/+1
| | | | | | | | | | | | | | | After I removed all the unit2minor()/minor2unit() calls from the kernel yesterday, I realised calling minor() everywhere is quite confusing. Character devices now only have the ability to store a unit number, not a minor number. Remove the confusion by using dev2unit() everywhere. This commit could also be considered as a bug fix. A lot of drivers call minor(), while they should actually be calling dev2unit(). In -CURRENT this isn't a problem, but it turns out we never had any problem reports related to that issue in the past. I suspect not many people connect more than 256 pieces of the same hardware. Reviewed by: kib
* When device_get_children returns an error, ignore that bus' children.imp2008-08-231-1/+2
|
* Move the agp(4) driver from sys/pci to sys/dev/agp. __FreeBSD_version wasjhb2007-11-121-3/+3
| | | | | | | | | 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
* Split agp_generic_detach() up into two routines: agp_free_cdev() destroysjhb2007-10-301-2/+17
| | | | | | | | | /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
* Add support for G965/Q965/GM965/GME965/GME945 AGP.anholt2007-07-131-5/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | 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. This also adds 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> Approved by: re (hrs)
* The page queues lock is no longer required by vm_page_busy() oralc2006-10-221-4/+0
| | | | vm_page_wakeup(). Reduce or eliminate its use accordingly.
* Fix the wraparound of memsize >=2GB.tanimura2006-10-151-2/+3
|
* Explicitly set v3 mode only when it is requested. Don't bother otherwise.jkim2006-08-111-1/+6
|
* Remove various bits of conditional Alpha code and fixup a few comments.jhb2006-05-121-10/+0
|
* Fix a memory leak I introduced with the hostb/vgapci stuff.jhb2006-01-171-4/+8
| | | | Reported by: Coverity (via dfr's clue-bat)
* Change the agp_find_device() to return the first agp device that has beenjhb2005-12-201-2/+11
| | | | attached to a driver rather than always returning agp0.
* Don't map the AGP aperture into contiguous KVA. The various graphicsjhb2005-12-201-3/+1
| | | | | | | | drivers already map sections into KVA as needed anyway. Note that this will probably break the nvidia driver, but I will coordinate to get that fixed. MFC after: 2 weeks
* Destroy the /dev device before destroying the mutex or releasing resourcesjhb2005-12-201-1/+2
| | | | | | rather than afterwards. MFC after: 1 week
* Use pci_find_extcap() to search for AGP capabilities (PCIY_AGP).jhb2005-12-201-25/+4
|
* Avoid repeated acquisition and release of the vm object lock inside ofalc2004-10-241-5/+6
| | | | | | two loops in agp_generic_bind_memory(). As an intended side-effect, all of the calls to vm_page_wakeup() are now performed with the containing vm object lock held.
* AMD64 on-CPU GART support.obrien2004-08-161-1/+1
| | | | | | | This also applies to AMD64 HW running 'i386' OS. Submitted by: Jung-uk Kim <jkim@niksun.com> Integration by: obrien
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-4/+4
| | | | Bump __FreeBSD_version accordingly.
* Add missing <sys/module.h> includesphk2004-05-301-0/+1
|
* In agp_generic_bind_memory(), grab the needed pages before acquiringmux2004-05-231-30/+42
| | | | | | | the agp mutex. We do this because vm_page_grab() called with the VM_ALLOC_RETRY flag can sleep. Pointed out by: alc
* Get rid of a lockmgr consumer by making agp(4) use a standard mutex,mux2004-05-221-12/+10
| | | | | since it's always acquiring the lock exclusively. This was tested with X on an SMP box, with and without WITNESS.
* Plug three lock leaks.mux2004-05-221-0/+3
|
* Push down the responsibility for zeroing a physical page from thealc2004-04-241-2/+0
| | | | | | | | | | | | | caller to vm_page_grab(). Although this gives VM_ALLOC_ZERO a different meaning for vm_page_grab() than for vm_page_alloc(), I feel such change is necessary to accomplish other goals. Specifically, I want to make the PG_ZERO flag immutable between the time it is allocated by vm_page_alloc() and freed by vm_page_free() or vm_page_free_zero() to avoid locking overheads. Once we gave up on the ability to automatically recognize a zeroed page upon entry to vm_page_free(), the ability to mutate the PG_ZERO flag became useless. Instead, I would like to say that "Once a page becomes valid, its PG_ZERO flag must be ignored."
* Convert callers to the new bus_alloc_resource_any(9) API.njl2004-03-171-2/+2
| | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
* Device megapatch 4/6:phk2004-02-211-0/+2
| | | | | | | | 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.
* Device megapatch 1/6:phk2004-02-211-2/+0
| | | | | | | 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.
* This is not a D_TTY driver.phk2004-02-151-1/+0
|
* - Disable AGP on ALI chipsets if aperture size is 0.anholt2003-11-111-0/+5
| | | | | | | | | - 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
* Add simple support for AGP 3.0 including enabling 8x mode. The simplejhb2003-10-231-13/+108
| | | | | | | | 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
* Prefer new location of pci include files (which have only been in theimp2003-08-221-2/+2
| | | | | tree for two or more years now), except in a few places where there's code to be compatible with older versions of FreeBSD.
* Add vm object locking.alc2003-06-191-0/+6
|
* Use __FBSDID().obrien2003-06-111-2/+3
|
* - Add vm_paddr_t, a physical address type. This is required for systemsjake2003-03-251-1/+1
| | | | | | | | | | | | | | | 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)
* Gigacommit to improve device-driver source compatibility betweenphk2003-03-031-13/+7
| | | | | | | | | | | | | 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)
* Cleanup of the d_mmap_t interface.mux2003-02-251-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | - 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
* Back out M_* changes, per decision of the TRB.imp2003-02-191-1/+1
| | | | Approved by: trb
* Split the arch-specific AGP files into the appropriate files.* and do the sameanholt2003-02-141-0/+6
| | | | | | 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.
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-1/+1
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* - Hold the page queues lock around vm_page_wakeup().alc2002-12-231-0/+4
|
* Remove a bunch of #include "opt_pci.h".mux2002-11-131-1/+0
|
* Include <sys/lockmgr.h> for old lock interfaces instead of depending onbde2002-08-271-0/+1
| | | | namespace pollution in <sys/lock.h>.
* o Retire vm_page_zero_fill() and vm_page_zero_fill_area(). Ever sincealc2002-08-251-1/+1
| | | | | | 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.
* o Use the VM_ALLOC_WIRED flag instead of calling vm_page_wire().alc2002-08-101-4/+1
|
* o If the page returned by vm_page_grab(VM_ALLOC_ZERO) isn't prezeroed,alc2002-07-211-0/+2
| | | | | | zero it. Reviewed by: dfr, peter
* o Lock page queue accesses by vm_page_wire().alc2002-07-141-0/+2
|
* o Complete the locking of page queue accesses by vm_page_unwire().alc2002-07-131-0/+4
| | | | | | 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.
* Allow retrieval of the virtual address of the AGP aperturemdodd2001-12-191-0/+1
| | | | | | using agp_get_info(). MFC after: 1 week
* Don't automatically unbind/deallocate memory when releasing.ru2001-11-271-10/+6
| | | | | | | This fixes the VT switching problem with the i810 X driver. Explained by: David Dawes <dawes@XFree86.Org> Reviewed by: dfr
* KSE Milestone 2julian2001-09-121-9/+9
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Introduce a global lock for the vm subsystem (vm_mtx).alfred2001-05-191-0/+1
| | | | | | | | | | | | | | | | | | | vm_mtx does not recurse and is required for most low level vm operations. faults can not be taken without holding Giant. Memory subsystems can now call the base page allocators safely. Almost all atomic ops were removed as they are covered under the vm mutex. Alpha and ia64 now need to catch up to i386's trap handlers. FFS and NFS have been tested, other filesystems will need minor changes (grabbing the vm lock when twiddling page properties). Reviewed (partially) by: jake, jhb
OpenPOWER on IntegriCloud