SlideShare a Scribd company logo
1 of 16
Download to read offline
LCU14-503: What to do about ADF? 
Daniel Thompson, LCU14 
LCU14 BURLINGAME
Atomic display framework (ADF) 
ADF is a new(ish) feature found in 3.10 AOSP kernels that provides 
dma-buf centric plumbing framework between Android’s hwcomposer 
HAL and kernel driver 
● Focuses heavily on data -> buffer validation, mapping and fencing 
● Meta data (scaling, z-order, alpha...) is effectively out-of-scope; 
binary blob passed from HAL to driver 
● Atomic display update (all buffers can hit the glass in one shot)
Describing buffers 
struct adf_buffer { 
struct adf_overlay_engine *overlay_engine; 
u16 w, h; 
u32 format; /* DRM-style fourcc */ 
struct dma_buf *dma_bufs[ADF_MAX_PLANES]; 
u32 offset[ADF_MAX_PLANES]; 
u32 pitch[ADF_MAX_PLANES]; 
u8 n_planes; 
struct sync_fence *acquire_fence; /* optional */ 
}; 
- Greg Hackmann, Google (from Linux Plumbers Conference 2013)
Describing atomic updates 
struct adf_post { 
size_t n_bufs; 
struct adf_buffer *bufs; 
struct adf_buffer_mapping *mappings; /* ADF-provided */ 
size_t custom_data_size; 
void *custom_data; 
}; 
- Greg Hackmann, Google (from Linux Plumbers Conference 2013)
Atomic updates 
1. ADF imports buffers, sanity-checks buffer sizes vs. formats 
2. Driver does hardware-specific checks and assembles internal state 
int (*validate)(struct adf_device *dev, struct adf_post *cfg, void **driver_state); 
3. ADF places config in queue 
4. ADF worker dequeues config, waits for fences to fire 
5. Driver updates hardware state and waits for flip 
void (*post)(struct adf_device *dev, struct adf_post *cfg, void *driver_state); 
6. ADF worker advances sync timeline and releases old buffers 
7. Driver cleans up internal state 
void (*state_free)(struct adf_device *dev, void *driver_state); 
- Greg Hackmann, Google (from Linux Plumbers Conference 2013)
Why do we care “what to do about ADF?” 
ADF significantly overlaps with DRM/KMS 
Getting SoC drivers from GNU/Linux to work on Android/Linux (and 
vice versa) is simplified when GFX stack is unified. Want to avoid 
fragmented driver delivery and degraded bringup. 
Even companies strongly engaged with upstream GFX developers 
may still end up with forked GFX drivers to support Android; a poor 
ROI on upstreaming effort.
Community activity in similar areas 
Linaro 
Android hwcomposer HAL implemented with DRM/KMS 
Rob Clark (TI/Linaro/Redhat) 
Atomic/nuclear modeset/pageflip 
Emil Velikov 
Upstream libdrm for Android 
“Inspired by the work of Chih-Wei Huang, from the Android-x86 project” 
“If there's community interest, moving forward I'd like to merge its 
functionality into KMS rather than keep it as a separate thing.” 
- Greg Hackmann
A strawman approach 
Evolution is (almost) always the Linux way... 
... we have to treat ADF motivations and features like a shopping list 
Experiences with DRM/KMS 
● Complex API geared toward incremental updates 
● CRTC + planes -> encoder(s) -> connector model doesn’t fit some 
embedded hardware 
● Lots of boilerplate GEM + framebuffer code, duplicates dma-buf 
functionality 
● Need support for custom pixel formats and explicit sync 
- Greg Hackmann, Google (from Linux Plumbers Conference 2013)
A strawman approach 
Evolution is (almost) always the Linux way... 
... we have to treat ADF motivations and features like a shopping list 
Experiences with DRM/KMS 
● Complex API geared toward incremental updates 
● CRTC + planes -> encoder(s) -> connector model doesn’t fit some 
embedded hardware 
● Lots of boilerplate GEM + framebuffer code, duplicates dma-buf 
functionality 
● Need support for custom pixel formats and explicit sync 
Can’t model 
hardware 
Driver 
LOC count 
Gaps 
Driver 
LOC count 
User space 
complexity 
- Greg Hackmann, Google (from Linux Plumbers Conference 2013)
Gaps 
● Custom pixel formats 
● ADF uses FOURCC plus plugin validators to support custom format validation 
● Fences (a.k.a. implict versus explicit sync) 
● Fence management is part of ADF not driver; by time driver is asked to “post” an 
update the fences have already fired 
● dma-buf without GEM
Modelling the hardware 
● Examples 
● Non-memory backed planes (e.g. single colour, HDMI RX) 
● 4k bandwidth limitations leading to quirky data paths such as mixer groups 
● ADF model 
Overlays to scan out data and interfaces to display it 
A collection of overlays and interfaces for a “display” and are atomically managed 
● KMS model 
● CRTC + planes + encoders + connector 
● Multiple CRTCs cannot drive a single encoder
Modelling the hardware - ADF 
Mixer A 
Mixer B 
Mixer C 
HDMI 
VGA 
DSI 
Overlay engine Interface 
Device 
- Greg Hackmann, Google (from Linux Plumbers Conference 2013)
Modelling the hardware - DRM/KMS 
Frame Buffer 
(memory) 
Planes 
CRTC Encoder Connector 
- Laurent Pinchart, Ideas on Board (from LinuxCon Japan 2013) 
Connector 
Encoder Connector 
Planes 
(memory)
Driver LOC count 
● Internal API complexity 
● KMS drivers which use CMA benefit from significantly reduced internal complexity 
● GEM boilerplate 
● Framebuffer 
● KMS can put an image on display in generic way without using fb (plymouth does this) 
● drm_fbdev_cma_init() gives a CMA based driver fbdev support in a single statement 
● Copy-update-commit properties versus all-at-once meta-data 
● And to a lesser extent binary blobs versus properties
User space complexity 
“One thing that makes him mad [is] being dismissive of regressions. 
If somebody responds to a regression report by telling the reporter 
to upgrade their user space, he will come down on them.” 
- LWN reporting of “What makes Linus happy (or not)?” at Kernel 
Summit 2014 
DRM is a capability based API. 
Is a modern subset or an 
embedded subset possible?
More about Linaro Connect: connect.linaro.org 
Linaro members: www.linaro.org/members 
More about Linaro: www.linaro.org/about/

