* [PATCH v1] media: ov8856: Fix Bayer format dependance on mode
@ 2020-11-24 15:03 Robert Foss
2020-11-24 17:13 ` Sakari Ailus
0 siblings, 1 reply; 2+ messages in thread
From: Robert Foss @ 2020-11-24 15:03 UTC (permalink / raw)
To: dongchun.zhu, mchehab, linux-media, linux-kernel, Tomasz Figa,
Dongchun Zhu, Sakari Ailus, Bingbu Cao
Cc: Robert Foss
The Bayer GRBG10 mode used for earlier modes 3280x2460 and
1640x1232 isn't the mode output by the sensor for the
3264x2448 and 1632x1224 modes.
Switch from MEDIA_BUS_FMT_SGRBG10_1X10 to MEDIA_BUS_FMT_SBGGR10_1X10
for 3264x2448 & 1632x1224 modes.
Signed-off-by: Robert Foss <robert.foss@linaro.org>
---
This patch is sent out after Dongchun Zhu clarified the Bayer
modes used by different sensor configuration in the below thread.
https://lkml.org/lkml/2020/11/24/335
drivers/media/i2c/ov8856.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/media/i2c/ov8856.c b/drivers/media/i2c/ov8856.c
index 2f4ceaa80593..a2dcbece558c 100644
--- a/drivers/media/i2c/ov8856.c
+++ b/drivers/media/i2c/ov8856.c
@@ -1281,8 +1281,13 @@ static void ov8856_update_pad_format(const struct ov8856_mode *mode,
{
fmt->width = mode->width;
fmt->height = mode->height;
- fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10;
fmt->field = V4L2_FIELD_NONE;
+
+ if (mode->reg_list.regs == mode_3264x2448_regs ||
+ mode->reg_list.regs == mode_1632x1224_regs)
+ fmt->code = MEDIA_BUS_FMT_SBGGR10_1X10;
+ else
+ fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10;
}
static int ov8856_start_streaming(struct ov8856 *ov8856)
--
2.27.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v1] media: ov8856: Fix Bayer format dependance on mode
2020-11-24 15:03 [PATCH v1] media: ov8856: Fix Bayer format dependance on mode Robert Foss
@ 2020-11-24 17:13 ` Sakari Ailus
0 siblings, 0 replies; 2+ messages in thread
From: Sakari Ailus @ 2020-11-24 17:13 UTC (permalink / raw)
To: Robert Foss
Cc: dongchun.zhu, mchehab, linux-media, linux-kernel, Tomasz Figa,
Bingbu Cao
Hi Robert,
On Tue, Nov 24, 2020 at 04:03:32PM +0100, Robert Foss wrote:
> The Bayer GRBG10 mode used for earlier modes 3280x2460 and
> 1640x1232 isn't the mode output by the sensor for the
> 3264x2448 and 1632x1224 modes.
>
> Switch from MEDIA_BUS_FMT_SGRBG10_1X10 to MEDIA_BUS_FMT_SBGGR10_1X10
> for 3264x2448 & 1632x1224 modes.
>
> Signed-off-by: Robert Foss <robert.foss@linaro.org>
> ---
>
> This patch is sent out after Dongchun Zhu clarified the Bayer
> modes used by different sensor configuration in the below thread.
>
> https://lkml.org/lkml/2020/11/24/335
>
> drivers/media/i2c/ov8856.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/i2c/ov8856.c b/drivers/media/i2c/ov8856.c
> index 2f4ceaa80593..a2dcbece558c 100644
> --- a/drivers/media/i2c/ov8856.c
> +++ b/drivers/media/i2c/ov8856.c
> @@ -1281,8 +1281,13 @@ static void ov8856_update_pad_format(const struct ov8856_mode *mode,
> {
> fmt->width = mode->width;
> fmt->height = mode->height;
> - fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10;
> fmt->field = V4L2_FIELD_NONE;
> +
> + if (mode->reg_list.regs == mode_3264x2448_regs ||
> + mode->reg_list.regs == mode_1632x1224_regs)
> + fmt->code = MEDIA_BUS_FMT_SBGGR10_1X10;
> + else
> + fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10;
> }
>
> static int ov8856_start_streaming(struct ov8856 *ov8856)
Could you instead add the mode information to the ov8856_mode struct?
Also enum_mbus_code needs to be updated.
The mbus code also has priority in mode selection, thus only the modes for
the selected mbus code should considered in set_fmt.
--
Regards,
Sakari Ailus
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-24 17:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-24 15:03 [PATCH v1] media: ov8856: Fix Bayer format dependance on mode Robert Foss
2020-11-24 17:13 ` Sakari Ailus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®