From e1335a792aff0dfbe3d95389e3a576297906b700 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 6 Feb 2023 17:54:13 +0100 Subject: [PATCH] output-layer: add feedback event --- include/wlr/types/wlr_output_layer.h | 17 +++++++++++++++++ types/wlr_output_layer.c | 1 + 2 files changed, 18 insertions(+) diff --git a/include/wlr/types/wlr_output_layer.h b/include/wlr/types/wlr_output_layer.h index e9b899a9..9f787e2c 100644 --- a/include/wlr/types/wlr_output_layer.h +++ b/include/wlr/types/wlr_output_layer.h @@ -9,6 +9,7 @@ #ifndef WLR_TYPES_WLR_OUTPUT_LAYER_H #define WLR_TYPES_WLR_OUTPUT_LAYER_H +#include #include #include @@ -36,6 +37,10 @@ struct wlr_output_layer { struct wl_list link; // wlr_output.layers struct wlr_addon_set addons; + struct { + struct wl_signal feedback; // struct wlr_output_layer_feedback_event + } events; + void *data; }; @@ -56,6 +61,18 @@ struct wlr_output_layer_state { bool accepted; }; +/** + * Feedback for an output layer. + * + * After an output commit, if the backend is not able to display a layer, it + * can send feedback events. These events can be used to re-allocate the + * layer's buffers so that they have a higher chance to get displayed. + */ +struct wlr_output_layer_feedback_event { + dev_t target_device; + const struct wlr_drm_format_set *formats; +}; + /** * Create a new output layer. */ diff --git a/types/wlr_output_layer.c b/types/wlr_output_layer.c index f50e6854..7624846f 100644 --- a/types/wlr_output_layer.c +++ b/types/wlr_output_layer.c @@ -9,6 +9,7 @@ struct wlr_output_layer *wlr_output_layer_create(struct wlr_output *output) { wl_list_insert(&output->layers, &layer->link); wlr_addon_set_init(&layer->addons); + wl_signal_init(&layer->events.feedback); return layer; }