aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/drm2
Commit message (Collapse)AuthorAgeFilesLines
* drm2: Stop checking for failures from malloc(M_WAITOK)Zhenlei Huang2024-09-303-79/+1
| | | | | | | MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 (cherry picked from commit 6dbf3aca4f5c4f7287f186360c2391f2adfea8d6)
* drm2: whack set-but-not-used warnsMateusz Guzik2023-09-183-3/+3
| | | | | | immediate MFC to unbreak the build (cherry picked from commit c9130a46bca272492b4f29429ed340504b8eced7)
* drm2: fix build after abs64 became globalMateusz Guzik2023-09-181-7/+0
| | | | | | | Fixes: 229c65a83fb ("kern: Globally define abs64") Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit ef545fe7ba6628054765c81624bb5f95884d45f2)
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-1657-114/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-1610-10/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* sys: Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-169-18/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* drm2: remove unused Alpha and MIPS #definesEd Maste2023-08-151-7/+0
|
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-124-4/+4
| | | | | | | | | 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
* Remove an extra argument to SYSCTL_FOREACHAndrew Turner2022-10-051-1/+1
| | | | | | This was missed in e0853c933661. Sponsored by: The FreeBSD Foundation
* Use SYSCTL_FOREACH in drm2Andrew Turner2022-10-051-1/+1
| | | | | | This was added recently. Use it to get the correct _FOREACH macro. Sponsored by: The FreeBSD Foundation
* Alter the prototype of qsort_r(3) to match POSIX, which adopted theEd Schouten2022-09-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | glibc-based interface. Unfortunately, the glibc maintainers, despite knowing the existence of the FreeBSD qsort_r(3) interface in 2004 and refused to add the same interface to glibc based on grounds of the lack of standardization and portability concerns, has decided it was a good idea to introduce their own qsort_r(3) interface in 2007 as a GNU extension with a slightly different and incompatible interface. With the adoption of their interface as POSIX standard, let's switch to the same prototype, there is no need to remain incompatible. C++ and C applications written for the historical FreeBSD interface get source level compatibility when building in C++ mode, or when building with a C compiler with C11 generics support, provided that the caller passes a fifth parameter of qsort_r() that exactly matches the historical FreeBSD comparator function pointer type and does not redefine the historical qsort_r(3) prototype in their source code. Symbol versioning is used to keep old binaries working. MFC: never Relnotes: yes Reviewed by: cem, imp, hps, pauamma Differential revision: https://reviews.freebsd.org/D17083
* kmem_malloc/free: Use void * instead of vm_offset_t for kernel pointers.John Baldwin2022-09-223-11/+11
| | | | | | Reviewed by: kib, markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D36549
* pmap_unmapdev/bios: Accept a pointer instead of a vm_offset_t.John Baldwin2022-09-222-5/+5
| | | | | | | | This matches the return type of pmap_mapdev/bios. Reviewed by: kib, markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D36548
* Adjust function definition in drm_fb_helper.c to avoid clang 15 warningDimitry Andric2022-08-141-1/+1
| | | | | | | | | | | | | | | With clang 15, the following -Werror warning is produced: sys/dev/drm2/drm_fb_helper.c:86:18: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] framebuffer_alloc() ^ void This is because framebuffer_alloc() is declared with a (void) argument list, but 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-121-1/+1
| | | | | | | | | | | | | 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
* drm2: Remove unused devclass argument to DRIVER_MODULE.John Baldwin2022-05-101-3/+4
|
* drm2: Remove unused drm_devclass.John Baldwin2022-05-101-2/+0
|
* Revert "drm2: Fix a typo in a source code comment"Gordon Bergling2022-04-141-1/+1
| | | | This reverts commit 5158cf0a382eb9079e1851f86293f37a1cf25f5b.
* drm2: Remove unused variables.John Baldwin2022-04-133-27/+5
|
* drm2: Fix a typo in a source code commentGordon Bergling2022-04-091-1/+1
| | | | | | - s/mmaping/mapping/ MFC after: 3 days
* Revert "drm2: Fix a typo in a source code comment"Gordon Bergling2022-03-291-1/+1
| | | | | | | | | The comment about 'mmaping' was actually correct since the comment was referencing to mmap(2). Reported by: alc This reverts commit 22ba115b49a2c266aa1967f6b192b7aa8f883b7d.
* drm2: Fix a typo in a source code commentGordon Bergling2022-03-281-1/+1
| | | | | | - s/mmaping/mapping/ MFC after: 3 days
* Create wrapper for Giant taken for newbusWarner Losh2021-12-101-4/+4
| | | | | | | | | | | Create a wrapper for newbus to take giant and for busses to take it too. bus_topo_lock() should be called before interacting with newbus routines and unlocked with bus_topo_unlock(). If you need the topology lock for some reason, bus_topo_mtx() will provide that. Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D31831
* Make device_busy/unbusy work w/o Giant heldWarner Losh2021-11-301-6/+0
| | | | | | | | | | | | | | | | | | The vast majority of the busy/unbusy users in the tree don't acquire Giant before calling device_busy/unbusy. However, if multiple threads are opening a file, say, that causes the device to busy/unbusy, then we can race to the root marking things busy. Move to using a reference count to keep track of how many times a device_t has been made busy. Use that count to make the same decisions that we'd make with the old device state. Note: gpiopps.c uses D_TRACKCLOSE. Others do as well. However, there's a known race with closes that will be corrected for all the drivers that do this in a future commit. Sponsored by: Netflix Reviewed by: hselasky, jhb Differential Revision: https://reviews.freebsd.org/D26284
* Revert "Make device_busy/unbusy work w/o Giant held"Warner Losh2021-11-301-0/+6
| | | | | | | | | | | This reverts commit 08e781915363f98f4318a864b3b5a52bd99424c6. Commit message was for a very old version of the patch. Will re-commit with the right one since it's so bad. There's no locked versions of it...that code was reworked to use refcnt APIs. Noticed by: jhb, jtrc27 Sponsored by: Netflix
* Make device_busy/unbusy work w/o Giant heldWarner Losh2021-11-301-6/+0
| | | | | | | | | | | | | | | The vast majority of the busy/unbusy users in the tree don't acquire Giant before calling device_busy/unbusy. However, if multiple threads are opening a file, say, that causes the device to busy/unbusy, then we can race to the root marking things busy. Create a new device_busy_locked and device_unbusy_locked that are the current implemntations of device_busy and device_unbusy. Make device_busy and unbusy acquire Giant before calling the _locked versrions. Since we never sleep in the busy/unbusy path, Giant's single threaded semantics suffice to keep this safe. Sponsored by: Netflix Reviewed by: hselasky, jhb Differential Revision: https://reviews.freebsd.org/D26284
* Convert consumers to vm_page_alloc_noobj_contig()Mark Johnston2021-10-202-9/+8
| | | | | | | | | Remove now-unneeded page zeroing. No functional change intended. Reviewed by: alc, hselasky, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32006
* Convert vm_page_alloc() callers to use vm_page_alloc_noobj().Mark Johnston2021-10-201-6/+1
| | | | | | | | | | | | | | | Remove page zeroing code from consumers and stop specifying VM_ALLOC_NOOBJ. In a few places, also convert an allocation loop to simply use VM_ALLOC_WAITOK. Similarly, convert vm_page_alloc_domain() callers. Note that callers are now responsible for assigning the pindex. Reviewed by: alc, hselasky, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31986
* Fix some common typos in source code commentsGordon Bergling2021-08-141-1/+1
| | | | | | | - s/struture/structure/ - s/structre/structure/ MFC after: 5 days
* Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrightsEd Maste2021-08-084-4/+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
* Don't permit DRM buffer mappings to be upgraded to executable.John Baldwin2020-10-061-6/+4
| | | | | | | | | | Reviewed by: kib MFC after: 1 month Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26697 Notes: svn path=/head/; revision=366494
* drm2: Fix build after r365264Niclas Zeising2020-09-031-0/+2
| | | | | | | | | | | | | Fix the build after r365264, I forgot to exclude arm in one more place. Reported by: rpokala Approved by: manu (implicit, build fix) MFC after: 3 days X-MFC-With: 365264 Pointy-hat to: zeising Notes: svn path=/head/; revision=365287
* drm2: Further improve deprecation messageNiclas Zeising2020-09-021-2/+8
| | | | | | | | | | | | | | | | | | Further improve the drm2 deprecation message, only displaying information about the port for relevant architectures, and skipping the message completely from arm, which uses some parts of drm2 still. This is mostly intended to be merged to 12, since the base bits of drm2 on FreeBSD 13 are only really used on arm. Reviewed by: manu, mmel Approved by: manu MFC after: 3 days X-MFC-with: r364737 Differential Revision: https://reviews.freebsd.org/D26275 Notes: svn path=/head/; revision=365264
* drm2: Update deprecation messageNiclas Zeising2020-08-241-5/+1
| | | | | | | | | | | | | | Update the deprecation message in the drm2 (aka legacy drm) drivers to point towards the graphics/drm-kmod ports for all architectures, not just amd64. drm-kmod has support for more architectures these days, and the graphics/drm-legacy-kmod port is being deprecated. Approved by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26174 Notes: svn path=/head/; revision=364737
* Convert a few triviail consumers to the new unlocked grab API.Jeff Roberson2020-02-281-5/+4
| | | | | | | | Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D23847 Notes: svn path=/head/; revision=358447
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (5 of many)Pawel Biernacki2020-02-162-13/+8
| | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Reviewed by: imp, kib Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D23633 Notes: svn path=/head/; revision=358004
* Add KERNEL_PANICKED macro for use in place of direct panicstr testsMateusz Guzik2020-01-121-1/+1
| | | | Notes: svn path=/head/; revision=356655
* Make page busy state deterministic on free. Pages must be xbusy whenJeff Roberson2019-12-221-0/+2
| | | | | | | | | | | | | | | | | | | removed from objects including calls to free. Pages must not be xbusy when freed and not on an object. Strengthen assertions to match these expectations. In practice very little code had to change busy handling to meet these rules but we can now make stronger guarantees to busy holders and avoid conditionally dropping busy in free. Refine vm_page_remove() and vm_page_replace() semantics now that we have stronger guarantees about busy state. This removes redundant and potentially problematic code that has proliferated. Discussed with: markj Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D22822 Notes: svn path=/head/; revision=356002
* (4/6) Protect page valid with the busy lock.Jeff Roberson2019-10-152-2/+2
| | | | | | | | | | | | | | Atomics are used for page busy and valid state when the shared busy is held. The details of the locking protocol and valid and dirty synchronization are in the updated vm_page.h comments. Reviewed by: kib, markj Tested by: pho Sponsored by: Netflix, Intel Differential Revision: https://reviews.freebsd.org/D21594 Notes: svn path=/head/; revision=353539
* Replace redundant code with a few new vm_page_grab facilities:Jeff Roberson2019-09-102-17/+8
| | | | | | | | | | | | | | - VM_ALLOC_NOCREAT will grab without creating a page. - vm_page_grab_valid() will grab and page in if necessary. - vm_page_busy_acquire() automates some busy acquire loops. Discussed with: alc, kib, markj Tested by: pho (part of larger branch) Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21546 Notes: svn path=/head/; revision=352176
* Use the sleepq lock rather than the page lock to protect against wakeupJeff Roberson2019-09-101-4/+1
| | | | | | | | | | | | | races with page busy state. The object lock is still used as an interlock to ensure that the identity stays valid. Most callers should use vm_page_sleep_if_busy() to handle the locking particulars. Reviewed by: alc, kib, markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21255 Notes: svn path=/head/; revision=352174
* Change synchonization rules for vm_page reference counting.Mark Johnston2019-09-093-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
* Avoid relying on header pollution from sys/refcount.h.Mark Johnston2019-07-291-0/+1
| | | | | | | | MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=350421
* Add a return value to vm_page_remove().Mark Johnston2019-06-261-1/+1
| | | | | | | | | | | | | | | | | | Use it to indicate whether the page may be safely freed following its removal from the object. Also change vm_page_remove() to assume that the page's object pointer is non-NULL, and have callers perform this check instead. This is a step towards an implementation of an atomic reference counter for each physical page structure. Reviewed by: alc, dougm, kib MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20758 Notes: svn path=/head/; revision=349432
* Replace uses of vm_page_unwire(m, PQ_NONE) with vm_page_unwire_noq(m).Mark Johnston2019-06-071-1/+1
| | | | | | | | | | | | | | | These calls are not the same in general: the former will dequeue the page if it is enqueued, while the latter will just leave it alone. But, all existing uses of the former apply to unmanaged pages, which are never enqueued in the first place. No functional change intended. Reviewed by: kib MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20470 Notes: svn path=/head/; revision=348785
* Include eventhandler.h in more compilation unitsConrad Meyer2019-05-211-0/+1
| | | | | | | | | | | | | | | | This was enumerated with exhaustive search for sys/eventhandler.h includes, cross-referenced against EVENTHANDLER_* usage with the comm(1) utility. Manual checking was performed to avoid redundant includes in some drivers where a common os_bsd.h (for example) included sys/eventhandler.h indirectly, but it is possible some of these are redundant with driver-specific headers in ways I didn't notice. (These CUs did not show up as missing eventhandler.h in tinderbox.) X-MFC-With: r347984 Notes: svn path=/head/; revision=348026
* Remove the i915 and radeon drivers.Warner Losh2019-02-19186-183247/+0
| | | | | | | | | | | | | Per discussions on arch@ and elsewhere, the maintenance of this code has moved to the drm-kmod and drm-legacy-kmod ports. Remove the i915 and radeon drivers from the tree. Approved by: graphics team Reviewed by: manu@, mmel@ Differential Revision: https://reviews.freebsd.org/D19196 Notes: svn path=/head/; revision=344299
* Complete the removal of obsolete ioctl handlers.Mark Johnston2019-01-092-8/+0
| | | | | | | | | | | PR: 234706 Reviewed by: imp MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18778 Notes: svn path=/head/; revision=342888
* Remove UMS support code from radeonkms.Mark Johnston2018-12-179-10807/+33
| | | | | | | | | | | | | | | | The code is unreachable since the entries of radeon_ioctls[] are not associated with any device: we provide only the KMS entry points. Moreover, r600_cp_dispatch_texture() contains an integer overflow bug that can be triggered from userspace.[1] Reported by: Anonymous of the Shellphish Grill Team[1] Reviewed by: dumbbell MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18516 Notes: svn path=/head/; revision=342182