layer: add tdm_layer_set_buffer_internal 92/169892/3
authorSooChan Lim <sc1.lim@samsung.com>
Mon, 12 Feb 2018 01:50:31 +0000 (10:50 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Mon, 12 Feb 2018 07:29:08 +0000 (07:29 +0000)
Change-Id: Iba8154071512bbd86d80666a8a84b33b9cb8f0e2

src/tdm_layer.c
src/tdm_private.h

index ed86c37..325752e 100644 (file)
@@ -415,17 +415,13 @@ _tdm_layer_free_all_buffers(tdm_private_layer *private_layer)
        }
 }
 
-EXTERN tdm_error
-tdm_layer_set_buffer(tdm_layer *layer, tbm_surface_h buffer)
+INTERN tdm_error
+tdm_layer_set_buffer_internal(tdm_private_layer *private_layer, tbm_surface_h buffer)
 {
+       tdm_private_output *private_output = private_layer->private_output;
+       tdm_private_display *private_display = private_output->private_display;
        tdm_func_layer *func_layer;
 
-       LAYER_FUNC_ENTRY();
-
-       TDM_RETURN_VAL_IF_FAIL(buffer != NULL, TDM_ERROR_INVALID_PARAMETER);
-
-       _pthread_mutex_lock(&private_display->lock);
-
        /* LCOV_EXCL_START */
        /* dump buffer */
        if (tdm_dump_enable && !(private_layer->caps.capabilities & TDM_LAYER_CAPABILITY_VIDEO))
@@ -450,7 +446,6 @@ tdm_layer_set_buffer(tdm_layer *layer, tbm_surface_h buffer)
 
        if (!func_layer->layer_set_buffer) {
                /* LCOV_EXCL_START */
-               _pthread_mutex_unlock(&private_display->lock);
                TDM_ERR("not implemented!!");
                return TDM_ERROR_NOT_IMPLEMENTED;
                /* LCOV_EXCL_START */
@@ -484,6 +479,20 @@ tdm_layer_set_buffer(tdm_layer *layer, tbm_surface_h buffer)
                TDM_TRACE_ASYNC_BEGIN((intptr_t)private_layer, "[LAYER] %d", tbm_bo_export(bo));
        }
 
+       return TDM_ERROR_NONE;
+}
+
+EXTERN tdm_error
+tdm_layer_set_buffer(tdm_layer *layer, tbm_surface_h buffer)
+{
+       LAYER_FUNC_ENTRY();
+
+       TDM_RETURN_VAL_IF_FAIL(buffer != NULL, TDM_ERROR_INVALID_PARAMETER);
+
+       _pthread_mutex_lock(&private_display->lock);
+
+       ret = tdm_layer_set_buffer_internal(private_layer, buffer);
+
        _pthread_mutex_unlock(&private_display->lock);
 
        return ret;
index c771bb0..1747bb5 100644 (file)
@@ -143,6 +143,8 @@ void
 tdm_layer_committed(tdm_private_layer *private_layer, tdm_private_layer_buffer **committed_buffer);
 tdm_error
 tdm_layer_set_info_internal(tdm_private_layer *private_layer, tdm_info_layer *info);
+tdm_error
+tdm_layer_set_buffer_internal(tdm_private_layer *private_layer, tbm_surface_h buffer);
 
 void
 tdm_pp_cb_done(tdm_pp *pp_backend, tbm_surface_h src, tbm_surface_h dst,