* @see The display_get_capability() function of #tdm_func_display
*/
typedef struct _tdm_caps_display {
- int max_layer_count; /**< The maximum layer count. -1 means "not defined" */
+ int max_layer_count; /**< The maximum layer count */
} tdm_caps_display;
/**
unsigned int mmHeight; /**< The physical height (milimeter) */
unsigned int subpixel; /**< The subpixel */
- int min_w; /**< The minimun width. -1 means "not defined" */
- int min_h; /**< The minimun height. -1 means "not defined" */
- int max_w; /**< The maximum width. -1 means "not defined" */
- int max_h; /**< The maximum height. -1 means "not defined" */
- int preferred_align; /**< The prefered align. -1 means "not defined" */
+ int min_w; /**< The minimun width */
+ int min_h; /**< The minimun height */
+ int max_w; /**< The maximum width */
+ int max_h; /**< The maximum height */
+ int preferred_align; /**< The prefered align */
tdm_output_capability capabilities; /**< The capabilities of output. @since 1.4.1 */
- int cursor_min_w; /**< The minimun width. -1 means "not defined" @since 1.5.0 */
- int cursor_min_h; /**< The minimun height. -1 means "not defined" @since 1.5.0 */
- int cursor_max_w; /**< The maximum width. -1 means "not defined" @since 1.5.0 */
- int cursor_max_h; /**< The maximum height. -1 means "not defined" @since 1.5.0 */
- int cursor_preferred_align; /**< The prefered align. -1 means "not defined" @since 1.5.0 */
+ int cursor_min_w; /**< The minimun width. @since 1.5.0 */
+ int cursor_min_h; /**< The minimun height. @since 1.5.0 */
+ int cursor_max_w; /**< The maximum width. @since 1.5.0 */
+ int cursor_max_h; /**< The maximum height. @since 1.5.0 */
+ int cursor_preferred_align; /**< The prefered align. @since 1.5.0 */
} tdm_caps_output;
/**
tbm_format
*formats; /**< The @b newly-allocated array. will be freed in frontend. */
- int min_w; /**< The minimun width. -1 means "not defined" */
- int min_h; /**< The minimun height. -1 means "not defined" */
- int max_w; /**< The maximum width. -1 means "not defined" */
- int max_h; /**< The maximum height. -1 means "not defined" */
- int preferred_align; /**< The prefered align. -1 means "not defined" */
+ int min_w; /**< The minimun width */
+ int min_h; /**< The minimun height */
+ int max_w; /**< The maximum width */
+ int max_h; /**< The maximum height */
+ int preferred_align; /**< The prefered align */
- /**< The attach count which a PP object can handle.
- * -1 means "not defined".
- * @since 1.2.0
- */
+ /**< The attach count which a PP object can handle. @since 1.2.0 */
int max_attach_count;
} tdm_caps_pp;
tbm_format
*formats; /**< The @b newly-allocated array of formats. will be freed in frontend. */
- int min_w; /**< The minimun width. -1 means "not defined" */
- int min_h; /**< The minimun height. -1 means "not defined" */
- int max_w; /**< The maximum width. -1 means "not defined" */
- int max_h; /**< The maximum height. -1 means "not defined" */
- int preferred_align; /**< The prefered align. -1 means "not defined" */
+ int min_w; /**< The minimun width */
+ int min_h; /**< The minimun height */
+ int max_w; /**< The maximum width */
+ int max_h; /**< The maximum height */
+ int preferred_align; /**< The prefered align */
- /**< The attach count which a capture object can handle.
- * -1 means "not defined".
- * @since 1.2.0
- */
+ /**< The attach count which a capture object can handle. @since 1.2.0 */
int max_attach_count;
} tdm_caps_capture;
* is connected.\n
* If a hardware has the restriction of the number of max usable layer count,
* a backend module can set the max count to max_layer_count of #tdm_caps_display
- * structure. Otherwise, set -1.
+ * structure.
*/
tdm_error (*display_get_capability)(tdm_backend_data *bdata, tdm_caps_display *caps);
_tdm_display_destroy_caps_capture(&private_display->caps_capture);
private_display->capabilities = 0;
- private_display->caps_display.max_layer_count = -1;
+ private_display->caps_display.max_layer_count = 0;
}
static tdm_error
}
if (min_w)
- *min_w = private_display->caps_pp.min_w;
+ *min_w = TDM_FRONT_VALUE(private_display->caps_pp.min_w);
if (min_h)
- *min_h = private_display->caps_pp.min_h;
+ *min_h = TDM_FRONT_VALUE(private_display->caps_pp.min_h);
if (max_w)
- *max_w = private_display->caps_pp.max_w;
+ *max_w = TDM_FRONT_VALUE(private_display->caps_pp.max_w);
if (max_h)
- *max_h = private_display->caps_pp.max_h;
+ *max_h = TDM_FRONT_VALUE(private_display->caps_pp.max_h);
if (preferred_align)
- *preferred_align = private_display->caps_pp.preferred_align;
+ *preferred_align = TDM_FRONT_VALUE(private_display->caps_pp.preferred_align);
_pthread_mutex_unlock(&private_display->lock);
}
if (min_w)
- *min_w = private_display->caps_capture.min_w;
+ *min_w = TDM_FRONT_VALUE(private_display->caps_capture.min_w);
if (min_h)
- *min_h = private_display->caps_capture.min_h;
+ *min_h = TDM_FRONT_VALUE(private_display->caps_capture.min_h);
if (max_w)
- *max_w = private_display->caps_capture.max_w;
+ *max_w = TDM_FRONT_VALUE(private_display->caps_capture.max_w);
if (max_h)
- *max_h = private_display->caps_capture.max_h;
+ *max_h = TDM_FRONT_VALUE(private_display->caps_capture.max_h);
if (preferred_align)
- *preferred_align = private_display->caps_capture.preferred_align;
+ *preferred_align = TDM_FRONT_VALUE(private_display->caps_capture.preferred_align);
_pthread_mutex_unlock(&private_display->lock);
_pthread_mutex_lock(&private_display->lock);
- *max_count = private_display->caps_display.max_layer_count;
+ *max_count = TDM_FRONT_VALUE(private_display->caps_display.max_layer_count);
_pthread_mutex_unlock(&private_display->lock);
_pthread_mutex_lock(&private_display->lock);
if (min_w)
- *min_w = private_output->caps.min_w;
+ *min_w = TDM_FRONT_VALUE(private_output->caps.min_w);
if (min_h)
- *min_h = private_output->caps.min_h;
+ *min_h = TDM_FRONT_VALUE(private_output->caps.min_h);
if (max_w)
- *max_w = private_output->caps.max_w;
+ *max_w = TDM_FRONT_VALUE(private_output->caps.max_w);
if (max_h)
- *max_h = private_output->caps.max_h;
+ *max_h = TDM_FRONT_VALUE(private_output->caps.max_h);
if (preferred_align)
- *preferred_align = private_output->caps.preferred_align;
+ *preferred_align = TDM_FRONT_VALUE(private_output->caps.preferred_align);
_pthread_mutex_unlock(&private_display->lock);
}
if (min_w)
- *min_w = private_output->caps.cursor_min_w;
+ *min_w = TDM_FRONT_VALUE(private_output->caps.cursor_min_w);
if (min_h)
- *min_h = private_output->caps.cursor_min_h;
+ *min_h = TDM_FRONT_VALUE(private_output->caps.cursor_min_h);
if (max_w)
- *max_w = private_output->caps.cursor_max_w;
+ *max_w = TDM_FRONT_VALUE(private_output->caps.cursor_max_w);
if (max_h)
- *max_h = private_output->caps.cursor_max_h;
+ *max_h = TDM_FRONT_VALUE(private_output->caps.cursor_max_h);
if (preferred_align)
- *preferred_align = private_output->caps.cursor_preferred_align;
+ *preferred_align = TDM_FRONT_VALUE(private_output->caps.cursor_preferred_align);
_pthread_mutex_unlock(&private_display->lock);
tdm_status_str(private_output->caps.status),
tdm_dpms_str(private_output->current_dpms_value),
private_output->caps.subpixel,
- private_output->caps.preferred_align,
- private_output->caps.min_w, private_output->caps.min_h,
- private_output->caps.max_w, private_output->caps.max_h,
+ TDM_FRONT_VALUE(private_output->caps.preferred_align),
+ TDM_FRONT_VALUE(private_output->caps.min_w),
+ TDM_FRONT_VALUE(private_output->caps.min_h),
+ TDM_FRONT_VALUE(private_output->caps.max_w),
+ TDM_FRONT_VALUE(private_output->caps.max_h),
private_output->caps.mmWidth, private_output->caps.mmHeight);
TDM_SNPRINTF(reply, len, "\t%d modes:\n", private_output->caps.mode_count);
}
TDM_SNPRINTF(reply, len, "\n");
TDM_SNPRINTF(reply, len, "size\t: min(%dx%d) max(%dx%d) align_w(%d)\n",
- private_display->caps_pp.min_w, private_display->caps_pp.min_h,
- private_display->caps_pp.max_w, private_display->caps_pp.max_h,
- private_display->caps_pp.preferred_align);
+ TDM_FRONT_VALUE(private_display->caps_pp.min_w),
+ TDM_FRONT_VALUE(private_display->caps_pp.min_h),
+ TDM_FRONT_VALUE(private_display->caps_pp.max_w),
+ TDM_FRONT_VALUE(private_display->caps_pp.max_h),
+ TDM_FRONT_VALUE(private_display->caps_pp.preferred_align));
if (!LIST_IS_EMPTY(&private_display->pp_list)) {
TDM_SNPRINTF(reply, len, "-------------------------------------------------------------\n");
TDM_SNPRINTF(reply, len, "src(format size crop) | dst(format size crop) | transform\n");
}
TDM_SNPRINTF(reply, len, "\n");
TDM_SNPRINTF(reply, len, "size\t: min(%dx%d) max(%dx%d) align_w(%d)\n",
- private_display->caps_capture.min_w, private_display->caps_capture.min_h,
- private_display->caps_capture.max_w, private_display->caps_capture.max_h,
- private_display->caps_capture.preferred_align);
+ TDM_FRONT_VALUE(private_display->caps_capture.min_w),
+ TDM_FRONT_VALUE(private_display->caps_capture.min_h),
+ TDM_FRONT_VALUE(private_display->caps_capture.max_w),
+ TDM_FRONT_VALUE(private_display->caps_capture.max_h),
+ TDM_FRONT_VALUE(private_display->caps_capture.preferred_align));
if (!LIST_IS_EMPTY(&private_display->capture_list)) {
TDM_SNPRINTF(reply, len, "-----------------------------------\n");
TDM_SNPRINTF(reply, len, "dst(format size crop) | transform\n");
} \
}
+#define TDM_NOT_DEFINED_VALUE (-1)
+#define TDM_FRONT_VALUE(n) (((n) > 0) ? (n) : TDM_NOT_DEFINED_VALUE)
+
#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)