More Related Content

More from Linaro

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
 
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...Linaro
 
HKG18-317 - Arm Server Ready Program
HKG18-317 - Arm Server Ready ProgramHKG18-317 - Arm Server Ready Program
HKG18-317 - Arm Server Ready ProgramLinaro
 
HKG18-312 - CMSIS-NN
HKG18-312 - CMSIS-NNHKG18-312 - CMSIS-NN
HKG18-312 - CMSIS-NNLinaro
 
HKG18-301 - Dramatically Accelerate 96Board Software via an FPGA with Integra...
HKG18-301 - Dramatically Accelerate 96Board Software via an FPGA with Integra...HKG18-301 - Dramatically Accelerate 96Board Software via an FPGA with Integra...
HKG18-301 - Dramatically Accelerate 96Board Software via an FPGA with Integra...Linaro
 
HKG18-300K2 - Keynote: Tomas Evensen - All Programmable SoCs? – Platforms to ...
HKG18-300K2 - Keynote: Tomas Evensen - All Programmable SoCs? – Platforms to ...HKG18-300K2 - Keynote: Tomas Evensen - All Programmable SoCs? – Platforms to ...
HKG18-300K2 - Keynote: Tomas Evensen - All Programmable SoCs? – Platforms to ...Linaro
 

More from Linaro (20)

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
 
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
 
HKG18-317 - Arm Server Ready Program
HKG18-317 - Arm Server Ready ProgramHKG18-317 - Arm Server Ready Program
HKG18-317 - Arm Server Ready Program
 
HKG18-312 - CMSIS-NN
HKG18-312 - CMSIS-NNHKG18-312 - CMSIS-NN
HKG18-312 - CMSIS-NN
 
HKG18-301 - Dramatically Accelerate 96Board Software via an FPGA with Integra...
HKG18-301 - Dramatically Accelerate 96Board Software via an FPGA with Integra...HKG18-301 - Dramatically Accelerate 96Board Software via an FPGA with Integra...
HKG18-301 - Dramatically Accelerate 96Board Software via an FPGA with Integra...
 
HKG18-300K2 - Keynote: Tomas Evensen - All Programmable SoCs? – Platforms to ...
HKG18-300K2 - Keynote: Tomas Evensen - All Programmable SoCs? – Platforms to ...HKG18-300K2 - Keynote: Tomas Evensen - All Programmable SoCs? – Platforms to ...
HKG18-300K2 - Keynote: Tomas Evensen - All Programmable SoCs? – Platforms to ...
 

Recently uploaded

%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...masabamasaba
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburgmasabamasaba
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 

Recently uploaded (20)

%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 

