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 1568ea17282daa9f98eec9431dbb9b004c74dd84..acd3a453a14f7c2ad0b6d75634bf0cae7eff738c 100644 (file)
@@ -835,6 +835,15 @@ tdm_error
 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
index 4949d1e38edef11bdb9c8e0eeae30ad1f7bb8906..d614fffeca7fb0cb8055944d2f7b8ed416b9b808 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 328f837c05724767e12ccbde20ebd86db59cac42..9492394b1c4536ad8acd67ab4d453894a91f9845 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 b4df1c03083393d3f4dab8713a224d11018ff82d..49d4ca9c77c3fb79d2f60f989309dc7b196a8686 100644 (file)
@@ -208,6 +208,34 @@ tdm_hwc_get_video_supported_formats(tdm_hwc *hwc, const tbm_format **formats, in
        return ret;
 }
 
+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)
 {