Received: by 10.223.164.202 with SMTP id h10csp3407484wrb; Sat, 25 Nov 2017 08:03:38 -0800 (PST) X-Google-Smtp-Source: AGs4zMaOI9pTIaAsCXMaIKjNtmXcOMUZZnwElu0iYeZfN5AQTGkDxjD8PyzDocuHpcYoTudQwduG X-Received: by 10.159.204.147 with SMTP id t19mr4635847plo.222.1511625818614; Sat, 25 Nov 2017 08:03:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511625818; cv=none; d=google.com; s=arc-20160816; b=EK2zzfTEe8R6ChvWRj1n0MzsLtNKb9QgQun6UvGpSnEFmC6GF6hW0CcTKVIosHf1Fg YfsVvwwYJ5xS2zeMwrMNne+x0U2OWeORaVUbaSe1C2ROlbf+r6D3x/kzplSAjiXZQSPX dumQ/r6l/f6JQ6KCm4DhJ7i5wYz5DU7FiT+PrhDuODytqi9rlt+DRCE2wzz4U8R7JRHN +vzbvFLWXi6V9hKGSA6TYxuZBjd/gOUPFuPdLhp7yB+pLgJnrSw94BOJ4kVv8VUcHUGt qWQQAobGHJe+Z/dquGzzpwYzNmCCWtlSCHClpvdCb06lFcVWaJWrn3z/K7k7X8XjjjSq Z1kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=2lHSvrkb45gxVd5BLD2qAaULuM9AMqODfRqwD+XZXBw=; b=V0HJwhaRyQnRL7+ROpXiXjWM6GTxr4nH7KmzCOqrUBMWLmFHGCVaEj+CueirsmyiRA s2JWFqiSqtl4vPuS9R4WV5lHYlIKDdlCBMRG6jxpTC4X3d6DOZuwLaksTPe0Msxr6jE8 y+51JnkqE46j6c07EomVwVqhDDC5YdLbBjUCQzoKSOW17sJQdS81TfFjhyDgyAw/8Qkg Rq+Uynn9MXXMfH76IVJL6v+yS6Md3GkW+D65LnWBfHZkhrup73G8FdwGcPtYQ0uvzPEL LugeRdzNzvhoHpaeXWA/UOjlA5UoPHrf6e29AJDedtxI0kcrQaNQeDhZLXP4QGleJQNT RvXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h1si20674693plh.3.2017.11.25.08.03.26; Sat, 25 Nov 2017 08:03:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751778AbdKYQCs (ORCPT + 80 others); Sat, 25 Nov 2017 11:02:48 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:37661 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751591AbdKYQCq (ORCPT ); Sat, 25 Nov 2017 11:02:46 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id E762620384; Sat, 25 Nov 2017 17:02:43 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LFbn-TOU-1-209-191.w86-201.abo.wanadoo.fr [86.201.56.191]) by mail.free-electrons.com (Postfix) with ESMTPSA id B35E620381; Sat, 25 Nov 2017 17:02:33 +0100 (CET) Date: Sat, 25 Nov 2017 17:02:33 +0100 From: Maxime Ripard To: Yong Cc: Mauro Carvalho Chehab , Rob Herring , Mark Rutland , Chen-Yu Tsai , Greg Kroah-Hartman , "David S. Miller" , Hans Verkuil , Arnd Bergmann , Hugues Fruchet , Yannick Fertre , Philipp Zabel , Benoit Parrot , Benjamin Gaignard , Jean-Christophe Trotin , Ramesh Shanmugasundaram , Minghsiu Tsai , Krzysztof Kozlowski , Robert Jarzmik , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: Re: [PATCH v2 1/3] media: V3s: Add support for Allwinner CSI. Message-ID: <20171125160233.skefdpkjy4peh7et@flea.lan> References: <1501131697-1359-1-git-send-email-yong.deng@magewell.com> <1501131697-1359-2-git-send-email-yong.deng@magewell.com> <20171121154827.5a35xa6zlqrrvkxx@flea.lan> <20171122093306.d30fe641f269d62daa1f66b4@magewell.com> <20171122094526.nqxfy2e5jzxw7nl4@flea.lan> <20171123091444.4bed66dffeb36ecea8dfa706@magewell.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3nh54js2ysxviywq" Content-Disposition: inline In-Reply-To: <20171123091444.4bed66dffeb36ecea8dfa706@magewell.com> User-Agent: NeoMutt/20171027 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --3nh54js2ysxviywq Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 23, 2017 at 09:14:44AM +0800, Yong wrote: > > On Wed, Nov 22, 2017 at 09:33:06AM +0800, Yong wrote: > > > > On Thu, Jul 27, 2017 at 01:01:35PM +0800, Yong Deng wrote: > > > > > Allwinner V3s SoC have two CSI module. CSI0 is used for MIPI inte= rface > > > > > and CSI1 is used for parallel interface. This is not documented in > > > > > datasheet but by testing and guess. > > > > >=20 > > > > > This patch implement a v4l2 framework driver for it. > > > > >=20 > > > > > Currently, the driver only support the parallel interface. MIPI-C= SI2, > > > > > ISP's support are not included in this patch. > > > > >=20 > > > > > Signed-off-by: Yong Deng > > > >=20 > > > > Thanks again for this driver. > > > >=20 > > > > It seems like at least this iteration is behaving in a weird way wi= th > > > > DMA transfers for at least YU12 and NV12 (and I would assume YV12). > > > >=20 > > > > Starting a transfer of multiple frames in either of these formats, > > > > using either ffmpeg (ffmpeg -f v4l2 -video_size 640x480 -framerate = 30 > > > > -i /dev/video0 output.mkv) or yavta (yavta -c80 -p -F --skip 0 -f N= V12 > > > > -s 640x480 $(media-c tl -e 'sun6i-csi')) will end up in a panic. > > > >=20 > > > > The panic seems to be generated with random data going into parts of > > > > the kernel memory, the pattern being in my case something like > > > > 0x8287868a which is very odd (always around 0x88) > > > >=20 > > > > It turns out that when you cover the sensor, the values change to > > > > around 0x28, so it really seems like it's pixels that have been cop= ied > > > > there. > > > >=20 > > > > I've looked quickly at the DMA setup, and it seems reasonable to > > > > me. Do you have the same issue on your side? Have you been able to > > > > test those formats using your hardware? > > >=20 > > > I had tested the following formats with BT1120 input: > > > V4L2_PIX_FMT_NV12 -> NV12 > > > V4L2_PIX_FMT_NV21 -> NV21 > > > V4L2_PIX_FMT_NV16 -> NV16 > > > V4L2_PIX_FMT_NV61 -> NV61 > > > V4L2_PIX_FMT_YUV420 -> YU12 > > > V4L2_PIX_FMT_YVU420 -> YV12 > > > V4L2_PIX_FMT_YUV422P -> 422P > > > And they all work fine. > >=20 > > Ok, that's good to know. > >=20 > > > > Given that they all are planar formats and YUYV and the likes work > > > > just fine, maybe we can leave them aside for now? > > >=20 > > > V4L2_PIX_FMT_YUV422P and V4L2_PIX_FMT_YUYV is OK, and V4L2_PIX_FMT_NV= 12 > > > is bad? It's really weird. > > >=20 > > > What's your input bus code format, type and width? > >=20 > > The sensor is an ov5640, so the MBUS code for the bus is > > MEDIA_BUS_FMT_YUYV8_2X8. >=20 > Did you test on V3s? No, this is on an H3, but that would be the first difference so far. > I haven't tested it with MEDIA_BUS_FMT_YUYV8_2X8. Ok, it's good to know that at least it works on your end, it's useful for us to debug things :) > The Allwinner CSI's DMA is definitely weird. Ond=C5=99ej Jirman thought > that CSI has an internal queue (Ond=C5=99ej's commit has explained in det= ail). > I think CSI just pick up the buffer address before the frame done=20 > interrupt triggered.=20 > The patch in attachment can deal with this. You can see if it is > useful to solve your problem. I'll test that on monday, thanks! Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com --3nh54js2ysxviywq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE0VqZU19dR2zEVaqr0rTAlCFNr3QFAloZlBUACgkQ0rTAlCFN r3RAaxAAiA3iBILt3eBf5t25Qcr1lhJdI2uh7MsblNlOCI8OY+3SmB9vjkqYWjcU wtQz11nUJ9a6vpxYGkTATJ6yPzCrKKE3HBuSkjR4p4fJvdgkiVoUu5sGQGIZmr64 5tOaSLp3/ce7LAjPES8nNZNi8LiQkNH93iDOJZSNV8wbSviJe+hU8YxhVw4XV5bJ E084qP+HE5lkse7qtOW8j/D+nZwcquJHOqO8vnQqNVYsWGL56gnmzQdciY8Yomjh 5BYXdTckdNX6fACx/phQVvXVPFdPaP3GT+Nh0m4Y1es62lhhlxND3celh9rugRvt t2yEooo9CtRthrafG7QISjGImi/Rj58y9ewbrhcmW7rg1BaOKkmZD5h0Ym+U/jqa 9QCOOfHTsZCPKpwhaWE3QF1OGLpPXWwKrnhXU42nBR1o2+uYsDM6hD6Lbc6Z98C0 wYmRGkEUidsGlnMUX7BMo4xGHikOUaf02UIl6LermHbYBxXliq/MhdrThR2meeVB 79OrPI6/s5HcHniyLk9UblP1Wsaa7ztocFLfL1WMEEoUms4kif3AKvXie3Q11g2L Q0dgVlCwEuSF+kW8lr3cXvuo94GzMMGEGAVoYl2iZ4vp8nYzLv5sIRHK1JaQ4FvG v1gknqV9BpTW0zobJex6yAZKE78olyQ5fwBodHgtqnxdBOO1Hxk= =VXwo -----END PGP SIGNATURE----- --3nh54js2ysxviywq-- From 1584817590015982961@xxx Thu Nov 23 01:17:11 +0000 2017 X-GM-THRID: 1574046305313556524 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread