Documentation
¶
Overview ¶
Package drm provides a library to interact with DRM (Direct Rendering Manager) and KMS (Kernel Mode Setting) interfaces. DRM is a low level interface for the graphics card (gpu) and this package enables the creation of graphics library on top of the kernel drm/kms subsystem.
Index ¶
Examples ¶
Constants ¶
View Source
const ( CapDumbBuffer uint64 = iota + 1 CapVBlankHighCRTC CapDumbPreferredDepth CapDumbPreferShadow CapPrime CapTimestampMonotonic CapAsyncPageFlip CapCursorWidth CapCursorHeight CapAddFB2Modifiers = 0x10 )
Variables ¶
This section is empty.
Functions ¶
func HasDumbBuffer ¶
Example ¶
package main
import (
"fmt"
"github.com/JesterSks/drm"
)
func main() {
// This example shows how to test if your graphics card
// supports 'dumb buffers' capability. With this capability
// you can create simple memory-mapped buffers without any
// driver-dependent code.
file, err := drm.OpenCard(0)
if err != nil {
fmt.Printf("error: %s", err.Error())
return
}
defer file.Close()
if !drm.HasDumbBuffer(file) {
fmt.Printf("drm device does not support dumb buffers")
return
}
fmt.Printf("ok")
}
Output: ok
Types ¶
type Version ¶
type Version struct {
internal.SysVersion
Major int32
Minor int32
Patch int32
Name string // Name of the driver (eg.: i915)
Date string
Desc string
}
Version of DRM driver
func ListDevices ¶
func ListDevices() []Version
Example ¶
package main
import (
"fmt"
"github.com/JesterSks/drm"
)
func main() {
// Shows how to enumerate the available dri devices
for _, dev := range drm.ListDevices() {
fmt.Printf("Driver name: %s\n", dev.Name)
}
}
Output: Driver name: i915
Directories
¶
| Path | Synopsis |
|---|---|
|
_examples
|
|
|
draw
command
|
|
|
modeset
command
Port of modeset.c example to Go Source: https://github.com/dvdhrm/docs/blob/master/drm-howto/modeset-double-buffered.c
|
Port of modeset.c example to Go Source: https://github.com/dvdhrm/docs/blob/master/drm-howto/modeset-double-buffered.c |
Click to show internal directories.
Click to hide internal directories.