summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-05-02 01:36:02 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-05-02 01:36:02 +0200
commit5256d9f02b9cdd1a42abdb4178355fc4b2142488 (patch)
tree5ce0e75cf7ee76a0c2334c9e175332f41b747c8c
parentd9ae982816edb51d4def8e58d2bbdade900acf33 (diff)
stats: Don't mess up Bayer pattern when setting the AEWB rectangle
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--isp/stats.c7
1 files 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,