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 7f15811b140ebf7947f7ef3627c28377e9fd8001
Author: Christopher Michael <[email protected]>
AuthorDate: Thu Aug 28 08:21:38 2025 -0500
ecore_drm2: Add API function used to setup page_flip, vblank handlers
This patch adds a public structure and API function that can be used
to setup vblank & page_flip handlers
---
src/lib/ecore_drm2/Ecore_Drm2.h | 20 ++++++++++++++++++++
src/lib/ecore_drm2/ecore_drm2_device.c | 18 ++++++++++++++++++
2 files changed, 38 insertions(+)
diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index 447212d376..d1ba90bbb6 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -76,6 +76,25 @@ typedef struct _Ecore_Drm2_Event_Activate
Eina_Bool active : 1;
} Ecore_Drm2_Event_Activate;
+/* public structure to represent a drmContext used to set vblank & pageflip callbacks */
+typedef struct _Ecore_Drm2_Event_Context
+{
+ int version;
+
+ void (*vblank_handler)(int fd, unsigned int sequence, unsigned int tv_sec,
+ unsigned int tv_usec, void *user_data);
+
+ void (*page_flip_handler)(int fd, unsigned int sequence, unsigned int tv_sec,
+ unsigned int tv_usec, void *user_data);
+
+ void (*page_flip_handler2)(int fd, unsigned int sequence, unsigned int tv_sec,
+ unsigned int tv_usec, unsigned int crtc_id,
+ void *user_data);
+
+ void (*sequence_handler)(int fd, uint64_t sequence, uint64_t ns,
+ uint64_t user_data);
+} Ecore_Drm2_Event_Context;
+
/* public structure to represent an event for display state changes */
typedef struct _Ecore_Drm2_Event_Display_Changed
{
@@ -115,6 +134,7 @@ EAPI int ecore_drm2_device_fd_get(Ecore_Drm2_Device *dev);
EAPI void ecore_drm2_device_window_set(Ecore_Drm2_Device *dev, unsigned int window);
EAPI Eina_Bool ecore_drm2_device_vblank_supported(Ecore_Drm2_Device *dev);
EAPI const Eina_List *ecore_drm2_device_displays_get(Ecore_Drm2_Device *dev);
+EAPI int ecore_drm2_device_context_event_handle(Ecore_Drm2_Device *dev, Ecore_Drm2_Event_Context *drmctx);
/* Display API functions */
EAPI char *ecore_drm2_display_name_get(Ecore_Drm2_Display *disp);
diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c b/src/lib/ecore_drm2/ecore_drm2_device.c
index e1e3e9a3b3..29eb7835b9 100644
--- a/src/lib/ecore_drm2/ecore_drm2_device.c
+++ b/src/lib/ecore_drm2/ecore_drm2_device.c
@@ -519,3 +519,21 @@ ecore_drm2_device_displays_get(Ecore_Drm2_Device *dev)
EINA_SAFETY_ON_NULL_RETURN_VAL(dev, NULL);
return dev->displays;
}
+
+EAPI int
+ecore_drm2_device_context_event_handle(Ecore_Drm2_Device *dev, Ecore_Drm2_Event_Context *drmctx)
+{
+ drmEventContext ctx;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(dev, -1);
+
+ memset(&ctx, 0, sizeof(ctx));
+
+ ctx.version = DRM_EVENT_CONTEXT_VERSION;
+ ctx.vblank_handler = drmctx->vblank_handler;
+ ctx.page_flip_handler = drmctx->page_flip_handler;
+ ctx.page_flip_handler2 = drmctx->page_flip_handler2;
+ ctx.sequence_handler = drmctx->sequence_handler;
+
+ return sym_drmHandleEvent(dev->fd, &ctx);
+}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.