summaryrefslogtreecommitdiff
path: root/src/modules/ecore_evas/engines/drm
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-07-21 15:48:40 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-08-09 14:56:58 -0500
commit8ff59b2c55a58331625b6d997918e64eddc84b10 (patch)
tree85a9d9398281b1aad159517e8e9bdee2c0adc3b8 /src/modules/ecore_evas/engines/drm
parentbe0af0ed00148c55e1eb519444ea48201677badb (diff)
ecore_drm2: Pass Ecore_Drm2_Device instead of fd to most functions
Intended to simplify the upcoming commit that merges device find and device open into a single function that returns a device. The fd is something callers shouldn't really need to get their hands on, right now there are still a few places where it's needed, but those will be gone soon too.
Diffstat (limited to '')
-rw-r--r--src/modules/ecore_evas/engines/drm/ecore_evas_drm.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
index 35cd8d83a1..a801445492 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -48,7 +48,6 @@
48 48
49typedef struct _Ecore_Evas_Engine_Drm_Data 49typedef struct _Ecore_Evas_Engine_Drm_Data
50{ 50{
51 int fd;
52 int cw, ch; 51 int cw, ch;
53 int clockid; 52 int clockid;
54 int x, y, w, h; 53 int x, y, w, h;
@@ -156,8 +155,7 @@ _ecore_evas_drm_init(Ecore_Evas *ee, Ecore_Evas_Engine_Drm_Data *edata, const ch
156 goto dev_err; 155 goto dev_err;
157 } 156 }
158 157
159 edata->fd = ecore_drm2_device_open(edata->dev); 158 if (ecore_drm2_device_open(edata->dev) < 0)
160 if (edata->fd < 0)
161 { 159 {
162 ERR("Failed to open device"); 160 ERR("Failed to open device");
163 goto open_err; 161 goto open_err;
@@ -597,7 +595,7 @@ _cb_drm_event(void *data, Ecore_Fd_Handler *hdlr EINA_UNUSED)
597 595
598 ee = data; 596 ee = data;
599 edata = ee->engine.data; 597 edata = ee->engine.data;
600 ret = ecore_drm2_event_handle(edata->fd, &edata->ctx); 598 ret = ecore_drm2_event_handle(edata->dev, &edata->ctx);
601 if (ret) 599 if (ret)
602 { 600 {
603 WRN("drmHandleEvent failed to read an event"); 601 WRN("drmHandleEvent failed to read an event");
@@ -907,7 +905,7 @@ _ecore_evas_new_internal(const char *device, int x, int y, int w, int h, Eina_Bo
907 if ((num) && (!atoi(num))) 905 if ((num) && (!atoi(num)))
908 einfo->info.vsync = EINA_FALSE; 906 einfo->info.vsync = EINA_FALSE;
909 907
910 einfo->info.fd = edata->fd; 908 einfo->info.dev = edata->dev;
911 einfo->info.bpp = edata->bpp; 909 einfo->info.bpp = edata->bpp;
912 einfo->info.depth = edata->depth; 910 einfo->info.depth = edata->depth;
913 einfo->info.format = edata->format; 911 einfo->info.format = edata->format;
@@ -925,7 +923,7 @@ _ecore_evas_new_internal(const char *device, int x, int y, int w, int h, Eina_Bo
925 { 923 {
926 Evas_Engine_Info_Drm *einfo = tinfo; 924 Evas_Engine_Info_Drm *einfo = tinfo;
927 925
928 einfo->info.fd = edata->fd; 926 einfo->info.dev = edata->dev;
929 einfo->info.bpp = edata->bpp; 927 einfo->info.bpp = edata->bpp;
930 einfo->info.depth = edata->depth; 928 einfo->info.depth = edata->depth;
931 einfo->info.format = edata->format; 929 einfo->info.format = edata->format;
@@ -962,7 +960,8 @@ _ecore_evas_new_internal(const char *device, int x, int y, int w, int h, Eina_Bo
962 edata->ctx.page_flip_handler = _cb_pageflip; 960 edata->ctx.page_flip_handler = _cb_pageflip;
963 961
964 edata->hdlr = 962 edata->hdlr =
965 ecore_main_fd_handler_add(edata->fd, ECORE_FD_READ, _cb_drm_event, ee, 963 ecore_main_fd_handler_add(ecore_drm2_device_fd_get(edata->dev),
964 ECORE_FD_READ, _cb_drm_event, ee,
966 NULL, NULL); 965 NULL, NULL);
967 966
968 canvases = eina_list_append(canvases, ee); 967 canvases = eina_list_append(canvases, ee);