Re: [Mesa-dev] [PATCH 1/2] gallium/util: implement util_format_is_yuv
2018-03-29 16:15 GMT+02:00 Lucas Stach: > This adds a helper to check if a pipe format is in YUV color space. > Drivers want to know about this, as YUV mostly needs special handling. > > Signed-off-by: Lucas Stach Reviewed-by: Christian Gmeiner > --- > src/gallium/auxiliary/util/u_format.h | 12 > 1 file changed, 12 insertions(+) > > diff --git a/src/gallium/auxiliary/util/u_format.h > b/src/gallium/auxiliary/util/u_format.h > index 88bfd72d0538..e497b4b3375a 100644 > --- a/src/gallium/auxiliary/util/u_format.h > +++ b/src/gallium/auxiliary/util/u_format.h > @@ -557,6 +557,18 @@ util_format_is_depth_and_stencil(enum pipe_format format) >util_format_has_stencil(desc); > } > > +static inline boolean > +util_format_is_yuv(enum pipe_format format) > +{ > + const struct util_format_description *desc = > util_format_description(format); > + > + assert(desc); > + if (!desc) { > + return FALSE; > + } > + > + return desc->colorspace == UTIL_FORMAT_COLORSPACE_YUV; > +} > > /** > * Calculates the depth format type based upon the incoming format > description. > -- > 2.16.1 > > ___ > etnaviv mailing list > etna...@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/etnaviv -- greets -- Christian Gmeiner, MSc https://christian-gmeiner.info ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/2] gallium/util: implement util_format_is_yuv
On Thu, 2018-03-29 at 16:15 +0200, Lucas Stach wrote: > This adds a helper to check if a pipe format is in YUV color space. > Drivers want to know about this, as YUV mostly needs special handling. > > Signed-off-by: Lucas Stach> --- > src/gallium/auxiliary/util/u_format.h | 12 > 1 file changed, 12 insertions(+) > > diff --git a/src/gallium/auxiliary/util/u_format.h > b/src/gallium/auxiliary/util/u_format.h > index 88bfd72d0538..e497b4b3375a 100644 > --- a/src/gallium/auxiliary/util/u_format.h > +++ b/src/gallium/auxiliary/util/u_format.h > @@ -557,6 +557,18 @@ util_format_is_depth_and_stencil(enum pipe_format format) >util_format_has_stencil(desc); > } > > +static inline boolean > +util_format_is_yuv(enum pipe_format format) > +{ > + const struct util_format_description *desc = > util_format_description(format); > + > + assert(desc); > + if (!desc) { > + return FALSE; > + } > + > + return desc->colorspace == UTIL_FORMAT_COLORSPACE_YUV; > +} > > /** > * Calculates the depth format type based upon the incoming format > description. Reviewed-by: Philipp Zabel regards Philipp ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/2] gallium/util: implement util_format_is_yuv
This adds a helper to check if a pipe format is in YUV color space. Drivers want to know about this, as YUV mostly needs special handling. Signed-off-by: Lucas Stach--- src/gallium/auxiliary/util/u_format.h | 12 1 file changed, 12 insertions(+) diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h index 88bfd72d0538..e497b4b3375a 100644 --- a/src/gallium/auxiliary/util/u_format.h +++ b/src/gallium/auxiliary/util/u_format.h @@ -557,6 +557,18 @@ util_format_is_depth_and_stencil(enum pipe_format format) util_format_has_stencil(desc); } +static inline boolean +util_format_is_yuv(enum pipe_format format) +{ + const struct util_format_description *desc = util_format_description(format); + + assert(desc); + if (!desc) { + return FALSE; + } + + return desc->colorspace == UTIL_FORMAT_COLORSPACE_YUV; +} /** * Calculates the depth format type based upon the incoming format description. -- 2.16.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev