From patchwork Fri Jan 22 13:14:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 10960 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 2D078BD808 for ; Fri, 22 Jan 2021 13:15:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E64566827A; Fri, 22 Jan 2021 14:14:59 +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="F8YKlKj/"; dkim-atps=neutral Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DF2CD6827E for ; Fri, 22 Jan 2021 14:14:57 +0100 (CET) Received: by mail-wr1-x42a.google.com with SMTP id 6so5054486wri.3 for ; Fri, 22 Jan 2021 05:14: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=bjrxqpQgzDBa9WkS2S3Mn4TK2H7Bqit1lomfmatnMZc=; b=F8YKlKj/u+wU+HmX9udoUG8DQJ1HTe6ukLmaKOVjepc+ZKD+MJcuCIgwiYzj/aAABy Wpi2UXR5FAjmaEMxh/2W34gwD691cbN7qUmSwQ5361JZ0Fg9XmprSzbFi7cJDg6IfJ8z 6YAAK7rRyBhQKWP9PguWqPDVr5a+Ap8R9lYAOQJZB74QFOuOkxNEyaVT5ZJhU4Tq2xlj KnHpOu9VOv8h+8kcB4FWpErgetBt89/og8YyzzQuZiI7lcOC/uDTVE/7WahRKRYsRmWH cV4eSw5tl10P32j0zxfgXiI5adizCiRzhGP8nTX+6R7taFvVPmwzKaRcTJUO09Lpc3tU cQ6A== 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=gvDghyQhhSNlInM1LEaLQoDrcAadoFK2Em7ORZnzG348WXSRje7d7He8ZuHwxooGyx z2nvqx4ImlG1veqAQj/wyUiLjvOgsBlb30NzJJyKMPx3Dv/vYPLm9Lk+/Q/DGrHaKJ9S EhlMD1+XyuOKi7cB7YYJ0rj5geEihkrDWzTFT+AgkyB+jcfd6QvsYSgrpyOT0w2+cQqa JZsx++Qw/iNycJmCFV6sai6xS4/Y+5ZGa+Z8cM/94Mt3OKZKv3pvaqtvn2i1hrNNXkTn ltYbAbjdyBrz8Q32Xet3Q+aiYlfrj7Vrkvtah3k8zEz+5ozrvgjqPm7Lg/l2imkIDWhw 2MWA== X-Gm-Message-State: AOAM532KP4vHpyInm2O+aTypLzBvu0hFELWFn4pZeDowxflGsrIjNytW I0BtN8mqUJ21POmJOteKK0tRxHJYgDvA3g== X-Google-Smtp-Source: ABdhPJyQPFr3qPbXncCC8KBVSinSlrZ+mMRSn3ggklXjQ2dIwtM3CBqQZ5c34kqGF7AX6fXFOZX80g== X-Received: by 2002:a5d:5549:: with SMTP id g9mr4792020wrw.244.1611321297397; Fri, 22 Jan 2021 05:14:57 -0800 (PST) Received: from naushir-VirtualBox.patuck.local ([88.97.76.4]) by smtp.gmail.com with ESMTPSA id i8sm7228870wry.90.2021.01.22.05.14.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jan 2021 05:14:56 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Fri, 22 Jan 2021 13:14:48 +0000 Message-Id: <20210122131451.726584-3-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210122131451.726584-1-naush@raspberrypi.com> References: <20210122131451.726584-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 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.