From 58bc8b7e380554d2d32f8d7f776a019cefc8afbf Mon Sep 17 00:00:00 2001 From: Johannes Schellen Date: Fri, 11 Jan 2013 12:00:19 -0300 Subject: [PATCH] [media] omap3isp: Fix histogram regions This patch fixes a bug which causes all histogram regions to start in the top left corner of the image. The histogram region coordinates are 16 bit values which share a 32 bit register. The bug is due to the region end value assignments overwriting the region start values with zero. Signed-off-by: Johannes Schellen Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/omap3isp/isphist.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/omap3isp/isphist.c b/drivers/media/platform/omap3isp/isphist.c index 2ccc4e5702b2..e070c24048ef 100644 --- a/drivers/media/platform/omap3isp/isphist.c +++ b/drivers/media/platform/omap3isp/isphist.c @@ -114,14 +114,14 @@ static void hist_setup_regs(struct ispstat *hist, void *priv) /* Regions size and position */ for (c = 0; c < OMAP3ISP_HIST_MAX_REGIONS; c++) { if (c < conf->num_regions) { - reg_hor[c] = conf->region[c].h_start << - ISPHIST_REG_START_SHIFT; - reg_hor[c] = conf->region[c].h_end << - ISPHIST_REG_END_SHIFT; - reg_ver[c] = conf->region[c].v_start << - ISPHIST_REG_START_SHIFT; - reg_ver[c] = conf->region[c].v_end << - ISPHIST_REG_END_SHIFT; + reg_hor[c] = (conf->region[c].h_start << + ISPHIST_REG_START_SHIFT) + | (conf->region[c].h_end << + ISPHIST_REG_END_SHIFT); + reg_ver[c] = (conf->region[c].v_start << + ISPHIST_REG_START_SHIFT) + | (conf->region[c].v_end << + ISPHIST_REG_END_SHIFT); } else { reg_hor[c] = 0; reg_ver[c] = 0; -- 2.34.1