From patchwork Thu Oct 31 09:49:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 21787 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 967ADC330D for ; Thu, 31 Oct 2024 09:52:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 79F5A653BA; Thu, 31 Oct 2024 10:52:55 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="SBro7SQL"; dkim-atps=neutral Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C19ED653B2 for ; Thu, 31 Oct 2024 10:52:46 +0100 (CET) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4315b957ae8so840205e9.1 for ; Thu, 31 Oct 2024 02:52:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1730368366; x=1730973166; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KemNgYMBW8186eLynbOGC1vQGWAH0T0PqLUvHvsVvSM=; b=SBro7SQLZlnSTSI/wNKPWehrMz8MkjH3roMTcXUfOHX/4xn+T3GMek0/dzKzJBuicZ W5QjyKMpyYUZv6lK1lIK0FP6amTclI6uxzb0HzpMuAbSyZVKSqfqRu2ZYkv1ToTLnxik iTqJ2LnCdV9ULtXBHw9AE3U6bu/QjpqiLm3hbyWxm4LTL1Mf8eNZfH8bdxhDxWENXa5Z 7vUCLbwatgiMplCAQtbMtk1nmAqiQlRz3KesJdeGaewkfBTcv5D73+rzVOm1H4CvqZRT JOa3NG/gxLSET74Y7v3G/YbXp1bpDGLbpK+ZU4MiWTYS52JsfuObwzAmK+H/XQ5vKWpn 8ZMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730368366; x=1730973166; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KemNgYMBW8186eLynbOGC1vQGWAH0T0PqLUvHvsVvSM=; b=OzT6oSq/rPaA50x4LscwZ0jsIfnmvvm8apUrbVGr9zNnyJ1E5q4+XUdJ4/yqiLMB4z 6ZB7SNwWTrrk21AGtUgO/ndAXydOreYwbPnSWBmURHmhttLZNDTFUKQJokK0/Qo4oGR4 X+SWtogP4x2M2N5YHoiWKKVVDp8Zue/oFIVkkHWAKoU8JLA2RX8P8doDvvlHNkric+4i 3lB6mIUUOZo3QLMj0KR5Xoc9eWvWkatCYUtI6AcU8XACiQ+FcWbd1quieBYWxUU3pL7K kqqJS7k29AgjFI3jlrwMd/yKXqYFQf4l/WWotzj/9QQTteZ2SwXo70IiHMUAkw1GzaGo daqw== X-Gm-Message-State: AOJu0Yxk9lXCGibzVYZjITGJwlJmVFzkR//ZsP3cJ/8+LajClwNbF0bc 24Ej+/5i/8DanRdPcBul2xSUdDjhLDYnL9r7k2H2/UqlwcopoHZ6hUt6ZSyd2Bj44FF02ZGdZ0m i X-Google-Smtp-Source: AGHT+IEzAw/J1YRG6wiA44boXhNlJSqttOw0iEQtR2qF9W2XLUsukVSZZ9XzGhDnUVhpMjcvlZtNTA== X-Received: by 2002:a05:600c:3b9e:b0:430:52ec:1e2a with SMTP id 5b1f17b1804b1-4319ad3ea5cmr72784735e9.7.1730368365924; Thu, 31 Oct 2024 02:52:45 -0700 (PDT) Received: from naush-laptop.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4327d6983c2sm19789835e9.42.2024.10.31.02.52.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 02:52:45 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , Laurent Pinchart , Jacopo Mondi Subject: [PATCH v4 6/7] pipeline: rpi: Pass ISP output index into platformSetIspCrop() Date: Thu, 31 Oct 2024 09:49:56 +0000 Message-Id: <20241031094957.18471-7-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 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" At this point, the index is unused, but will be in a future commit where we can set different crops on each ISP output. Signed-off-by: Naushir Patuck Reviewed-by: Laurent Pinchart Reviewed-by: Jacopo Mondi --- src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 2 +- src/libcamera/pipeline/rpi/common/pipeline_base.h | 2 +- src/libcamera/pipeline/rpi/vc4/vc4.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp index 220c7b962280..267e6bd9cd70 100644 --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp @@ -1321,7 +1321,7 @@ void CameraData::applyScalerCrop(const ControlList &controls) if (ispCrop != cropParams.ispCrop) { cropParams.ispCrop = ispCrop; - platformSetIspCrop(ispCrop); + platformSetIspCrop(cropParams.ispIndex, ispCrop); } } } diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.h b/src/libcamera/pipeline/rpi/common/pipeline_base.h index 9912796ec472..aae0c2f35888 100644 --- a/src/libcamera/pipeline/rpi/common/pipeline_base.h +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.h @@ -83,7 +83,7 @@ public: Rectangle scaleIspCrop(const Rectangle &ispCrop) const; void applyScalerCrop(const ControlList &controls); - virtual void platformSetIspCrop(const Rectangle &ispCrop) = 0; + virtual void platformSetIspCrop(unsigned int index, const Rectangle &ispCrop) = 0; void cameraTimeout(); void frameStarted(uint32_t sequence); diff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp index cfed214ddbd4..fd8d84b14f15 100644 --- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp +++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp @@ -109,7 +109,7 @@ public: Config config_; private: - void platformSetIspCrop(const Rectangle &ispCrop) override + void platformSetIspCrop([[maybe_unused]] unsigned int index, const Rectangle &ispCrop) override { Rectangle crop = ispCrop; isp_[Isp::Input].dev()->setSelection(V4L2_SEL_TGT_CROP, &crop); @@ -707,7 +707,7 @@ int Vc4CameraData::platformConfigure(const RPi::RPiCameraConfiguration *rpiConfi Size size = unicamFormat.size.boundedToAspectRatio(maxSize); Rectangle ispCrop = size.centeredTo(Rectangle(unicamFormat.size).center()); - platformSetIspCrop(ispCrop); + platformSetIspCrop(0, ispCrop); /* * Set the scaler crop to the value we are using (scaled to native sensor * coordinates).