1 From 29ec709794ac2aae569c8d486dd19a7d731cfeeb 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-v4l2-isp.c | 5 +++++
15 .../vc04_services/bcm2835-isp/bcm2835_isp_ctrls.h | 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-v4l2-isp.c
20 +++ b/drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c
21 @@ -776,6 +776,11 @@ static int bcm2835_isp_s_ctrl(struct v4l
23 sizeof(struct bcm2835_isp_denoise));
25 + case V4L2_CID_USER_BCM2835_ISP_CDN:
26 + ret = set_isp_param(node, MMAL_PARAMETER_CDN,
28 + sizeof(struct bcm2835_isp_cdn));
30 case V4L2_CID_USER_BCM2835_ISP_SHARPEN:
31 ret = set_isp_param(node, MMAL_PARAMETER_SHARPEN,
33 --- a/drivers/staging/vc04_services/bcm2835-isp/bcm2835_isp_ctrls.h
34 +++ b/drivers/staging/vc04_services/bcm2835-isp/bcm2835_isp_ctrls.h
35 @@ -57,6 +57,11 @@ static const struct bcm2835_isp_custom_c
36 .size = sizeof(struct bcm2835_isp_denoise),
39 + .name = "Colour Denoise",
40 + .id = V4L2_CID_USER_BCM2835_ISP_CDN,
41 + .size = sizeof(struct bcm2835_isp_cdn),
44 .name = "Defective Pixel Correction",
45 .id = V4L2_CID_USER_BCM2835_ISP_DPC,
46 .size = sizeof(struct bcm2835_isp_dpc),
47 --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h
48 +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h
49 @@ -277,6 +277,8 @@ enum mmal_parameter_camera_type {
51 /**< Tales a @ref MMAP_PARAMETER_GAMMA_T */
53 + /**< Takes a @ref MMAL_PARAMETER_CDN_T */
57 struct mmal_parameter_rational {
58 @@ -910,6 +912,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 {