add tdm_hwc_window_set_name
authorSooChan Lim <sc1.lim@samsung.com>
Thu, 29 Nov 2018 00:51:29 +0000 (09:51 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Thu, 29 Nov 2018 04:07:58 +0000 (13:07 +0900)
Change-Id: I496365a3babeb3e754166e1e1a5c95de124ab15d

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

index ab9197c..8b74b0e 100644 (file)
@@ -1153,6 +1153,15 @@ tdm_error
 tdm_hwc_window_get_constraints(tdm_hwc_window *hwc_window, int *constraints);
 
 /**
+ * @brief Set the name of hwc_window
+ * @param[in] hwc_window A hwc window object
+ * @param[in] name of the hwc_window
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_hwc_window_set_name(tdm_hwc_window *hwc_window, const char *name);
+
+/**
  * @brief Destroy a pp object
  * @param[in] pp A pp object
  * @see tdm_display_create_pp
index 40390c3..1b73ba9 100644 (file)
@@ -1047,6 +1047,15 @@ typedef struct _tdm_func_hwc_window {
         */
        tdm_error (*hwc_window_get_constraints)(tdm_hwc_window *hwc_window,
                                                                                                int *constraints);
+
+       /**
+        * @brief Set the name of hwc_window
+        * @param[in] hwc_window A hwc window object
+        * @param[in] name of the hwc_window
+        * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+        */
+       tdm_error (*hwc_window_set_name)(tdm_hwc_window *hwc_window,
+                                                                                               const char *name);
 } tdm_func_hwc_window;
 
 /**
index 9248ff5..fd86345 100644 (file)
@@ -467,4 +467,30 @@ tdm_hwc_window_get_constraints(tdm_hwc_window *hwc_window, int *constraints)
 
        return ret;
 }
+
+EXTERN tdm_error
+tdm_hwc_window_set_name(tdm_hwc_window *hwc_window, const char *name)
+{
+       tdm_private_module *private_module;
+       tdm_func_hwc_window *func_hwc_window = NULL;
+
+       HWC_WINDOW_FUNC_ENTRY();
+
+       _pthread_mutex_lock(&private_display->lock);
+
+       private_module = private_output->private_module;
+       func_hwc_window = &private_module->func_hwc_window;
+
+       if (!func_hwc_window->hwc_window_get_constraints) {
+               _pthread_mutex_unlock(&private_display->lock);
+               TDM_WRN("not implemented!!");
+               return TDM_ERROR_NOT_IMPLEMENTED;
+       }
+
+       ret = func_hwc_window->hwc_window_set_name(private_hwc_window->hwc_window_backend, name);
+
+       _pthread_mutex_unlock(&private_display->lock);
+
+       return ret;
+}
 /* LCOV_EXCL_STOP */
\ No newline at end of file