Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning

21
State of DRM (graphics driver subsystem, not the other thing) Daniel Vetter, Intel OTC Kernel Recipes 2016, Paris

Transcript of Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning

Page 1: Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning

State of DRM(graphics driver subsystem, not the other thing)

Daniel Vetter, Intel OTCKernel Recipes 2016, Paris

Page 2: Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning

tl;dr;

world domination progressing according to plan

Page 3: Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning

kerneldoc

● much pretty, such awesome

● sphinx+rst+/scripts/kernel­doc

● https://dri.freedesktop.org/docs/drm/

Page 4: Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning

kerneldoc … for DRM!

● everything atomic, see later● drm_crtc.c split into ~10 files and docs added● and more

Page 5: Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning

dungeons&dragons

● DRI1 legacy drivers still exist● 10+ years of bad UAPI and creative root holes

● now fully hidden behind drm_legacy_*● … and core de-midlayered

Page 6: Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning

IGT gpu tests

● port Intel tests to be generic● starting to get used on many drivers● plus CI systems!● https://dri.freedesktop.org/docs/drm/gpu/drm-

uapi.html#validating-changes-with-igt

Page 7: Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning

userspace requirements

● require open source for any UAPI● https://dri.freedesktop.org/docs/drm/gpu/drm-

uapi.html#open-source-userspace-requirements

Page 8: Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning

atomic display driver

● check/commit semantics● flicker-free commit● because hw● because direct scanout saves power

Page 9: Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning

atomic advances

● 20 drivers and counting, 2-3 more per release● lots of small polish and boiler-plate removal● docs, docs, docs● modular helper library now fully proven

Page 10: Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning

one atomic to rule them all

● drm_hwcomposer, for Android● CrOS&Ozone, using wayland● all the waylands

Page 11: Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning

atomic future

● trouble with some legacy use-cases, cursors● buffer allocation needs more UAPI● benchmark mode

Page 12: Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning

generic fbdev defio

● manual upload display to save memory bw● FBDEV now remapped to KMS● … dirty rectangle still missing for flips

Page 13: Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning

simple display pipeline helper

● simple pipe + 1 connectors● based on atomic, without the complexity● DRM now (strictly) better than FBDEV

Page 14: Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning

fences

● struct completion, but for DMA

● implicit: kernel takes care● explicit: userspace passes fences around

● kernel-internally a struct fence

Page 15: Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning

implicit fencing

● reservation_object on dma_buf● TTM (amd/nouveau) always supported it● support finally rolling out everywhere else● for Linux desktop (both X&Wayland)

Page 16: Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning

explicit fencing

● struct sync_file, exported as an FD

● more control for userspace● less complexity in (vendor tree) drivers needed● for Android

Page 17: Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning

explicit fencing for rendering

● userspace fences fully destaged in 4.9● EGL_ANDROID_native_sync for

msm/freedreno in 4.9 and mesa-next● interaction with implicit fencing is tricky

Page 18: Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning

explicit fencing for atomic KMS

● Google made HWC2 to suit upstream● blocked by embargo, hopefully 4.10● drm_hwcomposer has support● for details attend LPC

Page 19: Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning

rsn Android on upstream*

* without a joke** of a graphics stack

** I'm biased ;-)

Page 20: Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning

rendering?

● 2+1 vendor supported open drivers● 1+1+1 reverse-engineered drivers● plus virtual ones● still dire :(

Page 21: Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning

summary

● atomic rules them all● docs, tests and lots of cleanup● closed all major gaps for writing display drivers● cross-driver fence for everyone● even rendering shows some (slow) progress