From patchwork Thu Oct 3 07:47:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 21492 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 3A983C3263 for ; Thu, 3 Oct 2024 07:54:03 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 85B2163525; Thu, 3 Oct 2024 09:54:01 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="rjZa180l"; dkim-atps=neutral Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 24DD46352D for ; Thu, 3 Oct 2024 09:53:50 +0200 (CEST) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-42cb0d0311fso797625e9.1 for ; Thu, 03 Oct 2024 00:53:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1727942029; x=1728546829; 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=rjZa180lsOn3j+16nwd8G4vKcPGkX+h+nSm47gKj1YWynRfp2BAKtjPPfaONr+ySLp 0Uk7gMljfAmBSGuThzt3iwCsSjgH5sCDRYlOqxbi5o3sZ8PJJCf3QRWg67VgiwvxJPxk DruJHPdyQx5K89ReaWDUXNss4EodiTNSnDsLRE8znATi94BHNr0SsnbqwwF8nugHFSdo MHGRUGwwOKtMs/cMY4qYL3wW7gCUcJby+/vpvwvmauUGO/iMPXlri++GEWBw1Y9SGarq m+VbpWl35E9mfNPVLhX9BEnhB4zOmV9779XmTGvl1tBD79s9z5rUoH8CdPImCtOo4ad7 MqLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727942029; x=1728546829; 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=SmcTFbp4kXkxRNk5vpfZSYu/fRxL68DYESbXzB/QLagDDYOjlp9RrmNiP+q2a5eBY7 SerHb8VYkHtxdfwOgbGvnhLK+v1vWTwg7n/o3Cnnwc8kpJypz1FvdDmgjAAf+Bo7j3hH 0nh3F7AFYyyfMecYLBqN9bHEb2zFWoQZWKHYHc98IHZ+QH1rNM+bPbp46pDRNrhN36+B HP0e1UQ5MovyIIz0pyCSsT+zwn1zViTzLEzHfsiBcjOJK5aGXKUHCxexhHBVraiz5OQq 1mdYI+Sg2hoZp6nmERcLerLLM4DrDLFC11O2hvsX2Bofe2TbQre4FUthoXnar8CVScXw +sOw== X-Gm-Message-State: AOJu0Yx7pcK3fAnSDSdGG64xNp5byhTY+81eu18VBPqw3OWiaFWr2i+W XYdlFyvCwR0QqWhzZstVbNyUvqR+anpM3z4XbFva09yvfmTjQC/63fRwkNykpIq3Wi8qEz7Pssy Q X-Google-Smtp-Source: AGHT+IGtUUmUoxZajtIDfK46wOvyoL8JBuAtWUI6H7NYxYY4yTvraNd1kikvzohqJwXu9n6n+4ztQw== X-Received: by 2002:a05:600c:1d26:b0:42c:bfd6:9d1f with SMTP id 5b1f17b1804b1-42f777b010bmr21671845e9.1.1727942029335; Thu, 03 Oct 2024 00:53:49 -0700 (PDT) Received: from naush-laptop.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f8025b583sm8740825e9.12.2024.10.03.00.53.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 00:53:48 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , Laurent Pinchart , Jacopo Mondi Subject: [PATCH v3 6/7] pipeline: rpi: Pass ISP output index into platformSetIspCrop() Date: Thu, 3 Oct 2024 08:47:19 +0100 Message-Id: <20241003074720.18882-7-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 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).