From patchwork Mon Mar 21 10:26:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 15483 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 AD386BD80A for ; Mon, 21 Mar 2022 10:27:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B83DC604C4; Mon, 21 Mar 2022 11:27:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1647858426; bh=rLbaYj8GnxZBXheRZS0zJGUD5B9vbjUVd+wuovzMxCA=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=SRvJjC0jj8losWG4q0rgeDk/xfxgRfq0sTVbw7Qd402DLiGZLTj6kK0qWBeU+yoX7 2fFE/ubk71O3cxnEr3Akn1gWbyFSp2vqyQ0CDSaAmZzti50F6XPxFJBz25pbJB9jKZ 6ehEb94KZ1Bq84Y/iLFQzdSMBN2YYnfpats1jAWN3EdG3/4QzXfaZZIe4irFnFTu4v Se3P4yFiWJvEJftocWcdu8MCz8ggi3BipCfZlskSu3InyjdXOXMawM4BVm0YiqjLNz tIlIJLqhzJQa7QJupuwztiaqXhE9YScbBpZOx+V7s3fUKfGI1d6ZzhLqUSc7STo374 NuieLGGxuMZFw== Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AF695604C4 for ; Mon, 21 Mar 2022 11:27:05 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="LijH3ns1"; dkim-atps=neutral Received: by mail-wm1-x32f.google.com with SMTP id o7-20020a05600c4fc700b0038c87edc21eso2739178wmq.0 for ; Mon, 21 Mar 2022 03:27:05 -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=mcQTQAcd7NcnOFXPmjEdt880EuL0x49DRM1VxkeUukc=; b=LijH3ns1BEgdR5CwwWT5MF9/Hp94c0UPQpdq7aQIC+HLBoRtpsPF4y7cIUaP60oiV8 d60C0uOnZw5Xh3YzNuHhXthsG1u51Pfthe597kqcgVPJ4yz9i3w4Z3xfJDztYfba0+uO WoH3lAVdPMIrbU4Bjd1Yx9DMFy3TkUqtCc2k/daWnD9L8Kp6lOjOI8r/96zfUVZXPPJr zgtyG6TcHuffIxVxaAqxOb1eBaRjN5leC/DR9UkTxd/kfJ6mFTk3HvZVdZMJpSJh8nPI qeqPCAR+BtkzenzERnP72BtLTh9AVN3MWL9pMJREJlwHuiCN8iT/ah/A6wBYU43i5i4L fhsg== 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=mcQTQAcd7NcnOFXPmjEdt880EuL0x49DRM1VxkeUukc=; b=pXnqw0aMTJceCF36oLCw7TYjtbMU7slrVZng/DCEsEf4V5Cv8mWp7zhpx6CsVI8fl/ QeyPjaTCK//kF/UZky2f9dJdb/hCEdtzj0HTNR+YwMpq6LOwFMIWyprz9sqJCXcrDHz1 UdQpucs+Y1cjytIrh1r5FH7U5MmPfMU8cyfYdvUJfgrRoBaZubP8Je1G8L4J3n0Il4ks hlIIlu3cHg+D0qm0WUNUdVCgjpyHva2didFEd/educxhReNkyXl8tcpgxmH3CBOLGHBF pRBbwqV6Z1r6BhgCBb1TXoREoDBLdzw1v0mi+JrOMoi7vnlU3u/6sXrSfLsqdv+sHyAe zNpA== X-Gm-Message-State: AOAM531qX+B5NDEa/2TRlZO0B7eid4MFLwV/GiVxreWujmLNIIcmXw+u 6U19EWnMF4nC4L8SfSiGUwSiUueWuE3obQ== X-Google-Smtp-Source: ABdhPJwBfCL951jTnOh4S/KVJbUaS7k+zY0Fy8U9dyOZIPUX2ZFVKP3JrNEc6wXAKqxs+P7wkrqqCw== X-Received: by 2002:a7b:c110:0:b0:38c:8dbd:c199 with SMTP id w16-20020a7bc110000000b0038c8dbdc199mr12585602wmi.173.1647858424986; Mon, 21 Mar 2022 03:27:04 -0700 (PDT) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:77bd:7c6c:a8b9:8855]) by smtp.gmail.com with ESMTPSA id v10-20020a056000144a00b00203df06cf9bsm13530115wrx.106.2022.03.21.03.27.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 03:27:04 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 21 Mar 2022 10:26:57 +0000 Message-Id: <20220321102702.1753800-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 0/5] 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, For version 3 of this series, I've removed the patch to add a timer that waits for 5s after stop() to de-allocate buffers. David and me have had a chat about this and we think for now it is best that we have fully deterministic behavior for buffer allocations, and avoid CMA fragmentation on the Raspberry Pi platforms. Apart from that, I have renamed the reallocate flag based on Kieran's suggestion. Regards, Naush Naushir Patuck (5): 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: Empty the V4L2 buffer cache on streamOff() include/libcamera/internal/v4l2_videodevice.h | 1 + .../pipeline/raspberrypi/raspberrypi.cpp | 58 ++++++++++++------- .../pipeline/raspberrypi/rpi_stream.cpp | 13 ++--- .../pipeline/raspberrypi/rpi_stream.h | 2 +- src/libcamera/v4l2_videodevice.cpp | 16 +++++ 5 files changed, 61 insertions(+), 29 deletions(-)