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: Wed, 05 Sep 2018 15:20:58 +0200 [thread overview]
Message-ID: <1536153658.4084.7.camel@pengutronix.de> (raw)
In-Reply-To: <b2968b6b-b6ab-dfbe-b51c-5c4e73786039@xs4all.nl>
On Wed, 2018-09-05 at 14:50 +0200, Hans Verkuil wrote:
[...]
> > +config VIDEO_IMX_PXP
> > + tristate "i.MX Pixel Pipeline (PXP)"
> > + depends on VIDEO_DEV && VIDEO_V4L2 && (ARCH_MXC || COMPILE_TEST)
> > + select VIDEOBUF2_DMA_CONTIG
> > + select V4L2_MEM2MEM_DEV
> > + help
> > + The i.MX Pixel Pipeline is a memory-to-memory engine for scaling,
> > + color space conversion, and rotation.
>
> Weird indentation.
Huh, a tab got replaced with spaces.
[...]
> > +/* Per queue */
> > +#define MEM2MEM_DEF_NUM_BUFS VIDEO_MAX_FRAME
> > +/* In bytes, per queue */
> > +#define MEM2MEM_VID_MEM_LIMIT (16 * 1024 * 1024)
>
> These two defines are now unused and can be removed.
Will be gone in v3.
[...]
> > +static enum v4l2_ycbcr_encoding pxp_default_ycbcr_enc(struct pxp_ctx *ctx)
> > +{
> > + if (ctx->xfer_func)
> > + return V4L2_MAP_YCBCR_ENC_DEFAULT(ctx->colorspace);
> > + else
> > + return V4L2_YCBCR_ENC_DEFAULT;
> > +}
> > +
> > +static enum v4l2_quantization
> > +pxp_default_quant(struct pxp_ctx *ctx, u32 pixelformat,
> > + enum v4l2_ycbcr_encoding ycbcr_enc)
> > +{
> > + bool is_rgb = !pxp_v4l2_pix_fmt_is_yuv(pixelformat);
> > +
> > + if (ctx->xfer_func)
>
> Why check for xfer_func? (same question for the previous function)
That way if userspace sets
V4L2_XFER_FUNC_DEFAULT
V4L2_YCBCR_ENC_DEFAULT
V4L2_QUANTIZATION_DEFAULT
on the output queue, it will get
V4L2_XFER_FUNC_DEFAULT
V4L2_YCBCR_ENC_DEFAULT
V4L2_QUANTIZATION_DEFAULT
on the capture queue.
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.
[...]
> > +static int pxp_remove(struct platform_device *pdev)
> > +{
> > + struct pxp_dev *dev = platform_get_drvdata(pdev);
> > +
> > + writel(BM_PXP_CTRL_CLKGATE, dev->mmio + HW_PXP_CTRL_SET);
> > + writel(BM_PXP_CTRL_SFTRST, dev->mmio + HW_PXP_CTRL_SET);
> > +
> > + clk_disable_unprepare(dev->clk);
> > +
> > + v4l2_info(&dev->v4l2_dev, "Removing " MEM2MEM_NAME);
> > + v4l2_m2m_release(dev->m2m_dev);
> > + video_unregister_device(&dev->vfd);
>
> Swap these two lines: first unreg the device, Then call m2m_release.
Ok, thank you.
regards
Philipp
next prev parent reply other threads:[~2018-09-05 13:20 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 [this message]
2018-09-06 7:57 ` Hans Verkuil
2018-09-06 9:00 ` Philipp Zabel
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=1536153658.4084.7.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).