return count;
}
+/* commit_per_vblank == 1: we can commit if
+ * - there is no previous commit request
+ * - only 1 layer is used
+ * commit_per_vblank == 2: we can commit if
+ * - there is no previous commit request
+ */
static int
_tdm_layer_commit_possible(tdm_private_layer *private_layer)
{
tdm_private_output *private_output = private_layer->private_output;
tdm_private_display *private_display = private_output->private_display;
- if (private_display->commit_per_vblank == 1 && _tdm_lauer_get_output_used_layer_count(private_output) == 1) {
+ TDM_RETURN_VAL_IF_FAIL(!(private_display->commit_per_vblank > 0), 1);
+
+ /* There is a previous commit request which is not done and displayed on screen yet.
+ * We can't commit at this time.
+ */
+ if (!LIST_IS_EMPTY(&private_output->layer_commit_handler_list)) {
if (tdm_debug_module & TDM_DEBUG_COMMIT)
- TDM_INFO("layer(%p) commit: 1 layer", private_layer);
- return 1;
+ TDM_INFO("layer(%p) commit: not possible(previous commit)", private_layer);
+ return 0;
}
- if (private_display->commit_per_vblank == 2 && LIST_IS_EMPTY(&private_output->layer_commit_handler_list)) {
+ if (private_display->commit_per_vblank == 1 && _tdm_lauer_get_output_used_layer_count(private_output) > 1) {
if (tdm_debug_module & TDM_DEBUG_COMMIT)
- TDM_INFO("layer(%p) commit: non previous commit", private_layer);
- return 1;
+ TDM_INFO("layer(%p) commit: not possible(more than 2 layers)", private_layer);
+ return 0;
}
- return 0;
+ TDM_INFO("layer(%p) commit: possible", private_layer);
+
+ return 1;
}
/* CAUTION: Once _tdm_layer_commit returns success, the layer commit handler MUST be called always.