]> git.baikalelectronics.ru Git - kernel.git/commit
media: allegro: fix calculation of CPB size
authorMichael Tretter <m.tretter@pengutronix.de>
Mon, 16 Mar 2020 15:26:26 +0000 (16:26 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Fri, 20 Mar 2020 08:12:37 +0000 (09:12 +0100)
commit9bec3f34b8a80743d267da20d09dd5370d9aeefd
tree77138d1ba83fffbeb0dc8f931800c9ef7bb7a732
parentc49ba5f24ec546561c98051855aa03be2b951dd8
media: allegro: fix calculation of CPB size

The cpb_size is given in kilobytes, but the bitrate is given in bits per
second. Therefore, the calculation of the initial removal delay and the
cpb size for the firmware were wrong.

Convert the bitrate to kilobytes before calculating the cpb size in 90
kHz units for sending it to the firmware. Also reuse the result for the
initial removal delay, to make it obvious that we are setting the
initial removal delay to the maximum value.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/allegro-dvt/allegro-core.c