aboutsummaryrefslogtreecommitdiffstats
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
parentecore-drm2: Add API functions to get and set pointer position (diff)
downloadefl-3c332e1f88881b918abb1c2d042ca8d391f8d588.tar.gz
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 @@
# define DRM_CAP_CURSOR_HEIGHT 0x9
#endif
+static Eina_Bool
+_cb_session_active(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
+{
+ Elput_Event_Session_Active *ev;
+ Ecore_Drm2_Event_Activate *ea;
+
+ ev = event;
+
+ ea = calloc(1, sizeof(Ecore_Drm2_Event_Activate));
+ if (!ea) return ECORE_CALLBACK_RENEW;
+
+ ea->active = ev->active;
+
+ ecore_event_add(ECORE_DRM2_EVENT_ACTIVATE, ea, NULL, NULL);
+
+ return ECORE_CALLBACK_RENEW;
+}
+
static const char *
_drm2_device_find(const char *seat)
{
@@ -119,6 +137,10 @@ ecore_drm2_device_open(Ecore_Drm2_Device *device)
DBG("Device Path: %s", device->path);
DBG("Device Fd: %d", device->fd);
+ device->active_hdlr =
+ ecore_event_handler_add(ELPUT_EVENT_SESSION_ACTIVE,
+ _cb_session_active, device);
+
/* NB: Not going to enable planes if we don't support atomic */
/* if (drmSetClientCap(device->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1) < 0) */
/* ERR("Could not set Universal Plane support: %m"); */
@@ -140,6 +162,9 @@ ecore_drm2_device_free(Ecore_Drm2_Device *device)
{
EINA_SAFETY_ON_NULL_RETURN(device);
+ if (device->active_hdlr) ecore_event_handler_del(device->active_hdlr);
+ device->active_hdlr = NULL;
+
eina_stringshare_del(device->path);
free(device);
}