// Code generated by wlturbo-scanner. DO NOT EDIT. // Protocol: linux_drm_syncobj_v1 // Source: linux-drm-syncobj-v1.xml // Upstream protocol copyright and license: // Copyright 2016 The Chromium Authors. // Copyright 2017 Intel Corporation // Copyright 2018 Collabora, Ltd // Copyright 2021 Simon Ser // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice (including the next // paragraph) shall be included in all copies or substantial portions of the // Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. package drmsyncobj import ( cross_wl_surface "github.com/bnema/wlturbo/protocol/core" "github.com/bnema/wlturbo/wl" ) // ERROR_SURFACE_EXISTS is the error surface_exists value. const ERROR_SURFACE_EXISTS = 0 // ERROR_INVALID_TIMELINE is the error invalid_timeline value. const ERROR_INVALID_TIMELINE = 1 // ERROR_NO_SURFACE is the error no_surface value. const ERROR_NO_SURFACE = 1 // ERROR_UNSUPPORTED_BUFFER is the error unsupported_buffer value. const ERROR_UNSUPPORTED_BUFFER = 2 // ERROR_NO_BUFFER is the error no_buffer value. const ERROR_NO_BUFFER = 3 // ERROR_NO_ACQUIRE_POINT is the error no_acquire_point value. const ERROR_NO_ACQUIRE_POINT = 4 // ERROR_NO_RELEASE_POINT is the error no_release_point value. const ERROR_NO_RELEASE_POINT = 5 // ERROR_CONFLICTING_POINTS is the error conflicting_points value. const ERROR_CONFLICTING_POINTS = 6 // WpLinuxDrmSyncobjManagerInterface is the protocol interface name. const WpLinuxDrmSyncobjManagerInterface = "wp_linux_drm_syncobj_manager_v1" // WpLinuxDrmSyncobjManager is the generated binding for wp_linux_drm_syncobj_manager_v1 version 1. type WpLinuxDrmSyncobjManager struct { wl.BaseProxy } // NewWpLinuxDrmSyncobjManager returns an unbound WpLinuxDrmSyncobjManager. func NewWpLinuxDrmSyncobjManager(ctx *wl.Context) *WpLinuxDrmSyncobjManager { obj := &WpLinuxDrmSyncobjManager{} obj.SetContext(ctx) ctx.Register(obj) return obj } // Destroy this explicit synchronization factory object. Other objects shall not be affected by this request. func (o *WpLinuxDrmSyncobjManager) Destroy() error { if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 0, Name: "wp_linux_drm_syncobj_manager_v1.destroy", Destructor: true}); err != nil { return err } return nil } // Instantiate an interface extension for the given wl_surface to provide explicit synchronization. If the given wl_surface already has an explicit synchronization object associated, the surface_exists protocol error is raised. Graphics APIs, like EGL or Vulkan, that manage the buffer queue and commits of a wl_surface themselves, are likely to be using this extension internally. If a client is using such an API for a wl_surface, it should not directly use this extension on that surface, to avoid raising a surface_exists protocol error. func (o *WpLinuxDrmSyncobjManager) GetSurface(surface *cross_wl_surface.Surface) (*WpLinuxDrmSyncobjSurface, error) { var arg1 wl.Object if surface != nil { arg1 = surface } child := &WpLinuxDrmSyncobjSurface{} child.SetContext(o.Context()) if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 1, Name: "wp_linux_drm_syncobj_manager_v1.get_surface", Child: child}, wl.ArgObject(child), wl.ArgObject(arg1)); err != nil { return nil, err } return child, nil } // Import a DRM synchronization object timeline. If the FD cannot be imported, the invalid_timeline error is raised. func (o *WpLinuxDrmSyncobjManager) ImportTimeline(fd int) (*WpLinuxDrmSyncobjTimeline, error) { child := &WpLinuxDrmSyncobjTimeline{} child.SetContext(o.Context()) if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 2, Name: "wp_linux_drm_syncobj_manager_v1.import_timeline", Child: child, FDs: []int{fd}}, wl.ArgObject(child), wl.ArgFD()); err != nil { return nil, err } return child, nil } // EventSignature returns the declared event argument types in wire order. func (o *WpLinuxDrmSyncobjManager) EventSignature(opcode uint16) (string, bool) { switch opcode { default: return "", false } } // Dispatch decodes one event on wp_linux_drm_syncobj_manager_v1 and calls the registered handlers. func (o *WpLinuxDrmSyncobjManager) Dispatch(event *wl.Event) { switch event.Opcode { default: } } // WpLinuxDrmSyncobjTimelineInterface is the protocol interface name. const WpLinuxDrmSyncobjTimelineInterface = "wp_linux_drm_syncobj_timeline_v1" // WpLinuxDrmSyncobjTimeline is the generated binding for wp_linux_drm_syncobj_timeline_v1 version 1. type WpLinuxDrmSyncobjTimeline struct { wl.BaseProxy } // NewWpLinuxDrmSyncobjTimeline returns an unbound WpLinuxDrmSyncobjTimeline. func NewWpLinuxDrmSyncobjTimeline(ctx *wl.Context) *WpLinuxDrmSyncobjTimeline { obj := &WpLinuxDrmSyncobjTimeline{} obj.SetContext(ctx) ctx.Register(obj) return obj } // Destroy the synchronization object timeline. Other objects are not affected by this request, in particular timeline points set by set_acquire_point and set_release_point are not unset. func (o *WpLinuxDrmSyncobjTimeline) Destroy() error { if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 0, Name: "wp_linux_drm_syncobj_timeline_v1.destroy", Destructor: true}); err != nil { return err } return nil } // EventSignature returns the declared event argument types in wire order. func (o *WpLinuxDrmSyncobjTimeline) EventSignature(opcode uint16) (string, bool) { switch opcode { default: return "", false } } // Dispatch decodes one event on wp_linux_drm_syncobj_timeline_v1 and calls the registered handlers. func (o *WpLinuxDrmSyncobjTimeline) Dispatch(event *wl.Event) { switch event.Opcode { default: } } // WpLinuxDrmSyncobjSurfaceInterface is the protocol interface name. const WpLinuxDrmSyncobjSurfaceInterface = "wp_linux_drm_syncobj_surface_v1" // WpLinuxDrmSyncobjSurface is the generated binding for wp_linux_drm_syncobj_surface_v1 version 1. type WpLinuxDrmSyncobjSurface struct { wl.BaseProxy } // NewWpLinuxDrmSyncobjSurface returns an unbound WpLinuxDrmSyncobjSurface. func NewWpLinuxDrmSyncobjSurface(ctx *wl.Context) *WpLinuxDrmSyncobjSurface { obj := &WpLinuxDrmSyncobjSurface{} obj.SetContext(ctx) ctx.Register(obj) return obj } // Destroy this surface synchronization object. Any timeline point set by this object with set_acquire_point or set_release_point since the last commit may be discarded by the compositor. Any timeline point set by this object before the last commit will not be affected. func (o *WpLinuxDrmSyncobjSurface) Destroy() error { if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 0, Name: "wp_linux_drm_syncobj_surface_v1.destroy", Destructor: true}); err != nil { return err } return nil } // Set the timeline point that must be signalled before the compositor may sample from the buffer attached with wl_surface.attach. The 64-bit unsigned value combined from point_hi and point_lo is the point value. The acquire point is double-buffered state, and will be applied on the next wl_surface.commit request for the associated surface. Thus, it applies only to the buffer that is attached to the surface at commit time. If an acquire point has already been attached during the same commit cycle, the new point replaces the old one. If the associated wl_surface was destroyed, a no_surface error is raised. If at surface commit time there is a pending acquire timeline point set but no pending buffer attached, a no_buffer error is raised. If at surface commit time there is a pending buffer attached but no pending acquire timeline point set, the no_acquire_point protocol error is raised. func (o *WpLinuxDrmSyncobjSurface) SetAcquirePoint(timeline *WpLinuxDrmSyncobjTimeline, pointHi uint32, pointLo uint32) error { var arg0 wl.Object if timeline != nil { arg0 = timeline } if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 1, Name: "wp_linux_drm_syncobj_surface_v1.set_acquire_point"}, wl.ArgObject(arg0), wl.ArgUint(pointHi), wl.ArgUint(pointLo)); err != nil { return err } return nil } // Set the timeline point that must be signalled by the compositor when it has finished its usage of the buffer attached with wl_surface.attach for the relevant commit. Once the timeline point is signaled, and assuming the associated buffer is not pending release from other wl_surface.commit requests, no additional explicit or implicit synchronization with the compositor is required to safely re-use the buffer. Note that clients cannot rely on the release point being always signaled after the acquire point: compositors may release buffers without ever reading from them. In addition, the compositor may use different presentation paths for different commits, which may have different release behavior. As a result, the compositor may signal the release points in a different order than the client committed them. Because signaling a timeline point also signals every previous point, it is generally not safe to use the same timeline object for the release points of multiple buffers. The out-of-order signaling described above may lead to a release point being signaled before the compositor has finished reading. To avoid this, it is strongly recommended that each buffer should use a separate timeline for its release points. The 64-bit unsigned value combined from point_hi and point_lo is the point value. The release point is double-buffered state, and will be applied on the next wl_surface.commit request for the associated surface. Thus, it applies only to the buffer that is attached to the surface at commit time. If a release point has already been attached during the same commit cycle, the new point replaces the old one. If the associated wl_surface was destroyed, a no_surface error is raised. If at surface commit time there is a pending release timeline point set but no pending buffer attached, a no_buffer error is raised. If at surface commit time there is a pending buffer attached but no pending release timeline point set, the no_release_point protocol error is raised. func (o *WpLinuxDrmSyncobjSurface) SetReleasePoint(timeline *WpLinuxDrmSyncobjTimeline, pointHi uint32, pointLo uint32) error { var arg0 wl.Object if timeline != nil { arg0 = timeline } if err := o.Context().RequestArgs(wl.Request{Proxy: o, Opcode: 2, Name: "wp_linux_drm_syncobj_surface_v1.set_release_point"}, wl.ArgObject(arg0), wl.ArgUint(pointHi), wl.ArgUint(pointLo)); err != nil { return err } return nil } // EventSignature returns the declared event argument types in wire order. func (o *WpLinuxDrmSyncobjSurface) EventSignature(opcode uint16) (string, bool) { switch opcode { default: return "", false } } // Dispatch decodes one event on wp_linux_drm_syncobj_surface_v1 and calls the registered handlers. func (o *WpLinuxDrmSyncobjSurface) Dispatch(event *wl.Event) { switch event.Opcode { default: } }