When we create a new view, assign it to the primary plane from the beginning.
This made no difference before, since the next surface repaint would forcibly assign all views to a plane, either through DRM's assign_planes() hook, or the fallback inside core repaint. However, this is undesirable for DRM. In a multi-output situation, we would see a view only visible on another output, reasonably decide we didn't want it in a plane on our output, and move it to the primary plane, causing damage, and an output repaint. The plane wouldn't be assigned until the other output ran through repaint. For large SHM buffers (weston_surface->keep_buffer as false), this means that the other output would assign it to a plane later, which caused weston_surface_damage to be called - in the exact way the comment says it shouldn't - which triggered a flush and buffer upload. By this stage, the buffer content would be gone and we would upload garbage. Avoid this problem for now by assigning the view to the primary plane on creation, thus short-circuiting weston_view_move_to_plane when we do call it during output repaint. This is arguably the right thing to do if definitely the wrong way to fix it, but the atomic series is long enough for now. Signed-off-by: Daniel Stone <dani...@collabora.com> Cc: Pekka Paalanen <pekka.paala...@collabora.co.uk> --- libweston/compositor.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libweston/compositor.c b/libweston/compositor.c index 6a69394..895a040 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -269,6 +269,7 @@ weston_view_create(struct weston_surface *surface) return NULL; view->surface = surface; + view->plane = &surface->compositor->primary_plane; /* Assign to surface */ wl_list_insert(&surface->views, &view->surface_link); -- 2.9.3 _______________________________________________ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel