From patchwork Tue Jun 15 10:51:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 12596 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 94135BD78E for ; Tue, 15 Jun 2021 10:51:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C276A68948; Tue, 15 Jun 2021 12:51:43 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="nFoT9/DW"; dkim-atps=neutral Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E395C6029A for ; Tue, 15 Jun 2021 12:51:42 +0200 (CEST) Received: by mail-wm1-x333.google.com with SMTP id h11-20020a05600c350bb02901b59c28e8b4so1456337wmq.1 for ; Tue, 15 Jun 2021 03:51:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3h0epDvGtx3cavNp2JBbcJcJviLXVB+4fyiqILpE40c=; b=nFoT9/DWLkjS6cZ+FDg5dfgUZcHmE8Er3pYOVaVWZXRA4/ToFojOczHY9/NeThZ11w /RKK7+JxHvI3ddkheOhdo1dhEPtwYTf5zRWTengAiizEUivJx9sJ5ncJDo2wKDGu2MU6 3Twiwdrj0954SmbQGp9aEn7O4hlk8TsPwBm3bkAfmn514Q8hVCXPLitTqb3JQZ2YNqql +3EKFYIl+6V2RD3Ne8bGXpnJf4xacQfdq2SfcY9R64kk3W+d4itla0/3gQl+dmOwaQEr GdJFZZ9KmjIJJkCYbf6wvPUbWnajhccbU7kzK0NVKHi2Sk0UCqQ5cK7qZd3qFIxjdTE8 uLSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3h0epDvGtx3cavNp2JBbcJcJviLXVB+4fyiqILpE40c=; b=mhzNli36ET4tH/w6VyHGwCwE8VGBr6xPSaQRp4md/bh39YaZVum6D9nrS7jsRML8hl omZjN/APvXJ+iQ0PiT6GvUKHGL77gh8W0io9bXrWRr/t53l0KFhswe2p/zkwOvc9rEZl X649/yafR8Xvghu5Kd3ZVO4no9BHT0SXhC+S76XmTPmzSwwJa8ZKN2fAkEy9i+Rr1UzB uwH8ChuxoBWLZNLQQREICKfqNxLyL9ubwybECOshPcHw0q35H5pQg+kh4DeQDIews4RC +ukKTfxW/+VRhX+z/X7/sZfZZiwmNQJ+ENUmrJ6BC3/ax9kLwB9udbxL5XIRnjhBvsKp R/Ag== X-Gm-Message-State: AOAM533rFRId4gX1MSK4RWOJ2R2PDCacx31w9YcDnJjknb09MJdxx3De XXGKRmyI+H3+vDz0BFU/I7iymBTk423d/j6y X-Google-Smtp-Source: ABdhPJwYtQ0LeDGtTCwLowOM4gvSkEBoJD7PmNOkzFmxLdqMpYihvpF4Drr6lj0sdJkLq/A2Y+zlzQ== X-Received: by 2002:a7b:c5d2:: with SMTP id n18mr4563336wmk.97.1623754302140; Tue, 15 Jun 2021 03:51:42 -0700 (PDT) Received: from pi4-davidp.pitowers.org ([2a00:1098:3142:14:1ce1:9965:4328:89c4]) by smtp.gmail.com with ESMTPSA id u15sm1796300wmq.48.2021.06.15.03.51.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Jun 2021 03:51:41 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Tue, 15 Jun 2021 11:51:36 +0100 Message-Id: <20210615105139.16171-1-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/3] Support monochrome raw sensors X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hi This small patch set adds the necessary support for monochrome (greyscale) raw sensors, and also adds a tuning for one such sensor (the OV9281) for the Raspberry Pi. There are 3 patches: The first patch is the only one that affects non-Raspberry Pi code. It adds a new "MONO" order to the BayerFormat class. Possibly this might be slightly controversial, since when is "not really a Bayer format" a valid Bayer format? Nonetheless, I think it does make sense, and indeed this is not the first time I've created an enum for the 4 standard Bayer orders and then, when a monochrome sensor comes along, found myself adding this extra item. Moreover, the code that uses it - even all the transform related stuff - all works out nicely with no further edits. What do people think? The final two commits are Pi specific - I think they should be self-explanatory. Thanks! David David Plowman (3): libcamera: Add support for monochrome sensors libcamera: ipa: raspberrypi: Demote warnings about lack of AWB results libcamera: ipa: raspberrypi: Add support for ov9281 sensor include/libcamera/internal/bayer_format.h | 3 +- src/ipa/raspberrypi/cam_helper_mov9281.cpp | 108 ++++++++++++++++++++ src/ipa/raspberrypi/controller/rpi/agc.cpp | 2 +- src/ipa/raspberrypi/controller/rpi/alsc.cpp | 2 +- src/ipa/raspberrypi/data/meson.build | 1 + src/ipa/raspberrypi/data/mov9281.json | 92 +++++++++++++++++ src/ipa/raspberrypi/meson.build | 1 + src/libcamera/bayer_format.cpp | 14 ++- src/libcamera/camera_sensor.cpp | 3 + src/libcamera/property_ids.yaml | 4 + 10 files changed, 225 insertions(+), 5 deletions(-) create mode 100644 src/ipa/raspberrypi/cam_helper_mov9281.cpp create mode 100644 src/ipa/raspberrypi/data/mov9281.json