[PATCH] media: atmel-isi: fix debug message which only show the first format

2015-11-30 Thread Josh Wu
Correct the debug output message to show correct format.

Signed-off-by: Josh Wu 
---

 drivers/media/platform/soc_camera/atmel-isi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/soc_camera/atmel-isi.c 
b/drivers/media/platform/soc_camera/atmel-isi.c
index f51e41e..d5a5119 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -795,7 +795,7 @@ static int isi_camera_get_formats(struct soc_camera_device 
*icd,
xlate->host_fmt = _camera_formats[i];
xlate->code = code.code;
dev_dbg(icd->parent, "Providing format %s using code 
%d\n",
-   isi_camera_formats[0].name, code.code);
+   xlate->host_fmt->name, xlate->code);
}
break;
default:
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [media] atmel-isi: Protect PM-only functions to kill warning

2015-09-06 Thread Josh Wu

Hi, Geert Uytterhoeven

Thanks for the patch.

On 9/6/2015 6:08 PM, Geert Uytterhoeven wrote:

If CONFIG_PM=n:

 drivers/media/platform/soc_camera/atmel-isi.c:1044: warning: 
‘atmel_isi_runtime_suspend’ defined but not used
 drivers/media/platform/soc_camera/atmel-isi.c:1054: warning: 
‘atmel_isi_runtime_resume’ defined but not used

Protect the unused functions by #ifdef CONFIG_PM to fix this.

Signed-off-by: Geert Uytterhoeven 


Acked-by: Josh Wu 

Best Regards,
Josh Wu


---
Resend with correct suject
---
  drivers/media/platform/soc_camera/atmel-isi.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/drivers/media/platform/soc_camera/atmel-isi.c 
b/drivers/media/platform/soc_camera/atmel-isi.c
index 90701726a06a2e5c..ccf30ccbe389233f 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -1040,6 +1040,7 @@ err_alloc_ctx:
return ret;
  }
  
+#ifdef CONFIG_PM

  static int atmel_isi_runtime_suspend(struct device *dev)
  {
struct soc_camera_host *soc_host = to_soc_camera_host(dev);
@@ -1058,6 +1059,7 @@ static int atmel_isi_runtime_resume(struct device *dev)
  
  	return clk_prepare_enable(isi->pclk);

  }
