{"id":9220,"url":"https://patchwork.libcamera.org/api/1.1/patches/9220/?format=json","web_url":"https://patchwork.libcamera.org/patch/9220/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20200805105721.15445-5-jacopo@jmondi.org>","date":"2020-08-05T10:57:21","name":"[libcamera-devel,4/4] media: i2c: imx219: Selection compliance fixes","commit_ref":null,"pull_url":null,"state":"superseded","archived":true,"hash":"4fc0b88388a539eda583808fbbe4eec29e8e4137","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/1.1/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":{"id":15,"url":"https://patchwork.libcamera.org/api/1.1/users/15/?format=json","username":"jmondi","first_name":"Jacopo","last_name":"Mondi","email":"jacopo@jmondi.org"},"mbox":"https://patchwork.libcamera.org/patch/9220/mbox/","series":[{"id":1193,"url":"https://patchwork.libcamera.org/api/1.1/series/1193/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1193","date":"2020-08-05T10:57:18","name":"[libcamera-devel,1/4] media: docs: Describe pixel array properties","version":1,"mbox":"https://patchwork.libcamera.org/series/1193/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/9220/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/9220/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 3769DBD87A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  5 Aug 2020 10:53:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0FBDB6055E;\n\tWed,  5 Aug 2020 12:53:59 +0200 (CEST)","from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net\n\t[217.70.183.198])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 72D146039D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Aug 2020 12:53:57 +0200 (CEST)","from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay6-d.mail.gandi.net (Postfix) with ESMTPSA id D167EC000F;\n\tWed,  5 Aug 2020 10:53:55 +0000 (UTC)"],"X-Originating-IP":"93.34.118.233","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Hans Verkuil <hverkuil@xs4all.nl>,\n\tSakari Ailus <sakari.ailus@linux.intel.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","Date":"Wed,  5 Aug 2020 12:57:21 +0200","Message-Id":"<20200805105721.15445-5-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.27.0","In-Reply-To":"<20200805105721.15445-1-jacopo@jmondi.org>","References":"<20200805105721.15445-1-jacopo@jmondi.org>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH 4/4] media: i2c: imx219: Selection\n\tcompliance fixes","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org,\n\tSowjanya Komatineni <skomatineni@nvidia.com>,\n\tHans Verkuil <hverkuil-cisco@xs4all.nl>,\n\tRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>,\n\tLinux Media Mailing List <linux-media@vger.kernel.org>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"From: Hans Verkuil <hverkuil@xs4all.nl>\n\nTo comply with the intended usage of the V4L2 selection target when\nused to retrieve a sensor image properties, adjust the rectangles\nreturned by the imx219 driver.\n\nThe top/left crop coordinates of the TGT_CROP rectangle were set to\n(0, 0) instead of (8, 8) which is the offset from the larger physical\npixel array rectangle. This was also a mismatch with the default values\ncrop rectangle value, so this is corrected. Found with v4l2-compliance.\n\nWhile at it, add V4L2_SEL_TGT_CROP_BOUNDS support: CROP_DEFAULT and\nCROP_BOUNDS have the same size as the non-active pixels are not readable\nusing the selection API. Found with v4l2-compliance.\n\nFixes: e6d4ef7d58aa7 (\"media: i2c: imx219: Implement get_selection\")\nSigned-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>\n[reword commit message, use macros for pixel offsets]\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n drivers/media/i2c/imx219.c | 17 +++++++++--------\n 1 file changed, 9 insertions(+), 8 deletions(-)","diff":"diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c\nindex 60b23d113fc56..ff48a95b448b1 100644\n--- a/drivers/media/i2c/imx219.c\n+++ b/drivers/media/i2c/imx219.c\n@@ -473,8 +473,8 @@ static const struct imx219_mode supported_modes[] = {\n \t\t.width = 3280,\n \t\t.height = 2464,\n \t\t.crop = {\n-\t\t\t.left = 0,\n-\t\t\t.top = 0,\n+\t\t\t.left = IMX219_PIXEL_ARRAY_LEFT,\n+\t\t\t.top = IMX219_PIXEL_ARRAY_TOP,\n \t\t\t.width = 3280,\n \t\t\t.height = 2464\n \t\t},\n@@ -489,8 +489,8 @@ static const struct imx219_mode supported_modes[] = {\n \t\t.width = 1920,\n \t\t.height = 1080,\n \t\t.crop = {\n-\t\t\t.left = 680,\n-\t\t\t.top = 692,\n+\t\t\t.left = 688,\n+\t\t\t.top = 700,\n \t\t\t.width = 1920,\n \t\t\t.height = 1080\n \t\t},\n@@ -505,8 +505,8 @@ static const struct imx219_mode supported_modes[] = {\n \t\t.width = 1640,\n \t\t.height = 1232,\n \t\t.crop = {\n-\t\t\t.left = 0,\n-\t\t\t.top = 0,\n+\t\t\t.left = IMX219_PIXEL_ARRAY_LEFT,\n+\t\t\t.top = IMX219_PIXEL_ARRAY_TOP,\n \t\t\t.width = 3280,\n \t\t\t.height = 2464\n \t\t},\n@@ -521,8 +521,8 @@ static const struct imx219_mode supported_modes[] = {\n \t\t.width = 640,\n \t\t.height = 480,\n \t\t.crop = {\n-\t\t\t.left = 1000,\n-\t\t\t.top = 752,\n+\t\t\t.left = 1008,\n+\t\t\t.top = 760,\n \t\t\t.width = 1280,\n \t\t\t.height = 960\n \t\t},\n@@ -1045,6 +1045,7 @@ static int imx219_get_selection(struct v4l2_subdev *sd,\n \t\treturn 0;\n \n \tcase V4L2_SEL_TGT_CROP_DEFAULT:\n+\tcase V4L2_SEL_TGT_CROP_BOUNDS:\n \t\tsel->r.top = IMX219_PIXEL_ARRAY_TOP;\n \t\tsel->r.left = IMX219_PIXEL_ARRAY_LEFT;\n \t\tsel->r.width = IMX219_PIXEL_ARRAY_WIDTH;\n","prefixes":["libcamera-devel","4/4"]}