From patchwork Fri Oct 28 13:51:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 17728 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 24DA7BDB16 for ; Fri, 28 Oct 2022 13:51:15 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7E93562FEC; Fri, 28 Oct 2022 15:51:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666965074; bh=EpxW1eCv4PqGTgyBl7RrkoBtCaejCL5796aam+eMmtA=; 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=WTB6aADnfnT7cGyRqUVefXxlreuo+Pktixft9m78y68eRG1sYwfOu5OGIIuaCO/PG lcScW45UtYD2W89tp+pvFFSdQgAUpw2MHZVlNk7heVrFMb/dkhf0C//GXm6DIfrFx3 i+ZMnJQNljccJX59GRy2et/9q6FSzOAQGkRywyKjFLy7P6bC8zW0DnzsPB8FzjZfpg EQsDSLT+/4xvtv1j29G7kj32oCwOoDM47D2rUyQkP7rnYArT4u/nxsvdJaJAHeS702 bGPOe2l+XRUBh6aU52DMer4ZEo2T3zwpoYTCBV1NZHajAUAuuBXK4BgX5lELyzMQDV wjECLY2Pb64ng== Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0783561F4A for ; Fri, 28 Oct 2022 15:51:13 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="cSDcaX0H"; dkim-atps=neutral Received: by mail-wm1-x334.google.com with SMTP id m29-20020a05600c3b1d00b003c6bf423c71so6677254wms.0 for ; Fri, 28 Oct 2022 06:51:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; 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=pJZCtAFPEqGnKFw45EueE5fi2brF74zHRaK+U70buTk=; b=cSDcaX0HnH63clwWmkU9WhjGQtEcZ2XB/4hNQ4gff7UQSmBSxTcbM7kTmWo2XG0oHk Epysqtb4oyiQijNnoiZKky3yrlAEkLcJuxNMo4X0BDZfxGxKCL41UY/q+GiMYurbymVm evyHvvB2zUEssB+HeMKWS4/GPJwX7TND7CwEsVWIVIqvhIitfqWKxVlWndl9N+DpLJxq p5KnY7ddWbhhwS/Q6mZD3caS73Cosn6Uq5pp9kauJBTCymzYnnvLOx/cox40Ao8Uqg30 +Dt7OOc3oK5tuwR/Fs0k8F3UIYA/x8XjpeJlyglSGGefJ8MOX8e8yUMx+xwGKydigIyc imxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=pJZCtAFPEqGnKFw45EueE5fi2brF74zHRaK+U70buTk=; b=d5BkRHNSmhLWoD6gFGuTYZrmYAdPgO5Wvh0WwtekV3b1WHsJL5ZmhJctQDeP2quyRG 0spr8de82KeX0/gPxRRcfz0VaDvrhPQ2DGrbWP0Z0tLwrt0/EZxl3TBGOEZ/9okdr+No hZNgCUf9cLS0kEJ2O9JSmuJgCAc01q2lU/aLYMj0JZRE59BEkj8ZS7vNk0W20vQM8D8O +HAjLAwa2yTw6klwRNnlhSnzdnV3nTwnZUyqQf9l0FmGiedhFVpQowfw83mPhZ5WaTE/ idfkHOORXRTcaCrWzNFH93XXO9PLP2WplOozM4BAXzabQAV7bWMEHMKSocY22CaFpJfx CO3A== X-Gm-Message-State: ACrzQf331BXVMLMoIV+cIOWAkP9S4WmP8/AgXdoP4tNvLcOipALgBIOB dT1rEhivssJHSRUwTrnbxlDtjdJ2VguKHA== X-Google-Smtp-Source: AMsMyM7hHM7a42n92vUA+KjFNlz/oQaw3cEQQ9K0WqE+ob1S0oeBJttVErUoFVSSUbeCLymLMm3CZQ== X-Received: by 2002:a7b:c30c:0:b0:3c6:f26a:590f with SMTP id k12-20020a7bc30c000000b003c6f26a590fmr9659549wmj.205.1666965072403; Fri, 28 Oct 2022 06:51:12 -0700 (PDT) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id m8-20020a05600c3b0800b003c6edc05159sm7291082wms.1.2022.10.28.06.51.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 06:51:12 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Fri, 28 Oct 2022 14:51:10 +0100 Message-Id: <20221028135110.13433-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221028115200.8138-3-naush@raspberrypi.com> References: <20221028115200.8138-3-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] pipeline: raspberrypi: Do not unconditionally free buffers on close 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" When a camera is terminated, do not unconditionally free buffers in the RPiCameraData destructor. Otherwise, this causes harmless error log messages to be displayed if no buffer have previously been allocated. Signed-off-by: Naushir Patuck Tested-by: David Plowman Reviewed-by: David Plowman Reviewed-by: Kieran Bingham --- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 343f8cb2c7ed..1b599fcc9ecf 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -1506,6 +1506,9 @@ void PipelineHandlerRPi::mapBuffers(Camera *camera, const RPi::BufferMap &buffer void RPiCameraData::freeBuffers() { + if (!buffersAllocated_) + return; + if (ipa_) { /* * Copy the buffer ids from the unordered_set to a vector to