From patchwork Fri Oct 22 07:52:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 12577349 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 58073C433EF for ; Fri, 22 Oct 2021 08:00:06 +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 23BE560FC3 for ; Fri, 22 Oct 2021 08:00:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 23BE560FC3 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=krSUX4mtaNLonqMwX58bJXvcYbXtLTeopqd7mSD1UKA=; b=hQ0WXtWQSuGVNZ uSKFemK3CqAQuuJgtzj0X9tBS/518mxxf9jDzfKjPJ3dXRBPx96ynGSt8dbQ4DVvt80WcrwDyePqa aIC2T7gyaLl39q+ObEIhD3ownXgINZNGFoD3IySfhboBuxohBGe+3z0An3lZ0pLIy+HlhovpNCcFN /J3RoVSKdtJvfY6O+yUYUYMfThQP844yHI77LkoW1/LxcROA7DZGUUARZtZtqCWezNx38im7x8opP pXJxpUDdeswXTqIGfscaWmjP+NlWCrrO1IyXVyKswokEpMLYMSWfuFtHOJgQmorSWKO81VOnDsw83 VvOY3MMw4v3gvAmSz0PA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdpRO-00A437-1Q; Fri, 22 Oct 2021 07:58:14 +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 1mdpNd-00A2HF-Fg for linux-arm-kernel@lists.infradead.org; Fri, 22 Oct 2021 07:54:22 +0000 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: , , , 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211022_005421_573516_16C96023 X-CRM114-Status: GOOD ( 12.18 ) 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: jacopo@jmondi.org, robh+dt@kernel.org, sakari.ailus@iki.fi, laurent.pinchart@ideasonboard.com, Eugen Hristev 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 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; }