Tizen Buffer HAL and - Amazon Web Services · •Tizen Buffer HAL ... Wayland Client Buffer IOCTL...

28
1 Copyright © 2017 Samsung. All Rights Reserved. Tizen Buffer HAL and Tizen Display HAL SooChan Lim Samsung Electronics

Transcript of Tizen Buffer HAL and - Amazon Web Services · •Tizen Buffer HAL ... Wayland Client Buffer IOCTL...

1

Copyright © 2017 Samsung. All Rights Reserved.

Tizen Buffer HAL and

Tizen Display HAL SooChan Lim Samsung Electronics

2

• Introduction

• Tizen Buffer HAL

• Tizen Display HAL

• Conclusion

• References

Contents

3

• Tizen Platform provides the HAL(Hardware Abstraction Layer) to get the portability for the various OEM's hardware and kernel.

• OEM and Vendor can bring up the window system when they have their own Tizen Buffer&Display HAL backends.

• This session introduces the Tizen Buffer HAL and Tizen Display HAL.

Introduction

4

Introduction | Window System Diagram

Uses

Application

Backend Module

Top-level Module

Kernel layer – display sub system, memory sub system

Enlightenment (Display Server)

Tizen Buffer HAL

TBM (Tizen Buffer Manager) Tizen Display HAL TDM(Tizen Display Manager)

GL / EGL

TDM Backend TBM Backend

GPU Vender DDK For Tizen

EFL

H

ard

wa

re

ind

epen

den

t

Ha

rdw

are

d

epen

den

t

Tizen API

Native App

5

Tizen Buffer HAL | Diagram

Tizen Buffer HAL TBM (Tizen Buffer Manager)

libtbm backend module

libwayland-tbm

GPU Vender DDK For Tizen

libtdm

H

ard

wa

re

ind

epen

den

t H

ard

wa

re

dep

end

ent

App

EFL

Wayland Client

Buffer IOCTL

Enlightenment (Display Server)

EGL

Uses

Module

Process boundary

Legend

Backend Module

Wayland Server

Kernel

Tizen Buffer HAL TBM (Tizen Buffer Manager)

libtbm backend module

libwayland-tbm

GPU Vender DDK For Tizen

EGL

EFL

6

Tizen Buffer HAL | Why does it need? (1/3)

Application or Framework

exynos drm

exynos drm

sprd drm

vigs drm

vendor memory manager

Different vendors provides different user-level interface for the memory manager.

sprd drm

vigs drm

vendor memory manager

Kernel

Application or Framework has to get the implementation of each memory manager. Need Common Interface to control the user-level interfaces of every kernel memory manager

7

Tizen Buffer HAL | Why does it need? (2/3)

Display Server

ARGB8888 Buffer

OpenGL Application

OpenGL HW Multimedia

HW Display

Controller

There is the hardware restriction of the stride alignment.

Multimedia Application

YUV420 Buffer

Kernel

Display Controller needs the specific stride restriction.

ARGB8888 Buffer

OpenGL HW needs the specific stride restriction.

Multimedia HW needs the specific stride restriction.

Every Application or Framework has to change the implementation in each HW restriction Need Common Interface to get the information of the stride and size.

8

Tizen Buffer HAL | Why does it need? (3/3)

Enlightenment (Display Server)

Buffer

There is a need to set the specific hw memory to the specific hw layer.

Memory manager

Display Controller

Query the buffer flags which can display the specific hw layer.

Allocate the buffer with the flags which is queried from Display controller.

Kernel

There is a hardware of which Display controller accepts the specific buffer to display on a screen. Display Server has to be modified in each display controller hardware. Need Common Interface to create the buffer with the specific flags.

9 Display Server

Tizen Buffer HAL | TBM(Tizen Buffer Manager)

exynos drm

sprd drm

vigs drm

vendor memory manager

Kernel

OpenGL Application

Multimedia Application

TBM(libtbm) provides the common interface for the graphic buffers. It originated at 2012. The libtbm provides two interfaces. 1. the front-end interface to manage the graphic memory 2. the backend interface which is OAL(OEM Adaptation Layer) for implementing the libtbm backend module.

