From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7E73224D6; Thu, 26 Sep 2024 07:13:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727334816; cv=none; b=YtdX9kAQgZ22piGcFG5u0FpDCmg8TqPiDK82K6X5uNnqEiQWensItfDZnPgduzKMiOM34PfVJbxj7oQ3uhhATFeYnnRpXST+u/dyRBEkF+cGPTsywo+Oq0wt27vmqcDKQaWWnTE0CIY2N04mM2glNi2KT8j6SA9+YW5JZ/RiGs4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727334816; c=relaxed/simple; bh=mxaesniZDobVQDHBLuX45uEc5YOxQMsEkUYYRn1BU5U=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=k/UuxnU2MxjB1OQaPLNoM99o0tNeGj11QPoam9GduAr6tliK9m/kBMuVzvfpCwLRXHtpABwTsM4ORkNGZDHATMmyMkX7p6E+gz72ghDKgi7BqaQl0FU18MTry68UeipfvLs75z+C4JmpK9NQIF6rxyNfE6f1dbOVQsYboPefQMQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=t71QJoRz; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="t71QJoRz" Received: from [192.168.88.20] (91-156-87-48.elisa-laajakaista.fi [91.156.87.48]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 809D08D4; Thu, 26 Sep 2024 09:12:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1727334724; bh=mxaesniZDobVQDHBLuX45uEc5YOxQMsEkUYYRn1BU5U=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=t71QJoRzOLEw29qfeCw81IqtOVhV9hv5IZLt3g7s4A+lP8CGTnN+mGSYHEXvYdBmX nWyYfra0jKDB+OmRJh0QM94S0Sfl1Y76484QLht0pNxFnvcCygEyTPOSFxIAZPw6/i CajO1wihAmPiiGarwlpNVDaL3qFncMsnFqFp7Mno= Message-ID: Date: Thu, 26 Sep 2024 10:13:29 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 0/4] media: raspberrypi: Support RPi5's CFE To: Mauro Carvalho Chehab , Raspberry Pi Kernel Maintenance , Broadcom internal kernel review list , Laurent Pinchart , Sakari Ailus , Jacopo Mondi , Naushir Patuck Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Kieran Bingham , Krzysztof Kozlowski , Rob Herring , Krzysztof Kozlowski , Florian Fainelli , Rob Herring , Krzysztof Kozlowski , Conor Dooley References: <20240910-rp1-cfe-v5-0-9ab4c4c8eace@ideasonboard.com> Content-Language: en-US From: Tomi Valkeinen Autocrypt: addr=tomi.valkeinen@ideasonboard.com; keydata= xsFNBE6ms0cBEACyizowecZqXfMZtnBniOieTuFdErHAUyxVgtmr0f5ZfIi9Z4l+uUN4Zdw2 w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VnwNGc6nq5IQDESH mvQcsFS7d3eGVI6eyjCFdcAO8eMAEQEAAcLBXwQYAQIACQUCTqazRwIbDAAKCRD6PaqMvJYe 9fA7EACS6exUedsBKmt4pT7nqXBcRsqm6YzT6DeCM8PWMTeaVGHiR4TnNFiT3otD5UpYQI7S suYxoTdHrrrBzdlKe5rUWpzoZkVK6p0s9OIvGzLT0lrb0HC9iNDWT3JgpYDnk4Z2mFi6tTbq xKMtpVFRA6FjviGDRsfkfoURZI51nf2RSAk/A8BEDDZ7lgJHskYoklSpwyrXhkp9FHGMaYII m9EKuUTX9JPDG2FTthCBrdsgWYPdJQvM+zscq09vFMQ9Fykbx5N8z/oFEUy3ACyPqW2oyfvU CH5WDpWBG0s5BALp1gBJPytIAd/pY/5ZdNoi0Cx3+Z7jaBFEyYJdWy1hGddpkgnMjyOfLI7B CFrdecTZbR5upjNSDvQ7RG85SnpYJTIin+SAUazAeA2nS6gTZzumgtdw8XmVXZwdBfF+ICof 92UkbYcYNbzWO/GHgsNT1WnM4sa9lwCSWH8Fw1o/3bX1VVPEsnESOfxkNdu+gAF5S6+I6n3a ueeIlwJl5CpT5l8RpoZXEOVtXYn8zzOJ7oGZYINRV9Pf8qKGLf3Dft7zKBP832I3PQjeok7F yjt+9S+KgSFSHP3Pa4E7lsSdWhSlHYNdG/czhoUkSCN09C0rEK93wxACx3vtxPLjXu6RptBw 3dRq7n+mQChEB1am0BueV1JZaBboIL0AGlSJkm23kw== In-Reply-To: <20240910-rp1-cfe-v5-0-9ab4c4c8eace@ideasonboard.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, On 10/09/2024 11:07, Tomi Valkeinen wrote: > This series adds support to the CFE hardware block on RaspberryPi 5. The > CFE (Camera Front End) contains a CSI-2 receiver and Front End, a small > ISP. > > To run this, you need the basic RPi5 kernel support plus relevant dts > changes to enable the cfe and camera. My work branch with everything > needed to run CFE can be found from: > > git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux.git rp1-cfe > > A few notes about the patches: > > - The original work was done by RaspberryPi, mostly by Naushir Patuck. > - The second video node only sets V4L2_CAP_META_CAPTURE instead of both > V4L2_CAP_META_CAPTURE and V4L2_CAP_META_CAPTURE like the other nodes. > This is a temporary workaround for userspace (libcamera), and > hopefully can be removed soon. > > I have tested this with: > - A single IMX219 sensor connected to the RPi5's CSI-2 port > - Arducam's UB960 FPD-Link board with four imx219 sensors connected > > Tomi > > Signed-off-by: Tomi Valkeinen > --- > Changes in v5: > - Add "depends on PM". The platforms that use CFE will always have PM in > practice, and it's not worth supporting both the PM and !PM cases as > it adds complexity to the driver. > - Link to v4: https://lore.kernel.org/r/20240904-rp1-cfe-v4-0-f1b5b3d69c81@ideasonboard.com Is this solution to the PM issue ok for everyone? It feels most sensible to me. Any other comments? Tomi > Changes in v4: > - Drop unnecessary clock-lanes from the DT bindings > - Drop unnecessary linux-media from MAINTAINERS entry > - Drop unnecessary conversion to bool with !! > - Don't set cap->bus_info in cfe_querycap() > - Make debugfs files not readable by the world > - Check the return value of v4l2_fwnode_endpoint_parse() > - Remove the code dealing with remote_ep_fwnode. Instead use > v4l2_create_fwnode_links_to_pad() and media_pad_remote_pad_unique() to > create the link and get the pad index. > - Add cfe/csi2/fe/dphy argument to the respective dbg/info/err print > macros. > - Drop some debug prints and add a few, clarifying the prints for > enabling and disabling the streams. > - Some cosmetic changes (linefeed, drop unnecessary assignment, move a > define) > - Link to v3: https://lore.kernel.org/r/20240815-rp1-cfe-v3-0-e15a979db327@ideasonboard.com > > Changes in v3: > - Based on v6.11-rc3. The PiSP BE series is now in upstream so no extra > dependencies are needed. > - Fixed cfe_remove() return value, as the .remove hook has changed > - Added Krzysztof's Rb. > - Link to v2: https://lore.kernel.org/r/20240620-rp1-cfe-v2-0-b8b48fdba3b3@ideasonboard.com > > Changes in v2: > - Change the compatible string back to raspberrypi,rp1-cfe from raspberrypi,rpi5-rp1-cfe > - Drop the references to rp1 headers in the DT binding example. This > allows compiling the example without the rp1 support. > - Fix missing remap lines for mono formats > - Fix csi2_pad_set_fmt() so that the format can be changed back to the > sink's format from 16-bit or compressed format. > - Link to v1: https://lore.kernel.org/r/20240318-rp1-cfe-v1-0-ac6d960ff22d@ideasonboard.com > > --- > Tomi Valkeinen (4): > media: uapi: Add meta formats for PiSP FE config and stats > dt-bindings: media: Add bindings for raspberrypi,rp1-cfe > media: raspberrypi: Add support for RP1-CFE > media: admin-guide: Document the Raspberry Pi CFE (rp1-cfe) > > .../admin-guide/media/raspberrypi-rp1-cfe.dot | 27 + > .../admin-guide/media/raspberrypi-rp1-cfe.rst | 78 + > Documentation/admin-guide/media/v4l-drivers.rst | 1 + > .../bindings/media/raspberrypi,rp1-cfe.yaml | 93 + > .../userspace-api/media/v4l/meta-formats.rst | 1 + > .../userspace-api/media/v4l/metafmt-pisp-fe.rst | 39 + > MAINTAINERS | 7 + > drivers/media/platform/raspberrypi/Kconfig | 1 + > drivers/media/platform/raspberrypi/Makefile | 1 + > drivers/media/platform/raspberrypi/rp1-cfe/Kconfig | 15 + > .../media/platform/raspberrypi/rp1-cfe/Makefile | 6 + > .../media/platform/raspberrypi/rp1-cfe/cfe-fmts.h | 332 +++ > .../media/platform/raspberrypi/rp1-cfe/cfe-trace.h | 196 ++ > drivers/media/platform/raspberrypi/rp1-cfe/cfe.c | 2487 ++++++++++++++++++++ > drivers/media/platform/raspberrypi/rp1-cfe/cfe.h | 43 + > drivers/media/platform/raspberrypi/rp1-cfe/csi2.c | 583 +++++ > drivers/media/platform/raspberrypi/rp1-cfe/csi2.h | 89 + > drivers/media/platform/raspberrypi/rp1-cfe/dphy.c | 180 ++ > drivers/media/platform/raspberrypi/rp1-cfe/dphy.h | 27 + > .../media/platform/raspberrypi/rp1-cfe/pisp-fe.c | 581 +++++ > .../media/platform/raspberrypi/rp1-cfe/pisp-fe.h | 53 + > drivers/media/v4l2-core/v4l2-ioctl.c | 2 + > .../uapi/linux/media/raspberrypi/pisp_fe_config.h | 273 +++ > .../linux/media/raspberrypi/pisp_fe_statistics.h | 64 + > include/uapi/linux/videodev2.h | 2 + > 25 files changed, 5181 insertions(+) > --- > base-commit: 431c1646e1f86b949fa3685efc50b660a364c2b6 > change-id: 20240314-rp1-cfe-142b628b7214 > > Best regards,