Patch Detail
Show a patch.
GET /api/1.1/patches/14087/?format=api
{ "id": 14087, "url": "https://patchwork.libcamera.org/api/1.1/patches/14087/?format=api", "web_url": "https://patchwork.libcamera.org/patch/14087/", "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": "<20211011151154.72856-4-jacopo@jmondi.org>", "date": "2021-10-11T15:11:41", "name": "[libcamera-devel,v3,03/16] libcamera: ipu3: Rationalize constant expressions names", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "4ef0cc5201ec30c652186b61bb65fb385262dc70", "submitter": { "id": 3, "url": "https://patchwork.libcamera.org/api/1.1/people/3/?format=api", "name": "Jacopo Mondi", "email": "jacopo@jmondi.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/14087/mbox/", "series": [ { "id": 2613, "url": "https://patchwork.libcamera.org/api/1.1/series/2613/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2613", "date": "2021-10-11T15:11:38", "name": "IPU3 control info update and HAL frame durations", "version": 3, "mbox": "https://patchwork.libcamera.org/series/2613/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/14087/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/14087/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 E2B7FC323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 11 Oct 2021 15:11:15 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C126768F5B;\n\tMon, 11 Oct 2021 17:11:15 +0200 (CEST)", "from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net\n\t[217.70.183.196])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BD2956027F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 11 Oct 2021 17:11:12 +0200 (CEST)", "(Authenticated sender: jacopo@jmondi.org)\n\tby relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 5434CE000B;\n\tMon, 11 Oct 2021 15:11:12 +0000 (UTC)" ], "From": "Jacopo Mondi <jacopo@jmondi.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 11 Oct 2021 17:11:41 +0200", "Message-Id": "<20211011151154.72856-4-jacopo@jmondi.org>", "X-Mailer": "git-send-email 2.33.0", "In-Reply-To": "<20211011151154.72856-1-jacopo@jmondi.org>", "References": "<20211011151154.72856-1-jacopo@jmondi.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v3 03/16] libcamera: ipu3: Rationalize\n\tconstant expressions names", "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": "Following the previous patch that moved all the ImgU-related contants in\nthe ImgUDevice class namespace and that aligned their naming scheme to\nthe 'kNameOfConstant' scheme, apply the same changes to the other\ncomponents of the IPU3 pipeline handler.\n\nCosmetic change, no functional changes intended.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/pipeline/ipu3/cio2.cpp | 6 +++---\n src/libcamera/pipeline/ipu3/cio2.h | 2 +-\n src/libcamera/pipeline/ipu3/ipu3.cpp | 29 ++++++++++++++--------------\n 3 files changed, 18 insertions(+), 19 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp\nindex dc62ab197acb..59dda56bdd3d 100644\n--- a/src/libcamera/pipeline/ipu3/cio2.cpp\n+++ b/src/libcamera/pipeline/ipu3/cio2.cpp\n@@ -234,7 +234,7 @@ StreamConfiguration CIO2Device::generateConfiguration(Size size) const\n \n \tcfg.size = sensorFormat.size;\n \tcfg.pixelFormat = mbusCodesToPixelFormat.at(sensorFormat.mbus_code);\n-\tcfg.bufferCount = CIO2_BUFFER_COUNT;\n+\tcfg.bufferCount = kBufferCount;\n \n \treturn cfg;\n }\n@@ -338,11 +338,11 @@ int CIO2Device::exportBuffers(unsigned int count,\n \n int CIO2Device::start()\n {\n-\tint ret = output_->exportBuffers(CIO2_BUFFER_COUNT, &buffers_);\n+\tint ret = output_->exportBuffers(kBufferCount, &buffers_);\n \tif (ret < 0)\n \t\treturn ret;\n \n-\tret = output_->importBuffers(CIO2_BUFFER_COUNT);\n+\tret = output_->importBuffers(kBufferCount);\n \tif (ret)\n \t\tLOG(IPU3, Error) << \"Failed to import CIO2 buffers\";\n \ndiff --git a/src/libcamera/pipeline/ipu3/cio2.h b/src/libcamera/pipeline/ipu3/cio2.h\nindex 5fffe921f213..ba8f0052c5b3 100644\n--- a/src/libcamera/pipeline/ipu3/cio2.h\n+++ b/src/libcamera/pipeline/ipu3/cio2.h\n@@ -30,7 +30,7 @@ struct StreamConfiguration;\n class CIO2Device\n {\n public:\n-\tstatic constexpr unsigned int CIO2_BUFFER_COUNT = 4;\n+\tstatic constexpr unsigned int kBufferCount = 4;\n \n \tCIO2Device();\n \ndiff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex bb3826eee422..6449fa543191 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -39,10 +39,6 @@ namespace libcamera {\n \n LOG_DEFINE_CATEGORY(IPU3)\n \n-static constexpr unsigned int IPU3_BUFFER_COUNT = 4;\n-static constexpr unsigned int IPU3_MAX_STREAMS = 3;\n-static constexpr Size IPU3ViewfinderSize(1280, 720);\n-\n static const ControlInfoMap::Map IPU3Controls = {\n \t{ &controls::draft::PipelineDepth, ControlInfo(2, 3) },\n };\n@@ -93,6 +89,9 @@ private:\n class IPU3CameraConfiguration : public CameraConfiguration\n {\n public:\n+\tstatic constexpr unsigned int kBufferCount = 4;\n+\tstatic constexpr unsigned int kMaxStreams = 3;\n+\n \tIPU3CameraConfiguration(IPU3CameraData *data);\n \n \tStatus validate() override;\n@@ -118,7 +117,8 @@ private:\n class PipelineHandlerIPU3 : public PipelineHandler\n {\n public:\n-\tstatic constexpr unsigned int V4L2_CID_IPU3_PIPE_MODE = 0x009819c1;\n+\tstatic constexpr unsigned int kPipeModeCtrl = 0x009819c1;\n+\tstatic constexpr Size kViewfinderSize{ 1280, 720 };\n \n \tenum IPU3PipeModes {\n \t\tIPU3PipeModeVideo = 0,\n@@ -218,8 +218,8 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n \tcombinedTransform_ = combined;\n \n \t/* Cap the number of entries to the available streams. */\n-\tif (config_.size() > IPU3_MAX_STREAMS) {\n-\t\tconfig_.resize(IPU3_MAX_STREAMS);\n+\tif (config_.size() > kMaxStreams) {\n+\t\tconfig_.resize(kMaxStreams);\n \t\tstatus = Adjusted;\n \t}\n \n@@ -355,7 +355,7 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n \t\t\t\t\t ImgUDevice::kOutputAlignHeight);\n \n \t\t\tcfg->pixelFormat = formats::NV12;\n-\t\t\tcfg->bufferCount = IPU3_BUFFER_COUNT;\n+\t\t\tcfg->bufferCount = kBufferCount;\n \t\t\tcfg->stride = info.stride(cfg->size.width, 0, 1);\n \t\t\tcfg->frameSize = info.frameSize(cfg->size, 1);\n \n@@ -444,7 +444,7 @@ CameraConfiguration *PipelineHandlerIPU3::generateConfiguration(Camera *camera,\n \t\t\tsize.height = utils::alignDown(size.height - 1,\n \t\t\t\t\t\t ImgUDevice::kOutputMarginHeight);\n \t\t\tpixelFormat = formats::NV12;\n-\t\t\tbufferCount = IPU3_BUFFER_COUNT;\n+\t\t\tbufferCount = IPU3CameraConfiguration::kBufferCount;\n \t\t\tstreamFormats[pixelFormat] = { { ImgUDevice::kOutputMinSize, size } };\n \n \t\t\tbreak;\n@@ -469,11 +469,11 @@ CameraConfiguration *PipelineHandlerIPU3::generateConfiguration(Camera *camera,\n \t\t\t * capped to the maximum sensor resolution and aligned\n \t\t\t * to the ImgU output constraints.\n \t\t\t */\n-\t\t\tsize = sensorResolution.boundedTo(IPU3ViewfinderSize)\n+\t\t\tsize = sensorResolution.boundedTo(kViewfinderSize)\n \t\t\t\t\t .alignedDownTo(ImgUDevice::kOutputAlignWidth,\n \t\t\t\t\t\t\t ImgUDevice::kOutputAlignHeight);\n \t\t\tpixelFormat = formats::NV12;\n-\t\t\tbufferCount = IPU3_BUFFER_COUNT;\n+\t\t\tbufferCount = IPU3CameraConfiguration::kBufferCount;\n \t\t\tstreamFormats[pixelFormat] = { { ImgUDevice::kOutputMinSize, size } };\n \n \t\t\tbreak;\n@@ -645,8 +645,7 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)\n \t * \\todo Figure out what the 'Still Capture' mode is meant for, and use\n \t * it accordingly.\n \t */\n-\tctrls.set(V4L2_CID_IPU3_PIPE_MODE,\n-\t\t static_cast<int32_t>(IPU3PipeModeVideo));\n+\tctrls.set(kPipeModeCtrl, static_cast<int32_t>(IPU3PipeModeVideo));\n \tret = imgu->imgu_->setControls(&ctrls);\n \tif (ret) {\n \t\tLOG(IPU3, Error) << \"Unable to set pipe_mode control\";\n@@ -1005,8 +1004,8 @@ int PipelineHandlerIPU3::initControls(IPU3CameraData *data)\n \t * Either the smallest margin-aligned size larger than the viewfinder\n \t * size or the adjusted sensor resolution.\n \t */\n-\tminSize = Size(IPU3ViewfinderSize.width + 1,\n-\t\t IPU3ViewfinderSize.height + 1)\n+\tminSize = Size(kViewfinderSize.width + 1,\n+\t\t kViewfinderSize.height + 1)\n \t\t .alignedUpTo(ImgUDevice::kOutputMarginWidth,\n \t\t\t ImgUDevice::kOutputMarginHeight)\n \t\t .boundedTo(minSize);\n", "prefixes": [ "libcamera-devel", "v3", "03/16" ] }