SlideShare una empresa de Scribd logo
1 de 40
Descargar para leer sin conexión
Android Graphics Upstreaming
Linaro Connect Europe 2013
2
Overview
●
Covering
– ION
– Sync
– KMS/HWComposer
●
Hoping for active discussion
3
Disclosure
I'm not a DMA expert, nor am I all that
familiar with details around graphics
I'm likely to be wrong in more then one
place
4
ION
5
What is the issue ION solves?
●
Provides a way to allocate buffers so that they can be
shared between different hardware devices (via DMA)
to avoid copying
●
Different devices have different constraints
– Physically contiguous memory
– Smaller memory aperture (32bit device accessing LPAE/64bit
memory)
– Different pagetable sizes
●
Provides a method to select type of buffer that satisfies
the constraints
●
While mostly used for graphics, ION is not graphics
specific
6
????
Would contrived cartoon examples help?
7
8
CPU full virtual and physical addressing
9
GPU supports full memory range + scatter/gather
10
Camera is 32bit, and can only do DMA
to physically contiguous memory
11
Crypto engine only supports 32bits,
but does support scatter/gather
12
MMC supports full memory range,
but only contiguous physical memory
13
Virtual allocation
14
Resulting physical allocation
15
kmalloc for physically contiguous allocation
16
CMA allows kernel to make space for
contiguously physical allocations
17
Carveout memory is physically contiguous
memory reserved at boot
18
ION interface
●
Provides way for userland to allocate buffers
from various “pools of memory” (aka: heaps)
– SYSTEM: Virtually contiguous (vmalloc)
– SYSTEM_CONTIG: Small physically contiguous
(kmalloc)
– CARVEOUT: Large reserved physically contiguous
– CHUNK: Carveout + large page tables
– CUSTOM: Whatever hardware vendors want (ick)
– CMA: Sometime in the future?
19
ION Interface (cont)
●
Allows freeing, mapping and passing of
those buffers to other applications and
drivers
– Buffers shared as file descriptors
20
Using our examples
●
CPU + GPU: SYSTEM
●
CPU + MMC: SYSTEM_CONTIG
●
CPU + CAMERA: CARVEOUT
●
CPU + GPU + CAMERA: CARVEOUT
●
CPU + GPU + MMC: SYSTEM_CONTIG
●
Note: ION does not help calculate what the proper
heap is for the given combination of hardware. It just
provides userland an interface to specify a heap that
userland knows satisfies the hardware constraints
21
ION developer priorities
●
Android developers very focused on avoiding “jank”
- frame drops, jerky animations
●
Want very deterministic behavior
– They worry about CMA since it may spend a variable
amount of time to move memory on a large allocation
– Delayed constraint-solving dma-buf allocation ideas are
similarly not considered viable (by Android devs)
●
Want to centralize as much logic as possible in ION
core, so any optimizations can be made once in the
core infrastructure
– Avoid lots of per-driver tweaking
22
Isn't this what dma-buf does?
●
ION pre-dates dma-buf
●
dma-buf provides a subset of what ION does
●
dma-buf is more of a encapsulation structure for
buffers of different types
– Allows buffers to be passed between different drivers and
userland
– Basically a marshaling structure
– Does not specify how the buffers are allocated
●
ION also has its own buffer encapsulation structure
– ION added support to export dmabufs (sort of)
23
Isn't this what CMA does?
●
Again: Sort of.
●
CMA allows for large physically contiguous memory allocations by
migrating memory to make room for the large allocation
●
Pros:
– Avoids wasting memory with carveouts if they aren't in use.
– CMA has pluggable allocators and options that can allow for allocations that
satisfy the constraints needed.
●
Cons:
– CMA is kernel-internal only for now, and doesn't have a interface to allow
userland to allocate buffers or specify constraint options
– Migrating pages to make room can cause non-deterministic delays. Android
developers want deterministic behavior.
●
Patches to support CMA via ION have been submitted by Benjamin
Gaignard (Android developer plan on accepting them).
24
What about TTM, GEM and PRIME?
You are now in the acronym pit of despair!
DRM, DRI, DRI2, EXA, UXA, GEM, TTM, UMA, GTT
25
What about TTM, GEM?
●
TTM: Graphics memory manager for discrete gpus that have
their own video-ram.
– Considered complicated / poorly documented
– Provides fence synchronization facility
●
GEM: More minimal approach to TTM
– Developed by Intel, focused on their hardware
– Limited to UMA devices (ie: integrated graphics)
– No synchronization (fence) primitives
●
Those have to be implemented w/ driver-specific ioctls
– Allows for sharing of buffers between applications by named ids
●
GEM-ified TTM: TTM backend w/ GEM API
26
What about PRIME?
●
PRIME: GEM extended to use file
descriptors for passing object
references/buffers between drivers and
userland
– Uses dmabuf for passing buffers around
– Required for “hybrid graphics” where there
are multiple gpu (discrete and integrated)
working together.
27
Issues with ION
●
Doesn't build on non 32-bit ARM architectures
●
Quite a bit of DMA api misuse
– Lots of ARM specific assumptions about DMA rules that aren't
generically portable
●
Exports kernel pointers to userland (makes compat_ioctl
support difficult)
●
Larger portability issue that applications have to
understand the hardware buffer constraints in order to
select the right heap to use
– On different hardware, different heaps may be available, as
well as different devices with different constraints
– Same userland wouldn't necessarily work on different hardware
28
DMA-API Misuse
●
CPUs and Devices both cache memory
– To keep coherency, we need to flush caches
before initiating DMA
– This requires a direction and a device
●
ION pre sync's data, before knowing which
device its going to. Leaves device value as
NULL. Works for their uses
– Broken for IOMMUs
29
What is our plan with ION?
●
Working w/ Android and ARM developers to address 32bit
ARM assumptions
●
Working with Arnd to try to sort out if we can address the
dma-api misuse, or decide if new dma-apis are needed
●
Try to come up with a way for the interface to expose less
hardware specific detail
– Query devices for an opaque heap-cookie they support, which
could be OR-ed with other cookies to determine which heap to use
for cross device buffers
●
All of this may break current interface compatibility :(
●
I suspect getting ION into staging is as good as it will get
●
Other ideas?
30
Sync
31
What is Sync?
●
Provides synchronization primitives that can be
shared across processes
●
Used mostly to synchronize both drivers and
applications drawing to the screen
●
Like a condition-wait variable, but can be backed by
hardware primitives
– Some gpus support hardware mutexes
●
Provides lots of debugging data for sorting out
synchronization issues
●
In staging directory as of 3.10
32
Sync Interface
●
Timelines and fences
– Applications set fences at specific points on
timeline and wait
struct sw_sync_create_fence_data data;
data.value = fence_count
ioctl(timeline_fd, SW_SYNC_IOC_CREATE_FENCE, &data);
ioctl(data.fence, SYNC_IOC_WAIT, &timeout);
– Controlling thread increments timeline, waking
any processes waiting.
ioctl(timeline_fd, SW_SYNC_IOC_INC, &count);
33
What about Dmabuf-fences?
●
Developed by Maarten Lankhorst, Daniel Vetter and
Rob Clark
●
Creates similar synchronization fences that are tied to
specific dma-buf buffers
●
Provides implicit synchronization
– Android's Sync is explicit synchronization, requiring
developers to add the logic
●
Limited to dma-buf buffers
– Android's Sync driver can be used in more varied contexts
34
Daniel Vetter's take:
“The fundamental difference between android syncpoints and the dma_buf
fences is that syncpoints use explicit userspace synchronization objects which
get passed around as fds. Whereas dma_buf fences are all implicitly attached to
the respective dma_bufs, so userspace can just pass around the buffer object fds
and the kernel ensures that magic happens and everything is synced up properly.
Imo the later approach has two big upsides:
- Implicit sync objects are a _much_ simpler programming model. Think
synchronous file i/o vs. aio. And if the kernel doesn't suck, there's not really a
performance disadvantage, at least for the shared buffer use-case. GL drivers
might still need explicit syncing for their gpu state objects for the last ounce of
performance, but that's not relevant.
- Having fences attached directly to dma_buf objects is the only way to make
dynamic buffers (i.e. eviction from garts/memory) possible. Currently every
graphics driver on android seems to just pin their buffers into main memory so
there's no need for that. And ion also only cares about pinned buffers. But I
expect that this will change.”
35
What about wait/wound-style mutexes?
●
Also developed by Maarten Lankhorst and Daniel Vetter
●
Developed to handle the case where buffers are shared
between devices. Since buffers may not be ordered in the same
way on all devices, there may be the possiblility for ABBA
deadlocks
●
Wait/wound style mutexes provide a global ticket (or context)
which orders acquisitions. If a deadlock occurs, the oldest ticket
holder waits for the mutex, while the younger holders have to
“back off” and drop the locks they hold.
●
Kernel driver interface only, not something userspace can use.
●
I suspect this to be a base for dmabuf-fences
●
Queued to be merged for 3.11
36
What is our plan with Sync?
●
Try to stir discussion between community
and Android developers on explicit vs
implicit synchronization issues
●
Follow along to see if any part of the
implementations can be shared
●
Other ideas?
37
KMS HWComposer
38
What is KMS?
●
Kernel Mode Setting
●
Makes the kernel responsible for graphics
mode (resolution, refresh, orientation)
– Avoids races with userland and hardware
– Can switch modes on OOPs to display message
39
What is HWComposer?
●
Per-platform userspace code that manages
composition acceleration
●
Part of the HAL layer
●
Currently using fb
●
Would be nice to convert HWComposer to
KMS
40
What is our plan with
KMS/HWC/HAL?
●
Android devs likely already working on KMS enabled HAL
– Likely to be optimized specifically for next hardware release
– Not likely to be generic KMS HAL
●
Areas that may need work:
– Sync and vsync notifications with KMS
●
Hopefully this resolves the pageflipping framebuffer issue?
– Gralloc allocates 2x y_res
– Most fb drivers don't support this
●
Other thoughts/ideas?

Más contenido relacionado

La actualidad más candente

Understaing Android EGL
Understaing Android EGLUnderstaing Android EGL
Understaing Android EGLSuhan Lee
 
Inside Android's UI
Inside Android's UIInside Android's UI
Inside Android's UIOpersys inc.
 
A deep dive into Android OpenSource Project(AOSP)
A deep dive into Android OpenSource Project(AOSP)A deep dive into Android OpenSource Project(AOSP)
A deep dive into Android OpenSource Project(AOSP)Siji Sunny
 
Android's Multimedia Framework
Android's Multimedia FrameworkAndroid's Multimedia Framework
Android's Multimedia FrameworkOpersys inc.
 
ABS 2013: Dive into Android Networking - Adding Ethernet Connectivity
ABS 2013: Dive into Android Networking - Adding Ethernet ConnectivityABS 2013: Dive into Android Networking - Adding Ethernet Connectivity
ABS 2013: Dive into Android Networking - Adding Ethernet ConnectivityBenjamin Zores
 
Project meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture OverviewProject meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture OverviewYu-Hsin Hung
 
Android Binder IPC for Linux
Android Binder IPC for LinuxAndroid Binder IPC for Linux
Android Binder IPC for LinuxYu-Hsin Hung
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time OptimizationKan-Ru Chen
 
The Android graphics path, in depth
The Android graphics path, in depthThe Android graphics path, in depth
The Android graphics path, in depthChris Simmonds
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverNanik Tolaram
 
08 android multimedia_framework_overview
08 android multimedia_framework_overview08 android multimedia_framework_overview
08 android multimedia_framework_overviewArjun Reddy
 
RISC-V & SoC Architectural Exploration for AI and ML Accelerators
RISC-V & SoC Architectural Exploration for AI and ML AcceleratorsRISC-V & SoC Architectural Exploration for AI and ML Accelerators
RISC-V & SoC Architectural Exploration for AI and ML AcceleratorsRISC-V International
 
Android Automotive
Android AutomotiveAndroid Automotive
Android AutomotiveOpersys inc.
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsLinaro
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALOpersys inc.
 

La actualidad más candente (20)

Understaing Android EGL
Understaing Android EGLUnderstaing Android EGL
Understaing Android EGL
 
Inside Android's UI
Inside Android's UIInside Android's UI
Inside Android's UI
 
Android 10
Android 10Android 10
Android 10
 
A deep dive into Android OpenSource Project(AOSP)
A deep dive into Android OpenSource Project(AOSP)A deep dive into Android OpenSource Project(AOSP)
A deep dive into Android OpenSource Project(AOSP)
 
Android's Multimedia Framework
Android's Multimedia FrameworkAndroid's Multimedia Framework
Android's Multimedia Framework
 
ABS 2013: Dive into Android Networking - Adding Ethernet Connectivity
ABS 2013: Dive into Android Networking - Adding Ethernet ConnectivityABS 2013: Dive into Android Networking - Adding Ethernet Connectivity
ABS 2013: Dive into Android Networking - Adding Ethernet Connectivity
 
Understanding the Dalvik Virtual Machine
Understanding the Dalvik Virtual MachineUnderstanding the Dalvik Virtual Machine
Understanding the Dalvik Virtual Machine
 
Project meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture OverviewProject meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture Overview
 
Android Binder IPC for Linux
Android Binder IPC for LinuxAndroid Binder IPC for Linux
Android Binder IPC for Linux
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time Optimization
 
The Android graphics path, in depth
The Android graphics path, in depthThe Android graphics path, in depth
The Android graphics path, in depth
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device Driver
 
08 android multimedia_framework_overview
08 android multimedia_framework_overview08 android multimedia_framework_overview
08 android multimedia_framework_overview
 
Android IPC Mechanism
Android IPC MechanismAndroid IPC Mechanism
Android IPC Mechanism
 
RISC-V & SoC Architectural Exploration for AI and ML Accelerators
RISC-V & SoC Architectural Exploration for AI and ML AcceleratorsRISC-V & SoC Architectural Exploration for AI and ML Accelerators
RISC-V & SoC Architectural Exploration for AI and ML Accelerators
 
Linux Audio Drivers. ALSA
Linux Audio Drivers. ALSALinux Audio Drivers. ALSA
Linux Audio Drivers. ALSA
 
Android Automotive
Android AutomotiveAndroid Automotive
Android Automotive
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new Platforms
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HAL
 
Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)
 

