Patch Detail
Show a patch.
GET /api/patches/18220/?format=api
{ "id": 18220, "url": "https://patchwork.libcamera.org/api/patches/18220/?format=api", "web_url": "https://patchwork.libcamera.org/patch/18220/", "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": "<20230129135830.27490-4-jacopo.mondi@ideasonboard.com>", "date": "2023-01-29T13:58:28", "name": "[libcamera-devel,3/5] libcamera: imx8-isi: Automatically select media bus code", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "04df9144ac3ccbef80172d7f76de840086fd7607", "submitter": { "id": 143, "url": "https://patchwork.libcamera.org/api/people/143/?format=api", "name": "Jacopo Mondi", "email": "jacopo.mondi@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/18220/mbox/", "series": [ { "id": 3730, "url": "https://patchwork.libcamera.org/api/series/3730/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3730", "date": "2023-01-29T13:58:25", "name": "libcamera: imx8-isi: Remove pixelformat-2-media-bus map", "version": 1, "mbox": "https://patchwork.libcamera.org/series/3730/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/18220/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/18220/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 D567DBEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 29 Jan 2023 13:58:52 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A0697625F6;\n\tSun, 29 Jan 2023 14:58:51 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 98D4B625E8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 29 Jan 2023 14:58:48 +0100 (CET)", "from uno.localdomain (mob-5-90-54-203.net.vodafone.it\n\t[5.90.54.203])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0A95C449;\n\tSun, 29 Jan 2023 14:58:47 +0100 (CET)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1675000731;\n\tbh=7I/GCOvyVNiB9qdM1G7m3uc8iw1MKi3ccXoUClTIZo8=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=vSbzPnpFJT86OAt1ah6iDG0y7XeVN0cQrwKMDMgQTJPYPOQsNS67SYUZWEX8lwRPI\n\t9Z5VBa/dheZs0gqTjX19xHLZ0UQm/l8qorBguP0xwV7gyrG/T5YBZv6L03wZDqJcFw\n\tPxfBDcDMAM0QnQZx2ZhJD/ggs4+4wKnB8iG2ppCl3e8Ob2kuN/DdRDx9BzCJW5I7j1\n\tB9fcygXwofu0Lp9KzQdU7A/NpEdsPb8UEqYLg7sVlRyrMQV4txc0wKvTULmIcJwRx3\n\tYDUfmmDZ0k3cO65GT3X7bFsDRJaOsfCmcrXj0yqzNUc+/pdcvAS2T4lOwW1g7PmQWG\n\tZg/ECs6fWgj+g==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1675000728;\n\tbh=7I/GCOvyVNiB9qdM1G7m3uc8iw1MKi3ccXoUClTIZo8=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=W8OhejvQJA0ynpE0uX64Ig8UgFnVgO0vXMnvpqsfMySRvoBt0pwqXJC5zxwMRCmgA\n\tb6VhAljDevk5zYKMgrWonZDfNnql7/xxI1hx9LjoAx44oEK7i5RerB5/Vb5ke7gPNg\n\t/QyNCD23+ee4sLA44KCykaC8PK35btXN8LmdIwjo=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"W8OhejvQ\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Sun, 29 Jan 2023 14:58:28 +0100", "Message-Id": "<20230129135830.27490-4-jacopo.mondi@ideasonboard.com>", "X-Mailer": "git-send-email 2.39.0", "In-Reply-To": "<20230129135830.27490-1-jacopo.mondi@ideasonboard.com>", "References": "<20230129135830.27490-1-jacopo.mondi@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 3/5] libcamera: imx8-isi: Automatically\n\tselect media bus code", "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>", "From": "Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>", "Reply-To": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>", "Cc": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "The ISICameraConfiguration::validate() function selects which media\nbus format to configure the sensor with based on the pixel format\nof the first configured stream using the media bus code associated to it\nin the formatsMap_ map.\n\nIn order to remove the PixelFormamt-to-mbus-code association in\nformatsMap_ provide a wrapper function for the newly introduced\ngetRawMediaBusFormat() and getYubMediaBusFormat() that automatically\nselects what media bus format to use based on the first stream pixel\nformat.\n\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n src/libcamera/pipeline/imx8-isi/imx8-isi.cpp | 16 +++++++++++++---\n 1 file changed, 13 insertions(+), 3 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp\nindex 445fad32656c..5976a63d27dd 100644\n--- a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp\n+++ b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp\n@@ -61,6 +61,7 @@ public:\n \n \tunsigned int getRawMediaBusFormat(PixelFormat *pixelFormat) const;\n \tunsigned int getYuvMediaBusFormat(PixelFormat *pixelFormat) const;\n+\tunsigned int getMediaBusFormat(PixelFormat *pixelFormat) const;\n \n \tstd::unique_ptr<CameraSensor> sensor_;\n \tstd::unique_ptr<V4L2Subdevice> csis_;\n@@ -315,6 +316,15 @@ unsigned int ISICameraData::getYuvMediaBusFormat(PixelFormat *pixelFormat) const\n \treturn supportedCodes[0];\n }\n \n+unsigned int ISICameraData::getMediaBusFormat(PixelFormat *pixelFormat) const\n+{\n+\tif (PixelFormatInfo::info(*pixelFormat).colourEncoding ==\n+\t PixelFormatInfo::ColourEncodingRAW)\n+\t\treturn getRawMediaBusFormat(pixelFormat);\n+\n+\treturn getYuvMediaBusFormat(pixelFormat);\n+}\n+\n /* -----------------------------------------------------------------------------\n * Camera Configuration\n */\n@@ -628,16 +638,16 @@ CameraConfiguration::Status ISICameraConfiguration::validate()\n \t * image quality in exchange of a usually slower frame rate.\n \t * Usage of the STILL_CAPTURE role could be consider for this.\n \t */\n-\tconst PipeFormat &pipeFmt = formatsMap_.at(config_[0].pixelFormat);\n-\n \tSize maxSize;\n \tfor (const auto &cfg : config_) {\n \t\tif (cfg.size > maxSize)\n \t\t\tmaxSize = cfg.size;\n \t}\n \n+\tPixelFormat pixelFormat = config_[0].pixelFormat;\n+\n \tV4L2SubdeviceFormat sensorFormat{};\n-\tsensorFormat.mbus_code = pipeFmt.sensorCode;\n+\tsensorFormat.mbus_code = data_->getMediaBusFormat(&pixelFormat);\n \tsensorFormat.size = maxSize;\n \n \tLOG(ISI, Debug) << \"Computed sensor configuration: \" << sensorFormat;\n", "prefixes": [ "libcamera-devel", "3/5" ] }