Patch Detail
Show a patch.
GET /api/1.1/patches/12731/?format=api
{ "id": 12731, "url": "https://patchwork.libcamera.org/api/1.1/patches/12731/?format=api", "web_url": "https://patchwork.libcamera.org/patch/12731/", "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": "<20210628163644.3195189-1-hiroh@chromium.org>", "date": "2021-06-28T16:36:44", "name": "[libcamera-devel] android: camera_device: Propagate the requested test pattern mode", "commit_ref": "4c61c5d22371d416453f3124c73894a6c3b4422a", "pull_url": null, "state": "accepted", "archived": false, "hash": "5e80ab43b0c154c28c943a505e4905e0c596a3a9", "submitter": { "id": 63, "url": "https://patchwork.libcamera.org/api/1.1/people/63/?format=api", "name": "Hirokazu Honda", "email": "hiroh@chromium.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/12731/mbox/", "series": [ { "id": 2187, "url": "https://patchwork.libcamera.org/api/1.1/series/2187/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2187", "date": "2021-06-28T16:36:44", "name": "[libcamera-devel] android: camera_device: Propagate the requested test pattern mode", "version": 1, "mbox": "https://patchwork.libcamera.org/series/2187/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/12731/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/12731/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 83349C321F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 28 Jun 2021 16:36:53 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EEEEF60508;\n\tMon, 28 Jun 2021 18:36:52 +0200 (CEST)", "from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com\n\t[IPv6:2607:f8b0:4864:20::52e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5BBAD6028C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Jun 2021 18:36:51 +0200 (CEST)", "by mail-pg1-x52e.google.com with SMTP id y17so3634283pgf.12\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Jun 2021 09:36:51 -0700 (PDT)", "from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:203:a147:1cb:e226:4ed9])\n\tby smtp.gmail.com with ESMTPSA id r92sm22302pja.6.2021.06.28.09.36.47\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 28 Jun 2021 09:36:48 -0700 (PDT)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"F5MWyS3d\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; h=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=gka1u8kial3MrfS6NwTFMO4cJ/KoSi5j0u/D3BLc7sc=;\n\tb=F5MWyS3dm1xPQeOF9sh275r0zYs1bYs5GomqzoTHEeRDB0/sgt4vK1x5U/UBsUIrvS\n\t1xja/nbJmjmfg/I6HFBCH7RRKknof9Lpk1MFpwbHe0XvGSxQUqqaH3RJPe5lvh3ANNrB\n\tdD5cqp241meorzI9ggYZasvl8GAgo/Q+IuPv4=", "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:mime-version\n\t:content-transfer-encoding;\n\tbh=gka1u8kial3MrfS6NwTFMO4cJ/KoSi5j0u/D3BLc7sc=;\n\tb=UczTr7EkPV0MZSZuJTB91fGaQl49LBlJaX77wNV+By9LHZI1wE9eTU3D2ND/C4KNu7\n\tNZ3TZs1YXiHIrL1REk9l4gGTisAVmvholm+Ua+liJbBi99mXYSaO+2CUNSghRzekjfqy\n\tpWjk5zJPIGCBKxh5GHzqtX9OlMINL6P9QgTMcARP1UVS9ORmGOQPURD2bjQKLv9fTsgE\n\tzqFGtT34EPw3QGNNd3oROuu18j+HarESzqWV9ACUZq0xre8qIAz/KDaiI/wUgmF3k7/m\n\tbJwl/miKDlbQUqye1GCpUhAc03Hw2asQ3x7arnYLq2mwQVKCrIOgFTLpXLQAFcJXylT+\n\t2n8Q==", "X-Gm-Message-State": "AOAM530gCr684bZiJkZJa4aA0hyr9pcVaKeR8TJ4UzelVCaZ/X7z2TBa\n\tcM3IzHbHFP3+C9JIDB1LEihGn0j7du8geg==", "X-Google-Smtp-Source": "ABdhPJw8kueB8qBs8hLfSnzKjNPhzlcM8h7hY5WXM/4mBpwijaurodzoe6ZDFtcyPrpZBb3rsJY0OA==", "X-Received": "by 2002:a63:d301:: with SMTP id\n\tb1mr24455113pgg.423.1624898209420; \n\tMon, 28 Jun 2021 09:36:49 -0700 (PDT)", "From": "Hirokazu Honda <hiroh@chromium.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 29 Jun 2021 01:36:44 +0900", "Message-Id": "<20210628163644.3195189-1-hiroh@chromium.org>", "X-Mailer": "git-send-email 2.32.0.93.g670b81a890-goog", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH] android: camera_device: Propagate the\n\trequested test pattern mode", "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": "Propagate the requested test pattern mode to libcamera::Camera\nthrough libcamera::Request and also set the android metadata to\nthe test pattern mode contained by the complete Request.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/android/camera_device.cpp | 47 ++++++++++++++++++++++++++++++++++-\n 1 file changed, 46 insertions(+), 1 deletion(-)", "diff": "diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 678cde23..bce3fe48 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -768,16 +768,54 @@ int CameraDevice::processControls(Camera3RequestDescriptor *descriptor)\n \t\treturn 0;\n \n \t/* Translate the Android request settings to libcamera controls. */\n+\tControlList &controls = descriptor->request_->controls();\n \tcamera_metadata_ro_entry_t entry;\n \tif (settings.getEntry(ANDROID_SCALER_CROP_REGION, &entry)) {\n \t\tconst int32_t *data = entry.data.i32;\n \t\tRectangle cropRegion{ data[0], data[1],\n \t\t\t\t static_cast<unsigned int>(data[2]),\n \t\t\t\t static_cast<unsigned int>(data[3]) };\n-\t\tControlList &controls = descriptor->request_->controls();\n \t\tcontrols.set(controls::ScalerCrop, cropRegion);\n \t}\n \n+\tif (settings.getEntry(ANDROID_SENSOR_TEST_PATTERN_MODE, &entry)) {\n+\t\tconst int32_t data = *entry.data.i32;\n+\t\tint32_t testPatternMode = controls::draft::TestPatternModeOff;\n+\t\tswitch (data) {\n+\t\tcase ANDROID_SENSOR_TEST_PATTERN_MODE_OFF:\n+\t\t\ttestPatternMode = controls::draft::TestPatternModeOff;\n+\t\t\tbreak;\n+\n+\t\tcase ANDROID_SENSOR_TEST_PATTERN_MODE_SOLID_COLOR:\n+\t\t\ttestPatternMode = controls::draft::TestPatternModeSolidColor;\n+\t\t\tbreak;\n+\n+\t\tcase ANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS:\n+\t\t\ttestPatternMode = controls::draft::TestPatternModeColorBars;\n+\t\t\tbreak;\n+\n+\t\tcase ANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY:\n+\t\t\ttestPatternMode = controls::draft::TestPatternModeColorBarsFadeToGray;\n+\t\t\tbreak;\n+\n+\t\tcase ANDROID_SENSOR_TEST_PATTERN_MODE_PN9:\n+\t\t\ttestPatternMode = controls::draft::TestPatternModePn9;\n+\t\t\tbreak;\n+\n+\t\tcase ANDROID_SENSOR_TEST_PATTERN_MODE_CUSTOM1:\n+\t\t\ttestPatternMode = controls::draft::TestPatternModeCustom1;\n+\t\t\tbreak;\n+\n+\t\tdefault:\n+\t\t\tLOG(HAL, Error)\n+\t\t\t\t<< \"Unknown test pattern mode: \" << data;\n+\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\n+\t\tcontrols.set(controls::draft::TestPatternMode, testPatternMode);\n+\t}\n+\n \treturn 0;\n }\n \n@@ -1329,6 +1367,13 @@ CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor) cons\n \t\tresultMetadata->addEntry(ANDROID_SCALER_CROP_REGION, cropRect);\n \t}\n \n+\tif (metadata.contains(controls::draft::TestPatternMode)) {\n+\t\tconst int32_t testPatternMode =\n+\t\t\tmetadata.get(controls::draft::TestPatternMode);\n+\t\tresultMetadata->addEntry(ANDROID_SENSOR_TEST_PATTERN_MODE,\n+\t\t\t\t\t testPatternMode);\n+\t}\n+\n \t/*\n \t * Return the result metadata pack even is not valid: get() will return\n \t * nullptr.\n", "prefixes": [ "libcamera-devel" ] }