On Tue, 18 Jul 2017 14:14:23 +0100
Daniel Stone <dani...@collabora.com> wrote:

> From: Pekka Paalanen <pekka.paala...@collabora.co.uk>
> 
> This moves the single sprite creation code from create_sprites() into a
> new function. The readability clean-up is small, but my intention is to
> write an alternate version of create_sprites(), and sharing the single
> sprite creation code is useful.
> 
> [daniels: Genericised from drm_sprite to drm_plane, moving some of the
>           logic back into create_sprites(), also symmetrical
>           drm_plane_destroy.]
> 
> Signed-off-by: Pekka Paalanen <pekka.paala...@collabora.co.uk>
> Signed-off-by: Daniel Stone <dani...@collabora.com>
> ---
>  libweston/compositor-drm.c | 188 
> ++++++++++++++++++++++++++++-----------------
>  1 file changed, 117 insertions(+), 71 deletions(-)
> 
> diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
> index 10adb463..5967a18f 100644
> --- a/libweston/compositor-drm.c
> +++ b/libweston/compositor-drm.c
> @@ -1817,6 +1817,123 @@ init_pixman(struct drm_backend *b)
>  }

Hi,

the documentation mistakes are now fixed, but the two things we talked
about mentioning in the commit message are still not mentioned.

> +static void
> +drm_plane_destroy(struct drm_plane *plane)
> +{
> +     drmModeSetPlane(plane->backend->drm.fd, plane->plane_id, 0, 0, 0,
> +                     0, 0, 0, 0, 0, 0, 0, 0);
> +     assert(!plane->fb_last);
> +     assert(!plane->fb_pending);
> +     drm_fb_unref(plane->fb_current);
> +     weston_plane_release(&plane->base);
> +     wl_list_remove(&plane->link);
> +     free(plane);
> +}

This function does not use output->crtc_id like the old code did (it's
not necessary), and adds the wl_list_remove() (missing it was not a
problem because the dangling pointers got freed anyway).

A short note about those would be nice in the commit message, but
anyway:
Reviewed-by: Pekka Paalanen <pekka.paala...@collabora.co.uk>


Thanks,
pq

Attachment: pgp3MCgC8m91S.pgp
Description: OpenPGP digital signature

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to