X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Ftdm_macro.h;h=5b8f861c69eca09393f5221b213694e1d90daf21;hb=a4b8dac3dca041874b9890b7a79d367f100aa79a;hp=98f25b4f4c1738d11771406450f1af3ddb4d49ce;hpb=d7a3a75c32b83cc1859589e38ba5b1d0cb1a20ff;p=platform%2Fcore%2Fuifw%2Flibtdm.git diff --git a/src/tdm_macro.h b/src/tdm_macro.h index 98f25b4..5b8f861 100644 --- a/src/tdm_macro.h +++ b/src/tdm_macro.h @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the @@ -74,8 +74,6 @@ extern "C" { #define TDM_SWAP(a, b) ({ int t; t = a; a = b; b = t; }) #define TDM_ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) -#define TDM_NEVER_GET_HERE() TDM_WRN("** NEVER GET HERE **") - #define TDM_SNPRINTF(p, len, fmt, ARG...) \ do { \ if (p && len && *len > 0) { \ @@ -85,6 +83,10 @@ extern "C" { } \ } while (0) +/* common backend names *****************************************************/ +#define TDM_DEFAULT_MODULE "libtdm-default.so" +#define TDM_DUMMY_MODULE "libtdm-dummy.so" + /* dump directory ***********************************************************/ #define TDM_DUMP_DIR "/tmp" @@ -101,6 +103,7 @@ extern "C" { #define TDM_OUTPUT_DPMS_VSYNC_IS_OFF(dpms) ((dpms) & TDM_OUTPUT_DPMS_VSYNC_OFF_MASK) /* strtostr *****************************************************************/ +/* LCOV_EXCL_START */ static inline char* strtostr(char *buf, int len, char *str, char *delim) { @@ -115,6 +118,7 @@ strtostr(char *buf, int len, char *str, char *delim) snprintf(buf, len, "%s", str); return str + len - 1; } +/* LCOV_EXCL_STOP */ /* EXTERN, INTERN, DEPRECATED ***********************************************/ #undef EXTERN @@ -210,6 +214,12 @@ static struct tdm_type_name tdm_conn_names[] = { }; TDM_TYPE_NAME_FN(conn) +static struct tdm_type_name tdm_capture_type_names[] = { + { TDM_CAPTURE_TYPE_ONESHOT, "none" }, + { TDM_CAPTURE_TYPE_STREAM, "90" }, +}; +TDM_TYPE_NAME_FN(capture_type) + static struct tdm_type_name tdm_transform_names[] = { { TDM_TRANSFORM_NORMAL, "none" }, { TDM_TRANSFORM_90, "90" }, @@ -234,14 +244,16 @@ TDM_TYPE_NAME_FN(value_type) static struct tdm_type_name tdm_cb_type_names[] = { { TDM_THREAD_CB_NONE, "none" }, + { TDM_THREAD_CB_EXIT, "exit" }, { TDM_THREAD_CB_OUTPUT_COMMIT, "output-commit" }, { TDM_THREAD_CB_OUTPUT_VBLANK, "output-vblank" }, - { TDM_THREAD_CB_OUTPUT_CHANGE, "output-change" }, + { TDM_THREAD_CB_OUTPUT_STATUS, "output-status" }, + { TDM_THREAD_CB_OUTPUT_DPMS, "output-dpms" }, { TDM_THREAD_CB_PP_DONE, "pp-done" }, { TDM_THREAD_CB_CAPTURE_DONE, "capture-done" }, { TDM_THREAD_CB_VBLANK_SW, "vblank-sw" }, { TDM_THREAD_CB_VBLANK_CREATE, "vblank-create" }, - { TDM_THREAD_CB_NEED_VALIDATE, "need-validate" }, + { TDM_THREAD_CB_HWC_COMMIT, "hwc-commit" }, }; TDM_TYPE_NAME_FN(cb_type) @@ -368,6 +380,12 @@ TDM_BIT_NAME_FB(capture_caps) return; \ } \ } +#define TDM_DBG_RETURN_VAL_IF_FAIL(cond, val) { \ + if (!(cond)) { \ + TDM_SNPRINTF(reply, len, "[%s %d] '%s' failed\n", __func__, __LINE__, #cond); \ + return val; \ + } \ +} #define TDM_DBG_GOTO_IF_FAIL(cond, dst) { \ if (!(cond)) { \ TDM_SNPRINTF(reply, len, "[%s %d] '%s' failed\n", __func__, __LINE__, #cond); \ @@ -446,6 +464,29 @@ static inline int TDM_MUTEX_IS_LOCKED(void) #define tdm_display_unlock(dpy) _pthread_mutex_unlock(&((tdm_private_display *)dpy)->lock) +/* debugging mutex ************************************************************/ +extern pthread_mutex_t tdm_debug_mutex_check_lock; +extern const char *tdm_debug_mutex_lock_func; +extern int tdm_debug_mutex_lock_line; + +#define _debug_pthread_mutex_lock(l) \ + do { \ + pthread_mutex_lock(l); \ + pthread_mutex_lock(&tdm_debug_mutex_check_lock); \ + tdm_debug_mutex_lock_func = __FUNCTION__; \ + tdm_debug_mutex_lock_line = __LINE__; \ + pthread_mutex_unlock(&tdm_debug_mutex_check_lock); \ + } while (0) + +#define _debug_pthread_mutex_unlock(l) \ + do { \ + pthread_mutex_lock(&tdm_debug_mutex_check_lock); \ + tdm_debug_mutex_lock_func = NULL; \ + tdm_debug_mutex_lock_line = 0; \ + pthread_mutex_unlock(&tdm_debug_mutex_check_lock); \ + pthread_mutex_unlock(l); \ + } while (0) + #ifdef __cplusplus } #endif