From 5256d9f02b9cdd1a42abdb4178355fc4b2142488 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 2 May 2012 01:36:02 +0200 Subject: stats: Don't mess up Bayer pattern when setting the AEWB rectangle Signed-off-by: Laurent Pinchart --- isp/stats.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/isp/stats.c b/isp/stats.c index e4543af..a96da5e 100644 --- a/isp/stats.c +++ b/isp/stats.c @@ -251,10 +251,11 @@ int omap3_isp_aewb_configure(struct omap3_isp_device *isp, struct v4l2_rect *rec } /* Center the windows in the image area. The black row will be - * positionned at the end of the frame. + * positionned at the end of the frame. Make sure the position is a + * multiple of 2 pixels to keep the Bayer pattern. */ - win_x = (format.width - win_w * win_n_x) / 2; - win_y = (format.height - win_h * win_n_y) / 2; + win_x = ((format.width - win_w * win_n_x) / 2) & ~1; + win_y = ((format.height - win_h * win_n_y) / 2) & ~1; printf("AEWB: #win %ux%u start %ux%u size %ux%u inc %ux%u\n", win_n_x, win_n_y, win_x, win_y, win_w, win_h, -- cgit v1.2.3