linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: p.zabel@pengutronix.de (Philipp Zabel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/4] media: imx-pxp: add i.MX Pixel Pipeline driver
Date: Thu, 06 Sep 2018 11:00:10 +0200	[thread overview]
Message-ID: <1536224410.5357.2.camel@pengutronix.de> (raw)
In-Reply-To: <dbc31612-1686-c115-8618-309355363f27@xs4all.nl>

On Thu, 2018-09-06 at 09:57 +0200, Hans Verkuil wrote:
[...]
> > If userspace sets xfer_func explicitly, it will get the explicit default
> > ycbcr_enc and quantization values.
> > 
> > I think I did this to make v4l2-compliance at some point, but it could
> > be that the explicit output->capture colorimetry copy for RGB->RGB and
> > YUV->YUV conversions has me covered now.
> 
> This xfer_func test makes no sense. xfer_func is completely ignored by the
> driver (other than copying it from output to capture queue) since it can't
> make any changes to it anyway.
> 
> What you are trying to do in pxp_fixup_colorimetry() is to figure out the
> ycbcr_enc and quantization values for the capture queue.

Yes. I checked again without that. Since there is the forced out->cap
copy for RGB->RGB and YUV->YUV conversions in pxp_fixup_colorimetry,
v4l2-compliance is happy anyway. The pxp_default_quant/ycbcr_enc
functions are removed now.

> BTW, can you rename pxp_fixup_colorimetry to pxp_fixup_colorimetry_cap or
> something? Since it is specifically for the capture queue.

Ok.

> These values depend entirely on the capture queue pixelformat and on the
> colorspace and not on the xfer_func value.
> 
> So just do:
> 
> bool is_rgb = !pxp_v4l2_pix_fmt_is_yuv(dst_fourcc);
> *ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(ctx->colorspace);
> *quantization = V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb, ctx->colorspace,
> 					      *ycbcr_enc);

That's almost exactly what I ended up with, thank you.

> BTW, I just noticed that the V4L2_MAP_QUANTIZATION_DEFAULT macro no longer
> uses ycbcr_enc. The comment in videodev2.h should be updated. I can't
> change the define as it is used in applications (and we might need to
> depend on it again in the future anyway).
> 
> If this code will give you v4l2-compliance issues, please let me know.
> It shouldn't AFAICT.

There are no complaints anymore.

regards
Philipp

  reply	other threads:[~2018-09-06  9:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-05 10:00 [PATCH v2 0/4] i.MX PXP scaler/CSC driver Philipp Zabel
2018-09-05 10:00 ` [PATCH v2 1/4] dt-bindings: media: Add i.MX Pixel Pipeline binding Philipp Zabel
2018-09-05 17:10   ` Stefan Wahren
2018-09-06  9:00     ` Philipp Zabel
2018-09-05 10:00 ` [PATCH v2 2/4] ARM: dts: imx6ull: add pxp support Philipp Zabel
2018-09-05 10:00 ` [PATCH v2 4/4] MAINTAINERS: add entry for i.MX PXP media mem2mem driver Philipp Zabel
     [not found] ` <20180905100018.27556-4-p.zabel@pengutronix.de>
2018-09-05 12:50   ` [PATCH v2 3/4] media: imx-pxp: add i.MX Pixel Pipeline driver Hans Verkuil
2018-09-05 13:20     ` Philipp Zabel
2018-09-06  7:57       ` Hans Verkuil
2018-09-06  9:00         ` Philipp Zabel [this message]
2018-09-05 13:11   ` Fabio Estevam
2018-09-05 13:22     ` Philipp Zabel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1536224410.5357.2.camel@pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).