Similar a LCE13: Android Graphics Upstreaming

XPDDS17: Keynote: Shared Coprocessor Framework on ARM - Oleksandr Andrushchen...
XPDDS17: Keynote: Shared Coprocessor Framework on ARM - Oleksandr Andrushchen...XPDDS17: Keynote: Shared Coprocessor Framework on ARM - Oleksandr Andrushchen...
XPDDS17: Keynote: Shared Coprocessor Framework on ARM - Oleksandr Andrushchen...The Linux Foundation
 
Reliability, Availability and Serviceability on Linux
Reliability, Availability and Serviceability on LinuxReliability, Availability and Serviceability on Linux
Reliability, Availability and Serviceability on LinuxSamsung Open Source Group
 
C for Cuda - Small Introduction to GPU computing
C for Cuda - Small Introduction to GPU computingC for Cuda - Small Introduction to GPU computing
C for Cuda - Small Introduction to GPU computingIPALab
 
UWE Linux Boot Camp 2007: Hacking embedded Linux on the cheap
UWE Linux Boot Camp 2007: Hacking embedded Linux on the cheapUWE Linux Boot Camp 2007: Hacking embedded Linux on the cheap
UWE Linux Boot Camp 2007: Hacking embedded Linux on the cheapedlangley
 
Open_IoT_Summit-Europe-2016-Building_an_IoT-class_Device_0
Open_IoT_Summit-Europe-2016-Building_an_IoT-class_Device_0Open_IoT_Summit-Europe-2016-Building_an_IoT-class_Device_0
Open_IoT_Summit-Europe-2016-Building_an_IoT-class_Device_0Igor Stoppa
 
