Failed to close buffer handle in the virtual machine (use vmwgfx)
How to fix virtual machine vmwgfx graphics card using dma-buf protocol check_import_dmabuf unuseable?
static bool check_import_dmabuf(struct wlr_linux_dmabuf_v1 *linux_dmabuf,
struct wlr_dmabuf_attributes *attribs) {
if (linux_dmabuf->main_device_fd < 0) {
return true;
}
// TODO: check number of planes
for (int i = 0; i < attribs->n_planes; i++) {
uint32_t handle = 0;
if (drmPrimeFDToHandle(linux_dmabuf->main_device_fd, attribs->fd[i], &handle) != 0) {
wlr_log_errno(WLR_DEBUG, "Failed to import DMA-BUF FD");
return false;
}
if (drmCloseBufferHandle(linux_dmabuf->main_device_fd, handle) != 0) {
wlr_log_errno(WLR_ERROR, "Failed to close buffer handle");
return false;
}
}
return true;
}
drmCloseBufferHandle failed in check_import_dmabuf with vwmgfx driver.
drmCloseBufferHandle failed Some explanations from https://invent.kde.org/plasma/kwin/-/merge_requests/4811/diffs
Edited by sunzhguy