summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinyu Chen <b03824@freescale.com>2011-12-09 13:06:43 +0800
committerXinyu Chen <b03824@freescale.com>2011-12-09 13:06:43 +0800
commitbb41d1842fd9ba9af646794ab9939149548fc82b (patch)
treeaa3095b4a2315ea7918867781d8253893ea58a55
parent81a6b232b673a40424f4f62fbd5ce9ef088f3557 (diff)
ENGR00169880 v4l2 capture: reserve dummy framebuffer for 8M on probe
On GB with 512MB DDR size, when we taking 5M pixel picture, the v4l2 capture will first allocate a 8M continuous memory for first frame, which may cause allocation failed. Reserve this buffer on probe when safe. Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
-rw-r--r--drivers/media/video/mxc/capture/mxc_v4l2_capture.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/media/video/mxc/capture/mxc_v4l2_capture.c b/drivers/media/video/mxc/capture/mxc_v4l2_capture.c
index 64443c22d999..35fa5ada92ce 100644
--- a/drivers/media/video/mxc/capture/mxc_v4l2_capture.c
+++ b/drivers/media/video/mxc/capture/mxc_v4l2_capture.c
@@ -2589,6 +2589,14 @@ static void init_camera_struct(cam_data *cam, struct platform_device *pdev)
init_waitqueue_head(&cam->power_queue);
spin_lock_init(&cam->queue_int_lock);
spin_lock_init(&cam->dqueue_int_lock);
+
+ cam->dummy_frame.vaddress = dma_alloc_coherent(0,
+ SZ_8M, &cam->dummy_frame.paddress,
+ GFP_DMA | GFP_KERNEL);
+ if (cam->dummy_frame.vaddress == 0)
+ pr_err("ERROR: v4l2 capture: Allocate dummy frame "
+ "failed.\n");
+ cam->dummy_frame.buffer.length = SZ_8M;
}
static ssize_t show_streaming(struct device *dev,