media: ti: cal: fix wdma irq for metadata
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Tue, 26 Apr 2022 07:06:18 +0000 (09:06 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Tue, 30 Aug 2022 12:27:05 +0000 (14:27 +0200)
commitd91105e0567dabf487f81019e8b609706334d5ed
treed06893fa44abc03bb213b9d7583751724bebc774
parent0872dc04cf65fdfaa1d67453d535f8181982848b
media: ti: cal: fix wdma irq for metadata

CAL HW interrupts are inherently racy. If we get both start and end
interrupts, we don't know what has happened: did the DMA for a single
frame start and end, or did one frame end and a new frame start?

Usually for normal pixel frames we get the interrupts separately. If
we do get both, we have to guess. The assumption in the code is that the
active vertical area is larger than the blanking vertical area, and thus
it is more likely that we get the end of the old frame and the start of
a new frame.

However, for embedded data, which is only a few lines high, we always
get both interrupts. Here the assumption is that we get both for the
same frame.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/ti/cal/cal.c