Documentation
¶
Overview ¶
Package dmabufwl builds zwp_linux_buffer_params_v1 objects from dmabuf descriptions, the step every linux-dmabuf import shares, and reads the compositor's linux-dmabuf feedback, default and per surface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Device ¶
Device decodes a dev_t sent as a wl_array, the shape of linux-dmabuf feedback's main_device and ext-image-copy-capture's dmabuf_device.
func Modifiers ¶
Modifiers decodes a wl_array of DRM format modifiers, such as ext-image-copy-capture's dmabuf_format sends, into the explicit ones in their order: implicit layouts and repeats left out.
func Params ¶
func Params(mgr *wlr.ZwpDmabufV1, b dmabuf.Buffer) (*wlr.ZwpBufferParamsV1, error)
Params validates b and returns params carrying its planes, ready for create or create_immed.
Types ¶
type Feedback ¶
type Feedback struct {
Device uint64
Modifiers map[fourcc.Format][]fourcc.Modifier
Tranches []Tranche
}
Feedback is a compositor's linux-dmabuf feedback (version 4), default or for a surface: the device it wants buffers allocated on (main_device, a dev_t), its tranches in preference order, and per DRM format the explicit modifiers it imports across them all, tranche by tranche.
func DefaultFeedback ¶
func DefaultFeedback(mgr *wlr.ZwpDmabufV1, version uint32, roundtrip func() error) (Feedback, error)
DefaultFeedback asks mgr, bound at version, for its default feedback and dispatches through roundtrip until the compositor has sent it whole. A version below 4, which has no feedback, and a compositor that names no main device are errors.
func (Feedback) Equal ¶
Equal reports whether f and g name the same main device and the same tranches in the same order: a feedback resent unchanged needs no new buffers.
type SurfaceFeedback ¶
type SurfaceFeedback struct {
// contains filtered or unexported fields
}
SurfaceFeedback follows a surface's linux-dmabuf feedback for as long as it lives: the first feedback and every change the compositor sends, such as a scanout tranche added when the surface could go on a plane and removed when it no longer can.
func WatchSurfaceFeedback ¶
func WatchSurfaceFeedback(mgr *wlr.ZwpDmabufV1, version uint32, surface *wlr.Surface, update func(Feedback, error)) (*SurfaceFeedback, error)
WatchSurfaceFeedback asks mgr, bound at version, for surface's feedback and calls update, on the goroutine that dispatches the connection, with each feedback the compositor finishes, or with why it is malformed: a bad format table or device, or no main device. A version below 4, which has no feedback, is an error. The feedback is followed until Destroy.
func (*SurfaceFeedback) Destroy ¶
func (s *SurfaceFeedback) Destroy() error
Destroy stops following the feedback and releases its object.
type Tranche ¶
type Tranche struct {
Device uint64
Flags TrancheFlags
Modifiers map[fourcc.Format][]fourcc.Modifier
}
Tranche is one preference tranche of linux-dmabuf feedback: the device its buffers are to be allocated on (target_device, a dev_t), its flags, and per DRM format the explicit modifiers it takes, in the compositor's preference order.
type TrancheFlags ¶
type TrancheFlags uint32
TrancheFlags are a feedback tranche's zwp_linux_dmabuf_feedback_v1 tranche_flags.
const TrancheScanout TrancheFlags = wlr.ZwpDmabufFeedbackV1TrancheFlagsScanout
TrancheScanout marks a tranche whose buffers the compositor can put on a display plane directly, without compositing them.