Upload
others
View
33
Download
0
Embed Size (px)
Citation preview
DRM/KMS, FB and V4L2:How to Select a Graphics and
Video API
Embedded Linux Conference Europe 2012
Laurent [email protected]
Origins – DRM/KMS
2000
DRM, L
inux 2
.2.1
8
2009
KMS, T
TM
2008
GEMPlan
es, D
MABUF
2011 2012
Dumb
Buffe
rs
Origins – V4L2
V4L, L
inux 2
.2.0
1999 2002 2006
V4L2,
Linu
x 2.4
.0
V4L d
epre
cate
d
2008
V4L2
subd
ev
2011
Med
ia co
ntro
ller
video
buf2
2012
DMABUF(?
)
Memory Management
DRM FB V4L2
Dynamic Allocation Yes No Yes
Multiple Buffers Yes panning Yes
Import dmabuf No userptr
Exportdmabufmmap
mmap mmap
Mode Setting
DRM FB V4L2
Formats 4CCRGB4CC
4CC
Enumeration Planes No Yes
Negotiation No No Yes
Atomicity Yes No No
Transformations
DRM FB V4L2
Overlays Yes No Yes
Rotation Yes No Yes
Scaling Yes No Yes
Cropping/Panning Yes Yes Yes
DRM API Documentation
The DRM core exports several interfaces to applications, generally intended to be used through corresponding libdrm wrapper functions. In addition, drivers export device-specific interfaces for use by userspace drivers & device-aware applications through ioctls and sysfs files.
External interfaces include: memory mapping, context management, DMA operations, AGP management, vblank control, fence management, memory management, and output management.
Cover generic ioctls and sysfs layout here. We only need high-level info, since man pages should cover the rest.
“
„
Cumulative Changes - API
v2.6.12v2.6.14
v2.6.16v2.6.18
v2.6.20v2.6.22
v2.6.24v2.6.26
v2.6.28v2.6.30
v2.6.32v2.6.34
v2.6.36v2.6.38
v3.0v3.2
v3.4v3.6-rc3
0
500
1000
1500
2000
2500
3000
3500
4000
drm
fb
v4l2
drmfbv4l2
Cumulative Changes - Core
v2.6.12v2.6.14
v2.6.16v2.6.18
v2.6.20v2.6.22
v2.6.24v2.6.26
v2.6.28v2.6.30
v2.6.32v2.6.34
v2.6.36v2.6.38
v3.0v3.2
v3.4v3.6-rc3
0
5000
10000
15000
20000
25000
30000
35000
40000
45000
drm
fb
v4l2
drmfbv4l2
Cumulative Changes - Drivers
v2.6.12v2.6.14
v2.6.16v2.6.18
v2.6.20v2.6.22
v2.6.24v2.6.26
v2.6.28v2.6.30
v2.6.32v2.6.34
v2.6.36v2.6.38
v3.0v3.2
v3.4v3.6-rc3
0
100000
200000
300000
400000
500000
600000
700000
800000
900000
1000000
drm
fb
v4l2
drmfbv4l2
Mailing List Traffic
2009-112010-01
2010-032010-05
2010-072010-09
2010-112011-01
2011-032011-05
2011-072011-09
2011-112012-01
2012-032012-05
2012-07
0
200
400
600
800
1000
1200
1400
1600
drmfbv4l2drm+bug
KMS – Frame Buffer
CRTC
Frame Buffer
GEMObject(s)
Memory
● width● height● format● pitches● offsets
Properties
DRM/KMS – GEM Object
CRTC
Frame Buffer
GEM Object
● width● height● bpp● pitch● size
Properties
Memory
DRM – Handles
Process A
LocalHandle
GEMObject
Process B
Send FDSCM_RIGHTS
GlobalFD
1 2Global
FD4
LocalHandle
3