From a6204cac1cbccd03307626782c93c34242c5ee2a Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 25 Jul 2011 00:35:15 +0200 Subject: Activate viewfinder pipeline in omap3_isp_viewfinder_setup_pipeline() Move omap3_isp_pipeline_activate() call from omap3_isp_snapshot_restore_pipeline() to omap3_isp_viewfinder_setup_pipeline() and remove omap3_isp_snapshot_restore_pipeline(). Remove the setup_link() calls from omap3_isp_open(), pre-setup of the pipeline isn't required anymore now that trying formats doesn't rely on active links. Signed-off-by: Laurent Pinchart --- isp/omap3isp.c | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) (limited to 'isp') diff --git a/isp/omap3isp.c b/isp/omap3isp.c index 75467e1..c41e514 100644 --- a/isp/omap3isp.c +++ b/isp/omap3isp.c @@ -482,24 +482,6 @@ struct omap3_isp_device *omap3_isp_open(const char *devname, goto error; } - /* Setup the viewfinder pipeline. */ - ret = setup_link(isp, isp->sensor, isp->ccdc, MEDIA_LNK_FL_ENABLED); - if (ret < 0) - goto error; - - ret = setup_link(isp, isp->ccdc, isp->preview, MEDIA_LNK_FL_ENABLED); - if (ret < 0) - goto error; - - ret = setup_link(isp, isp->preview, isp->resizer, MEDIA_LNK_FL_ENABLED); - if (ret < 0) - goto error; - - ret = setup_link(isp, isp->resizer, isp->viewfinder.output.node, - MEDIA_LNK_FL_ENABLED); - if (ret < 0) - goto error; - ret = omap3_isp_preview_setup(isp); if (ret < 0) { printf("error: unable to setup preview engine.\n"); @@ -533,6 +515,10 @@ static int omap3_isp_viewfinder_setup_pipeline(struct omap3_isp_device *isp, { int ret; + ret = omap3_isp_pipeline_activate(isp, &isp->viewfinder); + if (ret < 0) + return ret; + /* Configure the formats on the pipeline. */ ret = omap3_isp_pipeline_set_format(isp, ofmt, isp->viewfinder.output.scaler, V4L2_SUBDEV_FORMAT_ACTIVE); @@ -739,11 +725,6 @@ int omap3_isp_viewfinder_put_buffer(struct omap3_isp_device *isp, * omap3_isp_snapshot_setup() before starting the viewfinder. */ -static int omap3_isp_snapshot_restore_pipeline(struct omap3_isp_device *isp) -{ - return omap3_isp_pipeline_activate(isp, &isp->viewfinder); -} - static int omap3_isp_snapshot_setup_pipeline(struct omap3_isp_device *isp, struct v4l2_mbus_framefmt *ofmt) { @@ -885,10 +866,6 @@ static void omap3_isp_snapshot_event(void *priv) isp->ops->snapshot_ready(isp, &buffer); /* Resume the viewfinder. */ - ret = omap3_isp_snapshot_restore_pipeline(isp); - if (ret < 0) - return; - format = isp->viewfinder.output.format; ret = omap3_isp_viewfinder_setup_pipeline(isp, &format); if (ret < 0) -- cgit v1.2.3