buffer: enhance debugging logs 49/173149/1
authorBoram Park <boram1288.park@samsung.com>
Tue, 20 Mar 2018 01:10:22 +0000 (10:10 +0900)
committerBoram Park <boram1288.park@samsung.com>
Tue, 20 Mar 2018 01:33:00 +0000 (10:33 +0900)
Change-Id: If1fda435f672768ab0a46a1c4e0f18dcc991fad8

src/tdm_buffer.c

index e437a58d33768291f3fb954f3d2e3cf6295b452c..72d9d1782c552162bd949a55b076d624cc3871e4 100644 (file)
@@ -203,6 +203,9 @@ tdm_buffer_ref_backend(tbm_surface_h buffer)
        buf_info->backend_ref_count++;
        tbm_surface_internal_ref(buffer);
 
+       if (tdm_debug_module & TDM_DEBUG_BUFFER)
+               TDM_INFO("buffer(%p) backend_ref_count(%d)", buffer, buf_info->backend_ref_count);
+
        return buffer;
 }
 
@@ -218,13 +221,17 @@ tdm_buffer_unref_backend(tbm_surface_h buffer)
        TDM_RETURN_IF_FAIL(buf_info != NULL);
 
        buf_info->backend_ref_count--;
+
+       if (tdm_debug_module & TDM_DEBUG_BUFFER)
+               TDM_INFO("buffer(%p) backend_ref_count(%d)", buffer, buf_info->backend_ref_count);
+
        if (buf_info->backend_ref_count > 0) {
                tbm_surface_internal_unref(buffer);
                return;
        }
 
-//     if (!tdm_thread_in_display_thread(syscall(SYS_gettid)))
-//             TDM_NEVER_GET_HERE();
+       if (tdm_debug_module & TDM_DEBUG_BUFFER)
+               TDM_INFO("buffer(%p) released", buffer);
 
        tbm_surface_internal_ref(buffer);
        LIST_FOR_EACH_ENTRY_SAFE(func_info, next, &buf_info->release_funcs, link)