+#endif /* CONFIG_PM */
  
  static const struct dev_pm_ops atmel_isi_dev_pm_ops = {

SET_RUNTIME_PM_OPS(atmel_isi_runtime_suspend,


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [media] atmel-isi: Protect PM-only functions to kill warning

2015-09-06 Thread Geert Uytterhoeven
If CONFIG_PM=n:

drivers/media/platform/soc_camera/atmel-isi.c:1044: warning: 
‘atmel_isi_runtime_suspend’ defined but not used
drivers/media/platform/soc_camera/atmel-isi.c:1054: warning: 
‘atmel_isi_runtime_resume’ defined but not used

Protect the unused functions by #ifdef CONFIG_PM to fix this.

Signed-off-by: Geert Uytterhoeven 
---
Resend with correct suject
---
 drivers/media/platform/soc_camera/atmel-isi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/platform/soc_camera/atmel-isi.c 
b/drivers/media/platform/soc_camera/atmel-isi.c
index 90701726a06a2e5c..ccf30ccbe389233f 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -1040,6 +1040,7 @@ err_alloc_ctx:
return ret;
 }
 
+#ifdef CONFIG_PM
 static int atmel_isi_runtime_suspend(struct device *dev)
 {
struct soc_camera_host *soc_host = to_soc_camera_host(dev);
@@ -1058,6 +1059,7 @@ static int atmel_isi_runtime_resume(struct device *dev)
 
return clk_prepare_enable(isi->pclk);
 }
+#endif /* CONFIG_PM */
 
 static const struct dev_pm_ops atmel_isi_dev_pm_ops = {
SET_RUNTIME_PM_OPS(atmel_isi_runtime_suspend,
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [media] atmel-isi:

2015-09-06 Thread Geert Uytterhoeven
If CONFIG_PM=n:

drivers/media/platform/soc_camera/atmel-isi.c:1044: warning: 
‘atmel_isi_runtime_suspend’ defined but not used
drivers/media/platform/soc_camera/atmel-isi.c:1054: warning: 
‘atmel_isi_runtime_resume’ defined but not used

Protect the unused functions by #ifdef CONFIG_PM to fix this.

Signed-off-by: Geert Uytterhoeven 
---
 drivers/media/platform/soc_camera/atmel-isi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/platform/soc_camera/atmel-isi.c 
b/drivers/media/platform/soc_camera/atmel-isi.c
index 90701726a06a2e5c..ccf30ccbe389233f 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -1040,6 +1040,7 @@ err_alloc_ctx:
return ret;
 }
 
+#ifdef CONFIG_PM
 static int atmel_isi_runtime_suspend(struct device *dev)
 {
struct soc_camera_host *soc_host = to_soc_camera_host(dev);
@@ -1058,6 +1059,7 @@ static int atmel_isi_runtime_resume(struct device *dev)
 
return clk_prepare_enable(isi->pclk);
 }
+#endif /* CONFIG_PM */
 
 static const struct dev_pm_ops atmel_isi_dev_pm_ops = {
SET_RUNTIME_PM_OPS(atmel_isi_runtime_suspend,
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] media: atmel-isi: parse the DT parameters for vsync/hsync polarity

2015-08-04 Thread Josh Wu

Hi, Laurent

On 8/1/2015 5:11 PM, Laurent Pinchart wrote:

Hi Josh,

Thank you for the patch.

On Friday 31 July 2015 18:33:32 Josh Wu wrote:

This patch will get the DT parameters of vsync/hsync polarity, and pass to
the platform data.

Also add a debug information for test purpose.

Signed-off-by: Josh Wu josh...@atmel.com
---

  drivers/media/platform/soc_camera/atmel-isi.c | 10 ++
  1 file changed, 10 insertions(+)

diff --git a/drivers/media/platform/soc_camera/atmel-isi.c
b/drivers/media/platform/soc_camera/atmel-isi.c index fe9247a..a7de55c
100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -811,6 +811,11 @@ static int isi_camera_set_bus_param(struct
soc_camera_device *icd) if (common_flags  V4L2_MBUS_PCLK_SAMPLE_FALLING)
cfg1 |= ISI_CFG1_PIXCLK_POL_ACTIVE_FALLING;

+   dev_dbg(icd-parent, vsync is active %s, hsyc is active %s, pix clock 
is
sampling %s\n,

s/hsyc/hsync/

I'd write it as vsync active %s, hsync active %s, sampling on pix clock %s
edge\n with falling and rising instead of fall and rise.


Thanks, I'll correct it.




+   common_flags  V4L2_MBUS_VSYNC_ACTIVE_LOW ? low : high,
+   common_flags  V4L2_MBUS_HSYNC_ACTIVE_LOW ? low : high,
+   common_flags  V4L2_MBUS_PCLK_SAMPLE_FALLING ? fall : rise);
+
if (isi-pdata.has_emb_sync)
cfg1 |= ISI_CFG1_EMB_SYNC;
if (isi-pdata.full_mode)
@@ -898,6 +903,11 @@ static int atmel_isi_probe_dt(struct atmel_isi *isi,
goto err_probe_dt;
}

+   if (ep.bus.parallel.flags  V4L2_MBUS_HSYNC_ACTIVE_LOW)
+   isi-pdata.hsync_act_low = true;
+   if (ep.bus.parallel.flags  V4L2_MBUS_VSYNC_ACTIVE_LOW)
+   isi-pdata.vsync_act_low = true;

While you're at it, how about setting has_emb_sync based on ep.bus_type and
pclk_act_falling from flags  V4L2_MBUS_PCLK_SAMPLE_FALLING ?


I will add the pclk_act_falling handling code as well. And rebase this 
patch on top of your dt modifications.


Best Regards
Josh Wu



  err_probe_dt:
of_node_put(np);


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] media: atmel-isi: parse the DT parameters for vsync/hsync polarity

2015-08-01 Thread Laurent Pinchart
Hi Josh,

Thank you for the patch.

On Friday 31 July 2015 18:33:32 Josh Wu wrote:
 This patch will get the DT parameters of vsync/hsync polarity, and pass to
 the platform data.
 
 Also add a debug information for test purpose.
 
 Signed-off-by: Josh Wu josh...@atmel.com
 ---
 
  drivers/media/platform/soc_camera/atmel-isi.c | 10 ++
  1 file changed, 10 insertions(+)
 
 diff --git a/drivers/media/platform/soc_camera/atmel-isi.c
 b/drivers/media/platform/soc_camera/atmel-isi.c index fe9247a..a7de55c
 100644
 --- a/drivers/media/platform/soc_camera/atmel-isi.c
 +++ b/drivers/media/platform/soc_camera/atmel-isi.c
 @@ -811,6 +811,11 @@ static int isi_camera_set_bus_param(struct
 soc_camera_device *icd) if (common_flags  V4L2_MBUS_PCLK_SAMPLE_FALLING)
   cfg1 |= ISI_CFG1_PIXCLK_POL_ACTIVE_FALLING;
 
 + dev_dbg(icd-parent, vsync is active %s, hsyc is active %s, pix clock 
 is
 sampling %s\n,

s/hsyc/hsync/

I'd write it as vsync active %s, hsync active %s, sampling on pix clock %s 
edge\n with falling and rising instead of fall and rise.

 + common_flags  V4L2_MBUS_VSYNC_ACTIVE_LOW ? low : high,
 + common_flags  V4L2_MBUS_HSYNC_ACTIVE_LOW ? low : high,
 + common_flags  V4L2_MBUS_PCLK_SAMPLE_FALLING ? fall : rise);
 +
   if (isi-pdata.has_emb_sync)
   cfg1 |= ISI_CFG1_EMB_SYNC;
   if (isi-pdata.full_mode)
 @@ -898,6 +903,11 @@ static int atmel_isi_probe_dt(struct atmel_isi *isi,
   goto err_probe_dt;
   }
 
 + if (ep.bus.parallel.flags  V4L2_MBUS_HSYNC_ACTIVE_LOW)
 + isi-pdata.hsync_act_low = true;
 + if (ep.bus.parallel.flags  V4L2_MBUS_VSYNC_ACTIVE_LOW)
 + isi-pdata.vsync_act_low = true;

While you're at it, how about setting has_emb_sync based on ep.bus_type and 
pclk_act_falling from flags  V4L2_MBUS_PCLK_SAMPLE_FALLING ?

  err_probe_dt:
   of_node_put(np);

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] media: atmel-isi: parse the DT parameters for vsync/hsync polarity

2015-07-31 Thread Josh Wu
This patch will get the DT parameters of vsync/hsync polarity, and pass to
the platform data.

Also add a debug information for test purpose.

Signed-off-by: Josh Wu josh...@atmel.com
---

 drivers/media/platform/soc_camera/atmel-isi.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/drivers/media/platform/soc_camera/atmel-isi.c 
b/drivers/media/platform/soc_camera/atmel-isi.c
index fe9247a..a7de55c 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -811,6 +811,11 @@ static int isi_camera_set_bus_param(struct 
soc_camera_device *icd)
if (common_flags  V4L2_MBUS_PCLK_SAMPLE_FALLING)
cfg1 |= ISI_CFG1_PIXCLK_POL_ACTIVE_FALLING;
 
+   dev_dbg(icd-parent, vsync is active %s, hsyc is active %s, pix clock 
is sampling %s\n,
+   common_flags  V4L2_MBUS_VSYNC_ACTIVE_LOW ? low : high,
+   common_flags  V4L2_MBUS_HSYNC_ACTIVE_LOW ? low : high,
+   common_flags  V4L2_MBUS_PCLK_SAMPLE_FALLING ? fall : rise);
+
if (isi-pdata.has_emb_sync)
cfg1 |= ISI_CFG1_EMB_SYNC;
if (isi-pdata.full_mode)
@@ -898,6 +903,11 @@ static int atmel_isi_probe_dt(struct atmel_isi *isi,
goto err_probe_dt;
}
 
+   if (ep.bus.parallel.flags  V4L2_MBUS_HSYNC_ACTIVE_LOW)
+   isi-pdata.hsync_act_low = true;
+   if (ep.bus.parallel.flags  V4L2_MBUS_VSYNC_ACTIVE_LOW)
+   isi-pdata.vsync_act_low = true;
+
 err_probe_dt:
of_node_put(np);
 
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] media: atmel-isi: increase timeout to disable/enable isi

