Running Android on the Mainline Graphics Stack Robert Foss - - PowerPoint PPT Presentation

running android on the mainline graphics stack
SMART_READER_LITE
LIVE PREVIEW

Running Android on the Mainline Graphics Stack Robert Foss - - PowerPoint PPT Presentation

Running Android on the Mainline Graphics Stack Robert Foss @memcpy_io Agenda Android History Android on Mainline Current Status Big Picture Android History Android History Qualcomm diff with mainline, # lines 4000000


slide-1
SLIDE 1

Running Android

  • n the Mainline

Graphics Stack

Robert Foss @memcpy_io

slide-2
SLIDE 2
  • Android History
  • Android on Mainline
  • Current Status
  • Big Picture

Agenda

slide-3
SLIDE 3

Android History

slide-4
SLIDE 4

v3.10 v3.14 v3.18 v4.4 v4.9 500000 1000000 1500000 2000000 2500000 3000000 3500000 4000000

Qualcomm diff with mainline, # lines

Android History

slide-5
SLIDE 5

Android History

  • Android forked the Kernel
slide-6
SLIDE 6

Android History

  • Android forked the Kernel

– Better Graphics stack was needed

slide-7
SLIDE 7

Android History

  • Android forked the Kernel

– Better Graphics stack was needed – Support for low power was lacking

slide-8
SLIDE 8

Android History

  • Android forked the Kernel

– Better Graphics stack was needed – Support for low power was lacking – Support for atomic operations

slide-9
SLIDE 9

Android History

  • Android forked the Kernel
  • Android Atomic Display Framework created
slide-10
SLIDE 10

Android History

  • Android forked the Kernel
  • Android Atomic Display Framework created

– Not extensible or generic

slide-11
SLIDE 11

Android History

  • Android forked the Kernel
  • Android Atomic Display Framework created

– Not extensible or generic – Only atomic for plane updates

slide-12
SLIDE 12

Android History

  • Android forked the Kernel
  • Android Atomic Display Framework created

– Not extensible or generic – Only atomic for plane updates – Not compatible with current ABI

slide-13
SLIDE 13

Android History

  • Android forked the Kernel
  • Android Atomic Display Framework created

– Not extensible or generic – Only atomic for plane updates – Not compatible with current ABI – Not upstreamable

slide-14
SLIDE 14

Android History

  • Android forked the Kernel
  • Android Atomic Display Framework created
  • Mainline Atomic KMS ABI introduced
slide-15
SLIDE 15

Android History

  • Android forked the Kernel
  • Android Atomic Display Framework created
  • Mainline Atomic KMS ABI introduced

– Supports the ADF usecases

slide-16
SLIDE 16

Android History

  • Android forked the Kernel
  • Android Atomic Display Framework created
  • Mainline Atomic KMS ABI introduced

– Supports the ADF usecases – Uses Properties to be generic

slide-17
SLIDE 17

Android History

  • Android forked the Kernel
  • Android Atomic Display Framework created
  • Mainline Atomic KMS ABI introduced

– Supports the ADF usecases – Uses Properties to be generic – Is now replacing ADF in vendor drivers

slide-18
SLIDE 18

Android on Mainline

slide-19
SLIDE 19

Android Graphics Stack

Kernel Vendor driver HWC2 SurfaceFlinger Apps HWC2

slide-20
SLIDE 20

Android Graphics Stack

Kernel Vendor driver HWC2 SurfaceFlinger Apps HWC2

Subtitle Karla regular 28pt

The Really Good Stuff ™

slide-21
SLIDE 21

Android Graphics Stack

Kernel Vendor driver HWC2 SurfaceFlinger Apps HWC2

Subtitle Karla regular 28pt

The Really Good Stuff ™

  • No really, this is the whole point!
slide-22
SLIDE 22

Android Graphics Stack

Kernel Vendor driver HWC2 SurfaceFlinger Apps HWC2

Subtitle Karla regular 28pt

Interface between applications and hardware

slide-23
SLIDE 23

Android Graphics Stack

Kernel Vendor driver HWC2 SurfaceFlinger Apps HWC2

Subtitle Karla regular 28pt

slide-24
SLIDE 24

Android Graphics Stack

Kernel Vendor driver HWC2 SurfaceFlinger Apps HWC2

Subtitle Karla regular 28pt

Status Bar

slide-25
SLIDE 25

Android Graphics Stack

Kernel Vendor driver HWC2 SurfaceFlinger Apps HWC2

Subtitle Karla regular 28pt

