tdm_hwc_get_commit_fence(tdm_hwc *hwc, int *commit_fence);
/**
+ * @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.
+ * @param[in] hwc A hwc object
+ * @param[out] num_elements the number of hwc_windows
+ * @param[out] hwc_windows An array of windows
+ * @param[out] release_fences An array of release fences, each corresponding
+ * to an element of windows
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+EXTERN tdm_error
+tdm_hwc_get_release_fences(tdm_hwc *hwc, uint32_t *num_elements,
+ tdm_hwc_window **hwc_windows, int *fences);
+
+/**
* @brief Set the property which has a given id on the hwc object.
* @param[in] hwc A hwc object
* @param[in] id The property id
tdm_error (*hwc_get_commit_fence)(tdm_hwc *hwc, int *commit_fence);
/**
+ * @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.
+ * @param[in] hwc A hwc object
+ * @param[out] num_elements the number of hwc_windows
+ * @param[out] hwc_windows An array of windows
+ * @param[out] release_fences An array of release fences, each corresponding
+ * to an element of windows
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+ tdm_error (*tdm_hwc_get_release_fences)(tdm_hwc *hwc, uint32_t *num_elements,
+ tdm_hwc_window **hwc_windows, int *release_fences);
+
+ /**
* @brief Set the property which has a given id on the hwc object.
* @param[in] hwc A hwc object
* @param[in] id The property id
return ret;
}
+EXTERN tdm_error
+tdm_hwc_get_release_fences(tdm_hwc *hwc, uint32_t *num_elements,
+ tdm_hwc_window **hwc_windows, int *fences)
+{
+ tdm_private_module *private_module;
+ tdm_func_hwc *func_hwc = NULL;
+ tdm_private_hwc_window *private_hwc_window = NULL;
+ int i;
+
+ 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_release_fences) {
+ /* 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_release_fences(private_hwc->hwc_backend, num_elements,
+ hwc_windows, fences);
+
+ if (hwc_windows == NULL || fences == NULL) {
+ _pthread_mutex_unlock(&private_display->lock);
+ return TDM_ERROR_NONE;
+ }
+
+ for (i = 0; i < *num_elements; i++) {
+ private_hwc_window = _tdm_hwc_find_private_hwc_window(private_hwc, hwc_windows[i]);
+ if (private_hwc_window == NULL) {
+ /* LCOV_EXCL_START */
+ TDM_ERR("failed! This should never happen!");
+ tdm_hwc_window_destroy_internal(private_hwc_window);
+ *num_elements = 0;
+ _pthread_mutex_unlock(&private_display->lock);
+ return TDM_ERROR_OPERATION_FAILED;
+ /* LCOV_EXCL_STOP */
+ }
+
+ hwc_windows[i] = (tdm_hwc_window*)private_hwc_window;
+ }
+
+ _pthread_mutex_unlock(&private_display->lock);
+
+ return ret;
+}
+
tdm_error
tdm_hwc_set_property(tdm_hwc *hwc, uint32_t id, tdm_value value)
{