backend-drm: prepare virtual output API for heterogeneous outputs
Stop plugins from overwriting the struct weston_output::destroy vfunc, as that will be used by backends to recognize their outputs. Instead, pass a plugin-specific destroy callback when creating the virtual output. See: https://gitlab.freedesktop.org/wayland/weston/-/issues/268 Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
This commit is contained in:
committed by
Pekka Paalanen
parent
54d7682ee8
commit
aab722bb17
@@ -579,6 +579,7 @@ struct drm_output {
|
||||
struct wl_event_source *pageflip_timer;
|
||||
|
||||
bool virtual;
|
||||
void (*virtual_destroy)(struct weston_output *base);
|
||||
|
||||
submit_frame_cb virtual_submit_frame;
|
||||
};
|
||||
|
||||
@@ -259,6 +259,9 @@ drm_virtual_output_destroy(struct weston_output *base)
|
||||
|
||||
drm_output_state_free(output->state_cur);
|
||||
|
||||
if (output->virtual_destroy)
|
||||
output->virtual_destroy(base);
|
||||
|
||||
free(output);
|
||||
}
|
||||
|
||||
@@ -324,7 +327,8 @@ drm_virtual_output_disable(struct weston_output *base)
|
||||
}
|
||||
|
||||
static struct weston_output *
|
||||
drm_virtual_output_create(struct weston_compositor *c, char *name)
|
||||
drm_virtual_output_create(struct weston_compositor *c, char *name,
|
||||
void (*destroy_func)(struct weston_output *))
|
||||
{
|
||||
struct drm_output *output;
|
||||
struct drm_backend *b = to_drm_backend(c);
|
||||
@@ -343,6 +347,7 @@ drm_virtual_output_create(struct weston_compositor *c, char *name)
|
||||
}
|
||||
|
||||
output->virtual = true;
|
||||
output->virtual_destroy = destroy_func;
|
||||
output->gbm_bo_flags = GBM_BO_USE_LINEAR | GBM_BO_USE_RENDERING;
|
||||
|
||||
weston_output_init(&output->base, c, name);
|
||||
|
||||
Reference in New Issue
Block a user