{"id":18701,"url":"https://patchwork.libcamera.org/api/patches/18701/?format=json","web_url":"https://patchwork.libcamera.org/patch/18701/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20230605082605.9993-2-naush@raspberrypi.com>","date":"2023-06-05T08:26:04","name":"[libcamera-devel,v3,1/2] camera_sensor: ipa: core: Add CFA pattern to IPACameraSensorInfo","commit_ref":"54340ef70f7ece5354dd4b62cecf833da400fdd9","pull_url":null,"state":"accepted","archived":false,"hash":"a4190b677f029a87c30c12acc2da81f55dc24604","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18701/mbox/","series":[{"id":3906,"url":"https://patchwork.libcamera.org/api/series/3906/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3906","date":"2023-06-05T08:26:03","name":"Mono sensor improvements","version":3,"mbox":"https://patchwork.libcamera.org/series/3906/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18701/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18701/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 D09A1C328F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  5 Jun 2023 08:26:13 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AEAFE62888;\n\tMon,  5 Jun 2023 10:26:12 +0200 (CEST)","from mail-wm1-x335.google.com (mail-wm1-x335.google.com\n\t[IPv6:2a00:1450:4864:20::335])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 27C0A61EA2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  5 Jun 2023 10:26:11 +0200 (CEST)","by mail-wm1-x335.google.com with SMTP id\n\t5b1f17b1804b1-3f6a6b9c079so37527225e9.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 05 Jun 2023 01:26:11 -0700 (PDT)","from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\t12-20020a05600c020c00b003f080b2f9f4sm13520686wmi.27.2023.06.05.01.26.09\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 05 Jun 2023 01:26:09 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1685953572;\n\tbh=0TjsBclAlE6H5qPR1974twQdZQ9SbFZs1nB0jRN66Gc=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=oQEFADirT+y8DQdyje0aDI2RN50/VwX3TMNcZnGaSHJ/sqe6hmSJgLnm9WEbQ0ZaR\n\ti0I3ZRq84BqYVme3DMQnVmb0g05CwVj6SdHzaIyu4skaeYlVSALLNYIEhbek8z8o/k\n\tIPTitvy1Dh+zItJlMpLbiA0sSJfy5DdE08v3xJeBLSs23EfRbNeaXkMyrQ8GVV8taC\n\teP/oArPu8XsMbOGIzx17pIZDcELWNhUEm7+S+RReQFRunEN7V2LVyQa6JgQubYAc2P\n\tIO1NTXgK2sw8ycI+K0kS0w+9+FIB5L8fDyVbTYaTZ5lPxdk76rNC44y4sC/E6jIG74\n\tKQinuZ+re+LBA==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1685953570; x=1688545570;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=GJ1SsWfssQVXGTqyavpfiDT9rBEE80I2lxQHY49BRFw=;\n\tb=YNY9WF8nq7uhUrVEhAGnNQE6DdppO2I4S++9xtgGXyFbvZ/7sYZ9YBy42cgiD6ftjB\n\t205ZRd3/we+BeKPKnQwPdNfLQQm3YZbfRYeXwA8JBpVezMNAqgXg4jGXWyQy6RRjNwvI\n\tEMOWg5CK6sTb+sZMFiy5CQ84kSbu6LjBczvDs3jsYZJpuFB+K/HvE8pAPEsSThZAg1/p\n\t7Y7WG3D7aQN8FpCtPLZvOQoOu3LK5nyLn/XyKg3ndt42ipMEDtq75/7/Kd64aRk2n745\n\tdDgFjYFzBwR07zgonJSp9pk1ahsDdRqKBHohONPpIYlARedu6Sm+klY/3/XIH5KwesXu\n\tL8FQ=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"YNY9WF8n\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20221208; t=1685953570; x=1688545570;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=GJ1SsWfssQVXGTqyavpfiDT9rBEE80I2lxQHY49BRFw=;\n\tb=MRq0KIeMVorrlNuBWfcxwGf673akBAGX9VyqP6XsCFm+89ITwH7uDEGRAh/YhXyB2w\n\tb/cuYRcLy4QpxdVmzPgBwiBVrIwTBxNg8C5T1EbOBbN5qudhtvpsexO+cQkTZoOgut20\n\tI4vMHfI1yPShuuGrGtDeXD7hLbpsn+P3nTPNfCRBJCDCoDqiTAsTvmHK3LslyziA4JzV\n\tCxIuF/4u4KWiO9LZqKYLzm5u4BBaYNZKzQAlrTBEIboBW+tpJfkTxb1tK1qKWFQK/EJD\n\tDZHVP8KbKOEMveoebKnR0a7GBLew6AoPkikr4mh21d44Adg3vqaxb75VWbro6nNjgZmw\n\t8XUg==","X-Gm-Message-State":"AC+VfDyH+jU6zexLuPTu99j9bPXnvJ+J0tVKhGnDH9wLZrjNiKlItUag\n\tDwVys6k5csu+IIgNriw88wANz1mI/DIVbJg6tc9U/A==","X-Google-Smtp-Source":"ACHHUZ7VdFNLwLLPOrthhd+S1yzOIrl4QotNwludWleuo/f7Q/VVVMxIG2Ft/sBXSFyCrsahcX7tbw==","X-Received":"by 2002:a7b:ce89:0:b0:3f6:552:8722 with SMTP id\n\tq9-20020a7bce89000000b003f605528722mr6277290wmj.18.1685953570463; \n\tMon, 05 Jun 2023 01:26:10 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Mon,  5 Jun 2023 09:26:04 +0100","Message-Id":"<20230605082605.9993-2-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20230605082605.9993-1-naush@raspberrypi.com>","References":"<20230605082605.9993-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3 1/2] camera_sensor: ipa: core: Add CFA\n\tpattern to IPACameraSensorInfo","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>","From":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Add a new cfaPattern field to the IPACameraSensorInfo to pass the\nCFA/Bayer pattern for the current sensor configuration to the IPA.\nThis field takes a value from properties::draft::ColorFilterArrangementEnum.\n\nPopulate cfaPattern in CameraSensor::sensorInfo(), called by the\npipeline handler before it calls ipa->init() and ipa->config().\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/ipa/core.mojom | 13 +++++++++++++\n src/libcamera/camera_sensor.cpp  |  3 +++\n 2 files changed, 16 insertions(+)","diff":"diff --git a/include/libcamera/ipa/core.mojom b/include/libcamera/ipa/core.mojom\nindex 5cef340d014c..bce797245829 100644\n--- a/include/libcamera/ipa/core.mojom\n+++ b/include/libcamera/ipa/core.mojom\n@@ -140,6 +140,18 @@ module libcamera;\n  * image sensor\n  */\n \n+/**\n+ * \\var IPACameraSensorInfo::cfaPattern\n+ * \\brief The arrangement of colour filters on the image sensor\n+ *\n+ * This takes a value defined by properties::draft::ColorFilterArrangementEnum.\n+ * For non-Bayer colour sensors, the cfaPattern will be set to\n+ * properties::draft::ColorFilterArrangementEnum::RGB.\n+ *\n+ * \\todo Make this variable optional once mojom supports it, instead of using\n+ * RGB for sensors that don't have a CFA.\n+ */\n+\n /**\n  * \\var IPACameraSensorInfo::activeAreaSize\n  * \\brief The size of the pixel array active area of the sensor\n@@ -229,6 +241,7 @@ struct IPACameraSensorInfo {\n \tstring model;\n \n \tuint32 bitsPerPixel;\n+\tuint32 cfaPattern;\n \n \tSize activeAreaSize;\n \tRectangle analogCrop;\ndiff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\nindex 06f315210240..60bf87b49e6e 100644\n--- a/src/libcamera/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor.cpp\n@@ -956,6 +956,9 @@ int CameraSensor::sensorInfo(IPACameraSensorInfo *info) const\n \tinfo->bitsPerPixel = format.bitsPerPixel();\n \tinfo->outputSize = format.size;\n \n+\tstd::optional<int32_t> cfa = properties_.get(properties::draft::ColorFilterArrangement);\n+\tinfo->cfaPattern = cfa ? *cfa : properties::draft::RGB;\n+\n \t/*\n \t * Retrieve the pixel rate, line length and minimum/maximum frame\n \t * duration through V4L2 controls. Support for the V4L2_CID_PIXEL_RATE,\n","prefixes":["libcamera-devel","v3","1/2"]}