LCU14 503 - What To Do About ADF?

  • 1. LCU14-503: What to do about ADF? Daniel Thompson, LCU14 LCU14 BURLINGAME
  • 2. Atomic display framework (ADF) ADF is a new(ish) feature found in 3.10 AOSP kernels that provides dma-buf centric plumbing framework between Android’s hwcomposer HAL and kernel driver ● Focuses heavily on data -> buffer validation, mapping and fencing ● Meta data (scaling, z-order, alpha...) is effectively out-of-scope; binary blob passed from HAL to driver ● Atomic display update (all buffers can hit the glass in one shot)
  • 3. Describing buffers struct adf_buffer { struct adf_overlay_engine *overlay_engine; u16 w, h; u32 format; /* DRM-style fourcc */ struct dma_buf *dma_bufs[ADF_MAX_PLANES]; u32 offset[ADF_MAX_PLANES]; u32 pitch[ADF_MAX_PLANES]; u8 n_planes; struct sync_fence *acquire_fence; /* optional */ }; - Greg Hackmann, Google (from Linux Plumbers Conference 2013)
  • 4. Describing atomic updates struct adf_post { size_t n_bufs; struct adf_buffer *bufs; struct adf_buffer_mapping *mappings; /* ADF-provided */ size_t custom_data_size; void *custom_data; }; - Greg Hackmann, Google (from Linux Plumbers Conference 2013)
  • 5. Atomic updates 1. ADF imports buffers, sanity-checks buffer sizes vs. formats 2. Driver does hardware-specific checks and assembles internal state int (*validate)(struct adf_device *dev, struct adf_post *cfg, void **driver_state); 3. ADF places config in queue 4. ADF worker dequeues config, waits for fences to fire 5. Driver updates hardware state and waits for flip void (*post)(struct adf_device *dev, struct adf_post *cfg, void *driver_state); 6. ADF worker advances sync timeline and releases old buffers 7. Driver cleans up internal state void (*state_free)(struct adf_device *dev, void *driver_state); - Greg Hackmann, Google (from Linux Plumbers Conference 2013)
  • 6. Why do we care “what to do about ADF?” ADF significantly overlaps with DRM/KMS Getting SoC drivers from GNU/Linux to work on Android/Linux (and vice versa) is simplified when GFX stack is unified. Want to avoid fragmented driver delivery and degraded bringup. Even companies strongly engaged with upstream GFX developers may still end up with forked GFX drivers to support Android; a poor ROI on upstreaming effort.
  • 7. Community activity in similar areas Linaro Android hwcomposer HAL implemented with DRM/KMS Rob Clark (TI/Linaro/Redhat) Atomic/nuclear modeset/pageflip Emil Velikov Upstream libdrm for Android “Inspired by the work of Chih-Wei Huang, from the Android-x86 project” “If there's community interest, moving forward I'd like to merge its functionality into KMS rather than keep it as a separate thing.” - Greg Hackmann
  • 8. A strawman approach Evolution is (almost) always the Linux way... ... we have to treat ADF motivations and features like a shopping list Experiences with DRM/KMS ● Complex API geared toward incremental updates ● CRTC + planes -> encoder(s) -> connector model doesn’t fit some embedded hardware ● Lots of boilerplate GEM + framebuffer code, duplicates dma-buf functionality ● Need support for custom pixel formats and explicit sync - Greg Hackmann, Google (from Linux Plumbers Conference 2013)
  • 9. A strawman approach Evolution is (almost) always the Linux way... ... we have to treat ADF motivations and features like a shopping list Experiences with DRM/KMS ● Complex API geared toward incremental updates ● CRTC + planes -> encoder(s) -> connector model doesn’t fit some embedded hardware ● Lots of boilerplate GEM + framebuffer code, duplicates dma-buf functionality ● Need support for custom pixel formats and explicit sync Can’t model hardware Driver LOC count Gaps Driver LOC count User space complexity - Greg Hackmann, Google (from Linux Plumbers Conference 2013)
  • 10. Gaps ● Custom pixel formats ● ADF uses FOURCC plus plugin validators to support custom format validation ● Fences (a.k.a. implict versus explicit sync) ● Fence management is part of ADF not driver; by time driver is asked to “post” an update the fences have already fired ● dma-buf without GEM
  • 11. Modelling the hardware ● Examples ● Non-memory backed planes (e.g. single colour, HDMI RX) ● 4k bandwidth limitations leading to quirky data paths such as mixer groups ● ADF model Overlays to scan out data and interfaces to display it A collection of overlays and interfaces for a “display” and are atomically managed ● KMS model ● CRTC + planes + encoders + connector ● Multiple CRTCs cannot drive a single encoder
  • 12. Modelling the hardware - ADF Mixer A Mixer B Mixer C HDMI VGA DSI Overlay engine Interface Device - Greg Hackmann, Google (from Linux Plumbers Conference 2013)
  • 13. Modelling the hardware - DRM/KMS Frame Buffer (memory) Planes CRTC Encoder Connector - Laurent Pinchart, Ideas on Board (from LinuxCon Japan 2013) Connector Encoder Connector Planes (memory)
  • 14. Driver LOC count ● Internal API complexity ● KMS drivers which use CMA benefit from significantly reduced internal complexity ● GEM boilerplate ● Framebuffer ● KMS can put an image on display in generic way without using fb (plymouth does this) ● drm_fbdev_cma_init() gives a CMA based driver fbdev support in a single statement ● Copy-update-commit properties versus all-at-once meta-data ● And to a lesser extent binary blobs versus properties
  • 15. User space complexity “One thing that makes him mad [is] being dismissive of regressions. If somebody responds to a regression report by telling the reporter to upgrade their user space, he will come down on them.” - LWN reporting of “What makes Linus happy (or not)?” at Kernel Summit 2014 DRM is a capability based API. Is a modern subset or an embedded subset possible?
  • 16. More about Linaro Connect: connect.linaro.org Linaro members: www.linaro.org/members More about Linaro: www.linaro.org/about/