2015-06-17 Thread Josh Wu
If ISI is working on a 1024x768 or higher resolution, it needs longer
time to disable ISI. So this patch will increase timeout to 500ms.

Signed-off-by: Josh Wu josh...@atmel.com
---

 drivers/media/platform/soc_camera/atmel-isi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/soc_camera/atmel-isi.c 
b/drivers/media/platform/soc_camera/atmel-isi.c
index 1482af2..354b7db 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -219,7 +219,7 @@ static int atmel_isi_wait_status(struct atmel_isi *isi, int 
wait_reset)
}
 
timeout = wait_for_completion_timeout(isi-complete,
-   msecs_to_jiffies(100));
+   msecs_to_jiffies(500));
if (timeout == 0)
return -ETIMEDOUT;
 
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] media: atmel-isi: increase the burst length to improve the performance

2015-02-02 Thread Josh Wu

Hi, Guennadi

Ping? what about the status of this patch?

Best Regards,
Josh Wu

On 11/25/2014 5:30 PM, Josh Wu wrote:

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.

Reported-by: Bo Shen voice.s...@atmel.com
Signed-off-by: Josh Wu josh...@atmel.com
---
  drivers/media/platform/soc_camera/atmel-isi.c | 2 ++
  include/media/atmel-isi.h | 4 
  2 files changed, 6 insertions(+)

