code clean-up (macro, structure) 87/80987/1
authorBoram Park <boram1288.park@samsung.com>
Wed, 20 Jul 2016 04:41:33 +0000 (13:41 +0900)
committerBoram Park <boram1288.park@samsung.com>
Thu, 21 Jul 2016 07:55:15 +0000 (16:55 +0900)
Change-Id: I88124bbca87fe5206c6da5e2faa2adfaa949fb44

src/tdm_capture.c
src/tdm_macro.h
src/tdm_pp.c
src/tdm_private.h

index f5bcfc2..2737805 100644 (file)
@@ -352,6 +352,8 @@ tdm_capture_set_info(tdm_capture *capture, tdm_info_capture *info)
        ret = func_capture->capture_set_info(private_capture->capture_backend, info);
        TDM_WARNING_IF_FAIL(ret == TDM_ERROR_NONE);
 
+       private_capture->info = *info;
+
        _pthread_mutex_unlock(&private_display->lock);
 
        return ret;
index d56267d..fe762c2 100644 (file)
@@ -128,6 +128,12 @@ extern "C" {
                return; \
        } \
 }
+#define TDM_DBG_GOTO_IF_FAIL(cond, dst) { \
+       if (!(cond))  { \
+               TDM_SNPRINTF(reply, len, "[%s %d] '%s' failed\n", __func__, __LINE__, #cond); \
+               goto dst; \
+       } \
+}
 
 #define C(b, m)             (((b) >> (m)) & 0xFF)
 #define B(c, s)             ((((unsigned int)(c)) & 0xff) << (s))
index a43d257..e9d5183 100644 (file)
 #include "tdm_private.h"
 #include "tdm_helper.h"
 
-typedef struct _tdm_pp_private_buffer {
-       tbm_surface_h src;
-       tbm_surface_h dst;
-       struct list_head link;
-       struct list_head commit_link;
-} tdm_pp_private_buffer;
-
 #define PP_FUNC_ENTRY() \
        tdm_func_pp *func_pp; \
        tdm_private_display *private_display; \
@@ -336,6 +329,8 @@ tdm_pp_set_info(tdm_pp *pp, tdm_info_pp *info)
        ret = func_pp->pp_set_info(private_pp->pp_backend, info);
        TDM_WARNING_IF_FAIL(ret == TDM_ERROR_NONE);
 
+       private_pp->info = *info;
+
        _pthread_mutex_unlock(&private_display->lock);
 
        return ret;
index a2740a0..f66bed3 100644 (file)
@@ -223,6 +223,7 @@ struct _tdm_private_pp {
        struct list_head pending_buffer_list;
        struct list_head buffer_list;
 
+       tdm_info_pp info;
        pid_t owner_tid;
 };
 
@@ -243,6 +244,7 @@ struct _tdm_private_capture {
        struct list_head pending_buffer_list;
        struct list_head buffer_list;
 
+       tdm_info_capture info;
        pid_t owner_tid;
 };
 
@@ -321,6 +323,13 @@ typedef struct _tdm_buffer_info {
        struct list_head link;
 } tdm_buffer_info;
 
+typedef struct _tdm_pp_private_buffer {
+       tbm_surface_h src;
+       tbm_surface_h dst;
+       struct list_head link;
+       struct list_head commit_link;
+} tdm_pp_private_buffer;
+
 int
 tdm_display_check_module_abi(tdm_private_display *private_display, int abimaj, int abimin);