Navigation Bar Status Bar

slide-26
SLIDE 26

Android Graphics Stack

Kernel Vendor driver HWC2 SurfaceFlinger Apps HWC2

Subtitle Karla regular 28pt

Navigation Bar Status Bar Background

slide-27
SLIDE 27

Android Graphics Stack

Kernel Vendor driver HWC2 SurfaceFlinger Apps HWC2

Subtitle Karla regular 28pt

SurfaceFlinger speaks HWC to the Composer

slide-28
SLIDE 28

Android Graphics Stack

What does the Hardware Composer do?

slide-29
SLIDE 29

Android Graphics Stack

What does the Hardware Composer do?

Get Layers Through HWC API

slide-30
SLIDE 30

Android Graphics Stack

What does the Hardware Composer do?

Get Layers Through HWC API Optimize Layers for Display

slide-31
SLIDE 31

Android Graphics Stack

What does the Hardware Composer do?

Get Layers Through HWC API Optimize Layers for Display Output Layers T

  • Display HW
slide-32
SLIDE 32

Android Graphics Stack

Kernel Vendor driver HWC2 SurfaceFlinger Apps HWC2

Subtitle Karla regular 28pt

The non-kernel part of the graphics driver

slide-33
SLIDE 33

Android Graphics Stack

Kernel Vendor driver HWC2 SurfaceFlinger Apps HWC2

Subtitle Karla regular 28pt

The non-kernel part of the graphics driver

  • OpenGL, Vulkan, memory allocator, etc.
slide-34
SLIDE 34

Android Graphics Stack

Kernel Vendor driver HWC2 SurfaceFlinger Apps HWC2

Subtitle Karla regular 28pt

The non-kernel part of the graphics driver

  • OpenGL, Vulkan, memory allocator, etc.
  • Hardware Composer
slide-35
SLIDE 35

Android Graphics Stack

Kernel Vendor driver HWC2 SurfaceFlinger Apps HWC2

Subtitle Karla regular 28pt

The Linux Kernel

slide-36
SLIDE 36

Mainline Graphics Stack

  • Mainline now has good Graphics ABI
slide-37
SLIDE 37

Mainline Graphics Stack

  • Mainline now has good Graphics ABI
  • Google Pixel C shipped using Atomic KMS
slide-38
SLIDE 38

Mainline Graphics Stack

  • Mainline now has good Graphics ABI
  • Google Pixel C shipped using Atomic KMS

– Android requires HWC implementation

slide-39
SLIDE 39

Mainline Graphics Stack

  • Mainline now has good Graphics ABI
  • Google Pixel C shipped using Atomic KMS

– Android requires HWC implementation – Mesa and the Kernel does not implement it

slide-40
SLIDE 40

Mainline Graphics Stack

  • Mainline now has good Graphics ABI
  • Google Pixel C shipped using Atomic KMS

– Android requires HWC implementation – Mesa and the Kernel does not implement it – drm_hwcomposer does!

slide-41
SLIDE 41

Mainline Graphics Stack

What is the Hardware Composer?

Kernel Vendor driver HWC2 SurfaceFlinger Apps HWC2

slide-42
SLIDE 42

Mainline Graphics Stack

Proprietary

}

What is the Hardware Composer?

Kernel Vendor driver HWC2 SurfaceFlinger Apps HWC2

slide-43
SLIDE 43

Mainline Graphics Stack

Kernel SurfaceFlinger Apps HWC2 ???

What is the Hardware Composer?

Kernel Vendor driver HWC2 SurfaceFlinger Apps HWC2

slide-44
SLIDE 44

Mainline Graphics Stack

What is the Hardware Composer?

Kernel SurfaceFlinger Apps HWC2 drm_hwc Kernel Vendor driver HWC2 SurfaceFlinger Apps HWC2 Driver

slide-45
SLIDE 45

Mainline Graphics Stack

Kernel SurfaceFlinger Apps HWC2 DRM drm_hwc libdrm mesa

