Re: [PATCH 4/6] media: imx-csi: Enable interlaced scan for field type alternate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 28/05/18 08:00, Philipp Zabel wrote:
On Fri, 2018-05-25 at 16:53 -0700, Steve Longerbeam wrote:
Interlaced scan, a.k.a. interweave, should be enabled at the CSI IDMAC
output pad if the input field type is 'alternate' (in addition to field
types 'seq-tb' and 'seq-bt').

Which brings up whether V4L2_FIELD_HAS_BOTH() macro should be used
to determine enabling interlaced/interweave scan. That macro
includes the 'interlaced' field types, and in those cases the data
is already interweaved with top/bottom field lines. A heads-up for
now that this if statement may need to call V4L2_FIELD_IS_SEQUENTIAL()
instead, I have no sensor hardware that sends 'interlaced' data, so can't
test.

I agree, the check here should be IS_SEQUENTIAL || ALTERNATE, and
interlaced_scan should also be enabled if image.pix.field is
INTERLACED_TB/BT.
And for INTERLACED_TB/BT input, the logic should be inverted: then we'd
have to enable interlaced_scan whenever image.pix.field is SEQ_BT/TB.

Hi Philipp,

If your intent here is to de-interweave the two fields back to two sequential fields, I don't believe the IDMAC operation would achieve that. It's basically line stride doubling and a line offset for the lines in the 2nd half of the incoming frame, right?

Regards,
Ian

regards
Philipp

Signed-off-by: Steve Longerbeam <steve_longerbeam@xxxxxxxxxx>
---
  drivers/staging/media/imx/imx-media-csi.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c
index 9bc555c..eef3483 100644
--- a/drivers/staging/media/imx/imx-media-csi.c
+++ b/drivers/staging/media/imx/imx-media-csi.c
@@ -477,7 +477,8 @@ static int csi_idmac_setup_channel(struct csi_priv *priv)
  	ipu_smfc_set_burstsize(priv->smfc, burst_size);
if (image.pix.field == V4L2_FIELD_NONE &&
-	    V4L2_FIELD_HAS_BOTH(infmt->field))
+	    (V4L2_FIELD_HAS_BOTH(infmt->field) ||
+	     infmt->field == V4L2_FIELD_ALTERNATE))
  		ipu_cpmem_interlaced_scan(priv->idmac_ch,
  					  image.pix.bytesperline);



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux