Commit Graph

1507 Commits

Author SHA1 Message Date
Simon Ser b3da33116e backend/drm: log refresh rate in Hz 2022-11-14 17:39:39 +00:00
Simon Ser feb5691240 backend: remove const casts for pixman_region32_t
Pixman 0.42.0 has constified APIs for pixman_region32_t. We no longer
need the casts.
2022-11-11 23:11:17 +00:00
Simon Ser 1928d1ce9f build: move udev dep to backend/
The DRM, libinput and session use udev. They are all hosted under
backend/.
2022-11-11 23:11:17 +00:00
Simon Ser 1c4a625fe3 backend/drm: ensure disconnected outputs are disabled after VT switch
The following situation can be dangerous:

- Output DP-1 is plugged in, compositor enables it.
- User VT switches away.
- User unplugs DP-1.
- User VT switches back.
- scan_drm_connectors() figures out the output is now disconnected,
  uninitializes the struct wlr_output.
- The loop restoring previous output state in handle_session_active()
  accesses the struct wlr_output to figure out what to restore.

By chance, we zero out the struct wlr_output after uninitializing it,
so enabled and current_mode will always be zero. But let's make sure
we handle this case explicitly, to remind future readers that it exists
and make the code less fragile.
2022-11-11 22:44:53 +00:00
Simon Ser 84e727daae backend/drm: request page-flip event on modeset
The old drm_connector_set_mode() function did that by calling
drm_crtc_page_flip(). We lost this in the refactoring.

Fixes: f216e97983 ("backend/drm: drop drm_connector_set_mode()")
2022-11-11 14:46:51 +00:00
illiliti eec95e3d5e backend/drm: use pnp.ids to fetch EDID data 2022-11-09 00:25:18 +03:00
Simon Ser d75b4d8e86 Revert "backend/drm: fetch EDID manufacturer from udev_hwdb"
This reverts commit e646d882cf.

This commit has added a dependency on udev_hwdb. This API isn't
available on all platforms (e.g. FreeBSD), and further deepens
our udev dependency. A better solution is being worked on in [1].

