Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit 9a74e56

Browse files
committed
backend/drm: use drmCloseBufferHandle
This has been added in [1] and allows us to close buffer handles without manually calling drmIoctl. [1]: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/192
1 parent 323b849 commit 9a74e56

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

backend/drm/renderer.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,7 @@ static uint32_t get_bo_handle_for_fd(struct wlr_drm_backend *drm,
216216
if (!drm_bo_handle_table_ref(&drm->bo_handles, handle)) {
217217
// If that failed, the handle wasn't ref'ed in the table previously,
218218
// so safe to delete
219-
struct drm_gem_close args = { .handle = handle };
220-
drmIoctl(drm->fd, DRM_IOCTL_GEM_CLOSE, &args);
219+
drmCloseBufferHandle(drm->fd, handle);
221220
return 0;
222221
}
223222

@@ -234,9 +233,8 @@ static void close_bo_handle(struct wlr_drm_backend *drm, uint32_t handle) {
234233
return;
235234
}
236235

237-
struct drm_gem_close args = { .handle = handle };
238-
if (drmIoctl(drm->fd, DRM_IOCTL_GEM_CLOSE, &args) != 0) {
239-
wlr_log_errno(WLR_ERROR, "drmIoctl(GEM_CLOSE) failed");
236+
if (drmCloseBufferHandle(drm->fd, handle) != 0) {
237+
wlr_log_errno(WLR_ERROR, "drmCloseBufferHandle failed");
240238
}
241239
}
242240

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ wayland_client = dependency('wayland-client',
107107
default_options: wayland_project_options,
108108
)
109109

110-
drm = dependency('libdrm', version: '>=2.4.105')
110+
drm = dependency('libdrm', version: '>=2.4.108')
111111
gbm = dependency('gbm', version: '>=17.1.0')
112112
xkbcommon = dependency('xkbcommon')
113113
udev = dependency('libudev')

0 commit comments

Comments
 (0)