summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSooChan Lim <sc1.lim@samsung.com>2018-03-22 11:50:33 +0900
committerSooChan Lim <sc1.lim@samsung.com>2018-03-22 23:32:05 +0000
commit0114d3bda0931d077087c1b7ff7f2ba014075322 (patch)
tree67e10e87ef3b15f6f6cd111a34877757cd6a7555
parentaecf629697a94d618d7bb47d89a72887ed83b60f (diff)
downloadlibtbm-exynos-tgm-0114d3bda0931d077087c1b7ff7f2ba014075322.tar.gz
libtbm-exynos-tgm-0114d3bda0931d077087c1b7ff7f2ba014075322.tar.bz2
libtbm-exynos-tgm-0114d3bda0931d077087c1b7ff7f2ba014075322.zip
use tbm_log.h
Change-Id: I48f95330938fd325281a345a8391c48d9f9cc7d4
-rw-r--r--src/tbm_bufmgr_exynos.c37
1 files changed, 11 insertions, 26 deletions
diff --git a/src/tbm_bufmgr_exynos.c b/src/tbm_bufmgr_exynos.c
index dd7a043..9bdcaf0 100644
--- a/src/tbm_bufmgr_exynos.c
+++ b/src/tbm_bufmgr_exynos.c
@@ -79,21 +79,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define S5P_FIMV_NV12MT_HALIGN 128
#define S5P_FIMV_NV12MT_VALIGN 64
-/* check condition */
-#define EXYNOS_RETURN_IF_FAIL(cond) {\
- if (!(cond)) {\
- TBM_ERR("[%s] : '%s' failed.\n", __func__, #cond);\
- return;\
- } \
-}
-
-#define EXYNOS_RETURN_VAL_IF_FAIL(cond, val) {\
- if (!(cond)) {\
- TBM_ERR("[%s] : '%s' failed.\n", __func__, #cond);\
- return val;\
- } \
-}
-
struct dma_buf_info {
unsigned long size;
unsigned int fence_supported;
@@ -366,7 +351,7 @@ _tgl_get_data(int fd, unsigned int key)
static int
_exynos_cache_flush(tbm_bufmgr_exynos bufmgr_exynos, tbm_bo_exynos bo_exynos, int flags)
{
- EXYNOS_RETURN_VAL_IF_FAIL(bufmgr_exynos != NULL, 0);
+ TBM_RETURN_VAL_IF_FAIL(bufmgr_exynos != NULL, 0);
/* cache flush is managed by kernel side when using dma-fence. */
if (bufmgr_exynos->use_dma_fence)
@@ -419,8 +404,8 @@ static int
_bo_init_cache_state(tbm_bufmgr_exynos bufmgr_exynos, tbm_bo_exynos bo_exynos, int import)
{
#ifdef ENABLE_CACHECTRL
- EXYNOS_RETURN_VAL_IF_FAIL(bufmgr_exynos != NULL, 0);
- EXYNOS_RETURN_VAL_IF_FAIL(bo_exynos != NULL, 0);
+ TBM_RETURN_VAL_IF_FAIL(bufmgr_exynos != NULL, 0);
+ TBM_RETURN_VAL_IF_FAIL(bo_exynos != NULL, 0);
if (bufmgr_exynos->use_dma_fence)
return 1;
@@ -445,8 +430,8 @@ static int
_bo_set_cache_state(tbm_bufmgr_exynos bufmgr_exynos, tbm_bo_exynos bo_exynos, int device, int opt)
{
#ifdef ENABLE_CACHECTRL
- EXYNOS_RETURN_VAL_IF_FAIL(bufmgr_exynos != NULL, 0);
- EXYNOS_RETURN_VAL_IF_FAIL(bo_exynos != NULL, 0);
+ TBM_RETURN_VAL_IF_FAIL(bufmgr_exynos != NULL, 0);
+ TBM_RETURN_VAL_IF_FAIL(bo_exynos != NULL, 0);
if (bufmgr_exynos->use_dma_fence)
return 1;
@@ -512,8 +497,8 @@ static int
_bo_save_cache_state(tbm_bufmgr_exynos bufmgr_exynos, tbm_bo_exynos bo_exynos)
{
#ifdef ENABLE_CACHECTRL
- EXYNOS_RETURN_VAL_IF_FAIL(bufmgr_exynos != NULL, 0);
- EXYNOS_RETURN_VAL_IF_FAIL(bo_exynos != NULL, 0);
+ TBM_RETURN_VAL_IF_FAIL(bufmgr_exynos != NULL, 0);
+ TBM_RETURN_VAL_IF_FAIL(bo_exynos != NULL, 0);
if (bufmgr_exynos->use_dma_fence)
return 1;
@@ -550,7 +535,7 @@ static int
_bufmgr_init_cache_state(tbm_bufmgr_exynos bufmgr_exynos)
{
#ifdef ENABLE_CACHECTRL
- EXYNOS_RETURN_VAL_IF_FAIL(bufmgr_exynos != NULL, 0);
+ TBM_RETURN_VAL_IF_FAIL(bufmgr_exynos != NULL, 0);
if (bufmgr_exynos->use_dma_fence)
return 1;
@@ -1003,7 +988,7 @@ static tbm_error_e
tbm_exynos_bufmgr_bind_native_display(tbm_backend_bufmgr_data *bufmgr_data, tbm_native_display *native_display)
{
tbm_bufmgr_exynos bufmgr_exynos = (tbm_bufmgr_exynos)bufmgr_data;
- EXYNOS_RETURN_VAL_IF_FAIL(bufmgr_exynos != NULL, TBM_ERROR_INVALID_PARAMETER);
+ TBM_RETURN_VAL_IF_FAIL(bufmgr_exynos != NULL, TBM_ERROR_INVALID_PARAMETER);
if (!tbm_drm_helper_wl_auth_server_init(native_display, bufmgr_exynos->fd,
bufmgr_exynos->device_name, 0)) {
@@ -1023,7 +1008,7 @@ tbm_exynos_bufmgr_get_supported_formats(tbm_backend_bufmgr_data *bufmgr_data,
tbm_bufmgr_exynos bufmgr_exynos = (tbm_bufmgr_exynos)bufmgr_data;
uint32_t *color_formats;
- EXYNOS_RETURN_VAL_IF_FAIL(bufmgr_exynos != NULL, TBM_ERROR_INVALID_PARAMETER);
+ TBM_RETURN_VAL_IF_FAIL(bufmgr_exynos != NULL, TBM_ERROR_INVALID_PARAMETER);
color_formats = (uint32_t *)calloc(1, sizeof(uint32_t) * TBM_COLOR_FORMAT_COUNT);
if (color_formats == NULL)
@@ -1052,7 +1037,7 @@ tbm_exynos_bufmgr_get_plane_data(tbm_backend_bufmgr_data *bufmgr_data,
int _size = 0;
int _bo_idx = 0;
- EXYNOS_RETURN_VAL_IF_FAIL(bufmgr_exynos != NULL, TBM_ERROR_INVALID_PARAMETER);
+ TBM_RETURN_VAL_IF_FAIL(bufmgr_exynos != NULL, TBM_ERROR_INVALID_PARAMETER);
switch (format) {
/* 16 bpp RGB */