From: Pekka Paalanen Date: Thu, 14 Sep 2017 13:17:59 +0000 (+0300) Subject: libweston: assert current_mode in weston_output_enable() X-Git-Tag: upstream/5.0.0~181 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=586e1ac791e7a514b71db873b477b137f02aa0b4;p=platform%2Fupstream%2Fweston.git libweston: assert current_mode in weston_output_enable() The functions called here, particularly weston_output_transform_scale_init(), rely on current mode being set. The current mode must also be found in the mode list, though we don't explicitly check it here. current_mode not being set is a programmer error. It could be a backend bug, but it could also be a libweston user bug not calling a set size function. Signed-off-by: Pekka Paalanen Reviewed-by: Ian Ray Reviewed-by: Daniel Stone Acked-by: Derek Foreman --- diff --git a/libweston/compositor.c b/libweston/compositor.c index 547e826..2ec7f8e 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -5539,6 +5539,12 @@ weston_output_enable(struct weston_output *output) return -1; } + if (wl_list_empty(&output->mode_list) || !output->current_mode) { + weston_log("Error: no video mode for output '%s'.\n", + output->name); + return -1; + } + wl_list_for_each(head, &output->head_list, output_link) { assert(head->make); assert(head->model);