TBM(libtbm)

libtbm backend

OEMs or Vendors can implement their own

libtbm backend modules.

10

• TBM(libtbm) has the OAL(OEM Adaptation Layer).

• The OAL interface defines in the tbm_backend.h file.

• TBM(libtbm) requests the operation and the

information of the buffer object(tbm_bo) and the

format to the tbm backend module through the OAL.

Tizen Buffer HAL | OAL (1/2)

11

• Requirements to implement the libtbm backend

module.

– allocate/free the memory with the size and the flags.

– export/import the memory via dmabuf fd or unique id.

– return the low level memory handle.

• for example, virtual address, gem memory, dmabuf fd …

– return the format list that the backend supports.

– return the plane information of the memory

• size, pitch(stride), offset of the memory

Tizen Buffer HAL | OAL (2/2)

12

Tizen Buffer HAL | Reference devices

There are reference implementations for the Tizen reference targets. You can refer to the TBM porting guide. https://wiki.tizen.org/wiki/Tizen_3.0_Porting_Guide#Buffer_Management

Refernece Target TM1 (Z3) TM2 (Note4) TW1 (GearS2) Emulator

chipset spreadtrum exynos exynos Emulator(vigs)

TBM backend libtbm-sprd libtbm-exynos libtbm-exynos libtbm-vigs

Git project platform/adaptation/spreadtrum/libtbm-sprd

platform/adaptation/samsung_exynos/libtbm-exynos

platform/adaptation/samsung_exynos/libtbm-exynos

platform/adaptation/emulator/libtbm-vigs

13

Tizen Display HAL | Diagram

Ha

rdw

are

in

dep

end

ent

Ha

rdw

are

d

epen

den

t

TBM (libtbm)

Tizen Display HAL TDM(Tizen Display Manager)

App EFL libwayland

Wayland Client

Enlightenment (Display Server)

Display controller

Display device

Buffer IOCTL

TBM backend module

TDM backend module

Wayland Server

Kernel

Uses

Module

Process boundary

Legend

Backend Module

14

Tizen Display HAL | Why does it need? (1/3)

Xorg Server

X video driver

Display Controller

Enlightenment(Display Server) does not have the HAL layer.

Kernel

Display Server (Enlightenment)

only support the standard

fb or drm

Kernel

Display Controller

X window system (Tizen 2.4)

Wayland window system (Tizen 3.0)

No porting layer(HAL layer) in Enlightenment

and EFL.

15

Tizen Display HAL | Why does it need? (2/3)

Enlightenment (Display Server)

fbdev

fbdev drm mode

setting vendor

display module

Different vendors provides different user-level interface for the display devices.

drm vendor

user interface for display

Kernel

OEM and Vendor should get the knowledge of the EFL. Need Common Interface to control the user-level interfaces of every display device

16

Tizen Display HAL | Why does it need? (3/3)

Enlightenment (Display Server)

Display Server needs to know the capabilities of the layers. For example, if the layer support only scanout buffer, enlightenment can know that through the layer capabilities.

Memory manager

Display Controller

Query the layer capabilities at the initial time.

Allocate the scanout buffer

Kernel

There is no common interface to get the layer capabilities.

17

Enlightenment (Display Server)

Tizen Display HAL | TDM(Tizen Display Manager)

TDM(libtdm)

libtdm backend

TDM(libtdm) provides the common interface for the display control. It originated at 2015. The libtdm provides two interfaces. 1. the front-end interface to manage the display control. 2. the backend interface which is OAL(OEM Adaptation Layer) for implementing the libtdm backend module. The libtdm is only used by the Display Server in Tizen Platform.

OEMs or Vendors can implement their libtdm

backend modules.

fbdev drm mode

setting vendor

display module

Kernel

18

• TDM(libtdm) has the OAL(OEM Adaptation Layer).

• The OAL interface defines in the tdm_backend.h file.

• TDM(libtdm) requests the operation and the

information of the tdm_display, tdm_output and

tdm_layer object to the tbm backend module.

Tizen Display HAL | OAL (1/5)

