summaryrefslogtreecommitdiff
path: root/sys/dev/fb
AgeCommit message (Collapse)Author
2024-01-12fb: Check for errors from copyin()Mark Johnston
When compiling with gcc, a function annotated with __result_use_check cannot have its return value ignored with a void cast. So, try to handle it. MFC after: 1 week
2023-12-26fb: Explicitly handle errors when getting or setting a colour paletteMark Johnston
In the VESA driver, simply ignore errors. It is not clear to me how to return them to userspace. This is in preparation for annotating copyin() and related functions with __result_use_check. MFC after: 1 week
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-08-17Remove my middle name.Dag-Erling Smørgrav
2023-08-16sys: Remove $FreeBSD$: one-line .c patternWarner Losh
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16sys: Remove $FreeBSD$: two-line .h patternWarner Losh
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
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
2023-03-01fb: whack __mips__ leftoversMateusz Guzik
Sponsored by: Rubicon Communications, LLC ("Netgate")
2022-10-03Fix various places which cast a pointer to a vm_paddr_t or vice versa.John Baldwin
GCC warns about the mismatched sizes on i386 where vm_paddr_t is 64 bits. Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D36750
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-07-19Adjust fbd_list() definition to avoid clang 15 warningDimitry Andric
With clang 15, the following -Werror warnings is produced: sys/dev/fb/fbd.c:205:9: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] fbd_list() ^ void This is because fbd_list() 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-06-21fb: Add a default getinfo methodEmmanuel Vadot
fb_getinfo is badly designed as it returns either the info if the driver have the method or ENXIO via the kobj stuff if the driver doesn't have it. Add a default method that returns NULL as the code already checks this and it avoid changing the interface. None of the drm drivers supported have this method and it sometimes fails and panic when loading them (for now only usb-c docks seems to be affected). MFC after: 3 days Sponsored by: Beckhoff Automation GmbH & Co. KG
2022-05-06s3pci: Remove unused devclass argument to DRIVER_MODULE.John Baldwin
2022-05-06Remove unused fbd_devclass.John Baldwin
2022-04-21FB_INSTALL_CDEV: Remove this option and related code.John Baldwin
This option was never enabled in GENERIC and does not appear to work (the cdevsw is stored in a global array but never passed to make_dev to be associated with a character device). Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D35008
2022-04-07splash_pcx: Remove unused variables.John Baldwin
2021-12-06fb: Remove some unused ioctlsEmmanuel Vadot
6d1699583d7e added the FBIOGXINFO,FBIOMONINFO and FBIOPUTCMAPI/FBIOGETCMAPI ioctls and said that implementation in driver will come later. Since it was in 2001 I think we can remove this. Reviewed by: emaste, imp, tsoome MFC after: 2 weeks Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D33218 Differential Revision: https://reviews.freebsd.org/D33219 Differential Revision: https://reviews.freebsd.org/D33220
2021-12-06fb: Remove unused cursors ioctlsEmmanuel Vadot
The cursors related ioctls were added in 1994 with the 4.4 Lite import but were never implemented in either sc(4), fb(4) or vt(4). Remove it. Reviewed by: emaste, tsoome MFC after: 2 weeks Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D33217
2021-12-06fb: Remove unused FBIOVERTICAL ioctlEmmanuel Vadot
Commit 6d1699583d7e added the FBIOVERTICAL ioctl and said that implementation in driver will come later. Since it was in 2001 I think we can remove this. MFC after: 2 weeks Sponsored by: Beckhoff Automation GmbH & Co. KG
2021-12-06fb: Remove unused FBIOSVIDEO/FBIOGVIDEO ioctlsEmmanuel Vadot
The FBIOSVIDEO/FBIOGVIDEO ioctls were added in 1994 with the 4.4 Lite import but were never implemented in either sc(4), fb(4) or vt(4). Remove it. Reviewed by: emaste, tsoome MFC after: 2 weeks Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D33216
2021-12-06fb: Remove unused FBIOSATTR/FBIOGATTR ioctlsEmmanuel Vadot
The FBIOSATTR/FBIOGATTR ioctls were added in 1994 with the 4.4 Lite import but were never implemented in either sc(4), fb(4) or vt(4). Remove it. Reviewed by: emaste, tsoome MFC after: 2 weeks Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D33215
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
2021-01-22fb_if: remove unused methodMarius Strobl
Apparently, it never came into play.
2021-01-22boot_font(4): remove obsolete fontMarius Strobl
It's no longer used since 4e421792ec80df7a5fa82e97dcc3575c3ec6740a and r325892 respectively.
2020-12-25gallant12x22(4): remove obsolete fontMarius Strobl
It's no longer used since 58aa35d42975c298ca0adba705c042596303c9f5 and r357455 respectively.
2020-09-18vm_ooffset_t is now unsignedEric van Gyzen
vm_ooffset_t is now unsigned. Remove some tests for negative values, or make other adjustments accordingly. Reported by: Coverity Reviewed by: kib markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D26214 Notes: svn path=/head/; revision=365886
2020-02-26Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki
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. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
2020-02-03Remove sparc64 kernel supportWarner Losh
Remove all sparc64 specific files Remove all sparc64 ifdefs Removee indireeect sparc64 ifdefs Notes: svn path=/head/; revision=357455
2019-11-13Stop the VESA driver from whining loudly in the dmesg during boot onScott Long
systems that use EFI instead of BIOS. Notes: svn path=/head/; revision=354683
2019-05-21Include eventhandler.h in more compilation unitsConrad Meyer
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
2019-01-30i386: Merge PAE and non-PAE pmaps into same kernel.Konstantin Belousov
Effectively all i386 kernels now have two pmaps compiled in: one managing PAE pagetables, and another non-PAE. The implementation is selected at cold time depending on the CPU features. The vm_paddr_t is always 64bit now. As result, nx bit can be used on all capable CPUs. Option PAE only affects the bus_addr_t: it is still 32bit for non-PAE configs, for drivers compatibility. Kernel layout, esp. max kernel address, low memory PDEs and max user address (same as trampoline start) are now same for PAE and for non-PAE regardless of the type of page tables used. Non-PAE kernel (when using PAE pagetables) can handle physical memory up to 24G now, larger memory requires re-tuning the KVA consumers and instead the code caps the maximum at 24G. Unfortunately, a lot of drivers do not use busdma(9) properly so by default even 4G barrier is not easy. There are two tunables added: hw.above4g_allow and hw.above24g_allow, the first one is kept enabled for now to evaluate the status on HEAD, second is only for dev use. i386 now creates three freelists if there is any memory above 4G, to allow proper bounce pages allocation. Also, VM_KMEM_SIZE_SCALE changed from 3 to 1. The PAE_TABLES kernel config option is retired. In collaboarion with: pho Discussed with: emaste Reviewed by: markj MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D18894 Notes: svn path=/head/; revision=343567
2018-01-21Revert r327828, r327949, r327953, r328016-r328026, r328041:Pedro F. Giffuni
Uses of mallocarray(9). The use of mallocarray(9) has rocketed the required swap to build FreeBSD. This is likely caused by the allocation size attributes which put extra pressure on the compiler. Given that most of these checks are superfluous we have to choose better where to use mallocarray(9). We still have more uses of mallocarray(9) but hopefully this is enough to bring swap usage to a reasonable level. Reported by: wosch PR: 225197 Notes: svn path=/head/; revision=328218
2018-01-13dev: make some use of mallocarray(9).Pedro F. Giffuni
Focus on code where we are doing multiplications within malloc(9). None of these is likely to overflow, however the change is still useful as some static checkers can benefit from the allocation attributes we use for mallocarray. This initial sweep only covers malloc(9) calls with M_NOWAIT. No good reason but I started doing the changes before r327796 and at that time it was convenient to make sure the sorrounding code could handle NULL values. Notes: svn path=/head/; revision=327949
2017-11-30SPDX: Consider code from Carnegie-Mellon University.Pedro F. Giffuni
Interesting cases, most likely from CMU Mach sources. Notes: svn path=/head/; revision=326403
2017-11-27sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni
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
2017-11-20sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni
Mainly focus on files that use BSD 3-Clause license. 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. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326022
2017-04-20Write-combine framebuffer writes through user-space mappings, if possible.Konstantin Belousov
Note that KVA mapping of the framebuffer already uses write-combining mode, so the change, besides improving speed of user mode writes, also satisfies requirement of the IA32 architecture of using consistent caching modes for multiple mappings of the same page. Reported and tested by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=317196
2017-04-20Attempt to determine the modes in which 8-bit wide characters are actuallyBruce Evans
9 wide. I only need this to improve the mouse cursor, but it has always been needed to select and/or adjust fonts. This is complicated because there are no standard parameter tables giving this bit of information directly, and the device register bit giving the information can't be trusted even if it is read from the hardware. Use a heuristic to guess if the device register can be trusted. (The device register is normally read from the BIOS mode table, but on my system where the device register is wrong, the mode table doesn't match the hardware and is not used; the device registers are used in this case.) Notes: svn path=/head/; revision=317190
2017-04-19When we don't use the parameter table in the BIOS, also don't use mostBruce Evans
of our tweaked modes based on it. In practice, this means limiting the tweaked modes to at most 80x50 based on 80x25, so there are no 90-column, 80x30 or 80x60 modes. This happens when the the initial mode is is not in the parameter table. We always detected this case, but assumed that the (necessarily nonstandard) parameters of the initial mode could be tweaked just as blindly as the probably-standard parameters of initial modes in the table. On 1 laptop system with near-VGA where the initial mode is nonstandard, this is because the hardware apparently doesn't support 9-bit mode, but otherwise has standard timing. The initial mode has 8-bit mode CRTC horizontal parameters similar to those in syscons' 90-column modes and in EGA modes. Tweaking these values for the 90-column modes has little effect except to print the extra 10 columns off the screen. Tweaking from 80x25 to 80x30 requires changing from 400 scan lines to 480. This can probably be made to work, but syscons blindly applies values based on standard timing. This gives blank output. Tweaking from 80x25 to 80x50 doesn't change the CRTC timing and works. Notes: svn path=/head/; revision=317142
2017-04-02Reset the DAC to 6-bit mode before calling the BIOS to set the screenBruce Evans
mode. This works around bugs in at least 2 Intel BIOSes for our subsequent setting of the DAC back to 8-bit mode. The bug caused dark (mostly 1/4-intensity) colors for all except the first setting to a VESA graphics mode (including for settings to the current mode). Remove restoration (with less bits) of the palette in vesa_unload() after resetting the DAC to 6-bit mode. Depend on the BIOS to keep the palette consistent with the DAC for the simpler reset case like we do everywhere else in places that are actually important. Setting the video mode should reset everything to defaults, although we usually don't want that. Even the buggy BIOSes set the DAC to the default 6-bit mode, and set the palette to a default that matches the DAC. We don't undo the reset for most things, but we do undo it for the DAC (more precisely, we change to an 8-bit DAC if possible, and this is the only way that we set to an 8-bit DAC; it is accidental that if the DAC was in 8-bit mode from a previous mode switch then setting it to 8-bit mode is an undo). The buggy BIOSes are confused by our setting of the DAC to 8-bit mode in the "undo" case. They should multiply palette entries by 4 to match, but they actually leave all palette entries except #2 (green) and #248-255 (unused) untouched. Green is mysteriously scaled from 0x2a to 0x6a, and #248-255 are scaled correctly. Our support for the 8-bit DAC had almost no effect except to enable bugs. Syscons barely supports 16 colors, so it doesn't benefit much from having a palette with 16 million colors instead of only 256K. Applications can manage the palette using FBIO_{GET,SET}PALETTE, but the palette managed by this is only used in the less interesting modes (text and non-truecolor graphics modes up to 8 bits wide), and the kernel loses the changes on any mode switch (including to another vt in a different mode). Notes: svn path=/head/; revision=316396
2017-03-26Fix 3 entries in mode tables related to mono and 90-column text modes.Bruce Evans
Newer VGAs don't support any mono modes, but bugs in the tables created 2 virtual mono modes (#45 90x43 and #112 80x43) that behaved more strangely than crashing. 90-column modes are tweaked 80-column ones and also fail to work on newer VGAs. #45 did crash (hang) on some hardware. Notes: svn path=/head/; revision=315986
2017-01-28Remove pc98 support completely.Yoshihiro Takahashi
I thank all developers and contributors for pc98. Relnotes: yes Notes: svn path=/head/; revision=312910
2016-10-01Provide way for framebuffer driver to request mmap(2) mapping typeOleksandr Tymoshenko
On ARM if memattr is not overriden mmap(2) maps framebuffer memory as WBWA which means part of changes to content in userland end up in cache and appear on screen gradually as cache lines are evicted. This change adds configurable memattr that hardware fb implementation can set to get the memory mapping type it requires: - Add new flag FB_FLAG_MEMATTR that indicates that framebuffer driver overrides default memattr - Add new field fb_memattr to struct fb_info to specify requested memattr Reviewed by: ray Differential Revision: https://reviews.freebsd.org/D8064 Notes: svn path=/head/; revision=306555
2016-07-23Use MTX_SYSINIT for the VESA lock.John Baldwin
vesa_init_done isn't a reliable guard for the mutex init. If vesa_configure() doesn't find valid VESA info it will not set vesa_init_done, but the lock will remain initialized. Revert r303076 and use MTX_SYSINIT to deterministically init the lock. Reviewed by: royger MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D7290 Notes: svn path=/head/; revision=303225
2016-07-20vesa: fix panic on suspendRoger Pau Monné
Fix the following panic seen when migrating a FreeBSD guest on Xen: panic: mtx_lock() of destroyed mutex @ /usr/src/sys/dev/fb/vesa.c:541 cpuid = 0 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe001d2fa4f0 vpanic() at vpanic+0x182/frame 0xfffffe001d2fa570 kassert_panic() at kassert_panic+0x126/frame 0xfffffe001d2fa5e0 __mtx_lock_flags() at __mtx_lock_flags+0x15b/frame 0xfffffe001d2fa630 vesa_bios_save_restore() at vesa_bios_save_restore+0x78/frame 0xfffffe001d2fa680 vga_suspend() at vga_suspend+0xa3/frame 0xfffffe001d2fa6b0 isavga_suspend() at isavga_suspend+0x1d/frame 0xfffffe001d2fa6d0 bus_generic_suspend_child() at bus_generic_suspend_child+0x44/frame [...] This is caused because vga_sub_configure (which is called if the VGA adapter is attached after VESA tried to initialize), points to vesa_configure, which doesn't initialize the VESA mutex. In order to fix it, make sure vga_sub_configure points to vesa_load, so that all the needed vesa components are properly initialized. Sponsored by: Citrix Systems R&D MFC after: 3 days PR: 209203 Reviewed by: dumbbell Differential revision: https://reviews.freebsd.org/D7196 Notes: svn path=/head/; revision=303076
2016-05-17Fix NULL-dereference panic if VESA reports zero modes.Alexander Motin
MFC after: 1 week Notes: svn path=/head/; revision=300072
2016-05-03sys/dev: minor spelling fixes.Pedro F. Giffuni
Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
2016-04-30sys: Make use of our rounddown() macro when sys/param.h is available.Pedro F. Giffuni
No functional change. Notes: svn path=/head/; revision=298848
2016-04-26sys/dev: extend use of the howmany() macro when available.Pedro F. Giffuni
We have a howmany() macro in the <sys/param.h> header that is convenient to re-use as it makes things easier to read. Notes: svn path=/head/; revision=298646
2016-04-21sys: use our nitems() macro when param.h is available.Pedro F. Giffuni
This should cover all the remaining cases in the kernel. Discussed in: freebsd-current Notes: svn path=/head/; revision=298431