From patchwork Mon Sep 30 14:14:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 21431 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 1D85CC32DC for ; Mon, 30 Sep 2024 14:14:14 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 770D46351F; Mon, 30 Sep 2024 16:14:13 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="HqFz9LL9"; dkim-atps=neutral Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5CE6563515 for ; Mon, 30 Sep 2024 16:14:03 +0200 (CEST) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-42cae563348so6164465e9.0 for ; Mon, 30 Sep 2024 07:14:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1727705642; x=1728310442; 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=Zt0s6lzWL4fOCXcqP0tX9PfDzIzeRQYXMu6WNo5LCG0=; b=HqFz9LL93oQrvaG7jPvAovf7F3C+DI5Dg1IboBKzjpXw8ztm+juOjazVMMP8H9w0JR Xz9i9z4Ld5Sp+ny+sdw8DuMpJ7aIGjfK49MecsfnQXEUXIEdumE+fjC5ZnjaQeAry8er FjiT0FX7c0IcVZH6sIh4T+0TAOnaMv8YUFWblpK8T8aak7knCd+5yJw0RVcsfZMuEXfA lxp/ZVK2LfcNiCcDYKKZtAtqdRsVKHSOt0waTs2D4BsLzW2SEtRmY9UwC4e9ouGioTkV UohE7L3EaTVILieiGR8yJefxyh/zDLEaFI+fqR/Y6WnWSKHY2kuU1syDpwWapkSNkOSL OPXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727705642; x=1728310442; 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=Zt0s6lzWL4fOCXcqP0tX9PfDzIzeRQYXMu6WNo5LCG0=; b=AhEUqnAfWivULBVUjmHaho4F80y/ZjVvo9mHmjTIh6XobA0bir+mQeYa2uKmOz7rH4 dcQD7rm6palPEjVY1QRRKl5g1cy+UnvlkBOH4Suyt0JmBOewfFt6Qjkp/GxM0l9yMyqO DwBJgxYOjGxmXKASB7do1DEZvHuIXEDbZNhnhRMteG7703GmWZlj9hTcJxrcTTaDp463 4FMXs/S+bY3FrQlmouy5yFLpYENiH9UP8SIaJPxPitf1mR3N73Jio4IN2z4R34NFULdV mmsbB3dySBcc/ffTLsw3FROh/3E6VeU83gj8vlnnID2g/aeJ8tGa++ATRG9NrLUYGV58 tX0A== X-Gm-Message-State: AOJu0YzhH6JVTen7Ydpm7W7M+QiwxsbM2+ADhAZX4o5MfNIOWmT94Ipa kzLNFwTvc7L3hqrTOL7OTP/jbR3Q8/osesdfjxbnouPsPtEJEreCOQJO/gmoEFTgIaErdGezGs/ A X-Google-Smtp-Source: AGHT+IEhfQLVZFkkE4E3I1TehvT+Hw6MtoPiqs8nHDnlXHLxpu4LBa13ZULcEhuNJFG+wil6kdSnVw== X-Received: by 2002:a05:600c:4711:b0:42c:b995:20c2 with SMTP id 5b1f17b1804b1-42f5e389525mr28924775e9.3.1727705642532; Mon, 30 Sep 2024 07:14:02 -0700 (PDT) Received: from naush-laptop.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37cd56e65c3sm9142524f8f.60.2024.09.30.07.14.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 07:14:02 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , Laurent Pinchart Subject: [PATCH v2 6/7] pipeline: rpi: Pass ISP output index into platformSetIspCrop() Date: Mon, 30 Sep 2024 15:14:14 +0100 Message-Id: <20240930141415.8857-7-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240930141415.8857-1-naush@raspberrypi.com> References: <20240930141415.8857-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 9d23a1994f00..3c47411f745a 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).