Commit e952a01c authored by Pekka Paalanen's avatar Pekka Paalanen

libweston: move asserts to add_pending_output()

weston_compositor_add_pending_output() is the point through which all
backends must go when creating a new output. The enable and disable
vfuns are essential for anything to be done with the output, so it makes
sense to check them here, rather than when actually enabling or
disabling.

Particularly the disable vfunc is rarely called, so this gets the check
better excercised.
Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: default avatarArmin Krezović <krezovic.armin@gmail.com>
parent d72bad2f
......@@ -4701,6 +4701,9 @@ WL_EXPORT void
weston_compositor_add_pending_output(struct weston_output *output,
struct weston_compositor *compositor)
{
assert(output->disable);
assert(output->enable);
wl_list_remove(&output->link);
wl_list_insert(compositor->pending_output_list.prev, &output->link);
wl_signal_emit(&compositor->output_pending_signal, output);
......@@ -4745,8 +4748,6 @@ weston_output_enable(struct weston_output *output)
struct weston_output *iterator;
int x = 0, y = 0;
assert(output->enable);
iterator = container_of(c->output_list.prev,
struct weston_output, link);
......@@ -4833,8 +4834,6 @@ weston_output_enable(struct weston_output *output)
WL_EXPORT void
weston_output_disable(struct weston_output *output)
{
assert(output->disable);
/* Should we rename this? */
output->destroying = 1;
......
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