summaryrefslogtreecommitdiff
path: root/sys/dev/wscons
AgeCommit message (Collapse)Author
2024-03-25Add 'ws_' prefix to 'wseventvar' structure members. No functionalVitaliy Makkoveev
changes. ok miod
2024-02-18Prevent ioctl(WSKBDIO_GETENCODINGS) NULL deference when sysctlAnton Lindqvist
machdep.forceukbd is enabled without any USB keyboard being attached. Found the hard way by sthen@; ok miod@
2024-01-19Rename WSDISPLAY_TYPE_RKDRM to WSDISPLAY_TYPE_KMS such that we can use itMark Kettenis
for other generic KMS drivers. ok jsg@, matthieu@
2023-11-23now always needs sys/task.hTheo de Raadt
2023-11-22Add support for keyboard backlight hotkeys in wskbd and hook up macppc appleTobias Heider
keyboards. From jon (at) elytron (dot) openbsd (dot) amsterdam with some changes by me ok gkoehler@
2023-09-08Remove the remnants of the leftover selinfo from vnode(9) layer. JustVitaliy Makkoveev
mechanical 'selinfo' to 'klist' replacement in 'vnode' structure because knote(9) API is already used. <sys/selinfo.h> headers added where is was required. ok bluhm
2023-08-15Replace a bunch of (1 << 31) with (1U << 31)Miod Vallat
2023-08-02Minor changes to reduce differences between vt100 and sun emulations. NFCIMiod Vallat
2023-07-24Fix scan code value for print screen key.Miod Vallat
2023-07-24Make sure we do not increase the escape sequence argument count beyond usableMiod Vallat
bounds, in case escape sequences end up with too many semicolons. Without this, the kernel could be made to access random memory after receiving some specially crafted DCS or CSI terminal escape sequences. Reported by David Leadbeater (dgl, dgl dot cx)
2023-07-09Add suspend key support in wskbd and make it work on Apple ARM laptops.Tobias Heider
feedback and ok miod@
2023-07-06Clear knotes when finishing wseventvarVisa Hankala
When finishing a wseventvar in wsevent_fini(), clear the klist. Otherwise knotes can be left dangling, which can crash the kernel. In general, klist_invalidate() should happen after vdevgone() in order to avoid a race with kevent registration. However, the current wscons drivers clear the wsevent pointer (sc->sc_base.me_evp) before calling wsevent_fini(). This prevents the drivers from registering new kevents. Prompted by a report by Peter J. Philipp on bugs@ OK mvs@ miod@
2023-07-02Add button mappings for two- and three-finger clicks on clickpads.Ulf Brosziewski
Based on a proposal of tobhe@. ok tobhe@
2023-04-20add viogpu, a VirtIO GPU driverJoshua Stein
works enough to get a console on qemu with more work to come from others feedback from miod ok patrick
2023-04-13Catch up with box drawing characters which have been standardized in unicodeMiod Vallat
after the original wscons code was written and chose placeholder values. From NetBSD (wsemul_vt100_chars.c r1.8 and r1.14) via Crystal Kolipe, thanks!
2023-03-06Correctly account the number of bytes processed when outputting UTF-8 encodedMiod Vallat
characters.
2023-03-06Replace old'n'wrong UTF-8 logic with a better one borrowed from Citrus;Miod Vallat
issue reported by Crystal Kolipe on tech@
2023-02-26Add a few missing bounds checks when processing terminal escape sequences.Miod Vallat
Without them, the kernel could be made to crash or reboot after receiving some specially crafted terminal escape sequences. Reported by David Leadbeater (dgl, dgl dot cx)
2023-01-23Add Backtab key, based on a change from Crystal Kolipe kolipe.c atNicholas Marriott
exoticsilicon dot com. ok miod
2023-01-12Disable double width and height escape sequences under SMALL_KERNEL.Nicholas Marriott
ok miod
2023-01-12free(NULL) has been allowed in the kernel since 5.4; remove checks.Miod Vallat
2023-01-12Add CBT (cursor back tab) sequence, from Crystal Kolipe kolipe.c atNicholas Marriott
exoticsilicon dot com. ok miod
2023-01-12Add aixterm bright colour sequences (SGR 90-97 and 100-107). FromNicholas Marriott
Crystal Kolipe kolipe.c at exoticsilicon dot com. ok miod
2023-01-12Add some missing cursor movement and scrolling escape sequences that areNicholas Marriott
supported by xterm. From Crystal Kolipe kolipe.c at exoticsilicon dot com. ok miod
2023-01-10Switch to console before suspending in DUMBFB mode. Fixes frame buffer ↵Tobias Heider
corruption and a few other bugs/races after wakeup on Apple Silicon laptops and Lenovo x13s. ok kettenis@ deraadt@
2023-01-10rhe -> the from Crystal KolipeTheo Buehler
2023-01-09DIAGNOSTIC is redundant with KASSERT, remove it. From Crystal Kolipe.Nicholas Marriott
ok guenther
2023-01-09Correct length of replies to primary and secondary DAs so as not to sendNicholas Marriott
a stray trailing NUL byte. From Crystal Kolipe. ok deraadt miod
2022-11-26While emulating the bell, wsdisplay could end up sleeping when reachingAnton Lindqvist
down to wsmux. This does not work since we're in interrupt context, as pointed out by witness. Instead, defer the work to a task which in turn will execute in process context. Problem reported by beck@ ok visa@
2022-11-10Move the code handling brightness keys into a task, since withMatthieu Herrb
inteldrm(4) it requires a process context. ok kettenis@
2022-10-16Fix a bug in the initialization mechanism of wsmouse.Ulf Brosziewski
The CONFIGURED flag, which indicates that first-time initialization has been completed, must be set immediately after the first call to wstpad_configure. Otherwise, passing touchpad parameters to the initialization function has no effect for some of them.
2022-07-15Implement support for framebuffers that don't start on a page boundary.Mark Kettenis
This happens on the new 14" and 16" Macbook Pro where we deliberately use a framebuffer that skips the first few lines to avoid "the notch". The offset of the first pixel is added to struct wsdisplay_fbinfo. The stride is added as well, mirroring the value returned by the WSDISPLAYIO_LINEBYTES ioctl, such that we can retire that one in the future. A compat ioctl is implemented to help the transition. The compat code will be removed after OpenBSD 7.3 has been released. ok miod@
2022-07-08Display parameters exposed to userland as percentages (backlight, brightness,Miod Vallat
contrast) are not valid if they only have one state, i.e. minimum and maximum values being equal. Do not expose them to userland in this case, for wsconsctl would attempt to divide by zero (which is known to have unwelcome consequences). This allows display drivers trusting not-so-reliable sources (fdt, bogus hardware...) to not have to perform those checks themselves. Found the hard way by daniel@. No firm consensus on this workaround, using one seniority point here, will revert if this spawns complaints.
2022-07-05Remove old poll/select wakeup mechanism.Visa Hankala
Also remove unneeded seltrue() and selfalse(). OK mpi@ jsg@
2022-07-02Remove unused device poll functions.Visa Hankala
Also remove unneeded includes of <sys/poll.h> and <sys/select.h>. Some addenda from jsg@. OK miod@ mpi@
2022-06-20Fix console screen blanker setting timeout back to zeroGreg Steuck
Tested locally. "looks correct" to miod@ From Crystal Kolipe kolipe DOT c AT exoticsilicon DOT com
2022-06-09Reorganize the handling of tap inputs.Ulf Brosziewski
This change fixes bugs concerning the transition into the hold/drag state after double taps or two- or three-finger taps. In addition, it ensures that button events properly match the logical button state when tap inputs and button inputs overlap.
2022-04-06constify struct cfattachChristian Weisgerber
2022-02-16Currently, wskbd_set_mixervolume() only adjusts the volume of the firstAnton Lindqvist
attached audio device, i.e. audio0. This approach does not work well while using additional audio devices equipped with physical volume keys since those would only affect the volume of audio0. Instead, correlate audio and ucc devices attached over USB in order to adjust the volume of the correct audio device. This is done by passing a cookie from the common point of attachment which is later used to correlate the audio and wskbd device. The same approach could be adopted for audio and wskbd devices attaching on a different bus. Keep in mind that it's of importance to make use of and increment the same global cookie identifier to avoid collisions. Makes the volume keys on my Logitech G435 Headset do the right thing. ok ratchov@
2021-12-30Prevent a double free by assigning the new keymap and corresponding sizeAnton Lindqvist
after the allocation and initialization is done. Otherwise, a race is possible if malloc ends up sleeping. ok sashan@ Reported-by: syzbot+7f8224e9f1a3487caf25@syzkaller.appspotmail.com
2021-10-22One could end up with the wrong encoding in xenocara while having a uccAnton Lindqvist
keyboard attached and /etc/kbdtype being present. The advertised encoding of a wsmux is a bit fragile as the last attached device will dictate it. If this happens to be a ucc keyboard, KB_US will always be the advertised encoding as its encoding is immutable and /etc/kbdtype is ignored. Instead, do not advertise the encoding for ucc devices when the parent mux queries its attached devices. However, asking the device directly (i.e. bypassing the mux) still returns the encoding as wsconsctl(8) would otherwise report an error. Thanks to landry@ for the report and testing.
2021-09-22Prevent ucc keyboards from changing the wsmux keyboard layout.Anton Lindqvist
ok deraadt@
2021-09-20Changing the encoding of a ucc keyboard doesn't make sense as only oneAnton Lindqvist
encoding is supported. Instead, silently ignore such requests. Gets rid of the following warning emitted by kbd(8) while booting with a ucc keyboard attached and /etc/kbdtype being present: kbd: unsupported encoding uk on /dev/wskbd2 I ended up repurposing KB_MACHDEP as is became unused back in 2008. Note that running a kernel with this commit applied requires kbd and wsconsctl to be recompiled in order to show correct encodings. Problem reported by landry@ and ok deraadt@
2021-03-24Improve the tap detection mechanism.Ulf Brosziewski
Revision 1.29 of wstpad.c has removed the 'maxdist' checks for multi-finger taps. While this change makes tap detection more reliable, and does not affect inputs intended for pointer movement, it might interfere with short scroll gestures. This version reorganizes the filtering code, and reintroduces a weaker version of those checks for MT touchpads.
2021-03-24Make tap detection less restrictive for multi-finger taps.Ulf Brosziewski
In order to distinguish tap gestures from short movements, the mechanism checks whether the distance between the first and the last position of a touch exceeds the 'maxdist' limit. Some touchpads provide unreliable coordinates when more than one contact is being made simultaneously, and in this case the filter may be too strong - and superfluous, because only one-finger contacts should trigger pointer movement.
2021-03-21Include wstpad allocations when cleaning up wsmouse resources.Ulf Brosziewski
ok gnezdo@
2021-03-12Add WSDISPLAYIO_DEPTH_30 in order to support 30-bit color support.Mark Kettenis
ok jsg@
2021-03-03Add a configurable button mapping for tap gestures on touchpads.Ulf Brosziewski
Thanks to RJ Johnson for this work! ok mpi@
2021-02-09ddb: when a new wsdisplay console attaches, resize ddb cols/rows to itJoshua Stein
ok visa
2021-01-09Revert mistaken commit: Stop wsmux_attach_sc race from anton@gnezdo