backend-drm: Skip testing plane state if plane is not enabled
authorMarius Vlad <marius.vlad@collabora.com>
Thu, 14 Nov 2019 22:25:11 +0000 (00:25 +0200)
committerMarius Vlad <marius.vlad@collabora.com>
Fri, 22 Nov 2019 15:11:36 +0000 (17:11 +0200)
Adds a further assert() to make sure we're not checking against invalid
values. This was seen in the wild when the kernel rejects the commit for
overlay resulting in a check for invalid zpos values.

Fixes: #304
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
libweston/backend-drm/state-propose.c

index e45ee65a0ba0403d8ba449e13ea3a74705c46519..9c7871e04ef3fcb796b2b83bda942430ebf21e8a 100644 (file)
@@ -604,6 +604,12 @@ drm_output_check_zpos_plane_states(struct drm_output_state *state)
                struct wl_list *next_node = ps->link.next;
                bool found_dup = false;
 
+               /* skip any plane that is not enabled */
+               if (!ps->fb)
+                       continue;
+
+               assert(ps->zpos != DRM_PLANE_ZPOS_INVALID_PLANE);
+
                /* find another plane with the same zpos value */
                if (next_node == &state->plane_list)
                        break;