struct drm_output *output;
drmModeObjectPropertiesPtr props;
struct drm_mode *drm_mode;
+ char *name;
int i;
static const struct drm_property_info connector_props[] = {
output->original_crtc = drmModeGetCrtc(b->drm.fd, output->crtc_id);
+ name = make_connector_name(connector);
+ weston_output_init(&output->base, b->compositor, name);
+ free(name);
+
output->base.enable = drm_output_enable;
output->base.destroy = drm_output_destroy;
output->base.disable = drm_output_disable;
- output->base.name = make_connector_name(connector);
output->destroy_pending = 0;
output->disable_pending = 0;
find_and_parse_output_edid(b, output, props);
drmModeFreeObjectProperties(props);
- weston_output_init(&output->base, b->compositor);
-
for (i = 0; i < output->connector->count_modes; i++) {
drm_mode = drm_output_add_mode(output, &output->connector->modes[i]);
if (!drm_mode) {
goto out_free;
}
- output->base.name = strdup("fbdev");
+ weston_output_init(&output->base, backend->compositor, "fbdev");
+
output->base.destroy = fbdev_output_destroy;
output->base.disable = fbdev_output_disable_handler;
output->base.enable = fbdev_output_enable;
- weston_output_init(&output->base, backend->compositor);
-
/* only one static mode in list */
output->mode.flags =
WL_OUTPUT_MODE_CURRENT | WL_OUTPUT_MODE_PREFERRED;
if (output == NULL)
return -1;
- output->base.name = strdup(name);
+ weston_output_init(&output->base, compositor, name);
+
output->base.destroy = headless_output_destroy;
output->base.disable = headless_output_disable;
output->base.enable = headless_output_enable;
- weston_output_init(&output->base, compositor);
weston_compositor_add_pending_output(&output->base, compositor);
return 0;
if (output == NULL)
return -1;
- output->base.name = strdup("rdp");
+ weston_output_init(&output->base, compositor, "rdp");
+
output->base.destroy = rdp_output_destroy;
output->base.disable = rdp_output_disable;
output->base.enable = rdp_output_enable;
- weston_output_init(&output->base, compositor);
weston_compositor_add_pending_output(&output->base, compositor);
return 0;
output->base.destroy = wayland_output_destroy;
output->base.disable = wayland_output_disable;
output->base.enable = wayland_output_enable;
- output->base.name = strdup(name);
return output;
}
if (!output)
return -1;
- weston_output_init(&output->base, compositor);
+ weston_output_init(&output->base, compositor, name);
weston_compositor_add_pending_output(&output->base, compositor);
return 0;
goto out;
}
- weston_output_init(&output->base, b->compositor);
+ weston_output_init(&output->base, b->compositor, "wlparent");
output->base.scale = 1;
output->base.transform = WL_OUTPUT_TRANSFORM_NORMAL;
if (!output)
return -1;
- weston_output_init(&output->base, b->compositor);
+ weston_output_init(&output->base, b->compositor, "wayland-fullscreen");
output->base.scale = 1;
output->base.transform = WL_OUTPUT_TRANSFORM_NORMAL;
return -1;
}
- output->base.name = strdup(name);
+ weston_output_init(&output->base, compositor, name);
+
output->base.destroy = x11_output_destroy;
output->base.disable = x11_output_disable;
output->base.enable = x11_output_enable;
- weston_output_init(&output->base, compositor);
weston_compositor_add_pending_output(&output->base, compositor);
return 0;
*
* \param output The weston_output object to initialize
* \param compositor The compositor instance.
+ * \param name Name for the output (the string is copied).
*
* Sets initial values for fields that are expected to be
* configured either by compositors or backends.
*
+ * The name is used in logs, and can be used by compositors as a configuration
+ * identifier.
+ *
* \memberof weston_output
* \internal
*/
WL_EXPORT void
weston_output_init(struct weston_output *output,
- struct weston_compositor *compositor)
+ struct weston_compositor *compositor,
+ const char *name)
{
output->compositor = compositor;
output->destroying = 0;
-
- /* Backends must set output->name */
- assert(output->name);
-
+ output->name = strdup(name);
wl_list_init(&output->link);
output->enabled = false;
void
weston_output_init(struct weston_output *output,
- struct weston_compositor *compositor);
+ struct weston_compositor *compositor,
+ const char *name);
void
weston_compositor_add_pending_output(struct weston_output *output,