ecore-drm Add API for querying output parameters
authorDerek Foreman <derekf@osg.samsung.com>
Thu, 19 Feb 2015 19:47:26 +0000 (14:47 -0500)
committerBoram Park <boram1288.park@samsung.com>
Wed, 29 Apr 2015 01:48:28 +0000 (10:48 +0900)
Reviewers: zmike, devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Maniphest Tasks: T2131

Differential Revision: https://phab.enlightenment.org/D2005

Conflicts:

src/lib/ecore_drm/Ecore_Drm.h
src/lib/ecore_drm/ecore_drm_output.c

Change-Id: I5d7e097834e5fd55aa4fad3ab137be6c0063f86f

src/lib/ecore_drm/Ecore_Drm.h
src/lib/ecore_drm/ecore_drm_output.c

index 2ce3bf757114378071987c91a024b14c09270414..1df5d095219e88f2313b68c974d67fdbed6e6757 100644 (file)
@@ -270,4 +270,86 @@ EAPI void ecore_drm_launcher_disconnect(Ecore_Drm_Device *dev);
  */
 EAPI void ecore_drm_output_dpms_set(Ecore_Drm_Output *output, int level);
 
+/**
+ * Get the output position of Ecore_Drm_Output
+ *
+ * This function will give the output position of Ecore_Drm_Output
+ *
+ * @param output The Ecore_Drm_Output to get position for
+ * @param *x The parameter in which output x co-ordinate is stored
+ * @param *y The parameter in which output y co-ordinate is stored
+ *
+ * @ingroup Ecore_Drm_Output_Group
+ * @since 1.14
+ */
+EAPI void ecore_drm_output_position_get(Ecore_Drm_Output *output, int *x, int *y);
+
+/**
+ * Get the current resolution of Ecore_Drm_Output
+ *
+ * This function will give the current resolution of Ecore_Drm_Output
+ *
+ * @param output The Ecore_Drm_Output to get resolution for
+ * @param *w The parameter in which output width is stored
+ * @param *h The parameter in which output height is stored
+ * @param *refresh The parameter in which output refresh rate is stored
+ *
+ * @ingroup Ecore_Drm_Output_Group
+ * @since 1.14
+ */
+EAPI void ecore_drm_output_current_resolution_get(Ecore_Drm_Output *output, int *w, int *h, unsigned int *refresh);
+
+/**
+ * Get the physical size of Ecore_Drm_Output
+ *
+ * This function will give the physical size (in mm) of Ecore_Drm_Output
+ *
+ * @param output The Ecore_Drm_Output to get physical size for
+ * @param *w The parameter in which output physical width is stored
+ * @param *h The parameter in which output physical height is stored
+ *
+ * @ingroup Ecore_Drm_Output_Group
+ * @since 1.14
+ */
+EAPI void ecore_drm_output_physical_size_get(Ecore_Drm_Output *output, int *w, int *h);
+
+/**
+ * Get the subpixel order of Ecore_Drm_Output
+ *
+ * This function will give the subpixel order of Ecore_Drm_Output
+ *
+ * @param output The Ecore_Drm_Output to get subpixel order for
+ * @return The output subpixel order
+ *
+ * @ingroup Ecore_Drm_Output_Group
+ * @since 1.14
+ */
+EAPI unsigned int ecore_drm_output_subpixel_order_get(Ecore_Drm_Output *output);
+
+/**
+ * Get the model of Ecore_Drm_Output
+ *
+ * This function will give the model of Ecore_Drm_Output
+ *
+ * @param output The Ecore_Drm_Output to get model for
+ * @return The model (do NOT eina_stringshare_del this return!)
+ *
+ * @ingroup Ecore_Drm_Output_Group
+ * @since 1.14
+ */
+EAPI Eina_Stringshare *ecore_drm_output_model_get(Ecore_Drm_Output *output);
+
+/**
+ * Get the make of Ecore_Drm_Output
+ *
+ * This function will give the make of Ecore_Drm_Output
+ *
+ * @param output The Ecore_Drm_Output to get model for
+ * @return The make (do NOT eina_stringshare_del this return!)
+ *
+ * @ingroup Ecore_Drm_Output_Group
+ * @since 1.14
+ */
+EAPI Eina_Stringshare *ecore_drm_output_make_get(Ecore_Drm_Output *output);
+
 #endif
index dfa9c031ea9edc054ea3e34e9b8c2041d9613d2d..01a254f949584cd20c258e26eb5fb87ed138c8a3 100644 (file)
@@ -979,3 +979,56 @@ ecore_drm_output_dpms_set(Ecore_Drm_Output *output, int level)
    drmModeConnectorSetProperty(output->dev->drm.fd, output->conn_id,
                                output->dpms->prop_id, level);
 }
+
+EAPI void
+ecore_drm_output_position_get(Ecore_Drm_Output *output, int *x, int *y)
+{
+   EINA_SAFETY_ON_NULL_RETURN(output);
+
+   if (x) *x = output->x;
+   if (y) *y = output->y;
+}
+
+EAPI void
+ecore_drm_output_current_resolution_get(Ecore_Drm_Output *output, int *w, int *h, unsigned int *refresh)
+{
+   EINA_SAFETY_ON_NULL_RETURN(output);
+
+   if (w) *w = output->current_mode->width;
+   if (h) *h = output->current_mode->height;
+   if (refresh) *refresh = output->current_mode->refresh;
+}
+
+EAPI void
+ecore_drm_output_physical_size_get(Ecore_Drm_Output *output, int *w, int *h)
+{
+   EINA_SAFETY_ON_NULL_RETURN(output);
+
+   //FIXME: This needs to be set when EDID parsing works
+   if (w) *w = 0;
+   if (h) *h = 0;
+}
+
+EAPI unsigned int
+ecore_drm_output_subpixel_order_get(Ecore_Drm_Output *output)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(output, 0);
+
+   return output->subpixel;
+}
+
+EAPI Eina_Stringshare *
+ecore_drm_output_model_get(Ecore_Drm_Output *output)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL);
+
+   return output->model;
+}
+
+EAPI Eina_Stringshare *
+ecore_drm_output_make_get(Ecore_Drm_Output *output)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL);
+
+   return output->make;
+}