dpms: add AOD dpms mode
[platform/core/uifw/libtdm.git] / src / tdm_macro.h
index 6da02b4..a55251e 100644 (file)
@@ -49,6 +49,7 @@ extern "C" {
 #endif
 
 #define TDM_SERVER_REPLY_MSG_LEN       8192
+#define TDM_DEBUG_REPLY_MSG_LEN                2048
 
 #undef EXTERN
 #undef DEPRECATED
@@ -138,6 +139,9 @@ extern "C" {
 #define TDM_NOT_DEFINED_VALUE       (-1)
 #define TDM_FRONT_VALUE(n)          (((n) > 0) ? (n) : TDM_NOT_DEFINED_VALUE)
 
+#define TDM_MAX(x, y) (((x) > (y)) ? (x) : (y))
+#define TDM_MIN(x, y) (((x) < (y)) ? (x) : (y))
+
 #define TDM_TIME(sec, usec)   ((double)(sec) + ((double)(usec)) / 1000000.0)
 #define TDM_TIME_SEC(time)    ((unsigned int)(time))
 #define TDM_TIME_USEC(time)   (unsigned int)(((time) - (unsigned int)(time)) * 1000000.0)
@@ -155,6 +159,13 @@ 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]))
 
+/* can't export VSYNC macro because we can't define the exact meaning of vsync off
+ * at this time. Does committing in standy mode work? Doesn't committing in suspend mode work?
+ */
+#define TDM_OUTPUT_DPMS_DEFAULT_MASK         0xF
+#define TDM_OUTPUT_DPMS_VSYNC_OFF_MASK       0x2
+#define TDM_OUTPUT_DPMS_VSYNC_IS_OFF(dpms)   ((dpms) & TDM_OUTPUT_DPMS_VSYNC_OFF_MASK)
+
 struct tdm_type_name {
        int type;
        const char *name;
@@ -176,6 +187,7 @@ static struct tdm_type_name tdm_dpms_names[] = {
        { TDM_OUTPUT_DPMS_STANDBY, "standby" },
        { TDM_OUTPUT_DPMS_SUSPEND, "suspend" },
        { TDM_OUTPUT_DPMS_OFF, "off" },
+       { TDM_OUTPUT_DPMS_AOD, "aod" },
 };
 TDM_TYPE_NAME_FN(dpms)