diff options
-rw-r--r-- | isp/omap3isp.c | 23 |
1 files changed, 13 insertions, 10 deletions
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; |