Don't use unneeded backend function if backend package use libtbm 2.0 version
[platform/core/uifw/libtbm.git] / src / tbm_bufmgr_int.h
index 8c7ad56..8c41b22 100644 (file)
@@ -88,6 +88,15 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
                                                surf->item_link.next && \
                                                surf->item_link.next->prev == &surf->item_link)
 
+#define TBM_DEBUG(fmt, ...)   fprintf(stderr, "[TBM:DEBUG(%d)] " fmt, getpid(), ##__VA_ARGS__)
+#define TBM_LOG(fmt, ...)  fprintf(stderr, "[TBM(%d):%s] " fmt, getpid(), __func__, ##__VA_ARGS__)
+
+struct list_head {
+       struct list_head *prev;
+       struct list_head *next;
+};
+
+/* unneeded version 2.0 */
 #define TBM_ALL_CTRL_BACKEND_VALID(flags) \
                ((flags&TBM_CACHE_CTRL_BACKEND) &&\
                (flags&TBM_LOCK_CTRL_BACKEND))
@@ -96,16 +105,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define TBM_LOCK_CTRL_BACKEND_VALID(flags) \
                (flags&TBM_LOCK_CTRL_BACKEND)
 
-#define TBM_DEBUG(fmt, ...)   fprintf(stderr, "[TBM:DEBUG(%d)] " fmt, getpid(), ##__VA_ARGS__)
-#define TBM_LOG(fmt, ...)  fprintf(stderr, "[TBM(%d):%s] " fmt, getpid(), __func__, ##__VA_ARGS__)
-
 typedef union _tbm_bo_cache_state tbm_bo_cache_state;
 
-struct list_head {
-       struct list_head *prev;
-       struct list_head *next;
-};
-
 union _tbm_bo_cache_state {
        unsigned int val;
        struct {
@@ -115,6 +116,7 @@ union _tbm_bo_cache_state {
                unsigned int isDirtied:2;
        } data;
 };
+/* unneeded version 2.0 */
 
 /**
  * @brief tbm_bo : buffer object of Tizen Buffer Manager
@@ -126,23 +128,26 @@ struct _tbm_bo {
 
        int flags;                                      /* TBM_BO_FLAGS :bo memory type */
 
-       unsigned int tgl_key;           /*global key for tizen global lock */
-
-       /* for cache control */
-       unsigned int map_cnt;           /* device map count */
-       tbm_bo_cache_state cache_state; /*cache state */
-
-       int lock_cnt;                           /* lock count of bo */
-
        struct list_head user_data_list;        /* list of the user_date in bo */
 
        void *priv;                                     /* bo private */
 
        struct list_head item_link;     /* link of bo */
 
+       tbm_surface_h surface; /* tbm_surface */
+
+       int lock_cnt;                           /* lock count of bo */
+
+       unsigned int map_cnt;           /* device map count */
+
+       /* unneeded version 2.0 */
        tbm_bo_handle default_handle; /*default handle */
 
-       tbm_surface_h surface; /* tbm_surface */
+       unsigned int tgl_key;           /*global key for tizen global lock */
+
+       /* for cache control */
+       tbm_bo_cache_state cache_state; /*cache state */
+       /* unneeded version 2.0 */
 };
 
 /**
@@ -156,14 +161,8 @@ struct _tbm_bufmgr {
 
        int fd;                                         /* bufmgr fd */
 
-       int fd_flag;                            /* flag set 1 when bufmgr fd open in tbm_bufmgr_init */
-
-       int lock_fd;                            /* fd of tizen global lock */
-
        int lock_type;                          /* lock_type of bufmgr */
 
-       int use_map_cache;                      /* flag to use the map_cahce */
-
        struct list_head bo_list;       /* list of bos belonging to bufmgr */
 
        struct list_head surf_list;     /* list of surfaces belonging to bufmgr */
@@ -171,6 +170,16 @@ struct _tbm_bufmgr {
        void *module_data;
 
        tbm_bufmgr_backend backend;     /* bufmgr backend */
+
+       int use_2_0;
+
+       /* unneeded version 2.0 */
+       int lock_fd;                            /* fd of tizen global lock */
+
+       int fd_flag;                            /* flag set 1 when bufmgr fd open in tbm_bufmgr_init */
+
+       int use_map_cache;                      /* flag to use the map_cahce */
+       /* unneeded version 2.0 */
 };
 
 /**