aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/agp
Commit message (Collapse)AuthorAgeFilesLines
* agp: Set the driver-specific field correctlyMark Johnston2024-09-051-1/+1
| | | | | | | | | PR: 281035 Reviewed by: mhorne MFC after: 1 week Fixes: 437ea82ce7fc ("agp: Handle multiple devices more gracefully") (cherry picked from commit 12500c14281dc62ddeac4c5e1e6eabd1e380f11c)
* pci_cfgreg: Add a PCI domain argument to the low-level register APIJohn Baldwin2024-01-181-33/+38
| | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the API of pci_cfgreg(read|write) to add a domain argument (referred to as a segment in ACPI parlance) (note that this is not the same as a NUMA domain, but something PCI-specific). This does not yet enable access to domains other than 0, but updates the API to support domains. Places that use hard-coded bus/slot/function addresses have been updated to hardcode a domain of 0. A few places that have the PCI domain (segment) available such as the acpi_pcib_acpi.c Host-PCI bridge driver pass the PCI domain. The hpt27xx(4) and hptnr(4) drivers fail to attach to a device not on domain 0 since they provide APIs to their binary blobs that only permit bus/slot/function addressing. The x86 non-ACPI PCI bus drivers all hardcode a domain of 0 as they do not support multiple domains. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D42827 (cherry picked from commit 1587a9db92c03c738bb3f0fc5874b43c961e7c99)
* agp_amd64: Use <machine/pci_cfgreg.h> rather than bare prototypesJohn Baldwin2024-01-041-4/+1
| | | | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D42826 (cherry picked from commit 71ac18a84df2771fb9bd91e2349eae91602c4e46)
* sys: Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-1611-22/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-164-8/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-1215-15/+15
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* kmem_malloc/free: Use void * instead of vm_offset_t for kernel pointers.John Baldwin2022-09-224-21/+15
| | | | | | Reviewed by: kib, markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D36549
* Adjust agp_find_device() definition in agp.c to avoid clang 15 warningDimitry Andric2022-07-161-1/+1
| | | | | | | | | | | | | | | With clang 15, the following -Werror warning is produced: sys/dev/agp/agp.c:910:16: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] agp_find_device() ^ void This is because agp_find_device() is declared with a (void) argument list, and defined with an empty argument list. Make the definition match the declaration. MFC after: 3 days
* vm_object: Modify various drivers to allocate OBJT_SWAP objectsMark Johnston2022-07-122-2/+2
| | | | | | | | | | | | | This is in preparation for removal of OBJT_DEFAULT. In particular, it is now cheap to check whether an OBJT_SWAP object has any swap blocks allocated, so the benefit of having a separate OBJT_DEFAULT type is quite marginal, and the OBJT_DEFAULT->SWAP transition is a source of bugs. Reviewed by: alc, hselasky, kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D35779
* agp: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-0610-30/+10
|
* agp_nvidia: Replace a dummy variable to force a read with a void cast.John Baldwin2022-04-091-3/+3
|
* agp: Handle multiple devices more gracefullyMark Johnston2021-11-252-5/+29
| | | | | | | | | | | | | | Currently agp(4) effectively assumes that only one driver instance exists, as the generic attach routine attempts to create /dev/agpgart and triggers a panic if it already exists. Instead, handle this situation by creating /dev/agpgart<unit> and making /dev/agpgart an alias of /dev/agpgart0 for compatibility. PR: 187015 Reviewed by: imp, kib Tested by: Yoshihiro Ota <ota@j.email.ne.jp> (earlier version) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D33068
* agp: plug a set-but-not-unused var in agp_intel_gtt_map_memoryMateusz Guzik2021-11-241-0/+4
| | | | Sponsored by: Rubicon Communications, LLC ("Netgate")
* Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrightsEd Maste2021-08-081-1/+0
| | | | | | | These ones were unambiguous cases where the Foundation was the only listed copyright holder (in the associated license block). Sponsored by: The FreeBSD Foundation
* agp: clean up empty lines in .c and .h filesMateusz Guzik2020-09-0111-30/+16
| | | | Notes: svn path=/head/; revision=365103
* Remove support for FreeBSD 4.x and earlier from agp driverWarner Losh2020-02-261-7/+0
| | | | | | | Compile tested only, but do we still need this driver? Notes: svn path=/head/; revision=358353
* Complete the removal of the "wire_count" field from struct vm_page.Mark Johnston2019-09-251-1/+1
| | | | | | | | | | | | Convert all remaining references to that field to "ref_count" and update comments accordingly. No functional change intended. Reviewed by: alc, kib Sponsored by: Intel, Netflix Differential Revision: https://reviews.freebsd.org/D21768 Notes: svn path=/head/; revision=352688
* Change synchonization rules for vm_page reference counting.Mark Johnston2019-09-092-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are several mechanisms by which a vm_page reference is held, preventing the page from being freed back to the page allocator. In particular, holding the page's object lock is sufficient to prevent the page from being freed; holding the busy lock or a wiring is sufficent as well. These references are protected by the page lock, which must therefore be acquired for many per-page operations. This results in false sharing since the page locks are external to the vm_page structures themselves and each lock protects multiple structures. Transition to using an atomically updated per-page reference counter. The object's reference is counted using a flag bit in the counter. A second flag bit is used to atomically block new references via pmap_extract_and_hold() while removing managed mappings of a page. Thus, the reference count of a page is guaranteed not to increase if the page is unbusied, unmapped, and the object's write lock is held. As a consequence of this, the page lock no longer protects a page's identity; operations which move pages between objects are now synchronized solely by the objects' locks. The vm_page_wire() and vm_page_unwire() KPIs are changed. The former requires that either the object lock or the busy lock is held. The latter no longer has a return value and may free the page if it releases the last reference to that page. vm_page_unwire_noq() behaves the same as before; the caller is responsible for checking its return value and freeing or enqueuing the page as appropriate. vm_page_wire_mapped() is introduced for use in pmap_extract_and_hold(). It fails if the page is concurrently being unmapped, typically triggering a fallback to the fault handler. vm_page_wire() no longer requires the page lock and vm_page_unwire() now internally acquires the page lock when releasing the last wiring of a page (since the page lock still protects a page's queue state). In particular, synchronization details are no longer leaked into the caller. The change excises the page lock from several frequently executed code paths. In particular, vm_object_terminate() no longer bounces between page locks as it releases an object's pages, and direct I/O and sendfile(SF_NOCACHE) completions no longer require the page lock. In these latter cases we now get linear scalability in the common scenario where different threads are operating on different files. __FreeBSD_version is bumped. The DRM ports have been updated to accomodate the KPI changes. Reviewed by: jeff (earlier version) Tested by: gallatin (earlier version), pho Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20486 Notes: svn path=/head/; revision=352110
* Eliminate the arena parameter to kmem_free(). Implicitly this corrects anAlan Cox2018-08-254-13/+13
| | | | | | | | | | | | | | | | | | | | | | error in the function hypercall_memfree(), where the wrong arena was being passed to kmem_free(). Introduce a per-page flag, VPO_KMEM_EXEC, to mark physical pages that are mapped in kmem with execute permissions. Use this flag to determine which arena the kmem virtual addresses are returned to. Eliminate UMA_SLAB_KRWX. The introduction of VPO_KMEM_EXEC makes it redundant. Update the nearby comment for UMA_SLAB_KERNEL. Reviewed by: kib, markj Discussed with: jeff Approved by: re (marius) Differential Revision: https://reviews.freebsd.org/D16845 Notes: svn path=/head/; revision=338318
* Eliminate kmem_alloc_contig()'s unused arena parameter.Alan Cox2018-08-202-6/+5
| | | | | | | | | Reviewed by: hselasky, kib, markj Discussed with: jeff Differential Revision: https://reviews.freebsd.org/D16799 Notes: svn path=/head/; revision=338107
* Oops. r338030 didn't eliminate the unused arena argument from all ofAlan Cox2018-08-182-10/+8
| | | | | | | kmem_alloc_attr()'s callers. Correct that mistake. Notes: svn path=/head/; revision=338032
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2715-0/+30
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* Add a helper function to agp(4) which installs a single GTT entry.Mark Johnston2017-07-092-0/+18
| | | | | | | | Submitted by: dumbbell MFC after: 1 week Notes: svn path=/head/; revision=320851
* sys/dev: Replace zero with NULL for pointers.Pedro F. Giffuni2017-02-201-1/+1
| | | | | | | | | | | Makes things easier to read, plus architectures may set NULL to something different than zero. Found with: devel/coccinelle MFC after: 3 weeks Notes: svn path=/head/; revision=313982
* Move bogus_page declaration to vm_page.h and initialization to vm_page.c.Gleb Smirnoff2017-01-041-2/+0
| | | | | | | Reviewed by: kib Notes: svn path=/head/; revision=311336
* sys: use our roundup2/rounddown2() macros when param.h is available.Pedro F. Giffuni2016-04-211-3/+3
| | | | | | | | | | | | | rounddown2 tends to produce longer lines than the original code and when the code has a high indentation level it was not really advantageous to do the replacement. This tries to strike a balance between readability using the macros and flexibility of having the expressions, so not everything is converted. Notes: svn path=/head/; revision=298433
* dev/agp: use our nitems() macro when it is avaliable through param.h.Pedro F. Giffuni2016-04-193-10/+9
| | | | | | | | | Consistently capitalize the macros used in the driver. No functional change. Notes: svn path=/head/; revision=298306
* agp: Do not attach to Intel GEN6+Jean-Sébastien Pédron2016-03-122-531/+33
| | | | | | | | | | | | | | | | The i915 video driver doesn't depend on agp(4) anymore for Sandybridge and later GPUs. Therefore, there is no need to attach agp(4) to those devices. While here, fix `agp_i965_res_spec` to include the aperture base for GEN4 and GEN5. Reviewed by: kib Approved by: kib Differential Revision: https://reviews.freebsd.org/D5586 Notes: svn path=/head/; revision=296719
* drm/i915: Update to match Linux 3.8.13Jean-Sébastien Pédron2016-03-082-31/+223
| | | | | | | | | | | | This update brings initial support for Haswell GPUs. Tested by: Many users of FreeBSD, PC-BSD and HardenedBSD Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5554 Notes: svn path=/head/; revision=296548
* Remove break after return.Kevin Lo2015-01-231-5/+5
| | | | Notes: svn path=/head/; revision=277565
* Initial attachment of the agp(4) to Haswell IGP. There is no handlingKonstantin Belousov2014-11-111-0/+58
| | | | | | | | | | of cacheablility control bits in GTT PTEs yet. Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=274379
* Based on some BIOS configuration (GGC register in host bridge, bit 1),Konstantin Belousov2014-11-111-1/+2
| | | | | | | | | | | | | IGP may declare subclass as either VGA-compatible, or non-VGA. The difference is that in the later case, IGP does not claim VGA cycles. Other than that, the device functions normally, and agp_i810 should attach to it. Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=274378
* On 965 and higher, map GTT as write-combining.Konstantin Belousov2014-11-111-8/+43
| | | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=274377
* Revert agp_intel.c part of the r274040 for now. There is a confusionKonstantin Belousov2014-11-041-0/+95
| | | | | | | | | | | | | | on my part about north bridge/GPU pci ids and use of aperture. Leave the agp_intel.c out of static compilation on amd64, it makes the things consistent with agp.ko. Pointed out by: tijl Sponsored by: The FreeBSD Foundation MFC after: 13 days Notes: svn path=/head/; revision=274084
* agp_intel.c provides support for AGP on Intel chipsets from 440/BX toKonstantin Belousov2014-11-031-95/+0
| | | | | | | | | | | | | | | | | | 875. This intersects with the agp_i810.c, which supports all Intels from i810 to Core i5/7. Both agp_intel.c and agp_i810.c are compiled into kernel when device agp is specified in config, and agp_i810 attach seems to be selected by chance due to linking order. Strip support for 810 and later from agp_intel.c. Since 440-class chipsets do not support any long-mode capable CPUs, remove agp_intel.c from amd64 kernel file list. Note that agp_intel.c is not compiled into agp.ko on amd64 already. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=274040
* - agp_generic_unbind_memory: flush AGP TLB before unwiring pagesTijl Coosemans2014-11-021-2/+5
| | | | | | | | | - agp_bind_pages: assert that pages have been wired down MFC after: 1 month Notes: svn path=/head/; revision=273965
* In agp_amd_bind_page don't flush the AGP TLB. It's done by the callingTijl Coosemans2014-11-021-3/+0
| | | | | | | function. Notes: svn path=/head/; revision=273964
* In agp(4) avoid the need to flush all cpu caches with wbinvd betweenTijl Coosemans2014-11-027-65/+40
| | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=273963
* Avoid possible overflow in agp_generic_alloc_memory.Tijl Coosemans2014-10-301-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=273863
* Add two new functions to the AGP driver KPI to bind/unbind arbitrary setsTijl Coosemans2014-10-302-0/+86
| | | | | | | | | | of pages into the GTT. Reviewed by: kib MFC after: 1 month Notes: svn path=/head/; revision=273856
* - Modify vm_page_unwire() and vm_page_enqueue() to directly acceptAttilio Rao2014-06-162-3/+3
| | | | | | | | | | | | | | | | | | | | | the queue where to enqueue pages that are going to be unwired. - Add stronger checks to the enqueue/dequeue for the pagequeues when adding and removing pages to them. Of course, for unmanaged pages the queue parameter of vm_page_unwire() will be ignored, just as the active parameter today. This makes adding new pagequeues quicker. This change effectively modifies the KPI. __FreeBSD_version will be, however, bumped just when the full cache of free pages will be evicted. Sponsored by: EMC / Isilon storage division Reviewed by: alc Tested by: pho Notes: svn path=/head/; revision=267548
* Fix undefined behavior: (1 << 31) is not defined as 1 is an int and thisEitan Adler2013-11-301-2/+2
| | | | | | | | | | | | | | | | shifts into the sign bit. Instead use (1U << 31) which gets the expected result. This fix is not ideal as it assumes a 32 bit int, but does fix the issue for most cases. A similar change was made in OpenBSD. Discussed with: -arch, rdivacky Reviewed by: cperciva Notes: svn path=/head/; revision=258780
* Remove the deprecated VM_ALLOC_RETRY flag for the vm_page_grab(9).Konstantin Belousov2013-08-222-2/+2
| | | | | | | | | | | The flag was mandatory since r209792, where vm_page_grab(9) was changed to only support the alloc retry semantic. Suggested and reviewed by: alc Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=254649
* The soft and hard busy mechanism rely on the vm object lock to work.Attilio Rao2013-08-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unify the 2 concept into a real, minimal, sxlock where the shared acquisition represent the soft busy and the exclusive acquisition represent the hard busy. The old VPO_WANTED mechanism becames the hard-path for this new lock and it becomes per-page rather than per-object. The vm_object lock becames an interlock for this functionality: it can be held in both read or write mode. However, if the vm_object lock is held in read mode while acquiring or releasing the busy state, the thread owner cannot make any assumption on the busy state unless it is also busying it. Also: - Add a new flag to directly shared busy pages while vm_page_alloc and vm_page_grab are being executed. This will be very helpful once these functions happen under a read object lock. - Move the swapping sleep into its own per-object flag The KPI is heavilly changed this is why the version is bumped. It is very likely that some VM ports users will need to change their own code. Sponsored by: EMC / Isilon storage division Discussed with: alc Reviewed by: jeff, kib Tested by: gavin, bapt (older version) Tested by: pho, scottl Notes: svn path=/head/; revision=254138
* Switch the vm_object mutex to be a rwlock. This will enable in theAttilio Rao2013-03-092-13/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | future further optimizations where the vm_object lock will be held in read mode most of the time the page cache resident pool of pages are accessed for reading purposes. The change is mostly mechanical but few notes are reported: * The KPI changes as follow: - VM_OBJECT_LOCK() -> VM_OBJECT_WLOCK() - VM_OBJECT_TRYLOCK() -> VM_OBJECT_TRYWLOCK() - VM_OBJECT_UNLOCK() -> VM_OBJECT_WUNLOCK() - VM_OBJECT_LOCK_ASSERT(MA_OWNED) -> VM_OBJECT_ASSERT_WLOCKED() (in order to avoid visibility of implementation details) - The read-mode operations are added: VM_OBJECT_RLOCK(), VM_OBJECT_TRYRLOCK(), VM_OBJECT_RUNLOCK(), VM_OBJECT_ASSERT_RLOCKED(), VM_OBJECT_ASSERT_LOCKED() * The vm/vm_pager.h namespace pollution avoidance (forcing requiring sys/mutex.h in consumers directly to cater its inlining functions using VM_OBJECT_LOCK()) imposes that all the vm/vm_pager.h consumers now must include also sys/rwlock.h. * zfs requires a quite convoluted fix to include FreeBSD rwlocks into the compat layer because the name clash between FreeBSD and solaris versions must be avoided. At this purpose zfs redefines the vm_object locking functions directly, isolating the FreeBSD components in specific compat stubs. The KPI results heavilly broken by this commit. Thirdy part ports must be updated accordingly (I can think off-hand of VirtualBox, for example). Sponsored by: EMC / Isilon storage division Reviewed by: jeff Reviewed by: pjd (ZFS specific review) Discussed with: alc Tested by: pho Notes: svn path=/head/; revision=248084
* Fix reversed condition in the logic to wait for the chipset buffersKonstantin Belousov2013-01-271-1/+1
| | | | | | | | | | | flush wait on the Gen2 chipsets. Confirmed by the inspection of the Linux agp code. Submitted by: Taku YAMAMOTO <taku@tackymt.homeip.net> MFC after: 2 weeks Notes: svn path=/head/; revision=245976
* Remove unneeded semicolons.Antoine Brodin2013-01-017-8/+8
| | | | | | | Reviewed by: md5 of the object files Notes: svn path=/head/; revision=244926
* Add pci id for the xeon hd4000 (IvyBridge server GT2)Baptiste Daroussin2012-12-111-0/+5
| | | | | | | | | Submitted by: François Tigeot <ftigeot@wolfpond.org> Obtained from: dragonfly MFC after: 3 days Notes: svn path=/head/; revision=244114
* Remove unneeded header from agp: opt_bus.hEitan Adler2012-11-1511-21/+0
| | | | | | | | | | Tested with "make universe" Approved by: cperciva MFC after: 1 week Notes: svn path=/head/; revision=243095