summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSooChan Lim <sc1.lim@samsung.com>2018-03-22 12:56:02 +0900
committerSooChan Lim <sc1.lim@samsung.com>2018-03-22 12:56:02 +0900
commit5827ab07611ef1e08d4e193623bc7991212b9d71 (patch)
tree091ce9588454e297f06ab0ae024dec611eb8dad4
parenta23c7c4f8d9cea16693c7d260c83153cd41c0f1d (diff)
downloadlibtbm-vc4-5827ab07611ef1e08d4e193623bc7991212b9d71.tar.gz
libtbm-vc4-5827ab07611ef1e08d4e193623bc7991212b9d71.tar.bz2
libtbm-vc4-5827ab07611ef1e08d4e193623bc7991212b9d71.zip
use tbm_log.h
Change-Id: I039797e857a0aae11e2cbf7ab36e68dd7b3769d6
-rw-r--r--src/tbm_bufmgr_vc4.c45
1 files changed, 15 insertions, 30 deletions
diff --git a/src/tbm_bufmgr_vc4.c b/src/tbm_bufmgr_vc4.c
index 6bf6285..2d8e735 100644
--- a/src/tbm_bufmgr_vc4.c
+++ b/src/tbm_bufmgr_vc4.c
@@ -84,21 +84,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 VC4_RETURN_IF_FAIL(cond) {\
- if (!(cond)) {\
- TBM_ERR("[%s] : '%s' failed.\n", __func__, #cond);\
- return;\
- } \
-}
-
-#define VC4_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;
@@ -378,7 +363,7 @@ _tgl_get_data(int fd, unsigned int key)
static int
_vc4_cache_flush(tbm_bufmgr_vc4 bufmgr_vc4, tbm_bo_vc4 bo_vc4, int flags)
{
- VC4_RETURN_VAL_IF_FAIL(bufmgr_vc4 != NULL, 0);
+ TBM_RETURN_VAL_IF_FAIL(bufmgr_vc4 != NULL, 0);
/* cache flush is managed by kernel side when using dma-fence. */
if (bufmgr_vc4->use_dma_fence)
@@ -431,8 +416,8 @@ static int
_bo_init_cache_state(tbm_bufmgr_vc4 bufmgr_vc4, tbm_bo_vc4 bo_vc4, int import)
{
#ifdef ENABLE_CACHECRTL
- VC4_RETURN_VAL_IF_FAIL(bufmgr_vc4 != NULL, 0);
- VC4_RETURN_VAL_IF_FAIL(bo_vc4 != NULL, 0);
+ TBM_RETURN_VAL_IF_FAIL(bufmgr_vc4 != NULL, 0);
+ TBM_RETURN_VAL_IF_FAIL(bo_vc4 != NULL, 0);
if (bufmgr_vc4->use_dma_fence)
return 1;
@@ -457,8 +442,8 @@ static int
_bo_set_cache_state(tbm_bufmgr_vc4 bufmgr_vc4, tbm_bo_vc4 bo_vc4, int device, int opt)
{
#ifdef ENABLE_CACHECRTL
- VC4_RETURN_VAL_IF_FAIL(bufmgr_vc4 != NULL, 0);
- VC4_RETURN_VAL_IF_FAIL(bo_vc4 != NULL, 0);
+ TBM_RETURN_VAL_IF_FAIL(bufmgr_vc4 != NULL, 0);
+ TBM_RETURN_VAL_IF_FAIL(bo_vc4 != NULL, 0);
if (bufmgr_vc4->use_dma_fence)
return 1;
@@ -521,8 +506,8 @@ static int
_bo_save_cache_state(tbm_bufmgr_vc4 bufmgr_vc4, tbm_bo_vc4 bo_vc4)
{
#ifdef ENABLE_CACHECRTL
- VC4_RETURN_VAL_IF_FAIL(bufmgr_vc4 != NULL, 0);
- VC4_RETURN_VAL_IF_FAIL(bo_vc4 != NULL, 0);
+ TBM_RETURN_VAL_IF_FAIL(bufmgr_vc4 != NULL, 0);
+ TBM_RETURN_VAL_IF_FAIL(bo_vc4 != NULL, 0);
if (bufmgr_vc4->use_dma_fence)
return 1;
@@ -545,8 +530,8 @@ static void
_bo_destroy_cache_state(tbm_bufmgr_vc4 bufmgr_vc4, tbm_bo_vc4 bo_vc4)
{
#ifdef ENABLE_CACHECRTL
- VC4_RETURN_IF_FAIL(bufmgr_vc4 != NULL);
- VC4_RETURN_IF_FAIL(bo_vc4 != NULL);
+ TBM_RETURN_IF_FAIL(bufmgr_vc4 != NULL);
+ TBM_RETURN_IF_FAIL(bo_vc4 != NULL);
if (bufmgr_vc4->use_dma_fence)
return ;
@@ -559,7 +544,7 @@ static int
_bufmgr_init_cache_state(tbm_bufmgr_vc4 bufmgr_vc4)
{
#ifdef ENABLE_CACHECRTL
- VC4_RETURN_VAL_IF_FAIL(bufmgr_vc4 != NULL, 0);
+ TBM_RETURN_VAL_IF_FAIL(bufmgr_vc4 != NULL, 0);
if (bufmgr_vc4->use_dma_fence)
return 1;
@@ -598,7 +583,7 @@ static void
_bufmgr_deinit_cache_state(tbm_bufmgr_vc4 bufmgr_vc4)
{
#ifdef ENABLE_CACHECRTL
- VC4_RETURN_IF_FAIL(bufmgr_vc4 != NULL);
+ TBM_RETURN_IF_FAIL(bufmgr_vc4 != NULL);
if (bufmgr_vc4->use_dma_fence)
return;
@@ -981,7 +966,7 @@ static tbm_error_e
tbm_vc4_bufmgr_bind_native_display(tbm_backend_bufmgr_data *bufmgr_data, tbm_native_display *native_display)
{
tbm_bufmgr_vc4 bufmgr_vc4 = (tbm_bufmgr_vc4)bufmgr_data;
- VC4_RETURN_VAL_IF_FAIL(bufmgr_vc4 != NULL, TBM_ERROR_INVALID_PARAMETER);
+ TBM_RETURN_VAL_IF_FAIL(bufmgr_vc4 != NULL, TBM_ERROR_INVALID_PARAMETER);
if (!tbm_drm_helper_wl_auth_server_init(native_display, bufmgr_vc4->fd,
bufmgr_vc4->device_name, 0)) {
@@ -1000,7 +985,7 @@ tbm_vc4_bufmgr_get_supported_formats(tbm_backend_bufmgr_data *bufmgr_data,
tbm_bufmgr_vc4 bufmgr_vc4 = (tbm_bufmgr_vc4)bufmgr_data;
uint32_t *color_formats;
- VC4_RETURN_VAL_IF_FAIL(bufmgr_vc4 != NULL, TBM_ERROR_INVALID_PARAMETER);
+ TBM_RETURN_VAL_IF_FAIL(bufmgr_vc4 != NULL, TBM_ERROR_INVALID_PARAMETER);
color_formats = (uint32_t *)calloc(1, sizeof(uint32_t) * TBM_COLOR_FORMAT_COUNT);
if (color_formats == NULL)
@@ -1029,7 +1014,7 @@ tbm_vc4_bufmgr_get_plane_data(tbm_backend_bufmgr_data *bufmgr_data,
int _size = 0;
int _bo_idx = 0;
- VC4_RETURN_VAL_IF_FAIL(bufmgr_vc4 != NULL, TBM_ERROR_INVALID_PARAMETER);
+ TBM_RETURN_VAL_IF_FAIL(bufmgr_vc4 != NULL, TBM_ERROR_INVALID_PARAMETER);
switch (format) {
/* 16 bpp RGB */
@@ -2068,7 +2053,7 @@ tbm_vc4_deinit(tbm_backend_bufmgr_data *bufmgr_data)
unsigned long key;
void *value;
- VC4_RETURN_IF_FAIL(bufmgr_vc4 != NULL);
+ TBM_RETURN_IF_FAIL(bufmgr_vc4 != NULL);
bufmgr = bufmgr_vc4->bufmgr;