summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-05-05 09:12:25 -0400
committerChris Michael <cp.michael@samsung.com>2015-05-07 14:39:46 -0400
commit1ab4975491f184f11b4c6407218669805a29894e (patch)
treeb24a4b2c72c54cbf167b3b96ec37c79fd85e986e /src/lib/ecore_drm
parent34664306a99100cdcebcba9b163d2d28ee3d1350 (diff)
ecore-drm: Add API function to return output modes
Summary: This adds a new API function to return a list of modes supported on a given output @feature Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_drm')
-rw-r--r--src/lib/ecore_drm/Ecore_Drm.h24
-rw-r--r--src/lib/ecore_drm/ecore_drm_output.c9
-rw-r--r--src/lib/ecore_drm/ecore_drm_private.h8
3 files changed, 31 insertions, 10 deletions
diff --git a/src/lib/ecore_drm/Ecore_Drm.h b/src/lib/ecore_drm/Ecore_Drm.h
index e2b79a0567..2177b3f49f 100644
--- a/src/lib/ecore_drm/Ecore_Drm.h
+++ b/src/lib/ecore_drm/Ecore_Drm.h
@@ -153,8 +153,14 @@ struct _Ecore_Drm_Event_Output
153/* opaque structure to represent a drm device */ 153/* opaque structure to represent a drm device */
154typedef struct _Ecore_Drm_Device Ecore_Drm_Device; 154typedef struct _Ecore_Drm_Device Ecore_Drm_Device;
155 155
156/* opaque structure to represent a drm output mode */ 156/* structure to represent a drm output mode */
157typedef struct _Ecore_Drm_Output_Mode Ecore_Drm_Output_Mode; 157typedef struct _Ecore_Drm_Output_Mode
158{
159 unsigned int flags;
160 int width, height;
161 unsigned int refresh;
162 drmModeModeInfo info;
163} Ecore_Drm_Output_Mode;
158 164
159/* opaque structure to represent a drm output */ 165/* opaque structure to represent a drm output */
160typedef struct _Ecore_Drm_Output Ecore_Drm_Output; 166typedef struct _Ecore_Drm_Output Ecore_Drm_Output;
@@ -836,6 +842,20 @@ EAPI Eina_Bool ecore_drm_output_backlight_get(Ecore_Drm_Output *output);
836 */ 842 */
837EAPI char *ecore_drm_output_edid_get(Ecore_Drm_Output *output); 843EAPI char *ecore_drm_output_edid_get(Ecore_Drm_Output *output);
838 844
845/**
846 * Get a list of the modes supported on a given output
847 *
848 * @param output The Ecore_Drm_Output to get the modes for
849 *
850 * @return An Eina_List of the modes supported for this output
851 *
852 * @note The returned list should not be freed
853 *
854 * @ingroup Ecore_Drm_Output_Group
855 * @since 1.15
856 */
857EAPI Eina_List *ecore_drm_output_modes_get(Ecore_Drm_Output *output);
858
839#ifdef __cplusplus 859#ifdef __cplusplus
840} 860}
841#endif 861#endif
diff --git a/src/lib/ecore_drm/ecore_drm_output.c b/src/lib/ecore_drm/ecore_drm_output.c
index b6c44cc3a1..fbd2a2a53e 100644
--- a/src/lib/ecore_drm/ecore_drm_output.c
+++ b/src/lib/ecore_drm/ecore_drm_output.c
@@ -1137,3 +1137,12 @@ ecore_drm_output_edid_get(Ecore_Drm_Output *output)
1137 1137
1138 return strdup(output->edid_blob); 1138 return strdup(output->edid_blob);
1139} 1139}
1140
1141EAPI Eina_List *
1142ecore_drm_output_modes_get(Ecore_Drm_Output *output)
1143{
1144 EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL);
1145 EINA_SAFETY_ON_NULL_RETURN_VAL(output->modes, NULL);
1146
1147 return output->modes;
1148}
diff --git a/src/lib/ecore_drm/ecore_drm_private.h b/src/lib/ecore_drm/ecore_drm_private.h
index 3bacef2334..8a2ca3c91b 100644
--- a/src/lib/ecore_drm/ecore_drm_private.h
+++ b/src/lib/ecore_drm/ecore_drm_private.h
@@ -87,14 +87,6 @@ typedef struct _Ecore_Drm_Pageflip_Callback
87 int count; 87 int count;
88} Ecore_Drm_Pageflip_Callback; 88} Ecore_Drm_Pageflip_Callback;
89 89
90struct _Ecore_Drm_Output_Mode
91{
92 unsigned int flags;
93 int width, height;
94 unsigned int refresh;
95 drmModeModeInfo info;
96};
97
98typedef enum _Ecore_Drm_Backlight_Type 90typedef enum _Ecore_Drm_Backlight_Type
99{ 91{
100 ECORE_DRM_BACKLIGHT_RAW, 92 ECORE_DRM_BACKLIGHT_RAW,