aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/drm2
Commit message (Collapse)AuthorAgeFilesLines
* drm2: update gone_in to 16 from 13David E. O'Brien2025-11-131-1/+1
|
* vt: refer to correct man section.Matteo Riondato2025-07-221-1/+1
| | | | | | Signed-off-by: Matteo Riondato <matteo@FreeBSD.org> Reviewed by: imp,emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/1781
* gone_in: make it __printflike()Gleb Smirnoff2025-06-241-10/+3
| | | | | | | | | | | | Provide flexibility to use format strings for gone_in(). As a side effect, this removes hardcoded string "Obsolete code will be removed soon:" from the message, so now it is obligation of the deprecated code to provide a meaningful message. This required a small adoption of the existing users: midi, drm2 and le(4). Note that gone_in() is not a public KPI as it has no sense to use it outside of the FreeBSD tree. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D50783
* drm2/ttm: Add missing includes to fix arm TEGRA124 buildJessica Clarke2025-05-311-1/+3
| | | | Fixes: bcd85e0150c9 ("vm_page: make iter_insert() public")
* vm_page: make iter_insert() publicDoug Moore2025-05-091-3/+6
| | | | | | | | | In places where vm_page_insert() is used after lookups, or for consecutive pages, use vm_page_iter_insert instead, to exploit locality. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D50248
* vm_lowmem: Fix signature mismatches in vm_lowmem callbacksSHENGYI HONG2025-03-051-1/+1
| | | | | | | This is required for kernel CFI. Reviewed by: rrs, jhb, glebius Differential Revision: https://reviews.freebsd.org/D49111
* LinnuxKPI: drm2: retire timespec_to_jiffies()Bjoern A. Zeeb2025-02-011-1/+0
| | | | | | | | | | | | | | Linux has removed timespec_to_jiffies() half a decade ago [1]. I cannot find any use of it anymore in recent drm-kmod branches or in the tree so retire it. While here also retire it from drm2. Reported by: emaste (D48318) [1]. Sponsored by: The freeBSD Foundation MFC after: 2 weeks Reviewed by: emaste, dumbbell (tested all drm-kmod versions, thanks!) Differential Revision: https://reviews.freebsd.org/D48379
* Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin2024-12-061-1/+1
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47675
* device_pager: user iterators to free device pagesDoug Moore2024-11-211-17/+3
| | | | | | | | | | | Change cdev_mgtdev_page_free_page to take an iterator, rather than an object and page, so that removing the page from the object radix tree can take advantage of locality with iterators. Define a general-purpose function to free all pages, which can be used in several places. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D47692
* drm2: Stop checking for failures from malloc(M_WAITOK)Zhenlei Huang2024-09-033-79/+1
| | | | | MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852
* dev_pager: define free_page for mgt devicesDoug Moore2024-08-211-1/+1
| | | | | | | | | Callers of cdev_pager_free_page in the kernel always have object->type == OBJT_MGTDEVICE. Define a function for them to call that skips the runtime type check in cdev_pager_free. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D46389
* newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANYWarner Losh2024-07-251-1/+1
| | | | Sponsored by: Netflix
* log2: move log2 functions from linuxkpi to libkernDoug Moore2024-06-241-7/+0
| | | | | | | | | | | | | | | | | | | | | Linux has a header file that defines an ilog2 function and some simple functions/macros that use it: roundup_pow_of_two, is_power_of_2, rounddown_pow_of_two, and order_base_2. This change moves three of those simple functions (all but is_power_of_2) from linuxkpi to libkern. It also deletes a few implementations of these functions that have previously been copied into code for various device drivers, so that they can use the libkern version. The is_power_of_2 macro was not moved because powerof2 in param.h provides almost the same service already (except that they disagree about whether 0 is a power of two). Since the linux definitions of these functions were copied into FreeBSD 11 years ago, linux has improved them, and this change provides those improvements. In particular, a giant table of log values for evaluating ilog2 for constant values is no longer necessary. Reviewed by: alc, markj (previous version) Differential Revision: https://reviews.freebsd.org/D45536
* drm2: Remove one more implementation of ilog2()Mark Johnston2024-06-051-7/+0
| | | | | | Reviewed by: dougm Fixes: b0056b31e900 ("libkern: add ilog2 macro") Differential Revision: https://reviews.freebsd.org/D45504
* Avoid waiting on physical allocations that can't possibly be satisfiedJason A. Harmening2023-12-242-5/+8
| | | | | | | | | | | | | | | | | | | | | | | - Change vm_page_reclaim_contig[_domain] to return an errno instead of a boolean. 0 indicates a successful reclaim, ENOMEM indicates lack of available memory to reclaim, with any other error (currently only ERANGE) indicating that reclamation is impossible for the specified address range. Change all callers to only follow up with vm_page_wait* in the ENOMEM case. - Introduce vm_domainset_iter_ignore(), which marks the specified domain as unavailable for further use by the iterator. Use this function to ignore domains that can't possibly satisfy a physical allocation request. Since WAITOK allocations run the iterators repeatedly, this avoids the possibility of infinitely spinning in domain iteration if no available domain can satisfy the allocation request. PR: 274252 Reported by: kevans Tested by: kevans Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D42706
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-273-3/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* drm2: whack set-but-not-used warnsMateusz Guzik2023-09-183-3/+3
|
* drm2: fix build after abs64 became globalMateusz Guzik2023-09-091-7/+0
| | | | | Fixes: 229c65a83fb ("kern: Globally define abs64") Sponsored by: Rubicon Communications, LLC ("Netgate")
* 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-28/+6
|
* 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