From patchwork Fri Oct 6 13:19:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 19114 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 C6D0AC32BD for ; Fri, 6 Oct 2023 13:20:14 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 59C126298B; Fri, 6 Oct 2023 15:20:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1696598414; bh=id5qaN0AlQ0dZvG0XNQj6kDyQVGgWcUJ0yI/mdjCs2A=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=eBzxkSNNIcrk6JFN3CdgaW5N9qLn0g5Ys/lkgZLqajIae9AHKa1el8wlNmhJF+QTl yktXAyj+qqybzd68Cj3J1UvZ5N5iflfeGXsGoApmCl03hu8ZwVufeJ70sCY9HiaVEU ZPPo6i9u9MXDO6xcI787UqHuMgs3EDfhrdXIIgMiVNBgJyR95ncLn/xyJdqWoXdb/l uPjI/XBAiHa2uA1JPkWjLZ0RNJQf6RI3sXqOYgiL+v6NeIhcKU3GqpftM9zJEU/Xdq yDoatWrLiXtJ1UES3kVpNbl9RZECFGrOuCo+/imWizIbo1eWP6+157U60ZKOhZHB3S 8/PSLlV5xbVYQ== Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 715EE62976 for ; Fri, 6 Oct 2023 15:20:12 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="N95pZuTd"; dkim-atps=neutral Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3247cefa13aso1927495f8f.1 for ; Fri, 06 Oct 2023 06:20:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1696598412; x=1697203212; 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=tBYDcv/H5q0eN5pmy8TnArjyUVyQOyyVCfr4S8C4GtY=; b=N95pZuTd09whPZ+jOg5Sm/w7tOe22MVNJ5onx5XU+vReErmiMYRjWDUGiD/5vRKDTX 2auhTZT6QJZUVDOQKX7PcYIj22PKprlqcVSZx7cGM7pQEtSr1KDunmrVNmo6RMuvXCik 33zdhTIv7QllZ978DAQ+V+eR5jMHMMg7K4JdUAEH6Crf1B92vDVASermY9EWokFYuft1 1aGN5O+djh0rn8HQP6uQY4lTKxAo/9ciuMwooAB1M25GVlOSTRtYxlUdO55lzjm59Jut F78IEvJ0lNvC1g0oW1ikn8d6nOSRVQhhSSg9QswUdq9vCe5Yrw+wJ1QankZY0QiHa8ct QLCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696598412; x=1697203212; 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=tBYDcv/H5q0eN5pmy8TnArjyUVyQOyyVCfr4S8C4GtY=; b=B2B2HFIP6i3RyMc/FBZvPLfTLWp2sIJq1qNo32tYqQHhVah1KFWR/r8o2KiAZKshgv U/mjs2PRyHIgoFcfFq1g1c8X6tKuDvfqhz4Cl9oyitKdqzbAsrXT1gCQbWNnFQi1hyHF uq7iaQhjkuv7uEGaUzo4nRKrDMNQm0h9cU6ZwUr2eRUdegDKUL5uD1xlfP2UgH79I9rh 4Pn6Wga2X8AHL82U5U9+WSYQsvKw1MazXjEMPHT8FXJlYIM7xdyyhahBVdPA7Nu+cRHJ UK+SmddyYG/ieQLVqCr78FlxQf09UFIYCDuDWCM3EDEvN1QD0OBK+L2AuaQn8/mvjHQk YVSg== X-Gm-Message-State: AOJu0YzVgFOKLbA6wPGPgqam7GMW4/xGlslSGXX0hB/tnxrhOY2SJCYs C4orWVI0n4hwZ8g6i8cvrU1EalvLHWnD5fUFMUKkyA== X-Google-Smtp-Source: AGHT+IHcZw9MlEC43NBmgnItQ2wOyGmdoFLGb2xHhk52tTtMlYO/bDi2b3SSQeSrbCKZg4MmohToRQ== X-Received: by 2002:a5d:6b82:0:b0:319:5677:f832 with SMTP id n2-20020a5d6b82000000b003195677f832mr6828786wrx.62.1696598411882; Fri, 06 Oct 2023 06:20:11 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id m8-20020a056000180800b00321773bb933sm1639478wrh.77.2023.10.06.06.20.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 06:20:11 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Fri, 6 Oct 2023 14:19:52 +0100 Message-Id: <20231006132000.23504-13-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231006132000.23504-1-naush@raspberrypi.com> References: <20231006132000.23504-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 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 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 fd6f2efc6e27..25e6a4383bf6 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_;