[PATCH 3/3] compositor-drm: add sprite support v6

Jesse Barnes jbarnes at virtuousgeek.org
Fri Feb 10 09:16:54 PST 2012


On Fri, 10 Feb 2012 11:55:45 +0200
Pekka Paalanen <ppaalanen at gmail.com> wrote:

> On Thu,  9 Feb 2012 13:12:58 -0800
> Jesse Barnes <jbarnes at virtuousgeek.org> wrote:
> 
> > Add support for assigning surfaces to overlay sprites using the new
> > assign_planes hook.
> > 
> > v2: queue per-sprite vblank events to avoid de-queuing sprite updates
> >     for unrelated outputs (reported by krh)
> > v3: handle output and surface transformation when calculating src & dest
> >     rects for the sprite (from pq & krh)
> > v4: use new gbm function to get actual surface format and check against
> >     supported formats in sprite
> > v5: track overlapped surfaces in compositor-drm better (krh)
> > v6: update with comments from Pekka
> >     - remove is_cursor, it was really just checking for buffers
> >     - use pixman_region32_fini before damaging the old surface
> >     - add comments about damage requirements and transform update
> > ---
> >  configure.ac         |    2 +-
> >  src/compositor-drm.c |  447 +++++++++++++++++++++++++++++++++++++++++++++++++-
> >  2 files changed, 447 insertions(+), 2 deletions(-)
> > 
> > diff --git a/configure.ac b/configure.ac
> > index 62d36eb..94c5ab9 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -73,7 +73,7 @@ AC_ARG_ENABLE(drm-compositor, [  --enable-drm-compositor],,
> >  AM_CONDITIONAL(ENABLE_DRM_COMPOSITOR, test x$enable_drm_compositor == xyes)
> >  if test x$enable_drm_compositor == xyes; then
> >    AC_DEFINE([BUILD_DRM_COMPOSITOR], [1], [Build the DRM compositor])
> > -  PKG_CHECK_MODULES(DRM_COMPOSITOR, [libudev >= 136 libdrm >= 2.4.23 gbm])
> > +  PKG_CHECK_MODULES(DRM_COMPOSITOR, [libudev >= 136 libdrm >= 2.4.30 gbm])
> >  fi
> >  
> >  
> > diff --git a/src/compositor-drm.c b/src/compositor-drm.c
> > index adbd03c..97bdfd0 100644
> > --- a/src/compositor-drm.c
> > +++ b/src/compositor-drm.c
> ...
> > +static void
> > +drm_assign_planes(struct weston_output *output)
> > +{
> > +	struct weston_compositor *ec = output->compositor;
> > +	struct weston_surface *es;
> > +	pixman_region32_t overlap, surface_overlap;
> > +
> > +	/*
> > +	 * Find a surface for each sprite in the output using some heuristics:
> > +	 * 1) size
> > +	 * 2) frequency of update
> > +	 * 3) opacity (though some hw might support alpha blending)
> > +	 * 4) clipping (this can be fixed with color keys)
> > +	 *
> > +	 * The idea is to save on blitting since this should save power.
> > +	 * If we can get a large video surface on the sprite for example,
> > +	 * the main display surface may not need to update at all, and
> > +	 * the client buffer can be used directly for the sprite surface
> > +	 * as we do for flipping full screen surfaces.
> > +	 */
> > +	pixman_region32_init(&overlap);
> > +	wl_list_for_each(es, &ec->surface_list, link) {
> > +		weston_surface_update_transform(es);
> 
> I am going to propose, that weston_output_repaint() will guarantee,
> that no surface (in the list) has dirty geometry, when it calls any
> functions, backend or otherwise. Therefore we would not need to take
> care of it inside any repaint functions by calling
> weston_surface_update_transform().

Ok that's fine by me.

> The reason is that I am adding damage_below and damage calls into
> weston_surface_update_transform(), which will apply damage while
> dealing with dirty geometry. Also, as weston_output_repaint() needs to
> compute e.g. overlaps, it already has a loop iterating over all
> surfaces, where I can call weston_surface_update_transform().
> 
> I hope this is ok for your output work.

I think it should work ok.

-- 
Jesse Barnes, Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20120210/6f265040/attachment-0001.pgp>


More information about the wayland-devel mailing list