wlroots-hyprland/include
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
..
backend backend/drm: get rid of BO handle table 2021-10-29 11:38:37 +02:00
render render/vulkan: add Vulkan renderer 2021-10-18 11:51:13 +02:00
types output: split into multiple files 2021-10-23 00:49:24 +02:00
util util/shm: add allocate_shm_file_pair 2021-09-05 22:06:25 +02:00
wlr scene: add support for direct scan-out 2021-10-23 00:49:07 +02:00
xcursor xcursor: make cursor data and metadata const 2021-02-05 10:04:20 +01:00
xwayland build: simplify get_variable calls 2021-09-21 11:35:08 -06:00
meson.build render/vulkan: add Vulkan renderer 2021-10-18 11:51:13 +02:00