From patchwork Thu May 10 08:19:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Krzysztof_Ha=C5=82asa?= X-Patchwork-Id: 10391381 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 291C660153 for ; Thu, 10 May 2018 08:28:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 193E3282E8 for ; Thu, 10 May 2018 08:28:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0CA07283AF; Thu, 10 May 2018 08:28:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35897282E8 for ; Thu, 10 May 2018 08:28:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933927AbeEJI2A (ORCPT ); Thu, 10 May 2018 04:28:00 -0400 Received: from ni.piap.pl ([195.187.100.4]:37364 "EHLO ni.piap.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756736AbeEJI16 (ORCPT ); Thu, 10 May 2018 04:27:58 -0400 X-Greylist: delayed 525 seconds by postgrey-1.27 at vger.kernel.org; Thu, 10 May 2018 04:27:58 EDT Received: from t19.piap.pl (OSB1819.piap.pl [10.0.9.19]) by ni.piap.pl (Postfix) with ESMTP id A87E14403E1; Thu, 10 May 2018 10:19:11 +0200 (CEST) From: khalasa@piap.pl (Krzysztof =?utf-8?Q?Ha=C5=82asa?=) To: Cc: Philipp Zabel , Steve Longerbeam , Tim Harvey Subject: i.MX6 IPU CSI analog video input on Ventana Date: Thu, 10 May 2018 10:19:11 +0200 Message-ID: MIME-Version: 1.0 X-KLMS-Rule-ID: 4 X-KLMS-Message-Action: skipped X-KLMS-AntiSpam-Status: not scanned, whitelist X-KLMS-AntiPhishing: not scanned, whitelist X-KLMS-AntiVirus: Kaspersky Security 8.0 for Linux Mail Server, version 8.0.1.721, not scanned, whitelist Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, I'm using analog PAL video in on GW53xx/54xx boards (through ADV7180 chip and 8-bit parallel CSI input, with (presumably) BT.656). I'm trying to upgrade from e.g. Linux 4.2 + Steve's older MX6 camera driver (which works fine) to v.4.16 with the recently merged driver. media-ctl -r -l '"adv7180 2-0020":0->"ipu2_csi1_mux":1[1], "ipu2_csi1_mux":2->"ipu2_csi1":0[1], "ipu2_csi1":2->"ipu2_csi1 capture":0[1]' media-ctl -V '"adv7180 2-0020":0[fmt:UYVY2X8 720x576 field:interlaced]' media-ctl -V '"ipu2_csi1_mux":1[fmt:UYVY2X8 720x576 field:interlaced]' media-ctl -V '"ipu2_csi1_mux":2[fmt:UYVY2X8 720x576 field:interlaced]' It seems there are issues, though: First, I can't find a way to change to PAL standard. *s_std() doesn't propagate from "ipu2_csi1 capture" through "ipu2_csi1_mux" to adv7180. For now I have just changed the default: Second, the image format information I'm getting out of "ipu2_csi1 capture" device is: open("/dev/video6") ioctl(VIDIOC_S_FMT, {V4L2_BUF_TYPE_VIDEO_CAPTURE, fmt.pix={704x576, pixelformat=NV12, V4L2_FIELD_INTERLACED} => fmt.pix={720x576, pixelformat=NV12, V4L2_FIELD_INTERLACED, bytesperline=720, sizeimage=622080, colorspace=V4L2_COLORSPACE_SMPTE170M}}) Now, the resulting image obtained via QBUF/DQBUF doesn't seem to be a single interlaced frame (like it was with older drivers). Actually, I'm getting the two fields, encoded with NV12 and concatenated together (I think it's V4L2_FIELD_SEQ_TB or V4L2_FIELD_SEQ_BT). What's wrong? Is it possible to get a real V4L2_FIELD_INTERLACED frame, so it can be passed straight to the CODA H.264 encoder? --- a/drivers/media/i2c/adv7180.c +++ b/drivers/media/i2c/adv7180.c @@ -1320,7 +1321,7 @@ static int adv7180_probe(struct i2c_client *client, state->irq = client->irq; mutex_init(&state->mutex); - state->curr_norm = V4L2_STD_NTSC; + state->curr_norm = V4L2_STD_PAL; if (state->chip_info->flags & ADV7180_FLAG_RESET_POWERED) state->powered = true; else