summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2015-02-19 14:47:26 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-02-19 14:48:21 -0500
commit5184ffec63390172d40ac525abb1d7b22c27457e (patch)
tree6748226438efe1dd3b01be385e99d61f3ef236fe /src/lib/ecore_drm
parenta915dcc9bd99878dfb249e9d4c9c4966fb4aa5ae (diff)
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
Diffstat (limited to 'src/lib/ecore_drm')
-rw-r--r--src/lib/ecore_drm/Ecore_Drm.h83
-rw-r--r--src/lib/ecore_drm/ecore_drm_output.c53
2 files changed, 136 insertions, 0 deletions
diff --git a/src/lib/ecore_drm/Ecore_Drm.h b/src/lib/ecore_drm/Ecore_Drm.h
index fecd0de498..17def6ea81 100644
--- a/src/lib/ecore_drm/Ecore_Drm.h
+++ b/src/lib/ecore_drm/Ecore_Drm.h
@@ -209,4 +209,87 @@ EAPI void ecore_drm_fb_destroy(Ecore_Drm_Fb *fb);
209 209
210EAPI Eina_Bool ecore_drm_launcher_connect(Ecore_Drm_Device *dev); 210EAPI Eina_Bool ecore_drm_launcher_connect(Ecore_Drm_Device *dev);
211EAPI void ecore_drm_launcher_disconnect(Ecore_Drm_Device *dev); 211EAPI void ecore_drm_launcher_disconnect(Ecore_Drm_Device *dev);
212
213/**
214 * Get the output position of Ecore_Drm_Output
215 *
216 * This function will give the output position of Ecore_Drm_Output
217 *
218 * @param output The Ecore_Drm_Output to get position for
219 * @param *x The parameter in which output x co-ordinate is stored
220 * @param *y The parameter in which output y co-ordinate is stored
221 *
222 * @ingroup Ecore_Drm_Output_Group
223 * @since 1.14
224 */
225EAPI void ecore_drm_output_position_get(Ecore_Drm_Output *output, int *x, int *y);
226
227/**
228 * Get the current resolution of Ecore_Drm_Output
229 *
230 * This function will give the current resolution of Ecore_Drm_Output
231 *
232 * @param output The Ecore_Drm_Output to get resolution for
233 * @param *w The parameter in which output width is stored
234 * @param *h The parameter in which output height is stored
235 * @param *refresh The parameter in which output refresh rate is stored
236 *
237 * @ingroup Ecore_Drm_Output_Group
238 * @since 1.14
239 */
240EAPI void ecore_drm_output_current_resolution_get(Ecore_Drm_Output *output, int *w, int *h, unsigned int *refresh);
241
242/**
243 * Get the physical size of Ecore_Drm_Output
244 *
245 * This function will give the physical size (in mm) of Ecore_Drm_Output
246 *
247 * @param output The Ecore_Drm_Output to get physical size for
248 * @param *w The parameter in which output physical width is stored
249 * @param *h The parameter in which output physical height is stored
250 *
251 * @ingroup Ecore_Drm_Output_Group
252 * @since 1.14
253 */
254EAPI void ecore_drm_output_physical_size_get(Ecore_Drm_Output *output, int *w, int *h);
255
256/**
257 * Get the subpixel order of Ecore_Drm_Output
258 *
259 * This function will give the subpixel order of Ecore_Drm_Output
260 *
261 * @param output The Ecore_Drm_Output to get subpixel order for
262 * @return The output subpixel order
263 *
264 * @ingroup Ecore_Drm_Output_Group
265 * @since 1.14
266 */
267EAPI unsigned int ecore_drm_output_subpixel_order_get(Ecore_Drm_Output *output);
268
269/**
270 * Get the model of Ecore_Drm_Output
271 *
272 * This function will give the model of Ecore_Drm_Output
273 *
274 * @param output The Ecore_Drm_Output to get model for
275 * @return The model (do NOT eina_stringshare_del this return!)
276 *
277 * @ingroup Ecore_Drm_Output_Group
278 * @since 1.14
279 */
280EAPI Eina_Stringshare *ecore_drm_output_model_get(Ecore_Drm_Output *output);
281
282/**
283 * Get the make of Ecore_Drm_Output
284 *
285 * This function will give the make of Ecore_Drm_Output
286 *
287 * @param output The Ecore_Drm_Output to get model for
288 * @return The make (do NOT eina_stringshare_del this return!)
289 *
290 * @ingroup Ecore_Drm_Output_Group
291 * @since 1.14
292 */
293EAPI Eina_Stringshare *ecore_drm_output_make_get(Ecore_Drm_Output *output);
294
212#endif 295#endif
diff --git a/src/lib/ecore_drm/ecore_drm_output.c b/src/lib/ecore_drm/ecore_drm_output.c
index aa694b71ec..827a4fcf75 100644
--- a/src/lib/ecore_drm/ecore_drm_output.c
+++ b/src/lib/ecore_drm/ecore_drm_output.c
@@ -902,3 +902,56 @@ ecore_drm_outputs_geometry_get(Ecore_Drm_Device *dev, int *x, int *y, int *w, in
902 if (w) *w = ow; 902 if (w) *w = ow;
903 if (h) *h = oh; 903 if (h) *h = oh;
904} 904}
905
906EAPI void
907ecore_drm_output_position_get(Ecore_Drm_Output *output, int *x, int *y)
908{
909 EINA_SAFETY_ON_NULL_RETURN(output);
910
911 if (x) *x = output->x;
912 if (y) *y = output->y;
913}
914
915EAPI void
916ecore_drm_output_current_resolution_get(Ecore_Drm_Output *output, int *w, int *h, unsigned int *refresh)
917{
918 EINA_SAFETY_ON_NULL_RETURN(output);
919
920 if (w) *w = output->current_mode->width;
921 if (h) *h = output->current_mode->height;
922 if (refresh) *refresh = output->current_mode->refresh;
923}
924
925EAPI void
926ecore_drm_output_physical_size_get(Ecore_Drm_Output *output, int *w, int *h)
927{
928 EINA_SAFETY_ON_NULL_RETURN(output);
929
930 //FIXME: This needs to be set when EDID parsing works
931 if (w) *w = 0;
932 if (h) *h = 0;
933}
934
935EAPI unsigned int
936ecore_drm_output_subpixel_order_get(Ecore_Drm_Output *output)
937{
938 EINA_SAFETY_ON_NULL_RETURN_VAL(output, 0);
939
940 return output->subpixel;
941}
942
943EAPI Eina_Stringshare *
944ecore_drm_output_model_get(Ecore_Drm_Output *output)
945{
946 EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL);
947
948 return output->model;
949}
950
951EAPI Eina_Stringshare *
952ecore_drm_output_make_get(Ecore_Drm_Output *output)
953{
954 EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL);
955
956 return output->make;
957}