From patchwork Thu Aug 8 10:23:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 20837 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 EE232C32D7 for ; Thu, 8 Aug 2024 10:24:04 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A2D64633C3; Thu, 8 Aug 2024 12:24:02 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="NL1LjAMi"; dkim-atps=neutral Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1827B6337F for ; Thu, 8 Aug 2024 12:23:51 +0200 (CEST) Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2f035ae1083so7481681fa.3 for ; Thu, 08 Aug 2024 03:23:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1723112630; x=1723717430; 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=VjueByByZqvccxa/i0QAXN2/rnotxj6xlf7+JpUcICE=; b=NL1LjAMiOcHdV39I80vkqrKKxRrAoDYQJYhyDvnmU82z+iVuQJBwb9mTnuwFUnfecH BwZGgabngZtzOUA3b293IjDvQipMMQtiSi07VSnTvfhJJMg2GB9btSvBzEgn/GCkfKD6 wAVHUvh3mDGQcokmG+EkbxhkgMb1gIsKhFNYBlXGVNKRoZ34i1Su/l/08pqYCsWCBNul vv3GWrGESj7w6Yds1lGcP48ydEizeXU7DwBl20M+M6M93rIw06R3l6c49AtRT+KOod8E ACW8PbXizEaXi7Yeabp84sVnF1SJWGnh9MZy0/jzj2XkzKzptXgnZOx0soFxdhl2n9KO GuRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723112630; x=1723717430; 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=VjueByByZqvccxa/i0QAXN2/rnotxj6xlf7+JpUcICE=; b=CbzI9P92MnSlJ3jb5BdfuiixouLqXvGuprF7Adja+ayKFTu/ArQejrYJpn4TIlnvFT W8P0H72+tBEYxuQxWiH3I0asKyaxkVoCevLl8XavP+Av96vRcmVX3IkZjkpLJI8HWC1V yjcT3zb7k1UXGsl0IZiTn2sh8IF69XLFaMHXtAfXnxtcn808fAa+sR5TKNStkmc4996A DqUhf5T+RaBvVVWiLRk2PGu05fxpO7JM2BcvQA+MAvJ1qBCM5Ywr1R7URtJ5emngTvkU taJX9i2+VH19sZN0asSCjg1yNajtbyORc/w3O0nn1BVAVNH0UgNlpVT5gyJK/HnoWet6 XKCA== X-Gm-Message-State: AOJu0Ywnf32AWrgAOrpH3bIXMYx3N2e6KW+puSGn3xFgIPwhx1eiduIA M4Hjt1FdS9cfcXWLmZSJshMWe9DxGgUkW1Vx/OUMVcFYfjxWoJxlCuRZb7qcG8rGIWnqqHZqq2x t X-Google-Smtp-Source: AGHT+IHHvbyJV9J2ORFB/SNQ8SaTTLjCAQ+SFLF0al0KAqRC6nPfOVhy37Rh48UpQU5f8UrtKGr9uA== X-Received: by 2002:a2e:90ce:0:b0:2ef:2d5a:485 with SMTP id 38308e7fff4ca-2f19de86b91mr8825831fa.46.1723112629898; Thu, 08 Aug 2024 03:23:49 -0700 (PDT) Received: from naush-laptop.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36d272290c2sm1404234f8f.92.2024.08.08.03.23.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 03:23:49 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck Subject: [PATCH v1 6/7] pipeline: rpi: Pass ISP output index into platformSetIspCrop() Date: Thu, 8 Aug 2024 11:23:45 +0100 Message-Id: <20240808102346.13065-7-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240808102346.13065-1-naush@raspberrypi.com> References: <20240808102346.13065-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 --- 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 412e71648231..a6ea4e9c47dd 100644 --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp @@ -1317,7 +1317,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 0ccfa4e82e86..7959d874dd6f 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 ffc45653daf1..04fb3c066baf 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).