From patchwork Thu Oct 3 07:47:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 21489 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 3E23EBD80A for ; Thu, 3 Oct 2024 07:53:58 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B3B2A63534; Thu, 3 Oct 2024 09:53:55 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="KWQ94QDK"; dkim-atps=neutral Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1E28B6352B for ; Thu, 3 Oct 2024 09:53:48 +0200 (CEST) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-42caeb4d671so1084995e9.2 for ; Thu, 03 Oct 2024 00:53:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1727942027; x=1728546827; 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=IUr6Lw+NnsqPBWYBrmq0WF1o8u+vmudIqx4yHm1X3FA=; b=KWQ94QDKcIZTV89oybsdmmfmSpTfAaHuLGD0qu8Jr5I/Xbuh0HJA5q1p8jK1RGeHPg 1kHV6+8T+Ne4p5fmJQ6bJXj/4Bq4vLLnaxBOqcKV3+nOQIIIYD47OUIfajjW/L74lKoO 0cPZYmqPzmIRZb5sS8FDBKMJKtdYnMK2pLi07ggsaSt7hw+JvW2qY3a+ocQKX4pcHY1l MzCP9ySJd6/iXUNRimO+BiCYABoOYlV8cP3j2v/Jhws5kpnmN5ktyYcyI0YfTmfoLXyq ak5SasclVtDsghvGVc4CxxeE8EHQie69P9R/hmQJ42eNDLKpn40FIu3ZeofPeLZzQQdh s42g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727942027; x=1728546827; 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=IUr6Lw+NnsqPBWYBrmq0WF1o8u+vmudIqx4yHm1X3FA=; b=nw4HPxRrGRKSqJ9CtqzorEwlIjom8Hno46LtySWfPCCc27NvMGPy49QKe6bG2zmM0q BghdMHLCTxg9dhdFBWFyZx60j0QAbmLkh9h1aiBarzyjiBzUHkSsuRiugcBjhoT7Hp8a R0o0YAH0hvfDDNg4SQtgJ8vsvQhYmDywU4BNbn68Eo05SPTGo8STf1wPFdeSpEEOyYvu vlmy1BUMgmTltRdj/lWQ5d+v/Q95hWgIsPAiFNH92KP8BOADFUzz014/ANyuxlXzBfks dio1UBxzfzzmtFwAsbHoCFbOtbZRNcYbpgp7cek+K/UcXtckPrArnAwm+eZlEIwOML/Q dHGw== X-Gm-Message-State: AOJu0Yy9OKcckwvJNZ61kMge3MJptojIKNtkStGfmnW3OiQv/v/108bo deQ0c7Hy/WCWSnc31m5CuBhxqMccYBErpRUeMLA0ob7x+WPUe3YqvMUn0L3W8yZws/D8Xjx9AFu v X-Google-Smtp-Source: AGHT+IHKYMawzHSvDTiXHCEYRS931DsSrZB2hpyUO9PuGkywAYDDy01hLq1hlxUYtkavZw8PURWWdw== X-Received: by 2002:a05:600c:1897:b0:42c:aeee:da86 with SMTP id 5b1f17b1804b1-42f77d30905mr19539405e9.8.1727942027286; Thu, 03 Oct 2024 00:53:47 -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.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 00:53:46 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , Laurent Pinchart , Jacopo Mondi Subject: [PATCH v3 3/7] pipeline: rpi: Pass crop rectangle as a parameter to platformSetIspCrop() 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 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" This will be required when we program separate crop values to each ISP output in a future commit. 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 | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp index 11f1bfd4a5da..2de6111bacfd 100644 --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp @@ -1314,7 +1314,7 @@ void CameraData::applyScalerCrop(const ControlList &controls) if (ispCrop != ispCrop_) { ispCrop_ = ispCrop; - platformSetIspCrop(); + platformSetIspCrop(ispCrop); } } } diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.h b/src/libcamera/pipeline/rpi/common/pipeline_base.h index 5161c16e518f..d65b695c30b5 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() = 0; + virtual void platformSetIspCrop(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 e5b6ef2b37cd..0ea032293bc9 100644 --- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp +++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp @@ -109,9 +109,10 @@ public: Config config_; private: - void platformSetIspCrop() override + void platformSetIspCrop(const Rectangle &ispCrop) override { - isp_[Isp::Input].dev()->setSelection(V4L2_SEL_TGT_CROP, &ispCrop_); + Rectangle crop = ispCrop; + isp_[Isp::Input].dev()->setSelection(V4L2_SEL_TGT_CROP, &crop); } int platformConfigure(const RPi::RPiCameraConfiguration *rpiConfig) override; @@ -707,7 +708,7 @@ int Vc4CameraData::platformConfigure(const RPi::RPiCameraConfiguration *rpiConfi Size size = unicamFormat.size.boundedToAspectRatio(maxSize); ispCrop_ = size.centeredTo(Rectangle(unicamFormat.size).center()); - platformSetIspCrop(); + platformSetIspCrop(ispCrop_); return 0; }