Hi, Changhuang On 2024-08-13 at 05:44 -07, Changhuang Liang <changhuang.liang@xxxxxxxxxxxxxxxx> wrote: > Hi, Mikhail > > Thanks for your patch. > >> >> Implement 2x2 binning support. Compute best binning mode (none or 2x2) >> from pad crop and pad format in ov4689_set_fmt. Use output frame size >> instead of analogue crop to compute control ranges and BLC anchors. >> >> Also move ov4689_hts_min and ov4689_update_ctrl_ranges, since they are >> now also called from ov4689_set_fmt. Update frame timings to >> accommodate the requirements of binning mode and avoid visual >> artefacts. Additionally, report 2x2 binned mode in addition to >> non-binned one in ov4689_enum_frame_sizes. >> >> Signed-off-by: Mikhail Rudenko <mike.rudenko@xxxxxxxxx> > > Tested-by: Changhuang Liang <changhuang.liang@xxxxxxxxxxxxxxxx> > Thanks for testing! It's good to see that this code has now been independently verified as it contains a few bits that were obtained through reverse engineering/trial and error that I was never entirely sure of. (Of course I did lots of testing to ensure that all possible crop+binning modes work as expected, but when datasheet lacks required information, one can never be fully sure.) >> --- >> drivers/media/i2c/ov4689.c | 179 ++++++++++++++++++++++++------------- >> 1 file changed, 117 insertions(+), 62 deletions(-) >> >> diff --git a/drivers/media/i2c/ov4689.c b/drivers/media/i2c/ov4689.c >> index c4c7c462672a..1499fbe88b76 100644 >> --- a/drivers/media/i2c/ov4689.c >> +++ b/drivers/media/i2c/ov4689.c >> @@ -114,7 +114,7 @@ >> * Minimum working vertical blanking value. Found experimentally at >> * minimum HTS values. >> */ > > Regards, > Changhuang -- Best regards, Mikhail Rudenko