OSDN Git Service

media: coda: coda_buffer_meta housekeeping fix
authorEzequiel Garcia <ezequiel@collabora.com>
Tue, 3 Nov 2020 21:32:37 +0000 (22:32 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 16 Nov 2020 09:31:16 +0000 (10:31 +0100)
commit8297ae5c29fc715d1da2e057852053dd900c99a6
tree81a2daaaec255a1bfd638c93a702ef4af30256cf
parent8cb7ebe4ebd70b33a6edb30c9984febb9947a407
media: coda: coda_buffer_meta housekeeping fix

It's possible that the VPU was initialized using just one buffer,
containing only codec headers.

In this case, right after the initialization and after updating
the FIFO read pointer, we need to iterate through all the coda_buffer_meta
and release any metas that have been already used by the VPU.

This issue is affecting indirectly the bitstream buffer fill
threshold, which depends on the meta end position of the first
queued meta, which is passed to coda_bitstream_can_fetch_past().

Without this fix, it's possible that for certain videos, the
bitstream buffer level is not filled properly, resulting in a PIC_RUN
timeout.

Reported-by: Benjamin Bara <benjamin.bara@skidata.com>
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/coda/coda-bit.c
drivers/media/platform/coda/coda.h