Skip to contentSkip to conversation

media: atmel-isi: increase the burst length to improve the performance

PATCH New Josh Wu 2 participants 6 messages Nov 25, 2014 – Feb 3, 2015

Subsystems (2)
lore
Share & tools
lore

Josh Wu

author
#0 lore raw

PATCH 1/1 media: atmel-isi: increase the burst length to improve the performance

The burst length could be BEATS_4/8/16. Before this patch, isi use default value BEATS_4. To imporve the performance we could set it to BEATS_16.

Otherwise sometime it would cause the ISI overflow error.

---
 drivers/media/platform/soc_camera/atmel-isi.c | 2 ++
 include/media/atmel-isi.h                     | 4 ++++
 2 files changed, 6 insertions(+)
drivers/media/platform/soc_camera/atmel-isi.c +2 -0
index ee5650f..fda587b 100644
@@ -839,6 +839,8 @@ static int isi_camera_set_bus_param(struct soc_camera_device *icd)
 	if (isi->pdata.full_mode)
 		cfg1 |= ISI_CFG1_FULL_MODE;
 
+	cfg1 |= ISI_CFG1_THMASK_BEATS_16;
+
 	isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS);
 	isi_writel(isi, ISI_CFG1, cfg1);
 
include/media/atmel-isi.h +4 -0
index c2e5703..6008b09 100644
@@ -59,6 +59,10 @@
 #define		ISI_CFG1_FRATE_DIV_MASK		(7 << 8)
 #define ISI_CFG1_DISCR				(1 << 11)
 #define ISI_CFG1_FULL_MODE			(1 << 12)
+/* Definition for THMASK(ISI_V2) */
+#define		ISI_CFG1_THMASK_BEATS_4		(0 << 13)
+#define		ISI_CFG1_THMASK_BEATS_8		(1 << 13)
+#define		ISI_CFG1_THMASK_BEATS_16	(2 << 13)
 
 /* Bitfields in CFG2 */
 #define ISI_CFG2_GRAYSCALE			(1 << 13)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 media: atmel-isi: increase the burst length to improve the performance

Hi Josh,

Quoted 4 lines · Josh Wu

The burst length could be BEATS_4/8/16. Before this patch, isi use default value BEATS_4. To imporve the performance we could set it to BEATS_16.

Otherwise sometime it would cause the ISI overflow error.

Without looking at datasheets - what does this bit do? Change the transfer length? What happens then if the data amount isn't a multiple of the transfer size?

Thanks
Guennadi

Quoted 39 lines
---
 drivers/media/platform/soc_camera/atmel-isi.c | 2 ++
 include/media/atmel-isi.h                     | 4 ++++
 2 files changed, 6 insertions(+)
drivers/media/platform/soc_camera/atmel-isi.c +2 -0
index ee5650f..fda587b 100644
@@ -839,6 +839,8 @@ static int isi_camera_set_bus_param(struct soc_camera_device *icd)
 	if (isi->pdata.full_mode)
 		cfg1 |= ISI_CFG1_FULL_MODE;
 
+	cfg1 |= ISI_CFG1_THMASK_BEATS_16;
+
 	isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS);
 	isi_writel(isi, ISI_CFG1, cfg1);
 
include/media/atmel-isi.h +4 -0
index c2e5703..6008b09 100644
@@ -59,6 +59,10 @@
 #define		ISI_CFG1_FRATE_DIV_MASK		(7 << 8)
 #define ISI_CFG1_DISCR				(1 << 11)
 #define ISI_CFG1_FULL_MODE			(1 << 12)
+/* Definition for THMASK(ISI_V2) */
+#define		ISI_CFG1_THMASK_BEATS_4		(0 << 13)
+#define		ISI_CFG1_THMASK_BEATS_8		(1 << 13)
+#define		ISI_CFG1_THMASK_BEATS_16	(2 << 13)
 
 /* Bitfields in CFG2 */
 #define ISI_CFG2_GRAYSCALE			(1 << 13)
Signature · 1 line
1.9.1
author
#2 lore raw

PATCH 1/1 media: atmel-isi: increase the burst length to improve the performance

Hi, Gunenadi

Quoted 10 lines · Guennadi Liakhovetski

Hi Josh,

Quoted 4 lines · Josh Wu

The burst length could be BEATS_4/8/16. Before this patch, isi use default value BEATS_4. To imporve the performance we could set it to BEATS_16.

Otherwise sometime it would cause the ISI overflow error.

Without looking at datasheets - what does this bit do? Change the transfer length?

