aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-01-30 11:04:01 +0100
committerGitHub <noreply@github.com>2018-01-30 11:04:01 +0100
commitf152fdb4c5ef46f9873b244c0616393efe039745 (patch)
treee12da0b948547aed959289a1c1a5b744aac1314b /backend
parented5b1fdedd775a7acec3d6814cc2ac007e34fd29 (diff)
parentcde0f454b376703e68662f9552b38fc10e97b74a (diff)
Merge pull request #594 from Ongy/drm-surface-buffers
relases gbm buffers on init
Diffstat (limited to 'backend')
-rw-r--r--backend/drm/renderer.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/backend/drm/renderer.c b/backend/drm/renderer.c
index 00182c59..350bfce4 100644
--- a/backend/drm/renderer.c
+++ b/backend/drm/renderer.c
@@ -66,6 +66,21 @@ 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;
+ }
+ gbm_surface_destroy(surf->gbm);
+ }
+ if (surf->egl) {
+ eglDestroySurface(surf->renderer->egl.display, surf->egl);
+ }
+
surf->gbm = gbm_surface_create(renderer->gbm, width, height,
format, GBM_BO_USE_RENDERING | flags);
if (!surf->gbm) {