aboutsummaryrefslogtreecommitdiff
path: root/backend/drm/renderer.c
diff options
context:
space:
mode:
Diffstat (limited to 'backend/drm/renderer.c')
-rw-r--r--backend/drm/renderer.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/backend/drm/renderer.c b/backend/drm/renderer.c
index 00182c59..d28164aa 100644
--- a/backend/drm/renderer.c
+++ b/backend/drm/renderer.c
@@ -66,6 +66,17 @@ bool wlr_drm_surface_init(struct wlr_drm_surface *surf,
surf->width = width;
surf->height = height;
+ if (surf->gbm) {
+ if (surf->front) {
+ gbm_surface_release_buffer(surf->gbm, surf->front);
+ surf->front = NULL;
+ }
+ if (surf->back) {
+ gbm_surface_release_buffer(surf->gbm, surf->back);
+ surf->back = NULL;
+ }
+ }
+
surf->gbm = gbm_surface_create(renderer->gbm, width, height,
format, GBM_BO_USE_RENDERING | flags);
if (!surf->gbm) {