From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AB7DC4361B for ; Thu, 10 Dec 2020 08:19:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0A52B23D68 for ; Thu, 10 Dec 2020 08:19:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387777AbgLJITG (ORCPT ); Thu, 10 Dec 2020 03:19:06 -0500 Received: from comms.puri.sm ([159.203.221.185]:35960 "EHLO comms.puri.sm" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387534AbgLJITF (ORCPT ); Thu, 10 Dec 2020 03:19:05 -0500 Received: from localhost (localhost [127.0.0.1]) by comms.puri.sm (Postfix) with ESMTP id EC5DFE11FD; Thu, 10 Dec 2020 00:17:54 -0800 (PST) Received: from comms.puri.sm ([127.0.0.1]) by localhost (comms.puri.sm [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BU_arEOzImWl; Thu, 10 Dec 2020 00:17:53 -0800 (PST) From: Martin Kepplinger Subject: question: CSI on imx8mq with (any) CSI2 camera / experience with mx6s_capture? To: "rogerio.silva@nxp.com" , Philipp Zabel , "slongerbeam@gmail.com" , Fabio Estevam , Laurent Pinchart Cc: "linux-arm-kernel@lists.infradead.org" , linux-media@vger.kernel.org, NXP Linux Team , "kernel@puri.sm" , Pengutronix Kernel Team Message-ID: <9e09ca8b-d1bc-eaa9-d296-c4ee98882c06@puri.sm> Date: Thu, 10 Dec 2020 09:17:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org hi, TL;DR: did you use the NXP "mx6s_capture" csi bridge driver with other cameras? I try to use a CSI2 camera (hi846 I'm writing a driver for) on imx8mq: Using NXP's CSI bridge driver https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/media/platform/mxc/capture/mx6s_capture.c?h=imx_5.4.0_8dxlphantom_er as well as the CSI driver itself: https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/media/platform/imx8/mxc-mipi-csi2_yav.c?h=imx_5.4.0_8dxlphantom_er works fine when using the ov5640 camera with this driver: https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/media/platform/mxc/capture/ov5640_mipi_v2.c?h=imx_5.4.0_8dxlphantom_er (I realize there is a CSI bridge driver in staging, but that need more work to be actually used. Of course after this the goal is to fix and use it; and mainline a CSI phy driver too.) Now I use said NXP's CSI drivers on mainline without problems with the ov5640. For the hi846 (as an example), I want to use a different pixelformat and CSI media bus format. Describing, say, MEDIA_BUS_FMT_SBGGR10_1X10 in the driver lets mx6s_capture find it; but as soon as I try to add a different pixelformat than V4L2_PIX_FMT_UYVY in: https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/media/platform/mxc/capture/mx6s_capture.c?h=imx_5.4.0_8dxlphantom_er#n244 streaming won't start anymore: "not negotiated, -4" and the "mx6s_vidioc_enum_framesizes" ioctl is not called anymore. Why so? I didn't find much when comparing strace from "gst-launch-1.0 v4l2src ! video/x-raw,width=1280,height=720 ! videoconvert ! xvimagesink" (which is how I test). When I simply use V4L2_PIX_FMT_UYVY I *do* get interrupts (in mx6s) but only "FIELD0_INT" (and drawing at this point suggests that buffer 1 is not yet full and "distorted" in a wrong format, which could explain why DMA is never completed in order to create a full frame). Now this is details, but the hi846 camera uses a 10bit CSI format and therefore I need to set PIXEL_BIT in cr1 too, but when I do that for example, I don't get "FIELD0_INT" anymore (only SFF_OR_INT and of course the "base address switching Change Err"). Do you have experience with using this driver with other cameras and can point me in a direction that might help me? If you want to look at the work-in-progress driver: https://source.puri.sm/martin.kepplinger/linux-next/-/blob/hi846/drivers/media/i2c/hi846.c thanks a lot, martin