Added cursor available size in caps output 43/98343/6
authorChangyeon Lee <cyeon.lee@samsung.com>
Tue, 15 Nov 2016 05:33:53 +0000 (14:33 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Tue, 22 Nov 2016 05:04:48 +0000 (14:04 +0900)
Change-Id: Ief1b42e61b51ba4710430f68b40e48bc3b189844

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

index ee7b160..7834591 100644 (file)
@@ -358,6 +358,21 @@ tdm_output_get_available_size(tdm_output *output, int *min_w, int *min_h,
                                                          int *max_w, int *max_h, int *preferred_align);
 
 /**
+ * @brief Get the available cursor size of a output object.
+ * @details -1 means that a TDM backend module doesn't define the value.
+ * @param[in] output A output 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_output_get_cursor_available_size(tdm_output *output, int *min_w, int *min_h,
+                                                                        int *max_w, int *max_h, int *preferred_align);
+
+/**
  * @brief Get the physical size of a output object.
  * @param[in] output A output object
  * @param[out] mmWidth The milimeter width
index c1c2120..91ee955 100644 (file)
@@ -119,6 +119,12 @@ typedef struct _tdm_caps_output {
        int preferred_align;    /**< The prefered align. -1 means "not defined" */
 
        tdm_output_capability capabilities;  /**< The capabilities of output. @since 1.4.1 */
+
+       int cursor_min_w;              /**< The minimun width. -1 means "not defined"  @since 1.5.0 */
+       int cursor_min_h;              /**< The minimun height. -1 means "not defined" @since 1.5.0 */
+       int cursor_max_w;              /**< The maximum width. -1 means "not defined" @since 1.5.0 */
+       int cursor_max_h;              /**< The maximum height. -1 means "not defined" @since 1.5.0 */
+       int cursor_preferred_align;    /**< The prefered align. -1 means "not defined" @since 1.5.0 */
 } tdm_caps_output;
 
 /**
index 7d9b08f..975e72f 100644 (file)
@@ -714,6 +714,48 @@ tdm_output_get_available_size(tdm_output *output, int *min_w, int *min_h,
 }
 
 EXTERN tdm_error
+tdm_output_get_cursor_available_size(tdm_output *output, int *min_w, int *min_h,
+                                                                        int *max_w, int *max_h, int *preferred_align)
+{
+       OUTPUT_FUNC_ENTRY();
+
+       _pthread_mutex_lock(&private_display->lock);
+
+       if (!tdm_display_check_module_abi(private_display, 1, 5)) {
+
+               if (min_w)
+                       *min_w = -1;
+               if (min_h)
+                       *min_h = -1;
+               if (max_w)
+                       *max_w = -1;
+               if (max_h)
+                       *max_h = -1;
+               if (preferred_align)
+                       *preferred_align = -1;
+
+               _pthread_mutex_unlock(&private_display->lock);
+
+               return TDM_ERROR_BAD_MODULE;
+       }
+
+       if (min_w)
+               *min_w = private_output->caps.cursor_min_w;
+       if (min_h)
+               *min_h = private_output->caps.cursor_min_h;
+       if (max_w)
+               *max_w = private_output->caps.cursor_max_w;
+       if (max_h)
+               *max_h = private_output->caps.cursor_max_h;
+       if (preferred_align)
+               *preferred_align = private_output->caps.cursor_preferred_align;
+
+       _pthread_mutex_unlock(&private_display->lock);
+
+       return ret;
+}
+
+EXTERN tdm_error
 tdm_output_get_physical_size(tdm_output *output, unsigned int *mmWidth,
                                                         unsigned int *mmHeight)
 {