From: SooChan Lim Date: Thu, 15 Mar 2018 01:36:16 +0000 (+0900) Subject: rename tbm_type_into to tbm_type_common X-Git-Tag: submit/tizen/20180316.064953~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=103403baf7ecbe41f111758549bc79e9effd7a35;p=platform%2Fcore%2Fuifw%2Flibtbm.git rename tbm_type_into to tbm_type_common Change-Id: I8293dd35bbec9b36774564f0271d5c7a26201932 --- diff --git a/packaging/libtbm.spec b/packaging/libtbm.spec index 120b31a..79af5a4 100644 --- a/packaging/libtbm.spec +++ b/packaging/libtbm.spec @@ -110,7 +110,7 @@ rm -f %{_unitdir_user}/basic.target.wants/tbm-drm-auth-user.path %{_includedir}/tbm_surface_queue.h %{_includedir}/tbm_bufmgr_backend.h %{_includedir}/tbm_type.h -%{_includedir}/tbm_type_int.h +%{_includedir}/tbm_type_common.h %{_includedir}/tbm_drm_helper.h %{_includedir}/tbm_sync.h %{_includedir}/tbm_bo.h diff --git a/src/Makefile.am b/src/Makefile.am index 8e2307f..6ac8c6e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -48,7 +48,7 @@ libtbminclude_HEADERS = tbm_bufmgr.h \ tbm_surface.h \ tbm_bufmgr_backend.h \ tbm_type.h \ - tbm_type_int.h \ + tbm_type_common.h \ tbm_surface_internal.h \ tbm_surface_queue.h \ tbm_drm_helper.h \ diff --git a/src/tbm_bo.h b/src/tbm_bo.h index d4ef6ab..84fe9b7 100644 --- a/src/tbm_bo.h +++ b/src/tbm_bo.h @@ -33,7 +33,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define _TBM_BO_H_ #include -#include +#include /** * \file tbm_bo.h diff --git a/src/tbm_bufmgr.h b/src/tbm_bufmgr.h index 0926b31..f597211 100644 --- a/src/tbm_bufmgr.h +++ b/src/tbm_bufmgr.h @@ -33,7 +33,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define _TBM_BUFMGR_H_ #include -#include +#include #include /** diff --git a/src/tbm_type_common.h b/src/tbm_type_common.h new file mode 100644 index 0000000..8f68fa8 --- /dev/null +++ b/src/tbm_type_common.h @@ -0,0 +1,212 @@ +/************************************************************************** + +libtbm + +Copyright 2012-2018 Samsung Electronics co., Ltd. All Rights Reserved. + +Contact: SooChan Lim , Sangjin Lee +Inpyo Kang , Dongyeon Kim +Boram Park , Changyeon Lee + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sub license, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice (including the +next paragraph) shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +**************************************************************************/ + +#ifndef _TBM_TYPE_COMMON_H_ +#define _TBM_TYPE_COMMON_H_ + +#include + +/** + * \file tbm_type_common.h + * \brief Type definition used internally + */ + +/* tbm error base : this error base is same as TIZEN_ERROR_TBM in tizen_error.h */ +#ifndef TBM_ERROR_BASE +#define TBM_ERROR_BASE -0x02830000 +#endif + +/** + * @brief Definition for the tizen buffer manager + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + */ +typedef struct _tbm_bufmgr *tbm_bufmgr; + +/** + * @brief Definition for the tizen buffer object + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + */ +typedef struct _tbm_bo *tbm_bo; + +/** + * @brief Definition for the key associated with the buffer object + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + */ + +typedef uint32_t tbm_key; +/** + * @brief Definition for the file descripter of the system buffer manager + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + */ +typedef int32_t tbm_fd; + +/** + * @brief Definition for native display (wl_display in tizen) + * @since_tizen 5.0 + */ +typedef void tbm_native_display; + + +/* TBM_DEVICE_TYPE */ + +/** + * @brief Enumeration for tbm error type. + * @since_tizen 2.4 + */ +typedef enum { + TBM_ERROR_NONE = 0, /**< Successful */ + TBM_ERROR_OUT_OF_MEMORY = TBM_ERROR_BASE | 0x0001, /**< failed to allocate the memory */ + TBM_ERROR_INVALID_PARAMETER = TBM_ERROR_BASE | 0x0002, /**< failed to get the valid parameter */ + TBM_ERROR_OPERATION_FAILED = TBM_ERROR_BASE | 0x0003, /**< failed to operation */ + TBM_BO_ERROR_GET_FD_FAILED = TBM_ERROR_BASE | 0x0101, /**< failed to get fd in bo */ + TBM_BO_ERROR_HEAP_ALLOC_FAILED = TBM_ERROR_BASE | 0x0102, /**< failed to allocate the heap memory in bo */ + TBM_BO_ERROR_LOAD_MODULE_FAILED = TBM_ERROR_BASE | 0x0103,/**< failed to load module*/ + TBM_BO_ERROR_THREAD_INIT_FAILED = TBM_ERROR_BASE | 0x0104,/**< failed to initialize the pthread */ + TBM_BO_ERROR_BO_ALLOC_FAILED = TBM_ERROR_BASE | 0x0105, /**< failed to allocate tbm_bo */ + TBM_BO_ERROR_INIT_STATE_FAILED = TBM_ERROR_BASE | 0x0106, /**< failed to initialize the state of tbm_bo */ + TBM_BO_ERROR_IMPORT_FAILED = TBM_ERROR_BASE | 0x0107, /**< failed to import the handle of tbm_bo */ + TBM_BO_ERROR_IMPORT_FD_FAILED = TBM_ERROR_BASE | 0x0108, /**< failed to import fd of tbm_bo */ + TBM_BO_ERROR_EXPORT_FAILED = TBM_ERROR_BASE | 0x0109, /**< failed to export the handle of the tbm_bo */ + TBM_BO_ERROR_EXPORT_FD_FAILED = TBM_ERROR_BASE | 0x01010, /**< failed to export fd of tbm_bo */ + TBM_BO_ERROR_GET_HANDLE_FAILED = TBM_ERROR_BASE | 0x0111, /**< failed to get the tbm_bo_handle */ + TBM_BO_ERROR_LOCK_FAILED = TBM_ERROR_BASE | 0x0112, /**< failed to lock the tbm_bo */ + TBM_BO_ERROR_MAP_FAILED = TBM_ERROR_BASE | 0x0113, /**< failed to map the tbm_bo to get the tbm_bo_handle */ + TBM_BO_ERROR_UNMAP_FAILED = TBM_ERROR_BASE | 0x0114, /**< failed to unmap the tbm_bo */ + TBM_BO_ERROR_SWAP_FAILED = TBM_ERROR_BASE | 0x0115, /**< failed to swap the tbm_bos */ + TBM_BO_ERROR_DUP_FD_FAILED = TBM_ERROR_BASE | 0x0116, /**< failed to duplicate fd */ +} tbm_error_e; + +/** + * @brief Enumeration of tbm buffer manager capability. + * @since_tizen 2.4 + */ +enum TBM_BUFMGR_CAPABILITY { + TBM_BUFMGR_CAPABILITY_NONE = 0, /**< Not Support capability*/ + TBM_BUFMGR_CAPABILITY_SHARE_KEY = (1 << 0), /**< Support sharing buffer by tbm key */ + TBM_BUFMGR_CAPABILITY_SHARE_FD = (1 << 1), /**< Support sharing buffer by tbm fd */ + TBM_BUFMGR_CAPABILITY_TBM_SYNC = (1 << 2), /**< Support tbm sync */ +}; + +/** + * @brief Definition for the device type to access tbm_bo + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + */ +typedef enum { + TBM_DEVICE_DEFAULT = 0, /**< the device type to get the default handle */ + TBM_DEVICE_CPU, /**< the device type to get the virtual memory */ + TBM_DEVICE_2D, /**< the device type to get the 2D memory handle */ + TBM_DEVICE_3D, /**< the device type to get the 3D memory handle */ + TBM_DEVICE_MM, /**< the device type to get the the multimedia handle */ + +} tbm_bo_device_type; + +/** + * @brief Definition for the optoin to access tbm_bo + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + */ +typedef enum { + TBM_OPTION_NONE = (1 << 0), /**< the option is none */ + TBM_OPTION_READ = (1 << 0), /**< the option to access to read the bo */ + TBM_OPTION_WRITE = (1 << 1), /**< the option to access to write the bo */ + TBM_OPTION_VENDOR = (0xffff0000), /**< the the vendor specific option that depends on the backend */ +} tbm_bo_access_option; + +/** + * @brief tbm_bo_handle abstraction of the memory handle by TBM_DEVICE_TYPE + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + */ +typedef union _tbm_bo_handle { + void *ptr; + int32_t s32; + uint32_t u32; + int64_t s64; + uint64_t u64; +} tbm_bo_handle; + +/** + * @brief Enumeration of bo memory type + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + */ +enum TBM_BO_FLAGS { + TBM_BO_DEFAULT = 0, /**< default memory: it depends on the backend */ + TBM_BO_SCANOUT = (1 << 0), /**< scanout memory */ + TBM_BO_NONCACHABLE = (1 << 1), /**< non-cachable memory */ + TBM_BO_WC = (1 << 2), /**< write-combine memory */ + TBM_BO_VENDOR = (0xffff0000), /**< vendor specific memory: it depends on the backend */ +}; + +/** + * @brief Called when the user data is deleted in buffer object. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @param[in] user_data User_data to be passed to callback function + * @pre The callback must be registered using tbm_bo_add_user_data().\n + * tbm_bo_delete_user_data() must be called to invoke this callback. + * @see tbm_bo_add_user_data() + * @see tbm_bo_delete_user_data() + */ +typedef void (*tbm_data_free) (void *user_data); + +/** + * @brief Enumeration of tbm buffer manager capability. + * @since_tizen 5.0 + */ +typedef enum TBM_BUFMGR_CAPABILITY tbm_bufmgr_capability; + +/** + * @brief Enumeration of tbm bo memory type. + * @since_tizen 5.0 + */ +typedef enum TBM_BO_FLAGS tbm_bo_memory_type; + +/** + * @brief Enumeration of buffer manager lock try for bo + * @since_tizen 5.0 + */ +typedef enum { + TBM_BUFMGR_BO_LOCK_TYPE_NEVER = 0, /**< the bufmgr do not try to lock the bos when the tbm_bo_map is called. */ + TBM_BUFMGR_BO_LOCK_TYPE_ONCE, /**< the bufmgr tries to lock the bos only once when the tbm_bo_map is called. */ + TBM_BUFMGR_BO_LOCK_TYPE_ALWAYS, /**< the bufmgr always tries to lock the bos when the tbm_bo_map is called. */ +} tbm_bufmgr_bo_lock_type; + +/** + * @brief Enumeration of the trace log for debug + * @since_tizen 5.0 + */ +typedef enum { + TBM_BUFGMR_DEBUG_TRACE_NONE = 0, + TBM_BUFGMR_DEBUG_TRACE_BO = (1 << 0), + TBM_BUFGMR_DEBUG_TRACE_SURFACE_INTERNAL = (1 << 1), + TBM_BUFGMR_DEBUG_TRACE_SURFACE = (1 << 2), + TBM_BUFGMR_DEBUG_TRACE_SURFACE_QUEUE = (1 << 3), +} tbm_bufmgr_debug_trace_mask; + +#endif /* _TBM_TYPE_COMMON_H_ */ diff --git a/src/tbm_type_int.h b/src/tbm_type_int.h deleted file mode 100644 index e9d2942..0000000 --- a/src/tbm_type_int.h +++ /dev/null @@ -1,212 +0,0 @@ -/************************************************************************** - -libtbm - -Copyright 2012-2018 Samsung Electronics co., Ltd. All Rights Reserved. - -Contact: SooChan Lim , Sangjin Lee -Inpyo Kang , Dongyeon Kim -Boram Park , Changyeon Lee - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sub license, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -#ifndef _TBM_TYPE_INT_H_ -#define _TBM_TYPE_INT_H_ - -#include - -/** - * \file tbm_type_int.h - * \brief Type definition used internally - */ - -/* tbm error base : this error base is same as TIZEN_ERROR_TBM in tizen_error.h */ -#ifndef TBM_ERROR_BASE -#define TBM_ERROR_BASE -0x02830000 -#endif - -/** - * @brief Definition for the tizen buffer manager - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - */ -typedef struct _tbm_bufmgr *tbm_bufmgr; - -/** - * @brief Definition for the tizen buffer object - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - */ -typedef struct _tbm_bo *tbm_bo; - -/** - * @brief Definition for the key associated with the buffer object - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - */ - -typedef uint32_t tbm_key; -/** - * @brief Definition for the file descripter of the system buffer manager - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - */ -typedef int32_t tbm_fd; - -/** - * @brief Definition for native display (wl_display in tizen) - * @since_tizen 5.0 - */ -typedef void tbm_native_display; - - -/* TBM_DEVICE_TYPE */ - -/** - * @brief Enumeration for tbm error type. - * @since_tizen 2.4 - */ -typedef enum { - TBM_ERROR_NONE = 0, /**< Successful */ - TBM_ERROR_OUT_OF_MEMORY = TBM_ERROR_BASE | 0x0001, /**< failed to allocate the memory */ - TBM_ERROR_INVALID_PARAMETER = TBM_ERROR_BASE | 0x0002, /**< failed to get the valid parameter */ - TBM_ERROR_OPERATION_FAILED = TBM_ERROR_BASE | 0x0003, /**< failed to operation */ - TBM_BO_ERROR_GET_FD_FAILED = TBM_ERROR_BASE | 0x0101, /**< failed to get fd in bo */ - TBM_BO_ERROR_HEAP_ALLOC_FAILED = TBM_ERROR_BASE | 0x0102, /**< failed to allocate the heap memory in bo */ - TBM_BO_ERROR_LOAD_MODULE_FAILED = TBM_ERROR_BASE | 0x0103,/**< failed to load module*/ - TBM_BO_ERROR_THREAD_INIT_FAILED = TBM_ERROR_BASE | 0x0104,/**< failed to initialize the pthread */ - TBM_BO_ERROR_BO_ALLOC_FAILED = TBM_ERROR_BASE | 0x0105, /**< failed to allocate tbm_bo */ - TBM_BO_ERROR_INIT_STATE_FAILED = TBM_ERROR_BASE | 0x0106, /**< failed to initialize the state of tbm_bo */ - TBM_BO_ERROR_IMPORT_FAILED = TBM_ERROR_BASE | 0x0107, /**< failed to import the handle of tbm_bo */ - TBM_BO_ERROR_IMPORT_FD_FAILED = TBM_ERROR_BASE | 0x0108, /**< failed to import fd of tbm_bo */ - TBM_BO_ERROR_EXPORT_FAILED = TBM_ERROR_BASE | 0x0109, /**< failed to export the handle of the tbm_bo */ - TBM_BO_ERROR_EXPORT_FD_FAILED = TBM_ERROR_BASE | 0x01010, /**< failed to export fd of tbm_bo */ - TBM_BO_ERROR_GET_HANDLE_FAILED = TBM_ERROR_BASE | 0x0111, /**< failed to get the tbm_bo_handle */ - TBM_BO_ERROR_LOCK_FAILED = TBM_ERROR_BASE | 0x0112, /**< failed to lock the tbm_bo */ - TBM_BO_ERROR_MAP_FAILED = TBM_ERROR_BASE | 0x0113, /**< failed to map the tbm_bo to get the tbm_bo_handle */ - TBM_BO_ERROR_UNMAP_FAILED = TBM_ERROR_BASE | 0x0114, /**< failed to unmap the tbm_bo */ - TBM_BO_ERROR_SWAP_FAILED = TBM_ERROR_BASE | 0x0115, /**< failed to swap the tbm_bos */ - TBM_BO_ERROR_DUP_FD_FAILED = TBM_ERROR_BASE | 0x0116, /**< failed to duplicate fd */ -} tbm_error_e; - -/** - * @brief Enumeration of tbm buffer manager capability. - * @since_tizen 2.4 - */ -enum TBM_BUFMGR_CAPABILITY { - TBM_BUFMGR_CAPABILITY_NONE = 0, /**< Not Support capability*/ - TBM_BUFMGR_CAPABILITY_SHARE_KEY = (1 << 0), /**< Support sharing buffer by tbm key */ - TBM_BUFMGR_CAPABILITY_SHARE_FD = (1 << 1), /**< Support sharing buffer by tbm fd */ - TBM_BUFMGR_CAPABILITY_TBM_SYNC = (1 << 2), /**< Support tbm sync */ -}; - -/** - * @brief Definition for the device type to access tbm_bo - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - */ -typedef enum { - TBM_DEVICE_DEFAULT = 0, /**< the device type to get the default handle */ - TBM_DEVICE_CPU, /**< the device type to get the virtual memory */ - TBM_DEVICE_2D, /**< the device type to get the 2D memory handle */ - TBM_DEVICE_3D, /**< the device type to get the 3D memory handle */ - TBM_DEVICE_MM, /**< the device type to get the the multimedia handle */ - -} tbm_bo_device_type; - -/** - * @brief Definition for the optoin to access tbm_bo - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - */ -typedef enum { - TBM_OPTION_NONE = (1 << 0), /**< the option is none */ - TBM_OPTION_READ = (1 << 0), /**< the option to access to read the bo */ - TBM_OPTION_WRITE = (1 << 1), /**< the option to access to write the bo */ - TBM_OPTION_VENDOR = (0xffff0000), /**< the the vendor specific option that depends on the backend */ -} tbm_bo_access_option; - -/** - * @brief tbm_bo_handle abstraction of the memory handle by TBM_DEVICE_TYPE - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - */ -typedef union _tbm_bo_handle { - void *ptr; - int32_t s32; - uint32_t u32; - int64_t s64; - uint64_t u64; -} tbm_bo_handle; - -/** - * @brief Enumeration of bo memory type - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - */ -enum TBM_BO_FLAGS { - TBM_BO_DEFAULT = 0, /**< default memory: it depends on the backend */ - TBM_BO_SCANOUT = (1 << 0), /**< scanout memory */ - TBM_BO_NONCACHABLE = (1 << 1), /**< non-cachable memory */ - TBM_BO_WC = (1 << 2), /**< write-combine memory */ - TBM_BO_VENDOR = (0xffff0000), /**< vendor specific memory: it depends on the backend */ -}; - -/** - * @brief Called when the user data is deleted in buffer object. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * @param[in] user_data User_data to be passed to callback function - * @pre The callback must be registered using tbm_bo_add_user_data().\n - * tbm_bo_delete_user_data() must be called to invoke this callback. - * @see tbm_bo_add_user_data() - * @see tbm_bo_delete_user_data() - */ -typedef void (*tbm_data_free) (void *user_data); - -/** - * @brief Enumeration of tbm buffer manager capability. - * @since_tizen 5.0 - */ -typedef enum TBM_BUFMGR_CAPABILITY tbm_bufmgr_capability; - -/** - * @brief Enumeration of tbm bo memory type. - * @since_tizen 5.0 - */ -typedef enum TBM_BO_FLAGS tbm_bo_memory_type; - -/** - * @brief Enumeration of buffer manager lock try for bo - * @since_tizen 5.0 - */ -typedef enum { - TBM_BUFMGR_BO_LOCK_TYPE_NEVER = 0, /**< the bufmgr do not try to lock the bos when the tbm_bo_map is called. */ - TBM_BUFMGR_BO_LOCK_TYPE_ONCE, /**< the bufmgr tries to lock the bos only once when the tbm_bo_map is called. */ - TBM_BUFMGR_BO_LOCK_TYPE_ALWAYS, /**< the bufmgr always tries to lock the bos when the tbm_bo_map is called. */ -} tbm_bufmgr_bo_lock_type; - -/** - * @brief Enumeration of the trace log for debug - * @since_tizen 5.0 - */ -typedef enum { - TBM_BUFGMR_DEBUG_TRACE_NONE = 0, - TBM_BUFGMR_DEBUG_TRACE_BO = (1 << 0), - TBM_BUFGMR_DEBUG_TRACE_SURFACE_INTERNAL = (1 << 1), - TBM_BUFGMR_DEBUG_TRACE_SURFACE = (1 << 2), - TBM_BUFGMR_DEBUG_TRACE_SURFACE_QUEUE = (1 << 3), -} tbm_bufmgr_debug_trace_mask; - -#endif /* _TBM_TYPE_INT_H_ */