mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
kmssink: Don't leak GEM primed from DMABuf
This otherwise breaks DMABuf reclaiming. This is not visible from userspace, but inside the kernel, the DRM driver will hold a ref to the DMABuf object. With a V4L2 driver allocating those DMABuf, it then prevent changing the resolution and re-allocation new buffers. https://bugzilla.gnome.org/show_bug.cgi?id=782774
This commit is contained in:
parent
6e3fe4eaab
commit
cfadd5a936
1 changed files with 12 additions and 0 deletions
|
@ -483,6 +483,18 @@ gst_kms_allocator_dmabuf_import (GstAllocator * allocator, gint * prime_fds,
|
|||
if (!gst_kms_allocator_add_fb (alloc, tmp, offsets, vinfo))
|
||||
goto failed;
|
||||
|
||||
for (i = 0; i < n_planes; i++) {
|
||||
struct drm_gem_close arg = { tmp->gem_handle[i], };
|
||||
gint err;
|
||||
|
||||
err = drmIoctl (alloc->priv->fd, DRM_IOCTL_GEM_CLOSE, &arg);
|
||||
if (err)
|
||||
GST_WARNING_OBJECT (allocator,
|
||||
"Failed to close GEM handle: %s %d", strerror (errno), errno);
|
||||
|
||||
tmp->gem_handle[i] = 0;
|
||||
}
|
||||
|
||||
return tmp;
|
||||
|
||||
/* ERRORS */
|
||||
|
|
Loading…
Reference in a new issue