Commit bd002b98 authored by Marius Vlad's avatar Marius Vlad

backend-drm: Assign the primary plane the lowest zpos value

when switching to mixed-mode of compositing

This way we avoid an (incorrect) duplicate check of zpos values. Also,
this would be needed because the renderer needs have the lowest zpos value
available as we don't (yet) properly support underlays, the primary
plane serves as our renderer.

Adds also a check to see if we try to assign a view to a plane with
a lower zpos value than the one assigned to the primary when switching
to mixed-mode of compositing.

Fixes: #304
Signed-off-by: Marius Vlad's avatarMarius Vlad <>
parent b544ac3a
......@@ -636,6 +636,7 @@ static struct drm_plane_state *
drm_output_prepare_plane_view(struct drm_output_state *state,
struct weston_view *ev,
enum drm_output_propose_state_mode mode,
struct drm_plane_state *scanout_state,
uint64_t current_lowest_zpos)
struct drm_output *output = state->output;
......@@ -677,6 +678,19 @@ drm_output_prepare_plane_view(struct drm_output_state *state,
assert(scanout_state != NULL);
if (scanout_state->zpos >= plane->zpos_max) {
drm_debug(b, "\t\t\t\t[plane] not adding plane %d to "
"candidate list: primary's zpos "
"value (%"PRIu64") higher than "
"plane's maximum value (%"PRIu64")\n",
plane->plane_id, scanout_state->zpos,
if (!drm_output_plane_view_has_valid_format(plane, state, ev, fb)) {
drm_debug(b, "\t\t\t\t[plane] not adding plane %d to "
"candidate list: invalid pixel format\n",
......@@ -786,10 +800,14 @@ drm_output_propose_state(struct weston_output *output_base,
scanout_state = drm_plane_state_duplicate(state,
/* assign the primary primary the lowest zpos value */
scanout_state->zpos = plane->zpos_min;
drm_debug(b, "\t\t[state] using renderer FB ID %lu for mixed "
"mode for output %s (%lu)\n",
(unsigned long) scanout_fb->fb_id, output->,
(unsigned long) output->;
drm_debug(b, "\t\t[state] scanout will use for zpos %"PRIu64"\n",
/* - renderer_region contains the total region which which will be
......@@ -887,6 +905,7 @@ drm_output_propose_state(struct weston_output *output_base,
drm_debug(b, "\t\t\t[plane] started with zpos %"PRIu64"\n",
ps = drm_output_prepare_plane_view(state, ev, mode,
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