summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/ecore_drm/Ecore_Drm.h6
-rw-r--r--src/lib/ecore_drm/ecore_drm_device.c14
2 files changed, 12 insertions, 8 deletions
diff --git a/src/lib/ecore_drm/Ecore_Drm.h b/src/lib/ecore_drm/Ecore_Drm.h
index 8b07cb5af2..cb6c6b2d48 100644
--- a/src/lib/ecore_drm/Ecore_Drm.h
+++ b/src/lib/ecore_drm/Ecore_Drm.h
@@ -117,6 +117,10 @@ struct _Ecore_Drm_Device
117 int current_fb; 117 int current_fb;
118 Ecore_Drm_Fb *current, *next; 118 Ecore_Drm_Fb *current, *next;
119 Ecore_Drm_Fb *dumb[2]; 119 Ecore_Drm_Fb *dumb[2];
120
121 drmEventContext drm_ctx;
122
123 Eina_Bool active : 1;
120}; 124};
121 125
122struct _Ecore_Drm_Event_Activate 126struct _Ecore_Drm_Event_Activate
@@ -205,6 +209,8 @@ EAPI int ecore_drm_device_fd_get(Ecore_Drm_Device *dev);
205EAPI void ecore_drm_device_window_set(Ecore_Drm_Device *dev, unsigned int window); 209EAPI void ecore_drm_device_window_set(Ecore_Drm_Device *dev, unsigned int window);
206EAPI const char *ecore_drm_device_name_get(Ecore_Drm_Device *dev); 210EAPI const char *ecore_drm_device_name_get(Ecore_Drm_Device *dev);
207 211
212EAPI void ecore_drm_device_fb_set(Ecore_Drm_Device *dev, Ecore_Drm_Fb *fb);
213
208/** 214/**
209 * Setup an Ecore_Drm_Device for software rendering 215 * Setup an Ecore_Drm_Device for software rendering
210 * 216 *
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