Mainline Explicit Fencing

Similar documents
Running Android on the Mainline Graphics Stack. Robert

Marek Szyprowski Samsung R&D Institute Poland

Display and Kernel Review and Future

Sync Points in the Intel Gfx Driver. Jesse Barnes Intel Open Source Technology Center

Graphics Stack Update

Bringing display and 3D to the C.H.I.P computer

Bringing display and 3D to the C.H.I.P computer

Building X 2D rendering acceleration with OpenGL. Eric Anholt Intel Open Source Technology Center

The Linux graphics stack, Optimus and the Nouveau driver

EXPLICIT SYNCHRONIZATION

Linux DRM Developer s Guide

Linux DRM Developer s Guide

Generic Buffer Sharing Mechanism for Mediated Devices

DRM(Direct Rendering Manager) of Tizen Kernel Joonyoung Shim

LCA14-417: mmap, allocators & sharing buffers - userland experience. Thu 6 March, 4:10pm, S.Semwal, B.Gaignard

Status Report 2015/09. Alexandre Courbot Martin Peres. Logo by Valeria Aguilera, CC BY-ND

Media Controller (MC) and OMAP2+ Display Subsystem (DSS) Embedded Linux Conference, SFO, 2011 Sumit Semwal

Vulkan Timeline Semaphores

Porting Tizen-IVI 3.0 to an ARM based SoC Platform

Expose NVIDIA s performance counters to the userspace for NV50/Tesla

The Nouveau community at FOSDEM History Architecture Conclusion Demos. Nouveau. Recap, on-going and future work

Memory Management in Tizen. SW Platform Team, SW R&D Center

Porting Tizen-IVI 3.0 to an ARM based SoC Platform. Damian Hobson-Garcia, IGEL Co., Ltd.

PRIME Synchronization. XDC 2016 Alex Goins, Andy Ritger

Kodi and Embedded Linux

The pathway to Chromium on Wayland

UI, Graphics & EFL. Carsten Haitzler Principal Engineer Samsung Electronics Korea Founder/Leader Enlightenment / EFL

Methods to protect proprietary components in device drivers

DRI Memory Management

Framebuffer Modifiers

QtWayland. Creating Window Compositors with the QtWayland module

Status of the Embedded GPU Space

Wayland IVI Extension

Display Virtualization with KVM for Automotive Systems

Groking the Linux SPI Subsystem FOSDEM Matt Porter

A brief overview of DRM/KMS and its status in NetBSD

Experiences Developing a Wayland-Based Tizen IVI HMI. Ossama Othman

Chromium Blink on Wayland with HW accelerated video playback using Gstreamer

LIQUIDVR TODAY AND TOMORROW GUENNADI RIGUER, SOFTWARE ARCHITECT

Unix Device Memory. James Jones XDC 2016

Bringing Vulkan to VR. Cass Everitt, Oculus

Intel GFX CI and IGT. What services do we provide, our roadmaps, and lessons learnt! Martin Peres & Arek Hiler Feb 3 rd 2018

The Wayland Display Server

Vulkan 1.1 March Copyright Khronos Group Page 1

Exporting virtual memory as dmabuf. Nikhil Devshatwar Texas Instruments, India

Android-x86 status update

Linux GPU Driver Developer s Guide

Vulkan: Scaling to Multiple Threads. Kevin sun Lead Developer Support Engineer, APAC PowerVR Graphics

Chromium on Wayland - Status update. Automotive Grade Linux F2F meeting (04/2017) Antonio Gomes & Silvia Cho

Explicit Multi GPU Programming with DirectX 12. Juha Sjöholm Developer Technology Engineer NVIDIA

