1 From 19b66a5cc04a0f4dee17bbc862568e6c7e015963 Mon Sep 17 00:00:00 2001
2 From: Naushir Patuck <naush@raspberrypi.com>
3 Date: Thu, 14 Jan 2021 09:20:52 +0000
4 Subject: [PATCH] staging: vc04_services: ISP: Add colour denoise
7 Add colour denoise control to the bcm2835 driver through a new v4l2
8 control: V4L2_CID_USER_BCM2835_ISP_CDN.
10 Add the accompanying MMAL configuration structure definitions as well.
12 Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
14 .../vc04_services/bcm2835-isp/bcm2835-isp-ctrls.h | 5 +++++
15 .../vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c | 5 +++++
16 .../vc04_services/vchiq-mmal/mmal-parameters.h | 13 +++++++++++++
17 3 files changed, 23 insertions(+)
19 --- a/drivers/staging/vc04_services/bcm2835-isp/bcm2835-isp-ctrls.h
20 +++ b/drivers/staging/vc04_services/bcm2835-isp/bcm2835-isp-ctrls.h
21 @@ -57,6 +57,11 @@ static const struct bcm2835_isp_custom_c
22 .size = sizeof(struct bcm2835_isp_denoise),
25 + .name = "Colour Denoise",
26 + .id = V4L2_CID_USER_BCM2835_ISP_CDN,
27 + .size = sizeof(struct bcm2835_isp_cdn),
30 .name = "Defective Pixel Correction",
31 .id = V4L2_CID_USER_BCM2835_ISP_DPC,
32 .size = sizeof(struct bcm2835_isp_dpc),
33 --- a/drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c
34 +++ b/drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c
35 @@ -766,6 +766,11 @@ static int bcm2835_isp_s_ctrl(struct v4l
37 sizeof(struct bcm2835_isp_denoise));
39 + case V4L2_CID_USER_BCM2835_ISP_CDN:
40 + ret = set_isp_param(node, MMAL_PARAMETER_CDN,
42 + sizeof(struct bcm2835_isp_cdn));
44 case V4L2_CID_USER_BCM2835_ISP_SHARPEN:
45 ret = set_isp_param(node, MMAL_PARAMETER_SHARPEN,
47 --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h
48 +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h
49 @@ -279,6 +279,8 @@ enum mmal_parameter_camera_type {
51 /**< Tales a @ref MMAP_PARAMETER_GAMMA_T */
53 + /**< Takes a @ref MMAL_PARAMETER_CDN_T */
55 /**< Takes a @ref MMAL_PARAMETER_BOOLEAN_T */
56 MMAL_PARAMETER_JPEG_IJG_SCALING,
58 @@ -915,6 +917,17 @@ struct mmal_parameter_gamma {
59 u16 y[MMAL_NUM_GAMMA_PTS];
62 +enum mmal_parameter_cdn_mode {
63 + MMAL_PARAM_CDN_FAST = 0,
64 + MMAL_PARAM_CDN_HIGH_QUALITY = 1,
65 + MMAL_PARAM_CDN_DUMMY = 0x7FFFFFFF
68 +struct mmal_parameter_colour_denoise {
70 + enum mmal_parameter_cdn_mode mode;
73 struct mmal_parameter_denoise {