Patch Detail
Show a patch.
GET /api/1.1/patches/20948/?format=api
{ "id": 20948, "url": "https://patchwork.libcamera.org/api/1.1/patches/20948/?format=api", "web_url": "https://patchwork.libcamera.org/patch/20948/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/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": "<20240818154324.71536-1-hdegoede@redhat.com>", "date": "2024-08-18T15:43:24", "name": "pipeline_handler: Fix unlocking media devices too early when there are multiple cameras", "commit_ref": "a3fb0b3d0aec6477c205e7300dd19e54fee20d54", "pull_url": null, "state": "accepted", "archived": false, "hash": "362fe6ecabc6364da2236c2293eee19b3983ae0f", "submitter": { "id": 102, "url": "https://patchwork.libcamera.org/api/1.1/people/102/?format=api", "name": "Hans de Goede", "email": "hdegoede@redhat.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/20948/mbox/", "series": [ { "id": 4526, "url": "https://patchwork.libcamera.org/api/1.1/series/4526/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4526", "date": "2024-08-18T15:43:24", "name": "pipeline_handler: Fix unlocking media devices too early when there are multiple cameras", "version": 1, "mbox": "https://patchwork.libcamera.org/series/4526/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/20948/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/20948/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 4C81DBDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 18 Aug 2024 15:43:36 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0FAF0633BD;\n\tSun, 18 Aug 2024 17:43:35 +0200 (CEST)", "from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 96B6561955\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 18 Aug 2024 17:43:31 +0200 (CEST)", "from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com\n\t(ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63])\n\tby relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n\tcipher=TLS_AES_256_GCM_SHA384) id us-mta-25-CwruC7NcOPib2LxPala_bw-1;\n\tSun, 18 Aug 2024 11:43:29 -0400", "from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com\n\t(mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com\n\t[10.30.177.15])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (2048 bits)\n\tserver-digest SHA256) (No client certificate requested)\n\tby mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTPS\n\tid 4A9DF19560AD for <libcamera-devel@lists.libcamera.org>;\n\tSun, 18 Aug 2024 15:43:28 +0000 (UTC)", "from shalem.redhat.com (unknown [10.39.192.60])\n\tby mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id 2F11D1955DD6; Sun, 18 Aug 2024 15:43:25 +0000 (UTC)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"J8pQCD5i\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1723995810;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding;\n\tbh=zQ7iWZKAkL0nItMEYniPwB0IrANQ/j4TZhRCzBK/u+I=;\n\tb=J8pQCD5iFwgK2EZOmO4i7JxLxGnwH2XpU1BP5ubGFzgvgS3nT5rqh2ToqQ3lppXjbS96HC\n\t6AR9GPxRL/Hu8EWDdBiI8Os1J649Uwq2AWKYe+6mUgQagccxJZK6JrRcWBmYFfWf57VCd9\n\t9XSoLkjQ4TIkZ9ON3DJF+ca4aWdAB+8=", "X-MC-Unique": "CwruC7NcOPib2LxPala_bw-1", "From": "Hans de Goede <hdegoede@redhat.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Milan Zamazal <mzamazal@redhat.com>, Maxime Ripard <mripard@redhat.com>, \n\tHans de Goede <hdegoede@redhat.com>", "Subject": "[PATCH] pipeline_handler: Fix unlocking media devices too early when\n\tthere are multiple cameras", "Date": "Sun, 18 Aug 2024 17:43:24 +0200", "Message-ID": "<20240818154324.71536-1-hdegoede@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.0 on 10.30.177.15", "X-Mimecast-Spam-Score": "0", "X-Mimecast-Originator": "redhat.com", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain; charset=\"US-ASCII\"; x-default=true", "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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "PipelineHandler::acquire() only locks the media devices when the first\ncamera is acquired. If a second camera of a pipeline is acquired only\nuseCount_ is increased and nothing else is done.\n\nWhen releasing cameras PipelineHandler::release() should only unlock\nthe media devices when the last camera is released. But the old code\nunlocked on every release().\n\nFix PipelineHandler::release() to only release the media devices when\nthe last camera is released.\n\nSigned-off-by: Hans de Goede <hdegoede@redhat.com>\n---\n src/libcamera/pipeline_handler.cpp | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)", "diff": "diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\nindex 5a6de685..a20cd27d 100644\n--- a/src/libcamera/pipeline_handler.cpp\n+++ b/src/libcamera/pipeline_handler.cpp\n@@ -205,7 +205,8 @@ void PipelineHandler::release(Camera *camera)\n \n \tASSERT(useCount_);\n \n-\tunlockMediaDevices();\n+\tif (useCount_ == 1)\n+\t\tunlockMediaDevices();\n \n \treleaseDevice(camera);\n \n", "prefixes": [] }