summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2/ecore_drm2.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2016-11-14 15:22:19 -0500
committerChris Michael <cp.michael@samsung.com>2016-11-15 08:42:07 -0500
commitfbc58c3424f3ae4893b94cde7adac4e71d7ff526 (patch)
treef3c0fe3384462178f6d6eb7853a542e9efd8d4a4 /src/lib/ecore_drm2/ecore_drm2.c
parent8421a373132e4d8ad0f980adac853dde64923a7d (diff)
ecore-drm2: Add API function for drmHandleEvent
As we are not compile-time linking to libdrm anymore, Ecore_Evas_Drm needs to be able to call drmHandleEvent, so add an API function to Ecore_Drm2 that can be used there. @feature Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_drm2/ecore_drm2.c')
-rw-r--r--src/lib/ecore_drm2/ecore_drm2.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2.c b/src/lib/ecore_drm2/ecore_drm2.c
index ddedac6..09e02f0 100644
--- a/src/lib/ecore_drm2/ecore_drm2.c
+++ b/src/lib/ecore_drm2/ecore_drm2.c
@@ -211,3 +211,18 @@ ecore_drm2_shutdown(void)
211 211
212 return _ecore_drm2_init_count; 212 return _ecore_drm2_init_count;
213} 213}
214
215EAPI int
216ecore_drm2_event_handle(int fd, Ecore_Drm2_Context *drmctx)
217{
218 drmEventContext ctx;
219
220 EINA_SAFETY_ON_TRUE_RETURN_VAL((fd < 0), -1);
221
222 memset(&ctx, 0, sizeof(ctx));
223 ctx.version = DRM_EVENT_CONTEXT_VERSION;
224 ctx.page_flip_handler = drmctx->page_flip_handler;
225 ctx.vblank_handler = drmctx->vblank_handler;
226
227 return sym_drmHandleEvent(fd, &ctx);
228}