From patchwork Wed Jan 20 08:34:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 10907 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 B2D4AC0F2A for ; Wed, 20 Jan 2021 08:35:01 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 807A06818A; Wed, 20 Jan 2021 09:35:01 +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="EfAEAiJn"; dkim-atps=neutral Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E9D506817F for ; Wed, 20 Jan 2021 09:34:57 +0100 (CET) Received: by mail-wr1-x42c.google.com with SMTP id a12so22184951wrv.8 for ; Wed, 20 Jan 2021 00:34:57 -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=8+WE1NbwXZbetuH84QlaBUaemUMsSvDAmxHr0W24uLk=; b=EfAEAiJnsCMXaTOtzjLK44KG/wdQfKha//2TVE4ZZaQo3H5jR0m+rnOmFAVRarbbxE xoiyEUo5K818QJXWzsec9+JbU2C4L3DUwvE6hBjQriQR06QOTn1bdlwXR1sMzAZ0eNXc rOoTR/UVdtP67wy3an5OjCMWMu1jH6+K6Qh5jlSJ9OzpuTPBkGjP9uqK0nGd/02j3VWQ 1R4P171whVNW4HyjEKFPn18VMV1wEiWxuijF0TJhXDsdsrhRH36rWihY5m10XqTf+STf tse/gnXtj5YI+b84im2MLiOAgZoOaB8TI6uL1yD91zbbsQEH6k0gg7mwXA36vFYdf8zd YFjg== 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=8+WE1NbwXZbetuH84QlaBUaemUMsSvDAmxHr0W24uLk=; b=TbtKNW+2lti3GEvE24QcETKMWYU9i+1eix3qYt6wEH+rOZssz4FHh5jK4l3grPhAaD akv+RJGxGSVQYRCqBPduZFCfOdIN0Ia1wbi1qoZu6rZLd+ZatnZJL593vIg0AoQQXhjY yNuwDuxc4T/OW3cn+M5rnYUb0LI8bnj1V5ooTn0+MrWxmiWtYjD+rwbna35FhRc3zmLX V22hXlmbisuXfbjHIiny/Z/6n3PdFkyE7yv3SHCjGWmA5RUqGbKNQmC0XBKSLTW6RcqY 3uyGP4X+2iQstaC7E7Ysqb7oyCiAGwBH49Lpx+dVsTWKpfyCNCveXrYOS2NTmkbyA4w0 KYBg== X-Gm-Message-State: AOAM531mzjaTCIDvU+dyCRSD4IlsQviv5K/dfNO6t6uzwdFQYfKDGGwf h1O1csbtLJOXlXVs4Fo4TM3XEWt4E4NGXg== X-Google-Smtp-Source: ABdhPJwFCrhyvsVPozUgCdHKCCCq8aXejzgxiFlARaJ6jPWVO5NMRNGYqLh08X9UWFjNCTANipGudQ== X-Received: by 2002:a5d:4d8d:: with SMTP id b13mr7811426wru.415.1611131697455; Wed, 20 Jan 2021 00:34:57 -0800 (PST) Received: from naushir-VirtualBox.patuck.local ([88.97.76.4]) by smtp.gmail.com with ESMTPSA id 33sm2809284wrn.35.2021.01.20.00.34.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jan 2021 00:34:56 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Wed, 20 Jan 2021 08:34:47 +0000 Message-Id: <20210120083449.642418-4-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210120083449.642418-1-naush@raspberrypi.com> References: <20210120083449.642418-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 3/5] 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 Raspberryp 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.