From patchwork Thu Aug 8 10:23:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 20832 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 E7058C323E for ; Thu, 8 Aug 2024 10:23:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E506A633AC; Thu, 8 Aug 2024 12:23:51 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="lOSO9bNo"; dkim-atps=neutral Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6D7E16337F for ; Thu, 8 Aug 2024 12:23:47 +0200 (CEST) Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-368712acb8dso447233f8f.2 for ; Thu, 08 Aug 2024 03:23:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1723112627; x=1723717427; 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=+/STe4ThVU9OKTfydcOuaJT8p+RpiuamPQ1PRGTFiSM=; b=lOSO9bNot3HWVatkkTg7LYpeoXZsEO3bz2is4znVz/GJUEeiiI3p7pl7hBSdUSdN3W Va1veh/vbonC/WSCndK9Jx4cabnJm8isKe/E5hwu7oj5lrWjVbVmg3tFuILK8E8HskdE tKqT4E49WprPnPGLGGbIC994Bv8TfH852FhsNH63xGMghZFXzUsT3WST7SN7WGSTBQL9 Q5RS1qx8nN+hKILGXAJlL2hggvWVaU/BHAn0kS5TxZ9TvW423cRzGCLV5M8RS1gNUspp K3JEjkTJPi0BhcYnEcMaLlWfkxNB+2Vt6RnAhs/LXEDptkuaoSpMF/XKi1EOnOkgNCJp pGAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723112627; x=1723717427; 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=+/STe4ThVU9OKTfydcOuaJT8p+RpiuamPQ1PRGTFiSM=; b=uLuis5+pwWJY4EgCS9L+AiMrQINVXqXazlxNYIIhb+OLRmrloEaWVNt3P6fWMrJc/0 tKucpjB+g9ECq2/78nu4bN0LV6LpDpSGd8AE0F6WTopP3Za4v9bUoid91wmOuSJhbVd1 /mAAXylftW3B/ZsA2sguGeISyieIZZaWKM0u4kepVkp8EIP+z6dVxG04qBztEsE4VyHp ZxOeuXBWBP5Xyc8eDoI3ZJ9QgD39aGVBVDfqFOmgiCiDgI/BPS0fiEl3WPsYBh6wpVXO dPWXWQWcmIc1LygzBQfNApPMOTrIbje1aLwh59YAxBH7WSMUZ/1/suoJAbDwjBxyJksB L40A== X-Gm-Message-State: AOJu0Yw9TX3/wx50gxTHQLwAG7wLtE23jZvpZBFlG67/4LZsFJ9NE+a+ Nid0g3SjtO/oanC4mJLX3rzv3xzM6NI8iWpxH2M1L/R5MONwiB0us0YIWqEHWcFuCQCg9x7vHhG K X-Google-Smtp-Source: AGHT+IFpg3HYxx1TrsdDAbcTzj3ebcwAhd9DhE9eERgd/zbIQ13zBmFgttBOPD+Bes63xI+BMLusxA== X-Received: by 2002:a5d:6e0c:0:b0:367:8847:5bf4 with SMTP id ffacd0b85a97d-36d273d43a2mr1099085f8f.10.1723112626577; Thu, 08 Aug 2024 03:23:46 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 03:23:46 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck Subject: [PATCH v1 1/7] controls: rpi: Add a vendor rpi::ScalerCrops control Date: Thu, 8 Aug 2024 11:23:40 +0100 Message-Id: <20240808102346.13065-2-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" Add a vendor control rpi::ScalerCrops that is analogous to the current core::ScalerCrop, but can apply a different crop to each configured stream. This control takes a span of Rectangle structures - the order of rectangles must match the order of streams configured by the application. Signed-off-by: Naushir Patuck --- src/ipa/rpi/common/ipa_base.cpp | 2 ++ src/libcamera/control_ids_rpi.yaml | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp index ee3848b54f21..463f6d384c9e 100644 --- a/src/ipa/rpi/common/ipa_base.cpp +++ b/src/ipa/rpi/common/ipa_base.cpp @@ -71,6 +71,7 @@ const ControlInfoMap::Map ipaControls{ { &controls::HdrMode, ControlInfo(controls::HdrModeValues) }, { &controls::Sharpness, ControlInfo(0.0f, 16.0f, 1.0f) }, { &controls::ScalerCrop, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) }, + { &controls::rpi::ScalerCrops, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) }, { &controls::FrameDurationLimits, ControlInfo(INT64_C(33333), INT64_C(120000)) }, { &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) }, { &controls::rpi::StatsOutputEnable, ControlInfo(false, true, false) }, @@ -1070,6 +1071,7 @@ void IpaBase::applyControls(const ControlList &controls) break; } + case controls::rpi::SCALER_CROPS: case controls::SCALER_CROP: { /* We do nothing with this, but should avoid the warning below. */ break; diff --git a/src/libcamera/control_ids_rpi.yaml b/src/libcamera/control_ids_rpi.yaml index cb097f887e16..3d4a305dd8f5 100644 --- a/src/libcamera/control_ids_rpi.yaml +++ b/src/libcamera/control_ids_rpi.yaml @@ -26,4 +26,19 @@ controls: \sa StatsOutputEnable + - ScalerCrops: + type: Rectangle + size: [n] + description: | + An array of rectangles, where each singular value has identical functionality + to the ScalerCrop control. This control allows the Raspberry Pi pipeline + handler to control individual scaler crops per output stream. + + The order of rectangles passed into the control must match the order of + streams configured by the application. + + Note that using different crop rectangles for each output stream is only + applicable on the Pi5/PiSP platform. + + \sa ScalerCrop ...