summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm/ecore_drm_device.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-04-08 13:50:50 -0400
committerStefan Schmidt <s.schmidt@samsung.com>2015-04-10 11:09:51 +0200
commit25de79b05a270e56e716291f88ed3fd17c5825b4 (patch)
tree2d2dff7c797e9afa3e789fb40d3eaa3b4c7b2a1c /src/lib/ecore_drm/ecore_drm_device.c
parent82ff6fc5126b77a98701d090fc3ac062c22304c8 (diff)
ecore-drm: Modify device pageflip function to accept ecore_drm_fb callbacks
Summary: This modifies the ecore_drm_device pageflip function to make use of the ecore_drm_fb callbacks passed into the ecore_drm_fb_send function @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.c52
1 files changed, 33 insertions, 19 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_device.c b/src/lib/ecore_drm/ecore_drm_device.c
index 405375239f..ad3a3f6be7 100644
--- a/src/lib/ecore_drm/ecore_drm_device.c
+++ b/src/lib/ecore_drm/ecore_drm_device.c
@@ -10,32 +10,46 @@
10 ((x) >= (xx)) && ((y) >= (yy))) 10 ((x) >= (xx)) && ((y) >= (yy)))
11 11
12static Eina_List *drm_devices; 12static Eina_List *drm_devices;
13static int flip_count = 0;
13 14
14static void 15static void
15_ecore_drm_device_cb_page_flip(int fd EINA_UNUSED, unsigned int frame EINA_UNUSED, unsigned int sec EINA_UNUSED, unsigned int usec EINA_UNUSED, void *data) 16_ecore_drm_device_cb_page_flip(int fd EINA_UNUSED, unsigned int frame EINA_UNUSED, unsigned int sec EINA_UNUSED, unsigned int usec EINA_UNUSED, void *data)
16{ 17{
17 Ecore_Drm_Output *output; 18 Ecore_Drm_Pageflip_Callback *cb;
18 19
19 DBG("Drm Page Flip Event"); 20 DBG("Drm Page Flip Event");
20 21
21 if (!(output = data)) return; 22 if (!(cb = data)) return;
22 23
23 if (output->pending_flip) 24 flip_count++;
24 { 25 if (flip_count < cb->count) return;
25 if (output->dev->current)
26 ecore_drm_output_fb_release(output, output->dev->current);
27 output->dev->current = output->dev->next;
28 output->dev->next = NULL;
29 }
30 26
31 output->pending_flip = EINA_FALSE; 27 flip_count = 0;
32 if (output->pending_destroy) 28 if (cb->func) cb->func(cb->data);
33 { 29 /* free(cb); */
34 output->pending_destroy = EINA_FALSE; 30
35 ecore_drm_output_free(output); 31 /* Ecore_Drm_Output *output; */
36 } 32
37 else if (!output->pending_vblank) 33 /* DBG("Drm Page Flip Event"); */
38 ecore_drm_output_repaint(output); 34
35 /* if (!(output = data)) return; */
36
37 /* if (output->pending_flip) */
38 /* { */
39 /* if (output->dev->current) */
40 /* ecore_drm_output_fb_release(output, output->dev->current); */
41 /* output->dev->current = output->dev->next; */
42 /* output->dev->next = NULL; */
43 /* } */
44
45 /* output->pending_flip = EINA_FALSE; */
46 /* if (output->pending_destroy) */
47 /* { */
48 /* output->pending_destroy = EINA_FALSE; */
49 /* ecore_drm_output_free(output); */
50 /* } */
51 /* else if (!output->pending_vblank) */
52 /* ecore_drm_output_repaint(output); */
39} 53}
40 54
41static void 55static void
@@ -308,8 +322,8 @@ ecore_drm_device_open(Ecore_Drm_Device *dev)
308 ecore_main_fd_handler_add(dev->drm.fd, ECORE_FD_READ, 322 ecore_main_fd_handler_add(dev->drm.fd, ECORE_FD_READ,
309 _ecore_drm_device_cb_event, dev, NULL, NULL); 323 _ecore_drm_device_cb_event, dev, NULL, NULL);
310 324
311 dev->drm.idler = 325 /* dev->drm.idler = */
312 ecore_idle_enterer_add(_ecore_drm_device_cb_idle, dev); 326 /* ecore_idle_enterer_add(_ecore_drm_device_cb_idle, dev); */
313 327
314 return EINA_TRUE; 328 return EINA_TRUE;
315} 329}