Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1857542pxb; Wed, 30 Mar 2022 11:21:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxitKHtzXbv62HXE86Uhku/9GtRj/sCRsUIt6GKtJnFsyruZMfZFwVQzYmUmPNdkjeZxCLY X-Received: by 2002:a17:907:1b1e:b0:6d7:31b0:e821 with SMTP id mp30-20020a1709071b1e00b006d731b0e821mr965475ejc.334.1648664485823; Wed, 30 Mar 2022 11:21:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648664485; cv=none; d=google.com; s=arc-20160816; b=uXEtv7l+gXTHaqQCzD3EeXz2NXHPpTNs/fKFZTloHTEAuXaMM+/8bxVn2Uvr//PEw8 OFfgC+kuEtue6v7b14QHLJXDO3qKpjXOjdGvk53ofWec92PVJmPhkQptn4nLCk23oVRi UgUl+hZ40yfWGMkf5a40Jb1SBLUWn/ucf4WHhWuqDHTpB3YC9NI290t5laL7+qketdAI 2UEpszUTqnUFhTtEtrYuBkdHs0CBrci2oB31LBkDrJ+RJxGgiI2NhP0uA9oAlzsGwfAw x08ZqqBrYAxSIpgO6bCYGpz2eRx6YhZhZEhQXnOK6uVYgyMk53/+ffa2D+y2mxb8mMhR 3vRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UrKdZUVQYyUSo1XK2H1B4pB7MZ1742o5AcjMUXLWE/M=; b=TQHKxbhNpzZ2id0Tc9aUIQZb+i6e178u8gKT+hHkZqcCDe10Dz24NJyn2SdK2ac6HR f0r4HPJoxcdhzlStMxsiC7/LCwtPWao838HVkLtrNeKevQ5csdghjT6JIGzTqSDxn7Lv oQQkuDGHSsRgKV8OfkotR1PMulXRhst4mZ3vPs8DHmjCU7zVdpc5oX1u1mzi8u98T23y n+KlvgVyv1MNHcHBiYGfcWA0N+6Nfo5XBUo8z0DD+NzkLsw4IjWr5VHouGcRS52NVJTN RctyeIUoXOStGoXeOHHSwSNbFseRO6QhrBmL/nozq5KD/9o55wvsI8uNXT8X/aPp29fl kywQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PikCB93X; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 20-20020a170906319400b006e0f9bb2596si13855029ejy.925.2022.03.30.11.20.59; Wed, 30 Mar 2022 11:21:25 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=PikCB93X; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344917AbiC3L4p (ORCPT + 99 others); Wed, 30 Mar 2022 07:56:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344228AbiC3Lwo (ORCPT ); Wed, 30 Mar 2022 07:52:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8A8725E33A; Wed, 30 Mar 2022 04:48:39 -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 dfw.source.kernel.org (Postfix) with ESMTPS id B7A1561624; Wed, 30 Mar 2022 11:48:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4944AC340F2; Wed, 30 Mar 2022 11:48:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648640919; bh=5UMlgXP9Kt7zNY8E5AlJDpLF7i4vLGx8OtzMkKu8RiA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PikCB93XPTCCr0re3EL9qHWPejEbZ21oILcVneJnZRm+41O/uwxbLx4KFR6lx/BNj jn/1KYFAN3HHm7vgfG+HyzCFL+gj9K8XEmdw5LqURIXMZ3MVpPbowMXs4vjTu3q9yy 8yrB1J5souGFF1HJQJQ3Ndxv9pPRuPJ5iVpTUIeX10hA72FsQKp0F00SD3CaiDto0O c+D2ymR0bBNEHQN9QjbaaH/Hc9TfALpc8IRM5rRcNiwxQwe6bHPOhV1dJS7fztIBWr ZjYW817bWu8ZK7cvgY44FL3xIh3Y+xjxuWoTzVuQeu0IE73BpHWjm3gEWM4d6Ikr2w rPJ3CebkEFxpw== 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.16 04/59] media: atmel: atmel-isc-base: report frame sizes as full supported range Date: Wed, 30 Mar 2022 07:47:36 -0400 Message-Id: <20220330114831.1670235-4-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220330114831.1670235-1-sashal@kernel.org> References: <20220330114831.1670235-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 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 660cd0ab6749..24807782c9e5 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