[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cce30b6ab6b15fe3e82f4ed79371ba4c81730249.camel@pengutronix.de>
Date: Wed, 02 Dec 2020 16:41:01 +0100
From: Philipp Zabel <p.zabel@...gutronix.de>
To: "Mirela Rabulea (OSS)" <mirela.rabulea@....nxp.com>,
mchehab@...nel.org, hverkuil-cisco@...all.nl, shawnguo@...nel.org,
robh+dt@...nel.org
Cc: paul.kocialkowski@...tlin.com, linux-media@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-imx@....com,
s.hauer@...gutronix.de, aisheng.dong@....com,
daniel.baluta@....com, robert.chiras@....com,
laurentiu.palcu@....com, mark.rutland@....com,
devicetree@...r.kernel.org, ezequiel@...labora.com,
laurent.pinchart+renesas@...asonboard.com,
niklas.soderlund+renesas@...natech.se,
dafna.hirschfeld@...labora.com,
Mirela Rabulea <mirela.rabulea@....com>
Subject: Re: [PATCH v5 10/10] media: imx-jpeg: Use v4l2 jpeg helpers in
mxc-jpeg
On Thu, 2020-11-12 at 05:05 +0200, Mirela Rabulea (OSS) wrote:
> From: Mirela Rabulea <mirela.rabulea@....com>
>
> Use v4l2_jpeg_parse_header in mxc_jpeg_parse, remove the old
> parsing way, which was duplicated in other jpeg drivers.
>
> Signed-off-by: Mirela Rabulea <mirela.rabulea@....com>
> ---
> Changes in v5:
> This was patch 11 in previous version
> Change triggered by patch 7 (app14 data change struct -> int)
>
> drivers/media/platform/imx-jpeg/Kconfig | 1 +
> drivers/media/platform/imx-jpeg/mxc-jpeg.c | 267 ++++++---------------
> drivers/media/platform/imx-jpeg/mxc-jpeg.h | 26 +-
> 3 files changed, 80 insertions(+), 214 deletions(-)
>
> diff --git a/drivers/media/platform/imx-jpeg/Kconfig b/drivers/media/platform/imx-jpeg/Kconfig
> index 7cc89e5eff90..d875f7c88cda 100644
> --- a/drivers/media/platform/imx-jpeg/Kconfig
> +++ b/drivers/media/platform/imx-jpeg/Kconfig
> @@ -4,6 +4,7 @@ config VIDEO_IMX8_JPEG
> depends on VIDEO_DEV && VIDEO_V4L2
> select VIDEOBUF2_DMA_CONTIG
> select V4L2_MEM2MEM_DEV
> + select V4L2_JPEG_HELPER
> default m
> help
> This is a video4linux2 driver for the i.MX8 QXP/QM integrated
> diff --git a/drivers/media/platform/imx-jpeg/mxc-jpeg.c b/drivers/media/platform/imx-jpeg/mxc-jpeg.c
> index 8f297803f2c3..d3b7581ce46e 100644
> --- a/drivers/media/platform/imx-jpeg/mxc-jpeg.c
> +++ b/drivers/media/platform/imx-jpeg/mxc-jpeg.c
[...]
> @@ -1448,12 +1317,11 @@ static int mxc_jpeg_parse(struct mxc_jpeg_ctx *ctx,
> * encoded with 3 components have RGB colorspace, see Recommendation
> * ITU-T T.872 chapter 6.5.3 APP14 marker segment for colour encoding
> */
> - if (img_fmt == MXC_JPEG_YUV444 && app14 && app14_transform == 0)
> - img_fmt = MXC_JPEG_RGB;
> -
> - if (mxc_jpeg_imgfmt_to_fourcc(img_fmt, &fourcc)) {
> - dev_err(dev, "Fourcc not found for %d", img_fmt);
> - return -EINVAL;
> + if (fourcc == V4L2_PIX_FMT_YUV24 || fourcc == V4L2_PIX_FMT_RGB24) {
> + if (header.app14_tf == 0)
This is what I meant in patch 7, I think it would be more clear to have
an enum value that says "RGB color coding" than to rely on the reader to
know what the value 0 means.
> + fourcc = V4L2_PIX_FMT_RGB24;
> + else
> + fourcc = V4L2_PIX_FMT_YUV24;
> }
>
> /*
>
Otherwise this patch looks fine to me.
regards
Philipp
Powered by blists - more mailing lists