Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9119105pxu; Mon, 28 Dec 2020 07:06:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzNBsQpCQtwk3N9Y+URDOE/76IGDkGMc35yJkCeebPVaNhEzHw04VizO1RZ6nz72cCYujrG X-Received: by 2002:a17:906:ae55:: with SMTP id lf21mr42049865ejb.101.1609168010292; Mon, 28 Dec 2020 07:06:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609168010; cv=none; d=google.com; s=arc-20160816; b=mMKNypFV3WvaNTwneFvQJ205uYJWrczLXkWTuLkZe5vZ2Ju7SEGOsuBDSdTwN6PcIo /TtTY5pudIbw8MJh5nlvNsyF3Qi6OAY/uPhs1GELr54BrCEhhlRQUeriEY+6L+oq4Gfs V1Cw5mLj5sGOhgBL0yo/7KtQMbS99cIT7tphgyvk7J19mYZ15gad3U/SU1NwJVwQyv+j 8CO4O3ZVgVbF8kH2eXqoQ/gR3jy9tThpIkcTtEaDSBMYBF301W4A4hDajBMPqGiIQ5Qv vV5AZXfRk7xuto6zJ6jlJy1jFXl9q3jG21z3jyc53bBgqN2BVemdOWmMr60eD1viwhfi S6CQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CtLeSzEDMaIcjgenLSs+F/em9Tlc1AD1UmfICZFj/xE=; b=r6tjurdpp3wxp6Xs1ij6CYg+k7rtgiOJ7v7FZZdcbU7zCk/PTdaOZ9tQrEbGHT0kU3 XjPYh7os/fofBM/ntzPY3/tj0g82H8A29Jl5k1IRdNlomQkIMLS5j348e5eSygWKE04/ G3SIYOhW82/fLbjfFTScvTuLyldF/FtK8U5OICA8jO/vwjLPybwiq0WqJtk4bV8tSRNz 8xfCTS9lVIlOMUVP3kb0/pQG7NRhmhAn0v15v8jG3jtq+9VRSsf6v3e5Uwde8ZHP1+AF 4nLRyt+HCrB3T489yDQrqkejuzbuG/bTPpYTp3Gz4moZsPmiqOPXYfuBQ6TB3jEpHQlc FAoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KXIZ2LRS; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dg4si19624219edb.104.2020.12.28.07.06.27; Mon, 28 Dec 2020 07:06:50 -0800 (PST) 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=pass header.i=@linuxfoundation.org header.s=korg header.b=KXIZ2LRS; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439747AbgL1OL6 (ORCPT + 99 others); Mon, 28 Dec 2020 09:11:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:46568 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439728AbgL1OL5 (ORCPT ); Mon, 28 Dec 2020 09:11:57 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A292C20715; Mon, 28 Dec 2020 14:11:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164676; bh=QzUb8k2L9ZU+aPkQhH4a7riCme34oUXh+tm3u8vGmlk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KXIZ2LRSiLqKfpyraJGFA2SmFGI71o/DyKEoRsUM3q3gjunvzMnKIHrez/hqlBFw6 zIDdyoanTpRwwwo5MLLILr1ScD7O/9yOrUzeFMuNn2lOaIR8DB7O+8gio59iCcFWZD wdaBGDHdPOC4ZrisXcTJiRntVRTN3ZsN5HwK+SmA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans Verkuil , Jacopo Mondi , Sakari Ailus , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.10 259/717] media: i2c: imx219: Selection compliance fixes Date: Mon, 28 Dec 2020 13:44:17 +0100 Message-Id: <20201228125033.404681857@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans Verkuil [ Upstream commit 1ed36ecd1459b653cced8929bfb37dba94b64c5d ] To comply with the intended usage of the V4L2 selection target when used to retrieve a sensor image properties, adjust the rectangles returned by the imx219 driver. The top/left crop coordinates of the TGT_CROP rectangle were set to (0, 0) instead of (8, 8) which is the offset from the larger physical pixel array rectangle. This was also a mismatch with the default values crop rectangle value, so this is corrected. Found with v4l2-compliance. While at it, add V4L2_SEL_TGT_CROP_BOUNDS support: CROP_DEFAULT and CROP_BOUNDS have the same size as the non-active pixels are not readable using the selection API. Found with v4l2-compliance. [reword commit message, use macros for pixel offsets] Fixes: e6d4ef7d58aa7 ("media: i2c: imx219: Implement get_selection") Signed-off-by: Hans Verkuil Signed-off-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/i2c/imx219.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c index 1cee45e353554..0ae66091a6962 100644 --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c @@ -473,8 +473,8 @@ static const struct imx219_mode supported_modes[] = { .width = 3280, .height = 2464, .crop = { - .left = 0, - .top = 0, + .left = IMX219_PIXEL_ARRAY_LEFT, + .top = IMX219_PIXEL_ARRAY_TOP, .width = 3280, .height = 2464 }, @@ -489,8 +489,8 @@ static const struct imx219_mode supported_modes[] = { .width = 1920, .height = 1080, .crop = { - .left = 680, - .top = 692, + .left = 688, + .top = 700, .width = 1920, .height = 1080 }, @@ -505,8 +505,8 @@ static const struct imx219_mode supported_modes[] = { .width = 1640, .height = 1232, .crop = { - .left = 0, - .top = 0, + .left = IMX219_PIXEL_ARRAY_LEFT, + .top = IMX219_PIXEL_ARRAY_TOP, .width = 3280, .height = 2464 }, @@ -521,8 +521,8 @@ static const struct imx219_mode supported_modes[] = { .width = 640, .height = 480, .crop = { - .left = 1000, - .top = 752, + .left = 1008, + .top = 760, .width = 1280, .height = 960 }, @@ -1008,6 +1008,7 @@ static int imx219_get_selection(struct v4l2_subdev *sd, return 0; case V4L2_SEL_TGT_CROP_DEFAULT: + case V4L2_SEL_TGT_CROP_BOUNDS: sel->r.top = IMX219_PIXEL_ARRAY_TOP; sel->r.left = IMX219_PIXEL_ARRAY_LEFT; sel->r.width = IMX219_PIXEL_ARRAY_WIDTH; -- 2.27.0