Patch Detail
Show a patch.
GET /api/patches/3780/?format=api
{ "id": 3780, "url": "https://patchwork.libcamera.org/api/patches/3780/?format=api", "web_url": "https://patchwork.libcamera.org/patch/3780/", "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": "<20200512003903.20986-2-laurent.pinchart@ideasonboard.com>", "date": "2020-05-12T00:39:03", "name": "[libcamera-devel,2/2] libcamera: pipeline: raspberrypi: Move StaggeredCtrl to libcamera namespace", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "d86dd5fc1d176d8b2e069c61f434ad9a79a62c48", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/3780/mbox/", "series": [ { "id": 898, "url": "https://patchwork.libcamera.org/api/series/898/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=898", "date": "2020-05-12T00:39:02", "name": "[libcamera-devel,1/2] libcamera: pipeline: raspberrypi: Don't inline all of StaggeredCtrl", "version": 1, "mbox": "https://patchwork.libcamera.org/series/898/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/3780/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/3780/checks/", "tags": {}, "headers": { "Return-Path": "<laurent.pinchart@ideasonboard.com>", "Received": [ "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 99AD5603DD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 12 May 2020 02:39:14 +0200 (CEST)", "from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2BB569CE;\n\tTue, 12 May 2020 02:39:14 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"i3xZh06s\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1589243954;\n\tbh=qHydbR6vh+V31zMOnQOvI6N015ShvrVHkSXpKbS38Jw=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=i3xZh06sSKMCFr1WgOJQOS6/7pj+s1ssaDwb+hG1ClQw+yyqMMItjvw1VVaOy0lD7\n\tsIRWaqUDx63RGV0jgI+bkec8giIJAzoBVkFZWPvguiIHYo29deUFeZGkQlpzwNq6N+\n\txQE6ERdKxvzFolEhIc6eJ36L+USEaju2NckrF1ZM=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 12 May 2020 03:39:03 +0300", "Message-Id": "<20200512003903.20986-2-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.26.2", "In-Reply-To": "<20200512003903.20986-1-laurent.pinchart@ideasonboard.com>", "References": "<20200512003903.20986-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 2/2] libcamera: pipeline: raspberrypi:\n\tMove StaggeredCtrl to libcamera namespace", "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>", "X-List-Received-Date": "Tue, 12 May 2020 00:39:14 -0000" }, "content": "The StaggeredCtrl class, part of the Raspberry Pi pipeline handler, is\npart of libcamera. Move it to the libcamera namespace to simplify usage\nof libcamera APIs.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n .../pipeline/raspberrypi/raspberrypi.cpp | 2 +-\n .../pipeline/raspberrypi/staggered_ctrl.cpp | 25 ++++++++++---------\n .../pipeline/raspberrypi/staggered_ctrl.h | 13 ++++++----\n 3 files changed, 22 insertions(+), 18 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 21a1d7f7cca3..41d1a522fa71 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -330,7 +330,7 @@ public:\n \tstd::vector<IPABuffer> ipaBuffers_;\n \n \t/* VCSM allocation helper. */\n-\tRPi::Vcsm vcsm_;\n+\t::RPi::Vcsm vcsm_;\n \tvoid *lsTable_;\n \n \tRPi::StaggeredCtrl staggeredCtrl_;\ndiff --git a/src/libcamera/pipeline/raspberrypi/staggered_ctrl.cpp b/src/libcamera/pipeline/raspberrypi/staggered_ctrl.cpp\nindex fbd87d3e791e..d431887ea137 100644\n--- a/src/libcamera/pipeline/raspberrypi/staggered_ctrl.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/staggered_ctrl.cpp\n@@ -9,20 +9,19 @@\n \n #include <algorithm>\n \n+#include <libcamera/controls.h>\n+\n #include \"log.h\"\n #include \"utils.h\"\n+#include \"v4l2_videodevice.h\"\n \n-/* For logging... */\n-using libcamera::LogCategory;\n-using libcamera::LogDebug;\n-using libcamera::LogInfo;\n-using libcamera::utils::hex;\n+namespace libcamera {\n \n LOG_DEFINE_CATEGORY(RPI_S_W);\n \n namespace RPi {\n \n-void StaggeredCtrl::init(libcamera::V4L2VideoDevice *dev,\n+void StaggeredCtrl::init(V4L2VideoDevice *dev,\n \t std::initializer_list<std::pair<const uint32_t, uint8_t>> delayList)\n {\n \tstd::lock_guard<std::mutex> lock(lock_);\n@@ -35,7 +34,7 @@ void StaggeredCtrl::init(libcamera::V4L2VideoDevice *dev,\n \tmaxDelay_ = 0;\n \tfor (auto const &p : delay_) {\n \t\tLOG(RPI_S_W, Info) << \"Init ctrl \"\n-\t\t\t\t << hex(p.first) << \" with delay \"\n+\t\t\t\t << utils::hex(p.first) << \" with delay \"\n \t\t\t\t << static_cast<int>(p.second);\n \t\tmaxDelay_ = std::max(maxDelay_, p.second);\n \t}\n@@ -92,7 +91,7 @@ bool StaggeredCtrl::set(std::initializer_list<std::pair<const uint32_t, int32_t>\n \treturn true;\n }\n \n-bool StaggeredCtrl::set(libcamera::ControlList &controls)\n+bool StaggeredCtrl::set(ControlList &controls)\n {\n \tstd::lock_guard<std::mutex> lock(lock_);\n \n@@ -103,7 +102,7 @@ bool StaggeredCtrl::set(libcamera::ControlList &controls)\n \n \t\tctrl_[p.first][setCount_] = CtrlInfo(p.second.get<int32_t>());\n \t\tLOG(RPI_S_W, Debug) << \"Setting ctrl \"\n-\t\t\t\t << hex(p.first) << \" to \"\n+\t\t\t\t << utils::hex(p.first) << \" to \"\n \t\t\t\t << ctrl_[p.first][setCount_].value\n \t\t\t\t << \" at index \"\n \t\t\t\t << setCount_;\n@@ -115,7 +114,7 @@ bool StaggeredCtrl::set(libcamera::ControlList &controls)\n int StaggeredCtrl::write()\n {\n \tstd::lock_guard<std::mutex> lock(lock_);\n-\tlibcamera::ControlList controls(dev_->controls());\n+\tControlList controls(dev_->controls());\n \n \tfor (auto &p : ctrl_) {\n \t\tint delayDiff = maxDelay_ - delay_[p.first];\n@@ -126,7 +125,7 @@ int StaggeredCtrl::write()\n \t\t\tcontrols.set(p.first, p.second[index].value);\n \t\t\tp.second[index].updated = false;\n \t\t\tLOG(RPI_S_W, Debug) << \"Writing ctrl \"\n-\t\t\t\t\t << hex(p.first) << \" to \"\n+\t\t\t\t\t << utils::hex(p.first) << \" to \"\n \t\t\t\t\t << p.second[index].value\n \t\t\t\t\t << \" at index \"\n \t\t\t\t\t << index;\n@@ -149,7 +148,7 @@ void StaggeredCtrl::get(std::unordered_map<uint32_t, int32_t> &ctrl, uint8_t off\n \t\tint index = std::max<int>(0, getCount_ - maxDelay_);\n \t\tctrl[p.first] = p.second[index].value;\n \t\tLOG(RPI_S_W, Debug) << \"Getting ctrl \"\n-\t\t\t\t << hex(p.first) << \" to \"\n+\t\t\t\t << utils::hex(p.first) << \" to \"\n \t\t\t\t << p.second[index].value\n \t\t\t\t << \" at index \"\n \t\t\t\t << index;\n@@ -171,3 +170,5 @@ void StaggeredCtrl::nextFrame()\n }\n \n } /* namespace RPi */\n+\n+} /* namespace libcamera */\ndiff --git a/src/libcamera/pipeline/raspberrypi/staggered_ctrl.h b/src/libcamera/pipeline/raspberrypi/staggered_ctrl.h\nindex c8f000a0b43c..eef16eaac235 100644\n--- a/src/libcamera/pipeline/raspberrypi/staggered_ctrl.h\n+++ b/src/libcamera/pipeline/raspberrypi/staggered_ctrl.h\n@@ -12,9 +12,10 @@\n #include <unordered_map>\n #include <utility>\n \n-#include <libcamera/controls.h>\n+namespace libcamera {\n \n-#include \"v4l2_videodevice.h\"\n+class ControlList;\n+class V4L2VideoDevice;\n \n namespace RPi {\n \n@@ -31,7 +32,7 @@ public:\n \t\treturn init_;\n \t}\n \n-\tvoid init(libcamera::V4L2VideoDevice *dev,\n+\tvoid init(V4L2VideoDevice *dev,\n \t\t std::initializer_list<std::pair<const uint32_t, uint8_t>> delayList);\n \tvoid reset();\n \n@@ -39,7 +40,7 @@ public:\n \n \tbool set(uint32_t ctrl, int32_t value);\n \tbool set(std::initializer_list<std::pair<const uint32_t, int32_t>> ctrlList);\n-\tbool set(libcamera::ControlList &controls);\n+\tbool set(ControlList &controls);\n \n \tint write();\n \n@@ -81,10 +82,12 @@ private:\n \tuint32_t setCount_;\n \tuint32_t getCount_;\n \tuint8_t maxDelay_;\n-\tlibcamera::V4L2VideoDevice *dev_;\n+\tV4L2VideoDevice *dev_;\n \tstd::unordered_map<uint32_t, uint8_t> delay_;\n \tstd::unordered_map<uint32_t, CircularArray> ctrl_;\n \tstd::mutex lock_;\n };\n \n } /* namespace RPi */\n+\n+} /* namespace libcamera */\n", "prefixes": [ "libcamera-devel", "2/2" ] }