From patchwork Mon Feb 8 15:07:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 11191 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 A1136BD160 for ; Mon, 8 Feb 2021 15:07:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3DC6760D2B; Mon, 8 Feb 2021 16:07:57 +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="WX5HpsC4"; dkim-atps=neutral Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3B05E60D20 for ; Mon, 8 Feb 2021 16:07:56 +0100 (CET) Received: by mail-wr1-x42d.google.com with SMTP id b3so17526386wrj.5 for ; Mon, 08 Feb 2021 07:07:56 -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=3HH8/GUJORTvoTeFuBrsV0XIkD1kOM1ZRQFK0DdpmdE=; b=WX5HpsC4/GZSwASifETmCXTctAMT4OE/VBHxloymOfHhBzcot1fD1LypIGIpHS78cR vz8fZFTtsxszsIBIB+mdZAy7I2CstzEYvYoqM3W7OPCw7+elm7BeMdXh18jEwAhi43IV DNKvyereKQml9URcJ7+tltrSr2NZAE5YMi33BSKm71E5zrGhN1TvahUGugtYp4Wtx96V SNILbvAPgcgQTRVID94OcK51hvshTLqTKd35dix3SzYZ4As/LlNMW0mxMZP9iZPaOTSk CYTWu48ERe29I/V5OMs3IiogHvCms8hlrlI4kZPAN61OIZwkIIA1zLf6KQP4D+NYFemA Pn8A== 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=3HH8/GUJORTvoTeFuBrsV0XIkD1kOM1ZRQFK0DdpmdE=; b=lbFj3UzXJJFsfIOMJ9FfbYhHb1WmhxdntalQrwsNSwVg313xjt419snTwZxybxJ5LH cSeAeUFBYuW/SxEn3U6y8NpjRwLlILnokWFLcBlrkqd9+x+7mbUB6M3v3MEUnDjqnrjQ pFfJyGgSfDHahz4hSlICuAndV3bIQ4LeCCt82qsy+aNlCeKB6L+r0f9xwpK6YwdLIKTM pCsBIWlQ5imxTkBioVBEOuFPhM81iYTP3c5kJTmPF+UdnHnaRhTiCoSIuvZrrpTrNQoN Ehot2jC4BZ/sb3T+Ym+2UJtDGnEQ0mYYRTfaf8qRvO0P9IEH+xkiMdwnRr6oEonPNGsB NMoQ== X-Gm-Message-State: AOAM530G7qQQ9F8ZJK6dbdNtwiyYIyz4mZeCqcpKxkuHK4Y20KAwcwWM AiBUKWiUbm2S4fQ6D8qk9LTuclTM90q3eqKY X-Google-Smtp-Source: ABdhPJyMLgoiiB/1KZKLvjR2R5xZlstWDx1IzHoj4tzmvqARWYoF6IE+gd91jsqwc6YGPCavRt5W6A== X-Received: by 2002:a5d:5049:: with SMTP id h9mr20942064wrt.404.1612796875466; Mon, 08 Feb 2021 07:07:55 -0800 (PST) Received: from naush-laptop.pitowers.org (cust51-dsl50.idnet.net. [212.69.50.51]) by smtp.gmail.com with ESMTPSA id a17sm31261389wrx.63.2021.02.08.07.07.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Feb 2021 07:07:54 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Mon, 8 Feb 2021 15:07:35 +0000 Message-Id: <20210208150738.2293520-4-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210208150738.2293520-1-naush@raspberrypi.com> References: <20210208150738.2293520-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v6 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 at commit: 68878170d8a98afd6d519a3a2c909080c19de4ce 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 Reviewed-by: Laurent Pinchart --- 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.