On Tue, 26 Sep 2017 18:15:35 +0100 Daniel Stone <dani...@collabora.com> wrote:
> Track dynamic plane state (CRTC, FB, position) in separate structures, > rather than as part of the plane. This will make it easier to handle > state management later, and much more closely tracks what the kernel > does with atomic modesets. > > The fb_last pointer previously used in drm_plane now becomes part of > output->state_last, and is not directly visible from the plane itself. > > Signed-off-by: Daniel Stone <dani...@collabora.com> > --- > libweston/compositor-drm.c | 342 > ++++++++++++++++++++++++++++++++++++--------- > 1 file changed, 277 insertions(+), 65 deletions(-) > +/** > + * Duplicate an existing plane state into a new plane state, storing it > within > + * the given output state. If the output state already contains a plane state > + * for the drm_plane referenced by 'src', that plane state is freed first. > + */ > +static struct drm_plane_state * > +drm_plane_state_duplicate(struct drm_output_state *state_output, > + struct drm_plane_state *src) > +{ > + struct drm_plane_state *dst = malloc(sizeof(*dst)); > + struct drm_plane_state *old, *tmp; > + > + assert(src); > + assert(dst); > + *dst = *src; > + wl_list_init(&dst->link); > + > + wl_list_for_each_safe(old, tmp, &state_output->plane_list, link) { > + if (old->plane == dst->plane) > + drm_plane_state_free(old, false); > + } Hi, should this not protect against src == old? That is, duplicating a plane state that is already in the output state as well? Or, should there be assert(src != old);? > + > + wl_list_insert(&state_output->plane_list, &dst->link); Or move the below to above the loop? > + if (src->fb) > + dst->fb = drm_fb_ref(src->fb); > + dst->output_state = state_output; > + dst->complete = false; > + > + return dst; > +} Otherwise I would be happy to give a R-b. Thanks, pq
pgp8mny0wRqt9.pgp
Description: OpenPGP digital signature
_______________________________________________ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel