summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Aguirre <aguirre.nicolas@gmail.com>2016-03-18 16:43:53 +0100
committerNicolas Aguirre <aguirre.nicolas@gmail.com>2016-03-18 16:43:53 +0100
commit9dcafb773713d237ab60041084a3f7f5688b5343 (patch)
tree643a50da57cfb58f7ea7ac62cfba88e5dcd58c90
parent608c32857961f93db1e090599922f2bf51af39ae (diff)
ecore_evas: Add eglfs backenddevs/captainigloo/eglfs
-rw-r--r--configure.ac2
-rw-r--r--src/Makefile_Ecore_Evas.am5
-rw-r--r--src/lib/ecore_evas/Ecore_Evas.h3
-rw-r--r--src/lib/ecore_evas/ecore_evas.c36
-rw-r--r--src/lib/ecore_evas/ecore_evas_module.c3
-rw-r--r--src/modules/ecore_evas/engines/fb/ecore_evas_fb.c121
6 files changed, 168 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 0ac263e9e8..3782a09207 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4217,6 +4217,7 @@ want_ecore_evas_gl_cocoa="${have_evas_engine_gl_cocoa}"
4217want_ecore_evas_wayland_egl="${have_evas_engine_wayland_egl}" 4217want_ecore_evas_wayland_egl="${have_evas_engine_wayland_egl}"
4218want_ecore_evas_extn="yes" 4218want_ecore_evas_extn="yes"
4219want_ecore_evas_drm="${have_evas_engine_drm}" 4219want_ecore_evas_drm="${have_evas_engine_drm}"
4220want_ecore_evas_eglfs="${have_evas_engine_eglfs}"
4220 4221
4221if test "x${have_ecore_ipc}" = "xno" || \ 4222if test "x${have_ecore_ipc}" = "xno" || \
4222 test "x${efl_func_shm_open}" = "xno" || \ 4223 test "x${efl_func_shm_open}" = "xno" || \
@@ -4249,6 +4250,7 @@ ECORE_EVAS_MODULE([drm], [${want_drm}],
4249ECORE_EVAS_MODULE([gl-drm], [${want_gl_drm}], 4250ECORE_EVAS_MODULE([gl-drm], [${want_gl_drm}],
4250 [EFL_OPTIONAL_INTERNAL_DEPEND_PKG([ECORE_EVAS], [${want_gl_drm}], [ecore-drm])]) 4251 [EFL_OPTIONAL_INTERNAL_DEPEND_PKG([ECORE_EVAS], [${want_gl_drm}], [ecore-drm])])
4251ECORE_EVAS_MODULE([psl1ght], [${have_ps3}]) 4252ECORE_EVAS_MODULE([psl1ght], [${have_ps3}])
4253ECORE_EVAS_MODULE([eglfs], [${want_eglfs}])
4252 4254
4253ECORE_EVAS_MODULE([opengl-cocoa], [${want_ecore_evas_gl_cocoa}]) 4255ECORE_EVAS_MODULE([opengl-cocoa], [${want_ecore_evas_gl_cocoa}])
4254 4256
diff --git a/src/Makefile_Ecore_Evas.am b/src/Makefile_Ecore_Evas.am
index 3ccf7c1bde..a4f9af5100 100644
--- a/src/Makefile_Ecore_Evas.am
+++ b/src/Makefile_Ecore_Evas.am
@@ -133,9 +133,12 @@ modules_ecore_evas_engines_fb_module_la_SOURCES = $(FBSOURCES)
133modules_ecore_evas_engines_fb_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ 133modules_ecore_evas_engines_fb_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
134@ECORE_EVAS_CFLAGS@ \ 134@ECORE_EVAS_CFLAGS@ \
135@ECORE_FB_CFLAGS@ \ 135@ECORE_FB_CFLAGS@ \
136-I$(top_srcdir)/src/modules/evas/engines/fb 136-I$(top_srcdir)/src/modules/evas/engines/fb \
137-I$(top_srcdir)/src/modules/evas/engines/eglfs \
138@ecore_evas_engines_eglfs_cflags@
137modules_ecore_evas_engines_fb_module_la_LIBADD = \ 139modules_ecore_evas_engines_fb_module_la_LIBADD = \
138@USE_ECORE_EVAS_LIBS@ \ 140@USE_ECORE_EVAS_LIBS@ \
141@ecore_evas_engines_eglfs_libs@ \
139@USE_ECORE_FB_LIBS@ 142@USE_ECORE_FB_LIBS@
140modules_ecore_evas_engines_fb_module_la_DEPENDENCIES = \ 143modules_ecore_evas_engines_fb_module_la_DEPENDENCIES = \
141@USE_ECORE_EVAS_INTERNAL_LIBS@ \ 144@USE_ECORE_EVAS_INTERNAL_LIBS@ \
diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h
index 30e45b1756..377e474a0e 100644
--- a/src/lib/ecore_evas/Ecore_Evas.h
+++ b/src/lib/ecore_evas/Ecore_Evas.h
@@ -91,6 +91,7 @@ extern "C" {
91 */ 91 */
92#define HAVE_ECORE_EVAS_X 1 92#define HAVE_ECORE_EVAS_X 1
93#define HAVE_ECORE_EVAS_FB 1 93#define HAVE_ECORE_EVAS_FB 1
94#define HAVE_ECORE_EVAS_EGLFS 1
94#define HAVE_ECORE_EVAS_X11_GL 1 95#define HAVE_ECORE_EVAS_X11_GL 1
95//#define HAVE_ECORE_EVAS_X11_16 1 96//#define HAVE_ECORE_EVAS_X11_16 1
96//#define HAVE_ECORE_EVAS_DIRECTFB 1 97//#define HAVE_ECORE_EVAS_DIRECTFB 1
@@ -121,6 +122,7 @@ typedef enum _Ecore_Evas_Engine_Type
121 ECORE_EVAS_ENGINE_SOFTWARE_SDL, 122 ECORE_EVAS_ENGINE_SOFTWARE_SDL,
122 ECORE_EVAS_ENGINE_DIRECTFB, 123 ECORE_EVAS_ENGINE_DIRECTFB,
123 ECORE_EVAS_ENGINE_SOFTWARE_FB, 124 ECORE_EVAS_ENGINE_SOFTWARE_FB,
125 ECORE_EVAS_ENGINE_EGLFS,
124 ECORE_EVAS_ENGINE_SOFTWARE_8_X11, 126 ECORE_EVAS_ENGINE_SOFTWARE_8_X11,
125 ECORE_EVAS_ENGINE_SOFTWARE_16_X11, 127 ECORE_EVAS_ENGINE_SOFTWARE_16_X11,
126 ECORE_EVAS_ENGINE_SOFTWARE_16_DDRAW, 128 ECORE_EVAS_ENGINE_SOFTWARE_16_DDRAW,
@@ -1303,6 +1305,7 @@ EAPI void ecore_evas_software_x11_16_extra_event_window_add(Ecore_Eva
1303 * @return The new Ecore_Evas. 1305 * @return The new Ecore_Evas.
1304 */ 1306 */
1305EAPI Ecore_Evas *ecore_evas_fb_new(const char *disp_name, int rotation, int w, int h); 1307EAPI Ecore_Evas *ecore_evas_fb_new(const char *disp_name, int rotation, int w, int h);
1308EAPI Ecore_Evas *ecore_evas_eglfs_new(const char *disp_name, int rotation, int w, int h);
1306 1309
1307EAPI Ecore_Evas *ecore_evas_directfb_new(const char *disp_name, int windowed, int x, int y, int w, int h) EINA_DEPRECATED; 1310EAPI Ecore_Evas *ecore_evas_directfb_new(const char *disp_name, int windowed, int x, int y, int w, int h) EINA_DEPRECATED;
1308EAPI Ecore_DirectFB_Window *ecore_evas_directfb_window_get(const Ecore_Evas *ee) EINA_DEPRECATED; 1311EAPI Ecore_DirectFB_Window *ecore_evas_directfb_window_get(const Ecore_Evas *ee) EINA_DEPRECATED;
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index eb57467441..fec89438f7 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -282,6 +282,12 @@ ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine)
282#else 282#else
283 return EINA_FALSE; 283 return EINA_FALSE;
284#endif 284#endif
285 case ECORE_EVAS_ENGINE_EGLFS:
286#ifdef BUILD_ECORE_EVAS_EGLFS
287 return EINA_TRUE;
288#else
289 return EINA_FALSE;
290#endif
285 291
286 case ECORE_EVAS_ENGINE_SOFTWARE_8_X11: 292 case ECORE_EVAS_ENGINE_SOFTWARE_8_X11:
287 return EINA_FALSE; 293 return EINA_FALSE;
@@ -646,6 +652,22 @@ _ecore_evas_constructor_fb(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, c
646} 652}
647 653
648static Ecore_Evas * 654static Ecore_Evas *
655_ecore_evas_constructor_eglfs(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options)
656{
657 Ecore_Evas *ee;
658 char *disp_name = NULL;
659 unsigned int rotation = 0;
660
661 _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
662 _ecore_evas_parse_extra_options_uint(extra_options, "rotation=", &rotation);
663
664 ee = ecore_evas_eglfs_new(disp_name, rotation, w, h);
665 free(disp_name);
666
667 return ee;
668}
669
670static Ecore_Evas *
649_ecore_evas_constructor_psl1ght(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options) 671_ecore_evas_constructor_psl1ght(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options)
650{ 672{
651 Ecore_Evas *ee; 673 Ecore_Evas *ee;
@@ -769,6 +791,7 @@ static const struct ecore_evas_engine _engines[] = {
769 {"software_x11", _ecore_evas_constructor_software_x11}, 791 {"software_x11", _ecore_evas_constructor_software_x11},
770 {"opengl_x11", _ecore_evas_constructor_opengl_x11}, 792 {"opengl_x11", _ecore_evas_constructor_opengl_x11},
771 {"fb", _ecore_evas_constructor_fb}, 793 {"fb", _ecore_evas_constructor_fb},
794 {"eglfs", _ecore_evas_constructor_eglfs},
772 {"software_gdi", _ecore_evas_constructor_software_gdi}, 795 {"software_gdi", _ecore_evas_constructor_software_gdi},
773 {"software_ddraw", _ecore_evas_constructor_software_ddraw}, 796 {"software_ddraw", _ecore_evas_constructor_software_ddraw},
774 {"direct3d", _ecore_evas_constructor_direct3d}, 797 {"direct3d", _ecore_evas_constructor_direct3d},
@@ -3647,6 +3670,19 @@ ecore_evas_fb_new(const char *disp_name, int rotation, int w, int h)
3647} 3670}
3648 3671
3649EAPI Ecore_Evas * 3672EAPI Ecore_Evas *
3673ecore_evas_eglfs_new(const char *disp_name, int rotation, int w, int h)
3674{
3675 Ecore_Evas *(*new)(const char *, int, int, int);
3676 Eina_Module *m = _ecore_evas_engine_load("fb");
3677 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
3678
3679 new = eina_module_symbol_get(m, "ecore_evas_eglfs_new_internal");
3680 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
3681
3682 return new(disp_name, rotation, w, h);
3683}
3684
3685EAPI Ecore_Evas *
3650ecore_evas_software_x11_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h) 3686ecore_evas_software_x11_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h)
3651{ 3687{
3652 Ecore_Evas *(*new)(const char *, Ecore_X_Window, int, int, int, int); 3688 Ecore_Evas *(*new)(const char *, Ecore_X_Window, int, int, int, int);
diff --git a/src/lib/ecore_evas/ecore_evas_module.c b/src/lib/ecore_evas/ecore_evas_module.c
index 59fb6010cb..239829dec7 100644
--- a/src/lib/ecore_evas/ecore_evas_module.c
+++ b/src/lib/ecore_evas/ecore_evas_module.c
@@ -189,6 +189,9 @@ _ecore_evas_available_engines_get(void)
189#ifdef BUILD_ECORE_EVAS_FB 189#ifdef BUILD_ECORE_EVAS_FB
190 ADDENG("fb"); 190 ADDENG("fb");
191#endif 191#endif
192#ifdef BUILD_ECORE_EVAS_EGLFS
193 ADDENG("eglfs");
194#endif
192 } 195 }
193 else if (!strcmp(name, "x")) 196 else if (!strcmp(name, "x"))
194 { 197 {
diff --git a/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c b/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c
index ed970a590c..a4ba8d58da 100644
--- a/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c
+++ b/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c
@@ -41,6 +41,7 @@
41#endif /* ! _WIN32 */ 41#endif /* ! _WIN32 */
42 42
43static int _ecore_evas_init_count = 0; 43static int _ecore_evas_init_count = 0;
44static Ecore_Fb_Device *dev = NULL;
44 45
45static char *ecore_evas_default_display = "0"; 46static char *ecore_evas_default_display = "0";
46static Eina_List *ecore_evas_input_devices = NULL; 47static Eina_List *ecore_evas_input_devices = NULL;
@@ -212,8 +213,18 @@ _ecore_evas_fb_init(Ecore_Evas *ee, int w, int h)
212 _ecore_evas_init_count++; 213 _ecore_evas_init_count++;
213 if (_ecore_evas_init_count > 1) return _ecore_evas_init_count; 214 if (_ecore_evas_init_count > 1) return _ecore_evas_init_count;
214 215
216 if (!(dev = ecore_fb_device_find("fb0")))
217 {
218 ERR("Could not find framebuffer device with name: %s.", "/dev/fb0");
219 }
220
221 ecore_fb_device_window_set(dev, ee);
215 ecore_event_evas_init(); 222 ecore_event_evas_init();
216 223
224 ecore_fb_inputs_create(dev);
225
226 return _ecore_evas_init_count;
227
217 /* register all input devices */ 228 /* register all input devices */
218 ls = eina_file_direct_ls("/dev/input/"); 229 ls = eina_file_direct_ls("/dev/input/");
219 230
@@ -743,7 +754,115 @@ ecore_evas_fb_new_internal(const char *disp_name, int rotation, int w, int h)
743 (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process, 754 (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
744 (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process, 755 (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
745 (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process, 756 (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
746 (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process); 757 (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
747 evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL); 758 evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
748 return ee; 759 return ee;
749} 760}
761
762#ifdef BUILD_ECORE_EVAS_EGLFS
763EAPI Ecore_Evas *
764ecore_evas_eglfs_new_internal(const char *disp_name, int rotation, int w, int h)
765{
766 Evas_Engine_Info_FB *einfo;
767 Ecore_Evas_Engine_FB_Data *idata;
768 Ecore_Evas *ee;
769
770 int rmethod;
771
772 if (!disp_name)
773 disp_name = ecore_evas_default_display;
774
775 rmethod = evas_render_method_lookup("eglfs");
776 if (!rmethod) return NULL;
777
778 if (!ecore_fb_init(disp_name)) return NULL;
779 ee = calloc(1, sizeof(Ecore_Evas));
780 if (!ee) return NULL;
781 idata = calloc(1, sizeof(Ecore_Evas_Engine_FB_Data));
782
783 ee->engine.data = idata;
784
785 ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
786
787 _ecore_evas_fb_init(ee, w, h);
788
789 ecore_fb_callback_gain_set(_ecore_evas_fb_gain, ee);
790 ecore_fb_callback_lose_set(_ecore_evas_fb_lose, ee);
791
792 ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_fb_engine_func;
793
794 ee->driver = "eglfs";
795 if (disp_name) ee->name = strdup(disp_name);
796
797 if (w < 1) w = 1;
798 if (h < 1) h = 1;
799 ee->rotation = rotation;
800 ee->visible = 1;
801 ee->w = w;
802 ee->h = h;
803 ee->req.w = ee->w;
804 ee->req.h = ee->h;
805
806 ee->prop.max.w = 0;
807 ee->prop.max.h = 0;
808 ee->prop.layer = 0;
809 ee->prop.focused = EINA_FALSE;
810 ee->prop.borderless = EINA_TRUE;
811 ee->prop.override = EINA_TRUE;
812 ee->prop.maximized = EINA_TRUE;
813 ee->prop.fullscreen = EINA_FALSE;
814 ee->prop.withdrawn = EINA_TRUE;
815 ee->prop.sticky = EINA_FALSE;
816
817 /* init evas here */
818 ee->evas = evas_new();
819 evas_data_attach_set(ee->evas, ee);
820 evas_output_method_set(ee->evas, rmethod);
821
822 if (ECORE_EVAS_PORTRAIT(ee))
823 {
824 evas_output_size_set(ee->evas, w, h);
825 evas_output_viewport_set(ee->evas, 0, 0, w, h);
826 }
827 else
828 {
829 evas_output_size_set(ee->evas, h, w);
830 evas_output_viewport_set(ee->evas, 0, 0, h, w);
831 }
832
833 einfo = (Evas_Engine_Info_FB *)evas_engine_info_get(ee->evas);
834 if (einfo && disp_name)
835 {
836 einfo->info.virtual_terminal = 0;
837 einfo->info.device_number = strtol(disp_name, NULL, 10);
838 einfo->info.refresh = 0;
839 einfo->info.rotation = ee->rotation;
840 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
841 {
842 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
843 ecore_evas_free(ee);
844 return NULL;
845 }
846 }
847 else
848 {
849 ERR("evas_engine_info_set() init engine '%s' failed.", ee->driver);
850 ecore_evas_free(ee);
851 return NULL;
852 }
853
854 ecore_evas_input_event_register(ee);
855
856 ee->engine.func->fn_render = _ecore_evas_fb_render;
857 _ecore_evas_register(ee);
858 ecore_evas_input_event_register(ee);
859
860 ecore_event_window_register(1, ee, ee->evas,
861 (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
862 (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
863 (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
864 (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
865 evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
866 return ee;
867}
868#endif