]> git.baikalelectronics.ru Git - kernel.git/commit
media: ov6650: Fix stored crop rectangle not in sync with hardware
authorJanusz Krzysztofik <jmkrzyszt@gmail.com>
Tue, 3 Sep 2019 20:11:44 +0000 (17:11 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 1 Oct 2019 20:31:20 +0000 (17:31 -0300)
commitb6ef031a64aba8d2c539b5bbed2197d5bbd857a3
tree36a71b888002dc5eef5c941ded398a1f9748be0f
parent5c340463314ffec2be84d1c976140604586fa9ff
media: ov6650: Fix stored crop rectangle not in sync with hardware

The driver stores crop rectangle settings supposed to be in line with
hardware state in a device private structure.  Since the driver initial
submission, crop rectangle width and height settings are not updated
correctly when rectangle offset settings are applied on hardware.  If
an error occurs while the device is updated, the stored settings my no
longer reflect hardware state and consecutive calls to .get_selection()
as well as .get/set_fmt() may return incorrect information.  That in
turn may affect ability of a bridge device to use correct DMA transfer
settings if such incorrect informamtion on active frame format returned
by .get/set_fmt() is used.

Assuming a failed update of the device means its actual settings haven't
changed, update crop rectangle width and height settings stored in the
device private structure correctly while the rectangle offset is
successfully applied on hardware so the stored values always reflect
actual hardware state to the extent possible.

Fixes: 0fe768636fbb ("[media] SoC Camera: add driver for OV6650 sensor")
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/i2c/ov6650.c