va: allocator: log dmabuf and surface at pool push or pop

In order to keep track of the dmabuf fds and surfaces numbers log messages are
added at memory_release() (queue push) and prepare_buffer() (queue pop).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1999>
This commit is contained in:
Víctor Manuel Jáquez Leal 2021-02-05 14:05:53 +01:00
parent 64cca0f791
commit 03847b65ca

View file

@ -599,7 +599,8 @@ gst_va_dmabuf_memory_release (GstMiniObject * mini_object)
GstMemory *mem = GST_MEMORY_CAST (mini_object);
GstVaDmabufAllocator *self = GST_VA_DMABUF_ALLOCATOR (mem->allocator);
GST_LOG ("releasing %p", mem);
GST_LOG ("releasing %p: dmabuf %d, va surface %#x", mem,
gst_dmabuf_memory_get_fd (mem), gst_va_memory_get_surface (mem));
gst_va_memory_pool_push (&self->pool, mem);
/* Keep last in case we are holding on the last allocator ref */
@ -766,6 +767,9 @@ gst_va_dmabuf_allocator_prepare_buffer_unlocked (GstVaDmabufAllocator * self,
for (j = idx - 1; j >= 0; j--) {
gst_object_ref (mem[j]->allocator);
gst_buffer_append_memory (buffer, mem[j]);
GST_LOG ("bufer: %p: memory %p - dmabuf %d / surface %#x", buffer, mem[j],
gst_dmabuf_memory_get_fd (mem[j]), gst_va_memory_get_surface (mem[j]));
}
return surface;
@ -782,11 +786,6 @@ gst_va_dmabuf_allocator_prepare_buffer (GstAllocator * allocator,
surface = gst_va_dmabuf_allocator_prepare_buffer_unlocked (self, buffer);
GST_VA_MEMORY_POOL_UNLOCK (&self->pool);
if (surface != VA_INVALID_ID) {
GST_TRACE_OBJECT (self, "Prepared surface %#x in buffer %p", surface,
buffer);
}
return (surface != VA_INVALID_ID);
}
@ -805,11 +804,6 @@ gst_va_dmabuf_allocator_wait_for_memory (GstAllocator * allocator,
surface = gst_va_dmabuf_allocator_prepare_buffer_unlocked (self, buffer);
GST_VA_MEMORY_POOL_UNLOCK (&self->pool);
if (surface != VA_INVALID_ID) {
GST_TRACE_OBJECT (self, "Prepared surface %#x in buffer %p", surface,
buffer);
}
return (surface != VA_INVALID_ID);
}
@ -1333,7 +1327,8 @@ gst_va_memory_release (GstMiniObject * mini_object)
GstMemory *mem = GST_MEMORY_CAST (mini_object);
GstVaAllocator *self = GST_VA_ALLOCATOR (mem->allocator);
GST_LOG ("releasing %p", mem);
GST_LOG ("releasing %p: surface %#x", mem, gst_va_memory_get_surface (mem));
gst_va_memory_pool_push (&self->pool, mem);
/* Keep last in case we are holding on the last allocator ref */
@ -1408,6 +1403,8 @@ gst_va_allocator_prepare_buffer_unlocked (GstVaAllocator * self,
surface = gst_va_memory_get_surface (mem);
gst_buffer_append_memory (buffer, mem);
GST_LOG ("buffer %p: memory %p - surface %#x", buffer, mem, surface);
return surface;
}
@ -1421,11 +1418,6 @@ gst_va_allocator_prepare_buffer (GstAllocator * allocator, GstBuffer * buffer)
surface = gst_va_allocator_prepare_buffer_unlocked (self, buffer);
GST_VA_MEMORY_POOL_UNLOCK (&self->pool);
if (surface != VA_INVALID_ID) {
GST_TRACE_OBJECT (self, "Prepared surface %#x in buffer %p", surface,
buffer);
}
return (surface != VA_INVALID_ID);
}
@ -1443,11 +1435,6 @@ gst_va_allocator_wait_for_memory (GstAllocator * allocator, GstBuffer * buffer)
surface = gst_va_allocator_prepare_buffer_unlocked (self, buffer);
GST_VA_MEMORY_POOL_UNLOCK (&self->pool);
if (surface != VA_INVALID_ID) {
GST_TRACE_OBJECT (self, "Prepared surface %#x in buffer %p", surface,
buffer);
}
return (surface != VA_INVALID_ID);
}