Patch Detail
Show a patch.
GET /api/1.1/patches/14943/?format=api
{ "id": 14943, "url": "https://patchwork.libcamera.org/api/1.1/patches/14943/?format=api", "web_url": "https://patchwork.libcamera.org/patch/14943/", "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": "<20211201075348.3121186-4-hiroh@chromium.org>", "date": "2021-12-01T07:53:39", "name": "[libcamera-devel,v5,03/12] v4l2: Consolidate mutex classes to Mutex and MutexLocker", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "edf468b2a56120633d55bcc7661452b3a1e68cbb", "submitter": { "id": 63, "url": "https://patchwork.libcamera.org/api/1.1/people/63/?format=api", "name": "Hirokazu Honda", "email": "hiroh@chromium.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/14943/mbox/", "series": [ { "id": 2791, "url": "https://patchwork.libcamera.org/api/1.1/series/2791/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2791", "date": "2021-12-01T07:53:36", "name": "Introduce clang thread safety annotations", "version": 5, "mbox": "https://patchwork.libcamera.org/series/2791/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/14943/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/14943/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 BB4C7BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 1 Dec 2021 07:54:03 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6E50C60720;\n\tWed, 1 Dec 2021 08:54:03 +0100 (CET)", "from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com\n\t[IPv6:2607:f8b0:4864:20::1034])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 437EA60723\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 1 Dec 2021 08:54:01 +0100 (CET)", "by mail-pj1-x1034.google.com with SMTP id h24so17350579pjq.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Nov 2021 23:54:01 -0800 (PST)", "from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:203:3892:a049:59ba:c772])\n\tby smtp.gmail.com with ESMTPSA id\n\tl9sm3500848pfu.55.2021.11.30.23.53.58\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 30 Nov 2021 23:53:59 -0800 (PST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"Fp0Q8t1/\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=FEPgOt+Hso6kjyjJCaZkES4+k/22ZXFKdEsxG1OY+gI=;\n\tb=Fp0Q8t1/6lvrBvGE21gpKg1QOwzZOhNMczPpJKOTxrG/QvK8aM3xTHQyopCzfcXqn4\n\tvHZrLfO5ijZwi7G9QH7TgVtLt6yeIyG+3k/48YXg8ynJ69QCxomABSiApKrvXqzYNS2i\n\twDQMQUI1lUnU5UoTkOVak/z+cd5ciRDscxVLw=", "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=FEPgOt+Hso6kjyjJCaZkES4+k/22ZXFKdEsxG1OY+gI=;\n\tb=1lwX0ZBHMQINx/8lZzdFyG8NFMOVENxPkw4Nb6RgKAOea8wOXEhlI6souAfnapOTBD\n\tvLMbc2JdQs67ta2Pc/wqo7dpAzG4veeXzFw+Fs/iQaJC665cSfS5TdnpuWme/tAP6Uxx\n\tfHJHo8Qg4AxIlULfeZH/r49rIH+3Q0rdJp2bqh/9qa3lMAbpKElERkYiLsFILKZBN6Kz\n\tfqAI/OsA3OFF0FWi7ZO3GartfbeqRCm51XXPni4wOVg8Hzqfi2Tn5d+E6rgHV0VToRYr\n\tT3wJKyzs20f+963XiB5a6HnxilRQmxPDLS9lWUvixxq4KeKeFYDfdGAT9iOsj506KRwQ\n\t8Kvw==", "X-Gm-Message-State": "AOAM531YIspINi6CrqKu47SEsfztnOkqsYQhrec2YG+6q39OseuE/lah\n\t4D9FaHXwXSk6VKDZwK34hXBTO1uPDSvCrw==", "X-Google-Smtp-Source": "ABdhPJwWES7Wl1w2iqOuT8+3Sid/dygEzg6pDHCsGnQIerBhHacRilJOHAKqI99b90I1aFstDrtX3g==", "X-Received": "by 2002:a17:903:1208:b0:143:e4e9:4ce3 with SMTP id\n\tl8-20020a170903120800b00143e4e94ce3mr5540793plh.21.1638345239607; \n\tTue, 30 Nov 2021 23:53:59 -0800 (PST)", "From": "Hirokazu Honda <hiroh@chromium.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 1 Dec 2021 16:53:39 +0900", "Message-Id": "<20211201075348.3121186-4-hiroh@chromium.org>", "X-Mailer": "git-send-email 2.34.0.rc2.393.gf8c9666880-goog", "In-Reply-To": "<20211201075348.3121186-1-hiroh@chromium.org>", "References": "<20211201075348.3121186-1-hiroh@chromium.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v5 03/12] v4l2: Consolidate mutex classes\n\tto Mutex and MutexLocker", "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": "std::mutex and std::unique_lock are used in v4l2 directory,\nmixing Mutex and MutexLocker. This consolidates them to Mutex\nand MutexLocker.\n\nThis also fixes vidioc_dqbuf argument to take Mutex instead of\nMutexLocker.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/v4l2/v4l2_camera.h | 4 ++--\n src/v4l2/v4l2_camera_proxy.cpp | 8 ++++----\n src/v4l2/v4l2_camera_proxy.h | 4 +++-\n 3 files changed, 9 insertions(+), 7 deletions(-)", "diff": "diff --git a/src/v4l2/v4l2_camera.h b/src/v4l2/v4l2_camera.h\nindex 4afbb331..bf1b6de4 100644\n--- a/src/v4l2/v4l2_camera.h\n+++ b/src/v4l2/v4l2_camera.h\n@@ -8,10 +8,10 @@\n #pragma once\n \n #include <deque>\n-#include <mutex>\n #include <utility>\n \n #include <libcamera/base/semaphore.h>\n+#include <libcamera/base/thread.h>\n \n #include <libcamera/camera.h>\n #include <libcamera/file_descriptor.h>\n@@ -71,7 +71,7 @@ private:\n \n \tbool isRunning_;\n \n-\tstd::mutex bufferLock_;\n+\tlibcamera::Mutex bufferLock_;\n \tlibcamera::FrameBufferAllocator *bufferAllocator_;\n \n \tstd::vector<std::unique_ptr<libcamera::Request>> requestPool_;\ndiff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\nindex 3610e63c..79bc880d 100644\n--- a/src/v4l2/v4l2_camera_proxy.cpp\n+++ b/src/v4l2/v4l2_camera_proxy.cpp\n@@ -575,7 +575,7 @@ int V4L2CameraProxy::vidioc_qbuf(V4L2CameraFile *file, struct v4l2_buffer *arg)\n }\n \n int V4L2CameraProxy::vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer *arg,\n-\t\t\t\t MutexLocker *locker)\n+\t\t\t\t Mutex *lock)\n {\n \tLOG(V4L2Compat, Debug) << \"Servicing vidioc_dqbuf fd = \" << file->efd();\n \n@@ -593,9 +593,9 @@ int V4L2CameraProxy::vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer *arg,\n \t\treturn -EINVAL;\n \n \tif (!file->nonBlocking()) {\n-\t\tlocker->unlock();\n+\t\tlock->unlock();\n \t\tvcam_->waitForBufferAvailable();\n-\t\tlocker->lock();\n+\t\tlock->lock();\n \t} else if (!vcam_->isBufferAvailable())\n \t\treturn -EAGAIN;\n \n@@ -753,7 +753,7 @@ int V4L2CameraProxy::ioctl(V4L2CameraFile *file, unsigned long request, void *ar\n \t\tret = vidioc_qbuf(file, static_cast<struct v4l2_buffer *>(arg));\n \t\tbreak;\n \tcase VIDIOC_DQBUF:\n-\t\tret = vidioc_dqbuf(file, static_cast<struct v4l2_buffer *>(arg), &locker);\n+\t\tret = vidioc_dqbuf(file, static_cast<struct v4l2_buffer *>(arg), &proxyMutex_);\n \t\tbreak;\n \tcase VIDIOC_STREAMON:\n \t\tret = vidioc_streamon(file, static_cast<int *>(arg));\ndiff --git a/src/v4l2/v4l2_camera_proxy.h b/src/v4l2/v4l2_camera_proxy.h\nindex fccec241..040954dd 100644\n--- a/src/v4l2/v4l2_camera_proxy.h\n+++ b/src/v4l2/v4l2_camera_proxy.h\n@@ -14,6 +14,8 @@\n #include <sys/types.h>\n #include <vector>\n \n+#include <libcamera/base/thread.h>\n+\n #include <libcamera/camera.h>\n \n #include \"v4l2_camera.h\"\n@@ -57,7 +59,7 @@ private:\n \tint vidioc_querybuf(V4L2CameraFile *file, struct v4l2_buffer *arg);\n \tint vidioc_qbuf(V4L2CameraFile *file, struct v4l2_buffer *arg);\n \tint vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer *arg,\n-\t\t\t libcamera::MutexLocker *locker);\n+\t\t\t libcamera::Mutex *lock);\n \tint vidioc_streamon(V4L2CameraFile *file, int *arg);\n \tint vidioc_streamoff(V4L2CameraFile *file, int *arg);\n \n", "prefixes": [ "libcamera-devel", "v5", "03/12" ] }