This function set the mirro image of the src_output to the output.
If there is the hardware or the implementation to display the mirror image
of the src_output to the output, the backend does it in this function.
Change-Id: Ic661793af90ce4d87684d1f0bbcb14a5052e2585
tdm_output_get_hwc(tdm_output *output, tdm_error *error);
/**
+ * @brief Set the mirror image of the src_output to the output
+ * @param[in] output A output object to display the src_output image
+ * @param[in] src_output A src output object of which image is displayed on the output
+ * @param[in] transform A transform value
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_output_set_mirror(tdm_output *output, tdm_output *src_output, tdm_transform transform);
+
+/**
* @brief Get a output object of a layer object
* @param[in] layer A layer object
* @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
*/
tdm_hwc *(*output_get_hwc)(tdm_output *output, tdm_error *error);
- void (*reserved3)(void);
+ /**
+ * @brief Set the mirror image of the src_output to the output
+ * @details This function set the mirro image of the src_output to the output.
+ * If there is the hardware or the implementation to display the mirror image
+ * of the src_output to the output, the backend does it in this function.
+ * If the backend output gets the ability of the mirror displaying, it has to
+ * set the TDM_OUTPUT_CAPABILITY_MIRROR on the output capability.
+ * @param[in] output A output object to display the src_output image
+ * @param[in] src_output A src output object of which image is displayed on the output
+ * @param[in] transform A transform value
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ * @see #TDM_OUTPUT_CAPABILITY_MIRROR
+ */
+ tdm_error (*output_set_mirror)(tdm_output *output,
+ tdm_output *src_output,
+ tdm_transform transform);
+
void (*reserved4)(void);
void (*reserved5)(void);
void (*reserved6)(void);
return private_hwc;
}
+EXTERN tdm_error
+tdm_output_set_mirror(tdm_output *output, tdm_output *src_output, tdm_transform transform)
+{
+ /* LCOV_EXCL_START */
+ tdm_private_module *private_module;
+ tdm_func_output *func_output;
+ tdm_private_output *private_src_output;
+
+ OUTPUT_FUNC_ENTRY();
+
+ TDM_RETURN_VAL_IF_FAIL(src_output != NULL, TDM_ERROR_INVALID_PARAMETER);
+
+ _pthread_mutex_lock(&private_display->lock);
+
+ private_module = private_output->private_module;
+ func_output = &private_module->func_output;
+ private_src_output = (tdm_private_output*)src_output;
+
+ if (!(private_output->caps.capabilities & TDM_OUTPUT_CAPABILITY_MIRROR)) {
+ TDM_INFO("output(%d) doesn't support the mirror.", private_output->pipe);
+ _pthread_mutex_unlock(&private_display->lock);
+ return TDM_ERROR_BAD_REQUEST;
+ }
+
+ if (!func_output->output_set_mirror) {
+ TDM_WRN("not implemented!!");
+ _pthread_mutex_unlock(&private_display->lock);
+ return TDM_ERROR_NOT_IMPLEMENTED;
+ }
+
+ ret = func_output->output_set_mirror(private_output->output_backend,
+ private_src_output->output_backend,
+ transform);
+ if (ret != TDM_ERROR_NONE) {
+ TDM_ERR("output(%p) fails to set MIRROR.", private_output);
+ _pthread_mutex_unlock(&private_display->lock);
+ return TDM_ERROR_BAD_REQUEST;
+ }
+
+ _pthread_mutex_unlock(&private_display->lock);
+
+ /* LCOV_EXCL_STOP */
+
+ return ret;
+}
+
INTERN tdm_error
tdm_output_choose_commit_per_vblank_mode(tdm_private_output *private_output, int mode)
{