]> git.baikalelectronics.ru Git - kernel.git/commit
media: i2c: imx219: Fix binning for RAW8 capture
authorJai Luthra <j-luthra@ti.com>
Tue, 17 Jan 2023 08:16:23 +0000 (09:16 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:33:42 +0000 (09:33 +0100)
commit9e570bca98cbe226bce1af74b9eec177a340bc7e
treeebf220b6217a86441d0465640dc7587dcefcccf6
parentdc6f9dd6eb82a36c22824bc87e2e322167b2a88f
media: i2c: imx219: Fix binning for RAW8 capture

[ Upstream commit 33b2fbe4cbe1bc268784617408e597ffd35bccbc ]

2x2 binning works fine for RAW10 capture, but for RAW8 1232p mode it
leads to corrupted frames [1][2].

Using the special 2x2 analog binning mode fixes the issue, but causes
artefacts for RAW10 1232p capture. So here we choose the binning mode
depending upon the frame format selected.

As both binning modes work fine for 480p RAW8 and RAW10 capture, it can
share the same code path as 1232p for selecting binning mode.

[1] https://forums.raspberrypi.com/viewtopic.php?t=332103
[2] https://github.com/raspberrypi/libcamera-apps/issues/281

Fixes: 6b3818e10dad ("media: i2c: imx219: Add support for RAW8 bit bayer format")
Signed-off-by: Jai Luthra <j-luthra@ti.com>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/i2c/imx219.c