aboutsummaryrefslogtreecommitdiff
path: root/backend
AgeCommit message (Collapse)Author
2022-07-11backend/libinput: code style consistencyJosé Expósito
Reduce a level of identation in "handle_pointer_axis" to keep the consistency with "handle_pointer_axis_value120".
2022-07-11backend/libinput: handle high-res scroll eventsJosé Expósito
On newer versions of libinput, the event LIBINPUT_EVENT_POINTER_AXIS has been deprecated in favour of LIBINPUT_EVENT_POINTER_SCROLL_WHEEL, LIBINPUT_EVENT_POINTER_SCROLL_FINGER and LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS. Where new events are provided by the backend, ignore LIBINPUT_EVENT_POINTER_AXIS, receive high-resolution scroll events from libinput and emit the appropiate wlr_pointer signal.
2022-07-11pointer: transform low-res to high-res axis eventsJosé Expósito
Currently, the "wlr_event_pointer_axis" event stores low-resolution values in its "delta_discrete" field. Low-resolution values are always multiples of one, i.e., 1 for one wheel detent, 2 for two wheel detents, etc. In order to simplify internal handling of events, always transform in the backend from the low-resolution value into the high-resolution value. The transformation is performed by multiplying by 120. The 120 magic number is used by the kernel and it is exposed to clients in the "WLR_POINTER_AXIS_DISCRETE_STEP" constant.
2022-07-11build: check if libinput supports high-res scrollJosé Expósito
Starting with Linux Kernel v5.0 two new axes are available for mice that support high-resolution wheel scrolling: REL_WHEEL_HI_RES and REL_HWHEEL_HI_RES. Both axes send data in fractions of 120 where each multiple of 120 amounts to one logical scroll event. Fractions of 120 indicate a wheel movement less than one detent. Three new events are now available on libinput: LIBINPUT_EVENT_POINTER_SCROLL_WHEEL, LIBINPUT_EVENT_POINTER_SCROLL_FINGER, and LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS. These events replace the LIBINPUT_EVENT_POINTER_AXIS event, so new clients should simply ignore that event. Also, two new APIs are available to access the high-resolution data: libinput_event_pointer_get_scroll_value() and libinput_event_pointer_get_scroll_value_v120(). Add a project argument (LIBINPUT_HAS_SCROLL_VALUE120) to allow building against old versions of libinput or, where high-resolution scroll is available, support it.
2022-06-21wlr_input_device: remove anon union fieldIsaac Freund
This union is unnecessary since the recent input device refactor and can now be replaced by wlr_*_from_input_device() functions.
2022-06-19backend/drm: set "max bpc" to the maxSimon Ser
"max bpc" is a maximum value, the driver is free to choose a smaller value depending on the bandwidth available. Some faulty monitors misbehave with higher bpc values. We'll add a workaround if users get hit by these in practice. References: https://gitlab.freedesktop.org/wayland/weston/-/issues/612
2022-06-19backend/drm: remove unused CRTC count checkSimon Ser
drmIsKMS already checks for this.
2022-06-07backend/drm: fix NULL pointer deference due to typoIsaac Freund
2022-06-07backend/drm: make serial optionalSimon Ser
The EDID 1.4 spec says that the serial number is optional: > If this field is not used, then enter “00h, 00h, 00h, 00h”. Leave the wlr_output.serial field NULL in that case, and hide it from the output description.
2022-06-07backend/drm: unconditionally set "content type" to graphicsSimon Ser
CTA-861-G says that "graphics" is used to indicate non-analog (ie, digital) content. With that bit set, the sink should turn off analog reconstruction and other related filtering.
2022-06-02backend/drm: fix check for no-op commitsIsaac Freund
Since 6936e163b, we short-circut no-op commits as an optimization. However, the logic in the check was slightly off.
2022-06-02backend/drm: short-circuit no-op commitsSimon Ser
Some output commits (changing e.g. the output scale or transform) don't require any change in the KMS state. Instead of going through a KMS commit, return early. Blocking KMS commits can be expensive.
2022-06-01backend/drm: make commits without a buffer blockingSimon Ser
The wlr_output API requires compositors to wait for wlr_output.frame before submitting a new buffer. However, compositors can perform a commit which doesn't involve a buffer anytime. If the commit is a modeset, we set DRM_MODE_ATOMIC_ALLOW_MODESET and block until the commit is done. If it isn't, we currently always perform a non-blocking commit. This is an issue because a previous page-flip might still be in flight kernel-side, returning EBUSY. Fix this by using blocking commits when a buffer isn't submitted by the compositor. Closes: https://github.com/swaywm/sway/issues/6962 References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/2239
2022-05-31backend/drm: improve atomic commit flag loggingSimon Ser
We weren't logging all of the flags, which made debugging more difficult.
2022-05-30output: pass wlr_output_state to backendSimon Ser
Groundwork for the following commits. The goal is to allow users to specify their own wlr_output_state instead of wlr_output.pending.
2022-05-27backend/x11: fix output model strdup callSimon Ser
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3434#note_1401193 Fixes: be86145322e6 ("output: turn make/model/serial into char *")
2022-05-26backend/drm: fix crash with null serialvaxerski
backend/drm: use serial_str instead
2022-05-26output: turn make/model/serial into char *Simon Ser
This allows the make/model/serial to be NULL when unset, and allows them to be longer than the hardcoded array length. This is a breaking change: compositors need to handle the new NULL case, and we stop setting make/model to useless "headless" or "wayland" strings.
2022-05-26backend/drm: fix crash in init_drm_surfaceSimon Ser
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3434
2022-05-25backend/drm: remove wlr_drm_surface.{width,height}Simon Ser
This information is stored in wlr_swapchain, no need to duplicate it.
2022-05-24backend/drm: allow non-linear modifiers for multi-GPUSimon Ser
Prior to [1], if an entry in a DRM format set was different than a single LINEAR modifier, implicit modifiers were always allowed. This has changed and now implicit modifiers are only allowed if INVALID is in the list of modifiers. So now we can safely enable explicit modifiers for cross-GPU imports, without risking receiving buffers with an implicit modifier. This should improve perf a bit on setups where two GPUs from the same vendor are used. This fixes the first bullet point from [2]. [1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3231 [2]: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3331
2022-05-11backend/drm: fetch EDID manufacturer from udev_hwdbSimon Ser
Maintaining our internal table up-to-date is tedious: one needs to manually go through the PnP ID registry [1] and check whether we're missing any entry. udev_hwdb already has an API to fetch a manufacturer name from its PnP ID. Use that instead. [1]: https://uefi.org/pnp_id_list
2022-05-10backend/headless: allow variable refresh rateSimon Ser
Instead of waking up each 16ms to emit a frame event, arm the timer when the output is committed. This allows the headless backend to idle when nothing changes on screen, and behaves similarly to the other backends.
2022-04-29backend/wayland: reset active pointer on destroyKirill Primak
2022-04-28Revert "backend/wayland: zero out finished input devices"Simon Ser
This reverts commit 03c88b07ba64185de7183f52f5f3e4875c5c1d5d. init functions now zero out the structs.
2022-04-28Zero-initialize structs in init functionsSimon Ser
Ensures there is no field left to its previous undefined value after calling an init function.
2022-04-22backend/wayland: zero out finished input devicesKirill Primak
2022-04-22backend/wayland/pointer: fix indentationKirill Primak
2022-04-22seat: Don't finish wlr_keyboard if server was never startedAlexander Orzechowski
2022-03-17types/wlr_touch: uniformize events nameSimon Zeni
2022-03-17types/wlr_tablet_tool: uniformize events nameSimon Zeni
2022-03-17types/wlr_tablet_pad: uniformize events nameSimon Zeni
2022-03-17types/wlr_switch: uniformize events nameSimon Zeni
2022-03-17types/wlr_keyboard: uniformize events nameSimon Zeni
2022-03-17types/wlr_pointer: uniformize events nameSimon Zeni
2022-03-17types/wlr_input_device: move width_mm and height_mm fields to wlr_tablet and ↵Simon Zeni
wlr_touch
2022-03-17types/wlr_input_device: move output_name field to wlr_pointer and wlr_touchSimon Zeni
2022-03-17backend/wayland: remove wl_seat_listener from public APISimon Zeni
2022-03-17backend/wayland: remove wlr_wl_input_deviceSimon Zeni
2022-03-17backend/wayland/tablet_v2: give wlr_tablet_* ownership to wlr_wl_seatSimon Zeni
2022-03-17backend/wayland: give wlr_touch ownership to wlr_wl_seatSimon Zeni
2022-03-17backend/wayland: drop wlr_switch supportSimon Zeni
2022-03-17backend/wayland: give wlr_pointer ownership to wlr_wl_seatSimon Zeni
All the code logic related to the pointer has been moved to its own file. The seat is responsible for the lifetime of its wlr_wl_pointer(s), and assigning them to the relevant wlr_wl_output. The wlr_wl_pointer becomes a simple helper to manager the wlr_pointer associated to the seat's wl_pointer and its lifetime.
2022-03-17backend/wayland: give wlr_keyboard ownership to wlr_wl_seatSimon Zeni
2022-03-13Pass O_CLOEXEC to drmModeCreateLease callsSamuel Čavoj
The lease_fd is currently being leaked to child processes Link: https://github.com/swaywm/sway/issues/4286#issuecomment-1065987957
2022-03-11types/wlr_tablet_tool: remove name ambiguityDavid96
It wasn't clear in the backend whether to use name or base.name, change it so base.name has to be used. Fixes https://github.com/swaywm/sway/issues/6884
2022-03-07types/wlr_input_device: move init and finish function to private APISimon Zeni
2022-03-07types/wlr_input_device: remove wlr_input_device_destroySimon Zeni
2022-03-07interface/wlr_touch: rework destroy sequenceSimon Zeni
The destroy callback in wlr_touch_impl has been removed. The function `wlr_touch_finish` has been introduced to clean up the resources owned by a wlr_touch. `wlr_input_device_destroy` no longer destroys the wlr_touch, attempting to destroy a wlr_touch will result in a no-op. The field `name` has been added to the wlr_touch_impl to be able to identify a given wlr_touch device.
2022-03-07interface/wlr_tablet_tool: rework destroy sequenceSimon Zeni
The destroy callback in wlr_tablet_tool_impl has been removed. The function `wlr_tablet_tool_finish` has been introduced to clean up the resources owned by a wlr_tablet_tool. `wlr_input_device_destroy` no longer destroys the wlr_tablet_tool, attempting to destroy a wlr_tablet_tool will result in a no-op. The field `name` has been added to the wlr_tablet_tool_impl to be able to identify a given wlr_tablet_tool device.