return ret;
}
-EXTERN tdm_error
-tdm_layer_commit(tdm_layer *layer, tdm_layer_commit_handler func, void *user_data)
+INTERN tdm_error
+tdm_layer_commit_internal(tdm_private_layer *private_layer, tdm_layer_commit_handler func, void *user_data)
{
- LAYER_FUNC_ENTRY();
-
- _pthread_mutex_lock(&private_display->lock);
+ tdm_private_output *private_output = private_layer->private_output;
+ tdm_error ret = TDM_ERROR_NONE; /* default TDM_ERROR_NONE */
if (private_output->commit_type == TDM_COMMIT_TYPE_NONE) {
if (!private_output->commit_per_vblank)
}
if (TDM_OUTPUT_DPMS_VSYNC_IS_OFF(private_output->current_dpms_value)) {
- TDM_ERR("layer(%p)'s output(%d) dpms: %s", layer, private_output->pipe,
+ TDM_ERR("layer(%p)'s output(%d) dpms: %s", private_layer, private_output->pipe,
tdm_dpms_str(private_output->current_dpms_value));
- _pthread_mutex_unlock(&private_display->lock);
return TDM_ERROR_DPMS_OFF;
}
/* don't call this inside of _tdm_layer_commit */
ret = tdm_layer_commit_pending_data(private_layer);
if (ret != TDM_ERROR_NONE) {
- TDM_ERR("layer(%p) committing pending data failed", layer);
- _pthread_mutex_unlock(&private_display->lock);
+ TDM_ERR("layer(%p) committing pending data failed", private_layer);
return ret;
}
ret = _tdm_layer_commit(private_layer, func, user_data);
+ return ret;
+}
+
+EXTERN tdm_error
+tdm_layer_commit(tdm_layer *layer, tdm_layer_commit_handler func, void *user_data)
+{
+ LAYER_FUNC_ENTRY();
+
+ _pthread_mutex_lock(&private_display->lock);
+
+ ret = tdm_layer_commit_internal(private_layer, func, user_data);
+
_pthread_mutex_unlock(&private_display->lock);
return ret;