Commit e7cd9098 authored by Michael Tretter's avatar Michael Tretter Committed by Mauro Carvalho Chehab

media: allegro: fix log2_max_poc in firmware 2019.1

The log2_max_poc field is used to set log2_max_pic_order_cnt_lsb_minus4
for the coded stream. It has an allowed range of 0 to 12.

param contains the value without the minus4, but since firmware
version 2019.1, the value has to be log2_max_pic_order_cnt_lsb - 1,
presumably to fit the maximum value of 16 into a 4 bit field.

The driver does not support firmware version 2019.1. Thus, change the
behaviour starting from firmware version 2019.2.
Signed-off-by: default avatarMichael Tretter <m.tretter@pengutronix.de>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 83a4b7fd
...@@ -109,8 +109,11 @@ allegro_encode_config_blob(u32 *dst, struct create_channel_param *param) ...@@ -109,8 +109,11 @@ allegro_encode_config_blob(u32 *dst, struct create_channel_param *param)
val = 0; val = 0;
val |= param->temporal_mvp_enable ? BIT(20) : 0; val |= param->temporal_mvp_enable ? BIT(20) : 0;
val |= FIELD_PREP(GENMASK(7, 4), param->log2_max_frame_num) | val |= FIELD_PREP(GENMASK(7, 4), param->log2_max_frame_num);
FIELD_PREP(GENMASK(3, 0), param->log2_max_poc); if (version >= MCU_MSG_VERSION_2019_2)
val |= FIELD_PREP(GENMASK(3, 0), param->log2_max_poc - 1);
else
val |= FIELD_PREP(GENMASK(3, 0), param->log2_max_poc);
dst[i++] = val; dst[i++] = val;
val = 0; val = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment