hwc_window: tdm_hwc_window_get_preparation_types 37/186437/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Tue, 24 Jul 2018 11:19:08 +0000 (20:19 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Fri, 27 Jul 2018 10:20:16 +0000 (19:20 +0900)
Change-Id: I977b322aaedf140ea0aa58342867ab58a0f73dad

include/tdm.h
include/tdm_backend.h
include/tdm_types.h
src/tdm_hwc_window.c

index acd3a453a14f7c2ad0b6d75634bf0cae7eff738c..fae93080788062d67972f23a729937ca83a17517 100644 (file)
@@ -1088,6 +1088,16 @@ tdm_hwc_window_get_property(tdm_hwc_window *hwc_window, uint32_t id, tdm_value *
 tdm_error
 tdm_hwc_window_set_property(tdm_hwc_window *hwc_window, uint32_t id, tdm_value value);
 
+/**
+ * @brief Get the preperation type of hwc_window
+ * @param[in] hwc window A hwc window object
+ * @param[out] preperation_types The tdm_hwc_window_preparation types
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_hwc_window_get_preparation_types(tdm_hwc_window *hwc_window,
+                                                                       int *preparation_types);
+
 /**
  * @brief Destroy a pp object
  * @param[in] pp A pp object
index d614fffeca7fb0cb8055944d2f7b8ed416b9b808..0b5829c64537c03c9702b85cbb9b48c4bddc4359 100644 (file)
@@ -960,6 +960,15 @@ typedef struct _tdm_func_hwc_window {
         */
        tdm_error (*hwc_window_get_property)(tdm_hwc_window *hwc_window,
                                                                                 uint32_t id, tdm_value *value);
+
+       /**
+        * @brief Get the preperation type of hwc_window
+        * @param[in] hwc window A hwc window object
+        * @param[out] preperation_types The tdm_hwc_window_preparation types
+        * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+        */
+       tdm_error (*hwc_window_get_preparation_types)(tdm_hwc_window *hwc_window,
+                                                                                               int *preperation_types);
 } tdm_func_hwc_window;
 
 /**
index 1a494f6841b3fd970f9ee4ceb449715f8da74c9b..c596ac672986ad97f57fd09ee6eceeec6d754bc0 100644 (file)
@@ -205,6 +205,16 @@ typedef enum {
        TDM_COMPOSITION_VIDEO = 5,
 } tdm_hwc_window_composition;
 
+typedef enum {
+       TDM_PREPARATION_NONE = 0,
+       /** If the client needs to render to a specific buffer for compositing
+        *  with TDM_COMPOSITION_DEVICE, Set TDM_PREPARATION_BUFFER_QUEUE type to hwc_window.
+        *  The client will render next frame on buffers of queue which got by
+        *  tdm_hwc_window_get_buffer_queue.
+        */
+       TDM_PREPARATION_BUFFER_QUEUE = (1 << 0),
+} tdm_hwc_window_preparation;
+
 /**
  * @brief The hwc window flag enumeration
  * @since 2.0.0
index 78df88dbf59d502ff76d9d07dc763b2e0c7f17a6..31e62ad65c3258fa63daeced398d6c86d246780f 100644 (file)
@@ -403,4 +403,31 @@ tdm_hwc_window_set_property(tdm_hwc_window *hwc_window, unsigned int id, tdm_val
 
        return ret;
 }
+
+EXTERN tdm_error
+tdm_hwc_window_get_preparation_types(tdm_hwc_window *hwc_window,
+                                                                        int *preparation_types)
+{
+       tdm_private_module *private_module;
+       tdm_func_hwc_window *func_hwc_window = NULL;
+
+       HWC_WINDOW_FUNC_ENTRY();
+
+       _pthread_mutex_lock(&private_display->lock);
+
+       private_module = private_output->private_module;
+       func_hwc_window = &private_module->func_hwc_window;
+
+       if (!func_hwc_window->hwc_window_get_preparation_types) {
+               _pthread_mutex_unlock(&private_display->lock);
+               TDM_WRN("not implemented!!");
+               return TDM_ERROR_NOT_IMPLEMENTED;
+       }
+
+       ret = func_hwc_window->hwc_window_get_preparation_types(private_hwc_window->hwc_window_backend, preparation_types);
+
+       _pthread_mutex_unlock(&private_display->lock);
+
+       return ret;
+}
 /* LCOV_EXCL_STOP */
\ No newline at end of file