From patchwork Fri Mar 24 15:12:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 13186904 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D5354C6FD1C for ; Fri, 24 Mar 2023 15:20:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qJpfzS1If3MsmlXjDqqoBGPVx8GCSaLS0ShBNAqE6q4=; b=vtV/lhw6WLz6kX l51md+H8SjO9ihvBBicDobwNtCbc1WSrawj0EU+TL2Di5Rv/hkzsa0YZiHYf6V3YuFnZV1jZDbu/U f/6OlfUAVqK0jumF8vvQZbqxlM8LWBovCwZJPyXG64nunZTRjAQVxuWVHNKw/CudPwm1kufo81FGY 1Ee4gSGE+hEbKiDGOFt7EPKX8bzfSg8HKPWDEN4hzkBdyJdSlqzERuTdSA8DQ3hUua2hQGAIlo3GL WjtZ5N8T6WznBmixdClX4MeIL2fbr+tBnyWqZ3Ueb4P5q1BI/G5pkNNJq6JL07/ucfWwr4Ecpiqjo clDgPNCAv8d+iOZBk7rA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pfj7I-004n9u-2D; Fri, 24 Mar 2023 15:14:08 +0000 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pfj69-004mIm-06 for linux-arm-kernel@lists.infradead.org; Fri, 24 Mar 2023 15:12:58 +0000 Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id A116DE001E; Fri, 24 Mar 2023 15:12:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1679670775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r+i8mUIhWtFV9XGBR7tTV1Ij/OB6oMkb1et6Czsk7zo=; b=OMh9PlANLksoDm/e9yK92YUnsJXBS/POfKawy8xHW9nxfgiKoQbPauHSCwWiE3IocUCGZS vUzyfYwKPKwg0wLAnJLHUclfwpd4Pu4AXDG9PgEyEGzorETZxE+pAQPhzRByVk9mMujomw hexpUhnbpgaNJKJWXc2tOeZ8Nq4X25oQ5PK2sznsE8hT+CB4luzkdCZwSLyMp2RLdZOd0F yECcBPXygUkQLkwC/Qm+T7OtCu9NZu/03hz2C6+2F0hoZnmECKIDTOC9G/dmMTwKdENNlH BFBNkVH1D5yybztsVVufy8SurlRs3ChUkW2UNuzgXJXkodSPBW8vqKbt9zqgGA== From: Paul Kocialkowski To: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev Cc: Paul Kocialkowski , Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Laurent Pinchart , Adam Pigg , Thomas Petazzoni Subject: [PATCH 9/9] media: sun6i-isp: capture: Implement enum_framesizes Date: Fri, 24 Mar 2023 16:12:28 +0100 Message-Id: <20230324151228.2778112-10-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230324151228.2778112-1-paul.kocialkowski@bootlin.com> References: <20230324151228.2778112-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230324_081257_199167_413132E6 X-CRM114-Status: GOOD ( 10.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Report available frame sizes as a continuous range between the hardware min/max limits. Signed-off-by: Paul Kocialkowski Co-authored-by: Adam Pigg Signed-off-by: Adam Pigg Reviewed-by: Jernej Skrabec --- .../media/sunxi/sun6i-isp/sun6i_isp_capture.c | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c index 5160b93b69ff..a368f90a9beb 100644 --- a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c +++ b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c @@ -487,6 +487,30 @@ static int sun6i_isp_capture_try_fmt(struct file *file, void *private, return 0; } +static int +sun6i_isp_capture_enum_framesizes(struct file *file, void *fh, + struct v4l2_frmsizeenum *frmsizeenum) +{ + const struct sun6i_isp_capture_format *format; + + if (frmsizeenum->index > 0) + return -EINVAL; + + format = sun6i_isp_capture_format_find(frmsizeenum->pixel_format); + if (!format) + return -EINVAL; + + frmsizeenum->type = V4L2_FRMSIZE_TYPE_CONTINUOUS; + frmsizeenum->stepwise.min_width = SUN6I_ISP_CAPTURE_WIDTH_MIN; + frmsizeenum->stepwise.max_width = SUN6I_ISP_CAPTURE_WIDTH_MAX; + frmsizeenum->stepwise.min_height = SUN6I_ISP_CAPTURE_HEIGHT_MIN; + frmsizeenum->stepwise.max_height = SUN6I_ISP_CAPTURE_HEIGHT_MAX; + frmsizeenum->stepwise.step_width = 1; + frmsizeenum->stepwise.step_height = 1; + + return 0; +} + static int sun6i_isp_capture_enum_input(struct file *file, void *private, struct v4l2_input *input) { @@ -524,6 +548,8 @@ static const struct v4l2_ioctl_ops sun6i_isp_capture_ioctl_ops = { .vidioc_s_fmt_vid_cap = sun6i_isp_capture_s_fmt, .vidioc_try_fmt_vid_cap = sun6i_isp_capture_try_fmt, + .vidioc_enum_framesizes = sun6i_isp_capture_enum_framesizes, + .vidioc_enum_input = sun6i_isp_capture_enum_input, .vidioc_g_input = sun6i_isp_capture_g_input, .vidioc_s_input = sun6i_isp_capture_s_input,