Towards Software Defined Persistent Memory
Towards Software Defined Persistent MemoryTowards Software Defined Persistent Memory
Towards Software Defined Persistent MemorySwaminathan Sundararaman
 
Rendering Battlefield 4 with Mantle by Yuriy ODonnell
Rendering Battlefield 4 with Mantle by Yuriy ODonnellRendering Battlefield 4 with Mantle by Yuriy ODonnell
Rendering Battlefield 4 with Mantle by Yuriy ODonnellAMD Developer Central
 
Continguous Memory Allocator in the Linux Kernel
Continguous Memory Allocator in the Linux KernelContinguous Memory Allocator in the Linux Kernel
Continguous Memory Allocator in the Linux KernelKernel TLV
 
Developping drivers on small machines
Developping drivers on small machinesDevelopping drivers on small machines
Developping drivers on small machinesAnne Nicolas
 
Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14
Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14
Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14AMD Developer Central
 
Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)Pankaj Suryawanshi
 
Enlightenment Foundation Libraries (Overview)
Enlightenment Foundation Libraries (Overview)Enlightenment Foundation Libraries (Overview)
Enlightenment Foundation Libraries (Overview)Samsung Open Source Group
 
Intro to parallel computing
Intro to parallel computingIntro to parallel computing
Intro to parallel computingPiyush Mittal
 
