hwc_window: add flags 76/148576/1
authorKonstantin Drabeniuk <k.drabeniuk@samsung.com>
Fri, 8 Sep 2017 06:51:42 +0000 (09:51 +0300)
committerKonstantin Drabeniuk <k.drabeniuk@samsung.com>
Fri, 8 Sep 2017 06:51:42 +0000 (09:51 +0300)
Change-Id: I51e3cb8ac46189a66ced6783a2335ed29999123f
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 d10b691..47180b9 100644 (file)
@@ -965,7 +965,7 @@ tdm_hwc_window_set_info(tdm_hwc_window *hwc_window, tdm_hwc_window_info *info);
  * @brief Set a TBM buffer to a window object
  * @details A TBM buffer will be applied when the output object of a layer
  * object is committed.
- * @param[in] hwc_window A layer object
+ * @param[in] hwc_window A window object
  * @param[in] buffer A TDM buffer
  * @return #TDM_ERROR_NONE if success. Otherwise, error value.
  */
@@ -973,6 +973,24 @@ tdm_error
 tdm_hwc_window_set_buffer(tdm_hwc_window *hwc_window, tbm_surface_h buffer);
 
 /**
+ * @brief Set a flags to a window object
+ * @param[in] hwc_window A window object
+ * @param[in] flags A hwc_window flags
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_hwc_window_set_flags(tdm_hwc_window *hwc_window, tdm_hwc_window_flag flags);
+
+/**
+ * @brief Unset a flags from a window object
+ * @param[in] hwc_window A window object
+ * @param[in] flags A hwc_window flags
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_hwc_window_unset_flags(tdm_hwc_window *hwc_window, tdm_hwc_window_flag flags);
+
+/**
  * @brief Destroy a pp object
  * @param[in] pp A pp object
  * @see tdm_display_create_pp
index 490bef2..1e5c362 100644 (file)
@@ -837,12 +837,30 @@ typedef struct _tdm_func_window {
         * @brief Set a TDM buffer to a window object
         * @details A TDM buffer will be applied when the output object
         * of a layer object is committed.
-        * @param[in] hwc_window A layer object
+        * @param[in] hwc_window A window object
         * @param[in] buffer A TDM buffer
         * @return #TDM_ERROR_NONE if success. Otherwise, error value.
         */
        tdm_error (*hwc_window_set_buffer)(tdm_hwc_window *hwc_window,
                                                                           tbm_surface_h buffer);
+
+       /**
+        * @brief Set a flags to a window object
+        * @param[in] hwc_window A window object
+        * @param[in] flags A hwc_window flags
+        * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+        */
+       tdm_error (*hwc_window_set_flags)(tdm_hwc_window *hwc_window,
+                                                                         tdm_hwc_window_flag flags);
+
+       /**
+        * @brief Unset a flags from a window object
+        * @param[in] hwc_window A window object
+        * @param[in] flags A hwc_window flags
+        * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+        */
+       tdm_error (*hwc_window_unset_flags)(tdm_hwc_window *hwc_window,
+                                                                               tdm_hwc_window_flag flags);
 } tdm_func_hwc_window;
 
 /**
index d7a10b5..7df7ed7 100644 (file)
@@ -289,6 +289,13 @@ typedef union {
        uint64_t u64;
 } tdm_value;
 
+/**
+ * @brief The hwc window flag enumeration
+ */
+typedef enum {
+       TDM_HWC_WINDOW_FLAG_SKIP     = (1 << 0),
+} tdm_hwc_window_flag;
+
 #ifdef __cplusplus
 }
 #endif
index ca64d65..e35574a 100644 (file)
@@ -339,3 +339,51 @@ tdm_hwc_window_destroy_internal(tdm_private_hwc_window * private_hwc_window)
        free(private_hwc_window);
        return TDM_ERROR_NONE;
 }
+
+EXTERN tdm_error
+tdm_hwc_window_set_flags(tdm_hwc_window *hwc_window, tdm_hwc_window_flag flags)
+{
+       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_set_flags) {
+               _pthread_mutex_unlock(&private_display->lock);
+               TDM_ERR("not implemented!!");
+               return TDM_ERROR_NOT_IMPLEMENTED;
+       }
+
+       ret = func_hwc_window->hwc_window_set_flags(private_hwc_window->hwc_window_backend, flags);
+
+       _pthread_mutex_unlock(&private_display->lock);
+
+       return ret;
+}
+
+EXTERN tdm_error
+tdm_hwc_window_unset_flags(tdm_hwc_window *hwc_window, tdm_hwc_window_flag flags)
+{
+       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_unset_flags) {
+               _pthread_mutex_unlock(&private_display->lock);
+               TDM_ERR("not implemented!!");
+               return TDM_ERROR_NOT_IMPLEMENTED;
+       }
+
+       ret = func_hwc_window->hwc_window_unset_flags(private_hwc_window->hwc_window_backend, flags);
+
+       _pthread_mutex_unlock(&private_display->lock);
+
+       return ret;
+}