{"id":15485,"url":"https://patchwork.libcamera.org/api/patches/15485/?format=json","web_url":"https://patchwork.libcamera.org/patch/15485/","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":"<20220321102702.1753800-3-naush@raspberrypi.com>","date":"2022-03-21T10:26:59","name":"[libcamera-devel,v3,2/5] pipeline: raspberrypi: Move freeBuffers() to the RPiCameraData class","commit_ref":null,"pull_url":null,"state":"superseded","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/15485/mbox/","series":[{"id":2977,"url":"https://patchwork.libcamera.org/api/series/2977/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2977","date":"2022-03-21T10:26:57","name":"Raspberry Pi: Efficient start/stop/start sequences","version":3,"mbox":"https://patchwork.libcamera.org/series/2977/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/15485/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/15485/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 44063BD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 21 Mar 2022 10:27:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F3ACA610F8;\n\tMon, 21 Mar 2022 11:27:09 +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 37CAB604DA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 21 Mar 2022 11:27:07 +0100 (CET)","by mail-wr1-x436.google.com with SMTP id u16so18995344wru.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 21 Mar 2022 03:27:07 -0700 (PDT)","from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:77bd:7c6c:a8b9:8855])\n\tby smtp.gmail.com with ESMTPSA id\n\tv10-20020a056000144a00b00203df06cf9bsm13530115wrx.106.2022.03.21.03.27.06\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 21 Mar 2022 03:27:06 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1647858430;\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=kJsblsTAxBB4+Dpvioxq+ZF0WT63iF1RM4T+Kiroj57zfmPzYjju4zQTZXcjU/mHV\n\tvu03g579cVgz+/+jMCCQKjYwZk/wjvEC1IhnO675y4z6rSyBHfLDs6B74qV3s2goed\n\tPvXN5jqmb4vKSPVuywBBczdxxnDRLAJ4K/5rkHbBwp9lwr+T6qL3eXvw7Z0HmaIwsP\n\tKcsLPcixBRzCecouyoRF8t0rjHha2VPjkclSaSkhOhqGHzIG5xkmGSzgBhTSOkqim2\n\tr/rB7/jVrWAUU/vYi045NbnG/W3ZVo11EoN6FxLl52D9W2lzI3p5Kwc7WS4fABQCEr\n\t3YJTgXSdKVqog==","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=nHwK4o1vdq2MCd3EBqqdMyh0j+agzust9QwR/K/3MDg4EzFw8XV9rEDY4a8lKxf0D8\n\ttSIJVYJr4MbOVr2VDe1odf94V7jLJsV94QL0GIiXlXbizv7MawG78TIPehyHXqTJKDto\n\t60y+Ay5HykE1cIdgZNcWaJFjVE0tPRwTkH4Px8GAZWBmPnhRRu9cftwe3pQn08fMIw17\n\tMzhVVpJhyaWfnCtZneUn/hoo+gHazrx8yUcuVEsw3IHzYiMaIuvqwTHVZu7AqqOLeMrr\n\tr72cXw9OzOcmKvKk2+t21KyyZ3q0X6a+q9GreGYEIQOEUoN5tiE3j3UNbvVF6lASPpDv\n\t5dLw=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"nHwK4o1v\"; 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=iZr1SeIjMn4vImFr+8eXP1h1xKHPmRnhmF3ec7mnJ5fIXMPu49naS0CUX/YFpbzHhM\n\tjG8thPLRb/uJshbkAxQzbMl3IIAAIkXr3BqhcCVIh+PWZt1jK0OxH3OB4TwFfnGVJCxg\n\t6O7xlp9Ma29XJAKA9WS9GtjwWHXGgWqTyiZzvBrFjti/817CRr7C5Gbm17WiJ6Eqq6nc\n\tQA4zht7Q7lLmT3BTmPFMNZJqmK1eI7G7ECa3MCSQeMPVzJUnwsG31QDW9UqAfrOSksPX\n\t5vjXkHnW7RVb4SWLyWyh+Wi0vS01NN7jRwkOhJqPqwVWkpXpEv0Ewl+9h/oDji20ILmV\n\tojoQ==","X-Gm-Message-State":"AOAM531Y1lu5bpGhNIlgSPQk8vRYVRAv+a4mZejiuFvLUjxQXOLbiOv8\n\t4jc1DPcMFICsTVZ5gYnA6uwH97Bk+iZAOw==","X-Google-Smtp-Source":"ABdhPJw1VEUs7CTcaV4qKo1Q0PwmjDQS8BVN0czaQhn0qQuk4As06fWlW4dIooQkr4BWoh3qYwbLxg==","X-Received":"by 2002:a5d:6208:0:b0:203:dde4:c76e with SMTP id\n\ty8-20020a5d6208000000b00203dde4c76emr17785921wru.273.1647858426567; \n\tMon, 21 Mar 2022 03:27:06 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 21 Mar 2022 10:26:59 +0000","Message-Id":"<20220321102702.1753800-3-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20220321102702.1753800-1-naush@raspberrypi.com>","References":"<20220321102702.1753800-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3 2/5] 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","v3","2/5"]}