Package version up to 2.7.1
[platform/core/uifw/libtdm.git] / src / tdm_helper.c
index 2e00648..e9db919 100644 (file)
@@ -9,7 +9,7 @@
  *          Taeheon Kim <th908.kim@samsung.com>,
  *          YoungJun Cho <yj44.cho@samsung.com>,
  *          SooChan Lim <sc1.lim@samsung.com>,
- *          Boram Park <sc1.lim@samsung.com>
+ *          Boram Park <boram1288.park@samsung.com>
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the
@@ -44,7 +44,7 @@
 
 #define PNG_DEPTH 8
 
-static const char *file_exts[2] = {"png", "yuv"};
+static const char *file_exts[2] = {"png", "raw"};
 
 int tdm_dump_enable;
 char *tdm_debug_dump_dir;
@@ -332,9 +332,14 @@ tdm_helper_dump_buffer(tbm_surface_h buffer, const char *file)
                                                         0);
                break;
        default:
-               TDM_ERR("can't dump %c%c%c%c buffer", FOURCC_STR(info.format));
-               tbm_surface_unmap(buffer);
-               return;
+               _tdm_helper_dump_raw((const char*)temp,
+                                                        info.planes[0].ptr,
+                                                        info.planes[0].size,
+                                                        info.planes[1].ptr,
+                                                        info.planes[1].size,
+                                                        info.planes[2].ptr,
+                                                        info.planes[2].size);
+               break;
        }
 
        tbm_surface_unmap(buffer);
@@ -841,6 +846,8 @@ _tdm_helper_get_backend_information(tdm_private_module *private_module, char *re
                        }
                }
        }
+       if (LIST_IS_EMPTY(&private_module->output_list))
+               TDM_SNPRINTF(reply, len, "(no output)\n");
        TDM_SNPRINTF(reply, len, "\n");
 
        /* layer information */
@@ -867,10 +874,7 @@ _tdm_helper_get_backend_information(tdm_private_module *private_module, char *re
                                format = tbm_surface_get_format(private_layer->showing_buffer->buffer);
                                tbm_surface_get_info(private_layer->showing_buffer->buffer, &buf_info);
 
-                               if (IS_RGB(format))
-                                       size.h = buf_info.planes[0].stride >> 2;
-                               else
-                                       size.h = buf_info.planes[0].stride;
+                               size.h = tbm_surface_get_width(private_layer->showing_buffer->buffer);
                                size.v = tbm_surface_get_height(private_layer->showing_buffer->buffer);
 
                                if (info.src_config.format)
@@ -943,6 +947,8 @@ _tdm_helper_get_backend_information(tdm_private_module *private_module, char *re
                        }
                }
        }
+       if (LIST_IS_EMPTY(&private_module->output_list))
+               TDM_SNPRINTF(reply, len, "(no layer)\n");
        TDM_SNPRINTF(reply, len, "\n");
 
        if (private_module->capabilities & TDM_DISPLAY_CAPABILITY_PP) {
@@ -1077,4 +1083,4 @@ tdm_helper_output_vblank_timer_expired(tdm_output *output)
        TDM_RETURN_VAL_IF_FAIL(private_output != NULL, -1);
 
        return private_output->vblank_timeout_timer_expired;
-}
\ No newline at end of file
+}