diff --git a/drivers/media/platform/soc_camera/atmel-isi.c 
b/drivers/media/platform/soc_camera/atmel-isi.c
index ee5650f..fda587b 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -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
--- a/include/media/atmel-isi.h
+++ b/include/media/atmel-isi.h
@@ -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) */
+#defineISI_CFG1_THMASK_BEATS_4 (0  13)
+#defineISI_CFG1_THMASK_BEATS_8 (1  13)
+#defineISI_CFG1_THMASK_BEATS_16(2  13)
  
  /* Bitfields in CFG2 */

  #define ISI_CFG2_GRAYSCALE(1  13)


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] media: atmel-isi: increase the burst length to improve the performance

2015-02-02 Thread Guennadi Liakhovetski
Hi Josh,

On Mon, 2 Feb 2015, Josh Wu wrote:

 Hi, Guennadi
 
 Ping? what about the status of this patch?

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

Thanks
Guennadi

 Best Regards,
 Josh Wu
 
 On 11/25/2014 5:30 PM, Josh Wu wrote:
  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.
  
  Reported-by: Bo Shen voice.s...@atmel.com
  Signed-off-by: Josh Wu josh...@atmel.com
  ---
drivers/media/platform/soc_camera/atmel-isi.c | 2 ++
include/media/atmel-isi.h | 4 
2 files changed, 6 insertions(+)
  
  diff --git a/drivers/media/platform/soc_camera/atmel-isi.c
  b/drivers/media/platform/soc_camera/atmel-isi.c
  index ee5650f..fda587b 100644
  --- a/drivers/media/platform/soc_camera/atmel-isi.c
  +++ b/drivers/media/platform/soc_camera/atmel-isi.c
  @@ -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
  --- a/include/media/atmel-isi.h
  +++ b/include/media/atmel-isi.h
  @@ -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) */
  +#defineISI_CFG1_THMASK_BEATS_4 (0  13)
  +#defineISI_CFG1_THMASK_BEATS_8 (1  13)
  +#defineISI_CFG1_THMASK_BEATS_16(2  13)
  /* Bitfields in CFG2 */
#define ISI_CFG2_GRAYSCALE(1  13)
 
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] media: atmel-isi: increase the burst length to improve the performance

2015-02-02 Thread Josh Wu

Hi, Guennadi

On 2/2/2015 6:22 PM, Guennadi Liakhovetski wrote:

Hi Josh,

On Mon, 2 Feb 2015, Josh Wu wrote:


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



Thanks
Guennadi


Best Regards,
Josh Wu

On 11/25/2014 5:30 PM, Josh Wu wrote:

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.

Reported-by: Bo Shen voice.s...@atmel.com
Signed-off-by: Josh Wu josh...@atmel.com
---
   drivers/media/platform/soc_camera/atmel-isi.c | 2 ++
   include/media/atmel-isi.h | 4 
   2 files changed, 6 insertions(+)

