{"id":20834,"url":"https://patchwork.libcamera.org/api/patches/20834/?format=json","web_url":"https://patchwork.libcamera.org/patch/20834/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20240808102346.13065-4-naush@raspberrypi.com>","date":"2024-08-08T10:23:42","name":"[v1,3/7] pipeline: rpi: Pass crop rectangle as a parameter to platformSetIspCrop()","commit_ref":null,"pull_url":null,"state":"superseded","archived":true,"hash":"f97a86eac01cbfff5604af8843e3af73c6c0306c","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/20834/mbox/","series":[{"id":4501,"url":"https://patchwork.libcamera.org/api/series/4501/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4501","date":"2024-08-08T10:23:39","name":"Raspberry Pi: Add controls::rpi::ScalerCrops","version":1,"mbox":"https://patchwork.libcamera.org/series/4501/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/20834/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/20834/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 9BF68C32D5\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  8 Aug 2024 10:24:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 92362633C0;\n\tThu,  8 Aug 2024 12:23:54 +0200 (CEST)","from mail-wr1-x431.google.com (mail-wr1-x431.google.com\n\t[IPv6:2a00:1450:4864:20::431])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8056B61955\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  8 Aug 2024 12:23:48 +0200 (CEST)","by mail-wr1-x431.google.com with SMTP id\n\tffacd0b85a97d-3683f56b9bdso521333f8f.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 08 Aug 2024 03:23:48 -0700 (PDT)","from naush-laptop.pitowers.org ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tffacd0b85a97d-36d272290c2sm1404234f8f.92.2024.08.08.03.23.47\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 08 Aug 2024 03:23:47 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"AxbCVfw5\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1723112628; x=1723717428;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=Nb+gdwWarnJNCQUVUUakWYok4gsIJIituzonUdU6Ang=;\n\tb=AxbCVfw5bg1P3TZN4HC/YWHBPl3f66OQ4MluPEgE9TiL39C9dZB1KB1GmKQe5S1sEN\n\tMwPtq2hR4avpKvfmX0uGE/6aGR0t8YFng3PrXRSZwjMXKsSYPRaf+WJhdHc1idtLT5RB\n\tk8/AKxuK80eeb5rTYamW8tr0p3l9ju5LBtVuWkMkMmZlJqQoJWpd05GRXEJztqLqORHf\n\tge86BPw648APjvLbXEWkMSQ6Z6Ijs8rrGeILLU0hFffFajiKuRSOBC5Agkmg1uDKL9Zz\n\t98QYFa6EdxfZNqkulL0okSq49cB3FYfhYCgevLmOxdYZkK8JAA6yhWooZEQ091glre3j\n\tSmqA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1723112628; x=1723717428;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=Nb+gdwWarnJNCQUVUUakWYok4gsIJIituzonUdU6Ang=;\n\tb=lb97dD77jownE0zDyE8yc3Eu5UqKLE/1633Ek9QF1jjIf3+g5ZOdCVHJtJQWCnAeIh\n\tRftElgSeZoq/cj9LUIQFG4Hu3xfrEnw7mtUlWcChmyoSZG1jLKKI5TBWgV94RzaCD2aL\n\t+H4igzLousL38jfe/8SP69eRZTgMDmQwMkrxcWI8XAZWJcctZkN+bgmaHEXFXG7iije6\n\tcPbj4A1sQAKUTsgwjNhyPaDV+5pL+aVzP7g3f7TvIRr9e5yJ8IAGMbja1bO5B4vWtxue\n\ttA/rw1ml+dRKkJf29MJGtqc3+t3TrvP7/ZCM4i2hBLNYJN/FWLMC9CRnvhifRYvwM6Dr\n\ta7LA==","X-Gm-Message-State":"AOJu0YzYr9Djls0PJto7no3yWH8JMRygqHSe9yUYs4JCdmheJM9vFqi4\n\twY+VYogFd7W4sgrzWF2D5wQ/zlSFLMrYn3TeXlukKxS/5NB5teaK2yxIhur2aoXxQTYibX97yCl\n\tE","X-Google-Smtp-Source":"AGHT+IGF05oNHM8p7Ce31bwXn08Ac7E8BGPabGvHPbgeQePR9ZipFLQHp9ZH/10O5ZlWsZ7Hsk3bDQ==","X-Received":"by 2002:a5d:6d01:0:b0:367:9828:f42d with SMTP id\n\tffacd0b85a97d-36d275798c6mr1213909f8f.53.1723112627728; \n\tThu, 08 Aug 2024 03:23:47 -0700 (PDT)","From":"Naushir Patuck <naush@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Naushir Patuck <naush@raspberrypi.com>","Subject":"[PATCH v1 3/7] pipeline: rpi: Pass crop rectangle as a parameter to\n\tplatformSetIspCrop()","Date":"Thu,  8 Aug 2024 11:23:42 +0100","Message-Id":"<20240808102346.13065-4-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20240808102346.13065-1-naush@raspberrypi.com>","References":"<20240808102346.13065-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"This will be required when we program separate crop values to each ISP\noutput in a future commit.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 3 +--\n src/libcamera/pipeline/rpi/common/pipeline_base.h   | 2 +-\n src/libcamera/pipeline/rpi/vc4/vc4.cpp              | 7 ++++---\n 3 files changed, 6 insertions(+), 6 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\nindex 5322fd798a36..2de6111bacfd 100644\n--- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n+++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n@@ -1314,8 +1314,7 @@ void CameraData::applyScalerCrop(const ControlList &controls)\n \n \t\tif (ispCrop != ispCrop_) {\n \t\t\tispCrop_ = ispCrop;\n-\t\t\tplatformSetIspCrop();\n-\n+\t\t\tplatformSetIspCrop(ispCrop);\n \t\t}\n \t}\n }\ndiff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.h b/src/libcamera/pipeline/rpi/common/pipeline_base.h\nindex 5161c16e518f..d65b695c30b5 100644\n--- a/src/libcamera/pipeline/rpi/common/pipeline_base.h\n+++ b/src/libcamera/pipeline/rpi/common/pipeline_base.h\n@@ -83,7 +83,7 @@ public:\n \n \tRectangle scaleIspCrop(const Rectangle &ispCrop) const;\n \tvoid applyScalerCrop(const ControlList &controls);\n-\tvirtual void platformSetIspCrop() = 0;\n+\tvirtual void platformSetIspCrop(const Rectangle &ispCrop) = 0;\n \n \tvoid cameraTimeout();\n \tvoid frameStarted(uint32_t sequence);\ndiff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp\nindex e5b6ef2b37cd..0ea032293bc9 100644\n--- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n+++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n@@ -109,9 +109,10 @@ public:\n \tConfig config_;\n \n private:\n-\tvoid platformSetIspCrop() override\n+\tvoid platformSetIspCrop(const Rectangle &ispCrop) override\n \t{\n-\t\tisp_[Isp::Input].dev()->setSelection(V4L2_SEL_TGT_CROP, &ispCrop_);\n+\t\tRectangle crop = ispCrop;\n+\t\tisp_[Isp::Input].dev()->setSelection(V4L2_SEL_TGT_CROP, &crop);\n \t}\n \n \tint platformConfigure(const RPi::RPiCameraConfiguration *rpiConfig) override;\n@@ -707,7 +708,7 @@ int Vc4CameraData::platformConfigure(const RPi::RPiCameraConfiguration *rpiConfi\n \tSize size = unicamFormat.size.boundedToAspectRatio(maxSize);\n \tispCrop_ = size.centeredTo(Rectangle(unicamFormat.size).center());\n \n-\tplatformSetIspCrop();\n+\tplatformSetIspCrop(ispCrop_);\n \n \treturn 0;\n }\n","prefixes":["v1","3/7"]}