Us 18-chen-keen lab-ios-jailbreak-internals
Us 18-chen-keen lab-ios-jailbreak-internalsUs 18-chen-keen lab-ios-jailbreak-internals
Us 18-chen-keen lab-ios-jailbreak-internalsLiang Chen
 
KeenLab iOS Jailbreak Internals: Userland Read-Only Memory can be Dangerous
KeenLab iOS Jailbreak Internals: Userland Read-Only Memory can be DangerousKeenLab iOS Jailbreak Internals: Userland Read-Only Memory can be Dangerous
KeenLab iOS Jailbreak Internals: Userland Read-Only Memory can be DangerousPriyanka Aash
 
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) WinningKernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) WinningAnne Nicolas
 
Nt1310 Unit 3 Computer Components
Nt1310 Unit 3 Computer ComponentsNt1310 Unit 3 Computer Components
Nt1310 Unit 3 Computer ComponentsKristi Anderson
 

Similar a LCE13: Android Graphics Upstreaming (20)

XPDDS17: Keynote: Shared Coprocessor Framework on ARM - Oleksandr Andrushchen...
XPDDS17: Keynote: Shared Coprocessor Framework on ARM - Oleksandr Andrushchen...XPDDS17: Keynote: Shared Coprocessor Framework on ARM - Oleksandr Andrushchen...
XPDDS17: Keynote: Shared Coprocessor Framework on ARM - Oleksandr Andrushchen...
 
