Patch Detail
Show a patch.
GET /api/patches/15782/?format=api
{ "id": 15782, "url": "https://patchwork.libcamera.org/api/patches/15782/?format=api", "web_url": "https://patchwork.libcamera.org/patch/15782/", "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": "<20220505084824.4104296-1-naush@raspberrypi.com>", "date": "2022-05-05T08:48:24", "name": "[libcamera-devel,v1] v4l2_videodevice: Disable the watchdog timer when no buffers are queued", "commit_ref": "c39b52c1840545bf89ff048764a4b550db465624", "pull_url": null, "state": "accepted", "archived": false, "hash": "f9757f864808ba2b421117cf695555de8b2b8468", "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/15782/mbox/", "series": [ { "id": 3092, "url": "https://patchwork.libcamera.org/api/series/3092/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3092", "date": "2022-05-05T08:48:24", "name": "[libcamera-devel,v1] v4l2_videodevice: Disable the watchdog timer when no buffers are queued", "version": 1, "mbox": "https://patchwork.libcamera.org/series/3092/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/15782/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/15782/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 049FCC0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 5 May 2022 08:48:33 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 25CA0604A2;\n\tThu, 5 May 2022 10:48:32 +0200 (CEST)", "from mail-wm1-x332.google.com (mail-wm1-x332.google.com\n\t[IPv6:2a00:1450:4864:20::332])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8B032604A2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 5 May 2022 10:48:29 +0200 (CEST)", "by mail-wm1-x332.google.com with SMTP id bg25so2207172wmb.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 05 May 2022 01:48:29 -0700 (PDT)", "from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:5723:5bb6:c5c7:3c86])\n\tby smtp.gmail.com with ESMTPSA id\n\tc17-20020a056000105100b0020c5253d8ccsm704209wrx.24.2022.05.05.01.48.27\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 05 May 2022 01:48:28 -0700 (PDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1651740512;\n\tbh=Nh9CViZESi3ZWpsw7UqYSp6wFdravTGRij9KX+92sTY=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=mOxCKNPY9UR70ElDTVL/NG+f0MhG3koOgNL9YaJSVNDBpjtzz2uedLXVx82h0j97c\n\tYpJmgLZ3dbDh1RE9edlfaeW0B/Uyz+FyRne2OOrqWGqvQyyM9UBV0Qq0UD8aGoN7KD\n\tIoWigc4t5OR92/uc4zVDKTB+Do71iQGCqL5iE6io1z9U6o1qgJqrloHOUExtH387+N\n\tEFSOxrgXYt5qplKv0WpkUKYJwlezCrhc6SYYlWL9sjfrRa/XjbdXS+v7fDnL2cyhpr\n\tc106GlCDJEpPOKvoZcPrJG/Aq82SdCEoYLRpQqP3OFcLdu7v7FwgJ7igfNHQZyz95J\n\tyxnWAheVrMrvg==", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=1XQYtPnGMekwManzDNKOC0qUk7neUy1qkELL9SJUG1I=;\n\tb=fhdHeOkVzsubcPNNQ2sJJbEGoTR7bcnK5qM7fKWPYB6hk0jfrgpeMmz9lkrKf4b8D0\n\tKhVVH/aLAU/1LQmJ9vQzYGJ/zohP/BRT8oTa85FsO+rHNebTSd352tFp9syiM5+Yzzac\n\tXhK6dxHa0OFTf88pRsg7+PmcG4lf7jqMzMFTG972nwaDSHmTPs3P2qC4qDicBlYGkDHo\n\td2+nNLnGdBvbUfQcy8pm48VWoHiiqnAJ2C4HdmvyjpKHbOUsVUKQpQvkz3HJU0PpuN8h\n\tbp3Fvb4kXwHfgwktcSZSyahh0OP0P1JSjool9f4fPZwOEr0tnRxlFfDQLUDsMGuMm1BS\n\tFtxw==" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"fhdHeOkV\"; 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:mime-version\n\t:content-transfer-encoding;\n\tbh=1XQYtPnGMekwManzDNKOC0qUk7neUy1qkELL9SJUG1I=;\n\tb=gc0fQiya2jKJjUiFiRYFhI+AcpT1Be7jg9J2E5PUOWnmqizTBq6aP9rAeWFTgzKTfQ\n\tFYrYSG9O7hH4MOzikdZ8/liUWHG27FDSKg7VN+Gx0FjHqWvyy6KBO35QDNS36x1n40de\n\tQHpc5myM0UpdH2CRM7NispcD0MlSH9TtHEkchlooLsKV3KnZZgfK+nIAt+/f4FYSRnx/\n\tZA9kZtGsjUNrcL8rFdmxSz/MILqmp6ikVaNoXfDhcGJTVbOcJSxVtdXvSOEI8fIaDlAV\n\tAxLcW4SH3hN1EAjbT7Tl7EtsBSBbMO5MvIzPZxq/vjWf3RlmqLkhmMd+C0905L+YqCYq\n\tEYhg==", "X-Gm-Message-State": "AOAM533YBoUKCtez+eVcPaa4QGh3bmSCi56hZvH2q/CYbdB/cuVeeWCP\n\tGZNW5kLZekCFZzMUVFIIcf09gDJWPEcTtw==", "X-Google-Smtp-Source": "ABdhPJwr32upuyitT9NI39NtCKBntxEAS9vIJswwfRpHrbnnLp0IK8CQHWQIRQf2p9TSNgSAYWNRZg==", "X-Received": "by 2002:a05:600c:24a:b0:394:4ce6:57db with SMTP id\n\t10-20020a05600c024a00b003944ce657dbmr3476136wmj.193.1651740508834; \n\tThu, 05 May 2022 01:48:28 -0700 (PDT)", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 5 May 2022 09:48:24 +0100", "Message-Id": "<20220505084824.4104296-1-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.25.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v1] v4l2_videodevice: Disable the watchdog\n\ttimer when no buffers are queued", "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": "Only enable/reset the watchdog timer when there are buffers queued in the V4L2\ndevice. Otherwise, we may trigger spurious warnings when the watchdog times out\neven if there are no buffers queued in the device.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/libcamera/v4l2_videodevice.cpp | 22 +++++++++++++++-------\n 1 file changed, 15 insertions(+), 7 deletions(-)", "diff": "diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\nindex 5b4637b1a39e..430715afd554 100644\n--- a/src/libcamera/v4l2_videodevice.cpp\n+++ b/src/libcamera/v4l2_videodevice.cpp\n@@ -1662,8 +1662,11 @@ int V4L2VideoDevice::queueBuffer(FrameBuffer *buffer)\n \t\treturn ret;\n \t}\n \n-\tif (queuedBuffers_.empty())\n+\tif (queuedBuffers_.empty()) {\n \t\tfdBufferNotifier_->setEnabled(true);\n+\t\tif (watchdogDuration_)\n+\t\t\twatchdog_.start(std::chrono::duration_cast<std::chrono::milliseconds>(watchdogDuration_));\n+\t}\n \n \tqueuedBuffers_[buf.index] = buffer;\n \n@@ -1742,16 +1745,21 @@ FrameBuffer *V4L2VideoDevice::dequeueBuffer()\n \t\treturn nullptr;\n \t}\n \n-\tif (watchdogDuration_.count())\n-\t\twatchdog_.start(std::chrono::duration_cast<std::chrono::milliseconds>(watchdogDuration_));\n-\n \tcache_->put(buf.index);\n \n \tFrameBuffer *buffer = it->second;\n \tqueuedBuffers_.erase(it);\n \n-\tif (queuedBuffers_.empty())\n+\tif (queuedBuffers_.empty()) {\n \t\tfdBufferNotifier_->setEnabled(false);\n+\t\twatchdog_.stop();\n+\t} else if (watchdogDuration_) {\n+\t\t/*\n+\t\t * Restart the watchdog timer if there are buffers still queued\n+\t\t * in the device.\n+\t\t */\n+\t\twatchdog_.start(std::chrono::duration_cast<std::chrono::milliseconds>(watchdogDuration_));\n+\t}\n \n \tbuffer->metadata_.status = buf.flags & V4L2_BUF_FLAG_ERROR\n \t\t\t\t ? FrameMetadata::FrameError\n@@ -1847,7 +1855,7 @@ int V4L2VideoDevice::streamOn()\n \t}\n \n \tstate_ = State::Streaming;\n-\tif (watchdogDuration_.count())\n+\tif (watchdogDuration_ && !queuedBuffers_.empty())\n \t\twatchdog_.start(std::chrono::duration_cast<std::chrono::milliseconds>(watchdogDuration_));\n \n \treturn 0;\n@@ -1924,7 +1932,7 @@ void V4L2VideoDevice::setDequeueTimeout(utils::Duration timeout)\n \twatchdogDuration_ = timeout;\n \n \twatchdog_.stop();\n-\tif (watchdogDuration_.count() && state_ == State::Streaming)\n+\tif (watchdogDuration_ && state_ == State::Streaming && !queuedBuffers_.empty())\n \t\twatchdog_.start(std::chrono::duration_cast<std::chrono::milliseconds>(timeout));\n }\n \n", "prefixes": [ "libcamera-devel", "v1" ] }