Patch Detail
Show a patch.
GET /api/1.1/patches/3060/?format=api
{ "id": 3060, "url": "https://patchwork.libcamera.org/api/1.1/patches/3060/?format=api", "web_url": "https://patchwork.libcamera.org/patch/3060/", "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": "<20200309123319.630-3-naush@raspberrypi.com>", "date": "2020-03-09T12:33:15", "name": "[libcamera-devel,v2,2/6] libcamera: uvcvideo: Update exposure/gain ctrls set with new units", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "71293749b11e352e2f1b473524ad8a366fbe63d2", "submitter": { "id": 34, "url": "https://patchwork.libcamera.org/api/1.1/people/34/?format=api", "name": "Naushir Patuck", "email": "naush@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/3060/mbox/", "series": [ { "id": 715, "url": "https://patchwork.libcamera.org/api/1.1/series/715/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=715", "date": "2020-03-09T12:33:13", "name": "Patchset for libcamera controls", "version": 2, "mbox": "https://patchwork.libcamera.org/series/715/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/3060/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/3060/checks/", "tags": {}, "headers": { "Return-Path": "<naush@raspberrypi.com>", "Received": [ "from mail-wr1-x434.google.com (mail-wr1-x434.google.com\n\t[IPv6:2a00:1450:4864:20::434])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7592762923\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 9 Mar 2020 13:35:34 +0100 (CET)", "by mail-wr1-x434.google.com with SMTP id z15so10901969wrl.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 09 Mar 2020 05:35:34 -0700 (PDT)", "from naushir-VirtualBox.pitowers.org (cust51-dsl50.idnet.net.\n\t[212.69.50.51]) by smtp.gmail.com with ESMTPSA id\n\tz135sm25693827wmc.20.2020.03.09.05.35.33\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 09 Mar 2020 05:35:33 -0700 (PDT)" ], "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=u1yajr8e8eccRLaXgFLXKas9XBf/N6Equw89ky49Kg8=;\n\tb=OKj2/idrQBZH1DiyjOm880IUsNkGy9IGYlpH8gbzcCtEXhhMSmjEamZScuvMLlonVR\n\tzICIEJHZrWGsPopJpiW3y0+Q0iZdIa0tAL39FMlUW5IMhbIQ4zZ+1iQbYu5W0ZOh6laK\n\tRQbWAm0pGf32VRNJalDYK2ZuF1fdls3vIFZpThU3NBv5/uDR+VhsYWNfHM0W0XmuTslL\n\t/5OHYFDJLpZeUotN+sXUbxoxOaHgjOfNYLIgIdIxdXR+IzSgWWO7bSheQk8N005FvHr4\n\t3MrB44KZ8Uel6AbSKJ8hc/80xW6GEC9KSaN1J9+tfY/Efne0ef3QcToVheaM7VxeZP93\n\tA8Bw==", "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=u1yajr8e8eccRLaXgFLXKas9XBf/N6Equw89ky49Kg8=;\n\tb=Q/bdAYs+GMGuUOYoycXKIUbB4nbGACtM4Db3ZABzklKotsd2cB6caZEO42FdKIMKbG\n\tSWJVJn4Xhok6Y+uk8p/BRWppr3AD1kBI3HZm9ncEdM5ndH9crWUOeG1gwRaEbY3LaS/5\n\tCvnZnMfU6AopOJhNicQIkuy6x2NpnVYxrq9VUF+o9d66z4phIWro/MO/ho+tWlbrijf7\n\tZVYIrVCtwB3gNRPjmIuxaJEK/7khZPNgZeBh8EsSRMBWJ9z/+enE0vMqLfeMjMsCque2\n\taXEgZ25C5JPTfGvzg72BjGnH5EBzFpyF1xIFj+VwRJn+FwAjhAz10XCCsE+DhBASRFbi\n\tssFg==", "X-Gm-Message-State": "ANhLgQ03YLuivakGaH0/Vkdm8sWrFBIXQ6GaMQhjaofoN5J+ptKjvnE4\n\tQ0hRdA53h0FX3yKQ+dJRQnv01JcnFSOBUQ==", "X-Google-Smtp-Source": "ADFU+vsWzkZAlBsoTkxADBdpOkoR1xj+p0yzgRMF6FsnwbXKshmjfPhL9RkYG/+cfvCagERg5o00PQ==", "X-Received": "by 2002:a5d:62c9:: with SMTP id o9mr21611183wrv.2.1583757334027; \n\tMon, 09 Mar 2020 05:35:34 -0700 (PDT)", "From": "Naushir Patuck <naush@raspberrypi.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 9 Mar 2020 12:33:15 +0000", "Message-Id": "<20200309123319.630-3-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20200309123319.630-1-naush@raspberrypi.com>", "References": "<20200309123319.630-1-naush@raspberrypi.com>", "Subject": "[libcamera-devel] [PATCH v2 2/6] 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": "Mon, 09 Mar 2020 12:35:34 -0000" }, "content": "The ManualExposure 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 ManualGain control now uses floats to allow fractional gain values.\nSince UVC has no explicit gain units, map the default gain value to 1.0\nand linearly map to the requested value.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/libcamera/pipeline/uvcvideo.cpp | 17 +++++++++++++++--\n 1 file changed, 15 insertions(+), 2 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo.cpp\nindex 29afb121..aff86803 100644\n--- a/src/libcamera/pipeline/uvcvideo.cpp\n+++ b/src/libcamera/pipeline/uvcvideo.cpp\n@@ -245,9 +245,22 @@ int PipelineHandlerUVC::processControls(UVCCameraData *data, Request *request)\n \t\t\tcontrols.set(V4L2_CID_SATURATION, value);\n \t\t} else if (id == controls::ManualExposure) {\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::ManualExposure 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 * So divide by 100 when setting the control.\n+\t\t\t */\n+\t\t\tcontrols.set(V4L2_CID_EXPOSURE_ABSOLUTE, value.get<int32_t>() / 100);\n \t\t} else if (id == controls::ManualGain) {\n-\t\t\tcontrols.set(V4L2_CID_GAIN, value);\n+\t\t\t/*\n+\t\t\t * controls::ManualGain is specified as an absolute float value.\n+\t\t\t * Map this in a linear way such that 1.0 -> default gain\n+\t\t\t * of the V4L2_CID_GAIN control.\n+\t\t\t */\n+\t\t\tControlRange gainInfo = controls.infoMap()->at(V4L2_CID_GAIN);\n+\t\t\tfloat requestGain = value.get<float>();\n+\t\t\tint32_t gain = requestGain * gainInfo.def().get<int32_t>();\n+\t\t\tcontrols.set(V4L2_CID_GAIN, gain);\n \t\t}\n \t}\n \n", "prefixes": [ "libcamera-devel", "v2", "2/6" ] }