This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch devs/devilhorns/apos
in repository efl.

View the commit online.

commit 948a328965218711849e76c591854f615784053a
Author: Christopher Michael <devilho...@comcast.net>
AuthorDate: Wed Nov 22 08:33:04 2023 -0500

    ecore_drm2: Handle raising event for session active/inactive
---
 src/lib/ecore_drm2/Ecore_Drm2.h        |  9 +++++++++
 src/lib/ecore_drm2/ecore_drm2.c        |  6 ++++++
 src/lib/ecore_drm2/ecore_drm2_device.c | 25 ++++++++++++++-----------
 3 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index a54a2f8b8d..eea8d0ae55 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -58,6 +58,15 @@ typedef struct _Ecore_Drm2_Plane Ecore_Drm2_Plane;
 /* opaque structure to represent a drm device */
 typedef struct _Ecore_Drm2_Device Ecore_Drm2_Device;
 
+/* public structure to represent an event for session state changes */
+typedef struct _Ecore_Drm2_Event_Activate
+{
+   Eina_Bool active : 1;
+} Ecore_Drm2_Event_Activate;
+
+/* API events */
+EAPI extern int ECORE_DRM2_EVENT_ACTIVATE;
+
 /* API functions */
 EAPI int ecore_drm2_init(void);
 EAPI int ecore_drm2_shutdown(void);
diff --git a/src/lib/ecore_drm2/ecore_drm2.c b/src/lib/ecore_drm2/ecore_drm2.c
index f0005a1fd1..b85521c26b 100644
--- a/src/lib/ecore_drm2/ecore_drm2.c
+++ b/src/lib/ecore_drm2/ecore_drm2.c
@@ -36,6 +36,8 @@ int (*sym_drmModeAtomicAddProperty)(drmModeAtomicReqPtr req, uint32_t object_id,
 int (*sym_drmModeAtomicCommit)(int fd, drmModeAtomicReqPtr req, uint32_t flags, void *user_data) = NULL;
 void (*sym_drmModeAtomicSetCursor)(drmModeAtomicReqPtr req, int cursor) = NULL;
 
+EAPI int ECORE_DRM2_EVENT_ACTIVATE = -1;
+
 /* local static functions */
 static Eina_Bool
 _ecore_drm2_link(void)
@@ -144,6 +146,8 @@ ecore_drm2_init(void)
         goto log_err;
      }
 
+   ECORE_DRM2_EVENT_ACTIVATE = ecore_event_type_new();
+
    if (!_ecore_drm2_link()) goto link_err;
 
    return _ecore_drm2_init_count;
@@ -176,6 +180,8 @@ ecore_drm2_shutdown(void)
 
    if (_drm_lib) dlclose(_drm_lib);
 
+   ECORE_DRM2_EVENT_ACTIVATE = -1;
+
    eina_log_domain_unregister(_ecore_drm2_log_dom);
    _ecore_drm2_log_dom = -1;
 
diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c b/src/lib/ecore_drm2/ecore_drm2_device.c
index bf87befb0f..d6a4bd67d4 100644
--- a/src/lib/ecore_drm2/ecore_drm2_device.c
+++ b/src/lib/ecore_drm2/ecore_drm2_device.c
@@ -9,26 +9,29 @@
 
 /* local functions */
 static Eina_Bool
-_ecore_drm2_device_cb_session_active(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
+_ecore_drm2_device_cb_session_active(void *data, int type EINA_UNUSED, void *event)
 {
-   /* Ecore_Drm2_Device *dev; */
+   Ecore_Drm2_Device *dev;
    Elput_Event_Session_Active *ev;
+   Ecore_Drm2_Event_Activate *eevent;
 
-   /* dev = data; */
+   dev = data;
    ev = event;
 
    if (ev->active)
      {
-        /* TODO: wake compositor, compositor damage all, set state_invalid = true */
-        /* NB: Input enable is already done inside elput */
-     }
-   else
-     {
-        /* TODO: compositor offscreen, output->repaint_needed = false */
-        /* NB: Input disable is already done inside elput */
+        Eina_List *l;
+        Ecore_Drm2_Display *disp;
+
+        EINA_LIST_FOREACH(dev->displays, l, disp)
+          ecore_drm2_display_dpms_set(disp, DRM_MODE_DPMS_ON);
      }
 
-   /* TODO: raise ecore_drm2_event_active ?? */
+   eevent = calloc(1, sizeof(Ecore_Drm2_Event_Activate));
+   if (!eevent) return ECORE_CALLBACK_RENEW;
+
+   eevent->active = ev->active;
+   ecore_event_add(ECORE_DRM2_EVENT_ACTIVATE, eevent, NULL, NULL);
 
    return ECORE_CALLBACK_RENEW;
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to