Reliability, Availability and Serviceability on Linux
Reliability, Availability and Serviceability on LinuxReliability, Availability and Serviceability on Linux
Reliability, Availability and Serviceability on Linux
 
C for Cuda - Small Introduction to GPU computing
C for Cuda - Small Introduction to GPU computingC for Cuda - Small Introduction to GPU computing
C for Cuda - Small Introduction to GPU computing
 
UWE Linux Boot Camp 2007: Hacking embedded Linux on the cheap
UWE Linux Boot Camp 2007: Hacking embedded Linux on the cheapUWE Linux Boot Camp 2007: Hacking embedded Linux on the cheap
UWE Linux Boot Camp 2007: Hacking embedded Linux on the cheap
 
Open_IoT_Summit-Europe-2016-Building_an_IoT-class_Device_0
Open_IoT_Summit-Europe-2016-Building_an_IoT-class_Device_0Open_IoT_Summit-Europe-2016-Building_an_IoT-class_Device_0
Open_IoT_Summit-Europe-2016-Building_an_IoT-class_Device_0
 
Towards Software Defined Persistent Memory
Towards Software Defined Persistent MemoryTowards Software Defined Persistent Memory
Towards Software Defined Persistent Memory
 
Rendering Battlefield 4 with Mantle by Yuriy ODonnell
Rendering Battlefield 4 with Mantle by Yuriy ODonnellRendering Battlefield 4 with Mantle by Yuriy ODonnell
Rendering Battlefield 4 with Mantle by Yuriy ODonnell
 
Continguous Memory Allocator in the Linux Kernel
Continguous Memory Allocator in the Linux KernelContinguous Memory Allocator in the Linux Kernel
Continguous Memory Allocator in the Linux Kernel
 
Developping drivers on small machines
Developping drivers on small machinesDevelopping drivers on small machines
Developping drivers on small machines
 
Cat @ scale
Cat @ scaleCat @ scale
Cat @ scale
 
Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14
Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14
Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14
 
Rendering Battlefield 4 with Mantle
Rendering Battlefield 4 with MantleRendering Battlefield 4 with Mantle
Rendering Battlefield 4 with Mantle
 
Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)
 
Enlightenment Foundation Libraries (Overview)
Enlightenment Foundation Libraries (Overview)Enlightenment Foundation Libraries (Overview)
Enlightenment Foundation Libraries (Overview)
 
module4.ppt
module4.pptmodule4.ppt
module4.ppt
 
Intro to parallel computing
Intro to parallel computingIntro to parallel computing
Intro to parallel computing
 
