From 84fc1350df874f4b8c684723279972a88af39e83 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Mon, 12 Feb 2018 10:37:22 +0900 Subject: [PATCH] hwc: add tdm_output_hwc_unset_client_target_buffer Change-Id: I1ba5f4dc3b2d547fd1ceee1ea01cebb1747e109d --- include/tdm.h | 10 ++++++++++ include/tdm_backend.h | 9 +++++++++ src/tdm_output.c | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) diff --git a/include/tdm.h b/include/tdm.h index 7be0a14..e317832 100644 --- a/include/tdm.h +++ b/include/tdm.h @@ -635,6 +635,16 @@ tdm_error tdm_output_hwc_set_client_target_buffer(tdm_output *output, tbm_surface_h target_buffer, tdm_hwc_region damage); /** + * @brief Unset the client(relative to the TDM) target buffer + * @details TODO + * @param[in] output A output object + * @return #TDM_ERROR_NONE if success. Otherwise, error value. + * @since 2.0.0 + */ +tdm_error +tdm_output_hwc_unset_client_target_buffer(tdm_output *output); + +/** * @brief Validate the output * @details Instructs the device to inspect all of the layer state and * determine if there are any composition type changes necessary before diff --git a/include/tdm_backend.h b/include/tdm_backend.h index a3bd3b3..f3e21d6 100644 --- a/include/tdm_backend.h +++ b/include/tdm_backend.h @@ -595,6 +595,15 @@ typedef struct _tdm_func_output { tdm_error (*output_hwc_set_client_target_buffer)(tdm_output *output, tbm_surface_h target_buffer, tdm_hwc_region damage); /** + * @brief Unset the client(relative to the TDM) target buffer + * @details TODO + * @param[in] output A output object + * @return #TDM_ERROR_NONE if success. Otherwise, error value. + * @since 2.0.0 + */ + tdm_error (*output_hwc_unset_client_target_buffer)(tdm_output *output); + + /** * @brief Validate the output * @details Instructs the device to inspect all of the layer state and * determine if there are any composition type changes necessary before diff --git a/src/tdm_output.c b/src/tdm_output.c index 63fe459..e5edf93 100644 --- a/src/tdm_output.c +++ b/src/tdm_output.c @@ -1826,6 +1826,38 @@ tdm_output_hwc_set_client_target_buffer(tdm_output *output, tbm_surface_h target return ret; } +EXTERN tdm_error +tdm_output_hwc_unset_client_target_buffer(tdm_output *output) +{ + tdm_func_output *func_output = NULL; + + OUTPUT_FUNC_ENTRY(); + + _pthread_mutex_lock(&private_display->lock); + + if (!(private_output->caps.capabilities & TDM_OUTPUT_CAPABILITY_HWC)) { + TDM_ERR("output(%p) not support HWC", private_output); + _pthread_mutex_unlock(&private_display->lock); + return TDM_ERROR_BAD_REQUEST; + } + + func_output = &private_display->func_output; + + if (!func_output->output_hwc_unset_client_target_buffer) { + /* LCOV_EXCL_START */ + _pthread_mutex_unlock(&private_display->lock); + TDM_ERR("not implemented!!"); + return TDM_ERROR_NOT_IMPLEMENTED; + /* LCOV_EXCL_STOP */ + } + + ret = func_output->output_hwc_unset_client_target_buffer(private_output->output_backend); + + _pthread_mutex_unlock(&private_display->lock); + + return ret; +} + tdm_error tdm_output_hwc_get_video_supported_formats(tdm_output *output, const tbm_format **formats, int *count) -- 2.7.4