From patchwork Fri Oct 6 13:19:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 19104 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 CAEB7C32B6 for ; Fri, 6 Oct 2023 13:20:02 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 17D406296C; Fri, 6 Oct 2023 15:20:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1696598401; bh=suH0PJIgEqPYNksTKJuL5bMOo1kXPdifvQWKd+ecGoc=; 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=wpcx6pdMx5nPshIIujyFT6asBu7xFyZH3oIBFJD7MTxQ+P2XyBmCuolmcSaWOOO9Y rjfaaY66KI3Q0+EAqzcUNLnHh8bweRt0tBtFQomOME4yXnaOm0/EW8OWYL/CMxHQbd knA1tqFGj9pH25eJEu4v5oE/JvpWaZhRgwVikxB2UIdFmSm7Yt9j5L6YI1fbM3v8I7 Yum6E9SXjcmcUYc4JQKWQYywMEwX5aciHYseu4ua9zvhKOvr5P5n2WkGTccbEn1loX KRQy2l0tOoHLOexxgRaPRovoHIpCqCbjlQoOU38X1irJ5x4WDNDSdj+6N9YbbEOwGe JEcSPgdQPxIYQ== Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3B90A62961 for ; Fri, 6 Oct 2023 15:19:59 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="q5Q7tNiu"; dkim-atps=neutral Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3232be274a0so2013791f8f.1 for ; Fri, 06 Oct 2023 06:19:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1696598398; x=1697203198; 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=iaJ6H3b9VuzhIwenAA8wBuE39LFc+MtAJZU0c3sCiBo=; b=q5Q7tNiucHlsce62xH2qVPHbXlVKL94Z1WgPn1u3y6p1DD3DCYQWiY7MQkTGkqT+4J ICQfcEPeMBS1kuKBrQgDznHCXExb1JKb8yPzVcJu72hxtfZK4i3lcOc0/kZHHUu9lplZ KUMszuhSiKhLAw7rjgJdXEB8aZoC+aS0muvX0ezK+KzaQaSR418u9pB1dRT2ZAtc9DwY ILm64aXcsdA60Bfge+qv+QZoWzjr+HM+uvrwdtiW0gcogRx77u9f1ogEY/5jMwMLc0uc S8+Lb+t2AUT4LIwhziaz4ryq32P8yi9bV3gKcc38Rf6MtiKQMVzWfoZoc9C+woQfaUQ7 F5nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696598398; x=1697203198; 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=iaJ6H3b9VuzhIwenAA8wBuE39LFc+MtAJZU0c3sCiBo=; b=d7b806zpYz5u9QeJazSEuat/XmyLSF3ptBxhiVc0/WyfRUhEqUB2sIK8D4t3WishIG nOL7GnvKZRJRWih0L8FM5EBLE/zobBLPF05w4mG6DCj6vTTnQU1Rc3SBB2LpbosIZn/D bIDfnP5l+aFoIJeBkGrnmDa0E5DN/60/3DkQC+QRY45vg3juvqrbchfmzz3kI05Pn1yA mEYlGCYLBJ0Xe+hNHu/HuQlGyqB3dC0TTC0AqCw6xP4SZgUonfbLVo0Y/2AFxYKHRWbr DBBMqJUlnfb132xHqB4NVK0LRJY9RBtdd5tcRNA2uIm7UXhZ5+1MhyJIILL6+oiPPNWb TRmw== X-Gm-Message-State: AOJu0Yw81epG8UDOq2aFhPxMSzwlZP/NpWan9XRk/JjjkcMBmpwSbGm3 M3IocWWswQKsOrJHOaJzE0dEQidZ4psROPbgoI3gWA== X-Google-Smtp-Source: AGHT+IEi9hBaD5Zd1EsPHXtCYiL6nXHGvk8uF5GWJI5PmNzBxcg0MtwnDTbqa+fBNzsG3LlvUddFbg== X-Received: by 2002:adf:cd09:0:b0:323:1e69:7b4 with SMTP id w9-20020adfcd09000000b003231e6907b4mr3864736wrm.31.1696598398301; Fri, 06 Oct 2023 06:19:58 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id m8-20020a056000180800b00321773bb933sm1639478wrh.77.2023.10.06.06.19.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 06:19:57 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Fri, 6 Oct 2023 14:19:42 +0100 Message-Id: <20231006132000.23504-3-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 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 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 83c2205f7ca0..fd6f2efc6e27 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;