compositor-drm: Remove unnecessary picked_scanout variable

e2e8013633 fixed the same issue as df573031d0 in a different way.
The latter commit (applied earlier in the upstream tree) adds a variable
to assign_planes to keep track of when we successfully assign a view to
the scanout plane, and doesn't call prepare_scanout_view if we have.

The former commit adds this checking inside prepare_scanout_view: if the
pending output state already has a framebuffer assigned to the scanout
plane, we drop out of prepare_scanout_view early. The picked_scanout
variable inside assign_planes can thus be removed.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Emre Ucan <eucan@de.adit-jv.com>
This commit is contained in:
Daniel Stone 2018-05-15 17:09:53 +01:00
parent 85eebdf456
commit f9bd54682b
1 changed files with 2 additions and 9 deletions

View File

@ -3099,7 +3099,6 @@ drm_assign_planes(struct weston_output *output_base, void *repaint_data)
struct weston_view *ev;
pixman_region32_t surface_overlap, renderer_region;
struct weston_plane *primary, *next_plane;
bool picked_scanout = false;
assert(!output->state_last);
state = drm_output_state_duplicate(output->state_cur,
@ -3147,19 +3146,13 @@ drm_assign_planes(struct weston_output *output_base, void *repaint_data)
&ev->transform.boundingbox);
next_plane = NULL;
if (pixman_region32_not_empty(&surface_overlap) || picked_scanout)
if (pixman_region32_not_empty(&surface_overlap))
next_plane = primary;
if (next_plane == NULL)
next_plane = drm_output_prepare_cursor_view(state, ev);
/* If a higher-stacked view already got assigned to scanout, it's incorrect to
* assign a subsequent (lower-stacked) view to scanout.
*/
if (next_plane == NULL) {
if (next_plane == NULL)
next_plane = drm_output_prepare_scanout_view(state, ev);
if (next_plane)
picked_scanout = true;
}
if (next_plane == NULL)
next_plane = drm_output_prepare_overlay_view(state, ev);