add tdm_display_get_capture_available_size & tdm_display_get_max_layer_count 60/99460/3
authorBoram Park <boram1288.park@samsung.com>
Wed, 23 Nov 2016 02:44:19 +0000 (11:44 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Fri, 25 Nov 2016 07:49:31 +0000 (23:49 -0800)
Change-Id: I3d3507ef1e3a590422032c35ee1f5c3adc7f2a44

include/tdm.h
src/tdm_display.c

index 7834591..15b1f56 100644 (file)
@@ -203,6 +203,31 @@ tdm_display_get_catpure_available_formats(tdm_display *dpy,
                                                                                  const tbm_format **formats, int *count);
 
 /**
+ * @brief Get the capture available size of a display object.
+ * @details -1 means that a TDM backend module doesn't define the value.
+ * @param[in] dpy A display object
+ * @param[out] min_w The minimum width which TDM can handle
+ * @param[out] min_h The minimum height which TDM can handle
+ * @param[out] max_w The maximum width which TDM can handle
+ * @param[out] max_h The maximum height which TDM can handle
+ * @param[out] preferred_align The preferred align width which TDM can handle
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_display_get_capture_available_size(tdm_display *dpy, int *min_w, int *min_h,
+                                                                          int *max_w, int *max_h, int *preferred_align);
+
+/**
+ * @brief Get the max layer counts which a display object can show on screen.
+ * @details -1 means that a TDM backend module doesn't define the value.
+ * @param[in] dpy A display object
+ * @param[out] count The max count of layers
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_display_get_max_layer_count(tdm_display *dpy, int *max_count);
+
+/**
  * @brief Get the output counts which a display object has.
  * @param[in] dpy A display object
  * @param[out] count The count of outputs
index 975e72f..d240d97 100644 (file)
@@ -246,6 +246,52 @@ tdm_display_get_catpure_available_formats(tdm_display *dpy,
 }
 
 EXTERN tdm_error
+tdm_display_get_capture_available_size(tdm_display *dpy, int *min_w, int *min_h,
+                                                                          int *max_w, int *max_h, int *preferred_align)
+{
+       DISPLAY_FUNC_ENTRY();
+
+       _pthread_mutex_lock(&private_display->lock);
+
+       if (!(private_display->capabilities & TDM_DISPLAY_CAPABILITY_CAPTURE)) {
+               TDM_ERR("no capture capability");
+               _pthread_mutex_unlock(&private_display->lock);
+               return TDM_ERROR_NO_CAPABILITY;
+       }
+
+       if (min_w)
+               *min_w = private_display->caps_capture.min_w;
+       if (min_h)
+               *min_h = private_display->caps_capture.min_h;
+       if (max_w)
+               *max_w = private_display->caps_capture.max_w;
+       if (max_h)
+               *max_h = private_display->caps_capture.max_h;
+       if (preferred_align)
+               *preferred_align = private_display->caps_capture.preferred_align;
+
+       _pthread_mutex_unlock(&private_display->lock);
+
+       return ret;
+}
+
+EXTERN tdm_error
+tdm_display_get_max_layer_count(tdm_display *dpy, int *max_count)
+{
+       DISPLAY_FUNC_ENTRY();
+
+       TDM_RETURN_VAL_IF_FAIL(max_count != NULL, TDM_ERROR_INVALID_PARAMETER);
+
+       _pthread_mutex_lock(&private_display->lock);
+
+       *max_count = private_display->caps_display.max_layer_count;
+
+       _pthread_mutex_unlock(&private_display->lock);
+
+       return ret;
+}
+
+EXTERN tdm_error
 tdm_display_get_output_count(tdm_display *dpy, int *count)
 {
        tdm_private_output *private_output = NULL;