Atmel ISI has two internal 32-bytes FIFOs, one for Preview, another for Codec.
This field is the threshold to trigger the FIFO transfer to AHB by DMA. We can set the threshold to allow 4-bytes, 8-bytes or 16-bytes for a burst. BEATS_4, means only allow 4-bytes in a burst.
BEATS_8, means only allow 4-bytes and 8-bytes in a burst. BEATS_16, means allow 4-bytes, 8-bytes and 16-bytes in a burst.

So BEATS_16 will use the DMA more efficient if has lots of data to transfer. As we are allowed to use 16-bytes in a burst. That will trigger less burst than BEATS_4 to transfer same amount of data.

We found this patch can fix ISI FIFO overflow error when system is in a situation that with a very high memory load.
If we only allow 4-bytes in a burst, that need more burst to transfer data and less effective.

Quoted 2 lines

What happens then if the data amount isn't a multiple of the transfer size?

BEATS_16 means allowed 4-bytes, 8-bytes and 16-bytes in a burst. So it still can perform a 4-bytes transfer if the data is not multiple of 16. I think all the data transfer are aligned with 4 bytes. The DMA address should be aligned with 4 bytes as well.

Best Regards,
Josh Wu

Quoted 42 lines

Thanks
Guennadi

Quoted 38 lines
---
  drivers/media/platform/soc_camera/atmel-isi.c | 2 ++
  include/media/atmel-isi.h                     | 4 ++++
  2 files changed, 6 insertions(+)
drivers/media/platform/soc_camera/atmel-isi.c +2 -0
index ee5650f..fda587b 100644
@@ -839,6 +839,8 @@ static int isi_camera_set_bus_param(struct soc_camera_device *icd)
  	if (isi->pdata.full_mode)
  		cfg1 |= ISI_CFG1_FULL_MODE;
 
+	cfg1 |= ISI_CFG1_THMASK_BEATS_16;
+
  	isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS);
  	isi_writel(isi, ISI_CFG1, cfg1);
 
include/media/atmel-isi.h +4 -0
index c2e5703..6008b09 100644
@@ -59,6 +59,10 @@
  #define		ISI_CFG1_FRATE_DIV_MASK		(7 << 8)
  #define ISI_CFG1_DISCR				(1 << 11)
  #define ISI_CFG1_FULL_MODE			(1 << 12)
+/* Definition for THMASK(ISI_V2) */
+#define		ISI_CFG1_THMASK_BEATS_4		(0 << 13)
+#define		ISI_CFG1_THMASK_BEATS_8		(1 << 13)
+#define		ISI_CFG1_THMASK_BEATS_16	(2 << 13)
 
  /* Bitfields in CFG2 */
  #define ISI_CFG2_GRAYSCALE			(1 << 13)
Signature · 1 line
1.9.1
author
#3 lore raw

PATCH 1/1 media: atmel-isi: increase the burst length to improve the performance

In reply to Josh Wu

Hi, Guennadi

Ping? what about the status of this patch?

Best Regards,
Josh Wu

Quoted 40 lines · Josh Wu

The burst length could be BEATS_4/8/16. Before this patch, isi use default value BEATS_4. To imporve the performance we could set it to BEATS_16.

Otherwise sometime it would cause the ISI overflow error.

---
  drivers/media/platform/soc_camera/atmel-isi.c | 2 ++
  include/media/atmel-isi.h                     | 4 ++++
  2 files changed, 6 insertions(+)
drivers/media/platform/soc_camera/atmel-isi.c +2 -0
index ee5650f..fda587b 100644
@@ -839,6 +839,8 @@ static int isi_camera_set_bus_param(struct soc_camera_device *icd)
  	if (isi->pdata.full_mode)
  		cfg1 |= ISI_CFG1_FULL_MODE;
 
+	cfg1 |= ISI_CFG1_THMASK_BEATS_16;
+
  	isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS);
  	isi_writel(isi, ISI_CFG1, cfg1);
 
include/media/atmel-isi.h +4 -0
index c2e5703..6008b09 100644
@@ -59,6 +59,10 @@
  #define		ISI_CFG1_FRATE_DIV_MASK		(7 << 8)
  #define ISI_CFG1_DISCR				(1 << 11)
  #define ISI_CFG1_FULL_MODE			(1 << 12)
+/* Definition for THMASK(ISI_V2) */
+#define		ISI_CFG1_THMASK_BEATS_4		(0 << 13)
+#define		ISI_CFG1_THMASK_BEATS_8		(1 << 13)
+#define		ISI_CFG1_THMASK_BEATS_16	(2 << 13)
 
  /* Bitfields in CFG2 */
  #define ISI_CFG2_GRAYSCALE			(1 << 13)
