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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A68FC4167E for ; Fri, 12 Nov 2021 14:28:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 235B660F45 for ; Fri, 12 Nov 2021 14:28:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235251AbhKLObM (ORCPT ); Fri, 12 Nov 2021 09:31:12 -0500 Received: from esa.microchip.iphmx.com ([68.232.153.233]:64856 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235246AbhKLObG (ORCPT ); Fri, 12 Nov 2021 09:31:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1636727296; x=1668263296; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QFcZqhwV54wl82Sk8IHg25ljnl0Hvg//Cvz5aknbgrg=; b=flj6QCya8AGH8qUQjU6RUHuMB8OQGBlysjsYwJG6HK0pxXGy3wrbr9YM pjm7YNr1sRUWhgeQ+JIp7w/7cgA2atQ8DRdyWRb15Q/oX9rp70ryTW+qZ nsn9qIQ45gi/59uuZGDdv9v+NXvpJl8QhTohR44T+mJ79nmrJqQ83LiSz A7OG5hz1LV8R/7myns/1HVJyIzoy6nSL5diM2lGSGrW7KgVUpzX8ZxsDt ydONgIcsEPJI3JVCTvnLPcBt49N2J3NhM5Ph22utxwe9BQuw8wto204Uh Kr64dBYx6PDeMRRTSaHhBuu9LgzPhHt2pS0BRfkKcxDwdICQWh520QCg8 Q==; IronPort-SDR: SbLC9AkFtt5nbB5N7OjdUtJexotXivMFCklhBOeZQGd0PuNqv83Z53tEdBQvTO72LOzSmLtpt9 8+yQYcsy9+EmNXe3/T3RbWdNhEwlozLGac0XMBgajL0SA80hooUSQNs3grroEn63N21kYzauwd AOegV8h3zIwClHdBFQKM4fxqPVF1p8iRD8DaShtHaCxM+bw7yTNk+xkc3uOVRoJpJqKO+evoaV TJYd/YWzzdneygPBDut6rQmDoH14GuEPWFOc1ezJOILn9yBLULbXO3J4j1ZQumn7hd2daPgO3q Equ5KjGiakGbhYFZLRneyGAp X-IronPort-AV: E=Sophos;i="5.87,229,1631602800"; d="scan'208";a="143154062" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 12 Nov 2021 07:28:16 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Fri, 12 Nov 2021 07:28:15 -0700 Received: from ROB-ULT-M18282.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Fri, 12 Nov 2021 07:28:10 -0700 From: Eugen Hristev To: CC: , , , , , , , Eugen Hristev Subject: [PATCH v2 10/25] media: atmel: atmel-isc-base: report frame sizes as full supported range Date: Fri, 12 Nov 2021 16:24:54 +0200 Message-ID: <20211112142509.2230884-11-eugen.hristev@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211112142509.2230884-1-eugen.hristev@microchip.com> References: <20211112142509.2230884-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 Reviewed-by: Jacopo Mondi --- 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 3389671fbfb9..bf638d201b29 100644 --- a/drivers/media/platform/atmel/atmel-isc-base.c +++ b/drivers/media/platform/atmel/atmel-isc-base.c @@ -1076,14 +1076,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; @@ -1095,14 +1093,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 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F017AC433EF for ; Fri, 12 Nov 2021 14:34:24 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C046461039 for ; Fri, 12 Nov 2021 14:34:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C046461039 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=V6OYvQx6yKnlr974/rA8uH1/rknDpIAM49Ncizm67ag=; b=tz35scyqs5yKCz N+fblNiD+LC7wGx8hW8tgkHF52Ah8o1VDf6GZxPFvCRi52bZ6zvdu+liuNSaneuxALZOnZYYLsQPf UomjdvSGZQ6A7r+w7HZXJhcXa260wGdtyXXigbGcn7Z5KNsOe1FGXIeW9wvmBZqS3eDWVNUPS/vwl buHPLrocDyyLimKOa9/1JKJ0xEYkTOz5IyMj9tmLEC4xXlE4m7BRlLuLDcA0A0uCEIxFd5zMXrVSB sw1t4Kd1rvkCdYK6euMxcki7hj39QV0Rj/OIjG/0Z2Pc5r+udCAdaFSMOwcbJnyU+XNALhbG09YrF nvw/IIpzxi6DNrv4NvYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mlXbe-00AnhK-NU; Fri, 12 Nov 2021 14:32:45 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mlXXN-00AldM-7J for linux-arm-kernel@lists.infradead.org; Fri, 12 Nov 2021 14:28:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1636727298; x=1668263298; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QFcZqhwV54wl82Sk8IHg25ljnl0Hvg//Cvz5aknbgrg=; b=oV2LnUaIFczYXGyvX4scNoox8QtNau2sh9faaLpL1vVEIVm4bZw2cZUQ 0oJL87yE3P+0yxso1it+ITaFdoooA5BMN2Avxtx/GNPyoBlz3EPgWGIei Dl4NL5ofyYQJBf2tK07eZZiWQRSs6OSsjbf2UTZgUVAUvFlwAvpJr+itS F1wH9iquYJA8cC4RKBXFF61mOS1oTFeFk1FN+RMwOXZCOveUVkEZPMg77 fMyzBSxtg0O8KXtUy0IWc9LgGmGy8ccKutuMHxQmhhsCNVJzklJ9xII7t AdSQZpuGsbvgAKumX8x1MDwpWfMgRtP5lM2OPyhymPhJPIXH0jMUz/MJM g==; IronPort-SDR: SbLC9AkFtt5nbB5N7OjdUtJexotXivMFCklhBOeZQGd0PuNqv83Z53tEdBQvTO72LOzSmLtpt9 8+yQYcsy9+EmNXe3/T3RbWdNhEwlozLGac0XMBgajL0SA80hooUSQNs3grroEn63N21kYzauwd AOegV8h3zIwClHdBFQKM4fxqPVF1p8iRD8DaShtHaCxM+bw7yTNk+xkc3uOVRoJpJqKO+evoaV TJYd/YWzzdneygPBDut6rQmDoH14GuEPWFOc1ezJOILn9yBLULbXO3J4j1ZQumn7hd2daPgO3q Equ5KjGiakGbhYFZLRneyGAp X-IronPort-AV: E=Sophos;i="5.87,229,1631602800"; d="scan'208";a="143154062" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 12 Nov 2021 07:28:16 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Fri, 12 Nov 2021 07:28:15 -0700 Received: from ROB-ULT-M18282.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Fri, 12 Nov 2021 07:28:10 -0700 From: Eugen Hristev To: Subject: [PATCH v2 10/25] media: atmel: atmel-isc-base: report frame sizes as full supported range Date: Fri, 12 Nov 2021 16:24:54 +0200 Message-ID: <20211112142509.2230884-11-eugen.hristev@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211112142509.2230884-1-eugen.hristev@microchip.com> References: <20211112142509.2230884-1-eugen.hristev@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211112_062817_317513_660F9DBF X-CRM114-Status: GOOD ( 12.44 ) 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: , Cc: devicetree@vger.kernel.org, jacopo@jmondi.org, linux-kernel@vger.kernel.org, sakari.ailus@iki.fi, laurent.pinchart@ideasonboard.com, Eugen Hristev , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 Reviewed-by: Jacopo Mondi --- 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 3389671fbfb9..bf638d201b29 100644 --- a/drivers/media/platform/atmel/atmel-isc-base.c +++ b/drivers/media/platform/atmel/atmel-isc-base.c @@ -1076,14 +1076,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; @@ -1095,14 +1093,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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel