Technology Consulting Company IGEL Co.,Ltd.
Technology Consulting Company Research, Development & Global Standard
Using Linux Media Controller for Wayland/Weston Renderer
Takanari Hayama taki@igel.co.jp http://www.igel.co.jp/
1
Using Linux Media Controller for Wayland/Weston Renderer Technology - - PowerPoint PPT Presentation
Using Linux Media Controller for Wayland/Weston Renderer Technology Consulting Company Research, Development & Takanari Hayama Global Standard taki@igel.co.jp http://www.igel.co.jp/ 1 Technology Consulting Company IGEL Co.,Ltd.
Technology Consulting Company IGEL Co.,Ltd.
Technology Consulting Company Research, Development & Global Standard
1
2
3
Wayland Client Weston Wayland Client Compositor Core Compositor (e.g. DRM) Renderer (e.g. GL) Shell (e.g. desktop) Shell Client (e.g. desktop-shell)
Wayland IPC Local API Call Confidential 4
5
Wayland Client Wayland Client Stub Weston (Wayland Server) Wayland Server Stub OpenGL/ES OpenGL/ES compositor-drm gl-renderer shell libgbm/ libdrm compositor- core pixman- renderer libpximan GPU Kernel Driver DRM/KMS Driver Qt, EFL, etc.
Weston Components Wayland Components Other Components IPC API Call
User Space Kernel Space
wayland protocol
6
Wayland Client OpenGL/ES + wayland_egl GPU driver for Wayland Weston / DRM Compositor OpenGL/ES + WL Ext. GBM DRM/KMS GPU GPU Driver for Wayland Display
wl_egl_window Type wl_egl_window Type
RENDERING DISPLAYING
wl_buffer Type wl_buffer Type
FRAME BUFFERS
gbm_surface Type
CLIENT BUFFERS
wl_buffer Type
FULL SCREEN
wl_buffer Type DRM/KMS BO Type
SCANOUT BUFFERS
Software Hardware
Wayland/Weston Components Khronos w/ Wayland Ext. OSS Components Hardware Specific
wayland protocol
7
Wayland Client OpenGL/ES + wayland_egl GPU driver for Wayland Weston / DRM Compositor OpenGL/ES + WL Ext. GBM DRM/KMS GPU GPU driver for Wayland Display
wl_egl_window Type wl_egl_window Type
RENDERING DISPLAYING
wl_buffer Type wl_buffer Type
FRAME BUFFERS
gbm_surface Type
CLIENT BUFFERS
wl_buffer Type
FULL SCREEN
wl_buffer Type DRM/KMS BO Type
SCANOUT BUFFERS
Software Hardware
Wayland/Weston Components Khronos w/ Wayland Ext. OSS Components Hardware Specific
OpenGL/ES 2.Commit buffers w/ eglSwapBuffers()
buffers as KMS BOs.
OpenGL/ES
destination frame buffers allocated with GBM.
wayland protocol
8
Wayland Client OpenGL/ES + wayland_egl GPU driver for Wayland Weston / DRM Compositor OpenGL/ES + WL Ext. GBM DRM/KMS GPU GPU driver for Wayland Display
wl_egl_window Type wl_egl_window Type
RENDERING DISPLAYING
wl_buffer Type wl_buffer Type
FRAME BUFFERS
gbm_surface Type
CLIENT BUFFERS
wl_buffer Type
FULL SCREEN
wl_buffer Type DRM/KMS BO Type
SCANOUT BUFFERS
Software Hardware
Wayland/Weston Components Khronos w/ Wayland Ext. OSS Components Hardware Specific
OpenGL/ES 2.Commit buffers w/ eglSwapBuffers()
buffers as KMS BOs.
9
10
– wl_display for clients – gbm handle for Weston
– EGL_KHR_image_pixmap – EGL_WL_bind_wayland_display
– EGL_WAYLAND_BUFFER_WL
– eglBindWaylandDisplayWL – eglUnbindWaylandDisplayWL – eglQueryWaylandBufferWL
11
WSEGL for Wayland
12
Wayland Client Renesas OpenGL/ES libgbm w/ KMS Backend wayland-kms
Wayland/Weston Components New OSS Components Standard OSS Components
IPC API Call
Wayland Client Support Wayland Server Support Weston (Wayland Server) Wayland Server Stub EGL with Wayland Extension Wayland Client Stub libdrm & libkms
Proprietary
wayland-egl
13
14
15
16
17
Wayland Client Wayland Client Stub Weston (Wayland Server) Wayland Server Stub OpenGL/ES gl-renderer compositor- drm KMS BO User Space Kernel Space Wayland GPU Driver KMS Driver OpenGL/ES Wayland GPU Driver
18
Wayland Client Wayland Client Stub Weston (Wayland Server) Wayland Server Stub OpenGL/ES gl-renderer compositor- drm KMS BO User Space Kernel Space Wayland GPU Driver KMS Driver OpenGL/ES Wayland GPU Driver
Buffer Allocation. Client creates rendering surface with EGL API. WSEGL allocates memory with KMS BO, and make avaialable to GPU.
19
Wayland Client Wayland Client Stub Weston (Wayland Server) Wayland Server Stub OpenGL/ES gl-renderer compositor- drm KMS BO User Space Kernel Space Wayland GPU Driver KMS Driver OpenGL/ES Wayland GPU Driver
Rendering to the allocated buffer. GPU gets all details needed about the buffer via WSEGL.
20
Wayland Client Wayland Client Stub Weston (Wayland Server) Wayland Server Stub OpenGL/ES gl-renderer compositor- drm KMS BO User Space Kernel Space Wayland GPU Driver KMS Driver OpenGL/ES Wayland GPU Driver
When a client calls eglSwapBuffers(), WSEGL commits a buffer to the server via Wayland. The details of the buffer is DMABUF fd, a stride, a size, and a pixelf ormat.
21
Wayland Client Wayland Client Stub Weston (Wayland Server) Wayland Server Stub OpenGL/ES gl-renderer compositor- drm KMS BO User Space Kernel Space Wayland GPU Driver KMS Driver OpenGL/ES Wayland GPU Driver
When the server receives the buffer, it imports with eglCreateImageKHR().
22
Wayland Client Wayland Client Stub Weston (Wayland Server) Wayland Server Stub OpenGL/ES gl-renderer compositor- drm KMS BO User Space Kernel Space Wayland GPU Driver KMS Driver OpenGL/ES Wayland GPU Driver
WSEGL gets details of the buffer from wayland- kms, and asks to import the given DMABUF. The buffer is then made available to GPU.
23
Wayland Client Wayland Client Stub Weston (Wayland Server) Wayland Server Stub OpenGL/ES gl-renderer compositor- drm KMS BO User Space Kernel Space Wayland GPU Driver KMS Driver OpenGL/ES Wayland GPU Driver
Gl-renderer can now refer the buffer passed by the client, and composes a final output.
24
25
26
27
28
29
Entity Entity 1 1 Entity 2 1
May have multiple sink pads
30
31
32
33
Wayland Client Wayland Client Stub Weston (Wayland Server) Wayland Server Stub OpenGL/ES v4l2-renderer device for VSPD compositor-drm v4l2-renderer shell libgbm/ libdrm compositor- core GPU Kernel Driver DRM/KMS Driver Qt, EFL, etc.
Weston Components Wayland Components Other Components IPC API Call
User Space Kernel Space VSP V4L2 Driver
New Components
New components added to Weston. Plus Minimum changes to the existing compositor- drm to host a v4l2- renderer.
34
35
36
API Descriptions init Initialize a v4l2 media controller device. create_output Create an output. No buffer passed yet. set_output_buffer Set an output buffer for the output. create_surface Create a surface. No buffer passed yet. attach_buffer Set a buffer for the surface. begin_compose Begin a new composition. finish_compose Finish the composition. draw_view Compose the surface. get_capabilities Get capabilities of the V4L2 Renderer Device.
37
38
39
40
41
42
Output 0 Output 1
region
View position is in Global Coordinate. Rendering needs to take care of
coordinate. Opaque region is specified in View Coordinate.
43
Components Descriptions EGL with Wayland Extension A thin layer to support Wayland specific EGL APIs and a native buffer type for eglCreateImageKHR(). https://github.com/thayama/libegl wayland-kms A subclass of wl_buffer for to pass KMS BO. Defines a wl_kms wayland protocol, and server side codes. https://github.com/thayama/wayland-kms libgbm w/ KMS Backend GBM frontend extracted from Mesa and used in Weston with a KMS Backend support. https://github.com/thayama/libgbm WSEGL for Wayland A bridge component between GPU and Wayland.
44