summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2016-09-22 09:35:44 -0400
committerChris Michael <cp.michael@samsung.com>2016-09-22 13:33:56 -0400
commit44a356a8488a736ae0ab524e20e71c4ed58fb580 (patch)
tree0f677adad51b82bb20c02540b7936d36ac033ba7
parent4768b1d04e49e924cbf9ab765c465989840d48a9 (diff)
ecore-drm2: Add private structures to support Atomic Modesetting
Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_private.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_private.h b/src/lib/ecore_drm2/ecore_drm2_private.h
index bce5edec89..04dcd1b459 100644
--- a/src/lib/ecore_drm2/ecore_drm2_private.h
+++ b/src/lib/ecore_drm2/ecore_drm2_private.h
@@ -24,6 +24,7 @@
24# include <drm_fourcc.h> 24# include <drm_fourcc.h>
25 25
26extern int _ecore_drm2_log_dom; 26extern int _ecore_drm2_log_dom;
27extern Eina_Bool _ecore_drm2_use_atomic;
27 28
28# ifdef ECORE_DRM2_DEFAULT_LOG_COLOR 29# ifdef ECORE_DRM2_DEFAULT_LOG_COLOR
29# undef ECORE_DRM2_DEFAULT_LOG_COLOR 30# undef ECORE_DRM2_DEFAULT_LOG_COLOR
@@ -55,6 +56,63 @@ extern int _ecore_drm2_log_dom;
55# endif 56# endif
56# define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_drm2_log_dom, __VA_ARGS__) 57# define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_drm2_log_dom, __VA_ARGS__)
57 58
59# ifdef HAVE_ATOMIC_DRM
60typedef struct _Ecore_Drm2_Atomic_State Ecore_Drm2_Atomic_State;
61
62typedef struct _Ecore_Drm2_Atomic_Blob
63{
64 uint32_t id, value;
65 size_t len;
66 void *data;
67} Ecore_Drm2_Atomic_Blob;
68
69typedef struct _Ecore_Drm2_Atomic_Property
70{
71 uint32_t id, value;
72} Ecore_Drm2_Atomic_Property;
73
74typedef struct _Ecore_Drm2_Connector_State
75{
76 uint32_t obj_id;
77 Ecore_Drm2_Atomic_Property crtc;
78 Ecore_Drm2_Atomic_Property dpms;
79 Ecore_Drm2_Atomic_Property aspect;
80 Ecore_Drm2_Atomic_Property scaling;
81 Ecore_Drm2_Atomic_Blob edid;
82} Ecore_Drm2_Connector_State;
83
84typedef struct _Ecore_Drm2_Crtc_State
85{
86 uint32_t obj_id;
87 int index;
88 Ecore_Drm2_Atomic_Property active;
89 Ecore_Drm2_Atomic_Blob mode;
90} Ecore_Drm2_Crtc_State;
91
92typedef struct _Ecore_Drm2_Plane_State
93{
94 uint32_t obj_id, mask;
95 Ecore_Drm2_Atomic_Property type;
96 Ecore_Drm2_Atomic_Property cid, fid;
97 Ecore_Drm2_Atomic_Property sx, sy, sw, sh;
98 Ecore_Drm2_Atomic_Property cx, cy, cw, ch;
99 Ecore_Drm2_Atomic_Property rotation;
100
101 /* these are not part of an atomic state, but we store these here
102 * so that we do not have to refetch properties when iterating planes */
103 uint32_t rotation_map[6];
104 uint32_t supported_rotations;
105} Ecore_Drm2_Plane_State;
106
107struct _Ecore_Drm2_Atomic_State
108{
109 int crtcs, conns, planes;
110 Ecore_Drm2_Crtc_State *crtc_states;
111 Ecore_Drm2_Connector_State *conn_states;
112 Ecore_Drm2_Plane_State *plane_states;
113};
114# endif
115
58typedef enum _Ecore_Drm2_Backlight_Type 116typedef enum _Ecore_Drm2_Backlight_Type
59{ 117{
60 ECORE_DRM2_BACKLIGHT_RAW, 118 ECORE_DRM2_BACKLIGHT_RAW,
@@ -157,6 +215,12 @@ struct _Ecore_Drm2_Output
157 Ecore_Drm2_Release_Handler release_cb; 215 Ecore_Drm2_Release_Handler release_cb;
158 void *release_data; 216 void *release_data;
159 217
218# ifdef HAVE_ATOMIC_DRM
219 Ecore_Drm2_Crtc_State *crtc_state;
220 Ecore_Drm2_Connector_State *conn_state;
221 Ecore_Drm2_Plane_State *plane_state;
222# endif
223
160 Eina_Bool connected : 1; 224 Eina_Bool connected : 1;
161 Eina_Bool primary : 1; 225 Eina_Bool primary : 1;
162 Eina_Bool cloned : 1; 226 Eina_Bool cloned : 1;
@@ -187,6 +251,10 @@ struct _Ecore_Drm2_Device
187 Ecore_Event_Handler *active_hdlr; 251 Ecore_Event_Handler *active_hdlr;
188 Ecore_Event_Handler *device_change_hdlr; 252 Ecore_Event_Handler *device_change_hdlr;
189 253
254# ifdef HAVE_ATOMIC_DRM
255 Ecore_Drm2_Atomic_State *state;
256# endif
257
190 Eina_List *outputs; 258 Eina_List *outputs;
191}; 259};
192 260