Merge branch 'tizen' into sandbox/cyeon/devel
[platform/core/uifw/libtdm.git] / src / tdm_hwc.c
index 5f43860..9238b29 100644 (file)
@@ -524,6 +524,33 @@ tdm_hwc_set_client_target_buffer(tdm_hwc *hwc, tbm_surface_h target_buffer, tdm_
        return ret;
 }
 
+EXTERN tdm_error
+tdm_hwc_set_client_target_acquire_fence(tdm_hwc *hwc, int acquire_fence)
+{
+       tdm_private_module *private_module;
+       tdm_func_hwc *func_hwc = NULL;
+
+       HWC_FUNC_ENTRY();
+
+       _pthread_mutex_lock(&private_display->lock);
+
+       private_module = private_hwc->private_module;
+       func_hwc = &private_module->func_hwc;
+
+       if (!func_hwc->hwc_set_client_target_acquire_fence) {
+               /* LCOV_EXCL_START */
+               _pthread_mutex_unlock(&private_display->lock);
+               TDM_WRN("not implemented!!");
+               return TDM_ERROR_NOT_IMPLEMENTED;
+               /* LCOV_EXCL_STOP */
+       }
+
+       ret = func_hwc->hwc_set_client_target_acquire_fence(private_hwc->hwc_backend, acquire_fence);
+
+       _pthread_mutex_unlock(&private_display->lock);
+
+       return ret;
+}
 
 EXTERN tdm_error
 tdm_hwc_validate(tdm_hwc *hwc, tdm_hwc_window **composited_wnds, uint32_t num_wnds, uint32_t *num_types)
@@ -798,6 +825,34 @@ commit_failed:
        /* LCOV_EXCL_STOP */
 }
 
+EXTERN tdm_error
+tdm_hwc_get_commit_fence(tdm_hwc *hwc, int *commit_fence)
+{
+       tdm_private_module *private_module;
+       tdm_func_hwc *func_hwc = NULL;
+
+       HWC_FUNC_ENTRY();
+
+       _pthread_mutex_lock(&private_display->lock);
+
+       private_module = private_hwc->private_module;
+       func_hwc = &private_module->func_hwc;
+
+       if (!func_hwc->hwc_get_commit_fence) {
+               /* LCOV_EXCL_START */
+               _pthread_mutex_unlock(&private_display->lock);
+               TDM_WRN("not implemented!!");
+               return TDM_ERROR_NOT_IMPLEMENTED;
+               /* LCOV_EXCL_STOP */
+       }
+
+       ret = func_hwc->hwc_get_commit_fence(private_hwc->hwc_backend, commit_fence);
+
+       _pthread_mutex_unlock(&private_display->lock);
+
+       return ret;
+}
+
 tdm_error
 tdm_hwc_set_property(tdm_hwc *hwc, uint32_t id, tdm_value value)
 {