wlroots-hyprland/backend
Simon Ser 0817c52a21 backend/drm: get rid of BO handle table
The BO handle table exists to avoid double-closing a BO handle,
which aren't reference-counted by the kernel. But if we can
guarantee that there is only ever a single ref for each BO handle,
then we don't need the BO handle table anymore.

This is possible if we create the handle right before the ADDFB2
IOCTL, and close the handle right after. The handles are very
short-lived and we don't need to track their lifetime.

Because of multi-planar FBs, we need to be a bit careful: some
FB planes might share the same handle. But with a small check, it's
easy to avoid double-closing the same handle (which wouldn't be a
big deal anyways).

There's one gotcha though: drmModeSetCursor2 takes a BO handle as
input. Saving the handles until drmModeSetCursor2 time would require
us to track BO handle lifetimes, so we wouldn't be able to get rid
of the BO handle table. As a workaround, use drmModeGetFB to turn the
FB ID back to a BO handle, call drmModeSetCursor2 and then immediately
close the BO handle. The overhead should be minimal since these IOCTLs
are pretty cheap.

Closes: https://github.com/swaywm/wlroots/issues/3164
2021-10-29 11:38:37 +02:00
..
drm backend/drm: get rid of BO handle table 2021-10-29 11:38:37 +02:00
headless output: add presented flag to presentation event 2021-10-15 09:38:58 +02:00
libinput backend/libinput: send hold gesture events 2021-09-27 15:30:31 +02:00
multi backend/multi: implement get_buffer_caps 2021-10-22 22:19:47 +02:00
noop backend/noop: drop attach_render/rollback_render 2021-07-29 09:48:33 -04:00
session backend/session: use DRM_PRIMARY_MINOR_NAME 2021-06-17 00:28:04 +02:00
wayland output: add presented flag to presentation event 2021-10-15 09:38:58 +02:00
x11 backend/x11: fix code style in get_touchpoint_from_x11_touch_id 2021-10-27 12:08:09 +02:00
backend.c backend.c: do not try to explicitly clean up the libinput backend 2021-10-27 14:54:01 +02:00
meson.build backend: make DRM and libinput backends optional 2021-07-22 09:56:38 -04:00