From patchwork Tue Jan 26 16:24:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 11012 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 12EBFC0F2B for ; Tue, 26 Jan 2021 16:24:26 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D266668325; Tue, 26 Jan 2021 17:24:25 +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="KTQ4W5Id"; dkim-atps=neutral Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8835E68319 for ; Tue, 26 Jan 2021 17:24:20 +0100 (CET) Received: by mail-wr1-x431.google.com with SMTP id l12so17105196wry.2 for ; Tue, 26 Jan 2021 08:24:20 -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=bjrxqpQgzDBa9WkS2S3Mn4TK2H7Bqit1lomfmatnMZc=; b=KTQ4W5IdZvPL1Sq84nOUcjfU99Sk6btme6F/Efq823pqarj1r5Pd7KVS1b2sQVbOF1 MV4IR+ql+/j3bYNYLMV40Zkkx3MS963Y3ljx0LWjFoVhd1aztbwDNC8NCss0aobQ6wN7 PYowtsmHmY8ksR1YlnMQCTLAdSwEvjDabv86MO0sDI9nb6o0uUis0TlJR1cPLwUZJ2y1 158iDNDYLE/xhcJpzd4KQawnjQVDKjaUKEoA63/P5w1UNwIG5XmqxNuVA80DNtJKnEQC vJNt2W87I9mb3uaoG5lqx/f9jSELdYtBPMkByicaTTXy+CDPQKg8DOSrr1FrBMq5wglv zKKA== 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=bjrxqpQgzDBa9WkS2S3Mn4TK2H7Bqit1lomfmatnMZc=; b=sozB9MKAiKYIK4a084rojGwYWQ0k1Yd3btxw5QZhuO8ZgkoP4KOGXS2guqEUkpNpJ9 eaX7js2FwGY9cXVMfVGtjAqIaqJn97AQ5jSmj//rEAQ+7GHbeE6svLCeKkqZQOzLjW6C siO8Bw5N43ce4JdZC9e7dQtdrjagqtaNsh/BxMTkqpiKN/Qmmkk+OWaEI/APU22daI6f ONdehpLGb5tUQ0rnCtIj1uy2s4l8D9lM3tiXyC7xhBCP/76AqZEBTEgVaEmV8iyFz1QJ yCl9rHq6ojocBxONp6s5xlLLHBD0zXY3Yteqpg7nr3kNK68h0S1/Jnk1B1hn8jcz8ntd bLbw== X-Gm-Message-State: AOAM5327jno0gN7QrKrtuEBCM9kNedaw/B7cOSFJq9J+N+aBvZttfirW /ORujYZl8m5dTlx9y8+zghNh80Ck/8G9tKKj X-Google-Smtp-Source: ABdhPJwze0M+nfemMuY3tu8VbL/TAUtAeEvTKU/nOtZ7OcN/YXzJXsh81qcCtpNX0ncJ3FOzpsztzQ== X-Received: by 2002:a05:6000:1082:: with SMTP id y2mr6717494wrw.27.1611678260089; Tue, 26 Jan 2021 08:24:20 -0800 (PST) Received: from naushir-VirtualBox.patuck.local ([88.97.76.4]) by smtp.gmail.com with ESMTPSA id m18sm8725809wrx.17.2021.01.26.08.24.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jan 2021 08:24:19 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Tue, 26 Jan 2021 16:24:09 +0000 Message-Id: <20210126162412.824033-4-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210126162412.824033-1-naush@raspberrypi.com> References: <20210126162412.824033-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 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 Reviewed-by: David Plowman Acked-by: Kieran Bingham --- 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.