{"id":21489,"url":"https://patchwork.libcamera.org/api/1.1/patches/21489/?format=json","web_url":"https://patchwork.libcamera.org/patch/21489/","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":"<20241003074720.18882-4-naush@raspberrypi.com>","date":"2024-10-03T07:47:16","name":"[v3,3/7] pipeline: rpi: Pass crop rectangle as a parameter to platformSetIspCrop()","commit_ref":null,"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/21489/mbox/","series":[{"id":4651,"url":"https://patchwork.libcamera.org/api/1.1/series/4651/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4651","date":"2024-10-03T07:47:13","name":"Raspberry Pi: Add controls::rpi::ScalerCrops","version":3,"mbox":"https://patchwork.libcamera.org/series/4651/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/21489/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/21489/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 3E23EBD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  3 Oct 2024 07:53:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B3B2A63534;\n\tThu,  3 Oct 2024 09:53:55 +0200 (CEST)","from mail-wm1-x336.google.com (mail-wm1-x336.google.com\n\t[IPv6:2a00:1450:4864:20::336])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1E28B6352B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  3 Oct 2024 09:53:48 +0200 (CEST)","by mail-wm1-x336.google.com with SMTP id\n\t5b1f17b1804b1-42caeb4d671so1084995e9.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 03 Oct 2024 00:53:48 -0700 (PDT)","from naush-laptop.pitowers.org ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-42f8025b583sm8740825e9.12.2024.10.03.00.53.45\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 03 Oct 2024 00:53:46 -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=\"KWQ94QDK\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1727942027; x=1728546827;\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=KWQ94QDKcIZTV89oybsdmmfmSpTfAaHuLGD0qu8Jr5I/Xbuh0HJA5q1p8jK1RGeHPg\n\t1kHV6+8T+Ne4p5fmJQ6bJXj/4Bq4vLLnaxBOqcKV3+nOQIIIYD47OUIfajjW/L74lKoO\n\t0cPZYmqPzmIRZb5sS8FDBKMJKtdYnMK2pLi07ggsaSt7hw+JvW2qY3a+ocQKX4pcHY1l\n\tMzCP9ySJd6/iXUNRimO+BiCYABoOYlV8cP3j2v/Jhws5kpnmN5ktyYcyI0YfTmfoLXyq\n\tak5SasclVtDsghvGVc4CxxeE8EHQie69P9R/hmQJ42eNDLKpn40FIu3ZeofPeLZzQQdh\n\ts42g==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1727942027; x=1728546827;\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=nw4HPxRrGRKSqJ9CtqzorEwlIjom8Hno46LtySWfPCCc27NvMGPy49QKe6bG2zmM0q\n\tBghdMHLCTxg9dhdFBWFyZx60j0QAbmLkh9h1aiBarzyjiBzUHkSsuRiugcBjhoT7Hp8a\n\tR0o0YAH0hvfDDNg4SQtgJ8vsvQhYmDywU4BNbn68Eo05SPTGo8STf1wPFdeSpEEOyYvu\n\tvlmy1BUMgmTltRdj/lWQ5d+v/Q95hWgIsPAiFNH92KP8BOADFUzz014/ANyuxlXzBfks\n\tdio1UBxzfzzmtFwAsbHoCFbOtbZRNcYbpgp7cek+K/UcXtckPrArnAwm+eZlEIwOML/Q\n\tdHGw==","X-Gm-Message-State":"AOJu0Yy9OKcckwvJNZ61kMge3MJptojIKNtkStGfmnW3OiQv/v/108bo\n\tdeQ0c7Hy/WCWSnc31m5CuBhxqMccYBErpRUeMLA0ob7x+WPUe3YqvMUn0L3W8yZws/D8Xjx9AFu\n\tv","X-Google-Smtp-Source":"AGHT+IHKYMawzHSvDTiXHCEYRS931DsSrZB2hpyUO9PuGkywAYDDy01hLq1hlxUYtkavZw8PURWWdw==","X-Received":"by 2002:a05:600c:1897:b0:42c:aeee:da86 with SMTP id\n\t5b1f17b1804b1-42f77d30905mr19539405e9.8.1727942027286; \n\tThu, 03 Oct 2024 00:53:47 -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 v3 3/7] pipeline: rpi: Pass crop rectangle as a parameter to\n\tplatformSetIspCrop()","Date":"Thu,  3 Oct 2024 08:47:16 +0100","Message-Id":"<20241003074720.18882-4-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20241003074720.18882-1-naush@raspberrypi.com>","References":"<20241003074720.18882-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":["v3","3/7"]}