summaryrefslogtreecommitdiffstats
path: root/drivers/staging/media/imx/imx-ic-prpencvf.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-02-15 05:26:40 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-03-11 11:59:47 +0100
commit0d966feb6bd087fd8392cee0ef76475714c162a4 (patch)
treed89812deda49d3de70941ceb84e30578311f4a14 /drivers/staging/media/imx/imx-ic-prpencvf.c
parent1f4e7241704baa2f9c52627439a32a92625e1f06 (diff)
downloadlinux-0d966feb6bd087fd8392cee0ef76475714c162a4.tar.bz2
media: imx: capture: Store v4l2_pix_format in imx_media_video_dev
The imx_media_video_dev structure stores the active format on the video node in an instance of v4l2_format. This wastes memory when all we need is the information contained in the smaller v4l2_pix_format sub-structure. Replace v4l2_format by v4l2_pix_format to save memory. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging/media/imx/imx-ic-prpencvf.c')
-rw-r--r--drivers/staging/media/imx/imx-ic-prpencvf.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/staging/media/imx/imx-ic-prpencvf.c b/drivers/staging/media/imx/imx-ic-prpencvf.c
index 47df1a5a1ae8..adb1a09e59d2 100644
--- a/drivers/staging/media/imx/imx-ic-prpencvf.c
+++ b/drivers/staging/media/imx/imx-ic-prpencvf.c
@@ -204,7 +204,7 @@ static void prp_vb2_buf_done(struct prp_priv *priv, struct ipuv3_channel *ch)
done = priv->active_vb2_buf[priv->ipu_buf_num];
if (done) {
- done->vbuf.field = vdev->fmt.fmt.pix.field;
+ done->vbuf.field = vdev->fmt.field;
done->vbuf.sequence = priv->frame_sequence;
vb = &done->vbuf.vb2_buf;
vb->timestamp = ktime_get_ns();
@@ -229,7 +229,7 @@ static void prp_vb2_buf_done(struct prp_priv *priv, struct ipuv3_channel *ch)
ipu_idmac_clear_buffer(ch, priv->ipu_buf_num);
if (priv->interweave_swap && ch == priv->out_ch)
- phys += vdev->fmt.fmt.pix.bytesperline;
+ phys += vdev->fmt.bytesperline;
ipu_cpmem_set_buffer(ch, priv->ipu_buf_num, phys);
}
@@ -362,7 +362,7 @@ static int prp_setup_channel(struct prp_priv *priv,
ipu_cpmem_zero(channel);
memset(&image, 0, sizeof(image));
- image.pix = vdev->fmt.fmt.pix;
+ image.pix = vdev->fmt;
image.rect = vdev->compose;
/*
@@ -457,7 +457,7 @@ static int prp_setup_rotation(struct prp_priv *priv)
int ret;
infmt = &priv->format_mbus[PRPENCVF_SINK_PAD];
- outfmt = &vdev->fmt.fmt.pix;
+ outfmt = &vdev->fmt;
incc = priv->cc[PRPENCVF_SINK_PAD];
outcc = vdev->cc;
@@ -586,7 +586,7 @@ static int prp_setup_norotation(struct prp_priv *priv)
int ret;
infmt = &priv->format_mbus[PRPENCVF_SINK_PAD];
- outfmt = &vdev->fmt.fmt.pix;
+ outfmt = &vdev->fmt;
incc = priv->cc[PRPENCVF_SINK_PAD];
outcc = vdev->cc;
@@ -665,17 +665,14 @@ static int prp_start(struct prp_priv *priv)
{
struct imx_ic_priv *ic_priv = priv->ic_priv;
struct imx_media_video_dev *vdev = priv->vdev;
- struct v4l2_pix_format *outfmt;
int ret;
ret = prp_get_ipu_resources(priv);
if (ret)
return ret;
- outfmt = &vdev->fmt.fmt.pix;
-
ret = imx_media_alloc_dma_buf(ic_priv->ipu_dev, &priv->underrun_buf,
- outfmt->sizeimage);
+ vdev->fmt.sizeimage);
if (ret)
goto out_put_ipu;