Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1453564pxb; Fri, 22 Oct 2021 00:57:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGu8jVTc9gzGNVu1XZDFrF//6LevltnRG5/VRsX+nmlXFTb2WYlmp6u8dlxHcOR9ZoSRhM X-Received: by 2002:a17:907:6e07:: with SMTP id sd7mr13630043ejc.392.1634889426731; Fri, 22 Oct 2021 00:57:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634889426; cv=none; d=google.com; s=arc-20160816; b=AjNmy/sxX0deyVI9Q50p/bBp7uzNoSXSmWYId3unQslu/hQhVDaLcQ/oZ5tpazu/Ng 2i0RRIdr8o2vV9YXZ7hWIneeE7xcFizmf94VfbJls1D+p+Z+7nkGBq3N5u7ETSAv93q4 0erXnihz64AktLu4FX7tuuufaR+NNJu9ST4Nt45jJLcr9t1419mUa5FtYWxdfE903CF7 0UIKGysxsKWahnADJGt0Gg710kHWhWnQGbL63LcOoF3hk5X8k1WFanwpMp1ctdkHRbxf W4qYvD6jTXF6aEwX7WorK7+z5VFjhxOzC50sCMq36FdC6JsQJ7H9Cw8+YVwQrpHY31HJ vlhA== 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 :ironport-sdr:dkim-signature; bh=8iXIQ5jTlaZJUgLnl1A23N8tLA00HIheXPCIOef8oDs=; b=xQeb96xWoshHmgBwGskc0dsa79/vhw6wlZqNUVmLkwga+S8CR+v/UyFWBsOIb8ywK3 TZZPLtk0NGICKxNdZRDbTQ4W1S7Gsq2HOMD8B4quIpCdFt/1i2op+/7PUQ3J1hnZN7hK PLsiRui5mAT2rFC9QlSpF3pkPx1XiuKKHzWx6wmOU9S8lD2VLFkVVtHHRJlkl5dXufKv QkttcU+cEHfi3hAQZLUnd+k57DUdmQF4VB1BPKsMHHdgylSGR9yiurbgCBNDtj8xbbl1 edm2z/4eEx5OXZ784Shic7fvhMawV68R3GFTUrzeggyN1lD+myqL4OZH9SAQuUQZ3TjZ QTHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=GASC9XHl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a12si9484650edr.352.2021.10.22.00.56.43; Fri, 22 Oct 2021 00:57:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=GASC9XHl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232526AbhJVH4p (ORCPT + 99 others); Fri, 22 Oct 2021 03:56:45 -0400 Received: from esa.microchip.iphmx.com ([68.232.153.233]:55701 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232488AbhJVH4i (ORCPT ); Fri, 22 Oct 2021 03:56:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1634889261; x=1666425261; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=REZFzzAUOglb7K1RDabqAKzlGAFNSmzLTlTDD6DNu20=; b=GASC9XHlsZALlmo2eq4DitIfiiuBBG0KMnc75tTcELmJNVC+6ZOguZuD X0kq91/jf2CnXjV4LEDcqDms9OkxZZLFzgOS0Vr4UeX22nnmSLEgf6snV 7acpISCzLbQ/tG9V+/XRYKLJ5wpy+Pk6A3VJJa3myxo1uioFw3rrDwsde 46XY5iwItbjUzMfR6N7nYkhXlUKYoaHf+EgE9IwANkOYhCM3YBF8EK0Cp Zz+uxEDsp0c7zgWb6ZMs0up5pK4GUmW/6qJsIEUt75u+/ixONlDuLlvnq df/e/zQvN2FwN7jfHw7kxBFEL09WnOmlb2Pc1OZmjZO138TSRXAD2gpSM w==; IronPort-SDR: AjDl8UDo1XWgESJKb05p6S4cISZnEXYMUMtDLVbDmrgHAhSxatZEJ/AAUqCdRoxUnK4LRBDyaA eoMdA4RN09/5vCcaiS500z7NNdifSAGKq6CxLfJgmUiJg9L6SO1Yuw7w/NUMR1qS0WzO8T8D6r xmvaaT1DzhtxQMx7V8hee7qyy34jxaBJ2FCt4x1qdTFplJv8p0ekGuRkth6egKBgR9GfjYEms5 hMeOQTQvd0DgpMWGhDTOLOMLiDuR0A8MyMCtLwtZ3F7AOVa7dwUmSfRrG+ZvnFjSV6cG0xqgY7 v4h/tw+ZbjxjIJcPEljdtbVl X-IronPort-AV: E=Sophos;i="5.87,172,1631602800"; d="scan'208";a="149141234" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 22 Oct 2021 00:54:20 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Fri, 22 Oct 2021 00:54:20 -0700 Received: from ROB-ULT-M18282.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Fri, 22 Oct 2021 00:54:17 -0700 From: Eugen Hristev To: , , , CC: , , , , , Eugen Hristev Subject: [PATCH 10/21] media: atmel: atmel-isc-base: report frame sizes as full supported range Date: Fri, 22 Oct 2021 10:52:36 +0300 Message-ID: <20211022075247.518880-11-eugen.hristev@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211022075247.518880-1-eugen.hristev@microchip.com> References: <20211022075247.518880-1-eugen.hristev@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 8537ad73d160..2dd2511c7be1 100644 --- a/drivers/media/platform/atmel/atmel-isc-base.c +++ b/drivers/media/platform/atmel/atmel-isc-base.c @@ -1077,14 +1077,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; @@ -1096,14 +1094,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.25.1