Patch Detail
Show a patch.
GET /api/patches/3372/?format=api
{ "id": 3372, "url": "https://patchwork.libcamera.org/api/patches/3372/?format=api", "web_url": "https://patchwork.libcamera.org/patch/3372/", "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": "<20200403145305.10288-3-naush@raspberrypi.com>", "date": "2020-04-03T14:53:02", "name": "[libcamera-devel,v3,2/5] libcamera: uvcvideo: Update exposure/gain ctrls set with new units", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "11854614eaacc7c88fcbbea007edff24eced7a6f", "submitter": { "id": 34, "url": "https://patchwork.libcamera.org/api/people/34/?format=api", "name": "Naushir Patuck", "email": "naush@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/3372/mbox/", "series": [ { "id": 794, "url": "https://patchwork.libcamera.org/api/series/794/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=794", "date": "2020-04-03T14:53:00", "name": "Patchset for libcamera controls", "version": 3, "mbox": "https://patchwork.libcamera.org/series/794/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/3372/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/3372/checks/", "tags": {}, "headers": { "Return-Path": "<naush@raspberrypi.com>", "Received": [ "from mail-wr1-x443.google.com (mail-wr1-x443.google.com\n\t[IPv6:2a00:1450:4864:20::443])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0000760104\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 3 Apr 2020 16:53:29 +0200 (CEST)", "by mail-wr1-x443.google.com with SMTP id t7so8829487wrw.12\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 03 Apr 2020 07:53:29 -0700 (PDT)", "from naushir-VirtualBox.patuck.local ([88.97.76.4])\n\tby smtp.gmail.com with ESMTPSA id\n\tu5sm13559469wrp.81.2020.04.03.07.53.28\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 03 Apr 2020 07:53:28 -0700 (PDT)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"jPF57lsi\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=fVXwuWn8rco3gELfJEAjuRoUPX3Va//Kq1kEXfngX2M=;\n\tb=jPF57lsiAeKM8eQWgtbq1kUqkC/xeIyYHlXenfOxpp+QAxBTFxghqXKEKN0haoYrdt\n\t8yTrCN/p+0Gn4HfywgBdpT9q8zNxl+5ohpN1Jb7iMOd+htK0ZCLhytWfD64QBvCHYCaZ\n\t5zDkDBZSmstv2oXQK7mGmJRDR9aVjIiDV0GVISya6cSSbleOjQh96fTcUigObc2U7Axv\n\tnipFnw3IxA/6FKRCdsl6R4vWlpGhzK58Py4bfI9rMy9yQU9mUMbfr4dqR+9tvEbSxQlt\n\tRgZUs9Q+dLW98RUGgRFpGDcJGxiwIl6zRvMeUs6IVpKienlfUKTJfTq+zj0emwf5w3vA\n\t5b3Q==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=fVXwuWn8rco3gELfJEAjuRoUPX3Va//Kq1kEXfngX2M=;\n\tb=fDtuXpDwKnpTnyG9foI06yfdUECZXLWzeJ+KWqc1e5OHHEuv9zRvuSQeoT8S8yyRG3\n\tprqBnafLFeatw4OxHWU1lVscqtz8iNg8t2L+ojgmVz1XZajnMbjKIYXTOaVPm+WXDMLb\n\tt5NsALjlokWAQ4loCG8omQE/jJ92F6maJ9/3Fyic+IxrHHgmlOcW3Map0/BnuomGkJbh\n\tzqONu8TLYoPTYEFeWXd0iglLsDWjbXoAv0GrdEw2gCpj/shxJ/luYngS8rvU4XOk8sp7\n\tLABFLh+o7gFRL4yRndII594G3jBf+bc/HLeg4ZdG+lZt1kIKj6WBkjxuvous9exF2aQ7\n\tYKhQ==", "X-Gm-Message-State": "AGi0PubWwKI31DqZITi+eWNXRA/E437fJRQwlQD0QXzjclAki3U7jzUt\n\tG+ULmc7HMfN6BrnOCJp45oLnBTEFwsNlPg==", "X-Google-Smtp-Source": "APiQypLkh9yXfP/V76KqOl02uds6pJJY9YdsvZ4ZcfO619lMqEn05LWpgye5ZrBN2wGEI9xd90FP7w==", "X-Received": "by 2002:a5d:4ac8:: with SMTP id y8mr8946516wrs.233.1585925609530;\n\tFri, 03 Apr 2020 07:53:29 -0700 (PDT)", "From": "Naushir Patuck <naush@raspberrypi.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 3 Apr 2020 15:53:02 +0100", "Message-Id": "<20200403145305.10288-3-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20200403145305.10288-1-naush@raspberrypi.com>", "References": "<20200403145305.10288-1-naush@raspberrypi.com>", "Subject": "[libcamera-devel] [PATCH v3 2/5] libcamera: uvcvideo: Update\n\texposure/gain ctrls set with new units", "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, 03 Apr 2020 14:53:30 -0000" }, "content": "The ExposureTime control now uses units of 1 micro-second, and UVC\nuses units of 100 micro-seconds. Correctly map the values before\nsetting V4L2_CID_EXPOSURE_ABSOLUTE on the V4L2 device.\n\nThe AnalogueGain control now uses floats to allow fractional gain\nvalues. Since UVC has no explicit gain units, map the default gain value\nto 1.0 and linearly map to the requested value.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 17 +++++++++++++++--\n 1 file changed, 15 insertions(+), 2 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\nindex d7df95e4..9d589f69 100644\n--- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n+++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n@@ -253,9 +253,22 @@ int PipelineHandlerUVC::processControls(UVCCameraData *data, Request *request)\n \t\t\tcontrols.set(V4L2_CID_SATURATION, value);\n \t\t} else if (id == controls::ExposureTime) {\n \t\t\tcontrols.set(V4L2_CID_EXPOSURE_AUTO, static_cast<int32_t>(1));\n-\t\t\tcontrols.set(V4L2_CID_EXPOSURE_ABSOLUTE, value);\n+\t\t\t/*\n+\t\t\t * controls::ExposureTime is in units of 1 us, and UVC\n+\t\t\t * expects V4L2_CID_EXPOSURE_ABSOLUTE in units of 100 us.\n+\t\t\t */\n+\t\t\tcontrols.set(V4L2_CID_EXPOSURE_ABSOLUTE,\n+\t\t\t\t value.get<int32_t>() / 100);\n \t\t} else if (id == controls::AnalogueGain) {\n-\t\t\tcontrols.set(V4L2_CID_GAIN, value);\n+\t\t\t/*\n+\t\t\t * controls::AnalogueGain is specified as an absolute\n+\t\t\t * multiplier for all RGB samples. Map this multiplier\n+\t\t\t * in a linear way such that 1.0 -> default gain\n+\t\t\t * of the V4L2_CID_GAIN control on the uvcvideo device.\n+\t\t\t */\n+\t\t\tconst ControlInfo &gainInfo = controls.infoMap()->at(V4L2_CID_GAIN);\n+\t\t\tint32_t gain = value.get<float>() * gainInfo.def().get<int32_t>();\n+\t\t\tcontrols.set(V4L2_CID_GAIN, gain);\n \t\t}\n \t}\n \n", "prefixes": [ "libcamera-devel", "v3", "2/5" ] }