summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm/ecore_drm_device.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-04-07 14:30:43 -0400
committerStefan Schmidt <s.schmidt@samsung.com>2015-04-10 11:09:50 +0200
commit3832cd59b8102b063fe65c7f0fe81626da285455 (patch)
tree3b297abbdb1b8a35e4c8951b9f1941d7a2c4d73a /src/lib/ecore_drm/ecore_drm_device.c
parente3440c4683143011f52e092eb722f4a8cabd454e (diff)
ecore-drm: Create drmEventContext Once during device open
Summary: This changes allows us to reuse the same drmEventContext once so that when we get drm events, we are not constantly recreating the drmEventContext. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_drm/ecore_drm_device.c')
-rw-r--r--src/lib/ecore_drm/ecore_drm_device.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_device.c b/src/lib/ecore_drm/ecore_drm_device.c
index 12f55ab2a0..b0f7953ae6 100644
--- a/src/lib/ecore_drm/ecore_drm_device.c
+++ b/src/lib/ecore_drm/ecore_drm_device.c
@@ -58,19 +58,12 @@ static Eina_Bool
58_ecore_drm_device_cb_event(void *data, Ecore_Fd_Handler *hdlr EINA_UNUSED) 58_ecore_drm_device_cb_event(void *data, Ecore_Fd_Handler *hdlr EINA_UNUSED)
59{ 59{
60 Ecore_Drm_Device *dev; 60 Ecore_Drm_Device *dev;
61 drmEventContext ctx;
62 61
63 if (!(dev = data)) return ECORE_CALLBACK_RENEW; 62 if (!(dev = data)) return ECORE_CALLBACK_RENEW;
64 63
65 DBG("Drm Device Event"); 64 DBG("Drm Device Event");
66 65
67 memset(&ctx, 0, sizeof(ctx)); 66 drmHandleEvent(dev->drm.fd, &dev->drm_ctx);
68
69 ctx.version = DRM_EVENT_CONTEXT_VERSION;
70 ctx.page_flip_handler = _ecore_drm_device_cb_page_flip;
71 ctx.vblank_handler = _ecore_drm_device_cb_vblank;
72
73 drmHandleEvent(dev->drm.fd, &ctx);
74 67
75 return ECORE_CALLBACK_RENEW; 68 return ECORE_CALLBACK_RENEW;
76} 69}
@@ -327,6 +320,11 @@ ecore_drm_device_open(Ecore_Drm_Device *dev)
327 return EINA_FALSE; 320 return EINA_FALSE;
328 } 321 }
329 322
323 memset(&dev->drm_ctx, 0, sizeof(dev->drm_ctx));
324 dev->drm_ctx.version = DRM_EVENT_CONTEXT_VERSION;
325 dev->drm_ctx.page_flip_handler = _ecore_drm_device_cb_page_flip;
326 dev->drm_ctx.vblank_handler = _ecore_drm_device_cb_vblank;
327
330 events = (EEZE_UDEV_EVENT_ADD | EEZE_UDEV_EVENT_REMOVE | 328 events = (EEZE_UDEV_EVENT_ADD | EEZE_UDEV_EVENT_REMOVE |
331 EEZE_UDEV_EVENT_CHANGE); 329 EEZE_UDEV_EVENT_CHANGE);
332 330