aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Vaussard <florian.vaussard@epfl.ch>2014-01-17 14:37:38 -0500
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-02-24 10:52:16 -0500
commit8b57b9669aa884ac75b8d09c251d6b1755533c15 (patch)
tree13c06e85dbf053ba44e7651d8e632aa424cd9fd1
parentefab6b6a6ea9364ececb955f69a9d3ffc6b782a1 (diff)
[media] omap3isp: preview: Fix the crop margins
Commit 3fdfedaaa "[media] omap3isp: preview: Lower the crop margins" accidentally changed the previewer's cropping, causing the previewer to miss four pixels on each line, thus corrupting the final image. Restored the removed setting. Cc: stable@vger.kernel.org Signed-off-by: Florian Vaussard <florian.vaussard@epfl.ch> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--drivers/media/platform/omap3isp/isppreview.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/media/platform/omap3isp/isppreview.c b/drivers/media/platform/omap3isp/isppreview.c
index 1c776c1186f1..1dbff1472809 100644
--- a/drivers/media/platform/omap3isp/isppreview.c
+++ b/drivers/media/platform/omap3isp/isppreview.c
@@ -1079,6 +1079,7 @@ static void preview_config_input_format(struct isp_prev_device *prev,
1079 */ 1079 */
1080static void preview_config_input_size(struct isp_prev_device *prev, u32 active) 1080static void preview_config_input_size(struct isp_prev_device *prev, u32 active)
1081{ 1081{
1082 const struct v4l2_mbus_framefmt *format = &prev->formats[PREV_PAD_SINK];
1082 struct isp_device *isp = to_isp_device(prev); 1083 struct isp_device *isp = to_isp_device(prev);
1083 unsigned int sph = prev->crop.left; 1084 unsigned int sph = prev->crop.left;
1084 unsigned int eph = prev->crop.left + prev->crop.width - 1; 1085 unsigned int eph = prev->crop.left + prev->crop.width - 1;
@@ -1086,6 +1087,14 @@ static void preview_config_input_size(struct isp_prev_device *prev, u32 active)
1086 unsigned int elv = prev->crop.top + prev->crop.height - 1; 1087 unsigned int elv = prev->crop.top + prev->crop.height - 1;
1087 u32 features; 1088 u32 features;
1088 1089
1090 if (format->code != V4L2_MBUS_FMT_Y8_1X8 &&
1091 format->code != V4L2_MBUS_FMT_Y10_1X10) {
1092 sph -= 2;
1093 eph += 2;
1094 slv -= 2;
1095 elv += 2;
1096 }
1097
1089 features = (prev->params.params[0].features & active) 1098 features = (prev->params.params[0].features & active)
1090 | (prev->params.params[1].features & ~active); 1099 | (prev->params.params[1].features & ~active);
1091 1100