================================================================================
===================================================================
@@ -1077,6 +1077,7 @@ CONFIG_VIDEO_OMAP24XX_TVOUT=y
CONFIG_VIDEO_OMAP3=y
CONFIG_VIDEO_OMAP34XX_ISP_PREVIEWER=y
CONFIG_VIDEO_OMAP34XX_ISP_RESIZER=y
+CONFIG_VIDEO_OMAP3_BUFFALLOC=y
# CONFIG_VIDEO_OMAP2 is not set
# CONFIG_V4L_USB_DRIVERS is not set
# CONFIG_SOC_CAMERA is not set
===================================================================
@@ -1032,6 +1032,7 @@ CONFIG_VIDEO_OMAP24XX_TVOUT=y
CONFIG_VIDEO_OMAP3=y
CONFIG_VIDEO_OMAP34XX_ISP_PREVIEWER=y
CONFIG_VIDEO_OMAP34XX_ISP_RESIZER=y
+CONFIG_VIDEO_OMAP3_BUFFALLOC=y
# CONFIG_VIDEO_OMAP2 is not set
# CONFIG_SOC_CAMERA is not set
# CONFIG_VIDEO_SH_MOBILE_CEU is not set
===================================================================
@@ -842,6 +842,14 @@ config VIDEO_OMAP3
source "drivers/media/video/isp/Kconfig"
+config VIDEO_OMAP3_BUFFALLOC
+ bool "OMAP3430 ISP Workaround: Allocate memory at driver init"
+ depends on VIDEO_OMAP3 && ARCH_OMAP3430
+ default y
+ ---help---
+ This option is for allocating the workaround buffer at
+ camera init time.
+
config VIDEO_OMAP2
tristate "OMAP 2 Camera support (EXPERIMENTAL)"
select VIDEOBUF_GEN
===================================================================
@@ -1185,6 +1185,15 @@ u32 isp_buf_allocation(void)
return -ENOMEM;
}
num_sc = dma_map_sg(NULL, sglist_alloc, ISP_BUFFER_MAX_PAGES, 1);
+ return 0;
+}
+
+/**
+ * isp_buf_mmap - Create MMU scatter-gather list.
+ *
+ **/
+u32 isp_buf_mmap(void)
+{
buff_addr_mapped = ispmmu_map_sg(sglist_alloc, ISP_BUFFER_MAX_PAGES);
if (!buff_addr_mapped) {
printk(KERN_ERR "ispmmu_map_sg mapping failed ");
@@ -1340,9 +1349,14 @@ u32 isp_calc_pipeline(struct v4l2_pix_fo
isppreview_config_datapath(PRV_RAW_CCDC, PREVIEW_MEM);
ispresizer_config_datapath(RSZ_MEM_YUV);
if (alloc_done == 0) {
+#if !defined(CONFIG_VIDEO_OMAP3_BUFFALLOC)
rval = isp_buf_allocation();
if (rval)
return -EINVAL;
+#endif
+ rval = isp_buf_mmap();
+ if (rval)
+ return -EINVAL;
}
#else
isppreview_config_datapath(PRV_RAW_CCDC, PREVIEW_RSZ);
@@ -2367,7 +2381,7 @@ int isp_put(void)
if (--isp_obj.ref_count == 0) {
isp_save_ctx();
off_mode = 1;
-#if ISP_WORKAROUND
+#if ISP_WORKAROUND && !defined(CONFIG_VIDEO_OMAP3_BUFFALLOC)
isp_buf_free();
#endif
isp_release_resources();
@@ -2420,6 +2434,9 @@ EXPORT_SYMBOL(isp_restore_context);
**/
static int __init isp_init(void)
{
+#if ISP_WORKAROUND && defined(CONFIG_VIDEO_OMAP3_BUFFALLOC)
+ int rval;
+#endif
DPRINTK_ISPCTRL("+isp_init for Omap 3430 Camera ISP\n");
isp_obj.ref_count = 0;
@@ -2427,6 +2444,14 @@ static int __init isp_init(void)
spin_lock_init(&isp_obj.isp_temp_buf_lock);
spin_lock_init(&isp_obj.lock);
+#if ISP_WORKAROUND && defined(CONFIG_VIDEO_OMAP3_BUFFALLOC)
+ if (alloc_done == 0) {
+ rval = isp_buf_allocation();
+ if (rval)
+ return -EINVAL;
+ }
+#endif
+
if (request_irq(INT_34XX_CAM_IRQ, omap34xx_isp_isr, IRQF_SHARED,
"Omap 34xx Camera ISP", &ispirq_obj)) {
DPRINTK_ISPCTRL("Could not install ISR\n");
@@ -2459,6 +2484,9 @@ static void __exit isp_cleanup(void)
isp_hist_cleanup();
isp_ccdc_cleanup();
free_irq(INT_34XX_CAM_IRQ, &ispirq_obj);
+#if ISP_WORKAROUND && defined(CONFIG_VIDEO_OMAP3_BUFFALLOC)
+ isp_buf_free();
+#endif
}
/**