SlideShare a Scribd company logo
1 of 28
Download to read offline
1/28
Porting DRM/KMS drivers to DragonFly BSD
François Tigeot
<ftigeot@wolfpond.org>
2/28
About myself
● Consultant, software developer, Sysadmin
● Former ccTLD System Engineer
● X11 and *BSD user since a heck of a long time
● Introduced FreeBSD in the .fr registry
● DragonFly developer since 2011
3/28
About DragonFly
● Unix-like Operating System
● Forked from FreeBSD 4.8 in 2003 by Matthew
Dillon
● Aims to be high-performance and scalable
● Uses per-core replicated resources
● Many operations are naturally lockless
● Caches stay hot
4/28
About DragonFly (2)
● Innovative features very useful for some workloads
● HAMMER filesystem
– History retention
– Deduplication
– Real-time replication
● Swapcache: second-level file cache
– Uses existing swap infrastructure
– Optimized for SSDs
5/28
About DragonFly (3)
1 5 10 15 20 25 30 35 40 60 80
0
50000
100000
150000
200000
250000
300000
350000
PostgreSQL 9.3 performance
DragonFly 3.6.1
Debian 7.0
Centos 6.5
Clients
TPS
6/28
First tentative
● David Shao, Google Summer Of Code 2010
● Based on Linux + a compatibility layer
● Dropped early but continued in his spare time
later
● Apparently got something to work
● Sadly probably specific to his machine
● Only got crashes with my hardware
7/28
Starting again with FreeBSD
● Many common kernel APIs with DragonFly, seemed
like a good idea at the time
● June 2012: Start implementing newly required APIs
● December 2012: drm/i915 mostly ported
● June 2013: i915 starts working after adding PAT
support to the kernel
● October 2013: ttm + radeon mostly ported
● July 2014: ttm + radeon working reliably
8/28
FreeBSD dropped the ball
● No significant updates to drm/i915 after 2012
● Latest supported hardware: Ivy-Bridge
● Prevents updates to their generic drm code and
the drm/radeon driver
● I switched to Linux as the new i915 upstream in
September 2013
● Most important goal: Haswell support
9/28
FreeBSD issues
● FreeBSD code vastly different from Linux
● Some very old parts
● Most modern features ~= Linux 3.4
● Two different versions of drm + drm drivers
– Old drm/ directory
– New drm2/ directory
● Most code the same, pointlessly duplicated!
10/28
Rebasing on Linux (1)
● Target: Linux 3.8.13
● Linux 3.8 first version with known working
Haswell support
● drm/radeon port based on Linux 3.8
● OpenBSD also targeting Linux 3.8.x
● OpenBSD has the best *BSD drm
implementation so far (2014-09)
11/28
Rebasing on Linux (2)
● Remove FreeBSD-inherited drm2/ directory
● Put everything into drm/
● Remove old drm1 radeon and i915 drivers in
the process
● Also clean up the agp driver
12/28
Update process
● 1. Diff Linux and DragonFly code
● 2. Reduce pointless noise
● 3. Identify important functional differences
● 4. Implement them piecemeal
● 6. Replay Linux git history if required
● 5. Try to keep commits small
13/28
Pointless noise in drm/i915
● Different file names
● Functions implemented in different order
● Functions present in different files
● Two previous items biggest source of loc
differences
● June 2014: moved most functions to the same
place they were in Linux 3.8.13
● Reduced differences from ~= 50K to 22K loc
14/28
Style changes in drm/i915
● The FreeBSD drm/i915 author basically rewrote
the entire driver to change its coding style
– if (ret != 0)
– If (ret)
● It was unmaintainable
● Had to reduce the amount of noise before
tackling functional differences
15/28
Difficult spots
● GEM VM code
– FreeBSD used custom do-everything routines different
from the Linux GEM implementation
– i915_gem_obj_io() in FreeBSD
– Various functions like i915_gem_shmem_pwrite() in
Linux
● I2c API in Linux, iic API in FreeBSD+DragonFly
● Hard to make these parts of the drivers work like
they do in Linux
16/28
Implement Linux APIs
● Same old idea as David Shao's who used a
Linux compatibility layer
● Many linux/xxx.h wrappers taken from FreeBSD
(OFED project, Infiniband)
● Some APIs implemented locally: idr(9), various
linux/yyy.h headers, etc...
● Other Linux functions taken from OpenBSD
17/28
Implement Linux APIs (2)
● Graphic drivers very complex
● Fast moving targets
● It makes more sense to change the DragonFly
kernel to behave like Linux than trying to
constantly keep up and change the drivers to
use *BSD-specific APIs
● In a way I'm porting DragonFly to the drm
drivers and not the drivers to DragonFly
18/28
Implement Linux APIs (3)
● ls /usr/src/sys/drm/include/linux
atomic.h export.h jiffies.h timer.h
bitops.h hash.h kernel.h types.h
compiler.h highmem.h kref.h wait.h
completion.h i2c.h list.h workqueue.h
delay.h idr.h mutex.h
err.h io.h time.h
● Most common Linux APIs used in i915 ttm and radeon
implemented by wrappers
● Reduce differences as much as possible in the drm/* directories
● Major exception: locking directives
19/28
The road to Haswell support
● 1. Reduce noise
● 2. Replace FreeBSD APIs by Linux ones
● 3. Update the interrupt code
● 4. Update the ringbuffer code
● 5. Update the output management code
● 6. Haswell-specific cache attributes in page tables
● Finally working reliably in August 2014
20/28
A few words about Userland
● Pkgsrc packages used until 2013
● Xorg-server 1.6
● I wanted to update it
● Didn't happen
● Lost interest
21/28
A few words about Userland (2)
● Switched to Dports
● FreeBSD ports + adaptation layer + automatic
tests and validation
● Much better
● Gave us xorg-server 1.12 and contemporary
software
22/28
A few words about Userland (3)
● Sadly, FreeBSD ports are beginning to lag
● Updating Cairo from 1.10 to 1.12 took years
● Still using xf86-video-intel 2.21.15
● Had to create a locally managed port of xf86-
video-intel 2.99.x
● Hope it won't become necessary for other parts
23/28
Current state
● drm/i915 mostly in sync with Linux 3.8.13
– Not the GEM code
● drm/radeon mostly in sync with Linux 3.8
● drm/ttm in sync with Linux 3.9
● Generic drm code a mess
– A few parts up to Linux 3.8.13
– Others much much older (< Linux 2.6.26)
24/28
Future directions
● Synchronize the drm code itself to Linux 3.8.13
– Required for key features like DRM Prime, DRM-
master, etc...
● Then start upgrading drm+drivers to more
recent versions
● Porting drm/nouveau also a good idea
– Should be easier now that ttm is working properly
25/28
Future directions (2)
● Restore 80x25 VGA text mode after Xorg exit
● Currently black screen or frozen image
● Alternatively implement a graphical TTY layer
● Patches are floating around
26/28
FreeBSD credits
● Konstantin Belousov
– Updated drm and drm/i915 to support gem+kms
– Ported most parts of drm/ttm to FreeBSD
● Alexander Kabaev
– Started to port the radeon driver
● Jean-Sébastien Pédron
– Finished the port of drm/radeon from Linux 3.8
– Critical fixes to drm/ttm
27/28
DragonFly Credits
● François Tigeot: bulk of drm, drm/i915, drm/ttm
and drm/radeon porting
● Johannes Hofmann: made i915 work
● Matt Dillon: made i915 and ttm work reliably
– Added PAT support to the kernel
– fixed critical VM bugs
● Joris Giovanelli and Markus Pfeiffer: critical bug
investigations and fixes
28/28
Questions ?

More Related Content

What's hot

FD.io Vector Packet Processing (VPP)
FD.io Vector Packet Processing (VPP)FD.io Vector Packet Processing (VPP)
FD.io Vector Packet Processing (VPP)Kirill Tsym
 
Lightweight Virtualization: LXC Best Practices
Lightweight Virtualization: LXC Best PracticesLightweight Virtualization: LXC Best Practices
Lightweight Virtualization: LXC Best PracticesWerner Fischer
 
OpenZFS send and receive
OpenZFS send and receiveOpenZFS send and receive
OpenZFS send and receiveMatthew Ahrens
 
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSDLAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSDLinaro
 
Porting linux to a new architecture
Porting linux to a new architecturePorting linux to a new architecture
Porting linux to a new architectureKALRAY
 
LAS16-209: Finished and Upcoming Projects in LMG
LAS16-209: Finished and Upcoming Projects in LMGLAS16-209: Finished and Upcoming Projects in LMG
LAS16-209: Finished and Upcoming Projects in LMGLinaro
 
Tempesta FW: a FrameWork and FireWall for HTTP DDoS mitigation and Web Applic...
Tempesta FW: a FrameWork and FireWall for HTTP DDoS mitigation and Web Applic...Tempesta FW: a FrameWork and FireWall for HTTP DDoS mitigation and Web Applic...
Tempesta FW: a FrameWork and FireWall for HTTP DDoS mitigation and Web Applic...Alexander Krizhanovsky
 
OpenZFS Developer Summit Introduction
OpenZFS Developer Summit IntroductionOpenZFS Developer Summit Introduction
OpenZFS Developer Summit IntroductionMatthew Ahrens
 
The Linux Kernel Scheduler (For Beginners) - SFO17-421
The Linux Kernel Scheduler (For Beginners) - SFO17-421The Linux Kernel Scheduler (For Beginners) - SFO17-421
The Linux Kernel Scheduler (For Beginners) - SFO17-421Linaro
 
DNF FUDCon Pune 2015
DNF FUDCon Pune 2015DNF FUDCon Pune 2015
DNF FUDCon Pune 2015Parag
 
LAS16-TR02: Upstreaming 101
LAS16-TR02: Upstreaming 101LAS16-TR02: Upstreaming 101
LAS16-TR02: Upstreaming 101Linaro
 
BKK16-106 ODP Project Update
BKK16-106 ODP Project UpdateBKK16-106 ODP Project Update
BKK16-106 ODP Project UpdateLinaro
 
Andrea Righi - Spying on the Linux kernel for fun and profit
Andrea Righi - Spying on the Linux kernel for fun and profitAndrea Righi - Spying on the Linux kernel for fun and profit
Andrea Righi - Spying on the Linux kernel for fun and profitlinuxlab_conf
 
FreeBSD and Drivers
FreeBSD and DriversFreeBSD and Drivers
FreeBSD and DriversKernel TLV
 
CS 626 - March : Capsicum: Practical Capabilities for UNIX
CS 626 - March : Capsicum: Practical Capabilities for UNIXCS 626 - March : Capsicum: Practical Capabilities for UNIX
CS 626 - March : Capsicum: Practical Capabilities for UNIXruchith
 
Linuxcon Barcelon 2012: LXC Best Practices
Linuxcon Barcelon 2012: LXC Best PracticesLinuxcon Barcelon 2012: LXC Best Practices
Linuxcon Barcelon 2012: LXC Best Practiceschristophm
 
Debugging with-wireshark-niels-de-vos
Debugging with-wireshark-niels-de-vosDebugging with-wireshark-niels-de-vos
Debugging with-wireshark-niels-de-vosGluster.org
 

What's hot (20)

FD.io Vector Packet Processing (VPP)
FD.io Vector Packet Processing (VPP)FD.io Vector Packet Processing (VPP)
FD.io Vector Packet Processing (VPP)
 
OpenZFS at LinuxCon
OpenZFS at LinuxConOpenZFS at LinuxCon
OpenZFS at LinuxCon
 
Lightweight Virtualization: LXC Best Practices
Lightweight Virtualization: LXC Best PracticesLightweight Virtualization: LXC Best Practices
Lightweight Virtualization: LXC Best Practices
 
OpenZFS send and receive
OpenZFS send and receiveOpenZFS send and receive
OpenZFS send and receive
 
Foss Gadgematics
Foss GadgematicsFoss Gadgematics
Foss Gadgematics
 
Masters porting linux
Masters porting linuxMasters porting linux
Masters porting linux
 
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSDLAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
 
Porting linux to a new architecture
Porting linux to a new architecturePorting linux to a new architecture
Porting linux to a new architecture
 
LAS16-209: Finished and Upcoming Projects in LMG
LAS16-209: Finished and Upcoming Projects in LMGLAS16-209: Finished and Upcoming Projects in LMG
LAS16-209: Finished and Upcoming Projects in LMG
 
Tempesta FW: a FrameWork and FireWall for HTTP DDoS mitigation and Web Applic...
Tempesta FW: a FrameWork and FireWall for HTTP DDoS mitigation and Web Applic...Tempesta FW: a FrameWork and FireWall for HTTP DDoS mitigation and Web Applic...
Tempesta FW: a FrameWork and FireWall for HTTP DDoS mitigation and Web Applic...
 
OpenZFS Developer Summit Introduction
OpenZFS Developer Summit IntroductionOpenZFS Developer Summit Introduction
OpenZFS Developer Summit Introduction
 
The Linux Kernel Scheduler (For Beginners) - SFO17-421
The Linux Kernel Scheduler (For Beginners) - SFO17-421The Linux Kernel Scheduler (For Beginners) - SFO17-421
The Linux Kernel Scheduler (For Beginners) - SFO17-421
 
DNF FUDCon Pune 2015
DNF FUDCon Pune 2015DNF FUDCon Pune 2015
DNF FUDCon Pune 2015
 
LAS16-TR02: Upstreaming 101
LAS16-TR02: Upstreaming 101LAS16-TR02: Upstreaming 101
LAS16-TR02: Upstreaming 101
 
BKK16-106 ODP Project Update
BKK16-106 ODP Project UpdateBKK16-106 ODP Project Update
BKK16-106 ODP Project Update
 
Andrea Righi - Spying on the Linux kernel for fun and profit
Andrea Righi - Spying on the Linux kernel for fun and profitAndrea Righi - Spying on the Linux kernel for fun and profit
Andrea Righi - Spying on the Linux kernel for fun and profit
 
FreeBSD and Drivers
FreeBSD and DriversFreeBSD and Drivers
FreeBSD and Drivers
 
CS 626 - March : Capsicum: Practical Capabilities for UNIX
CS 626 - March : Capsicum: Practical Capabilities for UNIXCS 626 - March : Capsicum: Practical Capabilities for UNIX
CS 626 - March : Capsicum: Practical Capabilities for UNIX
 
Linuxcon Barcelon 2012: LXC Best Practices
Linuxcon Barcelon 2012: LXC Best PracticesLinuxcon Barcelon 2012: LXC Best Practices
Linuxcon Barcelon 2012: LXC Best Practices
 
Debugging with-wireshark-niels-de-vos
Debugging with-wireshark-niels-de-vosDebugging with-wireshark-niels-de-vos
Debugging with-wireshark-niels-de-vos
 

Similar to Porting the drm/kms graphic drivers to DragonFlyBSD by Francois Tigeot

Bsdtw17: lightning talks/wip sessions
Bsdtw17: lightning talks/wip sessionsBsdtw17: lightning talks/wip sessions
Bsdtw17: lightning talks/wip sessionsScott Tsai
 
Embedded Linux Basics
Embedded Linux BasicsEmbedded Linux Basics
Embedded Linux BasicsMarc Leeman
 
Bsdtw17: george neville neil: realities of dtrace on free-bsd
Bsdtw17: george neville neil: realities of dtrace on free-bsdBsdtw17: george neville neil: realities of dtrace on free-bsd
Bsdtw17: george neville neil: realities of dtrace on free-bsdScott Tsai
 
lxc-namespace.pdf
lxc-namespace.pdflxc-namespace.pdf
lxc-namespace.pdf-
 
Improving DragonFly's performance with PostgreSQL by Francois Tigeot
Improving DragonFly's performance with PostgreSQL by Francois TigeotImproving DragonFly's performance with PostgreSQL by Francois Tigeot
Improving DragonFly's performance with PostgreSQL by Francois Tigeoteurobsdcon
 
Chimera Linux: A BSD-LLVM distro from scratch
Chimera Linux: A BSD-LLVM distro from scratchChimera Linux: A BSD-LLVM distro from scratch
Chimera Linux: A BSD-LLVM distro from scratchIgalia
 
Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Opersys inc.
 
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)Ron Munitz
 
Leveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VILeveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VIOpersys inc.
 
Leveraging Android's Linux Heritage
Leveraging Android's Linux HeritageLeveraging Android's Linux Heritage
Leveraging Android's Linux HeritageOpersys inc.
 
Leveraging Android's Linux Heritage at AnDevCon V
Leveraging Android's Linux Heritage at AnDevCon VLeveraging Android's Linux Heritage at AnDevCon V
Leveraging Android's Linux Heritage at AnDevCon VOpersys inc.
 
Building a Linux distro with LLVM
Building a Linux distro        with LLVMBuilding a Linux distro        with LLVM
Building a Linux distro with LLVMIgalia
 
LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205Linaro
 
Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011Opersys inc.
 
Up and Running with Freebsd
Up and Running with FreebsdUp and Running with Freebsd
Up and Running with FreebsdGLC Networks
 
Leveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVLeveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVOpersys inc.
 
[KubeCon NA 2020] containerd: Rootless Containers 2020
[KubeCon NA 2020] containerd: Rootless Containers 2020[KubeCon NA 2020] containerd: Rootless Containers 2020
[KubeCon NA 2020] containerd: Rootless Containers 2020Akihiro Suda
 
Lt2013 glusterfs.talk
Lt2013 glusterfs.talkLt2013 glusterfs.talk
Lt2013 glusterfs.talkUdo Seidel
 

Similar to Porting the drm/kms graphic drivers to DragonFlyBSD by Francois Tigeot (20)

Bsdtw17: lightning talks/wip sessions
Bsdtw17: lightning talks/wip sessionsBsdtw17: lightning talks/wip sessions
Bsdtw17: lightning talks/wip sessions
 
Embedded Linux Basics
Embedded Linux BasicsEmbedded Linux Basics
Embedded Linux Basics
 
Bsdtw17: george neville neil: realities of dtrace on free-bsd
Bsdtw17: george neville neil: realities of dtrace on free-bsdBsdtw17: george neville neil: realities of dtrace on free-bsd
Bsdtw17: george neville neil: realities of dtrace on free-bsd
 
lxc-namespace.pdf
lxc-namespace.pdflxc-namespace.pdf
lxc-namespace.pdf
 
Improving DragonFly's performance with PostgreSQL by Francois Tigeot
Improving DragonFly's performance with PostgreSQL by Francois TigeotImproving DragonFly's performance with PostgreSQL by Francois Tigeot
Improving DragonFly's performance with PostgreSQL by Francois Tigeot
 
Chimera Linux: A BSD-LLVM distro from scratch
Chimera Linux: A BSD-LLVM distro from scratchChimera Linux: A BSD-LLVM distro from scratch
Chimera Linux: A BSD-LLVM distro from scratch
 
Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3
 
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
 
Leveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VILeveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VI
 
Leveraging Android's Linux Heritage
Leveraging Android's Linux HeritageLeveraging Android's Linux Heritage
Leveraging Android's Linux Heritage
 
Leveraging Android's Linux Heritage at AnDevCon V
Leveraging Android's Linux Heritage at AnDevCon VLeveraging Android's Linux Heritage at AnDevCon V
Leveraging Android's Linux Heritage at AnDevCon V
 
Building a Linux distro with LLVM
Building a Linux distro        with LLVMBuilding a Linux distro        with LLVM
Building a Linux distro with LLVM
 
LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205
 
Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011
 
Up and Running with Freebsd
Up and Running with FreebsdUp and Running with Freebsd
Up and Running with Freebsd
 
Fedora 12 Introduction
Fedora 12 IntroductionFedora 12 Introduction
Fedora 12 Introduction
 
FreeBSD Portscamp, Kuala Lumpur 2016
FreeBSD Portscamp, Kuala Lumpur 2016FreeBSD Portscamp, Kuala Lumpur 2016
FreeBSD Portscamp, Kuala Lumpur 2016
 
Leveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVLeveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IV
 
[KubeCon NA 2020] containerd: Rootless Containers 2020
[KubeCon NA 2020] containerd: Rootless Containers 2020[KubeCon NA 2020] containerd: Rootless Containers 2020
[KubeCon NA 2020] containerd: Rootless Containers 2020
 
Lt2013 glusterfs.talk
Lt2013 glusterfs.talkLt2013 glusterfs.talk
Lt2013 glusterfs.talk
 

More from eurobsdcon

EuroBSDCon 2014 Program Front
EuroBSDCon 2014 Program FrontEuroBSDCon 2014 Program Front
EuroBSDCon 2014 Program Fronteurobsdcon
 
EuroBSDCon 2014 tutorials program Thursday & Friday
EuroBSDCon 2014 tutorials program Thursday & FridayEuroBSDCon 2014 tutorials program Thursday & Friday
EuroBSDCon 2014 tutorials program Thursday & Fridayeurobsdcon
 
EuroBSDCon 2014 Sofia Welcome
EuroBSDCon 2014 Sofia WelcomeEuroBSDCon 2014 Sofia Welcome
EuroBSDCon 2014 Sofia Welcomeeurobsdcon
 
EuroBSDCon 2014 Sofia Closing talk
EuroBSDCon 2014 Sofia Closing talkEuroBSDCon 2014 Sofia Closing talk
EuroBSDCon 2014 Sofia Closing talkeurobsdcon
 
Submitting documents anonymously by Atanas Chobanov
Submitting documents anonymously by Atanas ChobanovSubmitting documents anonymously by Atanas Chobanov
Submitting documents anonymously by Atanas Chobanoveurobsdcon
 
University of Oslo's TSD service - storing sensitive & restricted data by D...
  University of Oslo's TSD service - storing sensitive & restricted data by D...  University of Oslo's TSD service - storing sensitive & restricted data by D...
University of Oslo's TSD service - storing sensitive & restricted data by D...eurobsdcon
 
secure lazy binding, and the 64bit time_t development process by Philip Guenther
secure lazy binding, and the 64bit time_t development process by Philip Guenthersecure lazy binding, and the 64bit time_t development process by Philip Guenther
secure lazy binding, and the 64bit time_t development process by Philip Guenthereurobsdcon
 
The entropic principle: /dev/u?random and NetBSD by Taylor R Campbell
  The entropic principle: /dev/u?random and NetBSD by Taylor R Campbell  The entropic principle: /dev/u?random and NetBSD by Taylor R Campbell
The entropic principle: /dev/u?random and NetBSD by Taylor R Campbelleurobsdcon
 
The LLDB Debugger in FreeBSD by Ed Maste
The LLDB Debugger in FreeBSD by Ed MasteThe LLDB Debugger in FreeBSD by Ed Maste
The LLDB Debugger in FreeBSD by Ed Masteeurobsdcon
 
Porting Valgrind to NetBSD and OpenBSD by Masao Uebayashi
Porting Valgrind to NetBSD and OpenBSD by Masao UebayashiPorting Valgrind to NetBSD and OpenBSD by Masao Uebayashi
Porting Valgrind to NetBSD and OpenBSD by Masao Uebayashieurobsdcon
 
Multiplatform JIT Code Generator for NetBSD by Alexander Nasonov
Multiplatform JIT Code Generator for NetBSD by Alexander NasonovMultiplatform JIT Code Generator for NetBSD by Alexander Nasonov
Multiplatform JIT Code Generator for NetBSD by Alexander Nasonoveurobsdcon
 
OpenStack and OpenContrail for FreeBSD platform by Michał Dubiel
OpenStack and OpenContrail for FreeBSD platform by Michał DubielOpenStack and OpenContrail for FreeBSD platform by Michał Dubiel
OpenStack and OpenContrail for FreeBSD platform by Michał Dubieleurobsdcon
 
Porting NetBSD to the LatticeMico32 open source CPU by Yann Sionneau
Porting NetBSD to the LatticeMico32 open source CPU by Yann SionneauPorting NetBSD to the LatticeMico32 open source CPU by Yann Sionneau
Porting NetBSD to the LatticeMico32 open source CPU by Yann Sionneaueurobsdcon
 
Smartcom's control plane software, a customized version of FreeBSD by Boris A...
Smartcom's control plane software, a customized version of FreeBSD by Boris A...Smartcom's control plane software, a customized version of FreeBSD by Boris A...
Smartcom's control plane software, a customized version of FreeBSD by Boris A...eurobsdcon
 
Bugs Ex Ante by Kristaps Dzonsons
Bugs Ex Ante by Kristaps DzonsonsBugs Ex Ante by Kristaps Dzonsons
Bugs Ex Ante by Kristaps Dzonsonseurobsdcon
 
Cross Building the FreeBSD ports tree by Baptiste Daroussin
Cross Building the FreeBSD ports tree by Baptiste DaroussinCross Building the FreeBSD ports tree by Baptiste Daroussin
Cross Building the FreeBSD ports tree by Baptiste Daroussineurobsdcon
 
Building packages through emulation by Sean Bruno
Building packages through emulation by Sean BrunoBuilding packages through emulation by Sean Bruno
Building packages through emulation by Sean Brunoeurobsdcon
 
Making OpenBSD Useful on the Octeon Network Gear by Paul Irofti
Making OpenBSD Useful on the Octeon Network Gear by Paul IroftiMaking OpenBSD Useful on the Octeon Network Gear by Paul Irofti
Making OpenBSD Useful on the Octeon Network Gear by Paul Iroftieurobsdcon
 
A Reimplementation of NetBSD Based on a Microkernel by Andrew S. Tanenbaum
A Reimplementation of NetBSD Based on a Microkernel by Andrew S. TanenbaumA Reimplementation of NetBSD Based on a Microkernel by Andrew S. Tanenbaum
A Reimplementation of NetBSD Based on a Microkernel by Andrew S. Tanenbaumeurobsdcon
 
Using routing domains / routing tables in a production network by Peter Hessler
Using routing domains / routing tables in a production network by Peter HesslerUsing routing domains / routing tables in a production network by Peter Hessler
Using routing domains / routing tables in a production network by Peter Hesslereurobsdcon
 

More from eurobsdcon (20)

EuroBSDCon 2014 Program Front
EuroBSDCon 2014 Program FrontEuroBSDCon 2014 Program Front
EuroBSDCon 2014 Program Front
 
EuroBSDCon 2014 tutorials program Thursday & Friday
EuroBSDCon 2014 tutorials program Thursday & FridayEuroBSDCon 2014 tutorials program Thursday & Friday
EuroBSDCon 2014 tutorials program Thursday & Friday
 
EuroBSDCon 2014 Sofia Welcome
EuroBSDCon 2014 Sofia WelcomeEuroBSDCon 2014 Sofia Welcome
EuroBSDCon 2014 Sofia Welcome
 
EuroBSDCon 2014 Sofia Closing talk
EuroBSDCon 2014 Sofia Closing talkEuroBSDCon 2014 Sofia Closing talk
EuroBSDCon 2014 Sofia Closing talk
 
Submitting documents anonymously by Atanas Chobanov
Submitting documents anonymously by Atanas ChobanovSubmitting documents anonymously by Atanas Chobanov
Submitting documents anonymously by Atanas Chobanov
 
University of Oslo's TSD service - storing sensitive & restricted data by D...
  University of Oslo's TSD service - storing sensitive & restricted data by D...  University of Oslo's TSD service - storing sensitive & restricted data by D...
University of Oslo's TSD service - storing sensitive & restricted data by D...
 
secure lazy binding, and the 64bit time_t development process by Philip Guenther
secure lazy binding, and the 64bit time_t development process by Philip Guenthersecure lazy binding, and the 64bit time_t development process by Philip Guenther
secure lazy binding, and the 64bit time_t development process by Philip Guenther
 
The entropic principle: /dev/u?random and NetBSD by Taylor R Campbell
  The entropic principle: /dev/u?random and NetBSD by Taylor R Campbell  The entropic principle: /dev/u?random and NetBSD by Taylor R Campbell
The entropic principle: /dev/u?random and NetBSD by Taylor R Campbell
 
The LLDB Debugger in FreeBSD by Ed Maste
The LLDB Debugger in FreeBSD by Ed MasteThe LLDB Debugger in FreeBSD by Ed Maste
The LLDB Debugger in FreeBSD by Ed Maste
 
Porting Valgrind to NetBSD and OpenBSD by Masao Uebayashi
Porting Valgrind to NetBSD and OpenBSD by Masao UebayashiPorting Valgrind to NetBSD and OpenBSD by Masao Uebayashi
Porting Valgrind to NetBSD and OpenBSD by Masao Uebayashi
 
Multiplatform JIT Code Generator for NetBSD by Alexander Nasonov
Multiplatform JIT Code Generator for NetBSD by Alexander NasonovMultiplatform JIT Code Generator for NetBSD by Alexander Nasonov
Multiplatform JIT Code Generator for NetBSD by Alexander Nasonov
 
OpenStack and OpenContrail for FreeBSD platform by Michał Dubiel
OpenStack and OpenContrail for FreeBSD platform by Michał DubielOpenStack and OpenContrail for FreeBSD platform by Michał Dubiel
OpenStack and OpenContrail for FreeBSD platform by Michał Dubiel
 
Porting NetBSD to the LatticeMico32 open source CPU by Yann Sionneau
Porting NetBSD to the LatticeMico32 open source CPU by Yann SionneauPorting NetBSD to the LatticeMico32 open source CPU by Yann Sionneau
Porting NetBSD to the LatticeMico32 open source CPU by Yann Sionneau
 
Smartcom's control plane software, a customized version of FreeBSD by Boris A...
Smartcom's control plane software, a customized version of FreeBSD by Boris A...Smartcom's control plane software, a customized version of FreeBSD by Boris A...
Smartcom's control plane software, a customized version of FreeBSD by Boris A...
 
Bugs Ex Ante by Kristaps Dzonsons
Bugs Ex Ante by Kristaps DzonsonsBugs Ex Ante by Kristaps Dzonsons
Bugs Ex Ante by Kristaps Dzonsons
 
Cross Building the FreeBSD ports tree by Baptiste Daroussin
Cross Building the FreeBSD ports tree by Baptiste DaroussinCross Building the FreeBSD ports tree by Baptiste Daroussin
Cross Building the FreeBSD ports tree by Baptiste Daroussin
 
Building packages through emulation by Sean Bruno
Building packages through emulation by Sean BrunoBuilding packages through emulation by Sean Bruno
Building packages through emulation by Sean Bruno
 
Making OpenBSD Useful on the Octeon Network Gear by Paul Irofti
Making OpenBSD Useful on the Octeon Network Gear by Paul IroftiMaking OpenBSD Useful on the Octeon Network Gear by Paul Irofti
Making OpenBSD Useful on the Octeon Network Gear by Paul Irofti
 
A Reimplementation of NetBSD Based on a Microkernel by Andrew S. Tanenbaum
A Reimplementation of NetBSD Based on a Microkernel by Andrew S. TanenbaumA Reimplementation of NetBSD Based on a Microkernel by Andrew S. Tanenbaum
A Reimplementation of NetBSD Based on a Microkernel by Andrew S. Tanenbaum
 
Using routing domains / routing tables in a production network by Peter Hessler
Using routing domains / routing tables in a production network by Peter HesslerUsing routing domains / routing tables in a production network by Peter Hessler
Using routing domains / routing tables in a production network by Peter Hessler
 

Recently uploaded

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"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
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 

Recently uploaded (20)

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"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
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 

Porting the drm/kms graphic drivers to DragonFlyBSD by Francois Tigeot

  • 1. 1/28 Porting DRM/KMS drivers to DragonFly BSD François Tigeot <ftigeot@wolfpond.org>
  • 2. 2/28 About myself ● Consultant, software developer, Sysadmin ● Former ccTLD System Engineer ● X11 and *BSD user since a heck of a long time ● Introduced FreeBSD in the .fr registry ● DragonFly developer since 2011
  • 3. 3/28 About DragonFly ● Unix-like Operating System ● Forked from FreeBSD 4.8 in 2003 by Matthew Dillon ● Aims to be high-performance and scalable ● Uses per-core replicated resources ● Many operations are naturally lockless ● Caches stay hot
  • 4. 4/28 About DragonFly (2) ● Innovative features very useful for some workloads ● HAMMER filesystem – History retention – Deduplication – Real-time replication ● Swapcache: second-level file cache – Uses existing swap infrastructure – Optimized for SSDs
  • 5. 5/28 About DragonFly (3) 1 5 10 15 20 25 30 35 40 60 80 0 50000 100000 150000 200000 250000 300000 350000 PostgreSQL 9.3 performance DragonFly 3.6.1 Debian 7.0 Centos 6.5 Clients TPS
  • 6. 6/28 First tentative ● David Shao, Google Summer Of Code 2010 ● Based on Linux + a compatibility layer ● Dropped early but continued in his spare time later ● Apparently got something to work ● Sadly probably specific to his machine ● Only got crashes with my hardware
  • 7. 7/28 Starting again with FreeBSD ● Many common kernel APIs with DragonFly, seemed like a good idea at the time ● June 2012: Start implementing newly required APIs ● December 2012: drm/i915 mostly ported ● June 2013: i915 starts working after adding PAT support to the kernel ● October 2013: ttm + radeon mostly ported ● July 2014: ttm + radeon working reliably
  • 8. 8/28 FreeBSD dropped the ball ● No significant updates to drm/i915 after 2012 ● Latest supported hardware: Ivy-Bridge ● Prevents updates to their generic drm code and the drm/radeon driver ● I switched to Linux as the new i915 upstream in September 2013 ● Most important goal: Haswell support
  • 9. 9/28 FreeBSD issues ● FreeBSD code vastly different from Linux ● Some very old parts ● Most modern features ~= Linux 3.4 ● Two different versions of drm + drm drivers – Old drm/ directory – New drm2/ directory ● Most code the same, pointlessly duplicated!
  • 10. 10/28 Rebasing on Linux (1) ● Target: Linux 3.8.13 ● Linux 3.8 first version with known working Haswell support ● drm/radeon port based on Linux 3.8 ● OpenBSD also targeting Linux 3.8.x ● OpenBSD has the best *BSD drm implementation so far (2014-09)
  • 11. 11/28 Rebasing on Linux (2) ● Remove FreeBSD-inherited drm2/ directory ● Put everything into drm/ ● Remove old drm1 radeon and i915 drivers in the process ● Also clean up the agp driver
  • 12. 12/28 Update process ● 1. Diff Linux and DragonFly code ● 2. Reduce pointless noise ● 3. Identify important functional differences ● 4. Implement them piecemeal ● 6. Replay Linux git history if required ● 5. Try to keep commits small
  • 13. 13/28 Pointless noise in drm/i915 ● Different file names ● Functions implemented in different order ● Functions present in different files ● Two previous items biggest source of loc differences ● June 2014: moved most functions to the same place they were in Linux 3.8.13 ● Reduced differences from ~= 50K to 22K loc
  • 14. 14/28 Style changes in drm/i915 ● The FreeBSD drm/i915 author basically rewrote the entire driver to change its coding style – if (ret != 0) – If (ret) ● It was unmaintainable ● Had to reduce the amount of noise before tackling functional differences
  • 15. 15/28 Difficult spots ● GEM VM code – FreeBSD used custom do-everything routines different from the Linux GEM implementation – i915_gem_obj_io() in FreeBSD – Various functions like i915_gem_shmem_pwrite() in Linux ● I2c API in Linux, iic API in FreeBSD+DragonFly ● Hard to make these parts of the drivers work like they do in Linux
  • 16. 16/28 Implement Linux APIs ● Same old idea as David Shao's who used a Linux compatibility layer ● Many linux/xxx.h wrappers taken from FreeBSD (OFED project, Infiniband) ● Some APIs implemented locally: idr(9), various linux/yyy.h headers, etc... ● Other Linux functions taken from OpenBSD
  • 17. 17/28 Implement Linux APIs (2) ● Graphic drivers very complex ● Fast moving targets ● It makes more sense to change the DragonFly kernel to behave like Linux than trying to constantly keep up and change the drivers to use *BSD-specific APIs ● In a way I'm porting DragonFly to the drm drivers and not the drivers to DragonFly
  • 18. 18/28 Implement Linux APIs (3) ● ls /usr/src/sys/drm/include/linux atomic.h export.h jiffies.h timer.h bitops.h hash.h kernel.h types.h compiler.h highmem.h kref.h wait.h completion.h i2c.h list.h workqueue.h delay.h idr.h mutex.h err.h io.h time.h ● Most common Linux APIs used in i915 ttm and radeon implemented by wrappers ● Reduce differences as much as possible in the drm/* directories ● Major exception: locking directives
  • 19. 19/28 The road to Haswell support ● 1. Reduce noise ● 2. Replace FreeBSD APIs by Linux ones ● 3. Update the interrupt code ● 4. Update the ringbuffer code ● 5. Update the output management code ● 6. Haswell-specific cache attributes in page tables ● Finally working reliably in August 2014
  • 20. 20/28 A few words about Userland ● Pkgsrc packages used until 2013 ● Xorg-server 1.6 ● I wanted to update it ● Didn't happen ● Lost interest
  • 21. 21/28 A few words about Userland (2) ● Switched to Dports ● FreeBSD ports + adaptation layer + automatic tests and validation ● Much better ● Gave us xorg-server 1.12 and contemporary software
  • 22. 22/28 A few words about Userland (3) ● Sadly, FreeBSD ports are beginning to lag ● Updating Cairo from 1.10 to 1.12 took years ● Still using xf86-video-intel 2.21.15 ● Had to create a locally managed port of xf86- video-intel 2.99.x ● Hope it won't become necessary for other parts
  • 23. 23/28 Current state ● drm/i915 mostly in sync with Linux 3.8.13 – Not the GEM code ● drm/radeon mostly in sync with Linux 3.8 ● drm/ttm in sync with Linux 3.9 ● Generic drm code a mess – A few parts up to Linux 3.8.13 – Others much much older (< Linux 2.6.26)
  • 24. 24/28 Future directions ● Synchronize the drm code itself to Linux 3.8.13 – Required for key features like DRM Prime, DRM- master, etc... ● Then start upgrading drm+drivers to more recent versions ● Porting drm/nouveau also a good idea – Should be easier now that ttm is working properly
  • 25. 25/28 Future directions (2) ● Restore 80x25 VGA text mode after Xorg exit ● Currently black screen or frozen image ● Alternatively implement a graphical TTY layer ● Patches are floating around
  • 26. 26/28 FreeBSD credits ● Konstantin Belousov – Updated drm and drm/i915 to support gem+kms – Ported most parts of drm/ttm to FreeBSD ● Alexander Kabaev – Started to port the radeon driver ● Jean-Sébastien Pédron – Finished the port of drm/radeon from Linux 3.8 – Critical fixes to drm/ttm
  • 27. 27/28 DragonFly Credits ● François Tigeot: bulk of drm, drm/i915, drm/ttm and drm/radeon porting ● Johannes Hofmann: made i915 work ● Matt Dillon: made i915 and ttm work reliably – Added PAT support to the kernel – fixed critical VM bugs ● Joris Giovanelli and Markus Pfeiffer: critical bug investigations and fixes