log: add debugging logs for dump 08/120608/1
authorBoram Park <boram1288.park@samsung.com>
Thu, 23 Mar 2017 09:18:50 +0000 (18:18 +0900)
committerBoram Park <boram1288.park@samsung.com>
Thu, 23 Mar 2017 09:18:50 +0000 (18:18 +0900)
Change-Id: If8d84e12c2ece5cd46379d97c42f45ffaa80cc36

src/tdm_helper.c

index 4873d12..6b4178e 100644 (file)
@@ -245,6 +245,7 @@ tdm_helper_dump_buffer(tbm_surface_h buffer, const char *file)
        tbm_surface_info_s info;
        int len, ret;
        const char *ext;
+       int bo_cnt;
 
        TDM_RETURN_IF_FAIL(buffer != NULL);
        TDM_RETURN_IF_FAIL(file != NULL);
@@ -264,6 +265,13 @@ tdm_helper_dump_buffer(tbm_surface_h buffer, const char *file)
                return;
        }
 
+       bo_cnt = tbm_surface_internal_get_num_bos(buffer);
+       TDM_DBG("buffer: bo_cnt(%d) %dx%d %c%c%c%c, plane: (%p+%d, %d,%d) (%p+%d, %d,%d) (%p+%d, %d,%d)",
+                       bo_cnt, info.width, info.height, FOURCC_STR(info.format),
+                       info.planes[0].ptr, info.planes[0].offset, info.planes[0].stride, info.planes[0].size,
+                       info.planes[1].ptr, info.planes[1].offset, info.planes[1].stride, info.planes[1].size,
+                       info.planes[2].ptr, info.planes[2].offset, info.planes[2].stride, info.planes[2].size);
+
        switch (info.format) {
        case TBM_FORMAT_ARGB8888:
        case TBM_FORMAT_XRGB8888:
@@ -282,6 +290,10 @@ tdm_helper_dump_buffer(tbm_surface_h buffer, const char *file)
                break;
        case TBM_FORMAT_NV12:
        case TBM_FORMAT_NV21:
+               if (bo_cnt == 1 &&
+                       (info.planes[0].ptr + info.planes[0].stride * info.height) != info.planes[1].ptr)
+                       TDM_WRN("%p != %p", info.planes[0].ptr + info.planes[0].stride * info.height, info.planes[1].ptr);
+
                _tdm_helper_dump_raw(file,
                                                         info.planes[0].ptr,
                                                         info.planes[0].stride * info.height,