tdm_layer: do not free if wait vblank fail by dpms off 92/211192/1
authorJunkyeong Kim <jk0430.kim@samsung.com>
Wed, 31 Jul 2019 05:02:38 +0000 (14:02 +0900)
committerJunkyeong Kim <jk0430.kim@samsung.com>
Wed, 31 Jul 2019 05:02:42 +0000 (14:02 +0900)
if dpms off, the allocated layer_commit_handler memory free in tdm_output_commit_internal.
so must not free this memory in _tdm_layer_commit.

Change-Id: I0cdb117ccb0c16ec2cb793f873f645f1183d15c8
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
src/tdm_layer.c

index 0885abb..22cdb47 100644 (file)
@@ -998,7 +998,14 @@ _tdm_layer_commit(tdm_layer *layer, tdm_layer_commit_handler func, void *user_da
                        _pthread_mutex_unlock(&private_display->lock);
                        ret = tdm_vblank_wait(private_output->vblank, 0, 0, 1, _tdm_layer_cb_wait_vblank, private_output);
                        _pthread_mutex_lock(&private_display->lock);
-                       TDM_GOTO_IF_FAIL(ret == TDM_ERROR_NONE, commit_failed);
+                       if (ret != TDM_ERROR_NONE) {
+                               if (TDM_OUTPUT_DPMS_VSYNC_IS_OFF(private_output->current_dpms_value)) {
+                                       /* dpms off : the allocated memory was free in tdm_output_commit_internal */
+                                       return ret;
+                               }
+                               goto commit_failed;
+
+                       }
                        private_output->layer_waiting_vblank = 1;
 
                        if (tdm_debug_module & TDM_DEBUG_COMMIT)