summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2/ecore_drm2_device.c
diff options
context:
space:
mode:
authorChris Michael <cpmichael@osg.samsung.com>2016-05-09 12:47:02 -0400
committerChris Michael <cpmichael@osg.samsung.com>2016-05-27 11:57:53 -0400
commit3c332e1f88881b918abb1c2d042ca8d391f8d588 (patch)
treebb30ddcb9d01b5fc9fff4fef60ff8a01949f2620 /src/lib/ecore_drm2/ecore_drm2_device.c
parent296d233f64327d87d318093b2504b58834c5bc85 (diff)
ecore-drm2: Add drm2 event for session activation
This patch adds a new Ecore_Drm2_Event_Activate that can be raised to inform Enlightenment that a session has been activated or suspended so that rendering can be paused/resumed Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
Diffstat (limited to 'src/lib/ecore_drm2/ecore_drm2_device.c')
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_device.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c b/src/lib/ecore_drm2/ecore_drm2_device.c
index f352b30795..9e7d7a6063 100644
--- a/src/lib/ecore_drm2/ecore_drm2_device.c
+++ b/src/lib/ecore_drm2/ecore_drm2_device.c
@@ -8,6 +8,24 @@
8# define DRM_CAP_CURSOR_HEIGHT 0x9 8# define DRM_CAP_CURSOR_HEIGHT 0x9
9#endif 9#endif
10 10
11static Eina_Bool
12_cb_session_active(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
13{
14 Elput_Event_Session_Active *ev;
15 Ecore_Drm2_Event_Activate *ea;
16
17 ev = event;
18
19 ea = calloc(1, sizeof(Ecore_Drm2_Event_Activate));
20 if (!ea) return ECORE_CALLBACK_RENEW;
21
22 ea->active = ev->active;
23
24 ecore_event_add(ECORE_DRM2_EVENT_ACTIVATE, ea, NULL, NULL);
25
26 return ECORE_CALLBACK_RENEW;
27}
28
11static const char * 29static const char *
12_drm2_device_find(const char *seat) 30_drm2_device_find(const char *seat)
13{ 31{
@@ -119,6 +137,10 @@ ecore_drm2_device_open(Ecore_Drm2_Device *device)
119 DBG("Device Path: %s", device->path); 137 DBG("Device Path: %s", device->path);
120 DBG("Device Fd: %d", device->fd); 138 DBG("Device Fd: %d", device->fd);
121 139
140 device->active_hdlr =
141 ecore_event_handler_add(ELPUT_EVENT_SESSION_ACTIVE,
142 _cb_session_active, device);
143
122 /* NB: Not going to enable planes if we don't support atomic */ 144 /* NB: Not going to enable planes if we don't support atomic */
123 /* if (drmSetClientCap(device->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1) < 0) */ 145 /* if (drmSetClientCap(device->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1) < 0) */
124 /* ERR("Could not set Universal Plane support: %m"); */ 146 /* ERR("Could not set Universal Plane support: %m"); */
@@ -140,6 +162,9 @@ ecore_drm2_device_free(Ecore_Drm2_Device *device)
140{ 162{
141 EINA_SAFETY_ON_NULL_RETURN(device); 163 EINA_SAFETY_ON_NULL_RETURN(device);
142 164
165 if (device->active_hdlr) ecore_event_handler_del(device->active_hdlr);
166 device->active_hdlr = NULL;
167
143 eina_stringshare_del(device->path); 168 eina_stringshare_del(device->path);
144 free(device); 169 free(device);
145} 170}