added tdm_hwc_get_video_capability 19/185219/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Thu, 19 Jul 2018 11:35:05 +0000 (20:35 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Thu, 19 Jul 2018 11:35:05 +0000 (20:35 +0900)
Change-Id: I0bfff03716453a5e1b2b903bb55628e831c865dc

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

index 1568ea1..acd3a45 100644 (file)
@@ -836,6 +836,15 @@ tdm_hwc_get_video_supported_formats(tdm_hwc *hwc, const tbm_format **formats,
                                                                int *count);
 
 /**
+ * @brief Get the hwc video capability
+ * @param[in] hwc A hwc object
+ * @param[out] video_capability A hwc video capability
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_hwc_get_video_capability(tdm_hwc *hwc, tdm_hwc_video_capability *video_capability);
+
+/**
  * @brief Get the available property array  of a hwc object.
  * @param[in] hwc A hwc
  * @param[out] props The available property array
index 4949d1e..d614fff 100644 (file)
@@ -702,7 +702,14 @@ typedef struct _tdm_func_hwc {
         */
        tdm_error (*hwc_get_video_supported_formats)(tdm_hwc *hwc, const tbm_format **formats,
                                                                                int *count);
-
+       /**
+        * @brief Get the hwc video capability
+        * @param[in] hwc A hwc object
+        * @param[out] video_capability A hwc hwc video capability
+        * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+        */
+       tdm_error (*hwc_get_video_capability)(tdm_hwc *hwc,
+                                                       tdm_hwc_video_capability *video_capability);
 
        /**
         * @brief Get the available property array  of a hwc object.
index 328f837..9492394 100644 (file)
@@ -258,6 +258,16 @@ typedef enum {
        TDM_OUTPUT_MODE_FLAG_CLKDIV2    = (1 << 13),
 } tdm_output_mode_flag;
 
+/*
+ * @brief The hwc video capability enumeration
+ * @since 2.0.0
+ */
+typedef enum {
+       TDM_HWC_VIDEO_CAPABILITY_SCALE          = (1 << 1), /**< if a hwc  video has scale capability  */
+       TDM_HWC_VIDEO_CAPABILITY_TRANSFORM      = (1 << 2), /**< if a hwc  video has transform capability  */
+       TDM_HWC_VIDEO_CAPABILITY_SCANOUT        = (1 << 3), /**< if a  video allows a scanout buffer only */
+} tdm_hwc_video_capability;
+
 /**
  * @brief The size structure
  */
index b4df1c0..49d4ca9 100644 (file)
@@ -209,6 +209,34 @@ tdm_hwc_get_video_supported_formats(tdm_hwc *hwc, const tbm_format **formats, in
 }
 
 EXTERN tdm_error
+tdm_hwc_get_video_capability(tdm_hwc *hwc,
+                                                       tdm_hwc_video_capability *video_capability)
+{
+       tdm_private_module *private_module;
+       tdm_func_hwc *func_hwc;
+
+       HWC_FUNC_ENTRY();
+
+       _pthread_mutex_lock(&private_display->lock);
+
+       private_module = private_output->private_module;
+       func_hwc = &private_module->func_hwc;
+
+       if (!func_hwc->hwc_get_video_capability) {
+               _pthread_mutex_unlock(&private_display->lock);
+               TDM_WRN("not implemented!!");
+               return TDM_ERROR_NOT_IMPLEMENTED;
+       }
+
+       ret = func_hwc->hwc_get_video_capability(private_hwc->hwc_backend,
+                                                                                       video_capability);
+
+       _pthread_mutex_unlock(&private_display->lock);
+
+       return ret;
+}
+
+EXTERN tdm_error
 tdm_hwc_get_available_properties(tdm_hwc *hwc, const tdm_prop **props, int *count)
 {
        tdm_private_module *private_module;