Skip to content

Commit

Permalink
drivers: media: imx708: Adjust broken line correction parameter
Browse files Browse the repository at this point in the history
In full-resolution mode, the LPF_INTENSITY_EN and LPF_INTENSITY
registers control Quad Bayer Re-mosaic broken line correction.
Expose this as a module parameter "qbc_adjust": the value zero
sets LPF_INTENSTY_EN=1, disabling the correction. Other values
are written to LPF_INTENSITY; the legal range is 2 to 5.

There is a trade-off between coloured and monochrome patterns.
The previous fixed value 4 could produce ladder/spots artefacts
in coloured textures. The new default value 2 may suit a wider
range of scenes.

Signed-off-by: Nick Hollinghurst <[email protected]>
  • Loading branch information
njhollinghurst committed Nov 8, 2023
1 parent 686fe77 commit ae1547c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions drivers/media/i2c/imx708.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
#include <media/v4l2-fwnode.h>
#include <media/v4l2-mediabus.h>

/*
* Parameter to adjust Quad Bayer re-mosaic broken line correction strength
* (LPF_INTENSITY), used in full-resolution mode only. Set zero to disable.
*/
static int qbc_adjust = 2;
module_param(qbc_adjust, int, 0644);
MODULE_PARM_DESC(qbc_adjust, "Quad Bayer broken line correction strength [0,2-5]");

#define IMX708_REG_VALUE_08BIT 1
#define IMX708_REG_VALUE_16BIT 2

Expand Down Expand Up @@ -363,8 +371,6 @@ static const struct imx708_reg mode_4608x2592_regs[] = {
{0x341f, 0x20},
{0x3420, 0x00},
{0x3421, 0xd8},
{0xC428, 0x00},
{0xC429, 0x04},
{0x3366, 0x00},
{0x3367, 0x00},
{0x3368, 0x00},
Expand Down Expand Up @@ -1515,6 +1521,10 @@ static int imx708_start_streaming(struct imx708 *imx708)
return ret;
}

/* Quad Bayer re-mosaic adjustments (for full-resolution mode only) */
imx708_write_reg(imx708, 0xC428, IMX708_REG_VALUE_08BIT, !qbc_adjust);
imx708_write_reg(imx708, 0xC429, IMX708_REG_VALUE_08BIT, qbc_adjust);

/* Apply customized values from user */
ret = __v4l2_ctrl_handler_setup(imx708->sd.ctrl_handler);
if (ret)
Expand Down

0 comments on commit ae1547c

Please sign in to comment.