Patch Detail
Show a patch.
GET /api/patches/11073/?format=api
{ "id": 11073, "url": "https://patchwork.libcamera.org/api/patches/11073/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11073/", "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": "<20210131181722.5410-2-laurent.pinchart@ideasonboard.com>", "date": "2021-01-31T18:17:20", "name": "[libcamera-devel,1/3] libcamera: camera_sensor: Store Bayer pattern in class member", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "d9c01c82a4510d70883d1f878a3b0089537f62be", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": { "id": 14, "url": "https://patchwork.libcamera.org/api/users/14/?format=api", "username": "pinchartl", "first_name": "Laurent", "last_name": "Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "mbox": "https://patchwork.libcamera.org/patch/11073/mbox/", "series": [ { "id": 1631, "url": "https://patchwork.libcamera.org/api/series/1631/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1631", "date": "2021-01-31T18:17:19", "name": "Restore CameraSensor usage for YUV sensors", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1631/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11073/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11073/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 B6017BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 31 Jan 2021 18:17:50 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 80F42683D5;\n\tSun, 31 Jan 2021 19:17:49 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D8384683D0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 31 Jan 2021 19:17:46 +0100 (CET)", "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6EFE48A0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 31 Jan 2021 19:17:46 +0100 (CET)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"pUOHHs1u\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1612117066;\n\tbh=B93rKEFIsKSv1e9z4QLZsekDGzSyG+XXysRBBjTmEq8=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=pUOHHs1uUGBXhbFe5BPsfp8Mo91PaLLc1AxaK2U/H3onlxx4T30YbHvY4pcDbz2M3\n\tg3i9XgVHHlzO+Mu54Ben4H/LECkZe18dqXHgHCAMi7T+Urk1dSggCP0wVQPjyvcEjI\n\tpTR/RSEMGhL6o/ulZgN4xtY2ZGZqWgzFaMiiM7cs=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Sun, 31 Jan 2021 20:17:20 +0200", "Message-Id": "<20210131181722.5410-2-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.28.0", "In-Reply-To": "<20210131181722.5410-1-laurent.pinchart@ideasonboard.com>", "References": "<20210131181722.5410-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH 1/3] libcamera: camera_sensor: Store Bayer\n\tpattern in class member", "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>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "The Bayer pattern is retrieved based on the media bus formats supported\nby the sensor, when registering camera sensor properties. To prepare for\nits usage elsewhere in the CameraSensor class, store it in a private\nmember variable.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/internal/camera_sensor.h | 2 ++\n src/libcamera/camera_sensor.cpp | 22 +++++++++++++---------\n 2 files changed, 15 insertions(+), 9 deletions(-)", "diff": "diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h\nindex bf83d53134bf..a662807ab504 100644\n--- a/include/libcamera/internal/camera_sensor.h\n+++ b/include/libcamera/internal/camera_sensor.h\n@@ -20,6 +20,7 @@\n \n namespace libcamera {\n \n+class BayerFormat;\n class MediaEntity;\n \n struct CameraSensorInfo {\n@@ -89,6 +90,7 @@ private:\n \n \tSize pixelArraySize_;\n \tRectangle activeArea_;\n+\tconst BayerFormat *bayerFormat_;\n \n \tControlList properties_;\n };\ndiff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\nindex 2d15043431aa..35312857ff90 100644\n--- a/src/libcamera/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor.cpp\n@@ -133,7 +133,8 @@ LOG_DEFINE_CATEGORY(CameraSensor)\n * Once constructed the instance must be initialized with init().\n */\n CameraSensor::CameraSensor(const MediaEntity *entity)\n-\t: entity_(entity), pad_(UINT_MAX), properties_(properties::properties)\n+\t: entity_(entity), pad_(UINT_MAX), bayerFormat_(nullptr),\n+\t properties_(properties::properties)\n {\n }\n \n@@ -223,6 +224,15 @@ int CameraSensor::init()\n \t\treturn initProperties();\n \t}\n \n+\t/* Get the color filter array pattern (only for RAW sensors). */\n+\tfor (unsigned int mbusCode : mbusCodes_) {\n+\t\tconst BayerFormat &bayerFormat = BayerFormat::fromMbusCode(mbusCode);\n+\t\tif (bayerFormat.isValid()) {\n+\t\t\tbayerFormat_ = &bayerFormat;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n \tret = validateSensorDriver();\n \tif (ret)\n \t\treturn ret;\n@@ -405,14 +415,9 @@ int CameraSensor::initProperties()\n \tproperties_.set(properties::PixelArrayActiveAreas, { activeArea_ });\n \n \t/* Color filter array pattern, register only for RAW sensors. */\n-\tfor (const auto &format : formats_) {\n-\t\tunsigned int mbusCode = format.first;\n-\t\tBayerFormat bayerFormat = BayerFormat::fromMbusCode(mbusCode);\n-\t\tif (!bayerFormat.isValid())\n-\t\t\tcontinue;\n-\n+\tif (bayerFormat_) {\n \t\tint32_t cfa;\n-\t\tswitch (bayerFormat.order) {\n+\t\tswitch (bayerFormat_->order) {\n \t\tcase BayerFormat::BGGR:\n \t\t\tcfa = properties::draft::BGGR;\n \t\t\tbreak;\n@@ -428,7 +433,6 @@ int CameraSensor::initProperties()\n \t\t}\n \n \t\tproperties_.set(properties::draft::ColorFilterArrangement, cfa);\n-\t\tbreak;\n \t}\n \n \treturn 0;\n", "prefixes": [ "libcamera-devel", "1/3" ] }