From patchwork Fri Oct 13 07:48:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 19135 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 96FA8C32BD for ; Fri, 13 Oct 2023 07:49:03 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3611D629A1; Fri, 13 Oct 2023 09:49:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1697183343; bh=laC4WmX5dHbJ/iHze+vwusWOUuOXhEdsffSbd9YGUYw=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=gMadSTw7bC056I/94rg85fAzzNlC/rIGU1dQKq8VcQFC0zb2LoLOHgNfbZLrjx6B7 H8fMC9Z3r65jWImoGDkEFR6itAUcrde5K1wCkC4dhPaFUR81hl49HWfKMbpS3RBxBg NOm9B0kehFP0SGNEsBeAfAGsEDdQf2uw/gWXxja3Ec3jyI0l68ke9x1UtyT1cL2UKC xG/0VGAj7NCkhDGAjtAxQNSyBB0ChLXNdkKns6jk418WKZReUfPaYULg85NcDkrcat fOVDGDFHaDqtpqkhstqROVv0WJ9zSRkKjRows2chO3qmyras0JMduY+hS22MtAGydn pMScfrDOmBpfA== 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 9E7CD62987 for ; Fri, 13 Oct 2023 09:48:55 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="n6NfM0oj"; dkim-atps=neutral Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-406618d0992so18911255e9.0 for ; Fri, 13 Oct 2023 00:48:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1697183335; x=1697788135; 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=fs9TmN/NmB3KCzxAJfMZtU6Q37Dpqb4i7HZcupMowb8=; b=n6NfM0ojPVILUmm5Vb13f55fYTJJGOstYyeaSTILV/jqWoYGbZO5ZuuMtz7on4ry3v 0AZW6nidS/bkdYDpw8YGOzg/41i6ruUHqAGMzkhk1yjanJV91GmKEZw+hMcLva9MMJgA zojgNYUjjMzxdjQlIraYJm6uaAnvd3j2G/ky1TV9NduVLiBnp7kKgsy1sw1IQcQWc+Wt 71otk0PVJGxv0nGzxeOKbcMh9uG0RV8jy17SP5P5+lzA0G+Qyla4YtKPNWUhAjfCSNLc hGoCX7kNNbNPoFywqSjQvTdX3T8jBUuWNaD7ksaFTulCq00WZcRZotYMabCYfEyePWrN h1+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697183335; x=1697788135; 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=fs9TmN/NmB3KCzxAJfMZtU6Q37Dpqb4i7HZcupMowb8=; b=njJuLi9oj3CxWDmwxRk+Tgh8mswW9nSIc2GLEBTOSNsFpRdMj54YqoVpDRd/AkwMHd CBovlhT2LC2RAJEfy7OZMB4HQRkSJICIzojhmQCIDo7y/CiyejSoTsgaerG5L62bb1Yz /B8rp/MFjVqmaFlVkC2Haq8OWfpWzCgU1bD7uacZ5NH4V799fh4hwGkO1Ljxxa+sxNTz HnyazPITu6ibYDk+TPu3NjavIR8YIgvRiIH4HJyi0q3H9gg8YaL+9qT7QbUfuqO0qF0B qXIZwmvx66npe3P51O6d5yvOW1DsgwOO/hS4E2031eZp8UuEH5t+ZK54+hnSPGXNUJ/D FR1g== X-Gm-Message-State: AOJu0YwASKWcDWBFBUeX4K0rYzD6QhsmKy6VZfXZBF3kMyzmJhbq1DfP fC1cU3wrNLrCgEu0CEgXO4yz3mx6syTM4AqDUKkDdg== X-Google-Smtp-Source: AGHT+IH5Nih2aSqUcjcudbqO3grdLn+/r+Qsx7U1W3+bfUhcG4tUdLU/S0uImjAd90GF9rOXMDYrvQ== X-Received: by 2002:a1c:f709:0:b0:405:3b1f:9691 with SMTP id v9-20020a1cf709000000b004053b1f9691mr24010464wmh.11.1697183335036; Fri, 13 Oct 2023 00:48:55 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id m16-20020a7bca50000000b003fee6e170f9sm1791890wml.45.2023.10.13.00.48.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 00:48:54 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Fri, 13 Oct 2023 08:48:33 +0100 Message-Id: <20231013074841.16972-13-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231013074841.16972-1-naush@raspberrypi.com> References: <20231013074841.16972-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 12/20] pipeline: rpi: Add SW downscale status to RPi::Stream 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: , X-Patchwork-Original-From: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Cc: Jacopo Mondi Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Record if additional software downscaling is needed for a particular stream in the RPi::Stream class. Additional software downscaling may be needed if the user required downscale factor is greater than what the ISP hardware is capable of. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Jacopo Mondi --- src/libcamera/pipeline/rpi/common/rpi_stream.cpp | 10 ++++++++++ src/libcamera/pipeline/rpi/common/rpi_stream.h | 11 +++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp index 20864aeed2d1..70f115f17977 100644 --- a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp +++ b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp @@ -57,6 +57,16 @@ const std::string &Stream::name() const return name_; } +unsigned int Stream::swDownscale() const +{ + return swDownscale_; +} + +void Stream::setSwDownscale(unsigned int swDownscale) +{ + swDownscale_ = swDownscale; +} + void Stream::resetBuffers() { /* Add all internal buffers to the queue of usable buffers. */ diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.h b/src/libcamera/pipeline/rpi/common/rpi_stream.h index c5e35d134926..fc2bdfe25d4a 100644 --- a/src/libcamera/pipeline/rpi/common/rpi_stream.h +++ b/src/libcamera/pipeline/rpi/common/rpi_stream.h @@ -86,13 +86,14 @@ public: using StreamFlags = Flags; Stream() - : flags_(StreamFlag::None), id_(0) + : flags_(StreamFlag::None), id_(0), swDownscale_(0) { } Stream(const char *name, MediaEntity *dev, StreamFlags flags = StreamFlag::None) : flags_(flags), name_(name), - dev_(std::make_unique(dev)), id_(0) + dev_(std::make_unique(dev)), id_(0), + swDownscale_(0) { } @@ -104,6 +105,9 @@ public: const std::string &name() const; void resetBuffers(); + unsigned int swDownscale() const; + void setSwDownscale(unsigned int swDownscale); + void setExportedBuffers(std::vector> *buffers); const BufferMap &getBuffers() const; unsigned int getBufferId(FrameBuffer *buffer) const; @@ -139,6 +143,9 @@ private: /* Tracks a unique id key for the bufferMap_ */ unsigned int id_; + /* Power of 2 greater than one if software downscaling will be required. */ + unsigned int swDownscale_; + /* All frame buffers associated with this device stream. */ BufferMap bufferMap_;