From patchwork Fri Jan 22 09:25:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 10947 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 70467BD808 for ; Fri, 22 Jan 2021 09:25:49 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3F1D268241; Fri, 22 Jan 2021 10:25:49 +0100 (CET) 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="gSiwM3yk"; dkim-atps=neutral Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5D0EF68237 for ; Fri, 22 Jan 2021 10:25:46 +0100 (CET) Received: by mail-wm1-x32a.google.com with SMTP id j18so3648533wmi.3 for ; Fri, 22 Jan 2021 01:25:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oC5yi0rJCSJ++JryJM1jZt2Wbpib6spC2ceO5Cza75Y=; b=gSiwM3ykpvl1ogwZlqwEXenWeYrPU0AwiOB/MEvkgiBqQivK5D8UuacU5Re9UZ8+5n f0vLzakTwg/GG56c3P6iHc1Qs2VjTnqyu1QwwiORXWFD6pIqRlLVfYj4WYSuFhUlMaz6 nfSf4yL2FK+9XAWOSP45DSewcHeBJ0TCxcsYSm6MmJDkmNd5rQOHdDfI7n8EkTMJmeuN xzS9am2M3RXRJ+6Y5A79dOHKL5gr92N4/VUrmfmvmUQ63RwGO9rQo+BsCwEoxGDzFefT Uhx2ClrJIW/w8Q6e5nTTOdIuCmo8Gd41d0PDNlrdDJHnl+2Mr193eroy4YH3azucVhYP xJtw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=oC5yi0rJCSJ++JryJM1jZt2Wbpib6spC2ceO5Cza75Y=; b=PDDcnLvHhNU8NCgr7ocQCKbr/+OrWofsURZtbZzndXgESHxyzC6JTcD9rV2tKRIgG4 efigBokaQnmruhuUBlhVxzOwDjVaT6TTSOFQNKLpXcVBd4fO7WZfehAn81tWDdQisYzq 8WmoeD5r2xXnrk6ONNKLFU/LTvWhGa83MyrEGjIeGURgE3Y41dj4xgTrdz2wXGdflpja tTKEf735sTFoSsOX+Y9MuewYosbUluLuWYtwovF3XOR6yCmjgsh8PYlFOcinG1D9IOz1 n/lizM2iNJHmjFBbCE1C2eiAmjO4N/+qLhXiV3O3R6KwbBCYHDbQMujT385Inn9TeYlf IQjQ== X-Gm-Message-State: AOAM532mZ51BWgKaaRactLr6JWAEzJradZTaYh57HS1B8eg5JWsjre2v 2Ud83E654WAplh6BZ2aF0zxW0ElbOqSqMQ== X-Google-Smtp-Source: ABdhPJwNiHkw3qrsLUr2WFgK/1xWE/0B8lv2G4Hb8XRr/xWlPYphR9E1SLzQ2UXsJH6srKcNn0L01Q== X-Received: by 2002:a05:600c:1986:: with SMTP id t6mr3058448wmq.92.1611307545842; Fri, 22 Jan 2021 01:25:45 -0800 (PST) Received: from naushir-VirtualBox.patuck.local ([88.97.76.4]) by smtp.gmail.com with ESMTPSA id h15sm10664801wru.4.2021.01.22.01.25.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jan 2021 01:25:44 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Fri, 22 Jan 2021 09:25:34 +0000 Message-Id: <20210122092537.708375-4-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210122092537.708375-1-naush@raspberrypi.com> References: <20210122092537.708375-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 3/6] uapi: raspberrypi: Update the bcm2835-isp header definition 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" Update the bcm2835-isp.h file with the latest version available in the downstream Raspberry Pi linux repo. This change adds support for colour denoise processing, and the following downstream kernel changes must be available: https://github.com/raspberrypi/linux/pull/4069 https://github.com/raspberrypi/linux/pull/4083 The Raspberry Pi image must also be running the latest firmware, obtained by running rpi-update. Signed-off-by: Naushir Patuck Acked-by: Kieran Bingham Reviewed-by: David Plowman --- include/linux/bcm2835-isp.h | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/include/linux/bcm2835-isp.h b/include/linux/bcm2835-isp.h index 45abb681517e..94c3af947883 100644 --- a/include/linux/bcm2835-isp.h +++ b/include/linux/bcm2835-isp.h @@ -31,7 +31,8 @@ (V4L2_CID_USER_BCM2835_ISP_BASE + 0x0007) #define V4L2_CID_USER_BCM2835_ISP_DPC \ (V4L2_CID_USER_BCM2835_ISP_BASE + 0x0008) - +#define V4L2_CID_USER_BCM2835_ISP_CDN \ + (V4L2_CID_USER_BCM2835_ISP_BASE + 0x0009) /* * All structs below are directly mapped onto the equivalent structs in * drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h @@ -46,7 +47,7 @@ */ struct bcm2835_isp_rational { __s32 num; - __s32 den; + __u32 den; }; /** @@ -140,7 +141,7 @@ struct bcm2835_isp_black_level { __u16 black_level_r; __u16 black_level_g; __u16 black_level_b; - __u8 pad_[2]; /* Unused */ + __u8 padding[2]; /* Unused */ }; /** @@ -175,6 +176,31 @@ struct bcm2835_isp_gamma { __u16 y[BCM2835_NUM_GAMMA_PTS]; }; +/** + * enum bcm2835_isp_cdn_mode - Mode of operation for colour denoise. + * + * @CDN_MODE_FAST: Fast (but lower quality) colour denoise + * algorithm, typically used for video recording. + * @CDN_HIGH_QUALITY: High quality (but slower) colour denoise + * algorithm, typically used for stills capture. + */ +enum bcm2835_isp_cdn_mode { + CDN_MODE_FAST = 0, + CDN_MODE_HIGH_QUALITY = 1, +}; + +/** + * struct bcm2835_isp_cdn - Colour denoise parameters set with the + * V4L2_CID_USER_BCM2835_ISP_CDN ctrl. + * + * @enabled: Enable colour denoise. + * @cdn_mode: Colour denoise operating mode (see enum &bcm2835_isp_cdn_mode) + */ +struct bcm2835_isp_cdn { + __u32 enabled; + __u32 mode; +}; + /** * struct bcm2835_isp_denoise - Denoise parameters set with the * V4L2_CID_USER_BCM2835_ISP_DENOISE ctrl.