summaryrefslogtreecommitdiff
path: root/sys/dev/drm2
AgeCommit message (Collapse)Author
2025-11-13drm2: update gone_in to 16 from 13David E. O'Brien
2025-07-22vt: refer to correct man section.Matteo Riondato
Signed-off-by: Matteo Riondato <matteo@FreeBSD.org> Reviewed by: imp,emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/1781
2025-06-24gone_in: make it __printflike()Gleb Smirnoff
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
2025-05-31drm2/ttm: Add missing includes to fix arm TEGRA124 buildJessica Clarke
Fixes: bcd85e0150c9 ("vm_page: make iter_insert() public")
2025-05-08vm_page: make iter_insert() publicDoug Moore
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
2025-03-04vm_lowmem: Fix signature mismatches in vm_lowmem callbacksSHENGYI HONG
This is required for kernel CFI. Reviewed by: rrs, jhb, glebius Differential Revision: https://reviews.freebsd.org/D49111
2025-02-01LinnuxKPI: drm2: retire timespec_to_jiffies()Bjoern A. Zeeb
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
2024-12-06Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin
Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47675
2024-11-21device_pager: user iterators to free device pagesDoug Moore
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
2024-09-03drm2: Stop checking for failures from malloc(M_WAITOK)Zhenlei Huang
MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852
2024-08-21dev_pager: define free_page for mgt devicesDoug Moore
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
2024-07-24newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANYWarner Losh
Sponsored by: Netflix
2024-06-24log2: move log2 functions from linuxkpi to libkernDoug Moore
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
2024-06-05drm2: Remove one more implementation of ilog2()Mark Johnston
Reviewed by: dougm Fixes: b0056b31e900 ("libkern: add ilog2 macro") Differential Revision: https://reviews.freebsd.org/D45504
2023-12-23Avoid waiting on physical allocations that can't possibly be satisfiedJason A. Harmening
- 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
2023-11-26sys: Automated cleanup of cdefs and other formattingWarner Losh
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
2023-09-18drm2: whack set-but-not-used warnsMateusz Guzik
2023-09-09drm2: fix build after abs64 became globalMateusz Guzik
Fixes: 229c65a83fb ("kern: Globally define abs64") Sponsored by: Rubicon Communications, LLC ("Netgate")
2023-08-16sys: Remove $FreeBSD$: one-line .c patternWarner Losh
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16sys: Remove $FreeBSD$: one-line .c comment patternWarner Losh
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
2023-08-16sys: Remove $FreeBSD$: one-line .h patternWarner Losh
Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
2023-08-16sys: Remove $FreeBSD$: two-line .h patternWarner Losh
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-15drm2: remove unused Alpha and MIPS #definesEd Maste
2023-05-12spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh
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
2022-10-05Remove an extra argument to SYSCTL_FOREACHAndrew Turner
This was missed in e0853c933661. Sponsored by: The FreeBSD Foundation
2022-10-05Use SYSCTL_FOREACH in drm2Andrew Turner
This was added recently. Use it to get the correct _FOREACH macro. Sponsored by: The FreeBSD Foundation
2022-09-30Alter the prototype of qsort_r(3) to match POSIX, which adopted theEd Schouten
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
2022-09-22kmem_malloc/free: Use void * instead of vm_offset_t for kernel pointers.John Baldwin
Reviewed by: kib, markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D36549
2022-09-22pmap_unmapdev/bios: Accept a pointer instead of a vm_offset_t.John Baldwin
This matches the return type of pmap_mapdev/bios. Reviewed by: kib, markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D36548
2022-08-14Adjust function definition in drm_fb_helper.c to avoid clang 15 warningDimitry Andric
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
2022-07-12vm_object: Modify various drivers to allocate OBJT_SWAP objectsMark Johnston
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
2022-05-10drm2: Remove unused devclass argument to DRIVER_MODULE.John Baldwin
2022-05-10drm2: Remove unused drm_devclass.John Baldwin
2022-04-14Revert "drm2: Fix a typo in a source code comment"Gordon Bergling
This reverts commit 5158cf0a382eb9079e1851f86293f37a1cf25f5b.
2022-04-13drm2: Remove unused variables.John Baldwin
2022-04-09drm2: Fix a typo in a source code commentGordon Bergling
- s/mmaping/mapping/ MFC after: 3 days
2022-03-29Revert "drm2: Fix a typo in a source code comment"Gordon Bergling
The comment about 'mmaping' was actually correct since the comment was referencing to mmap(2). Reported by: alc This reverts commit 22ba115b49a2c266aa1967f6b192b7aa8f883b7d.
2022-03-28drm2: Fix a typo in a source code commentGordon Bergling
- s/mmaping/mapping/ MFC after: 3 days
2021-12-09Create wrapper for Giant taken for newbusWarner Losh
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
2021-11-30Make device_busy/unbusy work w/o Giant heldWarner Losh
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
2021-11-30Revert "Make device_busy/unbusy work w/o Giant held"Warner Losh
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
2021-11-30Make device_busy/unbusy work w/o Giant heldWarner Losh
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
2021-10-19Convert consumers to vm_page_alloc_noobj_contig()Mark Johnston
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
2021-10-19Convert vm_page_alloc() callers to use vm_page_alloc_noobj().Mark Johnston
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
2021-08-14Fix some common typos in source code commentsGordon Bergling
- s/struture/structure/ - s/structre/structure/ MFC after: 5 days
2021-08-08Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrightsEd Maste
These ones were unambiguous cases where the Foundation was the only listed copyright holder (in the associated license block). Sponsored by: The FreeBSD Foundation
2020-10-06Don't permit DRM buffer mappings to be upgraded to executable.John Baldwin
Reviewed by: kib MFC after: 1 month Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26697 Notes: svn path=/head/; revision=366494
2020-09-03drm2: Fix build after r365264Niclas Zeising
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
2020-09-02drm2: Further improve deprecation messageNiclas Zeising
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
2020-08-24drm2: Update deprecation messageNiclas Zeising
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