19

Tizen Display HAL | OAL (2/5)

• TDM consists of display,

outputs and layers

– A display object has a

list of output objects

– A output object has a list

of layer objects

Display

Output (LVDS)

Output (HDMI)

Layer

Layer

Layer

Layer

...

...

20

Tizen Display HAL | OAL (3/5)

• libtdm backend module

provides

– a list of outputs

Display

Output (LVDS)

Output (HDMI)

...

21

• libtdm backend module provides – the connection type/status of an

output

– a list of available output modes

– a list of available output properties

– the physical size of an output

– the device HW capabilities of an output • size(min/max/align)

– the a list of layers

– the calling the vblank handler function when the hw vblank interrupt occurs

Tizen Display HAL | OAL (4/5)

Output

Layer

Layer

....

22

• libtdm backend module provides

– the type of a layer

• cursor, primary, overlay, graphic, video

– a list of available layer properties

– the device HW capabilities of a

layer

• scale, transform, available formats

– to set a buffer to a layer in order to

display on screen

Tizen Display HAL | OAL (5/5)

Layer (overlay)

Layer (primary)

Display Controller

(screen)

(set buffer)

(set buffer)

23

Tizen Display HAL | Reference devices

There are reference implementations for the Tizen reference targets. You can refer to the TDM porting guide. https://wiki.tizen.org/wiki/Tizen_3.0_Porting_Guide#Display_Management

Refernece Target TM1 (Z3) TM2 (Note4) TW1 (GearS2) Emulator

chipset spreadtrum exynos exynos Emulator(vigs)

TDM backend libtdm-sprd libtdm-exynos libtdm-exynos libtdm-drm

Git project platform/adaptation/spreadtrum/libtdm-sprd

platform/adaptation/samsung_exynos/libtdm-exynos

platform/adaptation/samsung_exynos/libtdm-exynos

platform/adaptation/libtdm-drm

24

• You need to implement the libtbm backend module

and libtdm backend module for your hardware to

bring up.

• You can refer to the TBM&TDM porting guide or the

implementation of the existing backend modules in

Tizen git respositories.

Conclusion

25

• Graphics Porting Guide – Graphics Porting Guide : https://wiki.tizen.org/wiki/Tizen_3.0_Porting_Guide#Graphics_and_UI_2

– TBM Porting Guide : https://wiki.tizen.org/wiki/Tizen_3.0_Porting_Guide#Buffer_Management

– TDM Porting Guide : https://wiki.tizen.org/wiki/Tizen_3.0_Porting_Guide#Display_Management

• Git repositories – libtbm : https://review.tizen.org/gerrit/#/admin/projects/platform/core/uifw/libtbm

– libtbm-exynos : https://review.tizen.org/gerrit/#/admin/projects/platform/adaptation/samsung_exynos/libtbm-exynos

– libtbm-sprd : https://review.tizen.org/gerrit/#/admin/projects/platform/adaptation/spreadtrum/libtbm-sprd

– libtbm-vigs : https://review.tizen.org/gerrit/#/admin/projects/platform/adaptation/emulator/libtbm-vigs

– libtdm : https://review.tizen.org/gerrit/#/admin/projects/platform/core/uifw/libtdm

– libtdm-exynos : https://review.tizen.org/gerrit/#/admin/projects/platform/adaptation/samsung_exynos/libtdm-exynos

– libtdm-sprd : https://review.tizen.org/gerrit/#/admin/projects/platform/adaptation/spreadtrum/libtdm-sprd

– libtdm-drm : https://review.tizen.org/gerrit/#/admin/projects/platform/adaptation/libtdm-drm

References

26 Thank you

27 Appendix

28

• OpenGLES/EGL porting Guide

– https://wiki.tizen.org/3.0_Porting_Guide/Graphics_an

d_UI/OpenGL

• Tizen 3.0 's Window System Integration Layer of

OpenGLES/EGL & Vulkan Driver (libtpl-egl,

vulkan-wsi-tizen)

– https://www.x.org/wiki/Events/XDC2016/Program/mun_tiz

en/

OpenGLES/EGL Porting