From patchwork Sun Mar 12 20:22:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 9619545 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 BFF3E604A9 for ; Sun, 12 Mar 2017 20:24:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0D1E283E7 for ; Sun, 12 Mar 2017 20:24:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3D6128446; Sun, 12 Mar 2017 20:24:30 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2EAA5283E7 for ; Sun, 12 Mar 2017 20:24:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OCMJ51nElxNP2K33aWtnSqsVUrV0aHehSajKaoaUUyg=; b=G4jA5of7ep92hQ uPBYL97gAbmF6uVYExV/177vU6Xqqi8nbTkfkC4VZuWuipgW4xC8V3QtFZ3XuAMfTVeF9wBwUEPLj zvAy0KRduUZ7KLvd9WIQL2KGwqg6XwtrIf6Qjwpu+76S/H6atoTVromU0pMfwUhRkkIA3Ub0ss5/+ 6zwA7gPs6YnVxz1aqOUbNezTOgZTnDVEswf3tx6TyT7JdY0RYDNas7WcG9e14cnRT6LYTeB/EJ37k R0KWycSKIfQnHWAAl2F8EbjqxF4T/AhD4Nvey5lg7UI+/M2WW6T5Mh4C26tWHe57opuBbtdL9S4ZY ApiodrfN/fywpSEBsvug==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cnA2X-0003YG-CC; Sun, 12 Mar 2017 20:24:29 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cnA24-0003Wk-WA for linux-arm-kernel@lists.infradead.org; Sun, 12 Mar 2017 20:24:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2014; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=I/UtYiy77GjxDETcLw4rvXPtSl9vmBRRqg8O+35Zqc0=; b=l4UWBAy7uZveaVMJAW6Bz4QanmiKCvyj18/KjxZUG9FRVEni5AzA/H5FuP+dRH+oWYNOjVo65zetvj7Ywyy1e1UMiJAxR7neJ/sGFDT06dNDwjJSfxuiRzigGWREBpN22DnoQly3GeJa7Iq9tUXtNl++b4lzrMZXKThoVBuuJqs=; Received: from n2100.armlinux.org.uk ([fd8f:7570:feb6:1:214:fdff:fe10:4f86]:39307) by pandora.armlinux.org.uk with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1cnA0r-00080X-PP; Sun, 12 Mar 2017 20:22:46 +0000 Received: from linux by n2100.armlinux.org.uk with local (Exim 4.76) (envelope-from ) id 1cnA0n-0003Ym-Jj; Sun, 12 Mar 2017 20:22:41 +0000 Date: Sun, 12 Mar 2017 20:22:41 +0000 From: Russell King - ARM Linux To: Steve Longerbeam Subject: Re: [PATCH v5 00/39] i.MX Media Driver Message-ID: <20170312202240.GT21222@n2100.armlinux.org.uk> References: <1489121599-23206-1-git-send-email-steve_longerbeam@mentor.com> <20170310201356.GA21222@n2100.armlinux.org.uk> <47542ef8-3e91-b4cd-cc65-95000105f172@gmail.com> <20170312195741.GS21222@n2100.armlinux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170312_132401_704931_7F9BCECE X-CRM114-Status: GOOD ( 18.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, andrew-ct.chen@mediatek.com, minghsiu.tsai@mediatek.com, sakari.ailus@linux.intel.com, nick@shmanahar.org, songjun.wu@microchip.com, hverkuil@xs4all.nl, Steve Longerbeam , pavel@ucw.cz, robert.jarzmik@free.fr, devel@driverdev.osuosl.org, markus.heiser@darmarIT.de, laurent.pinchart+renesas@ideasonboard.com, shuah@kernel.org, geert@linux-m68k.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, kernel@pengutronix.de, arnd@arndb.de, mchehab@kernel.org, bparrot@ti.com, robh+dt@kernel.org, horms+renesas@verge.net.au, tiffany.lin@mediatek.com, linux-arm-kernel@lists.infradead.org, niklas.soderlund+renesas@ragnatech.se, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, jean-christophe.trotin@st.com, p.zabel@pengutronix.de, fabio.estevam@nxp.com, shawnguo@kernel.org, sudipm.mukherjee@gmail.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Sun, Mar 12, 2017 at 01:05:06PM -0700, Steve Longerbeam wrote: > > > On 03/12/2017 12:57 PM, Russell King - ARM Linux wrote: > >On Sat, Mar 11, 2017 at 04:30:53PM -0800, Steve Longerbeam wrote: > >>If it's too difficult to get the imx219 csi-2 transmitter into the > >>LP-11 state on power on, perhaps the csi-2 receiver can be a little > >>more lenient on the transmitter and make the LP-11 timeout a warning > >>instead of error-out. > >> > >>Can you try the attached change on top of the version 5 patchset? > >> > >>If that doesn't work then you're just going to have to fix the bug > >>in imx219. > > > >That patch gets me past that hurdle, only to reveal that there's another > >issue: > > Yeah, ipu_cpmem_set_image() failed because it doesn't recognize the > bayer formats. Wait, didn't we fix this already? I've lost track. > Ah, right, we were going to move this support into the IPUv3 driver, > but in the meantime I think you had some patches to get around this. What I had was this patch for your v3. I never got to testing your v4 because of the LP-11 problem. In v5, you've changed to propagate the ipu_cpmem_set_image() error code to avoid the resulting corruption, but that leaves the other bits of this patch unaddressed, along my "media: imx: smfc: add support for bayer formats" patch. Your driver basically has no support for bayer formats. diff --git a/drivers/staging/media/imx/imx-smfc.c b/drivers/staging/media/imx/imx-smfc.c index 313732201a52..4351c0365cf4 100644 --- a/drivers/staging/media/imx/imx-smfc.c +++ b/drivers/staging/media/imx/imx-smfc.c @@ -234,11 +234,6 @@ static void imx_smfc_setup_channel(struct imx_smfc_priv *priv) buf1 = imx_media_dma_buf_get_next_queued(priv->out_ring); priv->next = buf1; - image.phys0 = buf0->phys; - image.phys1 = buf1->phys; - ipu_cpmem_set_image(priv->smfc_ch, &image); - - switch (image.pix.pixelformat) { case V4L2_PIX_FMT_SBGGR8: case V4L2_PIX_FMT_SGBRG8: @@ -247,6 +242,10 @@ static void imx_smfc_setup_channel(struct imx_smfc_priv *priv) burst_size = 8; passthrough = true; passthrough_bits = 8; + ipu_cpmem_set_resolution(priv->smfc_ch, image.rect.width, image.rect.height); + ipu_cpmem_set_stride(priv->smfc_ch, image.pix.bytesperline); + ipu_cpmem_set_buffer(priv->smfc_ch, 0, buf0->phys); + ipu_cpmem_set_buffer(priv->smfc_ch, 1, buf1->phys); break; case V4L2_PIX_FMT_SBGGR16: @@ -256,9 +255,17 @@ static void imx_smfc_setup_channel(struct imx_smfc_priv *priv) burst_size = 4; passthrough = true; passthrough_bits = 16; + ipu_cpmem_set_resolution(priv->smfc_ch, image.rect.width, image.rect.height); + ipu_cpmem_set_stride(priv->smfc_ch, image.pix.bytesperline); + ipu_cpmem_set_buffer(priv->smfc_ch, 0, buf0->phys); + ipu_cpmem_set_buffer(priv->smfc_ch, 1, buf1->phys); break; default: + image.phys0 = buf0->phys; + image.phys1 = buf1->phys; + ipu_cpmem_set_image(priv->smfc_ch, &image); + burst_size = (outfmt->width & 0xf) ? 8 : 16; /*