tpl_surface: narrow the lock section 87/93187/1
authorYoungJun Cho <yj44.cho@samsung.com>
Fri, 21 Oct 2016 01:46:58 +0000 (10:46 +0900)
committerYoungJun Cho <yj44.cho@samsung.com>
Fri, 21 Oct 2016 01:46:58 +0000 (10:46 +0900)
This patch narrows the lock section.
The 'tbm_surface' NULL checking routine is not related with tpl surface.

Change-Id: Ic547e0784933dcfe1f779aaa2748ebf463f084a8
Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
src/tpl_surface.c

index 91aefc1..690f7e6 100644 (file)
@@ -257,16 +257,14 @@ tpl_surface_enqueue_buffer_with_damage_and_sync(tpl_surface_t *surface,
                return TPL_ERROR_INVALID_PARAMETER;
        }
 
-       TRACE_BEGIN("TPL:ENQUEUE_BUFFER_WITH_DAMAGE");
-       TPL_OBJECT_LOCK(surface);
-
        if (!tbm_surface) {
-               TPL_OBJECT_UNLOCK(surface);
-               TRACE_END();
                TPL_ERR("tbm surface is invalid.");
                return TPL_ERROR_INVALID_PARAMETER;
        }
 
+       TRACE_BEGIN("TPL:ENQUEUE_BUFFER_WITH_DAMAGE");
+       TPL_OBJECT_LOCK(surface);
+
        if (surface->is_frontbuffer_mode) {
                if (surface->frontbuffer == tbm_surface) {
                        TPL_OBJECT_UNLOCK(surface);