SlideShare una empresa de Scribd logo
1 de 16
Descargar para leer sin conexión
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/

Más contenido relacionado

Más de 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
 

Más de 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 ...
 

Último

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 

Último (20)

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 

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/