Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: staging: media: ipu3: Fix AWB x_start position when rightmost stripe is used

An not calibrated x_start setting would result in an incorrect AWB grid
configuration on a sensor when only the rightmost stripe is used.

If the AWB grid coordinate is set to the rightmost stripe, for example,
x_start is greater than 640, the AWB grid will be at the rightmost edge of
the sensor. The AWB statistic will be fetched from the wrong place of the
sensor and results in an incorrect AWB estimation result. Therefore,
stripe offset should subtract from x_start to have a correct grid
configuration for the rightmost stripe.

Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

authored by

Kate Hsuan and committed by
Mauro Carvalho Chehab
3bf96b6e 3c9b04d9

+11
+11
drivers/staging/media/ipu3/ipu3-css-params.c
··· 2636 2636 acc->stripe.down_scaled_stripes[1].offset + min_overlap) { 2637 2637 /* Enable only for rightmost stripe, disable left */ 2638 2638 acc->awb.stripes[0].rgbs_thr_b &= ~IPU3_UAPI_AWB_RGBS_THR_B_EN; 2639 + 2640 + acc->awb.stripes[1].grid.x_start = 2641 + (acc->awb.stripes[1].grid.x_start - 2642 + acc->stripe.down_scaled_stripes[1].offset) & 2643 + IPU3_UAPI_GRID_START_MASK; 2644 + 2645 + b_w_log2 = acc->awb.stripes[1].grid.block_width_log2; 2646 + acc->awb.stripes[1].grid.x_end = 2647 + imgu_css_grid_end(acc->awb.stripes[1].grid.x_start, 2648 + acc->awb.stripes[1].grid.width, 2649 + b_w_log2); 2639 2650 } else if (acc->awb.config.grid.x_end <= 2640 2651 acc->stripe.bds_out_stripes[0].width - min_overlap) { 2641 2652 /* Enable only for leftmost stripe, disable right */