Show a patch.

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

{
    "id": 2307,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/2307/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/2307/",
    "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": "<20191108205409.18845-12-laurent.pinchart@ideasonboard.com>",
    "date": "2019-11-08T20:53:56",
    "name": "[libcamera-devel,v2,11/24] libcamera: v4l2_controls: Fix control range construction for bool",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "4d3260116bd250168032eb3085ab7c0e4f534ab5",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/2307/mbox/",
    "series": [
        {
            "id": 568,
            "url": "https://patchwork.libcamera.org/api/1.1/series/568/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=568",
            "date": "2019-11-08T20:53:45",
            "name": "Control serialization and IPA C API",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/568/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/2307/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/2307/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<laurent.pinchart@ideasonboard.com>",
        "Received": [
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7D06F61529\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  8 Nov 2019 21:54:26 +0100 (CET)",
            "from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2BAA7A39\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  8 Nov 2019 21:54:26 +0100 (CET)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1573246466;\n\tbh=E/CpqVQl3laiOYaUjP6RsFCIj8xzLFAFk3y3ksKPzaI=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=pVJgc/fdVS9lNXQlmJ625pCFoPEVjK5WWah97gdnFDQofe+vyPsTMYM9cNlSDzqOF\n\tmUnRYE4wzmQq/Vz1vi2rozlIA2lMug5Gz5/hAsC6pVGq1x5NUbKmhdAUgXzfl7P95i\n\tLJvt/T2xfRRakq9AgCqgSTM5FP6HmkO32vnjWkO4=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri,  8 Nov 2019 22:53:56 +0200",
        "Message-Id": "<20191108205409.18845-12-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.23.0",
        "In-Reply-To": "<20191108205409.18845-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20191108205409.18845-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 11/24] libcamera: v4l2_controls: Fix\n\tcontrol range construction for bool",
        "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": "Fri, 08 Nov 2019 20:54:27 -0000"
    },
    "content": "V4L2 controls of type V4L2_CTRL_TYPE_BOOLEAN are incorrectly described\nwith a ControlRange of int32_t values. Fix it.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/v4l2_controls.cpp | 14 ++++++++++++--\n 1 file changed, 12 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/src/libcamera/v4l2_controls.cpp b/src/libcamera/v4l2_controls.cpp\nindex 2462c3e2c264..b6547a7c627c 100644\n--- a/src/libcamera/v4l2_controls.cpp\n+++ b/src/libcamera/v4l2_controls.cpp\n@@ -118,12 +118,22 @@ V4L2ControlId::V4L2ControlId(const struct v4l2_query_ext_ctrl &ctrl)\n  */\n V4L2ControlRange::V4L2ControlRange(const struct v4l2_query_ext_ctrl &ctrl)\n {\n-\tif (ctrl.type == V4L2_CTRL_TYPE_INTEGER64)\n+\tswitch (ctrl.type) {\n+\tcase V4L2_CTRL_TYPE_BOOLEAN:\n+\t\tControlRange::operator=(ControlRange(static_cast<bool>(ctrl.minimum),\n+\t\t\t\t\t\t     static_cast<bool>(ctrl.maximum)));\n+\t\tbreak;\n+\n+\tcase V4L2_CTRL_TYPE_INTEGER64:\n \t\tControlRange::operator=(ControlRange(static_cast<int64_t>(ctrl.minimum),\n \t\t\t\t\t\t     static_cast<int64_t>(ctrl.maximum)));\n-\telse\n+\t\tbreak;\n+\n+\tdefault:\n \t\tControlRange::operator=(ControlRange(static_cast<int32_t>(ctrl.minimum),\n \t\t\t\t\t\t     static_cast<int32_t>(ctrl.maximum)));\n+\t\tbreak;\n+\t}\n }\n \n } /* namespace libcamera */\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "11/24"
    ]
}