Change-Id: I03ad3946b46bde047a7e63efaab1350d282dbe8d
Signed-off-by: Changyeon Lee <cyeon.lee@samsung.com>
+unsigned int
+tbm_bufmgr_get_capability (tbm_bufmgr bufmgr)
+{
+ TBM_RETURN_IF_FAIL (TBM_BUFMGR_IS_VALID(bufmgr));
+
+ unsigned int capability = TBM_BUFMGR_CAPABILITY_NONE;
+
+ if (bufmgr->backend->bo_import && bufmgr->backend->bo_export)
+ capability |= TBM_BUFMGR_CAPABILITY_SHARE_KEY;
+
+ if (bufmgr->backend->bo_import_fd && bufmgr->backend->bo_export_fd)
+ capability |= TBM_BUFMGR_CAPABILITY_SHARE_FD;
+
+ return capability;
+}
+
TBM_BO_ERROR_DUP_FD_FAILED = TBM_ERROR_BASE|0x0116, /**< failed to duplicate fd */
} tbm_error_e;
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 */
+};
#ifdef __cplusplus
extern "C" {
#ifdef __cplusplus
extern "C" {
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @remarks You must release the fd using close().
* @param[in] bufmgr : the buffer manager
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @remarks You must release the fd using close().
* @param[in] bufmgr : the buffer manager
- * @parak[in] fd : the fd associated with the buffer object
+ * @param[in] fd : the fd associated with the buffer object
* @return a buffer object
* @retval #tbm_bo
* @see tbm_bo_export_fd()
* @return a buffer object
* @retval #tbm_bo
* @see tbm_bo_export_fd()
*/
tbm_error_e tbm_get_last_error (void);
*/
tbm_error_e tbm_get_last_error (void);
+/**
+ * @brief Gets the tbm buffer capability.
+ * @since_tizen 2.4
+ * @param[in] bufmgr : the buffer manager
+ * @return the tbm bufmgr capability
+ * @par Example
+ @code
+ #include <tbm_bufmgr.h>
+
+ int bufmgr_fd;
+ tbm_bufmgr bufmgr;
+ unsigned int capability;
+
+ bufmgr = tbm_bufmgr_init (bufmgr_fd);
+
+ capability = tbm_bufmgr_get_capability (bufmgr);
+
+ tbm_bufmgr_deinit (bufmgr);
+ @endcode
+ */
+unsigned int tbm_bufmgr_get_capability (tbm_bufmgr bufmgr);
+
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
}
#endif
/**
* @brief import the buffer object associated with the key.
/**
* @brief import the buffer object associated with the key.
+ * @remarks If the backend doesn't support a buffer sharing by tbm key,
+ fucntion pointer must be set to NULL.
* @param[in] bo : the buffer object
* @param[in] key : the key associated with the buffer object
* @return pointer of the bo private.
* @param[in] bo : the buffer object
* @param[in] key : the key associated with the buffer object
* @return pointer of the bo private.
/**
* @brief export the buffer object
/**
* @brief export the buffer object
+ * @remarks If the backend doesn't support a buffer sharing by tbm key,
+ fucntion pointer must be set to NULL.
* @param[in] bo : the buffer object
* @return key associated with the buffer object
*/
* @param[in] bo : the buffer object
* @return key associated with the buffer object
*/
/**
* @brief import the buffer object associated with the prime fd.
* @remarks tbm_fd must be free by user.
/**
* @brief import the buffer object associated with the prime fd.
* @remarks tbm_fd must be free by user.
+ * @remarks If the backend doesn't support a buffer sharing by tbm fd,
+ fucntion pointer must be set to NULL.
* @param[in] bo : the buffer object
* @param[in] fd : the prime fd associated with the buffer object
* @return pointer of the bo private.
* @param[in] bo : the buffer object
* @param[in] fd : the prime fd associated with the buffer object
* @return pointer of the bo private.
/**
* @brief export the buffer object
* @remarks tbm_fd must be free by user.
/**
* @brief export the buffer object
* @remarks tbm_fd must be free by user.
+ * @remarks If the backend doesn't support a buffer sharing by tbm fd,
+ fucntion pointer must be set to NULL.
* @param[in] bo : the buffer object
* @return tbm_fd associated with the buffer object
*/
* @param[in] bo : the buffer object
* @return tbm_fd associated with the buffer object
*/