Skip to contentSkip to conversation

media: ipu3-cio2: Update high watermark to support higher data rate camera sensors

PATCH In review Bingbu Cao 4 participants 5 messages Sep 23, 2021 – Oct 21, 2021

Subsystems (2)
lore
Share & tools
lore

Bingbu Cao

author
#0 lore raw

PATCH 1/1 media: ipu3-cio2: Update high watermark to support higher data rate camera sensors

CIO2 worked well with most camera sensors so far, but CIO2 will meet SRAM overflow when working with higher data rate camera sensors such as 13M@30fps. We must set lower high watermark value to trigger the DRAM write to support such camera sensors.

---
 drivers/media/pci/intel/ipu3/ipu3-cio2.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/pci/intel/ipu3/ipu3-cio2.h +1 -1
index 3806d7f04d69..fde80d48533b 100644
@@ -181,7 +181,7 @@ struct pci_dev;
 #define CIO2_PBM_WMCTRL1_MID1_2CK	(16 << CIO2_PBM_WMCTRL1_MID1_2CK_SHIFT)
 #define CIO2_PBM_WMCTRL1_MID2_2CK	(21 << CIO2_PBM_WMCTRL1_MID2_2CK_SHIFT)
 #define CIO2_REG_PBM_WMCTRL2				0x1468
-#define CIO2_PBM_WMCTRL2_HWM_2CK			40U
+#define CIO2_PBM_WMCTRL2_HWM_2CK			30U
 #define CIO2_PBM_WMCTRL2_HWM_2CK_SHIFT			0U
 #define CIO2_PBM_WMCTRL2_LWM_2CK			22U
 #define CIO2_PBM_WMCTRL2_LWM_2CK_SHIFT			8U
Signature · 1 line
2.7.4
#1 lore raw

Hi Bingbu,

Quoted 11 lines · Bingbu Cao

CIO2 worked well with most camera sensors so far, but CIO2 will meet SRAM overflow when working with higher data rate camera sensors such as 13M@30fps. We must set lower high watermark value to trigger the DRAM write to support such camera sensors.

---
 drivers/media/pci/intel/ipu3/ipu3-cio2.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks for the patch. Would this have any implications for other (lower) operating modes, such as increased power consumption, or it's harmless? If so, what's the reason we didn't use the value from the very beginning?

Best regards,
Tomasz

Quoted 16 lines
drivers/media/pci/intel/ipu3/ipu3-cio2.h +1 -2
index 3806d7f04d69..fde80d48533b 100644
@@ -181,7 +181,7 @@ struct pci_dev;
 #define CIO2_PBM_WMCTRL1_MID1_2CK      (16 << CIO2_PBM_WMCTRL1_MID1_2CK_SHIFT)
 #define CIO2_PBM_WMCTRL1_MID2_2CK      (21 << CIO2_PBM_WMCTRL1_MID2_2CK_SHIFT)
 #define CIO2_REG_PBM_WMCTRL2                           0x1468
-#define CIO2_PBM_WMCTRL2_HWM_2CK                       40U
+#define CIO2_PBM_WMCTRL2_HWM_2CK                       30U
 #define CIO2_PBM_WMCTRL2_HWM_2CK_SHIFT                 0U
 #define CIO2_PBM_WMCTRL2_LWM_2CK                       22U
 #define CIO2_PBM_WMCTRL2_LWM_2CK_SHIFT                 8U
--

2.7.4

#2 lore raw

Tomasz,

Quoted 15 lines · Tomasz Figa

Hi Bingbu,

Quoted 11 lines · Bingbu Cao

CIO2 worked well with most camera sensors so far, but CIO2 will meet SRAM overflow when working with higher data rate camera sensors such as 13M@30fps. We must set lower high watermark value to trigger the DRAM write to support such camera sensors.

---
 drivers/media/pci/intel/ipu3/ipu3-cio2.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 4 lines

Thanks for the patch. Would this have any implications for other (lower) operating modes, such as increased power consumption, or it's harmless? If so, what's the reason we didn't use the value from the very beginning?

Yes, we meet that the frame data corruption for some high data rate camera sensors like imx258 (13M@30fps) with current watermark settings. The higher watermark potentially has power concern as it request DMA transfer more than before.

To keep the old settings for low data rate camera sensor, I am thinking the rationality to determine the HWM value based on the link_frequency? Apparently, it is not reliable to determine by the format.

Quoted 20 lines

Best regards,
Tomasz

Quoted 16 lines
drivers/media/pci/intel/ipu3/ipu3-cio2.h +1 -2
index 3806d7f04d69..fde80d48533b 100644
@@ -181,7 +181,7 @@ struct pci_dev;
 #define CIO2_PBM_WMCTRL1_MID1_2CK      (16 << CIO2_PBM_WMCTRL1_MID1_2CK_SHIFT)
 #define CIO2_PBM_WMCTRL1_MID2_2CK      (21 << CIO2_PBM_WMCTRL1_MID2_2CK_SHIFT)
 #define CIO2_REG_PBM_WMCTRL2                           0x1468
-#define CIO2_PBM_WMCTRL2_HWM_2CK                       40U
+#define CIO2_PBM_WMCTRL2_HWM_2CK                       30U
 #define CIO2_PBM_WMCTRL2_HWM_2CK_SHIFT                 0U
 #define CIO2_PBM_WMCTRL2_LWM_2CK                       22U
 #define CIO2_PBM_WMCTRL2_LWM_2CK_SHIFT                 8U
--

