Patch Detail
Show a patch.
GET /api/1.1/patches/11538/?format=api
{ "id": 11538, "url": "https://patchwork.libcamera.org/api/1.1/patches/11538/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11538/", "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": "<20210309112949.26251-1-m.cichy@pengutronix.de>", "date": "2021-03-09T11:29:47", "name": "[libcamera-devel,0/2] pipeline: simple: Improve media-pipeline setup", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": false, "hash": "2e1c2942d54ded0e14a0e728ca15012f23370d3e", "submitter": { "id": 80, "url": "https://patchwork.libcamera.org/api/1.1/people/80/?format=api", "name": "Marian Cichy", "email": "m.cichy@pengutronix.de" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/11538/mbox/", "series": [], "comments": "https://patchwork.libcamera.org/api/patches/11538/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11538/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 700CFBD80E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 9 Mar 2021 11:30:35 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1BE4368AA8;\n\tTue, 9 Mar 2021 12:30:34 +0100 (CET)", "from metis.ext.pengutronix.de (metis.ext.pengutronix.de\n\t[IPv6:2001:67c:670:201:290:27ff:fe1d:cc33])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 97D2668A99\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 9 Mar 2021 12:30:31 +0100 (CET)", "from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28])\n\tby metis.ext.pengutronix.de with esmtps\n\t(TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)\n\t(envelope-from <mci@pengutronix.de>)\n\tid 1lJaZK-000840-SE; Tue, 09 Mar 2021 12:30:30 +0100", "from mci by dude02.hi.pengutronix.de with local (Exim 4.92)\n\t(envelope-from <mci@pengutronix.de>)\n\tid 1lJaZK-0007Sm-Jh; Tue, 09 Mar 2021 12:30:30 +0100" ], "From": "Marian Cichy <m.cichy@pengutronix.de>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 9 Mar 2021 12:29:47 +0100", "Message-Id": "<20210309112949.26251-1-m.cichy@pengutronix.de>", "X-Mailer": "git-send-email 2.29.2", "MIME-Version": "1.0", "X-SA-Exim-Connect-IP": "2001:67c:670:100:1d::28", "X-SA-Exim-Mail-From": "mci@pengutronix.de", "X-SA-Exim-Scanned": "No (on metis.ext.pengutronix.de);\n\tSAEximRunCond expanded to false", "X-PTX-Original-Recipient": "libcamera-devel@lists.libcamera.org", "Subject": "[libcamera-devel] [PATCH 0/2] pipeline: simple: Improve\n\tmedia-pipeline setup", "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>", "Cc": "graphics@pengutronix.de, Marian Cichy <m.cichy@pengutronix.de>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "These patches aim to improve the algorithm how SimplePipleine achieves\nthe setup of the Media-Pipeline. Prior to these patches, the\nSimplePipeline starts at the sensor-device, then always chooses the\nfirst Source-Pad it finds. This is obviously just a mere guess how to\nfind the capture device and may fail on some machines.\n\nWith these patches, SimplePipeline will instead choose the shortest path\nfrom the sensor to a capture device. This makes sense as the shortest\npath is probably a direct path to a capture device, ignoring any\nIPU-components like encoders or translators.\n\nThese patches were tested only on the imx-media driver, which is not yet\nsupported by SimplePipeline. The imx-media driver needs some changes in\norder to work with libcamera. If testing with the imx-media driver is\ndesired, one have to change the driver being media-centric first. For\ntesting purposes, this can be done quick and dirty by applying the\nfollowing hunk to the kernel:\n\n\nRegards,\nMarian Cichy\n\nMarian Cichy (2):\n media_entity: overload == operator to use media-entities in maps\n pipeline: simple: use uniform-cost search algorithm to setup media\n pipeline\n\n include/libcamera/internal/media_object.h | 2 +\n src/libcamera/pipeline/simple/simple.cpp | 118 +++++++++++-----------\n 2 files changed, 60 insertions(+), 60 deletions(-)", "diff": "--- a/drivers/staging/media/imx/imx-media-capture.c\n+++ b/drivers/staging/media/imx/imx-media-capture.c\n@@ -195,7 +195,7 @@ static int capture_enum_fmt_vid_cap(struct file *file, void *fh,\n if (ret)\n return ret;\n } else {\n- cc_src = imx_media_find_mbus_format(fmt_src.format.code,\n+ cc_src = imx_media_find_mbus_format(f->mbus_code,\n PIXFMT_SEL_ANY);\n if (WARN_ON(!cc_src))\n return -EINVAL;\n@@ -740,7 +740,7 @@ static struct video_device capture_videodev = {\n .release = video_device_release,\n .vfl_dir = VFL_DIR_RX,\n .tvnorms = V4L2_STD_NTSC | V4L2_STD_PAL | V4L2_STD_SECAM,\n- .device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING,\n+ .device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING | V4L2_CAP_IO_MC,\n };\n\nSecondly, if one wants to test these patches with the gstreamer libcamerasrc, it\nis also required to change the minimum buffers needed in the driver. The\nlibcamerasrc seems to have an issue that it only queues 1 buffer, thus\nnot starting the driver to stream. Applying this hunk to the kernel\nworks around this issue, although frame drops are probably to be expected:\n\n--- a/drivers/staging/media/imx/imx-media-capture.c\n+++ b/drivers/staging/media/imx/imx-media-capture.c\n@@ -1042,7 +1042,7 @@ int imx_media_capture_device_register(struct imx_media_video_dev *vdev)\n vq->mem_ops = &vb2_dma_contig_memops;\n vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;\n vq->lock = &priv->mutex;\n- vq->min_buffers_needed = 2;\n+ vq->min_buffers_needed = 1;\n vq->dev = priv->dev;\n\n ret = vb2_queue_init(vq);\n\nFinally, add imx-media to the supported Devices in libcamera:\n\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -51,6 +51,7 @@ static const SimplePipelineInfo supportedDevices[] = {\n { \"imx7-csi\", \"pxp\" },\n { \"qcom-camss\", nullptr },\n { \"sun6i-csi\", nullptr },\n+ { \"imx-media\", nullptr },\n };\n\n } /* namespace */\n", "prefixes": [ "libcamera-devel", "0/2" ] }