From 4871ffd7f025854615ce14b090c3e1db5ceae809 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 15 Oct 2011 13:44:13 +0200 Subject: omap3isp: Handle scaler properly in omap3_isp_pipeline_activate() Instead of retrieving the sensor default format and propagating through the pipeline, configure the sensor with the previously selected format (resulting from the scaler choice) and propagate it. Signed-off-by: Laurent Pinchart --- isp/omap3isp.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'isp/omap3isp.c') diff --git a/isp/omap3isp.c b/isp/omap3isp.c index 3ecf6b0..13e1fe3 100644 --- a/isp/omap3isp.c +++ b/isp/omap3isp.c @@ -681,6 +681,7 @@ static int omap3_isp_pipeline_activate(struct omap3_isp_device *isp, struct omap3_isp_entity *source = NULL; struct omap3_isp_entity *sink; struct media_entity_pad *pad; + bool first = true; int ret; ret = media_reset_links(isp->mdev); @@ -716,18 +717,19 @@ static int omap3_isp_pipeline_activate(struct omap3_isp_device *isp, if (source->type == OMAP3_ISP_ENTITY_ENTITY) { pad = source->source.link->source; - ret = v4l2_subdev_get_format(pad->entity, &format, pad->index, - V4L2_SUBDEV_FORMAT_ACTIVE); - if (ret < 0) { - printf("error: get format failed on %s:%u.\n", - pad->entity->info.name, pad->index); - return ret; - } - - if (sink->last) + if (sink->last || first) { format = source->source.format; - else + } else { + ret = v4l2_subdev_get_format(pad->entity, &format, pad->index, + V4L2_SUBDEV_FORMAT_ACTIVE); + if (ret < 0) { + printf("error: get format failed on %s:%u.\n", + pad->entity->info.name, pad->index); + return ret; + } + format.code = source->source.format.code; + } ret = v4l2_subdev_set_format(pad->entity, &format, pad->index, V4L2_SUBDEV_FORMAT_ACTIVE); @@ -752,6 +754,7 @@ static int omap3_isp_pipeline_activate(struct omap3_isp_device *isp, } source = sink; + first = false; } return 0; -- cgit v1.2.3