From: Marius Vlad Date: Thu, 14 Nov 2019 22:25:11 +0000 (+0200) Subject: backend-drm: Skip testing plane state if plane is not enabled X-Git-Tag: upstream/9.0.0~250 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=788e80db77e5e86a67fca606ac61f23682a07e71;p=platform%2Fupstream%2Fweston.git backend-drm: Skip testing plane state if plane is not enabled 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 --- diff --git a/libweston/backend-drm/state-propose.c b/libweston/backend-drm/state-propose.c index e45ee65a..9c7871e0 100644 --- a/libweston/backend-drm/state-propose.c +++ b/libweston/backend-drm/state-propose.c @@ -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;