Commit fd1f4c65 authored by Ander Conselvan de Oliveira's avatar Ander Conselvan de Oliveira Committed by Kristian H. Kristensen

compositor-drm: Remove destroy listeners when disabling planes

When an unused plane is disabled, the destroy listener for a previously
used buffer needs to be removed. This fixes a crash when an overlay
would be reenabled using the same buffer as before, causing the destroy
listener to be inserted twice.
parent a7326963
......@@ -29,6 +29,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <linux/input.h>
#include <assert.h>
#include <xf86drm.h>
#include <xf86drmMode.h>
......@@ -520,8 +521,13 @@ drm_disable_unused_sprites(struct weston_output *output_base)
weston_log("failed to disable plane: %d: %s\n",
ret, strerror(errno));
drmModeRmFB(c->drm.fd, s->fb_id);
s->surface = NULL;
s->pending_surface = NULL;
if (s->surface) {
s->surface = NULL;
s->fb_id = 0;
s->pending_fb_id = 0;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment