The tbm apis get the tbm_error_e values through tbm_get_last_error.
Change-Id: I2485a9ff6b60308e51f893887b8a3083fc87b002
%{_includedir}/tbm_sync.h
%{_includedir}/tbm_bo.h
%{_includedir}/tbm_log.h
+%{_includedir}/tbm_error.h
%{_includedir}/tbm_backend.h
%{_libdir}/libtbm.so
%{_libdir}/pkgconfig/libtbm.pc
tbm_drm_helper_client.c \
tbm_sync.c \
tbm_log.c \
+ tbm_error.c \
tbm_backend.c
nodist_libtbm_la_SOURCES = \
tbm_drm_helper.h \
tbm_sync.h \
tbm_log.h \
+ tbm_error.h \
tbm_backend.h
CLEANFILES = $(BUILT_SOURCES)
#include "list.h"
static pthread_mutex_t tbm_bo_lock = PTHREAD_MUTEX_INITIALIZER;
-static __thread tbm_error_e tbm_last_error = TBM_ERROR_NONE;
static void _tbm_bo_mutex_unlock(void);
/* check condition */
} \
}
-static void
-_tbm_set_last_result(tbm_error_e err)
-{
- tbm_last_error = err;
-}
-
/* LCOV_EXCL_START */
static bool
_tbm_bo_mutex_init(void)
return 1;
}
-/* LCOV_EXCL_START */
-tbm_error_e
-tbm_get_last_error(void)
-{
- return tbm_last_error;
-}
-/* LCOV_EXCL_STOP */
-
int
tbm_bo_get_flags(tbm_bo bo)
{
#include <tbm_type.h>
#include <tbm_type_common.h>
+#include <tbm_error.h>
/**
* \file tbm_bo.h
int tbm_bo_get_user_data(tbm_bo bo, unsigned long key, void **data);
/**
- * @brief Gets the latest tbm_error.
- * @since_tizen 2.4
- * @return the latest tbm_error
- * @par Example
- @code
- #include <tbm_bufmgr.h>
-
- int bufmgr_fd;
- 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);
- if (!bo)
- {
- error = tbm_get_last_error ();
- ...
- }
-
- ...
-
- handle = tbm_bo_map (bo, TBM_DEVICE_2D, TBM_OPTION_READ|TBM_OPTION_WRITE);
- if (handle.ptr == NULL)
- {
- error = tbm_get_last_error ();
- ...
- }
-
- ...
-
- tbm_bo_unmap (bo);
- tbm_bo_unref (bo);
- tbm_bufmgr_deinit (bufmgr);
- @endcode
- */
-tbm_error_e tbm_get_last_error(void);
-
-/**
* @brief Gets the tbm bo flags.
* @since_tizen 2.4
* @param[in] bo : the buffer object
#include <tbm_type.h>
#include <tbm_type_common.h>
-#include <tbm_bo.h>
+#include <tbm_error.h>
/**
* \file tbm_bufmgr.h
#include <tbm_log.h>
#include <tbm_bufmgr_backend.h>
#include <tbm_backend.h>
+#include <tbm_error.h>
extern tbm_bufmgr gBufMgr;
extern int b_dump_queue;
int tbm_bufmgr_get_fd_limit(void);
tbm_bufmgr tbm_bufmgr_get(void);
+
+void _tbm_set_last_result(tbm_error_e err);
+
#endif /* _TBM_BUFMGR_INT_H_ */
--- /dev/null
+/**************************************************************************
+
+libtbm
+
+Copyright 2012-2018 Samsung Electronics co., Ltd. All Rights Reserved.
+
+Contact: SooChan Lim <sc1.lim@samsung.com>, Sangjin Lee <lsj119@samsung.com>
+Boram Park <boram1288.park@samsung.com>, Changyeon Lee <cyeon.lee@samsung.com>
+
+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.
+
+**************************************************************************/
+
+#include "config.h"
+#include "tbm_bufmgr.h"
+#include "tbm_bufmgr_int.h"
+
+static __thread tbm_error_e tbm_last_error = TBM_ERROR_NONE;
+
+/* LCOV_EXCL_START */
+void
+_tbm_set_last_result(tbm_error_e err)
+{
+ tbm_last_error = err;
+}
+
+tbm_error_e
+tbm_get_last_error(void)
+{
+ return tbm_last_error;
+}
+/* LCOV_EXCL_STOP */
+
--- /dev/null
+/**************************************************************************
+
+libtbm
+
+Copyright 2012-2018 Samsung Electronics co., Ltd. All Rights Reserved.
+
+Contact: SooChan Lim <sc1.lim@samsung.com>, Sangjin Lee <lsj119@samsung.com>
+Boram Park <boram1288.park@samsung.com>, Changyeon Lee <cyeon.lee@samsung.com>
+
+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_ERROR_H_
+#define _TBM_ERROR_H_
+
+#include <tbm_type.h>
+#include <tbm_type_common.h>
+
+/**
+ * \file tbm_error.h
+ * \brief TBM Error
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Gets the latest tbm_error.
+ * @since_tizen 2.4
+ * @return the latest tbm_error
+ * @par Example
+ @code
+ #include <tbm_bufmgr.h>
+
+ int bufmgr_fd;
+ 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);
+ if (!bo)
+ {
+ error = tbm_get_last_error ();
+ ...
+ }
+
+ ...
+
+ handle = tbm_bo_map (bo, TBM_DEVICE_2D, TBM_OPTION_READ|TBM_OPTION_WRITE);
+ if (handle.ptr == NULL)
+ {
+ error = tbm_get_last_error ();
+ ...
+ }
+
+ ...
+
+ tbm_bo_unmap (bo);
+ tbm_bo_unref (bo);
+ tbm_bufmgr_deinit (bufmgr);
+ @endcode
+ */
+tbm_error_e tbm_get_last_error(void);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* _TBM_ERROR_H_ */
\ No newline at end of file
#define _TBM_SURFACE_INTERNAL_H_
#include <tbm_bufmgr.h>
+#include <tbm_error.h>
#ifdef __cplusplus
extern "C" {
#include <tbm_surface.h>
#include <tbm_type_common.h>
+#include <tbm_error.h>
typedef enum {
TBM_SURFACE_QUEUE_TRACE_NONE = 0, /**< Successful */