aboutsummaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
2020-11-23terminal: Improve loggingKenny Levinsen
2020-09-22terminal: Ack both release and acquireKenny Levinsen
Linux only requires acking release and ignores ack of acquire, but FreeBSD is more stringent and will patiently wait for both to be acked. Implement proper acking for both events.
2020-09-22terminal: Fix VT numbering on FreeBSDKenny Levinsen
FreeBSD adds one to the VT number returned by the GET_ACTIVE ioctl, so to match things up, the wrapper here subtracted by one. This lead to ttyv0 being named VT 0. This had the side-effect of VT numbering not matching expectations, and switching not behaving as intended. Align numbers with expectations, and move the required subtraction to terminal_open, so that VT 1 matches ttyv0.
2020-09-22drm: Relax drm file detection, support FreeBSDKenny Levinsen
Path check was done on /dev/dri/card and /dev/dri/renderD. However, /dev/dri/by-path is a thing, and on FreeBSD, /dev/dri/ symlinks to /dev/drm/. Relax Linux check to /dev/dri/, and add FreeBSD check for /dev/drm/.
2020-08-31Remove unused list implementationKenny Levinsen
2020-08-31linked_list: linked_list_take should concat listsKenny Levinsen
2020-08-30linked_list: Implement linked_list_takeKenny Levinsen
2020-08-29libseat: Improve logging with seatd conn helpersKenny Levinsen
Add helpers around connection access to have all logging centralized and reduce code duplication. Improve existing helpers to further reduce code duplication. The seatd backend should have much better logging after this.
2020-08-28terminal: Explain FreeBSD current_vt behaviorKenny Levinsen
2020-08-28terminal: Construct TTY paths correctly on FreeBSDKenny Levinsen
FreeBSD TTY paths are contructed in the kernel using the %r formatter, which in this case ends up being a base 32 encoding. The base 32 implementation is taken more or less directly from wlroots commit fc6c0ca12e94.
2020-08-28terminal: FreeBSD VT num is 1 higher than tty numKenny Levinsen
This was causing all VT and TTY changes to be applied to the wrong TTY.
2020-08-28terminal: Set K_RAW and term raw mode on FreeBSDKenny Levinsen
Taken from X11, weston and consolekit2 ports for FreeBSD. Setting just K_CODE as done before makes input seemingly have no ill effects, but it is still buffered and possibly send to the terminal after application exit if stdin is never drained. Setting raw mode appears to be needed to solve that issue. A K_OFF-like VT keyboard setting like Linux has would seem more appropriate, but that is not currently available to us on FreeBSD.
2020-08-28Introduce libseat_set_log_levelSimon Ser
The default level is SILENT. log_init no longer takes an initial log level (so that calls to libseat_set_log_level prior to log_init work correctly).
2020-08-28Introduce libseat_set_log_handlerSimon Ser
This allows libseat users to register a custom logging function.
2020-08-28Rename enum log_level to libseat_log_levelSimon Ser
This is preparatory work for exposing a public function to set libseat's log handler.
2020-08-05log: Remove libseat prefixesKenny Levinsen
2020-08-05Remove pointless compiler.hKenny Levinsen
2020-08-04linked_list: Assert initialized list in linked_list_emptyKenny Levinsen
2020-08-03linked_list: Initial implementationKenny Levinsen
2020-08-03list: Make list_concat argument constKenny Levinsen
2020-08-02list: Add list_pop_backKenny Levinsen
2020-08-02seat: Open/close tty on activation/deactivationKenny Levinsen
The VT and KD ioctl's are picky about the tty fd used. In order to satisfy these, and to improve state cleanup, we now only and store the current tty when opening a client, and use this fd to perform teardown later. The presence of the fd is also used to signal that teardown is needed.
2020-08-02terminal: Correctly set K_ON on keyboard enableKenny Levinsen
2020-08-02log: Fix inverted loglevel checkKenny Levinsen
2020-08-01Remove ALWAYS_INLINEKenny Levinsen
Didn't do what I wanted it to anyway.
2020-08-01connection: Shrink buffers from 1KB to 256B eachKenny Levinsen
2020-08-01client: Implement get_peer for FreeBSDKenny Levinsen
2020-08-01devices: Use path to check device typeKenny Levinsen
FreeBSD device numbers cannot be used to check the type of a device, as they are merely unique filesystem IDs. As the paths we use have been sanitized with realpath, we can simply use the path to check if a requested file is an evdev or drm device. This also allows us to make the check before the file is opened.
2020-08-01devices: FreeBSD support in drm and evdev codeKenny Levinsen
2020-08-01terminal: FreeBSD VT and KD handlingKenny Levinsen
2020-07-31Initial implementation of seatd and libseatKenny Levinsen