Received: by 10.223.164.202 with SMTP id h10csp128121wrb; Wed, 22 Nov 2017 17:17:11 -0800 (PST) X-Google-Smtp-Source: AGs4zMbBgmFBrGhY0uv7rwiheoNzBQoUhv/XSpxzOMhdTd2O/Mu88ltRlXHO+65lRG8qSQkUWeB9 X-Received: by 10.84.237.9 with SMTP id s9mr22804596plk.417.1511399831625; Wed, 22 Nov 2017 17:17:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511399831; cv=none; d=google.com; s=arc-20160816; b=wlW6yn1OJt0CNKFzFT5rl2NSYETdirEtWdKkAkI7mWAhpEALLCWg2zlH3xxxDySDyD wuE2zxRl/ojZPyZH1k1aExkg3DVP8Sg8pHlCZpIlSmk33Y+cm+v+V+/ESVcSFODqyLWR d/UyAg7w2Px9s25B6Jz9Dk3Lg8pG1aHpPhdDKSl6MOJnAwx5/NtCC+7DtVPVrE/DO23B hqxci7Cn5oJocikDVyh2yAY7gdsODo2FeNW6fb7dIT2crmHkHcMtHvsNRAJ4bcBhjNS8 /4tfVhxpiwaYmxh7U1CfgKMglfa2hM1JRIMBaW/1h2+kMxFkTQ7GwZptvzcoNxccE1dK fLYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:arc-authentication-results; bh=jqLWY7VWQUedPUmKFjpm9I/93P6CQwe3BPHy8vAWmFE=; b=l8FWi8V7QXiTxIAkeDpeOLGNv2b7g1It9wz42cnWr2+ve2sP7Dzpoexf50Cjsps2Na c1OShmSRMxxgTe7omkOoD616dNmiRP5ZrhkBtolq2xgty1YW374OJnQHTkZfahCSTzFx 89FhSuJ3Uj06u2i0bK8WIfcTFClk+uBxRFBmo8FRM3lO26mM04UQPlSedqD3p558lpcS eDsJ/O6IZFXVmgvVBEo7AbQ0whWv/yWhs2OcEillCfsqIYdVcvPGBZ0/6EWJLBeEP4mr gtaMmr5CLRg3e9aosGfH9DOxp4Mpk5R3qJhDLlvODWDwe4m2A93uC79AnWnDVkcpE2he fkHA== 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 c2si12749136pgp.117.2017.11.22.17.16.38; Wed, 22 Nov 2017 17:17:11 -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 S1752142AbdKWBPF (ORCPT + 77 others); Wed, 22 Nov 2017 20:15:05 -0500 Received: from out20-110.mail.aliyun.com ([115.124.20.110]:39010 "EHLO out20-110.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751732AbdKWBPD (ORCPT ); Wed, 22 Nov 2017 20:15:03 -0500 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.02466149|-1;CH=green;FP=0|0|0|0|0|0|0|0;HT=e02c03306;MF=yong.deng@magewell.com;NM=1;PH=DS;RN=24;RT=24;SR=0;TI=SMTPD_---.9TyRA2V_1511399683; Received: from John(mailfrom:yong.deng@magewell.com ip:58.213.29.2) by smtp.aliyun-inc.com(10.147.41.143); Thu, 23 Nov 2017 09:14:44 +0800 Date: Thu, 23 Nov 2017 09:14:44 +0800 From: Yong To: Maxime Ripard 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: <20171123091444.4bed66dffeb36ecea8dfa706@magewell.com> In-Reply-To: <20171122094526.nqxfy2e5jzxw7nl4@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> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Thu__23_Nov_2017_09_14_44_+0800_Po+9.1tqSRKHktjD" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a multi-part message in MIME format. --Multipart=_Thu__23_Nov_2017_09_14_44_+0800_Po+9.1tqSRKHktjD Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi, On Wed, 22 Nov 2017 10:45:26 +0100 Maxime Ripard wrote: > Hi, > > 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 interface > > > > and CSI1 is used for parallel interface. This is not documented in > > > > datasheet but by testing and guess. > > > > > > > > This patch implement a v4l2 framework driver for it. > > > > > > > > Currently, the driver only support the parallel interface. MIPI-CSI2, > > > > ISP's support are not included in this patch. > > > > > > > > Signed-off-by: Yong Deng > > > > > > Thanks again for this driver. > > > > > > It seems like at least this iteration is behaving in a weird way with > > > DMA transfers for at least YU12 and NV12 (and I would assume YV12). > > > > > > 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 NV12 > > > -s 640x480 $(media-c tl -e 'sun6i-csi')) will end up in a panic. > > > > > > 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) > > > > > > 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 copied > > > there. > > > > > > 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? > > > > 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. > > Ok, that's good to know. > > > > Given that they all are planar formats and YUYV and the likes work > > > just fine, maybe we can leave them aside for now? > > > > V4L2_PIX_FMT_YUV422P and V4L2_PIX_FMT_YUYV is OK, and V4L2_PIX_FMT_NV12 > > is bad? It's really weird. > > > > What's your input bus code format, type and width? > > The sensor is an ov5640, so the MBUS code for the bus is > MEDIA_BUS_FMT_YUYV8_2X8. Did you test on V3s? I haven't tested it with MEDIA_BUS_FMT_YUYV8_2X8. The Allwinner CSI's DMA is definitely weird. Ondřej Jirman thought that CSI has an internal queue (Ondřej's commit has explained in detail). I think CSI just pick up the buffer address before the frame done interrupt triggered. The patch in attachment can deal with this. You can see if it is useful to solve your problem. Thanks, Yong --Multipart=_Thu__23_Nov_2017_09_14_44_+0800_Po+9.1tqSRKHktjD Content-Type: application/octet-stream; name="sun6i_csi_fix_writing_to_incorrect_buffer.patch" Content-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