move a registration of commit_cb before calling output_commit 20/71920/2
authorRoman Marchenko <r.marchenko@samsung.com>
Fri, 27 May 2016 13:12:07 +0000 (16:12 +0300)
committerRoman Marchenko <r.marchenko@samsung.com>
Tue, 31 May 2016 10:33:53 +0000 (13:33 +0300)
    If TDM backend works without events (for example fbdev backend)
    then it should be able to call  the commit handler function right after
    doing commit.

Change-Id: I981a02bf257fda116861554db47e0bdf822bfa1f
Signed-off-by: Roman Marchenko <r.marchenko@samsung.com>
src/tdm_display.c

index 1790229..969b227 100644 (file)
@@ -1058,16 +1058,16 @@ _tdm_output_commit(tdm_output *output, int sync, tdm_output_commit_handler func,
        commit_handler->user_data = user_data;
        commit_handler->owner_tid = syscall(SYS_gettid);
 
-       ret = func_output->output_commit(private_output->output_backend, sync,
-                                                                        commit_handler);
-       TDM_RETURN_VAL_IF_FAIL(ret == TDM_ERROR_NONE, ret);
-
        if (!private_output->regist_commit_cb) {
                private_output->regist_commit_cb = 1;
                ret = func_output->output_set_commit_handler(private_output->output_backend,
                                tdm_output_cb_commit);
        }
 
+       ret = func_output->output_commit(private_output->output_backend, sync,
+                                                                        commit_handler);
+       TDM_RETURN_VAL_IF_FAIL(ret == TDM_ERROR_NONE, ret);
+
        return ret;
 }