diff options
author | Simon Ser <contact@emersion.fr> | 2023-04-14 20:41:27 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-07-14 15:20:35 +0200 |
commit | 67447d6cb407ac5b6405b4dbae01a38567feb111 (patch) | |
tree | e072e25f046adef041cbb1764149cf663be24d3b /include | |
parent | fe84bfc8d92c07c5c58c2b90e9884d74caa7bdb8 (diff) |
presentation-time: add separate helper for zero-copy
The backend is not able to tell whether a surface is being
presented via direct scan-out or not. The backend will set
ZERO_COPY if the buffer submitted via the output commit was
presented in a zero-copy fashion, but will no know whether the
buffer comes from the compositor or the client.
Diffstat (limited to 'include')
-rw-r--r-- | include/wlr/types/wlr_presentation_time.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/include/wlr/types/wlr_presentation_time.h b/include/wlr/types/wlr_presentation_time.h index 817730b3..a8df292d 100644 --- a/include/wlr/types/wlr_presentation_time.h +++ b/include/wlr/types/wlr_presentation_time.h @@ -33,11 +33,12 @@ struct wlr_presentation { struct wlr_presentation_feedback { struct wl_list resources; // wl_resource_get_link() - // Only when the wlr_presentation_surface_sampled_on_output() helper has - // been called. + // Only when the wlr_presentation_surface_textured_on_output() or + // wlr_presentation_surface_scanned_out_on_output() helper has been called. struct wlr_output *output; bool output_committed; uint32_t output_commit_seq; + bool zero_copy; struct wl_listener output_commit; struct wl_listener output_present; @@ -85,14 +86,23 @@ void wlr_presentation_event_from_output(struct wlr_presentation_event *event, const struct wlr_output_event_present *output_event); /** - * Mark the current surface's buffer as sampled on the given output. + * Mark the current surface's buffer as textured on the given output. * * Instead of calling wlr_presentation_surface_sampled() and managing the * struct wlr_presentation_feedback itself, the compositor can call this function * before a wlr_output_commit() call to indicate that the surface's current - * contents will be displayed on the output. + * contents have been copied to a buffer which will be displayed on the output. */ -void wlr_presentation_surface_sampled_on_output( +void wlr_presentation_surface_textured_on_output( + struct wlr_presentation *presentation, struct wlr_surface *surface, + struct wlr_output *output); +/** + * Mark the current surface's buffer as scanned out on the given output. + * + * Same as wlr_presentation_surface_textured_on_output(), but indicates direct + * scan-out. + */ +void wlr_presentation_surface_scanned_out_on_output( struct wlr_presentation *presentation, struct wlr_surface *surface, struct wlr_output *output); |