hwc: add tdm_hwc_get_property 05/200405/1
authorSooChan Lim <sc1.lim@samsung.com>
Sun, 24 Feb 2019 05:41:20 +0000 (14:41 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Sun, 24 Feb 2019 05:41:20 +0000 (14:41 +0900)
The user can get the property on the hwc object.

Change-Id: I7ac159c31ddb7532f5e76308969f7e0dc8ae5620

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

index 53aa7717988c34f3b2b5a159c7f555afe952e8b0..71f7a1cccd14c855c4e245d36a2cf6a0708b7017 100644 (file)
@@ -1039,6 +1039,16 @@ tdm_hwc_commit(tdm_hwc *hwc, int sync, tdm_hwc_commit_handler func, void *user_d
 tdm_error
 tdm_hwc_set_property(tdm_hwc *hwc, uint32_t id, tdm_value value);
 
+/**
+ * @brief Get the property which has a given id on the hwc object.
+ * @param[in] hwc A hwc object
+ * @param[in] id The property id
+ * @param[in] value The value of the propery id
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_hwc_get_property(tdm_hwc *hwc, uint32_t id, tdm_value *value);
+
 /**
  * @brief Destroys the given window.
  * @param[in] window the pointer of the window to destroy
index e89cd91fc99e47293f36a45c8125344fccb5456d..c5db80a936829d0941494e74f93f6a5df65d3774 100644 (file)
@@ -937,6 +937,15 @@ typedef struct _tdm_func_hwc {
         * @return #TDM_ERROR_NONE if success. Otherwise, error value.
         */
        tdm_error (*hwc_set_property)(tdm_hwc *hwc, uint32_t id, tdm_value value);
+
+       /**
+        * @brief Get the property which has a given id on the hwc object.
+        * @param[in] hwc A hwc object
+        * @param[in] id The property id
+        * @param[in] value The value of the propery id
+        * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+        */
+       tdm_error (*hwc_get_property)(tdm_hwc *hwc, uint32_t id, tdm_value *value);
 } tdm_func_hwc;
 
 /**
index b9029be9b9fe1a78e0615ed05ad0a7598ee74045..0589bc12e7b8f06c3455f7a93ae4dd2ae27a8a79 100644 (file)
@@ -634,3 +634,31 @@ tdm_hwc_set_property(tdm_hwc *hwc, uint32_t id, tdm_value value)
 
        return ret;
 }
+
+tdm_error
+tdm_hwc_get_property(tdm_hwc *hwc, uint32_t id, tdm_value *value)
+{
+       tdm_private_module *private_module;
+       tdm_func_hwc *func_hwc = NULL;
+
+       HWC_FUNC_ENTRY();
+
+       _pthread_mutex_lock(&private_display->lock);
+
+       private_module = private_hwc->private_module;
+       func_hwc = &private_module->func_hwc;
+
+       if (!func_hwc->hwc_get_property) {
+               /* LCOV_EXCL_START */
+               _pthread_mutex_unlock(&private_display->lock);
+               TDM_WRN("not implemented!!");
+               return TDM_ERROR_NOT_IMPLEMENTED;
+               /* LCOV_EXCL_STOP */
+       }
+
+       ret = func_hwc->hwc_get_property(private_hwc->hwc_backend, id, value);
+
+       _pthread_mutex_unlock(&private_display->lock);
+
+       return ret;
+}