JAVA BYTE IPC: PART 1 DERIVING NIO FROM I/O. Instructor: Prasun Dewan (FB 150,

TG-Gallium Driver Stack. Softpipe, Cell and Beyond. Keith Whitwell

Weston Plugin Based IVI Layer Management. Ossama Othman 20 September 2012

Release Notes. FW Version Localization

Mainline on form-factor devices / Improving AOSP

Vulkan: Architecture positive How Vulkan maps to PowerVR GPUs Kevin sun Lead Developer Support Engineer, APAC PowerVR Graphics.

Async Workgroup Update. Barthold Lichtenbelt

Experiences Developing a Wayland Based IVI HMI. Ossama Othman 28 May 2013

HMM: GUP NO MORE! XDC Jérôme Glisse

Kodi v18 features and improvements. Martijn Kaijser

Shared Memory Programming with OpenMP. Lecture 8: Memory model, flush and atomics

Swapchains Unchained!

Making C Less Dangerous

Thanks for Live Snapshots, Where's Live Merge?

Kodi v18 features and improvements. Martijn Kaijser

SFO15-100: 96Boards & the course upstream

LTSI : Status update and discussion. Long Term Support Ini1a1ve

Bluetooth Low Energy on Android

Android Kernel Security

ATC Android Application Development

HETEROGENEOUS MEMORY MANAGEMENT. Linux Plumbers Conference Jérôme Glisse

Introduction Pascal support Power management Userspace Community Conclusion. Nouveau. Recap, on-going and future work

Perf: From Profiling to Kernel Mobile Threat Response Team

WPE WebKit. HTML5 user interfaces for embedded devices. Juan José Sánchez Penas Embedded Linux Conference Prague, October 2017

Integration of the Chromium. Browser in the GENIVI Platform

Releasing and Testing Free Opensource Graphics Drivers: the case of Mesa3D

EzBench, a tool to help you benchmark and bisect the Graphics Stack s performance

Breaking Down Barriers: An Intro to GPU Synchronization. Matt Pettineo Lead Engine Programmer Ready At Dawn Studios

Porting Nouveau to Tegra K1

Press Briefing SIGGRAPH 2015 Neil Trevett Khronos President NVIDIA Vice President Mobile Ecosystem. Copyright Khronos Group Page 1

Linux: Reducing the cost of upstream development to encourage collaboration

PERFORMANCE ANALYSIS AND DEBUGGING FOR VOLTA. Felix Schmitt 11 th Parallel Tools Workshop September 11-12, 2017

EFL at ELC 2016 A toolkit for developping efficient and attractive Uis on embedded devices

What's new in the Linux kernel

Linux-CR: Transparent Application Checkpoint-Restart in Linux

Open Build Service in Debian It is impressive how much time and resources a team can save

Michael Adler 2017/09

Advanced OpenMP. Memory model, flush and atomics

MIGSOCK A Migratable TCP Socket in Linux

VCube Release Notes. Updates: Please check our Web site periodically for information, patches and updates.

EGLSTREAMS: INTEROPERABILITY FOR CAMERA, CUDA AND OPENGL. Debalina Bhattacharjee Sharan Ashwathnarayan

DTrace for Linux. Tomas Jedlicka Sat

The future of X.Org on non-gnu/linux systems

Asynchronous Peer-to-Peer Device Communication

Doom 3 Dante. Performance on Mesa (i965) (Not a Demo!) Oliver McFadden 1

Change-sets. Basavaraj Karadakal

The DRM/KMS subsystem from a newbie s point of view

AOSP Mini-Conference. Linaro

Team Up: Contributing to the Tizen Platform. Narasimha Swamy Sanjay NM

Reboot: Tizen Widget Framework. Hyun Ho, Kang Engineer Samsung Electronics. Copyright 2017 Samsung. All Rights Reserved.

Transcription:

Mainline Explicit Fencing A new era for graphics Gustavo Padovan Open First

Agenda Introduction Android Sync Framework Mainline Explicit Fencing Current Status 2

Fencing Ensure ordering between operations Synchronize buffer sharing e.g.: Between GPU and Display drivers Allow async operations Implicit fencing: userspace not aware Explicit fencing: userspace aware 3

Implicit Fencing No userspace knowledge/interference Simple/Dumb compositors No buffer state information But it can freeze the whole desktop! 4

Implicit Fencing A C B Buffer C will be composed of A and B Buffers A and B can render in Parallel Compositor notified only when both finishes 5

Implicit Fencing A C B A is fast and B takes too long C is blocked waiting for both to render The entire desktop freezes! 6

Explicit Fencing Fences goes to userspace Userspace can control synchronization Smart decisions on compositors Avoid blocking the entire desktop 7

Explicit Fencing Consumer/Producer without blocking 8

Explicit Fencing Better for traceability/debuggability Vulkan needs it Part of the API Efficient subbuffer processing 9

Android Sync Framework Android's Explicit Fencing implementation Use fd for fence passing Sync Timeline to control ordering Sync Point to represent a fence Sync Fence for fd passing 10

Sync Timeline 1 2 3 4 5 16 7... Monotonically increasing counter Usually one timeline per driver context 11

Sync Point 1 2 3 4 5 16 7... 2 3 It is the fence Represents a value on the timeline Three states: active, signaled and error 12

Sync Fence 1 2 3 4 5 1 6 7... 2 8 6 7 8 9 10 11 12... Wrap Sync Point into a file Also have active and signaled states Shared via fd-passing to/from userspace 13

Sync Fence 1 2 3 4 5 1 6 7... 2 2 8 8 6 7 8 9 10 11 12... Sync fences can be merged! It can contain many Sync Points 14

Android Sync Framework - ioctls sync_wait(fd, timeout) fd3 = sync_merge(fd1, fd2) sync_fence_info(fd, info) 15

Mainline Explicit Fencing Started with the fence synchronization mechanism by Maarten Lankhorst Buffer synchronization between drivers 16

struct fence fence->context fence_signal() fence_wait() fence_add_callback() 17

Sync Framework de-staging Android Sync added to staging in 2013 Mainly need for fd-passing Removed Sync Timeline Removed Sync Point Reworked Sync Fence 18

Sync File Renamed Sync Fence to Sync File Changed ioctl API Provided patch to Android's libsync Removed internal kernel API Used strictly for fd-passing sync_file = sync_file_create(fence) fence = sync_file_get_fence(fd) 19

struct fence_array Subclass of struct fence Store multiple fences Useful for merged Sync File Hide complexity from the drivers fence_is_array(fence) 20

DRM/KMS Only available for Atomic Modesetting Entirely in DRM Core Extended Atomic IOCTL in-fences: received from userspace out-fences: sent to userspace 21

DRM/KMS: in-fences in-fences: fences received from userspace FENCE_FD property on each DRM Plane Receives sync_file fds carrying fences drm_atomic_helper_wait_for_fences() helper 22

DRM/KMS: out-fences One out-fence per DRM CRTC get_unused_fd() + sync_file_create() + fd_install() It signals at CRTC scanout It means the previous buffer can be reused. Userspace need to ask for out-fence DRM_MODE_ATOMIC_OUT_FENCE flag libdrm: drmmodeatomicaddoutfences() 23

DRM/renderer Similar to KMS side Extends execbuffer ioctl args on each driver Every driver needs sync_file/fences support WIP on freedreno, i915 and virgl 24

Mesa EGL_ANDROID_native_fence_sync Create fence fd EGL_ANDROID_wait_sync Make the GPU wait for fence to signal WIP by Rob Clark kmscube running on explicit fencing 25

drm_hwcomposer2 Already support DRM fences semantic Use it as example userspace for upstream WIP by Sean Paul and Robert Foss 26

Current Status Summary Sync File syncronization de-stage: DONE SW_SYNC validation de-stage: DONE fence_array: DONE DRM/KMS: WIP 4.10? DRM/renderer: WIP 4.10? MESA: WIP igt-gpu-tools: WIP drm_hwcomposer2: WIP Wayland: TODO V4L explicit fences: TODO 27

Thank you to everyone involved Daniel Vetter, Rob Clark, Greg KH, Daniel Stone, Robert Foss, Sean Paul, Stéphane Marchesin, Maarten Lankhorst, Chris Wilson, Christian König and others. 28

Thank you! Gustavo Padovan gustavo@padovan.org www.padovan.org www.collabora.com