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=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham 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 B67AEC43381 for ; Fri, 22 Mar 2019 00:18:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 829E321900 for ; Fri, 22 Mar 2019 00:18:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727192AbfCVASE (ORCPT ); Thu, 21 Mar 2019 20:18:04 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:24189 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726944AbfCVASD (ORCPT ); Thu, 21 Mar 2019 20:18:03 -0400 X-UUID: 1ec1967452424b2bb3341bf18a1904ad-20190322 X-UUID: 1ec1967452424b2bb3341bf18a1904ad-20190322 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1215901566; Fri, 22 Mar 2019 08:17:59 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs03n1.mediatek.inc (172.21.101.181) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 22 Mar 2019 08:17:57 +0800 Received: from [172.21.84.99] (172.21.84.99) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 22 Mar 2019 08:17:57 +0800 Message-ID: <1553213877.7066.16.camel@mtksdccf07> Subject: Re: [RFC PATCH V0 7/7] [media] platform: mtk-isp: Add Mediatek ISP Pass 1 driver From: Jungo Lin To: Tomasz Figa CC: Frederic Chen , Hans Verkuil , Laurent Pinchart , Matthias Brugger , Mauro Carvalho Chehab , , "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , Sean Cheng =?UTF-8?Q?=28=E9=84=AD=E6=98=87=E5=BC=98=29?= , "Sj Huang" , Christie Yu =?UTF-8?Q?=28=E6=B8=B8=E9=9B=85=E6=83=A0=29?= , Holmes Chiou =?UTF-8?Q?=28=E9=82=B1=E6=8C=BA=29?= , Jerry-ch Chen , Rynn Wu =?UTF-8?Q?=28=E5=90=B3=E8=82=B2=E6=81=A9=29?= , Linux Media Mailing List , , , Date: Fri, 22 Mar 2019 08:17:57 +0800 In-Reply-To: References: <1549348966-14451-1-git-send-email-frederic.chen@mediatek.com> <1549348966-14451-8-git-send-email-frederic.chen@mediatek.com> <1552378607.13953.71.camel@mtksdccf07> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On Thu, 2019-03-21 at 12:48 +0900, Tomasz Figa wrote: > On Tue, Mar 12, 2019 at 5:16 PM Jungo Lin wrote: > > > > On Thu, 2019-03-07 at 19:04 +0900, Tomasz Figa wrote: > [snip] > > > > +struct mtk_cam_mem2mem2_device { > > > > + const char *name; > > > > + const char *model; > > > > > > For both of the fields above, they seem to be always > > > MTK_CAM_DEV_P1_NAME, so we can just use the macro directly whenever > > > needed. No need for this indirection. > > > > > > > OK. These two fields will be removed in next patch. > > > > > > + struct device *dev; > > > > + int num_nodes; > > > > + struct mtk_cam_dev_video_device *nodes; > > > > + const struct vb2_mem_ops *vb2_mem_ops; > > > > > > This is always "vb2_dma_contig_memops", so it can be used directly. > > > > > > > Ditto. > > > > > > + unsigned int buf_struct_size; > > > > > > This is always sizeof(struct mtk_cam_dev_buffer), so no need to save > > > it in the struct. > > > > > > > Ditto. > > > > > > + int streaming; > > > > + struct v4l2_device *v4l2_dev; > > > > + struct media_device *media_dev; > > > > > > These 2 fields are already in mtk_cam_dev which is a superclass of > > > this struct. One can just access them from there directly. > > > > > > > Ditto. > > > > > > + struct media_pipeline pipeline; > > > > + struct v4l2_subdev subdev; > > > > > > Could you remind me what was the media topology exposed by this > > > driver? This is already the second subdev I spotted in this patch, > > > which looks strange. > > > > > > > > > For sub-device design, we will remove the sub-device for CIO and keep > > only one sub-device for ISP driver in next patch. We will also provide > > the media topology in RFC v1 patch to clarify. > > > > > > + struct media_pad *subdev_pads; > > > > + struct v4l2_file_operations v4l2_file_ops; > > > > + const struct file_operations fops; > > > > +}; > > > > > > Given most of the comments above, it looks like the remaining useful > > > fields in this struct could be just moved to mtk_cam_dev, without the > > > need for this separate struct. > > > > > > > This is the final revision for these two structures. > > Do you suggest to merge it to simplify? > > > > struct mtk_cam_mem2mem2_device { > > struct mtk_cam_video_device *nodes; > > struct media_pipeline pipeline; > > struct v4l2_subdev subdev; > > struct media_pad *subdev_pads; > > }; > > > > struct mtk_cam_dev { > > struct platform_device *pdev; > > struct mtk_cam_video_device mem2mem2_nodes[MTK_CAM_DEV_NODE_MAX]; > > struct mtk_cam_mem2mem2_device mem2mem2; > > struct mtk_cam_io_connection cio; > > struct v4l2_device v4l2_dev; > > struct media_device media_dev; > > struct mtk_cam_ctx ctx; > > struct v4l2_async_notifier notifier; > > }; > > > > I feel like there is not much benefit in having this split. Similarly, > I'm not sure if there is a reason to have separate structs for > mtk_cam_io_connection and mtk_cam_ctx. > > (Sorry, missed this one in previous reply.) > > Best regards, > Tomasz Ok, agree your comment. We will remove both mtk_cam_io_connection and mtk_cam_ctx and merge those fields into mtk_cam_dev. Thanks for your suggestion. Best regards, Jungo From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jungo Lin Subject: Re: [RFC PATCH V0 7/7] [media] platform: mtk-isp: Add Mediatek ISP Pass 1 driver Date: Fri, 22 Mar 2019 08:17:57 +0800 Message-ID: <1553213877.7066.16.camel@mtksdccf07> References: <1549348966-14451-1-git-send-email-frederic.chen@mediatek.com> <1549348966-14451-8-git-send-email-frederic.chen@mediatek.com> <1552378607.13953.71.camel@mtksdccf07> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Tomasz Figa Cc: Sean Cheng =?UTF-8?Q?=28=E9=84=AD=E6=98=87=E5=BC=98=29?= , Frederic Chen , Rynn Wu =?UTF-8?Q?=28=E5=90=B3=E8=82=B2=E6=81=A9=29?= , Christie Yu =?UTF-8?Q?=28=E6=B8=B8=E9=9B=85=E6=83=A0=29?= , srv_heupstream@mediatek.com, Holmes Chiou =?UTF-8?Q?=28=E9=82=B1=E6=8C=BA=29?= , Jerry-ch Chen , yuzhao@chromium.org, Sj Huang , Laurent Pinchart , linux-mediatek@lists.infradead.org, zwisler@chromium.org, Matthias Brugger , Hans Verkuil , Mauro Carvalho Chehab , "list@263.net:IOMMU DRIVERS , Joerg Roedel , " List-Id: linux-mediatek@lists.infradead.org On Thu, 2019-03-21 at 12:48 +0900, Tomasz Figa wrote: > On Tue, Mar 12, 2019 at 5:16 PM Jungo Lin wrote: > > > > On Thu, 2019-03-07 at 19:04 +0900, Tomasz Figa wrote: > [snip] > > > > +struct mtk_cam_mem2mem2_device { > > > > + const char *name; > > > > + const char *model; > > > > > > For both of the fields above, they seem to be always > > > MTK_CAM_DEV_P1_NAME, so we can just use the macro directly whenever > > > needed. No need for this indirection. > > > > > > > OK. These two fields will be removed in next patch. > > > > > > + struct device *dev; > > > > + int num_nodes; > > > > + struct mtk_cam_dev_video_device *nodes; > > > > + const struct vb2_mem_ops *vb2_mem_ops; > > > > > > This is always "vb2_dma_contig_memops", so it can be used directly. > > > > > > > Ditto. > > > > > > + unsigned int buf_struct_size; > > > > > > This is always sizeof(struct mtk_cam_dev_buffer), so no need to save > > > it in the struct. > > > > > > > Ditto. > > > > > > + int streaming; > > > > + struct v4l2_device *v4l2_dev; > > > > + struct media_device *media_dev; > > > > > > These 2 fields are already in mtk_cam_dev which is a superclass of > > > this struct. One can just access them from there directly. > > > > > > > Ditto. > > > > > > + struct media_pipeline pipeline; > > > > + struct v4l2_subdev subdev; > > > > > > Could you remind me what was the media topology exposed by this > > > driver? This is already the second subdev I spotted in this patch, > > > which looks strange. > > > > > > > > > For sub-device design, we will remove the sub-device for CIO and keep > > only one sub-device for ISP driver in next patch. We will also provide > > the media topology in RFC v1 patch to clarify. > > > > > > + struct media_pad *subdev_pads; > > > > + struct v4l2_file_operations v4l2_file_ops; > > > > + const struct file_operations fops; > > > > +}; > > > > > > Given most of the comments above, it looks like the remaining useful > > > fields in this struct could be just moved to mtk_cam_dev, without the > > > need for this separate struct. > > > > > > > This is the final revision for these two structures. > > Do you suggest to merge it to simplify? > > > > struct mtk_cam_mem2mem2_device { > > struct mtk_cam_video_device *nodes; > > struct media_pipeline pipeline; > > struct v4l2_subdev subdev; > > struct media_pad *subdev_pads; > > }; > > > > struct mtk_cam_dev { > > struct platform_device *pdev; > > struct mtk_cam_video_device mem2mem2_nodes[MTK_CAM_DEV_NODE_MAX]; > > struct mtk_cam_mem2mem2_device mem2mem2; > > struct mtk_cam_io_connection cio; > > struct v4l2_device v4l2_dev; > > struct media_device media_dev; > > struct mtk_cam_ctx ctx; > > struct v4l2_async_notifier notifier; > > }; > > > > I feel like there is not much benefit in having this split. Similarly, > I'm not sure if there is a reason to have separate structs for > mtk_cam_io_connection and mtk_cam_ctx. > > (Sorry, missed this one in previous reply.) > > Best regards, > Tomasz Ok, agree your comment. We will remove both mtk_cam_io_connection and mtk_cam_ctx and merge those fields into mtk_cam_dev. Thanks for your suggestion. Best regards, Jungo 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=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=unavailable 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 5C20EC43381 for ; Fri, 22 Mar 2019 00:18:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2127C21900 for ; Fri, 22 Mar 2019 00:18:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="E3nnwAmo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2127C21900 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:MIME-Version:References:In-Reply-To: Date:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ASm768ER3Vdf673jYXefH5w7z69Xuck1UFplzpQwzfg=; b=E3nnwAmojzkAvG /D4wO/VeOYtcM+JpTyBMOBGVux6KgJHjZnGanDJvlxvsNt6SYCzahy78Q5BbUIMaHca9hnGfRbNH9 mbwnoehAE1fFG6basBSAuL/ezco3MswsEHpS/E/WNx+Gn4LhwGLsxev8pmqFkm9oeoHf3em0HIwCs 2mdXNHNNARN2+LPy3ss6ysET04Vaat7oU/IbsQwYxTA5UQ82XFgZSwktouZaCIz7eO+W6ZALNyRVD tzsdL0mduOdHdoiqQIhfBHCUUmX/GRqwVui9DEgXYH7QhWYDZrxtoC1Mru9XxKDxhTiOQhvAPrNab dze7d0TYuha/y7EumPhw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h77st-0003Bv-QW; Fri, 22 Mar 2019 00:18:07 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h77sq-0003Az-Qr; Fri, 22 Mar 2019 00:18:06 +0000 X-UUID: 5b19b8bd9c5c4184aa7fb763b8500d8d-20190321 X-UUID: 5b19b8bd9c5c4184aa7fb763b8500d8d-20190321 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 1768047934; Thu, 21 Mar 2019 16:18:00 -0800 Received: from mtkmbs03n1.mediatek.inc (172.21.101.181) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 21 Mar 2019 17:17:59 -0700 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs03n1.mediatek.inc (172.21.101.181) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 22 Mar 2019 08:17:57 +0800 Received: from [172.21.84.99] (172.21.84.99) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 22 Mar 2019 08:17:57 +0800 Message-ID: <1553213877.7066.16.camel@mtksdccf07> Subject: Re: [RFC PATCH V0 7/7] [media] platform: mtk-isp: Add Mediatek ISP Pass 1 driver From: Jungo Lin To: Tomasz Figa Date: Fri, 22 Mar 2019 08:17:57 +0800 In-Reply-To: References: <1549348966-14451-1-git-send-email-frederic.chen@mediatek.com> <1549348966-14451-8-git-send-email-frederic.chen@mediatek.com> <1552378607.13953.71.camel@mtksdccf07> X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190321_171804_881155_4BB5EE7C X-CRM114-Status: GOOD ( 22.94 ) 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: Sean Cheng =?UTF-8?Q?=28=E9=84=AD=E6=98=87=E5=BC=98=29?= , Frederic Chen , Rynn Wu =?UTF-8?Q?=28=E5=90=B3=E8=82=B2=E6=81=A9=29?= , Christie Yu =?UTF-8?Q?=28=E6=B8=B8=E9=9B=85=E6=83=A0=29?= , srv_heupstream@mediatek.com, Holmes Chiou =?UTF-8?Q?=28=E9=82=B1=E6=8C=BA=29?= , Jerry-ch Chen , yuzhao@chromium.org, Sj Huang , Laurent Pinchart , linux-mediatek@lists.infradead.org, zwisler@chromium.org, Matthias Brugger , Hans Verkuil , Mauro Carvalho Chehab , "list@263.net:IOMMU DRIVERS , Joerg Roedel , " , Linux Media Mailing List Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 2019-03-21 at 12:48 +0900, Tomasz Figa wrote: > On Tue, Mar 12, 2019 at 5:16 PM Jungo Lin wrote: > > > > On Thu, 2019-03-07 at 19:04 +0900, Tomasz Figa wrote: > [snip] > > > > +struct mtk_cam_mem2mem2_device { > > > > + const char *name; > > > > + const char *model; > > > > > > For both of the fields above, they seem to be always > > > MTK_CAM_DEV_P1_NAME, so we can just use the macro directly whenever > > > needed. No need for this indirection. > > > > > > > OK. These two fields will be removed in next patch. > > > > > > + struct device *dev; > > > > + int num_nodes; > > > > + struct mtk_cam_dev_video_device *nodes; > > > > + const struct vb2_mem_ops *vb2_mem_ops; > > > > > > This is always "vb2_dma_contig_memops", so it can be used directly. > > > > > > > Ditto. > > > > > > + unsigned int buf_struct_size; > > > > > > This is always sizeof(struct mtk_cam_dev_buffer), so no need to save > > > it in the struct. > > > > > > > Ditto. > > > > > > + int streaming; > > > > + struct v4l2_device *v4l2_dev; > > > > + struct media_device *media_dev; > > > > > > These 2 fields are already in mtk_cam_dev which is a superclass of > > > this struct. One can just access them from there directly. > > > > > > > Ditto. > > > > > > + struct media_pipeline pipeline; > > > > + struct v4l2_subdev subdev; > > > > > > Could you remind me what was the media topology exposed by this > > > driver? This is already the second subdev I spotted in this patch, > > > which looks strange. > > > > > > > > > For sub-device design, we will remove the sub-device for CIO and keep > > only one sub-device for ISP driver in next patch. We will also provide > > the media topology in RFC v1 patch to clarify. > > > > > > + struct media_pad *subdev_pads; > > > > + struct v4l2_file_operations v4l2_file_ops; > > > > + const struct file_operations fops; > > > > +}; > > > > > > Given most of the comments above, it looks like the remaining useful > > > fields in this struct could be just moved to mtk_cam_dev, without the > > > need for this separate struct. > > > > > > > This is the final revision for these two structures. > > Do you suggest to merge it to simplify? > > > > struct mtk_cam_mem2mem2_device { > > struct mtk_cam_video_device *nodes; > > struct media_pipeline pipeline; > > struct v4l2_subdev subdev; > > struct media_pad *subdev_pads; > > }; > > > > struct mtk_cam_dev { > > struct platform_device *pdev; > > struct mtk_cam_video_device mem2mem2_nodes[MTK_CAM_DEV_NODE_MAX]; > > struct mtk_cam_mem2mem2_device mem2mem2; > > struct mtk_cam_io_connection cio; > > struct v4l2_device v4l2_dev; > > struct media_device media_dev; > > struct mtk_cam_ctx ctx; > > struct v4l2_async_notifier notifier; > > }; > > > > I feel like there is not much benefit in having this split. Similarly, > I'm not sure if there is a reason to have separate structs for > mtk_cam_io_connection and mtk_cam_ctx. > > (Sorry, missed this one in previous reply.) > > Best regards, > Tomasz Ok, agree your comment. We will remove both mtk_cam_io_connection and mtk_cam_ctx and merge those fields into mtk_cam_dev. Thanks for your suggestion. Best regards, Jungo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel