Skip to content

Commit

Permalink
media: rockchip: rkisp1: reduce number of histogram grid elements in …
Browse files Browse the repository at this point in the history
…uapi

The uapi right now specifies an array size of 28 but the actual number
of elements is only 25 with the last 3 being unused.

Reduce the array size to the correct number of elements and change
the params code to iterate the array 25 times.

Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
  • Loading branch information
Heiko Stuebner authored and Mauro Carvalho Chehab committed Jan 28, 2021
1 parent a802a04 commit 66d81de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion drivers/media/platform/rockchip/rkisp1/rkisp1-params.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,6 @@ static void rkisp1_hst_config(struct rkisp1_params *params,
RKISP1_CIF_ISP_HIST_WEIGHT_22TO03,
RKISP1_CIF_ISP_HIST_WEIGHT_13TO43,
RKISP1_CIF_ISP_HIST_WEIGHT_04TO34,
RKISP1_CIF_ISP_HIST_WEIGHT_44,
};
const u8 *weight;
unsigned int i;
Expand Down Expand Up @@ -622,6 +621,8 @@ static void rkisp1_hst_config(struct rkisp1_params *params,
weight[2],
weight[3]),
hist_weight_regs[i]);

rkisp1_write(params->rkisp1, weight[0] & 0x1F, RKISP1_CIF_ISP_HIST_WEIGHT_44);
}

static void
Expand Down
3 changes: 1 addition & 2 deletions include/uapi/linux/rkisp1-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@
/*
* Histogram calculation
*/
/* Last 3 values unused. */
#define RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE 28
#define RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE 25

/*
* Defect Pixel Cluster Correction
Expand Down

0 comments on commit 66d81de

Please sign in to comment.