summaryrefslogtreecommitdiff
path: root/drivers/media/platform
diff options
context:
space:
mode:
authorMichael Tretter <m.tretter@pengutronix.de>2020-12-03 12:01:05 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-01-27 16:14:08 +0100
commit99b05ce74ceeb474ff4db37a0861b135063b7c7f (patch)
tree464852842cdeaacb6adb74da2ca13640e35cff48 /drivers/media/platform
parentbe7f41f2f10c8605ba4b9a5515cf449006470b90 (diff)
media: allegro: activate v4l2-ctrls only for current codec
These controls are specific to H.264 and shall only be activated, if the coded format is H.264. 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/media/platform')
-rw-r--r--drivers/media/platform/allegro-dvt/allegro-core.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/media/platform/allegro-dvt/allegro-core.c b/drivers/media/platform/allegro-dvt/allegro-core.c
index bb024cff4c7c..f3a656ab2b06 100644
--- a/drivers/media/platform/allegro-dvt/allegro-core.c
+++ b/drivers/media/platform/allegro-dvt/allegro-core.c
@@ -2105,6 +2105,7 @@ err:
static void allegro_channel_adjust(struct allegro_channel *channel)
{
struct allegro_dev *dev = channel->dev;
+ u32 codec = channel->codec;
struct v4l2_ctrl *ctrl;
s64 min;
s64 max;
@@ -2140,6 +2141,21 @@ static void allegro_channel_adjust(struct allegro_channel *channel)
ctrl->step, ctrl->default_value);
v4l2_ctrl_unlock(ctrl);
+ v4l2_ctrl_activate(channel->mpeg_video_h264_profile,
+ codec == V4L2_PIX_FMT_H264);
+ v4l2_ctrl_activate(channel->mpeg_video_h264_level,
+ codec == V4L2_PIX_FMT_H264);
+ v4l2_ctrl_activate(channel->mpeg_video_h264_i_frame_qp,
+ codec == V4L2_PIX_FMT_H264);
+ v4l2_ctrl_activate(channel->mpeg_video_h264_max_qp,
+ codec == V4L2_PIX_FMT_H264);
+ v4l2_ctrl_activate(channel->mpeg_video_h264_min_qp,
+ codec == V4L2_PIX_FMT_H264);
+ v4l2_ctrl_activate(channel->mpeg_video_h264_p_frame_qp,
+ codec == V4L2_PIX_FMT_H264);
+ v4l2_ctrl_activate(channel->mpeg_video_h264_b_frame_qp,
+ codec == V4L2_PIX_FMT_H264);
+
channel->log2_max_frame_num = LOG2_MAX_FRAME_NUM;
channel->temporal_mvp_enable = true;