Skip to contentSkip to conversation

Increase isp workaround buffer size for 8MP sensor.

PATCH Superseded Dominic Curran 2 participants 2 messages Jan 30, 2009 Media (V4L/DVB)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/6 Increase isp workaround buffer size for 8MP sensor.

From: Dominic Curran <[email protected]>
Subject: [OMAPZOOM][PATCH 2/6] Increase isp workaround buffer size for 8MP sensor.

A temporary buffer is created to hold the image while it is written by Previewer module and then read by Resizer module. This is called LSC Workaround. To take into account the Sony IMX046 8MP sensor that buffer needs to be increased in size.
Changed the #defines to be upper case.
Patch also fixes the initialization of a couple of CCDC values.

---
 drivers/media/video/isp/isp.c     |   10 +++++-----
 drivers/media/video/isp/isp.h     |    4 ++--
 drivers/media/video/isp/ispccdc.c |    2 ++
 3 files changed, 9 insertions(+), 7 deletions(-)
drivers/media/video/isp/isp.c +5 -5
Index: omapzoom04/drivers/media/video/isp/isp.c
===================================================================
@@ -1172,20 +1172,20 @@ void omapisp_unset_callback()
  **/
 u32 isp_buf_allocation(void)
 {
-	buff_addr = (void *) vmalloc(buffer_size);
+	buff_addr = (void *) vmalloc(ISP_BUFFER_MAX_SIZE);
 
 	if (!buff_addr) {
 		printk(KERN_ERR "Cannot allocate memory ");
 		return -ENOMEM;
 	}
 
-	sglist_alloc = videobuf_vmalloc_to_sg(buff_addr, no_of_pages);
+	sglist_alloc = videobuf_vmalloc_to_sg(buff_addr, ISP_BUFFER_MAX_PAGES);
 	if (!sglist_alloc) {
 		printk(KERN_ERR "videobuf_vmalloc_to_sg error");
 		return -ENOMEM;
 	}
-	num_sc = dma_map_sg(NULL, sglist_alloc, no_of_pages, 1);
-	buff_addr_mapped = ispmmu_map_sg(sglist_alloc, no_of_pages);
+	num_sc = dma_map_sg(NULL, sglist_alloc, ISP_BUFFER_MAX_PAGES, 1);
+	buff_addr_mapped = ispmmu_map_sg(sglist_alloc, ISP_BUFFER_MAX_PAGES);
 	if (!buff_addr_mapped) {
 		printk(KERN_ERR "ispmmu_map_sg mapping failed ");
 		return -ENOMEM;
@@ -1217,7 +1217,7 @@ void isp_buf_free(void)
 {
 	if (alloc_done == 1) {
 		ispmmu_unmap(buff_addr_mapped);
-		dma_unmap_sg(NULL, sglist_alloc, no_of_pages, 1);
+		dma_unmap_sg(NULL, sglist_alloc, ISP_BUFFER_MAX_PAGES, 1);
 		kfree(sglist_alloc);
 		vfree(buff_addr);
 		alloc_done = 0;
drivers/media/video/isp/isp.h +2 -2
Index: omapzoom04/drivers/media/video/isp/isp.h
===================================================================
@@ -69,8 +69,8 @@
 #define NUM_ISP_CAPTURE_FORMATS 	(sizeof(isp_formats) /\
 							sizeof(isp_formats[0]))
 #define ISP_WORKAROUND 1
-#define buffer_size (1024 * 1024 * 10)
-#define no_of_pages (buffer_size / (4 * 1024))
+#define ISP_BUFFER_MAX_SIZE (1024 * 1024 * 16)
+#define ISP_BUFFER_MAX_PAGES (ISP_BUFFER_MAX_SIZE / (4 * 1024))
 
 typedef int (*isp_vbq_callback_ptr) (struct videobuf_buffer *vb);
 typedef void (*isp_callback_t) (unsigned long status,
drivers/media/video/isp/ispccdc.c +2 -0
Index: omapzoom04/drivers/media/video/isp/ispccdc.c
===================================================================
@@ -1265,6 +1265,8 @@ int ispccdc_config_size(u32 input_w, u32
 	}
 
 	if (ispccdc_obj.ccdc_outfmt == CCDC_OTHERS_VP) {
+		ispccdc_obj.ccdcin_woffset = 0;
+		ispccdc_obj.ccdcin_hoffset = 0;
 		omap_writel((ispccdc_obj.ccdcin_woffset <<
 					ISPCCDC_FMT_HORZ_FMTSPH_SHIFT) |
 					(ispccdc_obj.ccdcin_w <<
#1 lore raw

Thanks,
Vaibhav Hiremath

Quoted 77 lines

-----Original Message-----
From: [email protected] [mailto:video4linux-list- [email protected]] On Behalf Of Curran, Dominic
Sent: Friday, January 30, 2009 6:24 AM
To: linux-omap; [email protected]
Cc: [email protected]
Subject: [OMAPZOOM][PATCH 2/6] Increase isp workaround buffer size for 8MP sensor.

From: Dominic Curran <[email protected]>
Subject: [OMAPZOOM][PATCH 2/6] Increase isp workaround buffer size for 8MP
sensor.

A temporary buffer is created to hold the image while it is written by
Previewer module and then read by Resizer module. This is called LSC Workaround. To take into account the Sony IMX046 8MP sensor that buffer
needs to be increased in size.
Changed the #defines to be upper case.
Patch also fixes the initialization of a couple of CCDC values.

---
 drivers/media/video/isp/isp.c     |   10 +++++-----
 drivers/media/video/isp/isp.h     |    4 ++--
 drivers/media/video/isp/ispccdc.c |    2 ++
 3 files changed, 9 insertions(+), 7 deletions(-)

Index: omapzoom04/drivers/media/video/isp/isp.c
===================================================================

drivers/media/video/isp/isp.c +4 -4
@@ -1172,20 +1172,20 @@ void omapisp_unset_callback()
  **/
 u32 isp_buf_allocation(void)
 {
-	buff_addr = (void *) vmalloc(buffer_size);
+	buff_addr = (void *) vmalloc(ISP_BUFFER_MAX_SIZE);
 
 	if (!buff_addr) {
 		printk(KERN_ERR "Cannot allocate memory ");
 		return -ENOMEM;
 	}
 
-	sglist_alloc = videobuf_vmalloc_to_sg(buff_addr, no_of_pages);
+	sglist_alloc = videobuf_vmalloc_to_sg(buff_addr,
 ISP_BUFFER_MAX_PAGES);
 	if (!sglist_alloc) {
 		printk(KERN_ERR "videobuf_vmalloc_to_sg error");
 		return -ENOMEM;
 	}
-	num_sc = dma_map_sg(NULL, sglist_alloc, no_of_pages, 1);
-	buff_addr_mapped = ispmmu_map_sg(sglist_alloc, no_of_pages);
+	num_sc = dma_map_sg(NULL, sglist_alloc, ISP_BUFFER_MAX_PAGES,
 1);
+	buff_addr_mapped = ispmmu_map_sg(sglist_alloc,
 ISP_BUFFER_MAX_PAGES);
drivers/media/video/isp/isp.c +1 -1
 	if (!buff_addr_mapped) {
 		printk(KERN_ERR "ispmmu_map_sg mapping failed ");
 		return -ENOMEM;
@@ -1217,7 +1217,7 @@ void isp_buf_free(void)
 {
 	if (alloc_done == 1) {
 		ispmmu_unmap(buff_addr_mapped);
-		dma_unmap_sg(NULL, sglist_alloc, no_of_pages, 1);
+		dma_unmap_sg(NULL, sglist_alloc, ISP_BUFFER_MAX_PAGES,
 1);
 		kfree(sglist_alloc);
 		vfree(buff_addr);

alloc_done = 0;
Index: omapzoom04/drivers/media/video/isp/isp.h
===================================================================

drivers/media/video/isp/isp.h line 74

Quoted 8 lines
drivers/media/video/isp/isp.h +2 -2
@@ -69,8 +69,8 @@
 #define NUM_ISP_CAPTURE_FORMATS 	(sizeof(isp_formats) /\
 							sizeof(isp_formats[0]))
 #define ISP_WORKAROUND 1
-#define buffer_size (1024 * 1024 * 10)
-#define no_of_pages (buffer_size / (4 * 1024))
+#define ISP_BUFFER_MAX_SIZE (1024 * 1024 * 16)
+#define ISP_BUFFER_MAX_PAGES (ISP_BUFFER_MAX_SIZE / (4 * 1024))
 

[Hiremath, Vaibhav] Is here (4 * 1024) indicates ISP-MMUSG page size configuration or normal kernel page size?

If it is kernel page size, then we can use PAGE_SIZE macro instead of hard coding.

Quoted 21 lines
drivers/media/video/isp/isp.h +0 -0
 typedef int (*isp_vbq_callback_ptr) (struct videobuf_buffer *vb);
 typedef void (*isp_callback_t) (unsigned long status,

Index: omapzoom04/drivers/media/video/isp/ispccdc.c
===================================================================

drivers/media/video/isp/ispccdc.c +2 -1
@@ -1265,6 +1265,8 @@ int ispccdc_config_size(u32 input_w, u32
 	}
 
 	if (ispccdc_obj.ccdc_outfmt == CCDC_OTHERS_VP) {
+		ispccdc_obj.ccdcin_woffset = 0;
+		ispccdc_obj.ccdcin_hoffset = 0;
 		omap_writel((ispccdc_obj.ccdcin_woffset <<
 					ISPCCDC_FMT_HORZ_FMTSPH_SHIFT) |
 					(ispccdc_obj.ccdcin_w <<
 
--

video4linux-list mailing list
Unsubscribe mailto:video4linux-list-
[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list