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)
commitc32c815503fa3bfae575cf92648685c30796f448
tree77138d1ba83fffbeb0dc8f931800c9ef7bb7a732
parent2fc29ef598b98915ddc698c998cc33c4530b84c8
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