compositor: set surface->plane from destroyed plane to NULL
In drm backend, the cursor_surface->plane point to
drm_output->cursor_plane.when this output is removed,
drm_output->cursor_plane is destroyed, butcursor_surface->plane
still point to destroyed plane. So once mouse move to this
cursor_surface and system will repaint this cursor_surface,
segment fault will generate in weston_surface_damage_below() function.
V2:
-set surface->plane to NULL whose plane point to unplugged output,
then change weston_surface_damage_below() to do nothing if
surface->plane is NULL (Kristian)
-set surface->plane to NULL in weston_surface_unmap(),
so that all surfaces that have a non-NULL plane pointer wil be
on compositor->surface_list (Kristian).
bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69777
Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
diff --git a/src/compositor.h b/src/compositor.h
index 5b813fc..73722b5 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -505,6 +505,7 @@
};
struct weston_plane {
+ struct weston_compositor *compositor;
pixman_region32_t damage;
pixman_region32_t clip;
int32_t x, y;
@@ -961,7 +962,9 @@
weston_layer_init(struct weston_layer *layer, struct wl_list *below);
void
-weston_plane_init(struct weston_plane *plane, int32_t x, int32_t y);
+weston_plane_init(struct weston_plane *plane,
+ struct weston_compositor *ec,
+ int32_t x, int32_t y);
void
weston_plane_release(struct weston_plane *plane);