tbm_surface_internal: do not print the error message 32/260732/1
authorSooChan Lim <sc1.lim@samsung.com>
Fri, 2 Jul 2021 02:08:18 +0000 (11:08 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Fri, 2 Jul 2021 02:44:52 +0000 (11:44 +0900)
If the tbm_module does not support the surface_data, the libtbm prints nothing.

Change-Id: Ibbe628d66a6ff1a1d56a9e578a38e8101e84530e

src/tbm_surface_internal.c

index 251b975..f540387 100644 (file)
@@ -106,6 +106,16 @@ void _tbm_surface_mutex_unlock(void);
        } \
 }
 
+#define TBM_SURFACE_RETURN_VAL_SET_ERR_NO_LOG_IF_FAIL(cond, val, error, error_type) {\
+       if (!(cond)) {\
+               if (error)\
+                       *error = error_type;\
+               _tbm_set_last_result(error_type);\
+               _tbm_surface_mutex_unlock();\
+               return val;\
+       } \
+}
+
 /* LCOV_EXCL_START */
 static double
 _tbm_surface_internal_get_time(void)
@@ -2880,7 +2890,7 @@ tbm_surface_internal_export(tbm_surface_h surface, tbm_error_e *error)
        TBM_SURFACE_RETURN_VAL_SET_ERR_IF_FAIL(bufmgr != NULL, NULL, error, TBM_ERROR_INVALID_OPERATION);
 
        // this function supports when the module suppport surface_data.
-       TBM_SURFACE_RETURN_VAL_SET_ERR_IF_FAIL(tbm_module_support_surface_data(bufmgr->module), NULL, error, TBM_ERROR_NOT_SUPPORTED);
+       TBM_SURFACE_RETURN_VAL_SET_ERR_NO_LOG_IF_FAIL(tbm_module_support_surface_data(bufmgr->module), NULL, error, TBM_ERROR_NOT_SUPPORTED);
 
        TBM_SURFACE_RETURN_VAL_SET_ERR_IF_FAIL(_tbm_surface_internal_is_valid(surface), NULL, error, TBM_ERROR_INVALID_PARAMETER);
 
@@ -2908,7 +2918,7 @@ tbm_surface_internal_import(tbm_surface_info_s *surface_info, tbm_surface_buffer
        TBM_SURFACE_RETURN_VAL_SET_ERR_IF_FAIL(bufmgr != NULL, NULL, error, TBM_ERROR_INVALID_OPERATION);
 
        // this function supports when the module suppport surface_data.
-       TBM_SURFACE_RETURN_VAL_SET_ERR_IF_FAIL(tbm_module_support_surface_data(bufmgr->module), NULL, error, TBM_ERROR_NOT_SUPPORTED);
+       TBM_SURFACE_RETURN_VAL_SET_ERR_NO_LOG_IF_FAIL(tbm_module_support_surface_data(bufmgr->module), NULL, error, TBM_ERROR_NOT_SUPPORTED);
 
        TBM_SURFACE_RETURN_VAL_SET_ERR_IF_FAIL(surface_info != NULL, NULL, error, TBM_ERROR_INVALID_PARAMETER);
        TBM_SURFACE_RETURN_VAL_SET_ERR_IF_FAIL(surface_info->width > 0, NULL, error, TBM_ERROR_INVALID_PARAMETER);