Show a patch.

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

{
    "id": 22944,
    "url": "https://patchwork.libcamera.org/api/patches/22944/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/22944/",
    "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": "<20250310170313.185227-1-barnabas.pocze@ideasonboard.com>",
    "date": "2025-03-10T17:03:13",
    "name": "[v1] libcamera: pipeline: uvcvideo: Expose `Gamma` control",
    "commit_ref": "78d9f7bb75b3d900536a151b1b1a0a6e9ba84c29",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "b23720e4e2a8c8d3b820d439eb296c4c93e22817",
    "submitter": {
        "id": 216,
        "url": "https://patchwork.libcamera.org/api/people/216/?format=api",
        "name": "Barnabás Pőcze",
        "email": "barnabas.pocze@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/22944/mbox/",
    "series": [
        {
            "id": 5052,
            "url": "https://patchwork.libcamera.org/api/series/5052/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5052",
            "date": "2025-03-10T17:03:13",
            "name": "[v1] libcamera: pipeline: uvcvideo: Expose `Gamma` control",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/5052/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/22944/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/22944/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 AE60CC32F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 10 Mar 2025 17:03:17 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5DD7368891;\n\tMon, 10 Mar 2025 18:03:17 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4BAFA68890\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 10 Mar 2025 18:03:16 +0100 (CET)",
            "from pb-laptop.local (185.221.143.221.nat.pool.zt.hu\n\t[185.221.143.221])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A46DC227\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 10 Mar 2025 18:01:39 +0100 (CET)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"NTwbfWIT\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1741626099;\n\tbh=NncTex8ui3cQMlJuoHdr4SPW+9dMSAZvey9CVFFpx7Y=;\n\th=From:To:Subject:Date:From;\n\tb=NTwbfWITTkBIDxj7Q65Wf4hox4jw9E1ES/6iHLCL610VRukfrvebFItsHhuGgIprC\n\t9pZ1SzvfBYipO4toTSxOmxOYL9jn46I6DZiJBBcpkoGuujDJ8+ZluCYQkA/wcxvJeH\n\tyWTl9GFIZkLTAMWAWE5XzD3PJkeLp36ACkW292eo=",
        "From": "=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Subject": "[PATCH v1] libcamera: pipeline: uvcvideo: Expose `Gamma` control",
        "Date": "Mon, 10 Mar 2025 18:03:13 +0100",
        "Message-ID": "<20250310170313.185227-1-barnabas.pocze@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.48.1",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Commit 294ead848c3fa2 (\"libcamera: Add gamma control id\")\nintroduced the \"Gamma\" control, so expose it for UVC\ncameras as well using the `V4L2_CID_GAMMA` control.\n\nSigned-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n---\n src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 18 ++++++++++++++++++\n 1 file changed, 18 insertions(+)",
    "diff": "diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\nindex 7470b5627..8a845233d 100644\n--- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n+++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n@@ -304,6 +304,8 @@ int PipelineHandlerUVC::processControl(ControlList *controls, unsigned int id,\n \t\tcid = V4L2_CID_EXPOSURE_ABSOLUTE;\n \telse if (id == controls::AnalogueGain)\n \t\tcid = V4L2_CID_GAIN;\n+\telse if (id == controls::Gamma)\n+\t\tcid = V4L2_CID_GAMMA;\n \telse\n \t\treturn -EINVAL;\n \n@@ -358,6 +360,10 @@ int PipelineHandlerUVC::processControl(ControlList *controls, unsigned int id,\n \t\tbreak;\n \t}\n \n+\tcase V4L2_CID_GAMMA:\n+\t\tcontrols->set(cid, static_cast<int32_t>(std::lround(value.get<float>() * 100)));\n+\t\tbreak;\n+\n \tdefault: {\n \t\tint32_t ivalue = value.get<int32_t>();\n \t\tcontrols->set(cid, ivalue);\n@@ -655,6 +661,9 @@ void UVCCameraData::addControl(uint32_t cid, const ControlInfo &v4l2Info,\n \tcase V4L2_CID_GAIN:\n \t\tid = &controls::AnalogueGain;\n \t\tbreak;\n+\tcase V4L2_CID_GAMMA:\n+\t\tid = &controls::Gamma;\n+\t\tbreak;\n \tdefault:\n \t\treturn;\n \t}\n@@ -782,6 +791,15 @@ void UVCCameraData::addControl(uint32_t cid, const ControlInfo &v4l2Info,\n \t\tbreak;\n \t}\n \n+\tcase V4L2_CID_GAMMA:\n+\t\t/* UVC gamma is in units of 1/100 gamma. */\n+\t\tinfo = ControlInfo{\n+\t\t\t{ min / 100.0f },\n+\t\t\t{ max / 100.0f },\n+\t\t\t{ def / 100.0f }\n+\t\t};\n+\t\tbreak;\n+\n \tdefault:\n \t\tinfo = v4l2Info;\n \t\tbreak;\n",
    "prefixes": [
        "v1"
    ]
}