wl_list_init(&output->head_list);
- weston_head_init(&output->head, name);
- output->head.allocator_output = output;
- if (!compositor->backend->create_output) {
- weston_head_set_connection_status(&output->head, true);
- weston_compositor_add_head(compositor, &output->head);
- }
-
/* Add some (in)sane defaults which can be used
* for checking if an output was properly configured
*/
wl_list_for_each_safe(head, tmp, &output->head_list, output_link)
weston_head_detach(head);
- weston_head_release(&output->head);
-
free(output->name);
}
{
struct weston_output *output;
- if (head->allocator_output) {
- /* XXX: compatibility path to be removed after all converted */
- output = head->allocator_output;
- } else {
- assert(compositor->backend->create_output);
- output = compositor->backend->create_output(compositor,
- head->name);
- }
-
+ assert(compositor->backend->create_output);
+ output = compositor->backend->create_output(compositor, head->name);
if (!output)
return NULL;
if (weston_output_attach_head(output, head) < 0) {
- if (!head->allocator_output)
- output->destroy(output);
-
+ weston_output_destroy(output);
return NULL;
}
WL_EXPORT void
weston_output_destroy(struct weston_output *output)
{
- struct weston_head *head;
-
- /* XXX: compatibility path to be removed after all converted */
- head = weston_output_get_first_head(output);
- if (head->allocator_output) {
- /* The old design: backend is responsible for destroying the
- * output, so just undo create_output_with_head()
- */
- weston_head_detach(head);
- return;
- }
-
output->destroy(output);
}
char *name; /**< head name, e.g. connector name */
bool connected; /**< is physically connected */
-
- struct weston_output *allocator_output; /**< XXX: to be removed */
};
struct weston_output {
struct weston_mode *original_mode;
struct wl_list mode_list;
- struct weston_head head; /**< head for unconverted backends */
struct wl_list head_list; /**< List of driven weston_heads */
void (*start_repaint_loop)(struct weston_output *output);