aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/wlr/render/wlr_renderer.h6
-rw-r--r--render/wlr_renderer.c1
2 files changed, 7 insertions, 0 deletions
diff --git a/include/wlr/render/wlr_renderer.h b/include/wlr/render/wlr_renderer.h
index 7d4e6720..c5c6be55 100644
--- a/include/wlr/render/wlr_renderer.h
+++ b/include/wlr/render/wlr_renderer.h
@@ -26,6 +26,12 @@ struct wlr_fbox;
struct wlr_renderer {
struct {
struct wl_signal destroy;
+ /**
+ * Emitted when the GPU is lost, e.g. on GPU reset.
+ *
+ * Compositors should destroy the renderer and re-create it.
+ */
+ struct wl_signal lost;
} events;
// private state
diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c
index b10b7513..7a18d95f 100644
--- a/render/wlr_renderer.c
+++ b/render/wlr_renderer.c
@@ -44,6 +44,7 @@ void wlr_renderer_init(struct wlr_renderer *renderer,
renderer->impl = impl;
wl_signal_init(&renderer->events.destroy);
+ wl_signal_init(&renderer->events.lost);
}
void wlr_renderer_destroy(struct wlr_renderer *r) {