summaryrefslogtreecommitdiff
path: root/isp/omap3isp.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2011-07-29 15:18:13 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2011-09-04 15:39:37 +0200
commitf0ecaf49c1630cdce3dd706264675f8e2ab5c418 (patch)
treec9fc60cdc9acbdc107b2a149b3e6e84d03bdf390 /isp/omap3isp.c
parentdd1c90351028d1b4bd7c1981ec448469b24d782a (diff)
omap3isp: Add support for memory pools in the viewfinder
Allocate buffers and start/stop pools. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'isp/omap3isp.c')
-rw-r--r--isp/omap3isp.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/isp/omap3isp.c b/isp/omap3isp.c
index 99eca7c..03b0f68 100644
--- a/isp/omap3isp.c
+++ b/isp/omap3isp.c
@@ -816,6 +816,7 @@ static int omap3_isp_viewfinder_setup_pipeline(struct omap3_isp_device *isp)
int omap3_isp_viewfinder_setup(struct omap3_isp_device *isp,
struct v4l2_mbus_framefmt *ofmt)
{
+ struct omap3_isp_pool *pool;
int ret;
ret = omap3_isp_pipeline_build(isp, &isp->viewfinder, ENTITY_SENSOR,
@@ -839,6 +840,10 @@ int omap3_isp_viewfinder_setup(struct omap3_isp_device *isp,
if (ret < 0)
return ret;
+ /* Allocate buffers for intermediate pools. */
+ list_for_each_entry(pool, &isp->viewfinder.pools, list)
+ omap3_isp_pool_alloc_buffers(pool);
+
return 0;
}
@@ -910,6 +915,7 @@ static void omap3_isp_viewfinder_event(void *priv)
int omap3_isp_viewfinder_start(struct omap3_isp_device *isp)
{
struct v4l2_video_buffer buffer;
+ struct omap3_isp_pool *pool;
unsigned int i;
int ret;
@@ -932,6 +938,10 @@ int omap3_isp_viewfinder_start(struct omap3_isp_device *isp)
if (isp->ops->prepare_streamon)
isp->ops->prepare_streamon(isp);
+ /* Start the pools. */
+ list_for_each_entry(pool, &isp->viewfinder.pools, list)
+ omap3_isp_pool_start(pool);
+
/* Watch the viewfinder file descriptor. */
isp->ops->watch_fd(isp->viewfinder.output->video->fd,
OMAP3_ISP_EVENT_READ, omap3_isp_viewfinder_event,
@@ -950,6 +960,7 @@ int omap3_isp_viewfinder_start(struct omap3_isp_device *isp)
int omap3_isp_viewfinder_stop(struct omap3_isp_device *isp)
{
+ struct omap3_isp_pool *pool;
int ret;
isp->ops->unwatch_fd(isp->viewfinder.output->video->fd);
@@ -960,6 +971,10 @@ int omap3_isp_viewfinder_stop(struct omap3_isp_device *isp)
return ret;
}
+ /* Stop the pools. */
+ list_for_each_entry(pool, &isp->viewfinder.pools, list)
+ omap3_isp_pool_stop(pool);
+
isp->viewfinder.output->queued = 0;
isp->viewfinder.output->running = false;
return 0;