Linux Media Controller development
 help / color / mirror / Atom feed
* [PATCH] omap3isp: Fix histogram regions
@ 2013-01-11 15:00 Johannes Schellen
  2013-01-21 10:19 ` Laurent Pinchart
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Schellen @ 2013-01-11 15:00 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-media

From: Johannes Schellen <Johannes.Schellen@rwth-aachen.de>

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 <Johannes.Schellen@rwth-aachen.de>
---
The patch is against v3.8-rc3

--- linux-3.8-rc3/drivers/media/platform/omap3isp/isphist.c.orig
+++ linux-3.8-rc3/drivers/media/platform/omap3isp/isphist.c
@@ -114,14 +114,14 @@ static void hist_setup_regs(struct ispst
 	/* 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;


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] omap3isp: Fix histogram regions
  2013-01-11 15:00 [PATCH] omap3isp: Fix histogram regions Johannes Schellen
@ 2013-01-21 10:19 ` Laurent Pinchart
  0 siblings, 0 replies; 2+ messages in thread
From: Laurent Pinchart @ 2013-01-21 10:19 UTC (permalink / raw)
  To: Johannes Schellen; +Cc: linux-media

Hi Johannes,

On Friday 11 January 2013 16:00:19 Johannes Schellen wrote:
> From: Johannes Schellen <Johannes.Schellen@rwth-aachen.de>
> 
> 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 <Johannes.Schellen@rwth-aachen.de>

Good catch, thanks.

I've applied the patch to my tree.

> ---
> The patch is against v3.8-rc3
> 
> --- linux-3.8-rc3/drivers/media/platform/omap3isp/isphist.c.orig
> +++ linux-3.8-rc3/drivers/media/platform/omap3isp/isphist.c
> @@ -114,14 +114,14 @@ static void hist_setup_regs(struct ispst
>  	/* 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;

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-21 10:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-11 15:00 [PATCH] omap3isp: Fix histogram regions Johannes Schellen
2013-01-21 10:19 ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox