hwc: add properties for video hwc windows 40/162140/5
authorRoman Marchenko <r.marchenko@samsung.com>
Wed, 29 Nov 2017 08:34:45 +0000 (10:34 +0200)
committerBoram Park <boram1288.park@samsung.com>
Mon, 4 Dec 2017 05:38:13 +0000 (05:38 +0000)
 - tdm_hwc_window_video_get_available_properties
 - tdm_hwc_window_video_get_property
 - tdm_hwc_window_video_set_property

Change-Id: I5a1aed2dab3daee875569f9d1046ad51906c1163
Signed-off-by: Roman Marchenko <r.marchenko@samsung.com>
include/tdm.h
include/tdm_backend.h
src/tdm_hwc_window.c

index 18241c0..85c3226 100644 (file)
@@ -1039,6 +1039,39 @@ tdm_error
 tdm_hwc_window_unset_flags(tdm_hwc_window *hwc_window, tdm_hwc_window_flag flags);
 
 /**
+ * @brief Get the available property array  of a video hwc window object.
+ * @param[in] hwc window A video hwc window object
+ * @param[out] props The available property array
+ * @param[out] count The count of properties
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_hwc_window_video_get_available_properties(tdm_hwc_window *hwc_window,
+                                                                 const tdm_prop **props, int *count);
+
+/**
+ * @brief Get the property which has a given id.
+ * @param[in] hwc window A video hwc window object
+ * @param[in] id The property id
+ * @param[out] value The value
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_hwc_window_video_get_property(tdm_hwc_window *hwc_window, uint32_t id,
+                                                                 tdm_value *value);
+
+/**
+ * @brief Set the property which has a given id.
+ * @param[in] hwc window  A video hwc window object
+ * @param[in] id The property id
+ * @param[in] value The value
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_hwc_window_video_set_property(tdm_hwc_window *hwc_window, uint32_t id,
+                                                                 tdm_value value);
+
+/**
  * @brief Get the window video capability
  * @param[in] hwc_window A window object
  * @param[out] video_capability A hwc window video capability
index f189d43..6e96440 100644 (file)
@@ -914,6 +914,38 @@ typedef struct _tdm_func_window {
        tdm_error (*hwc_window_video_get_supported_format)(tdm_hwc_window *hwc_window,
                                                                                                           const tbm_format **formats,
                                                                                                           int *count);
+
+       /**
+        * @brief Get the available property array  of a video hwc window object.
+        * @param[in] hwc window A video hwc window object
+        * @param[out] props The available property array
+        * @param[out] count The count of properties
+        * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+        */
+       tdm_error (*hwc_window_video_get_available_properties)(
+                                                                                       tdm_hwc_window *hwc_window,
+                                                                                       const tdm_prop **props, int *count);
+
+       /**
+        * @brief Get the property which has a given id.
+        * @param[in] hwc window A video hwc window object
+        * @param[in] id The property id
+        * @param[out] value The value
+        * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+        */
+       tdm_error (*hwc_window_video_get_property)(tdm_hwc_window *hwc_window,
+                                                                                          uint32_t id, tdm_value *value);
+
+       /**
+        * @brief Set the property which has a given id.
+        * @param[in] hwc window  A video hwc window object
+        * @param[in] id The property id
+        * @param[in] value The value
+        * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+        */
+       tdm_error (*hwc_window_video_set_property)(tdm_hwc_window *hwc_window,
+                                                                                          uint32_t id, tdm_value value);
+
 } tdm_func_hwc_window;
 
 /**
index 3efe364..1166e5b 100644 (file)
@@ -482,3 +482,92 @@ tdm_hwc_window_video_get_supported_format(tdm_hwc_window *hwc_window,
 
        return ret;
 }
+
+EXTERN tdm_error
+tdm_hwc_window_video_get_available_properties(tdm_hwc_window *hwc_window,
+                                                                                         const tdm_prop **props, int *count)
+{
+       tdm_func_hwc_window *func_hwc_window = NULL;
+
+       HWC_WINDOW_FUNC_ENTRY();
+
+       TDM_RETURN_VAL_IF_FAIL(props != NULL, TDM_ERROR_INVALID_PARAMETER);
+       TDM_RETURN_VAL_IF_FAIL(count != NULL, TDM_ERROR_INVALID_PARAMETER);
+
+       _pthread_mutex_lock(&private_display->lock);
+
+       func_hwc_window = &private_display->func_hwc_window;
+
+       if (!func_hwc_window->hwc_window_video_get_available_properties) {
+               /* LCOV_EXCL_START */
+               _pthread_mutex_unlock(&private_display->lock);
+               TDM_ERR("not implemented!!");
+               return TDM_ERROR_NOT_IMPLEMENTED;
+               /* LCOV_EXCL_STOP */
+       }
+
+       ret = func_hwc_window->hwc_window_video_get_available_properties(private_hwc_window->hwc_window_backend,
+                                                                                                                                        props, count);
+
+       _pthread_mutex_unlock(&private_display->lock);
+
+       return ret;
+}
+
+EXTERN tdm_error
+tdm_hwc_window_video_get_property(tdm_hwc_window *hwc_window,
+                                                                       unsigned int id, tdm_value *value)
+{
+       tdm_func_hwc_window *func_hwc_window = NULL;
+
+       HWC_WINDOW_FUNC_ENTRY();
+
+       TDM_RETURN_VAL_IF_FAIL(value != NULL, TDM_ERROR_INVALID_PARAMETER);
+
+       _pthread_mutex_lock(&private_display->lock);
+
+       func_hwc_window = &private_display->func_hwc_window;
+
+       if (!func_hwc_window->hwc_window_video_get_property) {
+               /* LCOV_EXCL_START */
+               _pthread_mutex_unlock(&private_display->lock);
+               TDM_ERR("not implemented!!");
+               return TDM_ERROR_NOT_IMPLEMENTED;
+               /* LCOV_EXCL_STOP */
+       }
+
+       ret = func_hwc_window->hwc_window_video_get_property(private_hwc_window->hwc_window_backend,
+                                                                                                                id, value);
+
+       _pthread_mutex_unlock(&private_display->lock);
+
+       return ret;
+}
+
+EXTERN tdm_error
+tdm_hwc_window_video_set_property(tdm_hwc_window *hwc_window,
+                                                                       unsigned int id, tdm_value value)
+{
+       tdm_func_hwc_window *func_hwc_window = NULL;
+
+       HWC_WINDOW_FUNC_ENTRY();
+
+       _pthread_mutex_lock(&private_display->lock);
+
+       func_hwc_window = &private_display->func_hwc_window;
+
+       if (!func_hwc_window->hwc_window_video_set_property) {
+               /* LCOV_EXCL_START */
+               _pthread_mutex_unlock(&private_display->lock);
+               TDM_ERR("not implemented!!");
+               return TDM_ERROR_NOT_IMPLEMENTED;
+               /* LCOV_EXCL_STOP */
+       }
+
+       ret = func_hwc_window->hwc_window_video_set_property(private_hwc_window->hwc_window_backend,
+                                                                                                                id, value);
+
+       _pthread_mutex_unlock(&private_display->lock);
+
+       return ret;
+}