2.7.4

Signature · 2 lines
Best regards,
Bingbu Cao
#3 lore raw

Hi Bingbu,

Quoted 19 lines · Bingbu Cao
Quoted 13 lines · Tomasz Figa
Quoted 11 lines · Bingbu Cao

CIO2 worked well with most camera sensors so far, but CIO2 will meet SRAM overflow when working with higher data rate camera sensors such as 13M@30fps. We must set lower high watermark value to trigger the DRAM write to support such camera sensors.

---
 drivers/media/pci/intel/ipu3/ipu3-cio2.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 4 lines

Thanks for the patch. Would this have any implications for other (lower) operating modes, such as increased power consumption, or it's harmless? If so, what's the reason we didn't use the value from the very beginning?

Quoted 7 lines

Yes, we meet that the frame data corruption for some high data rate camera sensors like imx258 (13M@30fps) with current watermark settings. The higher watermark potentially has power concern as it request DMA transfer more than before.

To keep the old settings for low data rate camera sensor, I am thinking the rationality to determine the HWM value based on the link_frequency? Apparently, it is not reliable to determine by the format.

It depends on the SRAM buffer size, on the image width, the horizontal blanking, and the link frequency. If you can store a full line of data, you'll have time during horizontal blanking to finish the DMA transfer, so you can trigger it later. I don't know how the hardware works exactly so I can't provide an exact formula (and I suppose you'll need to reserve some margin to account for other traffic to the DRAM).

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
drivers/media/pci/intel/ipu3/ipu3-cio2.h +1 -1
index 3806d7f04d69..fde80d48533b 100644
@@ -181,7 +181,7 @@ struct pci_dev;
 #define CIO2_PBM_WMCTRL1_MID1_2CK      (16 << CIO2_PBM_WMCTRL1_MID1_2CK_SHIFT)
 #define CIO2_PBM_WMCTRL1_MID2_2CK      (21 << CIO2_PBM_WMCTRL1_MID2_2CK_SHIFT)
 #define CIO2_REG_PBM_WMCTRL2                           0x1468
-#define CIO2_PBM_WMCTRL2_HWM_2CK                       40U
+#define CIO2_PBM_WMCTRL2_HWM_2CK                       30U
 #define CIO2_PBM_WMCTRL2_HWM_2CK_SHIFT                 0U
 #define CIO2_PBM_WMCTRL2_LWM_2CK                       22U
 #define CIO2_PBM_WMCTRL2_LWM_2CK_SHIFT                 8U
Signature · 3 lines
Regards,

Laurent Pinchart
#4 lore raw
Quoted 31 lines · Laurent Pinchart

Hi Bingbu,

Quoted 19 lines · Bingbu Cao
Quoted 13 lines · Tomasz Figa
Quoted 11 lines · Bingbu Cao

CIO2 worked well with most camera sensors so far, but CIO2 will meet SRAM overflow when working with higher data rate camera sensors such as 13M@30fps. We must set lower high watermark value to trigger the DRAM write to support such camera sensors.

---
 drivers/media/pci/intel/ipu3/ipu3-cio2.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 4 lines

Thanks for the patch. Would this have any implications for other (lower) operating modes, such as increased power consumption, or it's harmless? If so, what's the reason we didn't use the value from the very beginning?

Quoted 7 lines

Yes, we meet that the frame data corruption for some high data rate camera sensors like imx258 (13M@30fps) with current watermark settings. The higher watermark potentially has power concern as it request DMA transfer more than before.

To keep the old settings for low data rate camera sensor, I am thinking the rationality to determine the HWM value based on the link_frequency? Apparently, it is not reliable to determine by the format.

Quoted 7 lines

It depends on the SRAM buffer size, on the image width, the horizontal blanking, and the link frequency. If you can store a full line of data, you'll have time during horizontal blanking to finish the DMA transfer, so you can trigger it later. I don't know how the hardware works exactly so I can't provide an exact formula (and I suppose you'll need to reserve some margin to account for other traffic to the DRAM).

Yes, it would be good to have a formula. It doesn't have to be exact if it would make it overly complex, just care should be taken so that it doesn't undershoot, as it would cause overflows.

Quoted 18 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
drivers/media/pci/intel/ipu3/ipu3-cio2.h +0 -0
index 3806d7f04d69..fde80d48533b 100644
@@ -181,7 +181,7 @@ struct pci_dev;
Quoted 8 lines
Quoted 8 lines

drivers/media/pci/intel/ipu3/ipu3-cio2.h struct pci_dev; · line 187

Quoted 8 lines
drivers/media/pci/intel/ipu3/ipu3-cio2.h +1 -1
 #define CIO2_PBM_WMCTRL1_MID1_2CK      (16 << CIO2_PBM_WMCTRL1_MID1_2CK_SHIFT)
 #define CIO2_PBM_WMCTRL1_MID2_2CK      (21 << CIO2_PBM_WMCTRL1_MID2_2CK_SHIFT)
 #define CIO2_REG_PBM_WMCTRL2                           0x1468
-#define CIO2_PBM_WMCTRL2_HWM_2CK                       40U
+#define CIO2_PBM_WMCTRL2_HWM_2CK                       30U
 #define CIO2_PBM_WMCTRL2_HWM_2CK_SHIFT                 0U
 #define CIO2_PBM_WMCTRL2_LWM_2CK                       22U
 #define CIO2_PBM_WMCTRL2_LWM_2CK_SHIFT                 8U

--
Regards,

Laurent Pinchart