media: ov8856: Configure sensor for GRBG Bayer for all modes
PATCH v5 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 ...
row 3: B G B G B G ...
...
To:
row 2: G R G R G R ...
row 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
Changes since v4:
- Andrey: Fix typ-o
- Andrey: Add r-b
drivers/media/i2c/ov8856.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/ov8856.c +2 -2
@@ -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
Ping. I think this patch is ready to be merged.
Quoted 69 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 ...
row 3: B G B G B G ...
...To:
row 2: G R G R G R ...
row 3: B G B G B G ...
...Signed-off-by Robert Foss <[email protected]>Suggested-by Andrey Konovalov <[email protected]>Reviewed-by Andrey Konovalov <[email protected]>---
Changes since v1:
- Sakari: Added mode information toov8856_modestruct
- Sakari:enum_mbus_codeupdatedChanges since v2:
- Andrey: Switched approach to changing the sensor configuration to yield identical Bayer modes for all modesChanges since v3:
- Andrey: Improve commit msg to explain Bayer shift betterChanges since v4:
- Andrey: Fix typ-o
- Andrey: Add r-bdrivers/media/i2c/ov8856.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/media/i2c/ov8856.c +2
-3@@ -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.27.0