Show a patch.

GET /api/1.1/patches/18569/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 18569,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/18569/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/18569/",
    "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": "<20230427144740.64075-4-jacopo.mondi@ideasonboard.com>",
    "date": "2023-04-27T14:47:37",
    "name": "[libcamera-devel,v3,3/6] libcamera: imx8-isi: Automatically select media bus code",
    "commit_ref": "14995410fe8546350d35108398e8b853c9ced002",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "8bd3d3e6239926e888bea3106cc4eca587826b57",
    "submitter": {
        "id": 143,
        "url": "https://patchwork.libcamera.org/api/1.1/people/143/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo.mondi@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/18569/mbox/",
    "series": [
        {
            "id": 3852,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3852/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3852",
            "date": "2023-04-27T14:47:34",
            "name": "libcamera: imx8-isi: Remove pixelformat-2-media-bus map",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/3852/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/18569/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/18569/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 AADD1C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 27 Apr 2023 14:48:05 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EA068627E8;\n\tThu, 27 Apr 2023 16:48:04 +0200 (CEST)",
            "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 3F929627DF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 27 Apr 2023 16:48:00 +0200 (CEST)",
            "from uno.lan (unknown\n\t[IPv6:2001:b07:5d2e:52c9:1cf0:b3bc:c785:4625])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id ED5609B9;\n\tThu, 27 Apr 2023 16:47:47 +0200 (CEST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1682606884;\n\tbh=lqfECWfOb42pSWi49n7DEpmr+1CaFoHQcjYReous4kM=;\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=M0qBKdG4vjPJkBMOikSHdQrOFDKpTWydJceCufAKVnmOcXwVUpP0YrzS1FjnyokdK\n\tFBBz5uWjydJ/+05yEgjHsEx+JLor8pjG0ZS+h/tGs69sCldfFJQ5323XOBx3LevgJB\n\tPSjDSf87J7ro37qLFs14iTGPjaV0Ibzqx51uUBchavJbEykusNlH+ODE1SotV32Tsf\n\th8aNsZj4wsHg5Ky5oZboeHlBWVQWPteOgPmCQvtO86xI12KAn/SJoV1YTiUqiUqj5W\n\tA9mH+QRy3v8Yy76kkgxwrEoHWtiL/p1fn2LBxtSHEo0QRaNFTKjWVBIVlST1dFz4Q2\n\trrG0ulrhtRnQA==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1682606868;\n\tbh=lqfECWfOb42pSWi49n7DEpmr+1CaFoHQcjYReous4kM=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=luP5HkKrF1L+v+5h6TxdVYhFgJ84ysPNrE+uoe35VvjUwNBSg19V/gqgbEkw0RuJj\n\tZWUOT7XbdErPbqwxkkJ5R3854scRFqYbhwsP5Jm1HG47S1/WQcrhP2E5oKxIH0V3AL\n\tYE/AAbK02/JnXXpEgSgsuEqXQ+Ws4Vxadj+PVfCY="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"luP5HkKr\"; dkim-atps=neutral",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu, 27 Apr 2023 16:47:37 +0200",
        "Message-Id": "<20230427144740.64075-4-jacopo.mondi@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.40.0",
        "In-Reply-To": "<20230427144740.64075-1-jacopo.mondi@ideasonboard.com>",
        "References": "<20230427144740.64075-1-jacopo.mondi@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v3 3/6] 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 getYuvMediaBusFormat() 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>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Daniel Scally <dan.scally@ideasonboard.com>\nTested-by: Daniel Scally <dan.scally@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@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 148f108d630f..ee3dc4ad4d3e 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(const PixelFormat &pixelFormat) const;\n+\tunsigned int getMediaBusFormat(PixelFormat *pixelFormat) const;\n \n \tstd::unique_ptr<CameraSensor> sensor_;\n \tstd::unique_ptr<V4L2Subdevice> csis_;\n@@ -318,6 +319,15 @@ unsigned int ISICameraData::getYuvMediaBusFormat(const PixelFormat &pixelFormat)\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@@ -631,16 +641,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",
        "v3",
        "3/6"
    ]
}