From 03847b65ca43acf9b70dd8b985575b5e84790342 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Fri, 5 Feb 2021 14:05:53 +0100 Subject: [PATCH] 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: --- sys/va/gstvaallocator.c | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/sys/va/gstvaallocator.c b/sys/va/gstvaallocator.c index c1d35be..4b56a4d 100644 --- a/sys/va/gstvaallocator.c +++ b/sys/va/gstvaallocator.c @@ -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); } -- 2.7.4