Patch Detail
Show a patch.
GET /api/1.1/patches/8469/?format=api
{ "id": 8469, "url": "https://patchwork.libcamera.org/api/1.1/patches/8469/?format=api", "web_url": "https://patchwork.libcamera.org/patch/8469/", "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": "<20200628001532.2685967-13-niklas.soderlund@ragnatech.se>", "date": "2020-06-28T00:15:31", "name": "[libcamera-devel,v2,12/13] libcamera: ipu3: imgu: Remove ImgUOutput", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "c0300dcb5927a2721c7a10657db56c2acbad7b82", "submitter": { "id": 5, "url": "https://patchwork.libcamera.org/api/1.1/people/5/?format=api", "name": "Niklas Söderlund", "email": "niklas.soderlund@ragnatech.se" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/8469/mbox/", "series": [ { "id": 1048, "url": "https://patchwork.libcamera.org/api/1.1/series/1048/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1048", "date": "2020-06-28T00:15:19", "name": "libcamera: ipu3: Refactoring of ImgU", "version": 2, "mbox": "https://patchwork.libcamera.org/series/1048/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/8469/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/8469/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 4B8DBC2E69\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 28 Jun 2020 00:15:59 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0EDEF60B09;\n\tSun, 28 Jun 2020 02:15:59 +0200 (CEST)", "from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net\n\t[195.74.38.228])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 49621609C7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 28 Jun 2020 02:15:55 +0200 (CEST)", "from bismarck.berto.se (p4fca2eca.dip0.t-ipconnect.de\n\t[79.202.46.202]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA\n\tid 739cfaf2-b8d4-11ea-86ee-0050569116f7;\n\tSun, 28 Jun 2020 02:15:20 +0200 (CEST)" ], "X-Halon-ID": "739cfaf2-b8d4-11ea-86ee-0050569116f7", "Authorized-sender": "niklas@soderlund.pp.se", "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Sun, 28 Jun 2020 02:15:31 +0200", "Message-Id": "<20200628001532.2685967-13-niklas.soderlund@ragnatech.se>", "X-Mailer": "git-send-email 2.27.0", "In-Reply-To": "<20200628001532.2685967-1-niklas.soderlund@ragnatech.se>", "References": "<20200628001532.2685967-1-niklas.soderlund@ragnatech.se>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH v2 12/13] libcamera: ipu3: imgu: Remove\n\tImgUOutput", "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=\"utf-8\"", "Content-Transfer-Encoding": "base64", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "The struct ImgUOutput now only contains one member that is in use, the\nvideo device. Remove the struct and use the video device directly\ninstead.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n* Changes since v1\n- Fix indentation\n---\n src/libcamera/pipeline/ipu3/imgu.cpp | 51 ++++++++++++----------------\n src/libcamera/pipeline/ipu3/imgu.h | 32 ++++++-----------\n src/libcamera/pipeline/ipu3/ipu3.cpp | 12 +++----\n 3 files changed, 38 insertions(+), 57 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp\nindex 981239cba975f92e..6a721d47cdacf3d6 100644\n--- a/src/libcamera/pipeline/ipu3/imgu.cpp\n+++ b/src/libcamera/pipeline/ipu3/imgu.cpp\n@@ -54,31 +54,22 @@ int ImgUDevice::init(MediaDevice *media, unsigned int index)\n \tif (ret)\n \t\treturn ret;\n \n-\toutput_.dev = V4L2VideoDevice::fromEntityName(media, name_ + \" output\");\n-\tret = output_.dev->open();\n+\toutput_ = V4L2VideoDevice::fromEntityName(media, name_ + \" output\");\n+\tret = output_->open();\n \tif (ret)\n \t\treturn ret;\n \n-\toutput_.pad = PAD_OUTPUT;\n-\toutput_.name = \"output\";\n-\n-\tviewfinder_.dev = V4L2VideoDevice::fromEntityName(media,\n-\t\t\t\t\t\t\t name_ + \" viewfinder\");\n-\tret = viewfinder_.dev->open();\n+\tviewfinder_ = V4L2VideoDevice::fromEntityName(media,\n+\t\t\t\t\t\t name_ + \" viewfinder\");\n+\tret = viewfinder_->open();\n \tif (ret)\n \t\treturn ret;\n \n-\tviewfinder_.pad = PAD_VF;\n-\tviewfinder_.name = \"viewfinder\";\n-\n-\tstat_.dev = V4L2VideoDevice::fromEntityName(media, name_ + \" 3a stat\");\n-\tret = stat_.dev->open();\n+\tstat_ = V4L2VideoDevice::fromEntityName(media, name_ + \" 3a stat\");\n+\tret = stat_->open();\n \tif (ret)\n \t\treturn ret;\n \n-\tstat_.pad = PAD_STAT;\n-\tstat_.name = \"stat\";\n-\n \treturn 0;\n }\n \n@@ -159,7 +150,7 @@ int ImgUDevice::configureVideoDevice(V4L2VideoDevice *dev, unsigned int pad,\n \t\treturn ret;\n \n \t/* No need to apply format to the stat node. */\n-\tif (dev == stat_.dev)\n+\tif (dev == stat_)\n \t\treturn 0;\n \n \t*outputFormat = {};\n@@ -171,7 +162,7 @@ int ImgUDevice::configureVideoDevice(V4L2VideoDevice *dev, unsigned int pad,\n \tif (ret)\n \t\treturn ret;\n \n-\tconst char *name = dev == output_.dev ? \"output\" : \"viewfinder\";\n+\tconst char *name = dev == output_ ? \"output\" : \"viewfinder\";\n \tLOG(IPU3, Debug) << \"ImgU \" << name << \" format = \"\n \t\t\t << outputFormat->toString();\n \n@@ -197,7 +188,7 @@ int ImgUDevice::allocateBuffers(unsigned int bufferCount)\n \t *\n \t * \\todo To be revised when we'll actually use the stat node.\n \t */\n-\tret = stat_.dev->importBuffers(bufferCount);\n+\tret = stat_->importBuffers(bufferCount);\n \tif (ret < 0) {\n \t\tLOG(IPU3, Error) << \"Failed to allocate ImgU stat buffers\";\n \t\tgoto error;\n@@ -208,13 +199,13 @@ int ImgUDevice::allocateBuffers(unsigned int bufferCount)\n \t * corresponding stream is active or inactive, as the driver needs\n \t * buffers to be requested on the V4L2 devices in order to operate.\n \t */\n-\tret = output_.dev->importBuffers(bufferCount);\n+\tret = output_->importBuffers(bufferCount);\n \tif (ret < 0) {\n \t\tLOG(IPU3, Error) << \"Failed to import ImgU output buffers\";\n \t\tgoto error;\n \t}\n \n-\tret = viewfinder_.dev->importBuffers(bufferCount);\n+\tret = viewfinder_->importBuffers(bufferCount);\n \tif (ret < 0) {\n \t\tLOG(IPU3, Error) << \"Failed to import ImgU viewfinder buffers\";\n \t\tgoto error;\n@@ -235,15 +226,15 @@ void ImgUDevice::freeBuffers()\n {\n \tint ret;\n \n-\tret = output_.dev->releaseBuffers();\n+\tret = output_->releaseBuffers();\n \tif (ret)\n \t\tLOG(IPU3, Error) << \"Failed to release ImgU output buffers\";\n \n-\tret = stat_.dev->releaseBuffers();\n+\tret = stat_->releaseBuffers();\n \tif (ret)\n \t\tLOG(IPU3, Error) << \"Failed to release ImgU stat buffers\";\n \n-\tret = viewfinder_.dev->releaseBuffers();\n+\tret = viewfinder_->releaseBuffers();\n \tif (ret)\n \t\tLOG(IPU3, Error) << \"Failed to release ImgU viewfinder buffers\";\n \n@@ -257,19 +248,19 @@ int ImgUDevice::start()\n \tint ret;\n \n \t/* Start the ImgU video devices. */\n-\tret = output_.dev->streamOn();\n+\tret = output_->streamOn();\n \tif (ret) {\n \t\tLOG(IPU3, Error) << \"Failed to start ImgU output\";\n \t\treturn ret;\n \t}\n \n-\tret = viewfinder_.dev->streamOn();\n+\tret = viewfinder_->streamOn();\n \tif (ret) {\n \t\tLOG(IPU3, Error) << \"Failed to start ImgU viewfinder\";\n \t\treturn ret;\n \t}\n \n-\tret = stat_.dev->streamOn();\n+\tret = stat_->streamOn();\n \tif (ret) {\n \t\tLOG(IPU3, Error) << \"Failed to start ImgU stat\";\n \t\treturn ret;\n@@ -288,9 +279,9 @@ int ImgUDevice::stop()\n {\n \tint ret;\n \n-\tret = output_.dev->streamOff();\n-\tret |= viewfinder_.dev->streamOff();\n-\tret |= stat_.dev->streamOff();\n+\tret = output_->streamOff();\n+\tret |= viewfinder_->streamOff();\n+\tret |= stat_->streamOff();\n \tret |= input_->streamOff();\n \n \treturn ret;\ndiff --git a/src/libcamera/pipeline/ipu3/imgu.h b/src/libcamera/pipeline/ipu3/imgu.h\nindex 5f1dbfd8f45f7924..7be25e40957fcb03 100644\n--- a/src/libcamera/pipeline/ipu3/imgu.h\n+++ b/src/libcamera/pipeline/ipu3/imgu.h\n@@ -24,28 +24,19 @@ struct StreamConfiguration;\n class ImgUDevice\n {\n public:\n-\t/* ImgU output descriptor: group data specific to an ImgU output. */\n-\tstruct ImgUOutput {\n-\t\tV4L2VideoDevice *dev;\n-\t\tunsigned int pad;\n-\t\tstd::string name;\n-\t};\n-\n \tImgUDevice()\n-\t\t: imgu_(nullptr), input_(nullptr)\n+\t\t: imgu_(nullptr), input_(nullptr), output_(nullptr),\n+\t\t viewfinder_(nullptr), stat_(nullptr)\n \t{\n-\t\toutput_.dev = nullptr;\n-\t\tviewfinder_.dev = nullptr;\n-\t\tstat_.dev = nullptr;\n \t}\n \n \t~ImgUDevice()\n \t{\n \t\tdelete imgu_;\n \t\tdelete input_;\n-\t\tdelete output_.dev;\n-\t\tdelete viewfinder_.dev;\n-\t\tdelete stat_.dev;\n+\t\tdelete output_;\n+\t\tdelete viewfinder_;\n+\t\tdelete stat_;\n \t}\n \n \tint init(MediaDevice *media, unsigned int index);\n@@ -55,22 +46,21 @@ public:\n \tint configureOutput(const StreamConfiguration &cfg,\n \t\t\t V4L2DeviceFormat *outputFormat)\n \t{\n-\t\treturn configureVideoDevice(output_.dev, PAD_OUTPUT, cfg,\n+\t\treturn configureVideoDevice(output_, PAD_OUTPUT, cfg,\n \t\t\t\t\t outputFormat);\n \t}\n \n \tint configureViewfinder(const StreamConfiguration &cfg,\n \t\t\t\tV4L2DeviceFormat *outputFormat)\n \t{\n-\t\treturn configureVideoDevice(viewfinder_.dev, PAD_VF, cfg,\n+\t\treturn configureVideoDevice(viewfinder_, PAD_VF, cfg,\n \t\t\t\t\t outputFormat);\n \t}\n \n \tint configureStat(const StreamConfiguration &cfg,\n \t\t\t V4L2DeviceFormat *outputFormat)\n \t{\n-\t\treturn configureVideoDevice(stat_.dev, PAD_STAT, cfg,\n-\t\t\t\t\t outputFormat);\n+\t\treturn configureVideoDevice(stat_, PAD_STAT, cfg, outputFormat);\n \t}\n \n \tint allocateBuffers(unsigned int bufferCount);\n@@ -83,9 +73,9 @@ public:\n \n \tV4L2Subdevice *imgu_;\n \tV4L2VideoDevice *input_;\n-\tImgUOutput output_;\n-\tImgUOutput viewfinder_;\n-\tImgUOutput stat_;\n+\tV4L2VideoDevice *output_;\n+\tV4L2VideoDevice *viewfinder_;\n+\tV4L2VideoDevice *stat_;\n \t/* \\todo Add param video device for 3A tuning */\n \n private:\ndiff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 4e997c529153662c..7d9fca320d608a0e 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -563,9 +563,9 @@ int PipelineHandlerIPU3::exportFrameBuffers(Camera *camera, Stream *stream,\n \tunsigned int count = stream->configuration().bufferCount;\n \n \tif (stream == &data->outStream_)\n-\t\treturn data->imgu_->output_.dev->exportBuffers(count, buffers);\n+\t\treturn data->imgu_->output_->exportBuffers(count, buffers);\n \telse if (stream == &data->vfStream_)\n-\t\treturn data->imgu_->viewfinder_.dev->exportBuffers(count, buffers);\n+\t\treturn data->imgu_->viewfinder_->exportBuffers(count, buffers);\n \telse if (stream == &data->rawStream_)\n \t\treturn data->cio2_.exportBuffers(count, buffers);\n \n@@ -683,9 +683,9 @@ int PipelineHandlerIPU3::queueRequestDevice(Camera *camera, Request *request)\n \n \t\tint ret = 0;\n \t\tif (stream == &data->outStream_)\n-\t\t\tret = data->imgu_->output_.dev->queueBuffer(buffer);\n+\t\t\tret = data->imgu_->output_->queueBuffer(buffer);\n \t\telse if (stream == &data->vfStream_)\n-\t\t\tret = data->imgu_->viewfinder_.dev->queueBuffer(buffer);\n+\t\t\tret = data->imgu_->viewfinder_->queueBuffer(buffer);\n \n \t\tif (ret < 0)\n \t\t\terror = ret;\n@@ -811,9 +811,9 @@ int PipelineHandlerIPU3::registerCameras()\n \t\t\t\t\t&IPU3CameraData::cio2BufferReady);\n \t\tdata->imgu_->input_->bufferReady.connect(&data->cio2_,\n \t\t\t\t\t&CIO2Device::tryReturnBuffer);\n-\t\tdata->imgu_->output_.dev->bufferReady.connect(data.get(),\n+\t\tdata->imgu_->output_->bufferReady.connect(data.get(),\n \t\t\t\t\t&IPU3CameraData::imguOutputBufferReady);\n-\t\tdata->imgu_->viewfinder_.dev->bufferReady.connect(data.get(),\n+\t\tdata->imgu_->viewfinder_->bufferReady.connect(data.get(),\n \t\t\t\t\t&IPU3CameraData::imguOutputBufferReady);\n \n \t\t/* Create and register the Camera instance. */\n", "prefixes": [ "libcamera-devel", "v2", "12/13" ] }