Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1224349rda; Mon, 23 Oct 2023 06:29:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEqacGfgO/vMvpOtn5V+0rRspQ8zdwgQqmfw4OK5gIHUICv6ec0Q5wtNQrnC8OaE6yBPz3P X-Received: by 2002:a17:903:1210:b0:1c6:2dbb:e5fa with SMTP id l16-20020a170903121000b001c62dbbe5famr11560320plh.44.1698067768136; Mon, 23 Oct 2023 06:29:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698067768; cv=pass; d=google.com; s=arc-20160816; b=Ex+3/l9PznEVBzraQYFQZVFrt0mNSgCpCHWPErLIrhLt4xCqi1ozyC1gpSbaLOBsBm mtW4Dr/6YhhJpOYBIGpIxMjTRREHlZNP4s6todU5+Mr4m1lA7exOdtVUo5M3vIdgrVcI gLUtIfZCQ8lpt/bDvE3JAVgzH0SoYfrEdPa3QhXWtT2VTV0EIAAfCQ5UHKnsFMPcCST0 3I1P/YJ+cI0kf8mBBRjnk7XBxE8Y08SrRW/Do0d+uBPm5s1UAsNaOBapy4wXFr5/N9Cy QKkmdI4E8Wr5W/Shh5qTK4HwojMHSHwWewNzsSx8wEm/y47HY0oRUHR3V2tx+xfCBzPe DiSw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=EJaCxwwh+roQjYl602o8k+9pslodONkqCleR2OziZ5o=; fh=oSslltfxoc6dBeFlmMmMVX9ku5KxVL5IYrNuF49iGxM=; b=DYhY/I77dXRSx3c4Mz/hIA9yGKSoaZJwfFwFieztNrqJpv8OzCeqio0+WHrC3m3EmL gGvpk9Lh6AQ3fdyYlZiowjWPLopG3gfN8mPS1R64oHwwoXTkgBkq5MOqa+tHTZ+dS7Mw OHWJWvYkE9PtsWkuHutYvKzYxBJBWKKLaeJV1By4SBaXFt28H98FjrbY/+YmHOaMQxm5 flmCrgCZ0JH1YvpTet2ikFLfs2kLmnD8v7aiuymNwmfGEEUeql/tI/SfxRJjrfvJadRP C+4zph8JJNHWGU17ju0sjk9kQewdpfgBkLiUiLsJnUElmoLZ8sUxNahFJcTjRJeEEjJp mWeA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wolfvision.net header.s=selector2 header.b=KmrzeQpK; arc=pass (i=1 spf=pass spfdomain=wolfvision.net dkim=pass dkdomain=wolfvision.net dmarc=pass fromdomain=wolfvision.net); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wolfvision.net Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id a15-20020a170902eccf00b001b8a67f1c10si6555161plh.468.2023.10.23.06.29.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 06:29:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@wolfvision.net header.s=selector2 header.b=KmrzeQpK; arc=pass (i=1 spf=pass spfdomain=wolfvision.net dkim=pass dkdomain=wolfvision.net dmarc=pass fromdomain=wolfvision.net); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wolfvision.net Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 3C35580A4AD5; Mon, 23 Oct 2023 06:29:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230496AbjJWN2t (ORCPT + 99 others); Mon, 23 Oct 2023 09:28:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230427AbjJWN2r (ORCPT ); Mon, 23 Oct 2023 09:28:47 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2062.outbound.protection.outlook.com [40.107.104.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27B37F9; Mon, 23 Oct 2023 06:28:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f4Su9Cnt9Md72Na+ujtHT1nSXIT7DREYicK3+Z5g5uwa/cMzjyoEL1rD0wgcmu2eL0n7eI4YlaiIygDKb5fhWDadFgxB3tGvKRAMvvb97C7GCYssM+GCy/KF5+40E8aHgb7LoprIa2XzH7aI0y6EZdmqpsc+SxgaryHp/Dw3hd0MHNYZy9Plnngd8NgHCeIkTZ6ym1EIE4JhnlOFY36mBeArfS5LXJh947FpaLcAQGvY17kvjLrh84sOFS5jOTeFcRt/vTIPI6hLOjyFnE0ru+td1xYULO9ETLOrSZUNJaS8l9Im81p5WjIBKqADzxz37OqTAMTHzuoHiS5HjQ+uFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EJaCxwwh+roQjYl602o8k+9pslodONkqCleR2OziZ5o=; b=mqs5o3c/BTkrCven7ZZBEeG0jeF6/L023bhbn+MBR+xmb2EqGa77d/Wu44OLTrhUIEYbaaOx6vu7xrBH4mqw7J/+nc+bjir2/oWEl7/Xbuw4+v4MYemNp3PHL/0ME148O4OKJqmKJN9V4DPNTXtoueZ8tIalhgBD3gf3Wg7/2jZW2GNglFZpVkn/wQNZ8TvWvcbf2XN1qjOe1I5BYZ4fFB1OAGA0z1PyYaeD3ZuBztAb+ESFM+fPECRqXwNkVoq4kYCF/K1CJddRGutFoouVkjJekC3rWMzCrPnBEPtfr4vPPV7u8vosIyJiT8hyD5L3ratlzRdCuU9myFbDAyIeTg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wolfvision.net; dmarc=pass action=none header.from=wolfvision.net; dkim=pass header.d=wolfvision.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfvision.net; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EJaCxwwh+roQjYl602o8k+9pslodONkqCleR2OziZ5o=; b=KmrzeQpKNV4I5YGQn/CcvCO6BhRUVBsN+ebTYoB7AIqcOL1mY+VzSnrj4/HOPQMfaqRMB1GQJNpsw5mHZxHiujEAPF+p/QgDcN8vX1ad8FpRCSIbCmDCm8PF6rptFJo2wd0yqq/hPUh8kvuDidtDu3IQWoW8NCQIMUEOK4xEl+c= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) by DB5PR08MB10163.eurprd08.prod.outlook.com (2603:10a6:10:4a2::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.31; Mon, 23 Oct 2023 13:28:42 +0000 Received: from DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::1d06:cca0:f1ef:ff62]) by DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::1d06:cca0:f1ef:ff62%4]) with mapi id 15.20.6907.025; Mon, 23 Oct 2023 13:28:41 +0000 Message-ID: Date: Mon, 23 Oct 2023 15:28:39 +0200 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v8 2/3] media: rockchip: Add a driver for Rockhip's camera interface Content-Language: en-US To: Mehdi Djait , mchehab@kernel.org, heiko@sntech.de, hverkuil-cisco@xs4all.nl, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, conor+dt@kernel.org, ezequiel@vanguardiasur.com.ar Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, alexandre.belloni@bootlin.com, maxime.chevallier@bootlin.com, paul.kocialkowski@bootlin.com References: <3790470ff7606fc075ec742d43254e52dde5d120.1697446303.git.mehdi.djait@bootlin.com> From: Michael Riesch In-Reply-To: <3790470ff7606fc075ec742d43254e52dde5d120.1697446303.git.mehdi.djait@bootlin.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: ZR0P278CA0037.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1d::6) To DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB9155:EE_|DB5PR08MB10163:EE_ X-MS-Office365-Filtering-Correlation-Id: bbf5b571-d505-4a02-9ee7-08dbd3cbf954 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eBN393mllWijMsMHnS+x75IsG0j4EkDMCtpPEHtDXw3A5bcdG672XMOzU3lynnuQ2Ego+JikvszbC2Kg4eLCWN0aJOV1bNEtcten7EEzHN3DujGteDCykALufAmriqYHl2z1zs9uVPz3HDex01RMCw/enUVhMGid9+elGRVI8AizIVX/axPrkCRensRsyE1PtzT9X6m3HdAtiyQRrsp9WmWTPbGcERdba8dXdWg07ZD9unbMmZl6ZuHEJ5TJpDMTMXVxStJGnIppAMLhjq0Bn7DlGCoV81FSMmzfErDZj6dNnbJsJBa1kV/Q9e6yVFTANqX7zps4noI0K9C6wBcRN+rutTgpfJdYfduEz2la4cXaKvPE04q0UF2gngdUf7CQg19jWijR4EWq+3c+vcJVxCwcs3ApoD0CmPGkWq+TQ5F6hlWlBsC7Dj7Z5wtg9K/bZnPl/1qNO6JbdTvyUJaTMyk4Tcydl1BL8rJmSAuWxmmGboSrtT8wkvgp5IT37anMcjsXyhkPqItBYFZhrhkiraIc3LV7nqvBQzqax/TiKqaVcdXYVIbcd85+fB/kNTcD68eJYDadRoMd1uPWxs0hsFFGOT+zpldjSO08ZO3HUqHySRK7Hm3kE8OuNEXlvl4OluhlmEfWiKHIDV3omTiaMw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR08MB9155.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(376002)(136003)(39830400003)(366004)(346002)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(53546011)(44832011)(66946007)(66556008)(66476007)(316002)(478600001)(5660300002)(8676002)(6486002)(8936002)(4326008)(31686004)(6512007)(6506007)(41300700001)(7416002)(2906002)(38100700002)(83380400001)(2616005)(36756003)(31696002)(86362001)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SWNZTzFjcUpucmZPTXpBcWxCQnd5c251dDFjcE1jK3pxZXUvNzFVazJEcjVk?= =?utf-8?B?UTFrd2crTWlKY3h2cGI3NE5aTEVkL2dyR3VFY1NYNURGWCtMQVNJUEt3Uk04?= =?utf-8?B?Nm1qcmxMZEVtSDBiVlhBNlM4MGxBVXNLMTFpOCtMZHFoeHU1MlUzZGx2b01J?= =?utf-8?B?YVJYaVJhYUd1ODNvbUY4NDFXdG4zeWZMVnk4c08zVm9lN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VUdwZjN2L1NBOTZEQWZpK3B0RmNvK1RjQ1pmYWUwY1dOT1l0Zlpx?= =?utf-8?B?TlFUTlJZRzc3VStUWk42UERDcVZhRk9YSUJDeE9xYWZCYXJDaFprNDVNWDgy?= =?utf-8?B?OEE3cXh3ZFBiRWRieFA1TG00Z3pDRGsyUE5hYStBS1JRM3czRnNvSm14OWxK?= =?utf-8?B?SFVnT29TUG5DdW4wTUVRckxzUm1wN24vdm56NjBkZ1F0cVFscUhuSDFSdDR0?= =?utf-8?B?SklkMS9nWjh3TjhmZjh3MlN3NG9nPT0=?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: bbf5b571-d505-4a02-9ee7-08dbd3cbf954 X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB9155.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2023 13:28:41.9087 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e94ec9da-9183-471e-83b3-51baa8eb804f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: w1s3PcuzCP05MpPXmSiyiIIWQ5WhiJyDOTKO/Dn4CKgr/G/LlPvU0DQOdTwX2oVkW1shlKD0h6+SGqjE7qygEmgw7Fg955KPfO4hm6otAYY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR08MB10163 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 23 Oct 2023 06:29:25 -0700 (PDT) Hi Mehdi, Typo in the subject: "Rockhip's" -> "Rockchip's" I think this typo has been in there for a while now ;-) On 10/16/23 11:00, Mehdi Djait wrote: > Introduce a driver for the camera interface on some Rockchip platforms. > > This controller supports CSI2 and BT656 interfaces, but for > now only the BT656 interface could be tested, hence it's the only one > that's supported in the first version of this driver. "CSI2" -> "MIPI CSI-2" ? "BT656" -> "BT.656" ? Also, additional interfaces are supported by some units, e.g., the RK3568 VICAP also supports BT.1120. But most likely it becomes too complex to list everything, and it would be better if you simply described the unit in the PX30. I think this would clarify the commit message a lot. > This controller can be fond on PX30, RK1808, RK3128 and RK3288, > but for now it's only been tested on PX30. > > Most of this driver was written following the BSP driver from rockchip, "rockchip" -> "Rockchip" > removing the parts that either didn't fit correctly the guidelines, or > that couldn't be tested. > > In the BSP, this driver is known as the "cif" driver, but this was > renamed to "vip" to better fit the controller denomination in the > datasheet. > > This basic version doesn't support cropping nor scaling, and is only > designed with one SDTV video decoder being attached to it a any time. > > This version uses the "pingpong" mode of the controller, which is a > double-buffering mechanism. > > Signed-off-by: Mehdi Djait Two things below: >[...] > diff --git a/drivers/media/platform/rockchip/vip/dev.h b/drivers/media/platform/rockchip/vip/dev.h > new file mode 100644 > index 000000000000..eb9cd8f20ffc > --- /dev/null > +++ b/drivers/media/platform/rockchip/vip/dev.h > @@ -0,0 +1,163 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* > + * Rockchip VIP Driver > + * > + * Copyright (C) 2018 Rockchip Electronics Co., Ltd. > + * Copyright (C) 2023 Mehdi Djait > + */ > + > +#ifndef _RK_VIP_DEV_H > +#define _RK_VIP_DEV_H > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#define VIP_DRIVER_NAME "rk_vip" > +#define VIP_VIDEODEVICE_NAME "stream_vip" > + > +#define RK_VIP_MAX_BUS_CLK 8 > +#define RK_VIP_MAX_SENSOR 2 > +#define RK_VIP_MAX_RESET 5 > +#define RK_VIP_MAX_CSI_CHANNEL 4 > + > +#define RK_VIP_DEFAULT_WIDTH 640 > +#define RK_VIP_DEFAULT_HEIGHT 480 > + > +#define write_vip_reg(base, addr, val) writel(val, (addr) + (base)) > +#define read_vip_reg(base, addr) readl((addr) + (base)) Please provide those helpers as proper inline functions. As to the naming, the "_reg" suffix seems unnecessary. Alternatively, you could consider converting the driver to use regmap. > + > +enum rk_vip_state { > + RK_VIP_STATE_DISABLED, > + RK_VIP_STATE_READY, > + RK_VIP_STATE_STREAMING > +}; > + > +enum rk_vip_chip_id { > + CHIP_PX30_VIP, > + CHIP_RK1808_VIP, > + CHIP_RK3128_VIP, > + CHIP_RK3288_VIP > +}; > + > +enum host_type_t { > + RK_CSI_RXHOST, > + RK_DSI_RXHOST > +}; > + > +struct rk_vip_buffer { > + struct vb2_v4l2_buffer vb; > + struct list_head queue; > + union { > + u32 buff_addr[VIDEO_MAX_PLANES]; > + void *vaddr[VIDEO_MAX_PLANES]; > + }; > +}; > + > +struct rk_vip_scratch_buffer { > + void *vaddr; > + dma_addr_t dma_addr; > + u32 size; > +}; > + > +static inline struct rk_vip_buffer *to_rk_vip_buffer(struct vb2_v4l2_buffer *vb) > +{ > + return container_of(vb, struct rk_vip_buffer, vb); > +} > + > +struct rk_vip_sensor_info { > + struct v4l2_subdev *sd; > + int pad; > + struct v4l2_mbus_config mbus; > + int lanes; > + v4l2_std_id std; > +}; > + > +struct vip_output_fmt { > + u32 fourcc; > + u32 mbus; > + u32 fmt_val; > + u8 cplanes; > +}; > + > +enum vip_fmt_type { > + VIP_FMT_TYPE_YUV = 0, > + VIP_FMT_TYPE_RAW, > +}; > + > +struct vip_input_fmt { > + u32 mbus_code; > + u32 dvp_fmt_val; > + u32 csi_fmt_val; > + enum vip_fmt_type fmt_type; > + enum v4l2_field field; > +}; > + > +struct rk_vip_stream { > + struct rk_vip_device *vipdev; > + enum rk_vip_state state; > + bool stopping; > + wait_queue_head_t wq_stopped; > + int frame_idx; > + int frame_phase; > + > + /* lock between irq and buf_queue */ > + spinlock_t vbq_lock; > + struct vb2_queue buf_queue; > + struct list_head buf_head; > + struct rk_vip_scratch_buffer scratch_buf; > + struct rk_vip_buffer *buffs[2]; > + > + /* vfd lock */ > + struct mutex vlock; > + struct video_device vdev; > + struct media_pad pad; > + > + struct vip_output_fmt *vip_fmt_out; > + const struct vip_input_fmt *vip_fmt_in; > + struct v4l2_pix_format_mplane pixm; > +}; > + > +static inline struct rk_vip_stream *to_rk_vip_stream(struct video_device *vdev) > +{ > + return container_of(vdev, struct rk_vip_stream, vdev); > +} > + > +struct rk_vip_device { > + struct list_head list; > + struct device *dev; > + int irq; > + void __iomem *base_addr; > + void __iomem *csi_base; > + struct clk_bulk_data clks[RK_VIP_MAX_BUS_CLK]; > + int num_clk; > + struct vb2_alloc_ctx *alloc_ctx; > + bool iommu_en; > + struct iommu_domain *domain; > + struct reset_control *vip_rst; > + > + struct v4l2_device v4l2_dev; > + struct media_device media_dev; > + struct v4l2_ctrl_handler ctrl_handler; > + struct v4l2_async_notifier notifier; > + struct v4l2_async_connection asd; > + struct rk_vip_sensor_info sensor; Using "sensor" as name does not seem correct. As pointed out above it could be a video decoder just as well. Something with "subdevice" maybe? Thanks and best regards, Michael > [...]