/**
* @brief Set the acquire fence fd of client(relative to the TDM) target
+ * @details ownership of the acquire fence fd is transfered
* @param[in] hwc A output hwc
* @param[in] acquire_fence The acquire fence fd of target
* @return #TDM_ERROR_NONE if success. Otherwise, error value.
/**
* @brief Set the acquire fence of hwc_window
+ * @details ownership of the acquire fence fd is transfered
* @param[in] hwc_window A hwc window object
* @param[in] acquire_fence the acquire fence fd of a hwc window object
* @return #TDM_ERROR_NONE if success. Otherwise, error value.
/**
* @brief Set the acquire fence of client(relative to the TDM) target buffer
+ * @details ownership of the acquire fence fd is transfered and
+ * backend must close the acquire fence fd when it is no longer needed.
* @param[in] hwc A output hwc
* @param[in] acquire_fence The acquire fence fd of target
* @return #TDM_ERROR_NONE if success. Otherwise, error value.
* @brief Get commit fence
* @details After all change of a window object are applied to last tdm_hwc_commit,
* the fence is signaled.
+ * ownership of the commit fence fd is transfered and
+ * backend must dup the commit fence fd if the commit fence is continued used it in backend.
* @param[in] hwc A hwc object
* @param[out] commit_fence the commit fence fd of tdm_hwc_commit
* @return #TDM_ERROR_NONE if success. Otherwise, error value.
* @brief Get release fences
* @details Retrieves the windows which the backend requires setting the release fences
* the release fence is signaled when the backend is no longer using previous buffer.
+ * ownership of the release fence fd is transfered and
+ * backend must dup the release fence fd if the release fence is continued used it in backend.
* @param[in] hwc A hwc object
* @param[out] num_elements the number of hwc_windows
* @param[out] hwc_windows An array of windows
/**
* @brief Set the acquire fence of hwc_window
+ * @details ownership of the acquire fence fd is transfered and
+ * backend must close the acquire fence fd when it is no longer needed.
* @param[in] hwc_window A hwc window object
* @param[in] acquire_fence the acquire fence fd of a hwc window object
* @return #TDM_ERROR_NONE if success. Otherwise, error value.
ret = hal_tdm_hwc_window_set_acquire_fence((hal_tdm_hwc_window *)private_hwc_window->hwc_window_backend, acquire_fence);
} else {
if (!func_hwc_window->hwc_window_set_acquire_fence) {
+ if (acquire_fence >= 0)
+ close(acquire_fence);
_pthread_mutex_unlock(&private_display->lock);
TDM_WRN("not implemented!!");
return TDM_ERROR_NOT_IMPLEMENTED;