[PATCH weston v6 56/73] compositor-drm: remove unused_connectors array

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

Hi Pekka,

On 16 February 2018 at 15:57, Pekka Paalanen <ppaalanen at gmail.com> wrote:
> Replace the unused_connectors array by iterating through the head list
> instead. A head that is not enabled (attached to an enabled output) is
> basically an unused connector.
> All connectors regardless of their status have a drm_head. This has the
> nice effect that drm_pending_state_apply_atomic() does not need to
> re-query the connector properties every time, they can be simply looked
> up in the drm_head.

\o/ Nice!

Small comment, which also applies to some of the other patches IIRC:

>         if (b->state_invalid) {
> +               struct weston_head *head_base;
> +               struct drm_head *head;
>                 uint32_t *unused;
>                 int err;
>                 /* If we need to reset all our state (e.g. because we've
>                  * just started, or just been VT-switched in), explicitly
>                  * disable all the CRTCs and connectors we aren't using. */
> -               wl_array_for_each(unused, &b->unused_connectors) {
> -                       struct drm_property_info infos[WDRM_CONNECTOR__COUNT];
> +               wl_list_for_each(head_base,
> +                                &b->compositor->head_list, compositor_link) {

wl_list_for_each(head, &b->compositor->head_list, base.compositor_link)

You can get rid of the head_base declaration as well as the cast that way.

That being said, I'm still working through and up to here I've only
these two comments. Otherwise, so far, very happy to land what's here.


More information about the wayland-devel mailing list