[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3638
2022-11-08 19:08:43 +01:00
Simon Ser fc3d8b228b backend/drm: get possible CRTCs in create_drm_connector()
This stuff is immutable for a given connector.
2022-11-02 14:48:30 +00:00
Simon Ser 92580a2f67 backend/drm: extract create_drm_connector()
Move a bit more logic out of the big loop in scan_drm_connectors().
2022-11-02 14:48:30 +00:00
Simon Ser c6d8a11d2c backend/drm: fetch current CRTC once on startup
Once we are DRM master, the CRTC cannot be changed behind our back
except during a VT switch.

After a VT switch, we try to restore whatever KMS state we had last
programmed. Reloading the current CRTC from KMS breaks this and
can result in a modeset without a FB.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3432
2022-10-19 00:23:18 +00:00
Simon Ser b475190327 backend/drm: log failures in drm_surface_blit()
Can make issues like [1] easier to debug.

[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3451
2022-10-18 16:39:22 +02:00
Simon Ser a2063c93ea backend/drm: drop drm_crtc_page_flip()
Inline it in drm_connector_commit_state(). Brings us a step closer
to unifying the test code-path and the commit code-path.
2022-10-17 17:39:41 +02:00
Simon Ser 0c962c98cc backend/drm: log when restoring mode after VT switch fails
Can make it easier to track down issues.
2022-10-17 15:14:02 +00:00
Simon Ser 98a83ce14c backend/drm: fix EINVAL atomic commits after VT switch
The drm_connector_commit_state() call in handle_session_active()
was not resulting in any atomic commit, because it didn't match any
of the if branches: active = true, no new buffer was committed,
and adaptive sync/gamma LUT were unchanged. Thus the commit was a
no-op.

Later on, when the compositor performs regular page-flips, the
kernel would return EINVAL indicating that a modeset was needed.

Rework the logic to use a non-blocking page-flip commit if a buffer
was committed, and use a blocking commit if the connector is on or
is being disabled. The only case where we should skip the atomic
commit is when disabling (active = false) an already-disabled
connector (conn->crtc == NULL).

Note, 6936e163b5 ("backend/drm: short-circuit no-op commits")
has introduced early returns for other situations where we don't
need to perform an atomic commit (e.g. updating scale or transform
of an output).

Fixes: f216e97983 ("backend/drm: drop drm_connector_set_mode()")
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3432
2022-10-17 15:14:02 +00:00
Simon Ser ca432ea539 backend/drm: extract current mode logic into separate function
Extract the logic to fetch the current mode to a separate function
to make it more readable. Stop dying in an assert when
get_drm_prop_blob() fails. Always make it so the drmModeModeInfo
pointer is allocated so that we can free() it unconditionally.
2022-10-17 11:36:58 +02:00
Simon Ser eeb7a81138 backend/drm: extract connect_drm_connector() logic
We already have disconnect_drm_connector() to handle the
CONNECTED → DISCONNECTED transition. Let's add
connect_drm_connector() to handle DISCONNECTED → CONNECTED. This
makes scan_drm_connectors() shorter and easier to follow.

No functional change, literally just moving code around.
2022-10-15 12:20:55 +02:00
Simon Ser 9560a7eefd backend/drm: use atomic API to fetch current connector's CRTC
We were using the legacy API (with a detour through drmModeEncoder)
to find out the current CRTC for a connector. Use the atomic API
when available.

Also extract the whole logic into a separate function for better
readability, and better handle errors.
2022-10-14 15:13:14 +00:00
Simon Ser 0c0cea0258 backend/drm: use wl_container_of() instead of casts for wlr_drm_mode
Instead of casting a wlr_output_mode to wlr_drm_mode, use
wl_container_of() for slightly better type safety.
2022-10-13 16:11:39 +00:00
Alexander Orzechowski ada6f104e6 backend/drm/legacy: Fix whitespace
This confused me while reading through.
2022-10-13 10:51:11 -04:00
Simon Ser a28caf08e3 backend: use global output name counters
The output names must be globally unique per the Wayland spec, even
if the compositor creates multiple backends of the same kind.
2022-10-13 13:12:43 +02:00
Simon Ser f216e97983 backend/drm: drop drm_connector_set_mode()
Instead of special-casing modesets, we can just cut the wrapper
and directly call drm_crtc_page_flip(). drm_connector_test() should
already have the checks previously done in drm_connector_set_mode(),
all we need to do is update enabled/mode after a successful atomic
commit.
2022-10-10 07:48:25 +00:00
Simon Zeni 694e9bbb9d backend/drm: allocate connector CRTC on lease creation
This was leading to crash in compositors if the wanted connector had no CRTC
2022-10-07 15:54:51 -04:00
Simon Ser f4cf0a8d86 backend/drm: nuke wlr_drm_connector.desired_enabled
This field becomes stale too easily: for instance, see 6adca4089c
("backend/drm: don't unconditionally set desired_enabled").
Additionally, drm_connector_alloc_crtc() needs to do some weird
dance, restoring its previous value.

Instead, add a connector arg to realloc_crtcs() to indicate a new
connector we want to enable.
2022-10-07 16:28:36 +00:00
Simon Ser 5a207aea72 backend/drm: drop unnecessary wlr_drm_connector.crtc checks
drm_connector_alloc_crtc() already checks this.
2022-10-07 16:09:05 +00:00
Simon Ser 6832ae14aa render: drop wlr_renderer_read_pixels() flags
These are unused.
2022-10-04 09:15:19 +02:00
Simon Ser 0613fb0159 backend/drm: remove outdated TODO
This has been addressed in 8795dde94e ("Initialize connectors
current mode to the mode used by KMS on startup.").
2022-10-03 12:07:10 +02:00
Simon Ser 6adca4089c backend/drm: don't unconditionally set desired_enabled
We were unconditonally setting desired_enabled = true for all
connected connectors. This makes realloc_crtcs() always keep a CRTC
active for these, even if the user doesn't want to enable them.
2022-10-03 12:04:12 +02:00
Simon Ser 651c876e79 backend/drm: fix missing wlr_output_state.allow_artifacts
Without allow_artifacts, applying the new state will fail because
it requires ALLOW_MODESET.

Fixes VT switch and disabling CRTCs.
2022-09-30 13:35:07 +02:00
Simon Ser a0345f2854 output: add wlr_output_state.allow_artifacts
When starting up, the compositor might call wlr_output_set_mode()
with a mode which is already the current one. wlroots will detect
this and make the wlr_output_set_mode() call a no-op. During the
next wlr_output_commit() call, wlroots will perform an atomic
commit without the ALLOW_MODESET flag.

This is an issue, because some drivers need ALLOW_MODESET even if
the mode is the same. For instance, if the FB stride or modifier
changed, some drivers require a modeset.

Add a new flag "allow_artifacts" which is set when the compositor
calls mode-setting functions. Use this flag to figure out whether
we want to perform atomic commits with ALLOW_MODESET.

(The name "allow_artifacts" is picked because ALLOW_MODESET is a
misnomer, see [1].)

[1]: https://patchwork.freedesktop.org/patch/505107/

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3499
2022-09-30 10:58:17 +00:00
John Lindgren 2b767fe743 backend/libinput: Fix SIGSEGV found in low-memory fuzzing
Stack trace:

    #0  0x00007f17081f5b99 in wl_list_insert (list=list@entry=0x2d8, elm=elm@entry=0x7ffe7f7e85d0)
        at ../wayland-1.21.0/src/wayland-util.c:48
    #1  0x00007f17081f5f2e in wl_signal_emit_mutable (signal=signal@entry=0x2d8, data=data@entry=0x7ffe7f7e8660)
        at ../wayland-1.21.0/src/wayland-server.c:2167
    #2  0x00007f170815a971 in handle_switch_toggle (wlr_switch=0x2a0, event=0x55d5ba13dc00)
        at ../backend/libinput/switch.c:50
    #3  handle_libinput_event (event=0x55d5ba13dc00, backend=0x55d5b975d740) at ../backend/libinput/events.c:234
    #4  handle_libinput_readable (fd=<optimized out>, mask=<optimized out>, _backend=<optimized out>)
        at ../backend/libinput/backend.c:58
    #5  handle_libinput_readable (fd=fd@entry=34, mask=mask@entry=1, _backend=_backend@entry=0x55d5b975d740)
        at ../backend/libinput/backend.c:48
    #6  0x00007f170815c110 in backend_start (wlr_backend=0x55d5b975d740) at ../backend/libinput/backend.c:109
    #7  0x00007f1708160996 in multi_backend_start (wlr_backend=0x55d5b97583d0) at ../backend/multi/backend.c:32
2022-09-22 13:37:32 -04:00
Simon Ser 0cabc83046 backend/drm: pass through mode picture aspect ratio 2022-09-22 09:38:27 +02:00
Simon Ser 800ea7d52d backend/drm: de-duplicate wlr_drm_mode creation
Introduce a function to convert a drmModeModeInfo into a new
wlr_drm_mode.
2022-09-21 01:35:30 +00:00
vanfanel 4ffc97d134 Only set max_bpc when full modesetting is being done. 2022-09-16 14:15:58 +00:00
vanfanel 8795dde94e Initialize connectors current mode to the mode used by KMS on startup. 2022-09-16 14:15:58 +00:00
Simon Ser 4cc5bdc4d1 backend/wayland: drop output_set_custom_mode()
It's an unnecessary wrapper.
2022-09-08 14:18:40 +02:00
Isaac Freund 135e60ff82 backend/x11: report adaptive sync as enabled
All we can do to influence adaptive sync on the X11 backend is set the
_VARIABLE_REFRESH window property like mesa automatically does. We don't
have any control beyond that, so we set the state to enabled on creating
the output and never allow changing it (just like the Wayland backend).
2022-08-30 17:53:50 +00:00
Isaac Freund 2ec27d23e0 backend/wayland: report adaptive sync as enabled
Adaptive sync is effectively always enabled when using the Wayland
backend. This is not something we have control over, so we set the
state to enabled on creating the output and never allow changing it.
2022-08-30 17:53:50 +00:00
Simon Ser 8c70245d5f output: fail commits if adaptive sync cannot be enabled
Previously, adaptive sync was just a hint and wouldn't make any
atomic commit fail if the backend didn't support it. The main reason
is wlr_output_test wasn't supported at the time.

Now that we have a way for compositors to test whether a change can
work, let's remove the exception for adaptive sync and convert it to
a regular output state field.
2022-08-30 17:53:50 +00:00
Alexander Orzechowski 8bd7170fd9 Use env helpers 2022-08-22 10:18:52 -04:00
Alexander Orzechowski ef4baea0e2 Use wl_signal_emit_mutable 2022-08-18 07:16:16 -04:00
Simon Ser 8c3c6987db backend/wayland: fix touch device not added on startup
We were firing the new_input signal on backend initialization,
before the compositor had the chance to add a listener for it.

Mimick what's done for wl_keyboard: if the backend hasn't been
started, delay wl_touch initialization.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3473
2022-08-11 09:13:08 +02:00
Simon Ser f244094682 backend/drm: drop enum wlr_drm_connector_status
We can just use libdrm's drmModeConnection enum instead.
2022-08-10 14:19:58 +00:00
Simon Ser 08973d2430 backend/drm: drop WLR_DRM_CONN_NEEDS_MODESET
- Add wlr_output.enabled checks to CONNECTED checks
- Replace NEEDS_MODESET with CONNECTED
2022-08-10 14:19:58 +00:00
Simon Ser 7b5e890e61 backend/drm: use drmModeConnectorGetPossibleCrtcs
This function has been merged in libdrm.

References: 3ee004ef52
2022-07-25 17:28:33 +00:00
Simon Ser bd587a7f43 backend/drm: use drmModeGetConnectorTypeName
No need to manually maintain this table now.

The wlroots names and the libdrm (= kernel) names all match.

References: 50f8d51773
2022-07-25 17:28:33 +00:00
José Expósito 11f49b6b6a backend/wayland: handle high-res scroll events
Receive high-resolution scroll events from the parent compositor using
a Wayland listiner and emit the appropiate wlr_pointer signal.
2022-07-11 11:01:35 +02:00
José Expósito e00f042f80 backend/libinput: code style consistency
Reduce a level of identation in "handle_pointer_axis" to keep the
consistency with "handle_pointer_axis_value120".
2022-07-11 11:01:35 +02:00
José Expósito c6032d6b1c backend/libinput: handle high-res scroll events
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-11 11:01:35 +02:00
José Expósito 65c436407f pointer: transform low-res to high-res axis events
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-11 11:01:35 +02:00
José Expósito c84cc660f0 build: check if libinput supports high-res scroll
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-07-11 11:01:35 +02:00
Isaac Freund 91943a68a6 wlr_input_device: remove anon union field
This union is unnecessary since the recent input device refactor and can
now be replaced by wlr_*_from_input_device() functions.
2022-06-21 18:42:07 +00:00
Simon Ser 1d581656c7 backend/drm: set "max bpc" to the max
"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-19 16:55:36 +00:00
Simon Ser 1f1c0275be backend/drm: remove unused CRTC count check
drmIsKMS already checks for this.
2022-06-19 16:48:44 +00:00
Isaac Freund 5cca72958a
backend/drm: fix NULL pointer deference due to typo 2022-06-07 17:08:08 +02:00
Simon Ser 1f96f388e9 backend/drm: make serial optional
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-07 13:27:18 +00:00
Simon Ser 1b27d537d1 backend/drm: unconditionally set "content type" to graphics
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-07 13:21:21 +00:00
Isaac Freund 2b10ae62ad
backend/drm: fix check for no-op commits
Since 6936e163b, we short-circut no-op commits as an optimization.
However, the logic in the check was slightly off.
2022-06-02 20:18:16 +02:00
Simon Ser 6936e163b5 backend/drm: short-circuit no-op commits
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-02 11:46:31 +00:00
Simon Ser acc6d94db0 backend/drm: make commits without a buffer blocking
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-06-01 21:16:02 +02:00
Simon Ser 2563b79dc2 backend/drm: improve atomic commit flag logging
We weren't logging all of the flags, which made debugging more
difficult.
2022-05-31 09:31:16 +02:00
Simon Ser 25dd3cc0cd output: pass wlr_output_state to backend
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-30 11:34:57 +02:00
Simon Ser 4f5d6e4746 backend/x11: fix output model strdup call
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3434#note_1401193
Fixes: be86145322 ("output: turn make/model/serial into char *")
2022-05-27 13:21:50 +00:00
vaxerski d0d480b91a backend/drm: fix crash with null serial
backend/drm: use serial_str instead
2022-05-26 18:16:29 +02:00
Simon Ser be86145322 output: turn make/model/serial into char *
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-26 13:36:06 +00:00
Simon Ser 2e69eb1030 backend/drm: fix crash in init_drm_surface
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3434
2022-05-26 09:38:48 +02:00
Simon Ser f91f38b79a backend/drm: remove wlr_drm_surface.{width,height}
This information is stored in wlr_swapchain, no need to duplicate
it.
2022-05-25 15:55:41 +02:00
Simon Ser e59f4d4ffa backend/drm: allow non-linear modifiers for multi-GPU
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-24 20:45:55 +00:00
Simon Ser e646d882cf backend/drm: fetch EDID manufacturer from udev_hwdb
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-11 14:06:11 +00:00
Simon Ser 7b7562eb65 backend/headless: allow variable refresh rate
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-05-10 16:37:21 +00:00
Kirill Primak bc4350c976 backend/wayland: reset active pointer on destroy 2022-04-29 21:55:04 +03:00
Simon Ser a1e1e9aba8 Revert "backend/wayland: zero out finished input devices"
This reverts commit 03c88b07ba.

init functions now zero out the structs.
2022-04-28 10:09:50 +02:00
Simon Ser 6c350799b2 Zero-initialize structs in init functions
Ensures there is no field left to its previous undefined value after
calling an init function.
2022-04-28 10:09:50 +02:00
Kirill Primak 03c88b07ba backend/wayland: zero out finished input devices 2022-04-22 17:51:24 +00:00
Kirill Primak a43d105a50 backend/wayland/pointer: fix indentation 2022-04-22 17:51:24 +00:00
Alexander Orzechowski 2ce0305483 seat: Don't finish wlr_keyboard if server was never started 2022-04-22 01:49:58 +00:00
Simon Zeni aaf787ee56 types/wlr_touch: uniformize events name 2022-03-17 18:16:14 +00:00
Simon Zeni e732c5c895 types/wlr_tablet_tool: uniformize events name 2022-03-17 18:16:14 +00:00
Simon Zeni d1f543a9d8 types/wlr_tablet_pad: uniformize events name 2022-03-17 18:16:14 +00:00
Simon Zeni 13d7fa2f03 types/wlr_switch: uniformize events name 2022-03-17 18:16:14 +00:00
Simon Zeni 9a17200446 types/wlr_keyboard: uniformize events name 2022-03-17 18:16:14 +00:00
Simon Zeni bd6c000d14 types/wlr_pointer: uniformize events name 2022-03-17 18:16:14 +00:00
Simon Zeni 96ccc50c57 types/wlr_input_device: move width_mm and height_mm fields to wlr_tablet and wlr_touch 2022-03-17 13:44:19 -04:00
Simon Zeni a92e5f8d46 types/wlr_input_device: move output_name field to wlr_pointer and wlr_touch 2022-03-17 13:44:18 -04:00
Simon Zeni 2001441a37 backend/wayland: remove wl_seat_listener from public API 2022-03-17 17:16:47 +00:00
Simon Zeni b7e9ad7989 backend/wayland: remove wlr_wl_input_device 2022-03-17 17:16:47 +00:00
Simon Zeni 56f7c000b5 backend/wayland/tablet_v2: give wlr_tablet_* ownership to wlr_wl_seat 2022-03-17 17:16:47 +00:00
Simon Zeni d3fb44314c backend/wayland: give wlr_touch ownership to wlr_wl_seat 2022-03-17 17:16:47 +00:00
Simon Zeni e723dd928b backend/wayland: drop wlr_switch support 2022-03-17 17:16:47 +00:00
Simon Zeni be8527bd36 backend/wayland: give wlr_pointer ownership to wlr_wl_seat
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-17 17:16:47 +00:00
Simon Zeni f9b6aa3079 backend/wayland: give wlr_keyboard ownership to wlr_wl_seat 2022-03-17 17:16:47 +00:00
Samuel Čavoj 5c17452ae0
Pass O_CLOEXEC to drmModeCreateLease calls
The lease_fd is currently being leaked to child processes

Link: https://github.com/swaywm/sway/issues/4286#issuecomment-1065987957
2022-03-13 13:28:48 +01:00
David96 7a2c96dcbd types/wlr_tablet_tool: remove name ambiguity
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-11 11:49:41 +01:00
Simon Zeni cfed039c9a types/wlr_input_device: move init and finish function to private API 2022-03-07 16:37:41 +00:00
Simon Zeni 1bb2631c5c types/wlr_input_device: remove wlr_input_device_destroy 2022-03-07 16:37:41 +00:00
Simon Zeni 10cbb9fbe1 interface/wlr_touch: rework destroy sequence
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-07 16:37:41 +00:00
Simon Zeni 8d3cb94b41 interface/wlr_tablet_tool: rework destroy sequence
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.
2022-03-07 16:37:41 +00:00
Simon Zeni a5b032cb1e interface/wlr_tablet_pad: rework destroy sequence
The destroy callback in wlr_tablet_pad_impl has been removed. The function
`wlr_tablet_pad_finish` has been introduced to clean up the resources owned by a
wlr_tablet_pad.

`wlr_input_device_destroy` no longer destroys the wlr_tablet_pad, attempting to
destroy a wlr_tablet_pad will result in a no-op.

The field `name` has been added to the wlr_tablet_pad_impl to be able to identify
a given wlr_tablet_pad device.
2022-03-07 16:37:41 +00:00
Simon Zeni 0d2be496a8 interface/wlr_switch: rework destroy sequence
The destroy callback in wlr_switch_impl has been removed. The function
`wlr_switch_finish` has been introduced to clean up the resources owned by a
wlr_switch.

`wlr_input_device_destroy` no longer destroys the wlr_switch, attempting to
destroy a wlr_switch will result in a no-op.

The field `name` has been added to the wlr_switch_impl to be able to identify
a given wlr_switch device.
2022-03-07 16:37:41 +00:00
Simon Zeni 51cd3c0726 interface/wlr_pointer: rework destroy sequence
The destroy callback in wlr_pointer_impl has been removed. The function
`wlr_pointer_finish` has been introduced to clean up the resources owned by a
wlr_pointer.

`wlr_input_device_destroy` no longer destroys the wlr_pointer, attempting to
destroy a wlr_pointer will result in a no-op.

The field `name` has been added to the wlr_pointer_impl to be able to identify
a given wlr_pointer device.
2022-03-07 16:37:41 +00:00
Simon Zeni 7dc4a3ecd7 interface/wlr_keyboard: rework destroy sequence
The destroy member in wlr_keyboard_impl has been removed. The function
`wlr_keyboard_finish` has been introduce to clean up the resources owned by a
wlr_keyboard.

`wlr_input_device_destroy` no longer destroys the wlr_keyboard, attempting to
destroy a wlr_keyboard will result in a no-op.

The field `name` has been added to the wlr_keyboard_impl to be able to identify
a given wlr_keyboard device.
2022-03-07 16:37:41 +00:00