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 92718f7c07e5133b5c24fa0a3f9c8698113fb598..0772b7fb0a3038d1cfcd62f562b50f640f03834a 100644 (file)
@@ -977,6 +977,17 @@ tdm_hwc_get_available_properties(tdm_hwc *hwc, const tdm_prop **props, int *coun
 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.
index 078815c75c83797acb5561db9ee4a04ce18a575f..e53eb10ceb32a8fe1ad626b33ab736a6873ef848 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 11a7d5dac302733f4fb70c0d1f4b9e1518fdb172..18fca9c5ce916f980889b6cd65f6291263d25244 100644 (file)
@@ -520,6 +520,37 @@ tdm_hwc_get_client_target_buffer_queue(tdm_hwc *hwc, tdm_error *error)
        return queue;
 }
 
+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)
 {