[hwc] add the support of the TDM_COMPOSITION_VIDEO type 62/153762/1
authorKonstantin Drabeniuk <k.drabeniuk@samsung.com>
Fri, 29 Sep 2017 10:10:58 +0000 (13:10 +0300)
committerKonstantin Drabeniuk <k.drabeniuk@samsung.com>
Fri, 29 Sep 2017 10:10:58 +0000 (13:10 +0300)
Change-Id: I3f9639a1ca3316b10d79b32eb7ad04a158d36d8f
Signed-off-by: Konstantin Drabeniuk <k.drabeniuk@samsung.com>
include/tdm.h
include/tdm_backend.h
include/tdm_common.h
src/tdm_hwc_window.c

index d3be658..b7fb89e 100644 (file)
@@ -1008,6 +1008,28 @@ tdm_error
 tdm_hwc_window_unset_flags(tdm_hwc_window *hwc_window, tdm_hwc_window_flag flags);
 
 /**
+ * @brief Get the window video capability
+ * @param[in] hwc_window A window object
+ * @param[out] video_capability A hwc window video capability
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_hwc_window_video_get_capability(tdm_hwc_window *hwc_window,
+                                                                       tdm_hwc_window_video_capability *video_capability);
+
+/**
+ * @brief Get the window video supported format
+ * @param[in] hwc_window A window object
+ * @param[out] formats A hwc window supported formats
+ * @param[out] count A number of the hwc window supported formats
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_hwc_window_video_get_supported_format(tdm_hwc_window *hwc_window,
+                                                                                 const tbm_format **formats,
+                                                                                 int *count);
+
+/**
  * @brief Destroy a pp object
  * @param[in] pp A pp object
  * @see tdm_display_create_pp
index 719bd07..6411f61 100644 (file)
@@ -885,6 +885,26 @@ typedef struct _tdm_func_window {
         */
        tdm_error (*hwc_window_unset_flags)(tdm_hwc_window *hwc_window,
                                                                                tdm_hwc_window_flag flags);
+
+       /**
+        * @brief Get the window video capability
+        * @param[in] hwc_window A window object
+        * @param[out] video_capability A hwc window video capability
+        * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+        */
+       tdm_error (*hwc_window_video_get_capability)(tdm_hwc_window *hwc_window,
+                                                                                               tdm_hwc_window_video_capability *video_capability);
+
+       /**
+        * @brief Get the window video supported format
+        * @param[in] hwc_window A window object
+        * @param[out] formats A hwc window supported formats
+        * @param[out] count A number of the hwc window supported formats
+        * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+        */
+       tdm_error (*hwc_window_video_get_supported_format)(tdm_hwc_window *hwc_window,
+                                                                                                          const tbm_format **formats,
+                                                                                                          int *count);
 } tdm_func_hwc_window;
 
 /**
index 39e7840..f1f1482 100644 (file)
@@ -129,6 +129,12 @@ typedef enum {
        TDM_LAYER_CAPABILITY_NO_CROP        = (1 << 12), /**< if a layer has no cropping capability */
 } tdm_layer_capability;
 
+typedef enum {
+       TDM_HWC_WINDOW_VIDEO_CAPABILITY_SCALE          = (1 << 1), /**< if a hwc window video has scale capability  */
+       TDM_HWC_WINDOW_VIDEO_CAPABILITY_TRANSFORM      = (1 << 2), /**< if a hwc window video has transform capability  */
+       TDM_HWC_WINDOW_VIDEO_CAPABILITY_SCANOUT        = (1 << 3), /**< if a hwc_window video allows a scanout buffer only */
+} tdm_hwc_window_video_capability;
+
 /**
  * @brief The pp capability enumeration
  */
index e35574a..477ddf2 100644 (file)
@@ -387,3 +387,56 @@ tdm_hwc_window_unset_flags(tdm_hwc_window *hwc_window, tdm_hwc_window_flag flags
 
        return ret;
 }
+
+EXTERN tdm_error
+tdm_hwc_window_video_get_capability(tdm_hwc_window *hwc_window,
+                                                                       tdm_hwc_window_video_capability *video_capability)
+{
+       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_get_capability) {
+               _pthread_mutex_unlock(&private_display->lock);
+               TDM_ERR("not implemented!!");
+               return TDM_ERROR_NOT_IMPLEMENTED;
+       }
+
+       ret = func_hwc_window->hwc_window_video_get_capability(private_hwc_window->hwc_window_backend,
+                                                                                                                  video_capability);
+
+       _pthread_mutex_unlock(&private_display->lock);
+
+       return ret;
+}
+
+EXTERN tdm_error
+tdm_hwc_window_video_get_supported_format(tdm_hwc_window *hwc_window,
+                                                                                 const tbm_format **formats,
+                                                                                 int *count)
+{
+       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_get_supported_format) {
+               _pthread_mutex_unlock(&private_display->lock);
+               TDM_ERR("not implemented!!");
+               return TDM_ERROR_NOT_IMPLEMENTED;
+       }
+
+       ret = func_hwc_window->hwc_window_video_get_supported_format(private_hwc_window->hwc_window_backend,
+                                                                                                                                formats, count);
+
+       _pthread_mutex_unlock(&private_display->lock);
+
+       return ret;
+}