staging: vc04_services: ISP: Add colour denoise control
authorNaushir Patuck <naush@raspberrypi.com>
Thu, 14 Jan 2021 09:20:52 +0000 (09:20 +0000)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:33:08 +0000 (11:33 +0000)
Add colour denoise control to the bcm2835 driver through a new v4l2
control: V4L2_CID_USER_BCM2835_ISP_CDN.

Add the accompanying MMAL configuration structure definitions as well.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
drivers/staging/vc04_services/bcm2835-isp/bcm2835-isp-ctrls.h
drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c
drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h

index cfbb106..1726057 100644 (file)
@@ -57,6 +57,11 @@ static const struct bcm2835_isp_custom_ctrl custom_ctrls[] = {
                .size   = sizeof(struct bcm2835_isp_denoise),
                .flags  = 0
        }, {
+               .name   = "Colour Denoise",
+               .id     = V4L2_CID_USER_BCM2835_ISP_CDN,
+               .size   = sizeof(struct bcm2835_isp_cdn),
+               .flags  = 0
+       }, {
                .name   = "Defective Pixel Correction",
                .id     = V4L2_CID_USER_BCM2835_ISP_DPC,
                .size   = sizeof(struct bcm2835_isp_dpc),
index 8fea61d..e8f3362 100644 (file)
@@ -766,6 +766,11 @@ static int bcm2835_isp_s_ctrl(struct v4l2_ctrl *ctrl)
                                    ctrl->p_new.p_u8,
                                    sizeof(struct bcm2835_isp_denoise));
                break;
+       case V4L2_CID_USER_BCM2835_ISP_CDN:
+               ret = set_isp_param(node, MMAL_PARAMETER_CDN,
+                                   ctrl->p_new.p_u8,
+                                   sizeof(struct bcm2835_isp_cdn));
+               break;
        case V4L2_CID_USER_BCM2835_ISP_SHARPEN:
                ret = set_isp_param(node, MMAL_PARAMETER_SHARPEN,
                                    ctrl->p_new.p_u8,
index 6ae2673..722af05 100644 (file)
@@ -279,6 +279,8 @@ enum mmal_parameter_camera_type {
        MMAL_PARAMETER_DPC,
                /**< Tales a @ref MMAP_PARAMETER_GAMMA_T */
        MMAL_PARAMETER_GAMMA,
+               /**< Takes a @ref MMAL_PARAMETER_CDN_T */
+       MMAL_PARAMETER_CDN,
                /**< Takes a @ref MMAL_PARAMETER_BOOLEAN_T */
        MMAL_PARAMETER_JPEG_IJG_SCALING,
 };
@@ -915,6 +917,17 @@ struct mmal_parameter_gamma {
        u16 y[MMAL_NUM_GAMMA_PTS];
 };
 
+enum mmal_parameter_cdn_mode {
+       MMAL_PARAM_CDN_FAST = 0,
+       MMAL_PARAM_CDN_HIGH_QUALITY = 1,
+       MMAL_PARAM_CDN_DUMMY  = 0x7FFFFFFF
+};
+
+struct mmal_parameter_colour_denoise {
+       u32 enabled;
+       enum mmal_parameter_cdn_mode mode;
+};
+
 struct mmal_parameter_denoise {
        u32 enabled;
        u32 constant;