Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1768892rwb; Sat, 19 Nov 2022 03:15:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf5QOFvOdvBI3Gpk2BiGoabfMWV8Yys2RofTwiXheMXAzP40Ja9/KQ3+6CfYSImjoWVB3m/q X-Received: by 2002:a05:6402:360b:b0:468:f365:dca with SMTP id el11-20020a056402360b00b00468f3650dcamr8308293edb.41.1668856546301; Sat, 19 Nov 2022 03:15:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668856546; cv=none; d=google.com; s=arc-20160816; b=M80WFOSr/TyRrQ0AOolcvKzOsUHoQIrUdohn+8OUdOTIjhADFt75XBwDSFnk0IhH7T u88zaynyfd9irViYVPv8HL5z5xyFu1d4A7E2H/VwYh5bMA+EAHzVwFHZZAfGAI67y9kq qgJnJUctB9qBJwTGTCqy/5cRj3EMAeTX/1f5qRAMBA8NztiR93z6oiee0/NmjJDAELx0 aTv6o7BNbdhybhDitNoKRLixj+3v93yOi4jw0pR7xYJ/fYpRSKop3mnGI5zGSc2jBKdZ /DMPcZ9KfuSUojgyTLIGB4NU71z+43hGL2PxTvbvEMCz9k62Lq34ySGKIlMzaTXfFz2Y kRIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id :dkim-signature:dkim-signature; bh=UYi9C6IaaZioVaoTtatSi/ezY/KuSuWAipoDncaQtSw=; b=YhmI2MYsSN9wxm8Gbx9YEvxr73M0AoFmf8hmWNHeAErtFFOCgRzc9IkYP9rpN5GBQf qhIjWscKbQO6htQx/ZKwgemyXdm+SFT7STmc11nQ/jFzkADzdvPr+4L2ncPyiR7zG9Qi XKLF7bDTZcrT+EX9N9ahjPnyD7g4911uPCrtnitQX3fsCkWvMgXB07oErm+CvSnTVF4w 9s+KJj+iRk22MphdA5aHn/AnCbhCFiz35Fjvj6PDCiSCQZrRDzA7Awyq9BHLGWCJq0E/ 8hY2tdyhCSyyQQttbH5ctsNHC8DwDO6cjr3VHya3MKb50dz6tQNQXFlBqfk9Bs9/AvEr fLaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fastmail.com header.s=fm1 header.b=x0P7l1jk; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=G96HHULY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fastmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s7-20020a1709067b8700b0078db71898f2si4277065ejo.851.2022.11.19.03.15.23; Sat, 19 Nov 2022 03:15:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@fastmail.com header.s=fm1 header.b=x0P7l1jk; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=G96HHULY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fastmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230466AbiKSK5Y (ORCPT + 90 others); Sat, 19 Nov 2022 05:57:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbiKSK5V (ORCPT ); Sat, 19 Nov 2022 05:57:21 -0500 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 284A2976E6; Sat, 19 Nov 2022 02:57:21 -0800 (PST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 396555C013C; Sat, 19 Nov 2022 05:57:20 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sat, 19 Nov 2022 05:57:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1668855440; x=1668941840; bh=UYi9C6IaaZ ioVaoTtatSi/ezY/KuSuWAipoDncaQtSw=; b=x0P7l1jkb30Z8LOGNzKvuBE77L z3mtki6AnApaTgqxnUcwabvym1uihf3oYOvQOQBax6CGfS208No7KtL6GwZKOijt 3I5ZpmuAcbeG3iDmqBKaxqVpA/1fkAHpD1Wlh2XgVQKhUX4tBrx+CuWZVu1f4P0V ZKyFytHoqE/ecfh78FEto/CyW0DUvAo/q4QFvuFG5UVBzW2j9wvQiS6O6p1FuO7K FmFewnZtPKGU/Tncr2Ik90Sq5IJkZzSRb3CzJ+UDfuNumcha2pzk4AK3flydUBQB Hqq1/aDHgaYOKmbbykARp9GeGWMQngXaLAHCT2XFiuhbyPmtA5GGVyNjqm7A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1668855440; x=1668941840; bh=UYi9C6IaaZioVaoTtatSi/ezY/Ku SuWAipoDncaQtSw=; b=G96HHULYX4cJ7z5jPX/Y6cGqpx78nWKZUl0VuYionmAb zxyMAsmtL6wSiVj5Q04fK0mczXA901/mS1dIo3MLNiYqd5eKoFyrGG13uETWlg+m sjgzswGf64KCOKiiHA4a1Z9vSKxN5IeMpDZ6ZGofpXmhVq1kWzKnNtjL8NnHYtF2 UHBgCIAa4vxpxjnx++5JT1CTT6SPGgJj/m9mfdb9/oRGQrWtcC8ShToSjFhaEycc dzy1EzetDWRTM0q7phYDwbqVG0fdusLGh+RJ32B2UxNlpTDY3HSjT2dN0ssyqcj+ KVcTkXh49ac9H/wKQ3/Y2PtLbgisTKB6R+pQqXdgYg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrhedvgddvvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehttdertddttdejnecuhfhrohhmpeffrghfnhgr ucfjihhrshgthhhfvghlugcuoegurghfnhgrsehfrghsthhmrghilhdrtghomheqnecugg ftrfgrthhtvghrnhepvdehtdeludekgeevleefuedvudejieetheekvdfhteekffdujefh fedtudehvdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepuggrfhhnrgesfhgrshhtmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i0e894699:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 19 Nov 2022 05:57:17 -0500 (EST) Date: Sat, 19 Nov 2022 12:57:14 +0200 From: Dafna Hirschfeld To: Paul Elder Cc: linux-media@vger.kernel.org, Mauro Carvalho Chehab , Heiko Stuebner , Laurent Pinchart , linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/3] media: rkisp1: Implement ENUM_FRAMESIZES Message-ID: <20221119105714.6ynnl2jvfwnb4flw@guri> References: <20221117084217.3892680-1-paul.elder@ideasonboard.com> <20221117084217.3892680-4-paul.elder@ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline In-Reply-To: <20221117084217.3892680-4-paul.elder@ideasonboard.com> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17.11.2022 17:42, Paul Elder wrote: >Implement VIDIOC_ENUM_FRAMESIZES for the rkisp1 capture devices. > >Signed-off-by: Paul Elder >Signed-off-by: Laurent Pinchart Reviewed-by: Dafna Hirschfeld >--- > .../platform/rockchip/rkisp1/rkisp1-capture.c | 30 +++++++++++++++++++ > 1 file changed, 30 insertions(+) > >diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c >index 91e685fdbbe9..03c2922bfbed 100644 >--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c >+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c >@@ -1236,6 +1236,35 @@ static int rkisp1_enum_fmt_vid_cap_mplane(struct file *file, void *priv, > return -EINVAL; > } > >+static int rkisp1_enum_framesizes(struct file *file, void *fh, >+ struct v4l2_frmsizeenum *fsize) >+{ >+ static const unsigned int max_widths[] = { >+ RKISP1_RSZ_MP_SRC_MAX_WIDTH, >+ RKISP1_RSZ_SP_SRC_MAX_WIDTH, >+ }; >+ static const unsigned int max_heights[] = { >+ RKISP1_RSZ_MP_SRC_MAX_HEIGHT, >+ RKISP1_RSZ_SP_SRC_MAX_HEIGHT, >+ }; >+ struct rkisp1_capture *cap = video_drvdata(file); >+ >+ if (fsize->index != 0) >+ return -EINVAL; >+ >+ fsize->type = V4L2_FRMSIZE_TYPE_STEPWISE; >+ >+ fsize->stepwise.min_width = RKISP1_RSZ_SRC_MIN_WIDTH; >+ fsize->stepwise.max_width = max_widths[cap->id]; >+ fsize->stepwise.step_width = 2; >+ >+ fsize->stepwise.min_height = RKISP1_RSZ_SRC_MIN_HEIGHT; >+ fsize->stepwise.max_height = max_heights[cap->id]; >+ fsize->stepwise.step_height = 2; >+ >+ return 0; >+} >+ > static int rkisp1_s_fmt_vid_cap_mplane(struct file *file, > void *priv, struct v4l2_format *f) > { >@@ -1285,6 +1314,7 @@ static const struct v4l2_ioctl_ops rkisp1_v4l2_ioctl_ops = { > .vidioc_s_fmt_vid_cap_mplane = rkisp1_s_fmt_vid_cap_mplane, > .vidioc_g_fmt_vid_cap_mplane = rkisp1_g_fmt_vid_cap_mplane, > .vidioc_enum_fmt_vid_cap = rkisp1_enum_fmt_vid_cap_mplane, >+ .vidioc_enum_framesizes = rkisp1_enum_framesizes, > .vidioc_querycap = rkisp1_querycap, > .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, > .vidioc_unsubscribe_event = v4l2_event_unsubscribe, >-- >2.35.1 >