summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2015-02-19 14:47:26 -0500
committerBoram Park <boram1288.park@samsung.com>2015-04-29 10:48:28 +0900
commita9ad1da639ce6663e80dd2da852b58547f782957 (patch)
treeac6339970ad6f83bc3109f216855ca342c447d26
parente9f22c28a0fb06ae4335c15b8a1cef058ba6d165 (diff)
downloadefl-a9ad1da639ce6663e80dd2da852b58547f782957.tar.gz
ecore-drm Add API for querying output parameters
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
-rw-r--r--src/lib/ecore_drm/Ecore_Drm.h82
-rw-r--r--src/lib/ecore_drm/ecore_drm_output.c53
2 files changed, 135 insertions, 0 deletions
diff --git a/src/lib/ecore_drm/Ecore_Drm.h b/src/lib/ecore_drm/Ecore_Drm.h
index 2ce3bf7571..1df5d09521 100644
--- a/src/lib/ecore_drm/Ecore_Drm.h
+++ b/src/lib/ecore_drm/Ecore_Drm.h
@@ -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
diff --git a/src/lib/ecore_drm/ecore_drm_output.c b/src/lib/ecore_drm/ecore_drm_output.c
index dfa9c031ea..01a254f949 100644
--- a/src/lib/ecore_drm/ecore_drm_output.c
+++ b/src/lib/ecore_drm/ecore_drm_output.c
@@ -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;
+}