Patch Detail
Show a patch.
GET /api/1.1/patches/22903/?format=api
{ "id": 22903, "url": "https://patchwork.libcamera.org/api/1.1/patches/22903/?format=api", "web_url": "https://patchwork.libcamera.org/patch/22903/", "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": "<20250303134234.699293-3-barnabas.pocze@ideasonboard.com>", "date": "2025-03-03T13:42:34", "name": "[v3,2/2] libcamera: pipeline: uvcvideo: Fix `ExposureTimeMode` control setting", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "5381169c6b5106e1f1a49fc572fecd1b0ecc7ff9", "submitter": { "id": 216, "url": "https://patchwork.libcamera.org/api/1.1/people/216/?format=api", "name": "Barnabás Pőcze", "email": "barnabas.pocze@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/22903/mbox/", "series": [ { "id": 5031, "url": "https://patchwork.libcamera.org/api/1.1/series/5031/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5031", "date": "2025-03-03T13:42:32", "name": "libcamera: pipeline: uvcvideo: Fix `ExposureTimeMode` control", "version": 3, "mbox": "https://patchwork.libcamera.org/series/5031/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/22903/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/22903/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 5956AC3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 3 Mar 2025 13:42:47 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E595F68826;\n\tMon, 3 Mar 2025 14:42:42 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1149E68779\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 3 Mar 2025 14:42:39 +0100 (CET)", "from pb-laptop.local (185.221.143.4.nat.pool.zt.hu [185.221.143.4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8C61C1189\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 3 Mar 2025 14:41:07 +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=\"GSUVQR4U\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1741009267;\n\tbh=11ZJ3j9uyJ651iNeBocqE5Ge2a6LpBHD+243LQZVvPM=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=GSUVQR4UFVIJKm/2p1b8NtoJmXdHOVSms1cWTDv9faI26o+ncbz+2aq3woJ8ShEFV\n\tR01724jlYO/H07LMO5vVYbhpSpTWDNlVK8kywYIXmOePCof599itF8JPuOUF7cusSd\n\tNiammHKXlvuX/bshqjYvKtY7eOixYR9lvlFwEU3A=", "From": "=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Subject": "[PATCH v3 2/2] libcamera: pipeline: uvcvideo: Fix `ExposureTimeMode`\n\tcontrol setting", "Date": "Mon, 3 Mar 2025 14:42:34 +0100", "Message-ID": "<20250303134234.699293-3-barnabas.pocze@ideasonboard.com>", "X-Mailer": "git-send-email 2.48.1", "In-Reply-To": "<20250303134234.699293-1-barnabas.pocze@ideasonboard.com>", "References": "<20250303134234.699293-1-barnabas.pocze@ideasonboard.com>", "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": "The mapping in `UVCCameraData::processControl()` is not entirely correct\nbecause the control value is retrieved as a `bool` instead of `int32_t`.\nAdditionally, the available modes are not taken into account.\n\nTo fix this, retrieve the control with the proper type - `int32_t` -, and\nuse the V4L2 mode stored in `UVCCameraData` that was selected earlier in\n`UVCCameraData::addControl()` for the given libcamera exposure time mode.\n\nFixes: bad8d591f8acfa (\"libcamera: uvcvideo: Register ExposureTimeMode control\")\nSigned-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n---\n src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 32 ++++++++++++++------\n 1 file changed, 23 insertions(+), 9 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\nindex a6cc37366..dc3e85bd8 100644\n--- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n+++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n@@ -97,8 +97,8 @@ public:\n \tbool match(DeviceEnumerator *enumerator) override;\n \n private:\n-\tint processControl(ControlList *controls, unsigned int id,\n-\t\t\t const ControlValue &value);\n+\tint processControl(UVCCameraData *data, ControlList *controls,\n+\t\t\t unsigned int id, const ControlValue &value);\n \tint processControls(UVCCameraData *data, Request *request);\n \n \tbool acquireDevice(Camera *camera) override;\n@@ -291,8 +291,8 @@ void PipelineHandlerUVC::stopDevice(Camera *camera)\n \tdata->video_->releaseBuffers();\n }\n \n-int PipelineHandlerUVC::processControl(ControlList *controls, unsigned int id,\n-\t\t\t\t const ControlValue &value)\n+int PipelineHandlerUVC::processControl(UVCCameraData *data, ControlList *controls,\n+\t\t\t\t unsigned int id, const ControlValue &value)\n {\n \tuint32_t cid;\n \n@@ -336,10 +336,24 @@ int PipelineHandlerUVC::processControl(ControlList *controls, unsigned int id,\n \t}\n \n \tcase V4L2_CID_EXPOSURE_AUTO: {\n-\t\tint32_t ivalue = value.get<bool>()\n-\t\t\t ? V4L2_EXPOSURE_APERTURE_PRIORITY\n-\t\t\t : V4L2_EXPOSURE_MANUAL;\n-\t\tcontrols->set(V4L2_CID_EXPOSURE_AUTO, ivalue);\n+\t\tint32_t exposureMode;\n+\n+\t\tswitch (value.get<int32_t>()) {\n+\t\tcase controls::ExposureTimeModeAuto:\n+\t\t\tif (!data->autoExposureMode_)\n+\t\t\t\treturn -EINVAL;\n+\t\t\texposureMode = *data->autoExposureMode_;\n+\t\t\tbreak;\n+\t\tcase controls::ExposureTimeModeManual:\n+\t\t\tif (!data->manualExposureMode_)\n+\t\t\t\treturn -EINVAL;\n+\t\t\texposureMode = *data->manualExposureMode_;\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\n+\t\tcontrols->set(V4L2_CID_EXPOSURE_AUTO, exposureMode);\n \t\tbreak;\n \t}\n \n@@ -377,7 +391,7 @@ int PipelineHandlerUVC::processControls(UVCCameraData *data, Request *request)\n \tControlList controls(data->video_->controls());\n \n \tfor (const auto &[id, value] : request->controls())\n-\t\tprocessControl(&controls, id, value);\n+\t\tprocessControl(data, &controls, id, value);\n \n \tfor (const auto &ctrl : controls)\n \t\tLOG(UVC, Debug)\n", "prefixes": [ "v3", "2/2" ] }