1. 1Samsung Open Source Group
Cedric Bail
Senior Graphics Developer
Samsung Open Source Group
cedric@osg.samsung.com
Enlightenment Foundation Libraries
An UI Toolkit Designed for the Embedded World
2. 2Samsung Open Source Group
● What are the Enlightenment Foundation Libraries?
● Where are they used?
● Where it is going?
● Questions?
5. 5Samsung Open Source Group
Enlightenment 17
– Enlightenment project started in 1997
– Windows Manager
– First Windows Manager of GNOME
– Full rewrite started in 2001
– Primary belief is there will never be “a year of the Linux desktop”
– Designed with the embedded world in mind…
– … and needed a toolkit !
6. 6Samsung Open Source Group
Enlightenment
– 17 was just the version number, we are now at 19!
– Use EFL scenegraph and main loop
– Not different from any other EFL application
– Composite and Window Manager
– Wayland client support
– Multiple backend (X, FB, DRM, …)
– Highly customizable (Profiles, modules and themes)
7. 7Samsung Open Source Group
Enlightenment Community
● The Enlightenment community
– 60 uniq contributors per release (10 cores)
– 1000 users that build from source
– 2 distributions based on Enlightenment (Bodhi and Elive)
● The Enlightenment community expected Linux to takeoff in the embedded wo
rld, not on the desktop
● The values shared by this community:
● Customizable
● Scalable
● Fast
● Light
● Feature Rich
8. 8Samsung Open Source Group
Enlightenment Foundation Libraries (EFL)
● Spent a decade writing a modern graphic toolkit
● Licensed under a mix of LGPL and BSD license
● Focus on embedded devices
● First release on January 2011
● Stable, long term API/ABI
● In the process of releasing version 1.13
● 3 month release cycle
9. 9Samsung Open Source Group
State of EFL
● Designed for creating a Windows Manager (WM), now used for any type of
application
● Has its own scene graph and rendering library
● Optimized to reduce CPU, GPU, memory and battery usage
● Supports international language requirements (LTR/RTL, UTF8)
● Supports all variations of screens and input devices (scale factor)
● Fully Themable (layout of the application included)
● Supports profiles
● Can take up as little as 8MB of space with a minimal set of dependencies
● Has a modular design
10. 10Samsung Open Source Group
Why We Care About Optimization
● Moore's law doesn't apply to battery and memory bandwidth
● Most rendering operations are limited directly by memory bandwidth
● Many embedded devices have less available memory than a low end phone
– Refrigerator, oven, dish washer, washing machine, home automation…
● Even a low end phone doesn't have much memory to space once you run a
browser!
● GL context at best consumes 10MB, usually more around 40MB; this is bad
for multitasking!
11. 11Samsung Open Source Group
Current State of Optimization
● Application runtime memory use is mostly driven by screen size
● EFL can fit in 8MB on disk (static compilation with minimal dependencies)
● No hard requirement on the GPU
● Enlightenment + Arch Linux combined :
– 48 MB RAM
– 300 Mhz (1024 x 768)
– Yes, for a desktop profile!
13. 13Samsung Open Source Group
Bird's Eye View of EFL
X11
OpenGL
EINA
MEMPOOL
EVAS
JPEG
PNG
GIF
TIFF
EET
SVG
MORE...
XRENDER
OPENGL/ES
X11 (SOFTWARE)
FB (SOFTWARE)
MORE...
EET
EMBRYO
EDJE
ELEMENTARY E-DBUS DBUS
ECORE
FILE
X11
CON
IPC
FB
EVAS
QUARTZ
INPUT
JOB
SDL
WIN32/CE
MORE...
EFREET
MEMORY (RAM)
(DATA STRUCTURES)
DATA IN STORAGE
(DISK/FLASH ETC.)
PIXELS ON A
DISPLAY
IMAGE FILES
IN STORAGE
OTHER APPLICATIONS
AND SERVICES
USER INTERACTION
AND FEEDBACK
INPUT DEVICES
AND OTHER
SYSTEM SERVICES
AND COMPONENTS
ABSTRACTED UI
COMPONENTS
FROM STORAGE
FREEDESKTOP.ORG
STANDARDS LAYER
FAST VIRTUAL
MACHINE
FOR LOGIC
AUGMENTATION
14. 14Samsung Open Source Group
EET: Serialization of C Structure
● Something very specific to EFL
● Fast serialization library for file storage and network communication
● Store image, sounds, font
● Reduces overhead when loading the same data across multiple applications
● Provides tools to convert from and to a human readable form
● Configurations and themes are built with this library
15. 15Samsung Open Source Group
Evas: Scene Graph Canvas
●
The brain of EFL
● Has its own scene graph and rendering library with more than 10 years of optimization work
● Provides glitch-free rendering
● Reduces overdrawing
● Deduplicates as much as possible to reduce memory waste
● Offers compressed glyph rendering
● Is portable (SDL, X11, Wayland, FB, DRM, Windows, Mac OS X, ...)
●
Has an optimized software renderer (MMX, SSE*, Neon)
● Optimized use of GPU (optional)
– Supports partial updates (assuming the driver does)
– Reduces context and texture switches as much as possible
– Reduces memory overhead
16. 16Samsung Open Source Group
Scene Graph
Container
Container Container
Container Container
Example scene graph
17. 17Samsung Open Source Group
Evas: Scene Graph
●
A basic scene graph rendering ascends from the bottom to the top of the tree
●
Possible optimizations
– Reorder GL operations to limit Texture and Shader changes
– Partial updates
– Cutout opaque areas
– Complete drawing operations in another thread
– Efficiently cache costly CPU operations between frames
– Deduplicate objects
18. 18Samsung Open Source Group
Evas: Frame Delta
Computation of previous and current frame with cutout
19. 19Samsung Open Source Group
Evas: Rendering Pipeline
Current and future rendering pipeline for Evas
20. 20Samsung Open Source Group
Evas: Learned Experience From Our Scene Graph
● After initial startup... it's mostly bound to the memory
● Vector graphics and smooth scaled images are bound to the CPU
● It's important to optimize memory usage for both GL and software
● Deduplication of strings, images and text makes a major difference
● The compressed glyph (software) and image (GL) also make a difference
21. 21Samsung Open Source Group
Evas: Issue With Design of Future Pipeline
● CPU and memory frequency are very important
● Evas was created when dual core CPU's were found only on high end servers
●
It's slowly evolving to take advantage of more cores
● The Linux Kernel handles it poorly on embedded devices
● Typical scenario :
1. Long periods of IO bound operations (Main loop)
2. Followed by a short need for all cores to be up and running
3. Processes are then limited by memory speed
● In this scenario, it's not capable of running at the right speed with the right number of
cores
● A lot of work is needed in the kernel before we can totally benefit from it
22. 22Samsung Open Source Group
Edje: Theme and Layout Engine
● The heart of EFL
● Theme and layout engine
● Descriptive language
● Uses Evas for rendering logic (fully independent from the system)
● Doesn't require a FPU
● Optimizes load time (time to first frame) and run time
● Reduces memory fragmentation
24. 24Samsung Open Source Group
Elementary: Widgets Set
● Widgets toolkit
● Based on EFL infrastructure, uses Edje & Evas
● Screen and input independence achieved through :
– Scale factor
– Finger size
● Profile support (define configuration on a per Window basis)
● Fully themable
● Supports touchscreens
25. 25Samsung Open Source Group
Many Other Useful Components
● Eina: C data types library and various system helper
● Ecore: main loop, events, network and threads infrastructure
● Eio: asynchronous Input/Output
● Emotion: video component integration
● Eeze: hot plug and device detection
● Eldbus: dbus integration library
● Efreet: Freedesktop library
● Eo: safe, fast and light object infrastructure
● Eolian: compilation time introspection infrastructure
● Elocation: geoclue integration
26. 26Samsung Open Source Group
Bindings for all Sorts of Languages
● C++11 modern binding (RAII, lambda, …)
● Lua
● Python
● JS
● Ocaml (see http://win-builds.org)
32. 32Samsung Open Source Group
Many Other Products
● Fridge
● Printer
● Medical device
● Set top box
● Home automation
● Navigation system
● More to come...
34. 34Samsung Open Source Group
Improving Performance
● Faster, lighter, better
● Better support for systems without MMU
● Improve speed of software renderer (more colorspace support)
● Slowly roll in threads for CPU intensive tasks
● Improve speed of GPU renderer (more efficient packing)
● Speed up animation filter (Dedicated assembler and shader)
● Efficiently share data across processes
● Experiment with new memory layouts for Eo object
35. 35Samsung Open Source Group
Improve Functionality
● Improve 3D scene graph inside Evas canvas (3D world, Effect, …)
● Add SVG scene graph and Vector graphics API in Evas
● Animated filters
● Improve portability (Windows, Mac OS X)
● Keep it always up to date (C++, Lua, Python, JS, Ocaml)
● Improve tests and automatic build system to improve quality
● Improve documentation
36. 36Samsung Open Source Group
Animated Filter !
Animated bump map filter effect on an image
37. 37Samsung Open Source Group
3D Scene Graph
Example of using current Evas 3D scene graph
38. 38Samsung Open Source Group
The Future of Enlightenment
● X11 will be made optional by serving as a KMS/DRM Wayland Compositor
● Incorporate Elementary widgets set
● Differentiate from Qt logic to provide a library to do your own compositor
→ Enlightenment is the base to put your module in for your specific needs
● Improve support for HiDPI
● Improve modularity
● Support more upstream profiles (Tiling, mobile, TV, ...)
39. 39Samsung Open Source Group
EFL Cheat Sheet
● Fast release cycle: 3 months
● Used in Tizen
● Will always support systems with no GPU and limited resources
● Continuous EFL benchmarking to make sure that each release improves on
the last
● Majority is licensed under LGPL
● Backend is covered under MIT license
● World wide community
40. 40Samsung Open Source Group
Questions?
Twitter: @SamsungOSG
Email: jobs@osg.samsung.com
Slides: http://www.slideshare.net/SamsungOSG
We're Hiring!