Skip to content

wp_presentation_feedback¤

wayland.wp_presentation_feedback ¤

Presentation time feedback event

A presentation_feedback object returns an indication that a wl_surface content update has become visible to the user. One object corresponds to one content update submission (wl_surface.commit). There are two possible outcomes: the content update is presented to the user, and a presentation timestamp delivered; or, the user did not see the content update because it was superseded or its surface destroyed, and the content update is discarded.

Once a presentation_feedback object has delivered a 'presented' or 'discarded' event it is automatically destroyed.

Methods:

kind ¤

Bitmask of flags in presented event

These flags provide information about how the presentation of the related content update was done. The intent is to help clients assess the reliability of the feedback and the visual quality with respect to possible tearing and timings.

  • vsync
    Presentation was vsync'd The presentation was synchronized to the "vertical retrace" by the display hardware such that tearing does not happen. Relying on software scheduling is not acceptable for this flag. If presentation is done by a copy to the active frontbuffer, then it must guarantee that tearing cannot happen.
  • hw_clock
    Hardware provided the presentation timestamp The display hardware provided measurements that the hardware driver converted into a presentation timestamp. Sampling a clock in software is not acceptable for this flag.
  • hw_completion
    Hardware signalled the start of the presentation The display hardware signalled that it started using the new image content. The opposite of this is e.g. a timer being used to guess when the display hardware has switched to the new image content.
  • zero_copy
    Presentation was done zero-copy The presentation of this update was done zero-copy. This means the buffer from the client was given to display hardware as is, without copying it. Compositing with OpenGL counts as copying, even if textured directly from the client buffer. Possible zero-copy cases include direct scanout of a fullscreen surface and a surface on a hardware overlay.

events

sync_output ¤

sync_output(output: wl_output) -> None

Presentation synchronized to this output

As presentation can be synchronized to only one output at a time, this event tells which output it was. This event is only sent prior to the presented event.

As clients may bind to the same global wl_output multiple times, this event is sent for each bound instance that matches the synchronized output. If a client has not bound to the right wl_output global at all, this event is not sent.

Parameters:

presented ¤

presented(
    tv_sec_hi: int,
    tv_sec_lo: int,
    tv_nsec: int,
    refresh: int,
    seq_hi: int,
    seq_lo: int,
    flags: kind,
) -> None

The content update was displayed

The associated content update was displayed to the user at the indicated time (tv_sec_hi/lo, tv_nsec). For the interpretation of the timestamp, see presentation.clock_id event.

The timestamp corresponds to the time when the content update turned into light the first time on the surface's main output. Compositors may approximate this from the framebuffer flip completion events from the system, and the latency of the physical display path if known.

This event is preceded by all related sync_output events telling which output's refresh cycle the feedback corresponds to, i.e. the main output for the surface. Compositors are recommended to choose the output containing the largest part of the wl_surface, or keeping the output they previously chose. Having a stable presentation output association helps clients predict future output refreshes (vblank).

The 'refresh' argument gives the compositor's prediction of how many nanoseconds after tv_sec, tv_nsec the very next output refresh may occur. This is to further aid clients in predicting future refreshes, i.e., estimating the timestamps targeting the next few vblanks. If such prediction cannot usefully be done, the argument is zero.

For version 2 and later, if the output does not have a constant refresh rate, explicit video mode switches excluded, then the refresh argument must be either an appropriate rate picked by the compositor (e.g. fastest rate), or 0 if no such rate exists. For version 1, if the output does not have a constant refresh rate, the refresh argument must be zero.

The 64-bit value combined from seq_hi and seq_lo is the value of the output's vertical retrace counter when the content update was first scanned out to the display. This value must be compatible with the definition of MSC in GLX_OML_sync_control specification. Note, that if the display path has a non-zero latency, the time instant specified by this counter may differ from the timestamp's.

If the output does not have a concept of vertical retrace or a refresh cycle, or the output device is self-refreshing without a way to query the refresh count, then the arguments seq_hi and seq_lo must be zero.

Parameters:

  • tv_sec_hi ¤

    (int) –

    High 32 bits of the seconds part of the presentation timestamp

  • tv_sec_lo ¤

    (int) –

    Low 32 bits of the seconds part of the presentation timestamp

  • tv_nsec ¤

    (int) –

    Nanoseconds part of the presentation timestamp

  • refresh ¤

    (int) –

    Nanoseconds till next refresh

  • seq_hi ¤

    (int) –

    High 32 bits of refresh counter

  • seq_lo ¤

    (int) –

    Low 32 bits of refresh counter

  • flags ¤

    (kind) –

    Combination of 'kind' values

discarded ¤

discarded() -> None

The content update was not displayed

The content update was never displayed to the user.

on_sync_output ¤

on_sync_output(output: wl_output) -> None

Presentation synchronized to this output.

Override to handle wayland.wp_presentation_feedback.events.sync_output.

on_presented ¤

on_presented(
    tv_sec_hi: int,
    tv_sec_lo: int,
    tv_nsec: int,
    refresh: int,
    seq_hi: int,
    seq_lo: int,
    flags: kind,
) -> None

The content update was displayed.

Override to handle wayland.wp_presentation_feedback.events.presented.

on_discarded ¤

on_discarded() -> None

The content update was not displayed.

Override to handle wayland.wp_presentation_feedback.events.discarded.