Patch Detail
Show a patch.
GET /api/patches/1729/?format=api
{ "id": 1729, "url": "https://patchwork.libcamera.org/api/patches/1729/?format=api", "web_url": "https://patchwork.libcamera.org/patch/1729/", "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": "<20190805155133.11335-3-niklas.soderlund@ragnatech.se>", "date": "2019-08-05T15:51:31", "name": "[libcamera-devel,2/4] libcamera: pipeline: vimc: Propagate media bus format", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "844837fa21c130fafdc947b7c13da730ccc4517a", "submitter": { "id": 5, "url": "https://patchwork.libcamera.org/api/people/5/?format=api", "name": "Niklas Söderlund", "email": "niklas.soderlund@ragnatech.se" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/1729/mbox/", "series": [ { "id": 445, "url": "https://patchwork.libcamera.org/api/series/445/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=445", "date": "2019-08-05T15:51:29", "name": "libcamera: Fix issues with vimc and Linux v5.2", "version": 1, "mbox": "https://patchwork.libcamera.org/series/445/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/1729/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/1729/checks/", "tags": {}, "headers": { "Return-Path": "<niklas.soderlund@ragnatech.se>", "Received": [ "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 EEF7261616\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 5 Aug 2019 17:51:40 +0200 (CEST)", "from bismarck.berto.se (unknown [145.14.112.32])\n\tby bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA\n\tid e953e07e-b798-11e9-903a-005056917f90;\n\tMon, 05 Aug 2019 17:51:39 +0200 (CEST)" ], "X-Halon-ID": "e953e07e-b798-11e9-903a-005056917f90", "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": "Mon, 5 Aug 2019 17:51:31 +0200", "Message-Id": "<20190805155133.11335-3-niklas.soderlund@ragnatech.se>", "X-Mailer": "git-send-email 2.22.0", "In-Reply-To": "<20190805155133.11335-1-niklas.soderlund@ragnatech.se>", "References": "<20190805155133.11335-1-niklas.soderlund@ragnatech.se>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 2/4] libcamera: pipeline: vimc: Propagate\n\tmedia bus format", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.23", "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": "Mon, 05 Aug 2019 15:51:41 -0000" }, "content": "Linux commit 85ab1aa1fac17bcd (\"media: vimc: deb: fix default sink bayer\nformat\") which is part of v5.2 changes the default media bus format for\nthe debayer subdevices. This leads to a -EPIPE error when trying to use\nthe raw capture video device nodes.\n\nFix this by propagating the media bus format used on the debayer\nsubdevcie to the sensor. This allows the same code to function on\nkernels previous to the change and after it.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n src/libcamera/pipeline/vimc.cpp | 21 ++++++++++++++++++++-\n 1 file changed, 20 insertions(+), 1 deletion(-)", "diff": "diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp\nindex 3d6808222a8a2c5d..ae612b48436d1164 100644\n--- a/src/libcamera/pipeline/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc.cpp\n@@ -25,6 +25,7 @@\n #include \"pipeline_handler.h\"\n #include \"utils.h\"\n #include \"v4l2_controls.h\"\n+#include \"v4l2_subdevice.h\"\n #include \"v4l2_videodevice.h\"\n \n namespace libcamera {\n@@ -35,13 +36,15 @@ class VimcCameraData : public CameraData\n {\n public:\n \tVimcCameraData(PipelineHandler *pipe)\n-\t\t: CameraData(pipe), video_(nullptr), sensor_(nullptr)\n+\t\t: CameraData(pipe), video_(nullptr), debayer_(nullptr),\n+\t\t sensor_(nullptr)\n \t{\n \t}\n \n \t~VimcCameraData()\n \t{\n \t\tdelete sensor_;\n+\t\tdelete debayer_;\n \t\tdelete video_;\n \t}\n \n@@ -49,6 +52,7 @@ public:\n \tvoid bufferReady(Buffer *buffer);\n \n \tV4L2VideoDevice *video_;\n+\tV4L2Subdevice *debayer_;\n \tCameraSensor *sensor_;\n \tStream stream_;\n };\n@@ -188,6 +192,17 @@ int PipelineHandlerVimc::configure(Camera *camera, CameraConfiguration *config)\n \t format.fourcc != cfg.pixelFormat)\n \t\treturn -EINVAL;\n \n+\tV4L2SubdeviceFormat subformat = {};\n+\tsubformat.size = cfg.size;\n+\n+\tret = data->debayer_->setFormat(0, &subformat);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tret = data->sensor_->setFormat(&subformat);\n+\tif (ret)\n+\t\treturn ret;\n+\n \tcfg.setStream(&data->stream_);\n \n \treturn 0;\n@@ -340,6 +355,10 @@ int VimcCameraData::init(MediaDevice *media)\n \tif (video_->open())\n \t\treturn -ENODEV;\n \n+\tdebayer_ = new V4L2Subdevice(media->getEntityByName(\"Debayer B\"));\n+\tif (debayer_->open())\n+\t\treturn -ENODEV;\n+\n \tvideo_->bufferReady.connect(this, &VimcCameraData::bufferReady);\n \n \tsensor_ = new CameraSensor(media->getEntityByName(\"Sensor B\"));\n", "prefixes": [ "libcamera-devel", "2/4" ] }