Patch Detail
Show a patch.
GET /api/patches/15499/?format=api
{ "id": 15499, "url": "https://patchwork.libcamera.org/api/patches/15499/?format=api", "web_url": "https://patchwork.libcamera.org/patch/15499/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20220322092257.2713521-3-naush@raspberrypi.com>", "date": "2022-03-22T09:22:51", "name": "[libcamera-devel,v4,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=api", "name": "Naushir Patuck", "email": "naush@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/15499/mbox/", "series": [ { "id": 2982, "url": "https://patchwork.libcamera.org/api/series/2982/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2982", "date": "2022-03-22T09:22:49", "name": "Raspberry Pi: Efficient start/stop/start sequences", "version": 4, "mbox": "https://patchwork.libcamera.org/series/2982/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/15499/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/15499/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 D8966BD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 22 Mar 2022 09:23:06 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 73007632E6;\n\tTue, 22 Mar 2022 10:23:06 +0100 (CET)", "from mail-wm1-x329.google.com (mail-wm1-x329.google.com\n\t[IPv6:2a00:1450:4864:20::329])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9EF2860397\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Mar 2022 10:23:02 +0100 (CET)", "by mail-wm1-x329.google.com with SMTP id n35so8366753wms.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Mar 2022 02:23:02 -0700 (PDT)", "from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:9e9a:99af:e5a6:319b])\n\tby smtp.gmail.com with ESMTPSA id\n\tr14-20020a05600c35ce00b0038c9f469979sm1471695wmq.40.2022.03.22.02.23.01\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 22 Mar 2022 02:23:01 -0700 (PDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1647940986;\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=hs1TuPaqrL9VWGUDOeWI0LXuz85iWubLoap36AKh+u1FDB3Z4mvlQ29/4YC/D9I4N\n\tgvzfvbPdn8A7BJG8yhHcmaF9tFXDPHGC4yi7otItp0UMlu6ntXKJf6HJBi5PRrbTOa\n\tGZTWyHlNg0b/keREv9tf2v3Jm8iALU9a8nF5Zqi1AlNVz2nYUvHnANNaoVTCaH3N8W\n\teGk6H7gd3RhGEphdthyjV19mukYtNUwj4hHcm7HjRczoc0Ws2OF8+WwvQ3e7JzuFnR\n\tWwcE5QhhYGUWErWd3nHavzzFDxQ3kGDHx2xVaSfuDxUBUa7nJp/4+5kr7KaJrd1oPR\n\tkC9WT99txUdMQ==", "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=FC+4xYZ1gFaQy5dA2sAPcut9nfjGJrGtXSfbOuTtyF62zgBEcErQYBeS//EJa99v00\n\tiGZEEfFOGEFj5m3XN9IeODY1hKxaAOeO3cI5GEblmRJCnjDqw3RVap+zhrHfhM/ZIbG3\n\tJmj3U2o8BC6J7eTDt1dG273rG5SnrWEDgkdzHLkz/5jUEupomrvxBf7VVgXgVz/kZhCL\n\t2DtqSp+2k4LxKIsxhD+KYkQk8JCcKJgs0nYWgY0UEAZOm6d8Br2IFLH0vgdp34T93twS\n\tJfQUmJJ+bzyvIi/gzPRkMd7OHdL92Z8Z/YQLC47Mqh9x88EcxmTBGnvlU6uUq5R0q4zV\n\tTIBA==" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"FC+4xYZ1\"; 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=mE87f2yMSuU2FdxRyohSq8fqJF+BwTfiAY/0Kp6S8dfd/9xjT/iP8ZBRSEhKZshnOJ\n\t8HRHSIdAamG/bBT5tYvMblg17suJBNxu7UhwX7qmPAYPIPf1VGE3dklI7ANgl2zW8F4R\n\ttJwRx5xw0moqcIe0ghVXysqYgvF5kptQqw4w3SqvXNCpN+YEbh1xL8HtW3y7aWV7Pjhp\n\t3Duv5iNgB7sAv4U4FaKux6mQLpNq8bQYycadlLjf9iaaYtwA602/RKoRL7KvQK0DfV9I\n\tnJtVv/7S/NK/xABBYSBIEatI1zgbaHmzdKkvVEclBS1dvxyV8VADJSOeOg/TO5XQct6o\n\tZAdA==", "X-Gm-Message-State": "AOAM533Rk2cvFC4vN4+3hPuKSv5OEkEXl+cHvbQlhZ97fdTQHOuffHzN\n\t3DxmPPVATFgMc4vTzFCfVxVbGqOLYqjYVQ==", "X-Google-Smtp-Source": "ABdhPJyxnwreB2bPFI9hg+c8LlF4KieOJC1MOWNqVkVMfXyY5oFG2aWt3SA1CmoCOCVwPMqdrhjjZQ==", "X-Received": "by 2002:a1c:6a01:0:b0:37f:1b18:6b17 with SMTP id\n\tf1-20020a1c6a01000000b0037f1b186b17mr2742007wmc.146.1647940982101; \n\tTue, 22 Mar 2022 02:23:02 -0700 (PDT)", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 22 Mar 2022 09:22:51 +0000", "Message-Id": "<20220322092257.2713521-3-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20220322092257.2713521-1-naush@raspberrypi.com>", "References": "<20220322092257.2713521-1-naush@raspberrypi.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v4 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", "v4", "2/8" ] }