{

What is the Hardware Composer?

Kernel Vendor driver HWC2 SurfaceFlinger Apps HWC2 Kernel SurfaceFlinger Apps HWC2 drm_hwc Driver

slide-46
SLIDE 46

Mainline Graphics Stack

Kernel SurfaceFlinger Apps HWC2 DRM drm_hwc libdrm mesa

{

What is the Hardware Composer?

Kernel Vendor driver HWC2 SurfaceFlinger Apps HWC2 Kernel SurfaceFlinger Apps HWC2 drm_hwc Driver Kernel SurfaceFlinger Apps HWC2 DRM drm_hwc mesa gralloc libdrm

slide-47
SLIDE 47

drm_hwcomposer

HWC2

slide-48
SLIDE 48

drm_hwcomposer

HWC2

  • Android added bufer Fence support
slide-49
SLIDE 49

drm_hwcomposer

HWC2

  • Android added bufer Fence support

– Ensures ordering between operations

slide-50
SLIDE 50

drm_hwcomposer

HWC2

  • Android added bufer Fence support

– Ensures ordering between operations – Synchronizes bufer sharing

slide-51
SLIDE 51

drm_hwcomposer

HWC2

  • Android added bufer Fence support
  • HWC version 2 is improved using Fences
slide-52
SLIDE 52

drm_hwcomposer

HWC2

  • Android added bufer Fence support
  • HWC version 2 is improved using Fences
  • Mainline received Fence support
slide-53
SLIDE 53

drm_hwcomposer

HWC2

  • Android added bufer Fence support
  • HWC version 2 is improved using Fences
  • Mainline received Fence support
  • drm_hwcomposer implemented HWC2
slide-54
SLIDE 54

drm_hwcomposer

  • Previously hosted within ChromiumOS

Project Hosting

slide-55
SLIDE 55

drm_hwcomposer

  • Previously hosted within ChromiumOS
  • Now hosted on Freedesktop.org

Project Hosting

slide-56
SLIDE 56

drm_hwcomposer

  • Previously hosted within ChromiumOS
  • Now hosted on Freedesktop.org

– Thanks Google:

  • Sean Paul
  • Puneet Kumar
  • Marissa Wall

Project Hosting

slide-57
SLIDE 57

drm_hwcomposer

  • Previously hosted within ChromiumOS
  • Now hosted on Freedesktop.org
  • GitLab instance on Freedesktop.org soon!

Project Hosting

slide-58
SLIDE 58

Current Status

slide-59
SLIDE 59

Current status

Tested platforms

slide-60
SLIDE 60

Current status

  • iMX6

– GPU: Vivante GC3000

Tested platforms

slide-61
SLIDE 61

Current status

  • Dragonboard 410c

– GPU: Adreno 306

Tested platforms

slide-62
SLIDE 62

Current status

  • HiKey 960

– GPU: Mali G71

Under Development

slide-63
SLIDE 63

Big Picture

slide-64
SLIDE 64

Big Picture

Merge Android Features

slide-65
SLIDE 65

Big Picture

Merge Android Features

  • A new feature is introduced in Android
slide-66
SLIDE 66

Big Picture

Merge Android Features

  • A new feature is introduced in Android
  • Slowly migrated into the kernel
slide-67
SLIDE 67

Big Picture

Merge Android Features

  • A new feature is introduced in Android
  • Slowly migrated into the kernel
  • This does not to apply to all subsystems
slide-68
SLIDE 68

5.00% 6.50% 3.50% 13.40% 11.90% 11.90% 3.30% 7.10% 5.40%

Qualcomm v4.9 Diff

arch/arm64/ arch/ drivers/clk/ drivers/gpu/ drivers/media/ drivers/platform/ drivers/power/ drivers/soc/qcom/ include/

Big Picture

Merge Android Features

slide-69
SLIDE 69

Big Picture

Merge Android Features

  • A new feature is introduced in Android
  • Slowly migrated into the kernel
  • This does not to apply to all subsystems
  • The dif for drivers seem fairly constant
slide-70
SLIDE 70

v3.10 v3.14 v3.18 v4.4 v4.9 500000 1000000 1500000 2000000 2500000 3000000 3500000 4000000

Qualcomm diff with mainline, # lines

Big Picture

Merge Android Features

slide-71
SLIDE 71

Big Picture

Push industry towards Open Source

slide-72
SLIDE 72

Big Picture

Push industry towards Open Source

  • Increase device development speed
slide-73
SLIDE 73

Big Picture

Push industry towards Open Source

  • Increase device development speed
  • Lower driver development costs
slide-74
SLIDE 74

Big Picture

Push industry towards Open Source

  • Increase device development speed
  • Lower driver development costs
  • Increase driver quality
slide-75
SLIDE 75

Big Picture

Push industry towards Open Source

  • Increase device development speed
  • Lower driver development costs
  • Increase driver quality
  • Push Open Source adoption forward
slide-76
SLIDE 76

Running Android on the Mainline Graphics Stack

Any questions?