add tdm_hwc_set_client_target_buffer_info 27/271227/2
authorChangyeon Lee <cyeon.lee@samsung.com>
Fri, 11 Feb 2022 09:10:25 +0000 (18:10 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Thu, 17 Feb 2022 12:00:02 +0000 (21:00 +0900)
Change-Id: I2d1e5b302cd15355e4869faf59802a77c5cf0ca5

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

index 92718f7..0772b7f 100644 (file)
@@ -978,6 +978,17 @@ tbm_surface_queue_h
 tdm_hwc_get_client_target_buffer_queue(tdm_hwc *hwc, tdm_error *error);
 
 /**
+ * @brief Set the information of the client target buffer
+ * @details This function lets the backend know information of the target.
+ * @param[in] hwc A output hwc
+ * @param[in] info The information
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ * @since 3.1.0
+ */
+tdm_error
+tdm_hwc_set_client_target_buffer_info(tdm_hwc *hwc, tdm_hwc_window_info *info);
+
+/**
  * @brief Set the client(relative to the TDM) target buffer
  * @details This function lets the backend know the target buffer.
  * The target buffer contains the result of the gl composition with the
index 078815c..e53eb10 100644 (file)
@@ -1024,6 +1024,14 @@ typedef struct _tdm_func_hwc {
         * @return #TDM_ERROR_NONE if success. Otherwise, error value.
         */
        tdm_error (*hwc_get_commit_interval)(tdm_hwc *hwc, tdm_hwc_commit_interval *interval);
+
+       /**
+        * @brief Set the information of the client target buffer
+        * @param[in] hwc A output hwc
+        * @param[in] info The information
+        * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+        */
+       tdm_error (*hwc_set_client_target_buffer_info)(tdm_hwc *hwc, tdm_hwc_window_info *info);
 } tdm_func_hwc;
 
 /**
index 11a7d5d..18fca9c 100644 (file)
@@ -521,6 +521,37 @@ tdm_hwc_get_client_target_buffer_queue(tdm_hwc *hwc, tdm_error *error)
 }
 
 EXTERN tdm_error
+tdm_hwc_set_client_target_buffer_info(tdm_hwc *hwc, tdm_hwc_window_info *info)
+{
+       tdm_private_module *private_module;
+       tdm_func_hwc *func_hwc = NULL;
+
+       HWC_FUNC_ENTRY();
+
+       _pthread_mutex_lock(&private_display->lock);
+
+       private_module = private_hwc->private_module;
+       func_hwc = &private_module->func_hwc;
+
+       if (private_module->use_hal_tdm) {
+               ret = (tdm_error)hal_tdm_hwc_set_client_target_buffer_info((hal_tdm_hwc *)private_hwc->hwc_backend, (hal_tdm_hwc_window_info *)info);
+       } else {
+               if (!func_hwc->hwc_set_client_target_buffer_info) {
+                       /* LCOV_EXCL_START */
+                       _pthread_mutex_unlock(&private_display->lock);
+                       return TDM_ERROR_NOT_IMPLEMENTED;
+                       /* LCOV_EXCL_STOP */
+               }
+
+               ret = func_hwc->hwc_set_client_target_buffer_info(private_hwc->hwc_backend, info);
+       }
+
+       _pthread_mutex_unlock(&private_display->lock);
+
+       return ret;
+}
+
+EXTERN tdm_error
 tdm_hwc_set_client_target_buffer(tdm_hwc *hwc, tbm_surface_h target_buffer, tdm_region damage)
 {
        tdm_private_module *private_module;