Skip to contentSkip to conversation

media: ov8856: Configure sensor for GRBG Bayer for all modes

PATCH Superseded Robert Foss 2 participants 5 messages Jan 18, 2021

Subsystems (3)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 media: ov8856: Configure sensor for GRBG Bayer for all modes

The previously added modes 3264x2448 & 1632x1224 are actually configuring the sensor for BGGR mode, this is an issue since the mode that is exposed through V4L incorrectly is set as GRBG.

This patch fixes the issue by moving the output crop window of internal sensor ISP uses by one row, which means that the Bayer pattern of the output is changed.

From:
row 1: B G B G B G ...
row 2: G R G R G R ...
raw 3: B G B G B G ...
...

To:
raw 2: G R G R G R ...
raw 3: B G B G B G ...
...

---

Changes since v1:
- Sakari: Added mode information to ov8856_mode struct
- Sakari: enum_mbus_code updated

Changes since v2:
- Andrey: Switched approach to changing the sensor configuration to yield identical Bayer modes for all modes

Changes since v3:
- Andrey: Improve commit msg to explain Bayer shift better

 drivers/media/i2c/ov8856.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/ov8856.c +2 -2
index 2f4ceaa80593..8a355135c7db 100644
@@ -428,7 +428,7 @@ static const struct ov8856_reg mode_3264x2448_regs[] = {
 	{0x3810, 0x00},
 	{0x3811, 0x04},
 	{0x3812, 0x00},
-	{0x3813, 0x02},
+	{0x3813, 0x01},
 	{0x3814, 0x01},
 	{0x3815, 0x01},
 	{0x3816, 0x00},
@@ -821,7 +821,7 @@ static const struct ov8856_reg mode_1632x1224_regs[] = {
 	{0x3810, 0x00},
 	{0x3811, 0x02},
 	{0x3812, 0x00},
-	{0x3813, 0x02},
+	{0x3813, 0x01},
 	{0x3814, 0x03},
 	{0x3815, 0x01},
 	{0x3816, 0x00},
Signature · 1 line
2.27.0
Reviewed-by on v4 1/1
#1 lore raw

Hi Robert,

Thanks for you patch!

Quoted 60 lines · Robert Foss

The previously added modes 3264x2448 & 1632x1224 are actually configuring the sensor for BGGR mode, this is an issue since the mode that is exposed through V4L incorrectly is set as GRBG.

This patch fixes the issue by moving the output crop window of internal sensor ISP uses by one row, which means that the Bayer pattern of the output is changed.

From:
row 1: B G B G B G ...
row 2: G R G R G R ...
raw 3: B G B G B G ...
...

To:
raw 2: G R G R G R ...
raw 3: B G B G B G ...
...

---

Changes since v1:
- Sakari: Added mode information to ov8856_mode struct
- Sakari: enum_mbus_code updated

Changes since v2:
- Andrey: Switched approach to changing the sensor configuration to yield identical Bayer modes for all modes

Changes since v3:
- Andrey: Improve commit msg to explain Bayer shift better

  drivers/media/i2c/ov8856.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/ov8856.c +2 -2
index 2f4ceaa80593..8a355135c7db 100644
@@ -428,7 +428,7 @@ static const struct ov8856_reg mode_3264x2448_regs[] = {
  	{0x3810, 0x00},
  	{0x3811, 0x04},
  	{0x3812, 0x00},
-	{0x3813, 0x02},
+	{0x3813, 0x01},
  	{0x3814, 0x01},
  	{0x3815, 0x01},
  	{0x3816, 0x00},
@@ -821,7 +821,7 @@ static const struct ov8856_reg mode_1632x1224_regs[] = {
  	{0x3810, 0x00},
  	{0x3811, 0x02},
  	{0x3812, 0x00},
-	{0x3813, 0x02},
+	{0x3813, 0x01},
  	{0x3814, 0x03},
  	{0x3815, 0x01},
  	{0x3816, 0x00},
#2 lore raw

Oops.. I've missed a few mistypes

Quoted 19 lines · Andrey Konovalov

Hi Robert,

Thanks for you patch!

Quoted 12 lines · Robert Foss

The previously added modes 3264x2448 & 1632x1224 are actually configuring the sensor for BGGR mode, this is an issue since the mode that is exposed through V4L incorrectly is set as GRBG.

This patch fixes the issue by moving the output crop window of internal sensor ISP uses by one row, which means that the Bayer pattern of the output is changed.

From:
row 1: B G B G B G ...
row 2: G R G R G R ...
raw 3: B G B G B G ...

- row

Quoted 4 lines
Quoted 4 lines

...

To:
raw 2: G R G R G R ...

- row

Quoted 1 line
Quoted 1 line

raw 3: B G B G B G ...

- row

Thanks,
Andrey

Quoted 43 lines
Quoted 43 lines

...

---

Changes since v1:
  - Sakari: Added mode information to ov8856_mode struct
  - Sakari: enum_mbus_code updated

Changes since v2:
  - Andrey: Switched approach to changing the sensor configuration to yield identical Bayer modes for all modes

Changes since v3:
  - Andrey: Improve commit msg to explain Bayer shift better

  drivers/media/i2c/ov8856.c | 4 ++--

  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/ov8856.c +2 -2
index 2f4ceaa80593..8a355135c7db 100644
@@ -428,7 +428,7 @@ static const struct ov8856_reg mode_3264x2448_regs[] = {
       {0x3810, 0x00},
       {0x3811, 0x04},
       {0x3812, 0x00},
-    {0x3813, 0x02},
+    {0x3813, 0x01},
       {0x3814, 0x01},
       {0x3815, 0x01},
       {0x3816, 0x00},
@@ -821,7 +821,7 @@ static const struct ov8856_reg mode_1632x1224_regs[] = {
       {0x3810, 0x00},
       {0x3811, 0x02},
       {0x3812, 0x00},
-    {0x3813, 0x02},
+    {0x3813, 0x01},
       {0x3814, 0x03},
       {0x3815, 0x01},
       {0x3816, 0x00},
#3 lore raw

I was going for row, but got a bit wild with the Ctrl-C + Ctrl-V, is that alright with you?

Quoted 78 lines · Andrey Konovalov

Oops.. I've missed a few mistypes

Quoted 19 lines · Andrey Konovalov

Hi Robert,

Thanks for you patch!

Quoted 12 lines · Robert Foss

The previously added modes 3264x2448 & 1632x1224 are actually configuring the sensor for BGGR mode, this is an issue since the mode that is exposed through V4L incorrectly is set as GRBG.

This patch fixes the issue by moving the output crop window of internal sensor ISP uses by one row, which means that the Bayer pattern of the output is changed.

From:
row 1: B G B G B G ...
row 2: G R G R G R ...
raw 3: B G B G B G ...

- row

Quoted 4 lines
Quoted 4 lines

...

To:
raw 2: G R G R G R ...

- row

Quoted 1 line
Quoted 1 line

raw 3: B G B G B G ...

- row

Thanks,
Andrey

Quoted 43 lines
Quoted 43 lines

...

---

Changes since v1:
- Sakari: Added mode information to ov8856_mode struct
- Sakari: enum_mbus_code updated

Changes since v2:
- Andrey: Switched approach to changing the sensor configuration to yield identical Bayer modes for all modes

Changes since v3:
- Andrey: Improve commit msg to explain Bayer shift better

  drivers/media/i2c/ov8856.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/ov8856.c +2 -2
index 2f4ceaa80593..8a355135c7db 100644
@@ -428,7 +428,7 @@ static const struct ov8856_reg mode_3264x2448_regs[] = {
      {0x3810, 0x00},
      {0x3811, 0x04},
      {0x3812, 0x00},
-    {0x3813, 0x02},
+    {0x3813, 0x01},
      {0x3814, 0x01},
      {0x3815, 0x01},
      {0x3816, 0x00},
@@ -821,7 +821,7 @@ static const struct ov8856_reg mode_1632x1224_regs[] = {
      {0x3810, 0x00},
      {0x3811, 0x02},
      {0x3812, 0x00},
-    {0x3813, 0x02},
+    {0x3813, 0x01},
      {0x3814, 0x03},
      {0x3815, 0x01},
      {0x3816, 0x00},
#4 lore raw

Hi Robert,

Quoted 1 line · Robert Foss

I was going for row, but got a bit wild with the Ctrl-C + Ctrl-V, is

Yeah... "raw" was in my original text

Quoted 1 line

that alright with you?

Other than these few raw vs row mistypes the patch is fine for me. My Reviewed-by tag holds.

Thanks,
Andrey

Quoted 80 lines
Quoted 78 lines · Andrey Konovalov

Oops.. I've missed a few mistypes

Quoted 19 lines · Andrey Konovalov

Hi Robert,

Thanks for you patch!

Quoted 12 lines · Robert Foss

The previously added modes 3264x2448 & 1632x1224 are actually configuring the sensor for BGGR mode, this is an issue since the mode that is exposed through V4L incorrectly is set as GRBG.

This patch fixes the issue by moving the output crop window of internal sensor ISP uses by one row, which means that the Bayer pattern of the output is changed.

From:
row 1: B G B G B G ...
row 2: G R G R G R ...
raw 3: B G B G B G ...

- row

Quoted 4 lines
Quoted 4 lines

...

To:
raw 2: G R G R G R ...

- row

Quoted 1 line
Quoted 1 line

raw 3: B G B G B G ...

- row

Thanks,
Andrey

Quoted 43 lines
Quoted 43 lines

...

---

Changes since v1:
- Sakari: Added mode information to ov8856_mode struct
- Sakari: enum_mbus_code updated

Changes since v2:
- Andrey: Switched approach to changing the sensor configuration to yield identical Bayer modes for all modes

Changes since v3:
- Andrey: Improve commit msg to explain Bayer shift better

   drivers/media/i2c/ov8856.c | 4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/ov8856.c +2 -2
index 2f4ceaa80593..8a355135c7db 100644
@@ -428,7 +428,7 @@ static const struct ov8856_reg mode_3264x2448_regs[] = {
       {0x3810, 0x00},
       {0x3811, 0x04},
       {0x3812, 0x00},
-    {0x3813, 0x02},
+    {0x3813, 0x01},
       {0x3814, 0x01},
       {0x3815, 0x01},
       {0x3816, 0x00},
@@ -821,7 +821,7 @@ static const struct ov8856_reg mode_1632x1224_regs[] = {
       {0x3810, 0x00},
       {0x3811, 0x02},
       {0x3812, 0x00},
-    {0x3813, 0x02},
+    {0x3813, 0x01},
       {0x3814, 0x03},
       {0x3815, 0x01},
       {0x3816, 0x00},