aboutsummaryrefslogtreecommitdiff
path: root/backend/drm/meson.build
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-10-04 09:58:37 +0200
committerSimon Ser <contact@emersion.fr>2021-10-29 11:38:37 +0200
commit0817c52a2143eab1ffa4f5870b7c290688ceb1d1 (patch)
tree84b572e89313647e9c18ea075e49245efffca588 /backend/drm/meson.build
parent3b96aa04db0fee7231fba4fdeaed575478d88fcd (diff)
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
Diffstat (limited to 'backend/drm/meson.build')
-rw-r--r--backend/drm/meson.build1
1 files changed, 0 insertions, 1 deletions
diff --git a/backend/drm/meson.build b/backend/drm/meson.build
index 8f78b74e..b076b472 100644
--- a/backend/drm/meson.build
+++ b/backend/drm/meson.build
@@ -1,7 +1,6 @@
wlr_files += files(
'atomic.c',
'backend.c',
- 'bo_handle_table.c',
'cvt.c',
'drm.c',
'legacy.c',