930b0b4c2c13bdc2264f99a528c678264124b20b
[profile/ivi/layer-management.git] / README
1 Sections in this file describe:
2 - Introduction
3 - Component Overview
4 - Required platform capabilities
5 - How to build on different platforms
6
7
8 Introduction
9 ====================================
10 In the automotive domain, the most HMI systems are using their own window manager implementation. 
11 Many applications (e.g. navigation, reversing camera) are implemented standalone and 
12 therefore one service is used to composite all applications to the final image on the screen. This Service
13 is also know as LayerManagement. 
14 This Component provides a common API and a proof-of-concept implementation for the Layer Management Service. 
15 This service should improve the existing vendor-specific layer management implementations 
16 which have the following features :
17
18     * Fixed number of hardware layers
19     * Hardware accelerated compositing
20     * Platform dependent
21     * Number of layers not extensible during runtime
22     * Vendor-specific implementation
23     * No standardized interface
24     * Hardware dependent
25     * No change during runtime possible 
26
27 The IVI Layer Management have the following enhancements :
28
29     * Well-defined interface
30     * Standardized compositing
31     * Convenient and consistent access to hardware accelerated modules
32     * Separation of HMI and Layer Management
33     * Dynamically Extensions during runtime
34     * Low integration complexity
35     * Reduced dependency on hardware 
36
37 Component Overview
38 ====================================
39 The IVI Layer Management consist of three subcomponents.
40
41 The LayerManagementService
42 ===
43 This is the main component which controls and handles
44 the different layers with its content. Furthermore he
45 will execute the commands which are deployed by the corresponding
46 communicator. The content of the different layers are deployed to the
47 renderer.  
48
49 The LayerManagementCommunicator
50 ===
51 This subcomponent will handle the LayerManagement API messages. Generally
52 a communicator will establish the communication between application and the
53 LayerManagementService. The concept behind the communicator is to abstract
54 the required ipc mechanism on the target platform. 
55
56 The LayerManagementRenderer
57 ===
58 This subcomponent will handle the rendering of the different layers and its content on the
59 final used target platform. The concept behind the renderer is to abstract
60 the required rendering mechanism on the target platform. 
61
62 Required Platform capabilities
63 ====================================
64
65 Platform with X11 and OpenGL ES 2.0
66 ===
67
68 If you have choosen the X11GLESRenderer as rendering backend, then the following
69 Extensions have to be supported by the TargetPlatform :
70
71 X11 Extensions:
72
73 x-composite : This extension should support redirecting of egl Surfaces to x11 pixmaps too.
74 x-damage
75
76 EGL / OpenGL ES 2.0:
77
78 EGL_IMAGE_KHR : 
79 The following functions should be supported by the vendor specific graphic driver
80 glEGLImageTargetTexture2DOES
81 eglCreateImageKHR
82 eglDestroyImageKHR
83 Furthermore it should be supported to create an egl image from an x11 pixmap.  
84
85 Platform with X11 and OpenGL
86 ===
87
88 If you have choosen the GLXRenderer as rendering backend, then the following
89 Extensions have to be supported by the TargetPlatform :
90
91 X11 Extensions:
92
93 x-composite : This extension should support redirecting of egl Surfaces to x11 pixmaps too.
94
95 GLX / OpenGL :
96
97 GLX_TEXTURE_FROM_PIXMAP : 
98 The following functions should be supported by the vendor specific graphic driver
99 Furthermore it should be supported to create an texture from an x11 pixmap.  
100
101
102 Beagle board platform
103 ===
104
105 If you have choosen the BeagleRenderer as rendering backend, than the following
106 kernel module must be available too :
107
108 CMEM Module is needed, it can be downloaded from
109
110 http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/linuxutils/index.html
111
112 The EGL implementation on the beagle board should support the following egl config: 
113
114 EGL_SURFACE_TYPE = EGL_WINDOW_BIT | EGL_PIXMAP_BIT
115 EGL_RENDERABLE_TYPE = EGL_OPENGL_ES2_BIT,
116 EGL_RED_SIZE = 8
117 EGL_ALPHA_SIZE = 8 
118 EGL_BIND_TO_TEXTURE_RGBA = EGL_TRUE
119
120 Furthermore the application which should be rendered by the layermanagement, should initialize egl
121 by the following steps:
122         
123 1. Get EGL Display
124 2. Initialize EGL
125 3. Bind API
126 4. Choose EGL Config
127 5. Allocate native pixmap Structure 
128 6. Allocate native pixmap space by CMEM_alloc
129 7. Get physical address of native pixmap using the CMEM module, and assign the address to the native pixmap structure.
130 8. Create egl pixmap surface using the allocated native pixmap.
131 9. Create egl context.
132 10. Make egl context with the surface as current.
133
134
135 How to build on different platforms
136 ====================================
137
138 These conditions need to be met in order to build the LayerManager component:
139
140 - CMake required (version 2.6 or higher)
141
142 Building the LayerManager breaks down to the following steps:
143
144 1. Pull the current codebase from the git repository to your target source directory [referred to as <source-dir>]
145
146    Example: git clone https://git.genivi.org/srv/git/layer_management
147
148    This should give you a directory called "layer_management" in your current directory.
149
150 2. Create a build directory, e.g. IVILayerManagement_build [referred to as <build-dir>]
151
152    Example: mkdir IVILayerManagement_build
153
154 3. In <build-dir> Generate build system for your platform using CMake.
155    This step provides some customization options to configure build options.
156
157    Example: cd <build-dir>
158             cmake <source-dir> [optional_build_options]
159    
160    For a full list of available build options in [optional_build_options] see "Supported Build Options"   
161
162 4. Start the build.
163
164    Example: make
165
166 5. Install LayerManager on local system.
167    Note: This step will require root priviledges on most systems.
168
169    Example: sudo make install
170
171 The LayerManager may now be started by calling "LayerManagerService".
172
173 Needed Libraries
174 ===
175
176 You need both development packages and libraries for
177
178 LayerManagerService
179 --
180 libdbus
181
182 X11GLESRenderer:
183 --
184 Core X11 libraries
185 X11 Composite libraries
186
187 Vendor specific EGL 1.4 Libraries, which are support the EGL_IMAGE_KHR Extension including
188 build an EGL Image from X11Pixmap
189 Vendor specific OpenGL ES 2.0 Libraries, with JIT compiler to support shader which are
190 delivered as source code
191
192 X11Renderer:
193 ---
194 Core X11 libraries
195 X11 Composite libraries
196
197 OpenGL 1.1
198 GLX
199
200 Supported Build Options
201 ===
202
203 - Build configuration:
204   Option: -DCMAKE_BUILD_TYPE=DEBUG or
205           -DCMAKE_BUILD_TYPE=RELEASE
206
207 - Build for X11 Desktop with GLX Renderer
208   Option: -DWITH_DESKTOP=ON or
209           -DWITH_DESKTOP=OFF
210
211 - Build for X11 with OpenGL ES 2.0 Renderer
212   Option: -DWITH_X11_GLES=ON or
213           -DWITH_X11_GLES=OFF
214           
215 - Build EGL examples
216   Option: -DWITH_EGL_EXAMPLE=ON or
217           -DWITH_EGL_EXAMPLE=OFF
218
219 - Build GLX examples
220   Option: -DWITH_GLX_EXAMPLE=ON or
221           -DWITH_GLX_EXAMPLE=OFF
222
223 - Build available tests
224   Option: -DWITH_TESTS=ON or
225           -DWITH_TESTS=OFF
226
227   Remark: Test File are currently not upstreamed.       
228
229 - Build for diferent Platforms
230
231   You have the choice to use GLXRenderer or X11GLESRenderer.
232
233   GLXRenderer (X11Renderer.so) which is normaly used for a Desktop, VMWare Image and GMA500 based Headunits
234
235   cmake <source-dir>/ -DWITH_DESKTOP=ON -DWITH_GLX_EXAMPLE=ON -DWITH_TESTS=OFF -DWITH_EGL_EXAMPLE=OFF -DWITH_X11_GLES=OFF
236
237   X11GLESRenderer which is used on more embedded device which are supporting EGL and OpenGL ES 2.0
238
239   cmake <source-dir>/ -DWITH_DESKTOP=OFF -DWITH_GLX_EXAMPLE=OFF -DWITH_TESTS=OFF -DWITH_EGL_EXAMPLE=ON -DWITH_X11_GLES=ON
240
241