Show a patch.

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

{
    "id": 3912,
    "url": "https://patchwork.libcamera.org/api/patches/3912/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/3912/",
    "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": "<20200604090427.3779613-1-kieran.bingham@ideasonboard.com>",
    "date": "2020-06-04T09:04:27",
    "name": "[libcamera-devel,v2] libcamera: pipeline: vimc: Skip unsupported formats",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "392c98b00377fe3466cbc062da5962e0dcc9c58d",
    "submitter": {
        "id": 4,
        "url": "https://patchwork.libcamera.org/api/people/4/?format=api",
        "name": "Kieran Bingham",
        "email": "kieran.bingham@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/3912/mbox/",
    "series": [
        {
            "id": 949,
            "url": "https://patchwork.libcamera.org/api/series/949/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=949",
            "date": "2020-06-04T09:04:27",
            "name": "[libcamera-devel,v2] libcamera: pipeline: vimc: Skip unsupported formats",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/949/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/3912/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/3912/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<kieran.bingham@ideasonboard.com>",
        "Received": [
            "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 EE075603C8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  4 Jun 2020 11:04:30 +0200 (CEST)",
            "from Q.local (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net\n\t[86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 62C2F29B;\n\tThu,  4 Jun 2020 11:04:30 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"L/G3OJqg\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1591261470;\n\tbh=jXernnNrr7GegV0eKzuHSmXjDXPmYzaX0T4gHxfXt3w=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=L/G3OJqg6K4ELUB0DN1JeyryqTNbDzheYgC2R1PcXqqzdxCjlWxTSKAUYzjoovfQ7\n\t9HOpd+3SEQ+afZ9V9EMFQXz2WImLXPPPMj3XB2tuep/Py6VonjB4L9K3sHSrH6Jqtu\n\t0B+UgpojtiVoJT3hmLRNlKhe4lpvAqQFIQcaoVug=",
        "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>",
        "To": "libcamera devel <libcamera-devel@lists.libcamera.org>",
        "Date": "Thu,  4 Jun 2020 10:04:27 +0100",
        "Message-Id": "<20200604090427.3779613-1-kieran.bingham@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2] libcamera: pipeline: vimc: Skip\n\tunsupported formats",
        "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>",
        "X-List-Received-Date": "Thu, 04 Jun 2020 09:04:31 -0000"
    },
    "content": "Older kernels do not support all 'reported' formats. Skip them on those\nkernels.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n\nv2:\n - Remove todo, and confirm the kernel version.\n - Adjust validate() to reference the available formats in the\n   configuration.\n\n src/libcamera/pipeline/vimc/vimc.cpp | 19 +++++++++++++++++--\n 1 file changed, 17 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\nindex 68d65bc785b0..914df3476eb9 100644\n--- a/src/libcamera/pipeline/vimc/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc/vimc.cpp\n@@ -136,8 +136,9 @@ CameraConfiguration::Status VimcCameraConfiguration::validate()\n \tStreamConfiguration &cfg = config_[0];\n \n \t/* Adjust the pixel format. */\n-\tif (pixelformats.find(cfg.pixelFormat) == pixelformats.end()) {\n-\t\tLOG(VIMC, Debug) << \"Adjusting format to RGB24\";\n+\tconst std::vector<libcamera::PixelFormat> formats = cfg.formats().pixelformats();\n+\tif (std::find(formats.begin(), formats.end(), cfg.pixelFormat) == formats.end()) {\n+\t\tLOG(VIMC, Debug) << \"Adjusting format to BGR888\";\n \t\tcfg.pixelFormat = PixelFormat(DRM_FORMAT_BGR888);\n \t\tstatus = Adjusted;\n \t}\n@@ -171,6 +172,7 @@ CameraConfiguration *PipelineHandlerVimc::generateConfiguration(Camera *camera,\n \tconst StreamRoles &roles)\n {\n \tCameraConfiguration *config = new VimcCameraConfiguration();\n+\tVimcCameraData *data = cameraData(camera);\n \n \tif (roles.empty())\n \t\treturn config;\n@@ -178,6 +180,19 @@ CameraConfiguration *PipelineHandlerVimc::generateConfiguration(Camera *camera,\n \tstd::map<PixelFormat, std::vector<SizeRange>> formats;\n \n \tfor (const auto &pixelformat : pixelformats) {\n+\t\t/*\n+\t\t * Kernels previous to v5.7 incorrectly report support for\n+\t\t * RGB888, but it isn't functional within the pipeline.\n+\t\t */\n+\t\tif (data->media_->version() < KERNEL_VERSION(5, 7, 0)) {\n+\t\t\tif (pixelformat.first != PixelFormat(DRM_FORMAT_BGR888)) {\n+\t\t\t\tLOG(VIMC, Info)\n+\t\t\t\t\t<< \"Skipping unsupported pixel format \"\n+\t\t\t\t\t<< pixelformat.first.toString();\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t}\n+\n \t\t/* The scaler hardcodes a x3 scale-up ratio. */\n \t\tstd::vector<SizeRange> sizes{\n \t\t\tSizeRange{ { 48, 48 }, { 4096, 2160 } }\n",
    "prefixes": [
        "libcamera-devel",
        "v2"
    ]
}