{"id":21784,"url":"https://patchwork.libcamera.org/api/1.1/patches/21784/?format=json","web_url":"https://patchwork.libcamera.org/patch/21784/","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":"<20241031094957.18471-4-naush@raspberrypi.com>","date":"2024-10-31T09:49:53","name":"[v4,3/7] pipeline: rpi: Pass crop rectangle as a parameter to platformSetIspCrop()","commit_ref":"6bb278c20c2d1ce237b8d534fcc9711a65de8102","pull_url":null,"state":"accepted","archived":false,"hash":"312bb601ff6d6fc1eca9aa0c6e12b167ab1789fc","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/1.1/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/21784/mbox/","series":[{"id":4760,"url":"https://patchwork.libcamera.org/api/1.1/series/4760/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4760","date":"2024-10-31T09:49:50","name":"Raspberry Pi: Add controls::rpi::ScalerCrops","version":4,"mbox":"https://patchwork.libcamera.org/series/4760/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/21784/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/21784/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 7B115C31E9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 31 Oct 2024 09:52:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 34BB1653AB;\n\tThu, 31 Oct 2024 10:52:49 +0100 (CET)","from mail-wm1-x331.google.com (mail-wm1-x331.google.com\n\t[IPv6:2a00:1450:4864:20::331])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1C3A36539F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 31 Oct 2024 10:52:44 +0100 (CET)","by mail-wm1-x331.google.com with SMTP id\n\t5b1f17b1804b1-43160c5bad8so830845e9.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 31 Oct 2024 02:52:44 -0700 (PDT)","from naush-laptop.pitowers.org ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-4327d6983c2sm19789835e9.42.2024.10.31.02.52.42\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 31 Oct 2024 02:52:43 -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=\"qsO2Un/s\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1730368364; x=1730973164;\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=IUr6Lw+NnsqPBWYBrmq0WF1o8u+vmudIqx4yHm1X3FA=;\n\tb=qsO2Un/sz2dJtmpX/ogxcn42+QAxuSv7c3sBTgdtKOYXOQgJNUh7IcoUfJB96F3BXn\n\tdPGFoJdF90en8I+wfkKLX49uFnMZeYl4x/NGl95t7TDHDNv5utocTBL92iBfUkt+mWdl\n\tvxJsEJRyGXzTxYWsuRewbpYhKp2He1VYuv2eQMUyh52VmBdZmSTzht3fb+lI7fi/CgpQ\n\t9LFLjXwNlsZZ346uKbob/OXCiKFOftReWrISMQ4dlWS21K7MWbtxUr0y39xLzQcB849t\n\tGhV7AqRagFQmKg/WAvbrRs45ig3IdVmF1ar6jsSYllZ6oqK3E6x08ByED1wJ3yzxYs3T\n\tZ1Ig==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1730368364; x=1730973164;\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=IUr6Lw+NnsqPBWYBrmq0WF1o8u+vmudIqx4yHm1X3FA=;\n\tb=l6y8UfvrzA4LBJ6QQVvlL5axUnfbrpAmLE9VQKlgCkwD2zQKSDsgKhi7YmqQ6zS+N+\n\tEIhf60rB8pX97J0mf3hLhpUMmnZnwOzO95sNV8idH+ja9E49/f11E0dVZ5+mCXJ6jCVB\n\tKRvuJ2Rrz1ToM87oLQbTfW4U0+NhuB9RiyDq88jTOQfC+rGTU9MZ2z4QJux/RkYgXnyp\n\t4C5G1rbL2gAGhRNfXycSIsb6i+b6e0kbpFsUlVptR1qMb/sg8PxyARSqpjc/d3BVitOb\n\tnyZmOWqvlv6QEIdRFCuOdtOa48Dj3NDZfGHOuRkNC5aec5WoWAXt10FWLmxUrKdAJ246\n\t20zQ==","X-Gm-Message-State":"AOJu0YwvhFnp/fOi8Y/zCOGjCs1Ua3u0r38PMY1bFim/S7H8NdUvHl09\n\tLqnzQfWUL5eqE7jJ1RsRV73+/KoHwJQlZx0lm3Bov2Km12Nx+VvUuhtIb19mNXDY7IzTyqUJ6Rg\n\tX","X-Google-Smtp-Source":"AGHT+IEfsgogO3s8OyY/F+bsq57H50OrFcJaMzzpsGSRu0B759IzBj35G6VsgkgKJTFAGDJYvk1vgQ==","X-Received":"by 2002:a05:600c:468d:b0:42c:aeee:da86 with SMTP id\n\t5b1f17b1804b1-4319ad75782mr72843645e9.8.1730368363698; \n\tThu, 31 Oct 2024 02:52:43 -0700 (PDT)","From":"Naushir Patuck <naush@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Naushir Patuck <naush@raspberrypi.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tJacopo Mondi <jacopo.mondi@ideasonboard.com>","Subject":"[PATCH v4 3/7] pipeline: rpi: Pass crop rectangle as a parameter to\n\tplatformSetIspCrop()","Date":"Thu, 31 Oct 2024 09:49:53 +0000","Message-Id":"<20241031094957.18471-4-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20241031094957.18471-1-naush@raspberrypi.com>","References":"<20241031094957.18471-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>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 2 +-\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(+), 5 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\nindex 11f1bfd4a5da..2de6111bacfd 100644\n--- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n+++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n@@ -1314,7 +1314,7 @@ void CameraData::applyScalerCrop(const ControlList &controls)\n \n \t\tif (ispCrop != ispCrop_) {\n \t\t\tispCrop_ = ispCrop;\n-\t\t\tplatformSetIspCrop();\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":["v4","3/7"]}