Patch Detail
Show a patch.
GET /api/patches/11132/?format=api
{ "id": 11132, "url": "https://patchwork.libcamera.org/api/patches/11132/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11132/", "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": "<20210204093457.6879-3-david.plowman@raspberrypi.com>", "date": "2021-02-04T09:34:52", "name": "[libcamera-devel,2/7] ipa: raspberrypi: AWB: Improve locking.", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "1bfae00eae899e374ced2da915cc24ea247e832c", "submitter": { "id": 42, "url": "https://patchwork.libcamera.org/api/people/42/?format=api", "name": "David Plowman", "email": "david.plowman@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/11132/mbox/", "series": [ { "id": 1649, "url": "https://patchwork.libcamera.org/api/series/1649/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1649", "date": "2021-02-04T09:34:50", "name": "Raspberry Pi IPA maintenance", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1649/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11132/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11132/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 31B7EBD162\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 4 Feb 2021 09:35:07 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1582261418;\n\tThu, 4 Feb 2021 10:35:06 +0100 (CET)", "from mail-wr1-x435.google.com (mail-wr1-x435.google.com\n\t[IPv6:2a00:1450:4864:20::435])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5A5D861402\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 4 Feb 2021 10:35:03 +0100 (CET)", "by mail-wr1-x435.google.com with SMTP id d16so2608176wro.11\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 04 Feb 2021 01:35:03 -0800 (PST)", "from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72])\n\tby smtp.gmail.com with ESMTPSA id\n\tg16sm5280580wmi.30.2021.02.04.01.35.02\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 04 Feb 2021 01:35:02 -0800 (PST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"PiO+gqTT\"; dkim-atps=neutral", "DKIM-Signature": "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=abXjeJ8fOOsHiqXb1xOtDpFUgjWFPczUiRCmefqAMUI=;\n\tb=PiO+gqTTLFmGgUibscrhewkUs73YtI9ZyQY5l2AMekf7OZ0q1qzlbgaNX6NqKmaPOA\n\toQHQW9Ub2HoG0zZhiWAr2jQFg6/VRtq/ORwI9Yclb4C2xD23FIiVeZ/h9dCa2fntOX/3\n\tXKm1sd4r5AarEYQUjKAMsQkfkJQ+MfkTdwIVHI9dUmSze1VovQzGrAdPAo5LxMM8a2ug\n\tC1wog48FNMrTPREu1HrXSOHVSjVzNRAGj0EPYrie3gJucwpuAKaqN6U+kQ01H+BcNrk2\n\tbRAkmRCDqcaJeV6v9wndlUiHp+1hWF0L99qUvSAekVyodLBePo0BzUjcNOunwnFU7eO0\n\tM8zg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\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=abXjeJ8fOOsHiqXb1xOtDpFUgjWFPczUiRCmefqAMUI=;\n\tb=icQzt6iBKoTSDsgilxW0RD5RERl9ySfLyawSZ5D39iGujL1deUz9euSNP6fDZKjKg8\n\teF4C/EaiYhETOaiziB6WI2o9aqC12oqu0tJmN2edTaqod+q8ZSPydChbu9EMnYwr3xAE\n\t8nh4+cJPM61Pd/kBi2G52Ce02ivViLZnxIgjFnACecQgTr8EmhwOWS2BcbNOvkBd7Pbs\n\tvX1Z3tgfaloiXKKLhRAEjsbSU3Us/vH5fhciwg/dX6RHsWcSaduoHLM3eGc6yZNGmyT/\n\ttQ7PiuNZFVUb+hw2qMj20N1TWTKXRgOk9e1kYIrfNGrXuBO0fo4d4//1W7AcCiZKjvP/\n\toJnA==", "X-Gm-Message-State": "AOAM532xlK3hJvKyci1rK10npp3bjXDaXH6F05utl3zr9n2ZJGcGP/sg\n\tRQyBcAVpGIBc+wg+Us98kju0QNDjRQWutfQk", "X-Google-Smtp-Source": "ABdhPJzoH5zl5rW6rHnNYJGnW2h60I0jgpS+TLruADGDiDeW06g6KJM3JAKPTCN7tel/p4ShyIA+Ww==", "X-Received": "by 2002:a5d:47af:: with SMTP id 15mr8229570wrb.205.1612431302757;\n\tThu, 04 Feb 2021 01:35:02 -0800 (PST)", "From": "David Plowman <david.plowman@raspberrypi.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 4 Feb 2021 09:34:52 +0000", "Message-Id": "<20210204093457.6879-3-david.plowman@raspberrypi.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20210204093457.6879-1-david.plowman@raspberrypi.com>", "References": "<20210204093457.6879-1-david.plowman@raspberrypi.com>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH 2/7] ipa: raspberrypi: AWB: Improve\n\tlocking.", "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>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Fix a couple of places where notify_one() was called with the lock\nheld. Also restartAsync doesn't need the lock for its entire duration.\n\nThis change exactly matches commit db552b where we do the same for\nALSC (the asynchronous thread arrangement there is identical).\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\n---\n src/ipa/raspberrypi/controller/rpi/awb.cpp | 10 ++++++----\n 1 file changed, 6 insertions(+), 4 deletions(-)", "diff": "diff --git a/src/ipa/raspberrypi/controller/rpi/awb.cpp b/src/ipa/raspberrypi/controller/rpi/awb.cpp\nindex dabab726..791b5108 100644\n--- a/src/ipa/raspberrypi/controller/rpi/awb.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp\n@@ -136,8 +136,8 @@ Awb::~Awb()\n \t{\n \t\tstd::lock_guard<std::mutex> lock(mutex_);\n \t\tasync_abort_ = true;\n-\t\tasync_signal_.notify_one();\n \t}\n+\tasync_signal_.notify_one();\n \tasync_thread_.join();\n }\n \n@@ -239,11 +239,14 @@ void Awb::restartAsync(StatisticsPtr &stats, double lux)\n \t\t\t: (mode_ == nullptr ? config_.default_mode : mode_);\n \tlux_ = lux;\n \tframe_phase_ = 0;\n-\tasync_start_ = true;\n \tasync_started_ = true;\n \tsize_t len = mode_name_.copy(async_results_.mode,\n \t\t\t\t sizeof(async_results_.mode) - 1);\n \tasync_results_.mode[len] = '\\0';\n+\t{\n+\t\tstd::lock_guard<std::mutex> lock(mutex_);\n+\t\tasync_start_ = true;\n+\t}\n \tasync_signal_.notify_one();\n }\n \n@@ -297,7 +300,6 @@ void Awb::Process(StatisticsPtr &stats, Metadata *image_metadata)\n \t\t\tLOG(RPiAwb, Debug) << \"No lux metadata found\";\n \t\tLOG(RPiAwb, Debug) << \"Awb lux value is \" << lux_status.lux;\n \n-\t\tstd::unique_lock<std::mutex> lock(mutex_);\n \t\tif (async_started_ == false)\n \t\t\trestartAsync(stats, lux_status.lux);\n \t}\n@@ -319,8 +321,8 @@ void Awb::asyncFunc()\n \t\t{\n \t\t\tstd::lock_guard<std::mutex> lock(mutex_);\n \t\t\tasync_finished_ = true;\n-\t\t\tsync_signal_.notify_one();\n \t\t}\n+\t\tsync_signal_.notify_one();\n \t}\n }\n \n", "prefixes": [ "libcamera-devel", "2/7" ] }