OSDN Git Service

media: atmel: atmel-isc: reworked white balance feature
authorEugen Hristev <eugen.hristev@microchip.com>
Mon, 15 Apr 2019 14:13:49 +0000 (10:13 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 21 May 2019 11:14:02 +0000 (07:14 -0400)
commit73c1a577b83999f3bd208bbc6955f21d82b7f9ac
treebade54f769b99228a08d9c01c0d6a6ffc532829d
parenta188339ca5a396acc588e5851ed7e19f66b0ebd9
media: atmel: atmel-isc: reworked white balance feature

Reworked auto white balance feature (awb) to cope with all four channels.
Implemented stretching and grey world algorithms.
Using the histogram, the ISC will auto adjust the white balance during
frame captures.
Because each histogram needs a frame, it will take 4 frames for one adjustment.
When the gains were updated by previous code, the registers for the gains
were updated only on new streaming start. Now, after each full histogram the
registers are updated with new gains.
Also, on previous code, if the streaming stopped but not all 3 histograms
finished, a new histogram was started either way. This used to lead to an
error "timeout to update profile" when streaming was stopped.
According to the hardware, histogram can only work together with the capture,
not independently.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/atmel/atmel-isc-regs.h
drivers/media/platform/atmel/atmel-isc.c