From patchwork Fri Oct 13 07:48:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 19126 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 83CB1C32B6 for ; Fri, 13 Oct 2023 07:48:53 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 44BB562980; Fri, 13 Oct 2023 09:48:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1697183332; bh=vpTMwsBE85smJGdnV8ufWU9wfac7cA+9jg3yj6jEfFA=; 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=VKPECP8UnI1HLqytkisiCh94dSW5KcCi/Lv01uGcn7sZ56C3gT2fMar8cax3EXSU1 gJGjwdn9r8JeThXmyt9kcBxk5NdITS2OE6DMsJ2vuXVZDFq+RziTiSnWwaORoWEsC0 0uYPBQd1dffUMuGewosf6rVLZxl0vnCcWD4zmZjnX9RKprOjSFhq7gG5GHPo0rOyzH sKmFEoitjVXbzPbUCrnW0biEVAfYqPjzaRAOF8rEgLDt5ulD118H6bOZV097XK7W33 bgm8lAIG+tCN7M8Y3MGejLbCiJXiu/HFJJdyCczCXVbatHtssOdjj92PgpbbbrdV6u HdaPPZXfYKOug== Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 13E2D6295F for ; Fri, 13 Oct 2023 09:48:49 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="LsHm5uII"; dkim-atps=neutral Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40666aa674fso18809525e9.0 for ; Fri, 13 Oct 2023 00:48:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1697183328; x=1697788128; 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=kn40iwxfpZOODJIPAGAfiw/6Gmd7I0zdgzH/m35HEcM=; b=LsHm5uIIHM0MVRz6SJklchnLRhqoqvlXqkNqojWyw+OFrrbJCVQfxtkn2eU1KwLwks sGHzGgEEZSzmqOUt/N3DHaFX0SaHq9fAsa8Myqzd6uWtCgf76FcHYjTnBKzmn+iJM9WO U1N7y5Skn0qJAlQZNvdKJZISOsl3zpBbyk7LViYdP1YnkZh/izUVkSRqA5rL4jvyRipC PRtHu2qI9XBKnkEipQ8EL8RX75//u/W2JzJfxebGBkB0/Ctep6WJQ/PqswSf+PgwagV9 HOuMJ2BgFuc6ZiGPoMDomIAvUGPxBhNNJ4giWjhelB/aCAJali2SFVS9HvfqJH3L/icq uVGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697183328; x=1697788128; 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=kn40iwxfpZOODJIPAGAfiw/6Gmd7I0zdgzH/m35HEcM=; b=LuXn2Mb6M2/BaMT7USowMR3IHlI2A7/hG+DPi4tP4Wy/AtzqKleSjLx0DLJ3wxLEtk DpPswrqj3Svh7bhPQtohMj+fDUKcZ+UmPNkXmK6+jXsK7QVUKjkYd+/ZhkUeaLHxBO/A UhASzn4uk6F6t88FNAT/BOdAIVfZxy7zqwH2WB1Mf7EMpzWr0sn+us4uesm7LaLjIAsF P8qSn/WBmUK3wPsJ6m64MvYsFokz9q93GBrkXlWJc+enUH+YTPRmYxm0hRsk4V8rPrbJ DQSsXc8/sh+rYdtpbzdr16LAAdLlgusJQmqwn2zSBn78uk7b6z8adocWypB6cQj8R215 AJhQ== X-Gm-Message-State: AOJu0YxBz+GeXo2IVbUmvshmUSAm2YJEjQ2PjRgcMaQ2o1uOD2WvJfh/ rvrg7I9flHBbiOlIfP6pNQCIpKDCz3oH6xiISnsfdA== X-Google-Smtp-Source: AGHT+IHsFi1NnQ6MrltLBpCb6Fiw2Ia74S36Woz8SA2HMpfCC9wQEYOQyCQG0iVYeCpKekqwmNMCdw== X-Received: by 2002:a1c:7914:0:b0:405:37bb:d942 with SMTP id l20-20020a1c7914000000b0040537bbd942mr23917932wme.4.1697183328243; Fri, 13 Oct 2023 00:48:48 -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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 00:48:47 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Fri, 13 Oct 2023 08:48:23 +0100 Message-Id: <20231013074841.16972-3-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 02/20] pipeline: rpi: Add Recurrent and Needs32bitConv flags 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" Add a new "Recurrent" stream flag. This flag indicates the stream buffer handling/management happend from the pipeline handler exclusively. This is used for TDN/Stitch and Config streams. Add a new Needs32bitConv stream flag to indicate that this stream needs a software postprocessing conversion run on it before returning out to the application. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Jacopo Mondi --- src/libcamera/pipeline/rpi/common/rpi_stream.cpp | 4 ++-- src/libcamera/pipeline/rpi/common/rpi_stream.h | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp index ee827a86b06a..20864aeed2d1 100644 --- a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp +++ b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp @@ -155,7 +155,7 @@ int Stream::queueBuffer(FrameBuffer *buffer) void Stream::returnBuffer(FrameBuffer *buffer) { - if (!(flags_ & StreamFlag::External)) { + if (!(flags_ & StreamFlag::External) && !(flags_ & StreamFlag::Recurrent)) { /* For internal buffers, simply requeue back to the device. */ queueToDevice(buffer); return; @@ -217,7 +217,7 @@ int Stream::queueAllBuffers() { int ret; - if (flags_ & StreamFlag::External) + if ((flags_ & StreamFlag::External) || (flags_ & StreamFlag::Recurrent)) return 0; while (!availableBuffers_.empty()) { diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.h b/src/libcamera/pipeline/rpi/common/rpi_stream.h index 861e9c8e7dab..c5e35d134926 100644 --- a/src/libcamera/pipeline/rpi/common/rpi_stream.h +++ b/src/libcamera/pipeline/rpi/common/rpi_stream.h @@ -70,6 +70,17 @@ public: * to the pipeline handler when requested. */ RequiresMmap = (1 << 2), + /* + * Indicates a stream that needs buffers recycled every frame internally + * in the pipeline handler, e.g. stitch, TDN, config. All buffer + * management will be handled by the pipeline handler. + */ + Recurrent = (1 << 3), + /* + * Indicates that the output stream needs a software format conversion + * to be applied after ISP processing. + */ + Needs32bitConv = (1 << 4), }; using StreamFlags = Flags;