summaryrefslogtreecommitdiff
path: root/drivers/staging/media/allegro-dvt/allegro-core.c
diff options
context:
space:
mode:
authorMichael Tretter <m.tretter@pengutronix.de>2020-07-13 16:42:24 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-07-19 14:00:31 +0200
commitd30e841216411cb95ffbb56252f8431fd752c54d (patch)
treed72f703d897fbf4745fca3b989d0819e4b644a48 /drivers/staging/media/allegro-dvt/allegro-core.c
parent62ed97df7dc1bbb564fcd1c4f795aaa74245c63f (diff)
media: allegro: encode bit fields separately
Even bits in bitfields do not keep their position, but move around or move to other bitfields. Therefore, the driver has to handle bitfields differently depending on the firmware version. Create separate fields for the options that have been in bitfields and handle the bitfields when encoding the message. As a side effect, this makes the messages a bit more readable. 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>
Diffstat (limited to 'drivers/staging/media/allegro-dvt/allegro-core.c')
-rw-r--r--drivers/staging/media/allegro-dvt/allegro-core.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/staging/media/allegro-dvt/allegro-core.c b/drivers/staging/media/allegro-dvt/allegro-core.c
index 1bbb44140a6c..e6d64151e4fe 100644
--- a/drivers/staging/media/allegro-dvt/allegro-core.c
+++ b/drivers/staging/media/allegro-dvt/allegro-core.c
@@ -913,10 +913,17 @@ static int fill_create_channel_param(struct allegro_channel *channel,
param->codec = channel->codec;
param->level = v4l2_level_to_mcu_level(channel->level);
param->tier = 0;
- param->sps_param = BIT(20) | 0x4a;
- param->pps_param = BIT(2);
- param->enc_option = AL_OPT_RDO_COST_MODE | AL_OPT_LF_X_TILE |
- AL_OPT_LF_X_SLICE | AL_OPT_LF;
+
+ param->log2_max_poc = 10;
+ param->log2_max_frame_num = 4;
+ param->temporal_mvp_enable = 1;
+
+ param->dbf_ovr_en = 1;
+ param->rdo_cost_mode = 1;
+ param->lf = 1;
+ param->lf_x_tile = 1;
+ param->lf_x_slice = 1;
+
param->beta_offset = -1;
param->tc_offset = -1;
param->num_slices = 1;