diff --git a/drivers/media/platform/soc_camera/atmel-isi.c
b/drivers/media/platform/soc_camera/atmel-isi.c
index ee5650f..fda587b 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -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
--- a/include/media/atmel-isi.h
+++ b/include/media/atmel-isi.h
@@ -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) */
+#defineISI_CFG1_THMASK_BEATS_4 (0  13)
+#defineISI_CFG1_THMASK_BEATS_8 (1  13)
+#defineISI_CFG1_THMASK_BEATS_16(2  13)
 /* Bitfields in CFG2 */
   #define ISI_CFG2_GRAYSCALE   (1  13)


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2014-11-25 Thread 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.

Reported-by: Bo Shen voice.s...@atmel.com
Signed-off-by: Josh Wu josh...@atmel.com
---
 drivers/media/platform/soc_camera/atmel-isi.c | 2 ++
 include/media/atmel-isi.h | 4 
 2 files changed, 6 insertions(+)

diff --git a/drivers/media/platform/soc_camera/atmel-isi.c 
b/drivers/media/platform/soc_camera/atmel-isi.c
index ee5650f..fda587b 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -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
--- a/include/media/atmel-isi.h
+++ b/include/media/atmel-isi.h
@@ -59,6 +59,10 @@
 #defineISI_CFG1_FRATE_DIV_MASK (7  8)
 #define ISI_CFG1_DISCR (1  11)
 #define ISI_CFG1_FULL_MODE (1  12)
+/* Definition for THMASK(ISI_V2) */
+#defineISI_CFG1_THMASK_BEATS_4 (0  13)
+#defineISI_CFG1_THMASK_BEATS_8 (1  13)
+#defineISI_CFG1_THMASK_BEATS_16(2  13)
 
 /* Bitfields in CFG2 */
 #define ISI_CFG2_GRAYSCALE (1  13)
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] media: atmel-isi: increase the burst length to improve the performance

2014-11-25 Thread Guennadi Liakhovetski
Hi Josh,

On Tue, 25 Nov 2014, Josh Wu wrote:

 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

 
 Reported-by: Bo Shen voice.s...@atmel.com
 Signed-off-by: Josh Wu josh...@atmel.com
 ---
  drivers/media/platform/soc_camera/atmel-isi.c | 2 ++
  include/media/atmel-isi.h | 4 
  2 files changed, 6 insertions(+)
 
 diff --git a/drivers/media/platform/soc_camera/atmel-isi.c 
 b/drivers/media/platform/soc_camera/atmel-isi.c
 index ee5650f..fda587b 100644
 --- a/drivers/media/platform/soc_camera/atmel-isi.c
 +++ b/drivers/media/platform/soc_camera/atmel-isi.c
 @@ -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
 --- a/include/media/atmel-isi.h
 +++ b/include/media/atmel-isi.h
 @@ -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)
 -- 
 1.9.1
 
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] media: atmel-isi: increase the burst length to improve the performance

2014-11-25 Thread Josh Wu

Hi, Gunenadi

On 11/26/2014 6:21 AM, Guennadi Liakhovetski wrote:

Hi Josh,

On Tue, 25 Nov 2014, Josh Wu wrote:


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.



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


Thanks
Guennadi


Reported-by: Bo Shen voice.s...@atmel.com
Signed-off-by: Josh Wu josh...@atmel.com
---
  drivers/media/platform/soc_camera/atmel-isi.c | 2 ++
  include/media/atmel-isi.h | 4 
  2 files changed, 6 insertions(+)

diff --git a/drivers/media/platform/soc_camera/atmel-isi.c 
b/drivers/media/platform/soc_camera/atmel-isi.c
index ee5650f..fda587b 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -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
--- a/include/media/atmel-isi.h
+++ b/include/media/atmel-isi.h
@@ -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) */
+#defineISI_CFG1_THMASK_BEATS_4 (0  13)
+#defineISI_CFG1_THMASK_BEATS_8 (1  13)
+#defineISI_CFG1_THMASK_BEATS_16(2  13)
  
  /* Bitfields in CFG2 */

  #define ISI_CFG2_GRAYSCALE(1  13)
--
1.9.1



--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html