[PATCH weston v10 21/61] compositor-drm: Track all plane types

Pekka Paalanen ppaalanen at gmail.com
Wed Apr 12 14:16:48 UTC 2017


On Tue,  4 Apr 2017 17:54:39 +0100
Daniel Stone <daniels at collabora.com> wrote:

> Retain drm_plane tracking objects for all actual DRM planes when using
> universal planes, not just overlay planes. Rename uses of 'sprite' to
> 'plane' to make it clear that it can now be any kind of plane, not just
> an overlay/sprite.
> 
> These are currently unused.
> 
> Differential Revision: https://phabricator.freedesktop.org/D1496
> 
> Signed-off-by: Daniel Stone <daniels at collabora.com>
> ---
>  libweston/compositor-drm.c | 74 +++++++++++++++++++++++++---------------------
>  1 file changed, 41 insertions(+), 33 deletions(-)
> 
> diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
> index 04491da6..afc36fda 100644
> --- a/libweston/compositor-drm.c
> +++ b/libweston/compositor-drm.c
> @@ -173,7 +173,7 @@ struct drm_backend {
>  	int min_height, max_height;
>  	int no_addfb2;
>  
> -	struct wl_list sprite_list;
> +	struct wl_list plane_list;
>  	int sprites_are_broken;
>  	int sprites_hidden;
>  
> @@ -1188,7 +1188,7 @@ drm_output_repaint(struct weston_output *output_base,
>  	struct drm_output *output = to_drm_output(output_base);
>  	struct drm_backend *backend =
>  		to_drm_backend(output->base.compositor);
> -	struct drm_plane *s;
> +	struct drm_plane *p;
>  	struct drm_mode *mode;
>  	int ret = 0;

Ah, this is where the rest of the renames come in. Nice.

>  
> @@ -1238,26 +1238,31 @@ drm_output_repaint(struct weston_output *output_base,
>  	/*
>  	 * Now, update all the sprite surfaces
>  	 */
> -	wl_list_for_each(s, &backend->sprite_list, link) {
> +	wl_list_for_each(p, &backend->plane_list, link) {
>  		uint32_t flags = 0, fb_id = 0;
>  		drmVBlank vbl = {
>  			.request.type = DRM_VBLANK_RELATIVE | DRM_VBLANK_EVENT,
>  			.request.sequence = 1,
>  		};
>  
> -		if ((!s->fb_current && !s->fb_pending) ||
> -		    !drm_plane_crtc_supported(output, s))
> +		if (p->type != WDRM_PLANE_TYPE_OVERLAY)
> +			continue;
> +
> +		/* XXX: Set output much earlier, so we don't attempt to place
> +		 *      planes on entirely the wrong output. */

The comment comes back!

> +		if ((!p->fb_current && !p->fb_pending) ||
> +		    !drm_plane_crtc_supported(output, p))
>  			continue;
>  
> -		if (s->fb_pending && !backend->sprites_hidden)
> -			fb_id = s->fb_pending->fb_id;
> +		if (p->fb_pending && !backend->sprites_hidden)
> +			fb_id = p->fb_pending->fb_id;
>  
> -		ret = drmModeSetPlane(backend->drm.fd, s->plane_id,
> +		ret = drmModeSetPlane(backend->drm.fd, p->plane_id,
>  				      output->crtc_id, fb_id, flags,
> -				      s->dest_x, s->dest_y,
> -				      s->dest_w, s->dest_h,
> -				      s->src_x, s->src_y,
> -				      s->src_w, s->src_h);
> +				      p->dest_x, p->dest_y,
> +				      p->dest_w, p->dest_h,
> +				      p->src_x, p->src_y,
> +				      p->src_w, p->src_h);


Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20170412/e8897636/attachment-0001.sig>


More information about the wayland-devel mailing list