[PATCH weston v6 69/73] compositor-drm: head attach requires a modeset

Daniel Stone daniel at fooishbar.org
Thu Apr 12 12:55:01 UTC 2018


On 16 February 2018 at 15:57, Pekka Paalanen <ppaalanen at gmail.com> wrote:
> For the attach on an enabled output to have an effect, we need to go
> through drmModeSetCrtc or ATOMIC_ALLOW_MODESET.
>
> Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> ---
>  libweston/compositor-drm.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>
> diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
> index d1fc66ac..d0196715 100644
> --- a/libweston/compositor-drm.c
> +++ b/libweston/compositor-drm.c
> @@ -4404,9 +4404,24 @@ static int
>  drm_output_attach_head(struct weston_output *output_base,
>                        struct weston_head *head_base)
>  {
> +       struct drm_backend *b = to_drm_backend(output_base->compositor);
> +
>         if (wl_list_length(&output_base->head_list) >= MAX_CLONED_CONNECTORS)
>                 return -1;
>
> +       if (!output_base->enabled)
> +               return 0;
> +
> +       /* XXX: ensure the configuration will work.
> +        * This is actually impossible without major infrastructure
> +        * work. */
> +
> +       /* Need to go through modeset to add connectors. */
> +       /* XXX: Ideally we'd do this per-output, not globally. */
> +       b->state_invalid = true;

How about just an output->heads_dirty flag or something, which would
ensure ALLOW_MODESET/SetCrtc are called?

Cheers,
Daniel


More information about the wayland-devel mailing list