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

Daniel Stone daniel at fooishbar.org
Thu Apr 12 13:10:58 UTC 2018

On 12 April 2018 at 14:48, Pekka Paalanen <ppaalanen at gmail.com> wrote:
> On Thu, 12 Apr 2018 14:38:01 +0200 Daniel Stone <daniel at fooishbar.org> wrote:
>> > +               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.
> Actually I very specifically chose to not do that. I want to keep the
> to_drm_head() call, because I envision in the future we will have
> several different kinds of heads (virtual maybe) and to_drm_head()
> might actually return NULL. Grepping for it will be easy, finding all
> the wl_list_for_each(..., base.derived_field) will be hard.
> I have been migrating the whole code base towards the explicit calls of
> down-cast wrappers and away from the sneaky container_of() double-casts
> as I go. This applies to outputs as well.

Oh, I hadn't at all thought about virtual / mixed-backend / etc
outputs. Good plan; objection dropped.


More information about the wayland-devel mailing list