Us 18-chen-keen lab-ios-jailbreak-internals
Us 18-chen-keen lab-ios-jailbreak-internalsUs 18-chen-keen lab-ios-jailbreak-internals
Us 18-chen-keen lab-ios-jailbreak-internals
 
KeenLab iOS Jailbreak Internals: Userland Read-Only Memory can be Dangerous
KeenLab iOS Jailbreak Internals: Userland Read-Only Memory can be DangerousKeenLab iOS Jailbreak Internals: Userland Read-Only Memory can be Dangerous
KeenLab iOS Jailbreak Internals: Userland Read-Only Memory can be Dangerous
 
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) WinningKernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning
 
Nt1310 Unit 3 Computer Components
Nt1310 Unit 3 Computer ComponentsNt1310 Unit 3 Computer Components
Nt1310 Unit 3 Computer Components
 

Más de Linaro

Deep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Deep Learning Neural Network Acceleration at the Edge - Andrea GalloDeep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Deep Learning Neural Network Acceleration at the Edge - Andrea GalloLinaro
 
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta VekariaArm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta VekariaLinaro
 
Huawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
Huawei’s requirements for the ARM based HPC solution readiness - Joshua MoraHuawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
Huawei’s requirements for the ARM based HPC solution readiness - Joshua MoraLinaro
 
Bud17 113: distribution ci using qemu and open qa
Bud17 113: distribution ci using qemu and open qaBud17 113: distribution ci using qemu and open qa
Bud17 113: distribution ci using qemu and open qaLinaro
 
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018Linaro
 
HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018Linaro
 
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...Linaro
 
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...Linaro
 
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...Linaro
 
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...Linaro
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineLinaro
 
HKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening KeynoteHKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening KeynoteLinaro
 
HKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP WorkshopHKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP WorkshopLinaro
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineLinaro
 
HKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and allHKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and allLinaro
 
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse HypervisorHKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse HypervisorLinaro
 
HKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMUHKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMULinaro
 
HKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8MHKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8MLinaro
 
HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation Linaro
 
HKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootHKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootLinaro
 

Más de Linaro (20)

Deep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Deep Learning Neural Network Acceleration at the Edge - Andrea GalloDeep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Deep Learning Neural Network Acceleration at the Edge - Andrea Gallo
 
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta VekariaArm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
 
Huawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
Huawei’s requirements for the ARM based HPC solution readiness - Joshua MoraHuawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
Huawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
 
Bud17 113: distribution ci using qemu and open qa
Bud17 113: distribution ci using qemu and open qaBud17 113: distribution ci using qemu and open qa
Bud17 113: distribution ci using qemu and open qa
 
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
 
HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018
 
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
 
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
 
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
 
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
 
HKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening KeynoteHKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening Keynote
 
HKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP WorkshopHKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP Workshop
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
 
HKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and allHKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and all
 
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse HypervisorHKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
 
HKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMUHKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMU
 
HKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8MHKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8M
 
HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation
 
HKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootHKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted boot
 

Último

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Último (20)

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

