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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4679BC38A2D for ; Wed, 30 Mar 2022 12:06:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344764AbiC3MCy (ORCPT ); Wed, 30 Mar 2022 08:02:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345017AbiC3Lxx (ORCPT ); Wed, 30 Mar 2022 07:53:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B6AC275C97; Wed, 30 Mar 2022 04:50:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E0518B81C39; Wed, 30 Mar 2022 11:50:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BFCC0C36AE3; Wed, 30 Mar 2022 11:50:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648641012; bh=536otJG6irmPN3L/0cDJmTTtx6vrE6tpwy6troGIf0Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=srdIy53V20extuVx0MCnZ3yekyUCvvEx/bFKmv9TEEis8ny7WpIUdyHgAE4lzbHj/ cPp85JI3/1lUg4gwBtS1q4WHib53f1U5WHk3X/Xw1qDRSgPZnn8GHLoSuPpFVCMabZ iyvQ3tMRaYtIFMu7MFAeIjUjdsh4YIekC3daARhAFPx8pYJdwTbM/xj7v5VHlrpgZ/ cGzcZrgEzNJ9DawMovIqq49XuCTOj4gj7ipMhTlbV908nAcBap9HWV7wZ/J+a6yy1i 6Tm73nJmpIrcJ7r+rKeTwVqeLZNCUs4Z2pon6gwm2AOE94Xli3MP9GGQTIQWLqChMm +nBfXubb9IGzA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Eugen Hristev , Jacopo Mondi , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin , linux-media@vger.kernel.org Subject: [PATCH AUTOSEL 5.15 04/50] media: atmel: atmel-isc-base: report frame sizes as full supported range Date: Wed, 30 Mar 2022 07:49:18 -0400 Message-Id: <20220330115005.1671090-4-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220330115005.1671090-1-sashal@kernel.org> References: <20220330115005.1671090-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eugen Hristev [ Upstream commit 72802a86e11c34e819fbfb38f58c5aef668f833d ] The ISC supports a full broad range of frame sizes. Until now, the subdevice was queried for possible frame sizes and these were reported to the user space. However, the ISC should not care about which frame sizes the subdev supports, as long as this frame size is supported. Thus, report a continuous range from smallest frame size up to the max resolution. Signed-off-by: Eugen Hristev Reviewed-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/atmel/atmel-isc-base.c | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/media/platform/atmel/atmel-isc-base.c b/drivers/media/platform/atmel/atmel-isc-base.c index ebf264b980f9..f768be3c4059 100644 --- a/drivers/media/platform/atmel/atmel-isc-base.c +++ b/drivers/media/platform/atmel/atmel-isc-base.c @@ -1369,14 +1369,12 @@ static int isc_enum_framesizes(struct file *file, void *fh, struct v4l2_frmsizeenum *fsize) { struct isc_device *isc = video_drvdata(file); - struct v4l2_subdev_frame_size_enum fse = { - .code = isc->config.sd_format->mbus_code, - .index = fsize->index, - .which = V4L2_SUBDEV_FORMAT_ACTIVE, - }; int ret = -EINVAL; int i; + if (fsize->index) + return -EINVAL; + for (i = 0; i < isc->num_user_formats; i++) if (isc->user_formats[i]->fourcc == fsize->pixel_format) ret = 0; @@ -1388,14 +1386,14 @@ static int isc_enum_framesizes(struct file *file, void *fh, if (ret) return ret; - ret = v4l2_subdev_call(isc->current_subdev->sd, pad, enum_frame_size, - NULL, &fse); - if (ret) - return ret; + fsize->type = V4L2_FRMSIZE_TYPE_CONTINUOUS; - fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE; - fsize->discrete.width = fse.max_width; - fsize->discrete.height = fse.max_height; + fsize->stepwise.min_width = 16; + fsize->stepwise.max_width = isc->max_width; + fsize->stepwise.min_height = 16; + fsize->stepwise.max_height = isc->max_height; + fsize->stepwise.step_width = 1; + fsize->stepwise.step_height = 1; return 0; } -- 2.34.1