#4 lore raw

PATCH 1/1 media: atmel-isi: increase the burst length to improve the performance

Hi Josh,

Quoted 3 lines · Josh Wu

Hi, Guennadi

Ping? what about the status of this patch?

Right, got lost, sorry... Added to the queue now.

Thanks
Guennadi

Quoted 44 lines

Best Regards,
Josh Wu

Quoted 39 lines · Josh Wu

The burst length could be BEATS_4/8/16. Before this patch, isi use default value BEATS_4. To imporve the performance we could set it to BEATS_16.

Otherwise sometime it would cause the ISI overflow error.

---
  drivers/media/platform/soc_camera/atmel-isi.c | 2 ++
  include/media/atmel-isi.h                     | 4 ++++
  2 files changed, 6 insertions(+)
drivers/media/platform/soc_camera/atmel-isi.c +1 -0
index ee5650f..fda587b 100644
@@ -839,6 +839,8 @@ static int isi_camera_set_bus_param(struct
 soc_camera_device *icd)
  	if (isi->pdata.full_mode)
  		cfg1 |= ISI_CFG1_FULL_MODE;
  +	cfg1 |= ISI_CFG1_THMASK_BEATS_16;
+
  	isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS);
  	isi_writel(isi, ISI_CFG1, cfg1);
  diff --git a/include/media/atmel-isi.h b/include/media/atmel-isi.h

index c2e5703..6008b09 100644

include/media/atmel-isi.h +4 -0
@@ -59,6 +59,10 @@
  #define		ISI_CFG1_FRATE_DIV_MASK		(7 << 8)
  #define ISI_CFG1_DISCR				(1 << 11)
  #define ISI_CFG1_FULL_MODE			(1 << 12)
+/* Definition for THMASK(ISI_V2) */
+#define		ISI_CFG1_THMASK_BEATS_4		(0 << 13)
+#define		ISI_CFG1_THMASK_BEATS_8		(1 << 13)
+#define		ISI_CFG1_THMASK_BEATS_16	(2 << 13)
    /* Bitfields in CFG2 */
  #define ISI_CFG2_GRAYSCALE			(1 << 13)
author
#5 lore raw

PATCH 1/1 media: atmel-isi: increase the burst length to improve the performance

Hi, Guennadi

Quoted 8 lines · Guennadi Liakhovetski

Hi Josh,

Quoted 3 lines · Josh Wu

Hi, Guennadi

Ping? what about the status of this patch?

Right, got lost, sorry... Added to the queue now.

Thank you.

Best Regards,
Josh Wu

Quoted 47 lines

Thanks
Guennadi

Quoted 43 lines

Best Regards,
Josh Wu

Quoted 39 lines · Josh Wu

The burst length could be BEATS_4/8/16. Before this patch, isi use default value BEATS_4. To imporve the performance we could set it to BEATS_16.

Otherwise sometime it would cause the ISI overflow error.

---
   drivers/media/platform/soc_camera/atmel-isi.c | 2 ++
   include/media/atmel-isi.h                     | 4 ++++
   2 files changed, 6 insertions(+)
drivers/media/platform/soc_camera/atmel-isi.c +1 -0
index ee5650f..fda587b 100644
@@ -839,6 +839,8 @@ static int isi_camera_set_bus_param(struct
 soc_camera_device *icd)
   	if (isi->pdata.full_mode)
   		cfg1 |= ISI_CFG1_FULL_MODE;
   +	cfg1 |= ISI_CFG1_THMASK_BEATS_16;
+
   	isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS);
   	isi_writel(isi, ISI_CFG1, cfg1);
   diff --git a/include/media/atmel-isi.h b/include/media/atmel-isi.h

index c2e5703..6008b09 100644

include/media/atmel-isi.h +4 -0
@@ -59,6 +59,10 @@
   #define		ISI_CFG1_FRATE_DIV_MASK		(7 << 8)
   #define ISI_CFG1_DISCR				(1 << 11)
   #define ISI_CFG1_FULL_MODE			(1 << 12)
+/* Definition for THMASK(ISI_V2) */
+#define		ISI_CFG1_THMASK_BEATS_4		(0 << 13)
+#define		ISI_CFG1_THMASK_BEATS_8		(1 << 13)
+#define		ISI_CFG1_THMASK_BEATS_16	(2 << 13)
     /* Bitfields in CFG2 */
   #define ISI_CFG2_GRAYSCALE			(1 << 13)