LCE13: Android Graphics Upstreaming

  • 2. 2 Overview ● Covering – ION – Sync – KMS/HWComposer ● Hoping for active discussion
  • 3. 3 Disclosure I'm not a DMA expert, nor am I all that familiar with details around graphics I'm likely to be wrong in more then one place
  • 5. 5 What is the issue ION solves? ● Provides a way to allocate buffers so that they can be shared between different hardware devices (via DMA) to avoid copying ● Different devices have different constraints – Physically contiguous memory – Smaller memory aperture (32bit device accessing LPAE/64bit memory) – Different pagetable sizes ● Provides a method to select type of buffer that satisfies the constraints ● While mostly used for graphics, ION is not graphics specific
  • 7. 7
  • 8. 8 CPU full virtual and physical addressing
  • 9. 9 GPU supports full memory range + scatter/gather
  • 10. 10 Camera is 32bit, and can only do DMA to physically contiguous memory
  • 11. 11 Crypto engine only supports 32bits, but does support scatter/gather
  • 12. 12 MMC supports full memory range, but only contiguous physical memory
  • 15. 15 kmalloc for physically contiguous allocation
  • 16. 16 CMA allows kernel to make space for contiguously physical allocations
  • 17. 17 Carveout memory is physically contiguous memory reserved at boot
  • 18. 18 ION interface ● Provides way for userland to allocate buffers from various “pools of memory” (aka: heaps) – SYSTEM: Virtually contiguous (vmalloc) – SYSTEM_CONTIG: Small physically contiguous (kmalloc) – CARVEOUT: Large reserved physically contiguous – CHUNK: Carveout + large page tables – CUSTOM: Whatever hardware vendors want (ick) – CMA: Sometime in the future?
  • 19. 19 ION Interface (cont) ● Allows freeing, mapping and passing of those buffers to other applications and drivers – Buffers shared as file descriptors
  • 20. 20 Using our examples ● CPU + GPU: SYSTEM ● CPU + MMC: SYSTEM_CONTIG ● CPU + CAMERA: CARVEOUT ● CPU + GPU + CAMERA: CARVEOUT ● CPU + GPU + MMC: SYSTEM_CONTIG ● Note: ION does not help calculate what the proper heap is for the given combination of hardware. It just provides userland an interface to specify a heap that userland knows satisfies the hardware constraints
  • 21. 21 ION developer priorities ● Android developers very focused on avoiding “jank” - frame drops, jerky animations ● Want very deterministic behavior – They worry about CMA since it may spend a variable amount of time to move memory on a large allocation – Delayed constraint-solving dma-buf allocation ideas are similarly not considered viable (by Android devs) ● Want to centralize as much logic as possible in ION core, so any optimizations can be made once in the core infrastructure – Avoid lots of per-driver tweaking
  • 22. 22 Isn't this what dma-buf does? ● ION pre-dates dma-buf ● dma-buf provides a subset of what ION does ● dma-buf is more of a encapsulation structure for buffers of different types – Allows buffers to be passed between different drivers and userland – Basically a marshaling structure – Does not specify how the buffers are allocated ● ION also has its own buffer encapsulation structure – ION added support to export dmabufs (sort of)
  • 23. 23 Isn't this what CMA does? ● Again: Sort of. ● CMA allows for large physically contiguous memory allocations by migrating memory to make room for the large allocation ● Pros: – Avoids wasting memory with carveouts if they aren't in use. – CMA has pluggable allocators and options that can allow for allocations that satisfy the constraints needed. ● Cons: – CMA is kernel-internal only for now, and doesn't have a interface to allow userland to allocate buffers or specify constraint options – Migrating pages to make room can cause non-deterministic delays. Android developers want deterministic behavior. ● Patches to support CMA via ION have been submitted by Benjamin Gaignard (Android developer plan on accepting them).
  • 24. 24 What about TTM, GEM and PRIME? You are now in the acronym pit of despair! DRM, DRI, DRI2, EXA, UXA, GEM, TTM, UMA, GTT
  • 25. 25 What about TTM, GEM? ● TTM: Graphics memory manager for discrete gpus that have their own video-ram. – Considered complicated / poorly documented – Provides fence synchronization facility ● GEM: More minimal approach to TTM – Developed by Intel, focused on their hardware – Limited to UMA devices (ie: integrated graphics) – No synchronization (fence) primitives ● Those have to be implemented w/ driver-specific ioctls – Allows for sharing of buffers between applications by named ids ● GEM-ified TTM: TTM backend w/ GEM API
  • 26. 26 What about PRIME? ● PRIME: GEM extended to use file descriptors for passing object references/buffers between drivers and userland – Uses dmabuf for passing buffers around – Required for “hybrid graphics” where there are multiple gpu (discrete and integrated) working together.
  • 27. 27 Issues with ION ● Doesn't build on non 32-bit ARM architectures ● Quite a bit of DMA api misuse – Lots of ARM specific assumptions about DMA rules that aren't generically portable ● Exports kernel pointers to userland (makes compat_ioctl support difficult) ● Larger portability issue that applications have to understand the hardware buffer constraints in order to select the right heap to use – On different hardware, different heaps may be available, as well as different devices with different constraints – Same userland wouldn't necessarily work on different hardware
  • 28. 28 DMA-API Misuse ● CPUs and Devices both cache memory – To keep coherency, we need to flush caches before initiating DMA – This requires a direction and a device ● ION pre sync's data, before knowing which device its going to. Leaves device value as NULL. Works for their uses – Broken for IOMMUs
  • 29. 29 What is our plan with ION? ● Working w/ Android and ARM developers to address 32bit ARM assumptions ● Working with Arnd to try to sort out if we can address the dma-api misuse, or decide if new dma-apis are needed ● Try to come up with a way for the interface to expose less hardware specific detail – Query devices for an opaque heap-cookie they support, which could be OR-ed with other cookies to determine which heap to use for cross device buffers ● All of this may break current interface compatibility :( ● I suspect getting ION into staging is as good as it will get ● Other ideas?
  • 31. 31 What is Sync? ● Provides synchronization primitives that can be shared across processes ● Used mostly to synchronize both drivers and applications drawing to the screen ● Like a condition-wait variable, but can be backed by hardware primitives – Some gpus support hardware mutexes ● Provides lots of debugging data for sorting out synchronization issues ● In staging directory as of 3.10
  • 32. 32 Sync Interface ● Timelines and fences – Applications set fences at specific points on timeline and wait struct sw_sync_create_fence_data data; data.value = fence_count ioctl(timeline_fd, SW_SYNC_IOC_CREATE_FENCE, &data); ioctl(data.fence, SYNC_IOC_WAIT, &timeout); – Controlling thread increments timeline, waking any processes waiting. ioctl(timeline_fd, SW_SYNC_IOC_INC, &count);
  • 33. 33 What about Dmabuf-fences? ● Developed by Maarten Lankhorst, Daniel Vetter and Rob Clark ● Creates similar synchronization fences that are tied to specific dma-buf buffers ● Provides implicit synchronization – Android's Sync is explicit synchronization, requiring developers to add the logic ● Limited to dma-buf buffers – Android's Sync driver can be used in more varied contexts
  • 34. 34 Daniel Vetter's take: “The fundamental difference between android syncpoints and the dma_buf fences is that syncpoints use explicit userspace synchronization objects which get passed around as fds. Whereas dma_buf fences are all implicitly attached to the respective dma_bufs, so userspace can just pass around the buffer object fds and the kernel ensures that magic happens and everything is synced up properly. Imo the later approach has two big upsides: - Implicit sync objects are a _much_ simpler programming model. Think synchronous file i/o vs. aio. And if the kernel doesn't suck, there's not really a performance disadvantage, at least for the shared buffer use-case. GL drivers might still need explicit syncing for their gpu state objects for the last ounce of performance, but that's not relevant. - Having fences attached directly to dma_buf objects is the only way to make dynamic buffers (i.e. eviction from garts/memory) possible. Currently every graphics driver on android seems to just pin their buffers into main memory so there's no need for that. And ion also only cares about pinned buffers. But I expect that this will change.”
  • 35. 35 What about wait/wound-style mutexes? ● Also developed by Maarten Lankhorst and Daniel Vetter ● Developed to handle the case where buffers are shared between devices. Since buffers may not be ordered in the same way on all devices, there may be the possiblility for ABBA deadlocks ● Wait/wound style mutexes provide a global ticket (or context) which orders acquisitions. If a deadlock occurs, the oldest ticket holder waits for the mutex, while the younger holders have to “back off” and drop the locks they hold. ● Kernel driver interface only, not something userspace can use. ● I suspect this to be a base for dmabuf-fences ● Queued to be merged for 3.11
  • 36. 36 What is our plan with Sync? ● Try to stir discussion between community and Android developers on explicit vs implicit synchronization issues ● Follow along to see if any part of the implementations can be shared ● Other ideas?
  • 38. 38 What is KMS? ● Kernel Mode Setting ● Makes the kernel responsible for graphics mode (resolution, refresh, orientation) – Avoids races with userland and hardware – Can switch modes on OOPs to display message
  • 39. 39 What is HWComposer? ● Per-platform userspace code that manages composition acceleration ● Part of the HAL layer ● Currently using fb ● Would be nice to convert HWComposer to KMS
  • 40. 40 What is our plan with KMS/HWC/HAL? ● Android devs likely already working on KMS enabled HAL – Likely to be optimized specifically for next hardware release – Not likely to be generic KMS HAL ● Areas that may need work: – Sync and vsync notifications with KMS ● Hopefully this resolves the pageflipping framebuffer issue? – Gralloc allocates 2x y_res – Most fb drivers don't support this ● Other thoughts/ideas?