Re: [PATCH] media: ov8856: Remove 3280x2464 mode

From: Dongchun Zhu
Date: Tue Nov 24 2020 - 05:10:45 EST


Hi Sakari,

On Tue, 2020-11-24 at 10:43 +0200, Sakari Ailus wrote:
> Hi Dongchun,
>
> On Tue, Nov 24, 2020 at 03:40:51PM +0800, Dongchun Zhu wrote:
> > > static const struct ov8856_mode supported_modes[] = {
> > > - {
> > > - .width = 3280,
> > > - .height = 2464,
> > > - .hts = 1928,
> > > - .vts_def = 2488,
> > > - .vts_min = 2488,
> > > - .reg_list = {
> > > - .num_of_regs = ARRAY_SIZE(mode_3280x2464_regs),
> > > - .regs = mode_3280x2464_regs,
> > > - },
> > > - .link_freq_index = OV8856_LINK_FREQ_720MBPS,
> > > - },
> >
> > If 3280x2464 resolution is removed, bayer order needs to be updated in
> > the meantime. From OV8856's datasheet, bayer order turns to be BGGR if
> > sensor adopts full mode (3264x2448) or binning mode (1632x1224).
>
> How is this related to the patch?
>

Yes, it seems to be another issue.
But it is very often that bayer order is strongly related to the image
window size and mirror/flip setting.

> The next largest size is 16 by 16 less, so the Bayer order is the same. If
> it's wrong currently (as it would appear to), it should be a separate
> patch.
>

OV8856 sensor array region consists of 3 main window settings.
The inner window is controlled by [H_win_off, V_win_off].
From the old unusual 3280x2464 and 1640x1232 setting,
H_win_off(R3810-R3811) is 0, V_win_off(R3812-R3813) is 1.

Considering that the register TEST_PATTERN_CTRL(R4320) controlling pixel
order is not set (default: 0x80, meaning BG/GR) and mirror/flip are both
OFF, the absolute coordinate of crop_start is expressed as:
[H_crop_start+H_win_off, V_crop_start+V_win_off] = [0, 7]

Thus the first pixel shall start with G channel(according to datasheet).
This is different with current resolutions (3264x2448 and 1632x1224).