[PATCH weston v10 02/61] libweston: Add pixel-format helpers

Pekka Paalanen ppaalanen at gmail.com
Fri Apr 7 09:41:55 UTC 2017


On Wed, 5 Apr 2017 16:42:07 +0300
Pekka Paalanen <ppaalanen at gmail.com> wrote:

> On Tue,  4 Apr 2017 17:54:20 +0100
> Daniel Stone <daniels at collabora.com> wrote:
> 
> > Rather than duplicating knowledge of pixel formats across several
> > components, create a custom central repository.
> > 
> > Signed-off-by: Daniel Stone <daniels at collabora.com>
> > ---
> >  Makefile.am               |   2 +
> >  libweston/pixel-formats.c | 430 ++++++++++++++++++++++++++++++++++++++++++++++
> >  libweston/pixel-formats.h | 194 +++++++++++++++++++++
> >  3 files changed, 626 insertions(+)
> >  create mode 100644 libweston/pixel-formats.c
> >  create mode 100644 libweston/pixel-formats.h
> > 
> > v10: Add more docs. Build without EGL. Fix format transposition errors.
> >      Insert omitted [hv]sub.
> > 
> > diff --git a/Makefile.am b/Makefile.am
> > index 519d9115..7b24d40c 100644
> > --- a/Makefile.am
> > +++ b/Makefile.am
> > @@ -105,6 +105,8 @@ libweston_ at LIBWESTON_MAJOR@_la_SOURCES =			\
> >  	libweston/timeline-object.h			\
> >  	libweston/linux-dmabuf.c			\
> >  	libweston/linux-dmabuf.h			\
> > +	libweston/pixel-formats.c			\
> > +	libweston/pixel-formats.h			\
> >  	shared/helpers.h				\
> >  	shared/matrix.c					\
> >  	shared/matrix.h					\  
> 
> Hi,
> 
> all the actual content is good now, there are a couple of typoes in the
> comments.
> 
> The remaining issue is the dependency on libdrm headers, more below.
> 
> > diff --git a/libweston/pixel-formats.c b/libweston/pixel-formats.c

> > + *
> > + * Author: Daniel Stone <daniels at collabora.com>
> > + */
> > +
> > +#include "config.h"
> > +
> > +#include <endian.h>
> > +#include <inttypes.h>
> > +#include <stdbool.h>
> > +#include <unistd.h>
> > +#include <libdrm/drm_fourcc.h>  
> 
> Shouldn't this be just <drm_fourcc.h>? We have pkg-config providing us
> with -I/usr/include/libdrm.

Hi,

I fixed that.

> The problem with this is that this makes libweston unconditionally
> depend on libdrm headers at build time (not the library, and nothing
> new at runtime).
> 
> I think that is ok by now. Do people agree?

We now unconditionally depend on libdrm for build in master.


> > +
> > +/**
> > + * Return the effective sampling height for a given plane
> > + *
> > + * When vertical subsampling is in effect, a sampler bound to a secondary
> > + * plane must bind the sampler with a smaller effective height. This function
> > + * returns the effective width to use for the sampler, i.e. dividing by vsub.  
> 
> s/width/height/
> 
> > + *
> > + * If vertical subsampling is not in effect, this will be equal to the height.
> > + *
> > + * @param format Pixel format info structure
> > + * @param plane Zero-indexed plane number
> > + * @param width Height of the buffer  
> 
> s/width/height/
> 
> > + * @returns Effective width for sampling
> > + */
> > +unsigned int
> > +pixel_format_height_for_plane(const struct pixel_format_info *format,
> > +			      unsigned int plane,
> > +			      unsigned int height);  

I fixed the pasties too, and pushed this patch:
   b030897..903721a  master -> master


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/20170407/666effc2/attachment-0001.sig>


More information about the wayland-devel mailing list