hwc: add tdm_output_hwc_unset_client_target_buffer 84/169884/2
authorSooChan Lim <sc1.lim@samsung.com>
Mon, 12 Feb 2018 01:37:22 +0000 (10:37 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Mon, 12 Feb 2018 06:55:08 +0000 (06:55 +0000)
Change-Id: I1ba5f4dc3b2d547fd1ceee1ea01cebb1747e109d

include/tdm.h
include/tdm_backend.h
src/tdm_output.c

index 7be0a14..e317832 100644 (file)
@@ -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
index a3bd3b3..f3e21d6 100644 (file)
@@ -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
index 63fe459..e5edf93 100644 (file)
@@ -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)