Documentation
¶
Overview ¶
Package backend abstracts outputs and input devices so the compositor runs headless, nested or on DRM.
Index ¶
- Constants
- Variables
- func AdaptiveSyncCapable(o Output) bool
- func Broken(format string, args ...any) error
- func Displays(o Output) bool
- func Fatal(err error) bool
- func GPULost(err error) bool
- func NextVblank(last, now, interval time.Duration) (at time.Duration, ticks uint64)
- func PlaneLatch(last, now, interval time.Duration) time.Duration
- type AdaptiveSync
- type AxisSource
- type Backend
- type BitDepth
- type Capability
- type ColorTransform
- type Commits
- type ContentTyped
- type CursorPlane
- type Degamma
- type Device
- type Event
- type Frame
- type FrameClock
- type FrameFilling
- type FrameRateCap
- type FrameTearing
- type Gamma
- type Gesture
- type GestureBegin
- type GestureEnd
- type HDRDisplay
- type HDRMetadata
- type Handler
- type Inheriting
- type Key
- type KeyboardLEDs
- type Latch
- type Matrix
- type Mode
- type Orientation
- type Output
- type OutputState
- type Overlay
- type OverlayFlip
- type OverlayPlanes
- type Pacing
- type PinchUpdate
- type Placement
- type PointerAxis
- type PointerButton
- type PointerFrame
- type PointerMotion
- type PointerMotionAbsolute
- type Power
- type Presentation
- type RenderBudget
- func (b *RenderBudget) Budget(interval time.Duration) time.Duration
- func (b *RenderBudget) Deadline(p Pacing, now time.Duration) time.Duration
- func (b *RenderBudget) Expect(pixels int)
- func (b *RenderBudget) Latch(p Pacing, now time.Duration) time.Duration
- func (b *RenderBudget) Missed(interval time.Duration)
- func (b *RenderBudget) Overruns(interval time.Duration) bool
- func (b *RenderBudget) Painted(pixels int)
- func (b *RenderBudget) Sample(took time.Duration)
- func (b *RenderBudget) Started()
- type Scanner
- type ScanoutKey
- type Stalling
- type SwipeUpdate
- type Switch
- type SwitchKind
- type TouchCancel
- type TouchDown
- type TouchFrame
- type TouchMotion
- type TouchUp
- type WorkHinter
Constants ¶
View Source
const EmptyFramesPerRefresh = 2
View Source
const MaxOverlayPlanes = 3
View Source
const (
PlaneLead = 2 * time.Millisecond
)
View Source
const SustainedFor = time.Second
Variables ¶
View Source
var ( ErrDeviceLost = errors.New("backend: the device is gone") ErrBroken = errors.New("backend: broken invariant") )
View Source
var ErrCursorReadback = errors.New("backend: drawing this cursor image on the plane would read it back from the GPU synchronously")
View Source
var ErrDepthUnsupported = errors.New("backend: the output cannot show frames at this bit depth")
View Source
var ErrHDRUnsupported = errors.New("backend: the output cannot carry an HDR signal")
View Source
var ErrNoCursorPlanes = errors.New("backend: this backend draws the cursor in the frame")
View Source
var Identity = Matrix{1, 0, 0, 0, 1, 0, 0, 0, 1}
Functions ¶
func AdaptiveSyncCapable ¶
func NextVblank ¶
Types ¶
type AdaptiveSync ¶
type AxisSource ¶
type AxisSource uint8
const ( Wheel AxisSource = iota Finger Continuous WheelTilt )
type Capability ¶
type Capability uint8
const ( Keyboard Capability = 1 << iota Pointer Touch )
func (Capability) Has ¶
func (c Capability) Has(flag Capability) bool
type ColorTransform ¶
type Commits ¶
type Commits struct {
// contains filtered or unexported fields
}
type ContentTyped ¶
type ContentTyped interface {
SetContentType(t wm.ContentType)
}
type CursorPlane ¶
type Device ¶
type Device interface {
Name() string
Capabilities() Capability
}
type FrameClock ¶
type FrameClock struct {
// contains filtered or unexported fields
}
func NewFrameClock ¶
func NewFrameClock(idle func(func() error), ready func() bool, frame func() error, latch *Latch) *FrameClock
func (*FrameClock) Cancel ¶
func (f *FrameClock) Cancel()
func (*FrameClock) Kick ¶
func (f *FrameClock) Kick() error
func (*FrameClock) Queued ¶
func (f *FrameClock) Queued() bool
func (*FrameClock) Request ¶
func (f *FrameClock) Request() error
func (*FrameClock) Requested ¶
func (f *FrameClock) Requested() bool
func (*FrameClock) Waiting ¶
func (f *FrameClock) Waiting() bool
func (*FrameClock) Woke ¶
func (f *FrameClock) Woke() error
type FrameFilling ¶
type FrameFilling interface {
FillFrame(filled bool)
}
type FrameRateCap ¶
type FrameRateCap interface {
CapFrameRate(hz int)
}
type FrameTearing ¶
type FrameTearing interface {
TearFrame(tear bool)
}
type GestureBegin ¶
func (GestureBegin) Timestamp ¶
func (e GestureBegin) Timestamp() time.Duration
type GestureEnd ¶
func (GestureEnd) Timestamp ¶
func (e GestureEnd) Timestamp() time.Duration
type HDRDisplay ¶
type HDRMetadata ¶
type Inheriting ¶
type KeyboardLEDs ¶
type Output ¶
type Output interface {
Name() string
Description() string
Identity() edid.Info
PhysicalSize() image.Point
Modes() []Mode
State() OutputState
Commit(s OutputState) error
ScheduleFrame() error
BeginFrame() (Frame, error)
AbortFrame()
Present(damage render.Region) error
CursorPlane() (CursorPlane, error)
}
type OutputState ¶
type OutputState struct {
Power Power
Mode Mode
Depth BitDepth
HDR HDRMetadata
}
func (OutputState) Enabled ¶
func (s OutputState) Enabled() bool
func (OutputState) Lit ¶
func (s OutputState) Lit() bool
type Overlay ¶
type Overlay struct {
Key ScanoutKey
Buffer gpu.DMABUF
At Placement
Release func() error
}
type OverlayFlip ¶
type OverlayFlip uint8
const ( OverlaysNotFlipped OverlayFlip = iota OverlaysFlipped OverlaysRefused )
type OverlayPlanes ¶
type OverlayPlanes interface {
OverlayPlanes() int
OverlayTarget() gpu.ScanoutTarget
TestOverlays(layers []Overlay) uint
SetOverlays(layers []Overlay) error
FlipOverlays() (OverlayFlip, error)
}
type Pacing ¶
type PinchUpdate ¶
func (*PinchUpdate) Timestamp ¶
func (e *PinchUpdate) Timestamp() time.Duration
type PointerAxis ¶
type PointerAxis struct {
Time time.Duration
Orientation Orientation
Source AxisSource
Value float64
Value120 int32
}
func (PointerAxis) Timestamp ¶
func (e PointerAxis) Timestamp() time.Duration
type PointerButton ¶
func (PointerButton) Timestamp ¶
func (e PointerButton) Timestamp() time.Duration
type PointerFrame ¶
func (*PointerFrame) Timestamp ¶
func (e *PointerFrame) Timestamp() time.Duration
type PointerMotion ¶
func (*PointerMotion) Timestamp ¶
func (e *PointerMotion) Timestamp() time.Duration
type PointerMotionAbsolute ¶
func (PointerMotionAbsolute) Timestamp ¶
func (e PointerMotionAbsolute) Timestamp() time.Duration
type Presentation ¶
type RenderBudget ¶
type RenderBudget struct {
// contains filtered or unexported fields
}
func (*RenderBudget) Expect ¶
func (b *RenderBudget) Expect(pixels int)
func (*RenderBudget) Missed ¶
func (b *RenderBudget) Missed(interval time.Duration)
func (*RenderBudget) Painted ¶
func (b *RenderBudget) Painted(pixels int)
func (*RenderBudget) Sample ¶
func (b *RenderBudget) Sample(took time.Duration)
func (*RenderBudget) Started ¶
func (b *RenderBudget) Started()
type Scanner ¶
type Scanner interface {
Scanout(key ScanoutKey, d gpu.DMABUF, at Placement, release func() error, tear bool) (bool, error)
ForgetScanout(key ScanoutKey) error
ScanoutFormats() gpu.ScanoutTarget
}
type ScanoutKey ¶
type SwipeUpdate ¶
func (*SwipeUpdate) Timestamp ¶
func (e *SwipeUpdate) Timestamp() time.Duration
type TouchCancel ¶
func (TouchCancel) Timestamp ¶
func (e TouchCancel) Timestamp() time.Duration
type TouchFrame ¶
func (TouchFrame) Timestamp ¶
func (e TouchFrame) Timestamp() time.Duration
type TouchMotion ¶
func (TouchMotion) Timestamp ¶
func (e TouchMotion) Timestamp() time.Duration
type WorkHinter ¶
type WorkHinter interface {
ExpectFrameWork(pixels int)
}
Directories
¶
| Path | Synopsis |
|---|---|
|
Package drm is the native backend: one DRM device driven with atomic KMS, scanning out buffers the Vulkan renderer exports or GBM allocates for GLES.
|
Package drm is the native backend: one DRM device driven with atomic KMS, scanning out buffers the Vulkan renderer exports or GBM allocates for GLES. |
|
Package headless is a backend with virtual outputs rendered in software and synthetic input devices, for tests and the compositor-in-the-loop harness.
|
Package headless is a backend with virtual outputs rendered in software and synthetic input devices, for tests and the compositor-in-the-loop harness. |
|
Package nested runs lys-wm as a client of a host Wayland compositor: each output is a host window and the host seat is lys-wm's input.
|
Package nested runs lys-wm as a client of a host Wayland compositor: each output is a host window and the host seat is lys-wm's input. |
|
Package virtual is an output that exists only in memory: whatever backend runs the session, it renders offscreen with the session's renderer, paced by its own frame clock at its mode's refresh rate, and never presents.
|
Package virtual is an output that exists only in memory: whatever backend runs the session, it renders offscreen with the session's renderer, paced by its own frame clock at its mode's refresh rate, and never presents. |
Click to show internal directories.
Click to hide internal directories.