{"id":15543,"url":"https://patchwork.libcamera.org/api/patches/15543/?format=json","web_url":"https://patchwork.libcamera.org/patch/15543/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20220325090903.880311-3-naush@raspberrypi.com>","date":"2022-03-25T09:08:57","name":"[libcamera-devel,v5,2/8] pipeline: raspberrypi: Move freeBuffers() to the RPiCameraData class","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"5a053ac4811b935215fbbd3ef00542e1bd811547","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/15543/mbox/","series":[{"id":2999,"url":"https://patchwork.libcamera.org/api/series/2999/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2999","date":"2022-03-25T09:08:55","name":"Raspberry Pi: Efficient start/stop/start sequences","version":5,"mbox":"https://patchwork.libcamera.org/series/2999/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/15543/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/15543/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id CB3ACC0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 25 Mar 2022 09:09:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8E2C261FBD;\n\tFri, 25 Mar 2022 10:09:10 +0100 (CET)","from mail-wr1-x436.google.com (mail-wr1-x436.google.com\n\t[IPv6:2a00:1450:4864:20::436])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BD97360136\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 25 Mar 2022 10:09:08 +0100 (CET)","by mail-wr1-x436.google.com with SMTP id r7so8841695wrc.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 25 Mar 2022 02:09:08 -0700 (PDT)","from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:478c:773f:4734:d0bc])\n\tby smtp.gmail.com with ESMTPSA id\n\tc4-20020a056000184400b0020584c40778sm4915297wri.103.2022.03.25.02.09.07\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 25 Mar 2022 02:09:07 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1648199350;\n\tbh=kXB2y+u+v0J4lOfnEEEK0fEHQi8UCDN+opF1eo2OslI=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=A1nuv6x95HOjHFgbX7SRYcmTMgQJwBGqtavNzqkB3H1Xqvk7YZMBFWuNkWkKCorvf\n\t8vkT3GqPybfcEwf6aszOUPegS3g1lh9X6fvZd7tAHHWgMxnBLJU9eWKCbPeyqJwNTn\n\tH43rtafbIdoH6Cia81MpYX7rmB5mss4dYujEh6HUCkCksqDO8znvc90WfkPQV6USvA\n\tsof2AG9p/9tk5zAxoGXDK/GyldSx8P0sK7fV6UUfdqWNNYmf/BHCytwkZgd5JtaCbN\n\tq70G3Y/dnDKn7IATwmWzaUn9nTsoz3l0Pu/aDl2SmnA4yGteG6/MwHGYCWZ5M7FEpT\n\tLNx/Apo5TkUpg==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=gxKs37xBf6jAcWLRbf5L/O2SlW/iZaDg6COx8v6by6c=;\n\tb=HAYeHmeXyx4S6yTTGTVRCSP5UlFgVHiUwwFA5+XIhqL/TD6GOz4P0bgcN39fDmeqUZ\n\tpgObMpD6jbPkLADVkceXSGcgpR/vR2rHYlZOUg9QUr9GAawQNbKQVw5FRRMlH9xRlGHN\n\tJcuCChOjkdfl0/m2yc8fb5uH9SzABWH3XJjpEyAS/O/limrkGArprArjLRLvrSMbdTE2\n\tR++YxrAxSMWB+bS39yzubUzvGFECbbiFjsNZG8SL2GkuzNNHSWHyDUrEV5IZRg29aLH2\n\tUn3Z3oVY/TjOPAiMNfIOjDRmJ9AyBiRq4tcl0VyKdQ3q8uMh82tctqs1hnn//urwteQ5\n\tX0/g=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"HAYeHmeX\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=gxKs37xBf6jAcWLRbf5L/O2SlW/iZaDg6COx8v6by6c=;\n\tb=6CC+UtpZaejqbrmjVlanN5ZzOCDArbMp+tFZXWkz4sFc4s9RFZpJ9FkL7STuDXtgBg\n\tglxj3Vn+BNqVQLVaZU8EBZjNwGzrM/WdKkfaCjbkIUh9as6Ri60QZTnOZrp4cZ/eb1dP\n\t3OXsmgZScRmb5X5GDZnY5iCAL83ggAkG+xWPECvx+H8PyUi8yMeX7EqioYX706fVMjjX\n\tZ6FFN6iDyOAr++w9jjlMi7aP33rgO2VY1XvxD6JvL+q5Cgr1AQmwUqoWuXmuDMKkZPRJ\n\tERFUjAvmGcuOfWy4TgYJcrEoHBoGDx6yztm10fswTYymVfJXMBDluU926YTkZ3o+AZpW\n\tci8A==","X-Gm-Message-State":"AOAM533HAa+W15YfMSZs1EwJSLJHQh/F7Ztr/LcOAXCbYPte6r7Vjvja\n\tJmb4VtuoeLyOgzWFkG34gIoEQzD0McuYGg==","X-Google-Smtp-Source":"ABdhPJzGDHkGtuKCGk3W1+rGFvyEcnSu7N7D5mLZu5yjjZB/U+sLPRWpg5N+tvp4zoi65gB1tOHrOA==","X-Received":"by 2002:adf:eb4d:0:b0:1ed:c1f7:a951 with SMTP id\n\tu13-20020adfeb4d000000b001edc1f7a951mr7908323wrn.454.1648199348048; \n\tFri, 25 Mar 2022 02:09:08 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 25 Mar 2022 09:08:57 +0000","Message-Id":"<20220325090903.880311-3-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20220325090903.880311-1-naush@raspberrypi.com>","References":"<20220325090903.880311-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v5 2/8] pipeline: raspberrypi: Move\n\tfreeBuffers() to the RPiCameraData class","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"This function used to clear the camera buffers does not belong in the\nPipelineHandlerRPi class as it only access members of the RPiCameraData,\nso move it.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\nTested-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n .../pipeline/raspberrypi/raspberrypi.cpp         | 16 +++++++---------\n 1 file changed, 7 insertions(+), 9 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 43e87a406036..2281b43fc3ac 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -189,6 +189,7 @@ public:\n \t{\n \t}\n \n+\tvoid freeBuffers();\n \tvoid frameStarted(uint32_t sequence);\n \n \tint loadIPA(ipa::RPi::SensorConfig *sensorConfig);\n@@ -330,7 +331,6 @@ private:\n \tint registerCamera(MediaDevice *unicam, MediaDevice *isp, MediaEntity *sensorEntity);\n \tint queueAllBuffers(Camera *camera);\n \tint prepareBuffers(Camera *camera);\n-\tvoid freeBuffers(Camera *camera);\n \tvoid mapBuffers(Camera *camera, const RPi::BufferMap &buffers, unsigned int mask);\n };\n \n@@ -1056,7 +1056,7 @@ void PipelineHandlerRPi::stopDevice(Camera *camera)\n \t/* Stop the IPA. */\n \tdata->ipa_->stop();\n \n-\tfreeBuffers(camera);\n+\tdata->freeBuffers();\n }\n \n int PipelineHandlerRPi::queueRequestDevice(Camera *camera, Request *request)\n@@ -1452,16 +1452,14 @@ void PipelineHandlerRPi::mapBuffers(Camera *camera, const RPi::BufferMap &buffer\n \tdata->ipa_->mapBuffers(ipaBuffers);\n }\n \n-void PipelineHandlerRPi::freeBuffers(Camera *camera)\n+void RPiCameraData::freeBuffers()\n {\n-\tRPiCameraData *data = cameraData(camera);\n-\n \t/* Copy the buffer ids from the unordered_set to a vector to pass to the IPA. */\n-\tstd::vector<unsigned int> ipaBuffers(data->ipaBuffers_.begin(), data->ipaBuffers_.end());\n-\tdata->ipa_->unmapBuffers(ipaBuffers);\n-\tdata->ipaBuffers_.clear();\n+\tstd::vector<unsigned int> ipaBuffers(ipaBuffers_.begin(), ipaBuffers_.end());\n+\tipa_->unmapBuffers(ipaBuffers);\n+\tipaBuffers_.clear();\n \n-\tfor (auto const stream : data->streams_)\n+\tfor (auto const stream : streams_)\n \t\tstream->releaseBuffers();\n }\n \n","prefixes":["libcamera-devel","v5","2/8"]}