weston/libweston
Daniel Stone fb4869d628 compositor: Assign new views to the primary plane
When we create a new view, assign it to the primary plane from the
beginning.

Currently, every view across the compositor will be assigned to a plane
during every repaint cycle of every output: the DRM renderer's
assign_planes hook will either move a view to a drm_plane, or to the
primary plane if a suitable drm_plane could not be found for the output
it is on. There are no other assign_planes implementation, and the
fallback when none is provided, is to assign every view to the primary
plane.

DRM's behaviour is undesirable in multi-output situations, since it
means that views which were on a plane on one output will be demoted to
the primary plane; doing this causes damage, which will cause a spurious
repaint for the output. This spurious repaint will have no effect on the
other output, but it will do the same demotion of views to the primary
plane, which will again provoke a repaint on the other output.

With a simple fix for this behaviour (i.e. not moving views which are
only visible on other outputs), the following behaviour is observed:
  - outputs A and B are present
  - views A and B are created for those outputs respectively, with SHM
    buffers attached; view->plane == NULL for both
  - current buffer content for views A and B are uploaded to the
    renderer
  - output A runs its repaint cycle, and sets keep_buffer to false on
    surface B's output, as it can never be promoted to a plane; it does
    not move view B to another plane
  - output B runs its repaint cycle, and moves view B to the primary
    plane
  - weston_view_assign_to_plane has work to do (as the plane is changing
    from NULL to the primary plane), calls weston_surface_damage and
    calls weston_surface_damage
  - weston_surface_damage re-uploads buffer content, possibly from
    nowhere at all; e508ce6a notes that this behaviour is broken

Assigning views to the primary plane when created makes it possible to
fix the DRM assign_planes implementation: assign_planes will always set
keep_buffer to true if there is any chance the buffer can ever be
promoted to a plane, regardless of view configruation. If the buffer
cannot be promoted to a plane, it must by definition never migrate from
the primary plane. This means that there is no opportunity to hit the
same issue, where the buffer content has already been discarded, but
weston_view_assign_to_plane is not a no-op.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-12-16 12:43:07 +00:00
..
animation.c libweston: Add move (without scale) animation 2016-11-21 18:22:47 +00:00
bindings.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
clipboard.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
compositor-drm.c compositor-drm: Reshuffle and comment plane conditions 2016-12-12 20:49:29 +00:00
compositor-drm.h weston: Port DRM backend to new output handling API 2016-10-03 14:22:50 +03:00
compositor-fbdev.c weston: Rename weston_output_init_pending() to weston_output_init() 2016-10-05 14:59:09 +03:00
compositor-fbdev.h weston: Port fbdev backend to new output handling API 2016-10-03 14:24:08 +03:00
compositor-headless.c weston: Rename weston_output_init_pending() to weston_output_init() 2016-10-05 14:59:09 +03:00
compositor-headless.h weston: Port headless backend to new output handling API 2016-10-03 14:24:08 +03:00
compositor-rdp.c compositor-rdp: Properly destroy the renderer and pixman image 2016-10-05 14:59:10 +03:00
compositor-rdp.h weston: Port RDP backend to new output handling API 2016-10-03 14:24:08 +03:00
compositor-wayland.c compositor-wayland: Destroy cursor images earlier 2016-11-29 09:49:29 +00:00
compositor-wayland.h compositor-wayland: Convert fullscreen flag to bool 2016-10-14 10:42:17 +02:00
compositor-x11.c compositor-x11: fix segfault when use_pixman is true 2016-11-24 11:45:40 +00:00
compositor-x11.h weston: Port X11 backend to new output handling API 2016-10-05 14:59:09 +03:00
compositor.c compositor: Assign new views to the primary plane 2016-12-16 12:43:07 +00:00
compositor.h Don't include version.h from compositor.h 2016-11-24 11:42:05 +00:00
data-device.c libweston: Rename weston_surface::configure to ::committed 2016-08-14 09:28:50 +02:00
dbus.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
dbus.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
gl-renderer.c gl-renderer: Fix an invalid write when closing a Weston window 2016-11-28 18:11:09 +00:00
gl-renderer.h gl-renderer: Add <platform_attribs> param to gl_renderer_display_create 2016-11-07 17:06:44 +02:00
input.c Don't prepend protocol/ to include paths 2016-11-29 09:49:00 +00:00
launcher-direct.c Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
launcher-impl.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
launcher-logind.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
launcher-util.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
launcher-util.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
launcher-weston-launch.c libweston/launcher-weston-launch: Silence unused-function warning 2016-08-15 16:33:42 +02:00
libbacklight.c Switch to use safe_strtoint instead of strtol 2016-08-06 18:19:22 -07:00
libbacklight.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
libinput-device.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
libinput-device.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
libinput-seat.c Add configuration option for no input device. 2016-10-22 15:04:58 +01:00
libinput-seat.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
libweston.pc.in libweston: fix major in libweston.pc 2016-08-02 14:19:11 +03:00
linux-dmabuf.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
linux-dmabuf.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
log.c Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
noop-renderer.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
pixman-renderer.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
pixman-renderer.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
plugin-registry.c compositor: add plugin-registry 2016-07-01 14:10:26 +03:00
plugin-registry.h compositor: add plugin-registry 2016-07-01 14:10:26 +03:00
screenshooter.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
spring-tool.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
timeline-object.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
timeline.c Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
timeline.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
vaapi-recorder.c Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
vaapi-recorder.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
version.h.in Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
vertex-clipping.c Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
vertex-clipping.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
weston-egl-ext.h gl-renderer: Use EGL_KHR_no_config_context 2016-11-16 14:46:22 +00:00
weston-launch.c weston-launch: Only run a login shell for new sessions 2016-08-15 16:58:23 +02:00
weston-launch.h Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
windowed-output-api.h libweston: Add initial output API for windowed outputs configuration 2016-10-03 13:51:24 +03:00
zoom.c include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00