int
tbm_surface_destroy(tbm_surface_h surface)
{
- if (!_tbm_surface_is_valid(surface))
+ if (!tbm_surface_internal_is_valid(surface))
return TBM_SURFACE_ERROR_INVALID_PARAMETER;
tbm_surface_internal_destroy(surface);
int
tbm_surface_map(tbm_surface_h surface, int opt, tbm_surface_info_s *info)
{
- TBM_RETURN_VAL_IF_FAIL(_tbm_surface_is_valid(surface), TBM_SURFACE_ERROR_INVALID_PARAMETER);
+ TBM_RETURN_VAL_IF_FAIL(tbm_surface_internal_is_valid(surface), TBM_SURFACE_ERROR_INVALID_PARAMETER);
TBM_RETURN_VAL_IF_FAIL(info != NULL, TBM_SURFACE_ERROR_INVALID_PARAMETER);
int ret = 0;
int
tbm_surface_unmap(tbm_surface_h surface)
{
- TBM_RETURN_VAL_IF_FAIL(_tbm_surface_is_valid(surface), TBM_SURFACE_ERROR_INVALID_PARAMETER);
+ TBM_RETURN_VAL_IF_FAIL(tbm_surface_internal_is_valid(surface), TBM_SURFACE_ERROR_INVALID_PARAMETER);
tbm_surface_internal_unmap(surface);
int
tbm_surface_get_info(tbm_surface_h surface, tbm_surface_info_s *info)
{
- TBM_RETURN_VAL_IF_FAIL(_tbm_surface_is_valid(surface), TBM_SURFACE_ERROR_INVALID_PARAMETER);
+ TBM_RETURN_VAL_IF_FAIL(tbm_surface_internal_is_valid(surface), TBM_SURFACE_ERROR_INVALID_PARAMETER);
TBM_RETURN_VAL_IF_FAIL(info != NULL, TBM_SURFACE_ERROR_INVALID_PARAMETER);
int ret = 0;
int
tbm_surface_get_width(tbm_surface_h surface)
{
- TBM_RETURN_VAL_IF_FAIL(_tbm_surface_is_valid(surface), TBM_SURFACE_ERROR_INVALID_PARAMETER);
+ TBM_RETURN_VAL_IF_FAIL(tbm_surface_internal_is_valid(surface), TBM_SURFACE_ERROR_INVALID_PARAMETER);
return tbm_surface_internal_get_width(surface);
}
int
tbm_surface_get_height(tbm_surface_h surface)
{
- TBM_RETURN_VAL_IF_FAIL(_tbm_surface_is_valid(surface), TBM_SURFACE_ERROR_INVALID_PARAMETER);
+ TBM_RETURN_VAL_IF_FAIL(tbm_surface_internal_is_valid(surface), TBM_SURFACE_ERROR_INVALID_PARAMETER);
return tbm_surface_internal_get_height(surface);
}
tbm_format
tbm_surface_get_format(tbm_surface_h surface)
{
- if (!_tbm_surface_is_valid(surface)) {
+ if (!tbm_surface_internal_is_valid(surface)) {
#ifdef HAVE_CAPI_0_1_1
set_last_result(TBM_SURFACE_ERROR_INVALID_PARAMETER);
#endif
static tbm_bufmgr g_surface_bufmgr;
static pthread_mutex_t tbm_surface_lock;
-int
-_tbm_surface_is_valid(tbm_surface_h surface)
-{
- tbm_surface_h old_data = NULL, tmp = NULL;
-
- if (surface == NULL || g_surface_bufmgr == NULL)
- return 0;
-
- if (!LIST_IS_EMPTY(&g_surface_bufmgr->surf_list)) {
- LIST_FOR_EACH_ENTRY_SAFE(old_data, tmp, &g_surface_bufmgr->surf_list, item_link) {
- if (old_data == surface)
- return 1;
- }
- }
- return 0;
-}
-
char *
_tbm_surface_internal_format_to_str(tbm_format format)
{
}
}
+int
+tbm_surface_internal_is_valid(tbm_surface_h surface)
+{
+ tbm_surface_h old_data = NULL, tmp = NULL;
+
+ if (surface == NULL || g_surface_bufmgr == NULL)
+ return 0;
+
+ if (!LIST_IS_EMPTY(&g_surface_bufmgr->surf_list)) {
+ LIST_FOR_EACH_ENTRY_SAFE(old_data, tmp, &g_surface_bufmgr->surf_list, item_link) {
+ if (old_data == surface)
+ return 1;
+ }
+ }
+ return 0;
+}
+
int
tbm_surface_internal_query_supported_formats(uint32_t **formats,
uint32_t *num)
void
tbm_surface_internal_destroy(tbm_surface_h surface)
{
- if (!_tbm_surface_is_valid(surface))
+ if (!tbm_surface_internal_is_valid(surface))
return;
_tbm_surface_mutex_lock();
void
tbm_surface_internal_ref(tbm_surface_h surface)
{
- TBM_RETURN_IF_FAIL(_tbm_surface_is_valid(surface));
+ TBM_RETURN_IF_FAIL(tbm_surface_internal_is_valid(surface));
_tbm_surface_mutex_lock();
void
tbm_surface_internal_unref(tbm_surface_h surface)
{
- TBM_RETURN_IF_FAIL(_tbm_surface_is_valid(surface));
+ TBM_RETURN_IF_FAIL(tbm_surface_internal_is_valid(surface));
_tbm_surface_mutex_lock();
int
tbm_surface_internal_get_num_bos(tbm_surface_h surface)
{
- TBM_RETURN_VAL_IF_FAIL(_tbm_surface_is_valid(surface), 0);
+ TBM_RETURN_VAL_IF_FAIL(tbm_surface_internal_is_valid(surface), 0);
struct _tbm_surface *surf;
int num;
tbm_bo
tbm_surface_internal_get_bo(tbm_surface_h surface, int bo_idx)
{
- TBM_RETURN_VAL_IF_FAIL(_tbm_surface_is_valid(surface), NULL);
+ TBM_RETURN_VAL_IF_FAIL(tbm_surface_internal_is_valid(surface), NULL);
TBM_RETURN_VAL_IF_FAIL(bo_idx > -1, NULL);
struct _tbm_surface *surf;
int
tbm_surface_internal_get_size(tbm_surface_h surface)
{
- TBM_RETURN_VAL_IF_FAIL(_tbm_surface_is_valid(surface), 0);
+ TBM_RETURN_VAL_IF_FAIL(tbm_surface_internal_is_valid(surface), 0);
struct _tbm_surface *surf;
unsigned int size;
tbm_surface_internal_get_plane_data(tbm_surface_h surface, int plane_idx,
uint32_t *size, uint32_t *offset, uint32_t *pitch)
{
- TBM_RETURN_VAL_IF_FAIL(_tbm_surface_is_valid(surface), 0);
+ TBM_RETURN_VAL_IF_FAIL(tbm_surface_internal_is_valid(surface), 0);
TBM_RETURN_VAL_IF_FAIL(plane_idx > -1, 0);
struct _tbm_surface *surf;
tbm_surface_internal_get_info(tbm_surface_h surface, int opt,
tbm_surface_info_s *info, int map)
{
- TBM_RETURN_VAL_IF_FAIL(_tbm_surface_is_valid(surface), 0);
+ TBM_RETURN_VAL_IF_FAIL(tbm_surface_internal_is_valid(surface), 0);
struct _tbm_surface *surf;
tbm_bo_handle bo_handles[4];
void
tbm_surface_internal_unmap(tbm_surface_h surface)
{
- TBM_RETURN_IF_FAIL(_tbm_surface_is_valid(surface));
+ TBM_RETURN_IF_FAIL(tbm_surface_internal_is_valid(surface));
struct _tbm_surface *surf;
int i;
unsigned int
tbm_surface_internal_get_width(tbm_surface_h surface)
{
- TBM_RETURN_VAL_IF_FAIL(_tbm_surface_is_valid(surface), 0);
+ TBM_RETURN_VAL_IF_FAIL(tbm_surface_internal_is_valid(surface), 0);
struct _tbm_surface *surf;
unsigned int width;
unsigned int
tbm_surface_internal_get_height(tbm_surface_h surface)
{
- TBM_RETURN_VAL_IF_FAIL(_tbm_surface_is_valid(surface), 0);
+ TBM_RETURN_VAL_IF_FAIL(tbm_surface_internal_is_valid(surface), 0);
struct _tbm_surface *surf;
unsigned int height;
tbm_format
tbm_surface_internal_get_format(tbm_surface_h surface)
{
- TBM_RETURN_VAL_IF_FAIL(_tbm_surface_is_valid(surface), 0);
+ TBM_RETURN_VAL_IF_FAIL(tbm_surface_internal_is_valid(surface), 0);
struct _tbm_surface *surf;
tbm_format format;
int
tbm_surface_internal_get_plane_bo_idx(tbm_surface_h surface, int plane_idx)
{
- TBM_RETURN_VAL_IF_FAIL(_tbm_surface_is_valid(surface), 0);
+ TBM_RETURN_VAL_IF_FAIL(tbm_surface_internal_is_valid(surface), 0);
TBM_RETURN_VAL_IF_FAIL(plane_idx > -1, 0);
struct _tbm_surface *surf;
int bo_idx;
void
tbm_surface_internal_set_debug_pid(tbm_surface_h surface, unsigned int pid)
{
- TBM_RETURN_IF_FAIL(_tbm_surface_is_valid(surface));
+ TBM_RETURN_IF_FAIL(tbm_surface_internal_is_valid(surface));
surface->debug_pid = pid;
}
tbm_surface_internal_add_user_data(tbm_surface_h surface, unsigned long key,
tbm_data_free data_free_func)
{
- TBM_RETURN_VAL_IF_FAIL(_tbm_surface_is_valid(surface), 0);
+ TBM_RETURN_VAL_IF_FAIL(tbm_surface_internal_is_valid(surface), 0);
tbm_user_data *data;
tbm_surface_internal_set_user_data(tbm_surface_h surface, unsigned long key,
void *data)
{
- TBM_RETURN_VAL_IF_FAIL(_tbm_surface_is_valid(surface), 0);
+ TBM_RETURN_VAL_IF_FAIL(tbm_surface_internal_is_valid(surface), 0);
tbm_user_data *old_data;
tbm_surface_internal_get_user_data(tbm_surface_h surface, unsigned long key,
void **data)
{
- TBM_RETURN_VAL_IF_FAIL(_tbm_surface_is_valid(surface), 0);
+ TBM_RETURN_VAL_IF_FAIL(tbm_surface_internal_is_valid(surface), 0);
tbm_user_data *old_data;
tbm_surface_internal_delete_user_data(tbm_surface_h surface,
unsigned long key)
{
- TBM_RETURN_VAL_IF_FAIL(_tbm_surface_is_valid(surface), 0);
+ TBM_RETURN_VAL_IF_FAIL(tbm_surface_internal_is_valid(surface), 0);
tbm_user_data *old_data = (void *)0;