TBM_LOG ("[libtbm:%d] "
"error %s:%d fail to lock bo:%p)\n",
getpid(), __FUNCTION__, __LINE__, bo);
-
+#ifdef HAVE_CAPI_0_1_1
+ set_last_result (TBM_ERROR_BO_LOCK_FAILED);
+#endif
pthread_mutex_unlock (&bufmgr->lock);
return (tbm_bo_handle)NULL;
}
getpid(), __FUNCTION__, __LINE__, bo);
_tbm_bo_unlock(bo);
+#ifdef HAVE_CAPI_0_1_1
+ set_last_result (TBM_ERROR_BO_MAP_FAILED);
+#endif
pthread_mutex_unlock (&bufmgr->lock);
return (tbm_bo_handle)NULL;
}
#include <tbm_type.h>
#include <stdint.h>
+#include <tizen_error.h>
+
+
+/* this define will be removed when the capi-common is the version 0.1.1 */
+#ifndef TIZEN_ERROR_TBM
+#define TIZEN_ERROR_TBM -0x02830000
+#endif
/**
* \file tbm_bufmgr.h
TBM_BO_VENDOR = (0xffff0000), /**< vendor specific memory: it depends on the backend */
};
+
+/**
+ * @brief Enumeration for tbm error type.
+ * @since_tizen 2.4
+ */
+typedef enum
+{
+ TBM_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
+ TBM_ERROR_BO_LOCK_FAILED = TIZEN_ERROR_TBM|0x0101, /**< tbm_bo lock failed */
+ TBM_ERROR_BO_MAP_FAILED = TIZEN_ERROR_TBM|0x0102, /**< tbm_bo map failed */
+} tbm_error_e;
+
+
#ifdef __cplusplus
extern "C" {
#endif
* @param[in] device : the device type to get a handle
* @param[in] opt : the option to access the buffer object
* @return the handle of the buffer object
+ * @exception #TBM_ERROR_NONE Success
+ * @exception #TBM_ERROR_BO_LOCK_FAILED tbm_bo lock failed
+ * @exception #TBM_ERROR_BO_MAP_FAILED tbm_bo map failed
* @retval #tbm_bo
* @see tbm_bo_unmap()
* @par Example
tbm_bufmgr bufmgr;
tbm_bo bo;
tbm_bo_handle handle;
+ tbm_error_e error;
bufmgr = tbm_bufmgr_init (bufmgr_fd);
bo = tbm_bo_alloc (bufmgr, 128 * 128, TBM_BO_DEFAULT);
...
handle = tbm_bo_map (bo, TBM_DEVICE_2D, TBM_OPTION_READ|TBM_OPTION_WRITE);
+ if (handle.ptr == NULL)
+ {
+ error = get_last_result ();
+ ...
+ }
...