From patchwork Tue Mar 22 09:22:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 15497 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 8441BBD80A for ; Tue, 22 Mar 2022 09:23:03 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BD4EA604DC; Tue, 22 Mar 2022 10:23:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1647940982; bh=gScbv5NNko2KzK/Nlt+j8zhuk7DjKx3ZXygboVKYHps=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=PsTxmzZJpRbEe9lb6nLGgHy8D4lTQzSqcp4topyh+OUxLcarZUWVMqtJabaqyEwwq pUpg4CT6vkhlHjloaHT9hmgJYiNGkhVa4NzqDMSMAoegW/GdahZcWhRp3Dha8B+fE+ PXG9fPb3Q+O8chzPl0eoJhNJSH3VdJMdKXy2pTqQ5gG55XQg2I1t0QA7q7QNGvDJEX mrGreNPBkXIrCvs5Td0EhOEFxoOnzdPwB5RRj+D14smR+4ECzPhvbnvkVwkSoLYVnm ZSMii2DNId/wRujsYdKDRVFba31IyxjKNEd/EK23NMsHs3MYdrfo7Kd3s2PbGYiH8A 43vigPfdzD09A== 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 615D960397 for ; Tue, 22 Mar 2022 10:23:01 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="d+MLppNr"; dkim-atps=neutral Received: by mail-wm1-x331.google.com with SMTP id l7-20020a05600c1d0700b0038c99618859so1027776wms.2 for ; Tue, 22 Mar 2022 02:23:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Ol5KodlK74yFlzD1AUFn38wu4UDC3fq+yapTmjyFarA=; b=d+MLppNr6Fiw8lXggxMrHpTVl91zUAfZl8AoSLP1jm7NEuJDTztFRdA8HeTUGQB+Ru PHqZnYhbyPCJxfUyTnpEzruYRdQNrYKYn/5kD1s7id83P0s+ce2ddOTpfU+00TDx+We1 PC1NZmSndF+uwpRdHezHRHpzTC351cBB+yfR+BWH6/jcQlgfqT7cyMBClFos0KFmMr39 Iz7EdCR5Ns+oMiEdh0ORz+1Drdsv0P3UiHWIFwYRB8J4+7m2/cbiKW35Iv25gXzoljcN GNUMYyF1q/yKHyNEhfbFTzL5w5WiatpDpZQTzHr4EjNRV6/iCJVRboKHXqN7EcF6TOzK d1Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Ol5KodlK74yFlzD1AUFn38wu4UDC3fq+yapTmjyFarA=; b=EYGtkEfB1P8p+GvAkMfAnXknGpJ2bijhc04sYF/DPKyqV2jmi1+HOio+69lzHCZZXb Pg8GeFaTHxbgNbsb0EzH8nCtZgOEo9CIjRyCOeb4YFPOj6xvDgWlbQei474KtxSR4yeX Do2UEAAYeCB/nXHr+d+aaMXe3msXO+WrYI53+2MmVq8ls2ekQEI0Dpf2I4Y+XpRN+L9G IAtbPdD82sgVIKdtY8181p/4A0KNc+MICLwKiJew8Ec5GrW5RuyKpE1K/wYTr9U5IIOl 6YEiLVgPkSsk8wRIr69aGn3mz2FVeMBvqqU5tx5SVWTcMgYgxKt50rCcWgpk2Fpnh+u9 8QqQ== X-Gm-Message-State: AOAM5308CDh7c6Vw/ZWJk5YTEdu/AjMgBvAGOA+vXf6STANARYbAKyZH ZOhTR4zE0aW6xsmT23mvtdwpOJKyASmu6A== X-Google-Smtp-Source: ABdhPJyo4MiVtKxfcDDJjpPuzQB/fw9w9ITnQXVuG3Zt/EPX5ZxUvIWc+w6m/AZXeKCGB0MalQp5hA== X-Received: by 2002:adf:c188:0:b0:1e6:8ecb:ea5a with SMTP id x8-20020adfc188000000b001e68ecbea5amr20910250wre.711.1647940980728; Tue, 22 Mar 2022 02:23:00 -0700 (PDT) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:9e9a:99af:e5a6:319b]) by smtp.gmail.com with ESMTPSA id r14-20020a05600c35ce00b0038c9f469979sm1471695wmq.40.2022.03.22.02.23.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Mar 2022 02:23:00 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Tue, 22 Mar 2022 09:22:49 +0000 Message-Id: <20220322092257.2713521-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 0/8] Raspberry Pi: Efficient start/stop/start sequences 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" Hi, Version 4 of this patch adds a few new commits to fix various things: Patch 5/8 adds some state variables to the V4L2VideoDevice class. Patch 6/8 stops allowing buffers to be queued when the device is stopping. Patch 8/8 adds a test for the new buffer cache isEmpty() member function. Thanks, Naush Naushir Patuck (8): pipeline: raspberrypi: Avoid over-allocation for ISP Output 1 pipeline: raspberrypi: Move freeBuffers() to the RPiCameraData class pipeline: raspberrypi: Free buffers in the RPiCamera destructor and re-configure pipeline: raspberrypi: Repurpose RPi::Stream::reset() libcamera: v4l2_videodevice: Better tracking of the device state libcamera: v4l2_videodevice: Do not allow buffer queueing in stopping state libcamera: v4l2_videodevice: Empty the V4L2 buffer cache on streamOff() test: Test V4L2BufferCache::isEmpty() member function include/libcamera/internal/v4l2_videodevice.h | 4 +- .../pipeline/raspberrypi/raspberrypi.cpp | 56 ++++++++++++------- .../pipeline/raspberrypi/rpi_stream.cpp | 13 ++--- .../pipeline/raspberrypi/rpi_stream.h | 2 +- src/libcamera/v4l2_videodevice.cpp | 34 +++++++++-- test/v4l2_videodevice/buffer_cache.cpp | 36 ++++++++++++ 6 files changed, 112 insertions(+), 33 deletions(-)