All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Longerbeam <slongerbeam@gmail.com>
To: "Philipp Zabel" <p.zabel@pengutronix.de>,
	"Krzysztof Hałasa" <khalasa@piap.pl>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Hans Verkuil" <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org,
	Steve Longerbeam <steve_longerbeam@mentor.com>
Subject: [PATCH v2 09/10] media: imx-csi: Move crop/compose reset after filling default mbus fields
Date: Thu, 31 May 2018 17:30:48 -0700	[thread overview]
Message-ID: <1527813049-3231-10-git-send-email-steve_longerbeam@mentor.com> (raw)
In-Reply-To: <1527813049-3231-1-git-send-email-steve_longerbeam@mentor.com>

If caller passes un-initialized field type V4L2_FIELD_ANY to CSI
sink pad, the reset CSI crop window would not be correct, because
the crop window depends on the current input field type. To fix move
the reset of crop and compose windows to after the call to
imx_media_fill_default_mbus_fields().

Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
---
 drivers/staging/media/imx/imx-media-csi.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c
index c878a00..471130a 100644
--- a/drivers/staging/media/imx/imx-media-csi.c
+++ b/drivers/staging/media/imx/imx-media-csi.c
@@ -1358,17 +1358,6 @@ static void csi_try_fmt(struct csi_priv *priv,
 				      W_ALIGN, &sdformat->format.height,
 				      MIN_H, MAX_H, H_ALIGN, S_ALIGN);
 
-		/* Reset crop and compose rectangles */
-		crop->left = 0;
-		crop->top = 0;
-		crop->width = sdformat->format.width;
-		crop->height = sdformat->format.height;
-		csi_try_crop(priv, crop, cfg, &sdformat->format, upstream_ep);
-		compose->left = 0;
-		compose->top = 0;
-		compose->width = crop->width;
-		compose->height = crop->height;
-
 		*cc = imx_media_find_mbus_format(sdformat->format.code,
 						 CS_SEL_ANY, true);
 		if (!*cc) {
@@ -1385,6 +1374,17 @@ static void csi_try_fmt(struct csi_priv *priv,
 			&sdformat->format, infmt,
 			priv->active_output_pad == CSI_SRC_PAD_DIRECT);
 
+		/* Reset crop and compose rectangles */
+		crop->left = 0;
+		crop->top = 0;
+		crop->width = sdformat->format.width;
+		crop->height = sdformat->format.height;
+		csi_try_crop(priv, crop, cfg, &sdformat->format, upstream_ep);
+		compose->left = 0;
+		compose->top = 0;
+		compose->width = crop->width;
+		compose->height = crop->height;
+
 		break;
 	}
 }
-- 
2.7.4

  parent reply	other threads:[~2018-06-01  0:31 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-01  0:30 [PATCH v2 00/10] imx-media: Fixes for interlaced capture Steve Longerbeam
2018-06-01  0:30 ` [PATCH v2 01/10] media: imx-csi: Pass sink pad field to ipu_csi_init_interface Steve Longerbeam
2018-06-01 13:22   ` Philipp Zabel
2018-06-02 16:30     ` Steve Longerbeam
2018-06-04  5:25       ` Krzysztof Hałasa
2018-06-04  8:32         ` Philipp Zabel
2018-06-04 16:47         ` Steve Longerbeam
2018-06-05  4:54           ` Krzysztof Hałasa
2018-06-01  0:30 ` [PATCH v2 02/10] gpu: ipu-csi: Check for field type alternate Steve Longerbeam
2018-06-01 13:26   ` Philipp Zabel
2018-06-01  0:30 ` [PATCH v2 03/10] media: videodev2.h: Add macros V4L2_FIELD_IS_{INTERLACED|SEQUENTIAL} Steve Longerbeam
2018-06-01  0:30 ` [PATCH v2 04/10] media: imx: interweave only for sequential input/interlaced output fields Steve Longerbeam
2018-06-01 13:33   ` Philipp Zabel
2018-06-02 16:32     ` Steve Longerbeam
2018-06-04  5:35     ` Krzysztof Hałasa
2018-06-04  8:27       ` Philipp Zabel
2018-06-05  0:56         ` Steve Longerbeam
2018-06-05  8:07           ` Philipp Zabel
2018-06-05 10:43             ` Krzysztof Hałasa
2018-06-05 19:00             ` Steve Longerbeam
2018-06-06  5:48               ` Krzysztof Hałasa
2018-06-06  9:05               ` Philipp Zabel
2018-06-07  3:37                 ` Steve Longerbeam
2018-06-07  7:43                   ` Krzysztof Hałasa
2018-06-06  6:26           ` Krzysztof Hałasa
2018-06-01  0:30 ` [PATCH v2 05/10] media: imx: interweave and odd-chroma-row skip are incompatible Steve Longerbeam
2018-06-01  0:30 ` [PATCH v2 06/10] media: imx: Fix field setting logic in try_fmt Steve Longerbeam
2018-06-01 13:34   ` Philipp Zabel
2018-06-02 16:32     ` Steve Longerbeam
2018-06-01  0:30 ` [PATCH v2 07/10] media: imx-csi: Allow skipping odd chroma rows for YVU420 Steve Longerbeam
2018-06-01 13:35   ` Philipp Zabel
2018-06-01  0:30 ` [PATCH v2 08/10] media: imx: vdic: rely on VDIC for correct field order Steve Longerbeam
2018-06-01  0:30 ` Steve Longerbeam [this message]
2018-06-01  0:30 ` [PATCH v2 10/10] media: imx.rst: Update doc to reflect fixes to interlaced capture Steve Longerbeam
2018-06-01 13:44   ` Philipp Zabel
2018-06-02 17:58     ` Steve Longerbeam
2018-06-02 18:44     ` Steve Longerbeam
2018-06-04  5:52       ` Krzysztof Hałasa
2018-06-04  8:34       ` 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=1527813049-3231-10-git-send-email-steve_longerbeam@mentor.com \
    --to=slongerbeam@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hverkuil@xs4all.nl \
    --cc=khalasa@piap.pl \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=steve_longerbeam@mentor.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.