EXTERN tdm_error
tdm_layer_set_property(tdm_layer *layer, unsigned int id, tdm_value value)
{
+ tdm_private_backend *private_backend;
tdm_func_layer *func_layer;
LAYER_FUNC_ENTRY();
_pthread_mutex_lock(&private_display->lock);
- func_layer = &private_display->func_layer;
+ private_backend = private_layer->private_backend;
+ func_layer = &private_backend->func_layer;
if (private_layer->usable)
TDM_INFO("layer(%d) not usable", private_layer->index);
EXTERN tdm_error
tdm_layer_get_property(tdm_layer *layer, unsigned int id, tdm_value *value)
{
+ tdm_private_backend *private_backend;
tdm_func_layer *func_layer;
LAYER_FUNC_ENTRY();
_pthread_mutex_lock(&private_display->lock);
- func_layer = &private_display->func_layer;
+ private_backend = private_layer->private_backend;
+ func_layer = &private_backend->func_layer;
if (!func_layer->layer_get_property) {
/* LCOV_EXCL_START */
INTERN tdm_error
tdm_layer_set_info_internal(tdm_private_layer *private_layer, tdm_info_layer *info)
{
- tdm_private_output *private_output = private_layer->private_output;
- tdm_private_display *private_display = private_output->private_display;
+ tdm_private_backend *private_backend;
tdm_func_layer *func_layer;
char fmtstr[128];
- func_layer = &private_display->func_layer;
+ private_backend = private_layer->private_backend;
+ func_layer = &private_backend->func_layer;
if (private_layer->usable)
TDM_INFO("layer(%p) not usable", private_layer);
EXTERN tdm_error
tdm_layer_get_info(tdm_layer *layer, tdm_info_layer *info)
{
+ tdm_private_backend *private_backend;
tdm_func_layer *func_layer;
LAYER_FUNC_ENTRY();
_pthread_mutex_lock(&private_display->lock);
- func_layer = &private_display->func_layer;
+ private_backend = private_layer->private_backend;
+ func_layer = &private_backend->func_layer;
if (!func_layer->layer_get_info) {
/* LCOV_EXCL_START */
INTERN tdm_error
tdm_layer_set_buffer_internal(tdm_private_layer *private_layer, tbm_surface_h buffer)
{
+ tdm_private_backend *private_backend;
tdm_private_output *private_output = private_layer->private_output;
- tdm_private_display *private_display = private_output->private_display;
tdm_func_layer *func_layer;
/* LCOV_EXCL_START */
}
/* LCOV_EXCL_STOP */
- func_layer = &private_display->func_layer;
+ private_backend = private_layer->private_backend;
+ func_layer = &private_backend->func_layer;
if (private_layer->usable)
TDM_INFO("layer(%p) not usable", private_layer);
INTERN tdm_error
tdm_layer_unset_buffer_internal(tdm_private_layer *private_layer)
{
- tdm_private_output *private_output = private_layer->private_output;
- tdm_private_display *private_display = private_output->private_display;
+ tdm_private_backend *private_backend;
tdm_func_layer *func_layer;
tdm_error ret = TDM_ERROR_NONE;
- func_layer = &private_display->func_layer;
+ private_backend = private_layer->private_backend;
+ func_layer = &private_backend->func_layer;
_tdm_layer_free_all_buffers(private_layer);
if (layer_commit_handler->func) {
_pthread_mutex_unlock(&private_display->lock);
- layer_commit_handler->func(private_output, sequence,
+ layer_commit_handler->func(private_layer, sequence,
tv_sec, tv_usec, layer_commit_handler->user_data);
_pthread_mutex_lock(&private_display->lock);
}
INTERN tdm_error
tdm_layer_commit_pending_data(tdm_private_layer *private_layer)
{
- tdm_private_output *private_output = private_layer->private_output;
- tdm_private_display *private_display = private_output->private_display;
+ tdm_private_backend *private_backend;
tdm_func_layer *func_layer;
tdm_error ret = TDM_ERROR_NONE;
- func_layer = &private_display->func_layer;
+ private_backend = private_layer->private_backend;
+ func_layer = &private_backend->func_layer;
if (private_layer->pending_info_changed) {
ret = func_layer->layer_set_info(private_layer->layer_backend, &private_layer->pending_info);
if (private_layer->showing_buffer) {
buffer = private_layer->showing_buffer->buffer;
} else {
- if (error)
- *error = TDM_ERROR_OPERATION_FAILED;
_pthread_mutex_unlock(&private_display->lock);
TDM_DBG("layer(%p) showing_buffer is null", private_layer);
return NULL;
{
TDM_RETURN_IF_FAIL(data != NULL);
tdm_layer *layer = data;
+ tdm_private_backend *private_backend;
tdm_func_layer *func_layer;
- tbm_surface_h surface = NULL;
+ tbm_surface_h buffer = NULL;
tdm_private_layer_buffer *layer_buffer;
LAYER_FUNC_ENTRY_VOID_RETURN();
_pthread_mutex_lock(&private_display->lock);
- func_layer = &private_display->func_layer;
+ private_backend = private_layer->private_backend;
+ func_layer = &private_backend->func_layer;
+
if (!func_layer->layer_set_buffer) {
/* LCOV_EXCL_START */
_pthread_mutex_unlock(&private_display->lock);
}
LIST_INITHEAD(&layer_buffer->link);
- if (TBM_SURFACE_QUEUE_ERROR_NONE != tbm_surface_queue_acquire(private_layer->buffer_queue, &surface) ||
- surface == NULL) {
+ if (TBM_SURFACE_QUEUE_ERROR_NONE != tbm_surface_queue_acquire(private_layer->buffer_queue, &buffer) ||
+ buffer == NULL) {
/* LCOV_EXCL_START */
TDM_ERR("layer(%p) tbm_surface_queue_acquire() failed surface:%p",
- private_layer, surface);
+ private_layer, buffer);
_pthread_mutex_unlock(&private_display->lock);
free(layer_buffer);
return;
/* LCOV_EXCL_STOP */
}
- /* we don't need to handle pending data here because the changes in this function
- * should be applied immediately. we can't expect calling tdm_layer_commit.
- */
- ret = func_layer->layer_set_buffer(private_layer->layer_backend, surface);
- TDM_WARNING_IF_FAIL(ret == TDM_ERROR_NONE);
-
- if (ret == TDM_ERROR_NONE) {
- if (private_layer->waiting_buffer) {
- TDM_DBG("layer(%p) drop waiting_buffer(%p)", private_layer, private_layer->waiting_buffer->buffer);
- _tdm_layer_free_buffer(private_layer, private_layer->waiting_buffer);
- }
-
- private_layer->waiting_buffer = layer_buffer;
- private_layer->waiting_buffer->buffer = tdm_buffer_ref_backend(surface);
-
- if (tdm_debug_module & TDM_DEBUG_BUFFER)
- TDM_INFO("layer(%p) waiting_buffer(%p)",
- private_layer, private_layer->waiting_buffer->buffer);
+ ret = tdm_layer_set_buffer_internal(private_layer, buffer);
+ if (ret != TDM_ERROR_NONE) {
+ TDM_ERR("tdm_layer_set_buffer_internal failed");
+ _pthread_mutex_unlock(&private_display->lock);
+ return;
+ }
- if (private_output->commit_type == TDM_COMMIT_TYPE_OUTPUT) {
- ret = tdm_output_commit_internal(private_layer->private_output, 0, NULL, NULL);
- if (ret != TDM_ERROR_NONE)
- TDM_ERR("tdm_output_commit_internal() is fail");
- } else if (private_output->commit_type == TDM_COMMIT_TYPE_LAYER) {
- ret = _tdm_layer_commit(private_layer, NULL, NULL);
- if (ret != TDM_ERROR_NONE)
- TDM_ERR("layer(%p) _tdm_layer_commit() is fail", private_layer);
- } else {
- TDM_NEVER_GET_HERE();
- }
- } else
- _tdm_layer_free_buffer(private_layer, layer_buffer);
+ ret = tdm_layer_commit_internal(private_layer, NULL, NULL);
+ if (ret != TDM_ERROR_NONE) {
+ TDM_ERR("tdm_layer_commit_internal failed");
+ _pthread_mutex_unlock(&private_display->lock);
+ return;
+ }
_pthread_mutex_unlock(&private_display->lock);
}
EXTERN tdm_error
tdm_layer_set_buffer_queue(tdm_layer *layer, tbm_surface_queue_h buffer_queue)
{
+ tdm_private_backend *private_backend;
tdm_func_layer *func_layer;
LAYER_FUNC_ENTRY();
_pthread_mutex_lock(&private_display->lock);
- func_layer = &private_display->func_layer;
+ private_backend = private_layer->private_backend;
+ func_layer = &private_backend->func_layer;
if (private_layer->usable)
TDM_INFO("layer(%p) not usable", private_layer);
EXTERN tdm_error
tdm_layer_set_video_pos(tdm_layer *layer, int zpos)
{
+ tdm_private_backend *private_backend;
tdm_func_layer *func_layer;
LAYER_FUNC_ENTRY();
_pthread_mutex_lock(&private_display->lock);
- func_layer = &private_display->func_layer;
+ private_backend = private_layer->private_backend;
+ func_layer = &private_backend->func_layer;
if (!(private_layer->caps.capabilities & TDM_LAYER_CAPABILITY_VIDEO)) {
TDM_ERR("layer(%p) is not video layer", private_layer);
_pthread_mutex_unlock(&private_display->lock);
- return TDM_ERROR_INVALID_PARAMETER;
+ return TDM_ERROR_BAD_REQUEST;
}
if (!func_layer->layer_set_video_pos) {
EXTERN tdm_error
tdm_layer_get_buffer_flags(tdm_layer *layer, unsigned int *flags)
{
+ tdm_private_backend *private_backend;
tdm_func_layer *func_layer;
LAYER_FUNC_ENTRY();
TDM_RETURN_VAL_IF_FAIL(flags != NULL, TDM_ERROR_INVALID_PARAMETER);
_pthread_mutex_lock(&private_display->lock);
- func_layer = &private_display->func_layer;
+ private_backend = private_layer->private_backend;
+ func_layer = &private_backend->func_layer;
if (!func_layer->layer_get_buffer_flags) {
/* LCOV_EXCL_START */
*flags = 0;
_pthread_mutex_unlock(&private_display->lock);
- TDM_ERR("not implemented!!");
- return TDM_ERROR_NOT_IMPLEMENTED;
+ TDM_INFO("not implemented!!");
+ return TDM_ERROR_NONE;
/* LCOV_EXCL_STOP */
}