Commit d3951cfc authored by Ezequiel Garcia's avatar Ezequiel Garcia Committed by Mauro Carvalho Chehab

media: rkvdec: Drop unneeded per_request driver-specific control flag

Currently, the drivers makes no distinction between per_request
and mandatory, as both are used in the same request validate check.

The driver only cares to know if a given control is
required to be part of a request, so only one flag is needed.
Signed-off-by: default avatarEzequiel Garcia <ezequiel@collabora.com>
Tested-by: default avatarJonas Karlman <jonas@kwiboo.se>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 46e8893e
...@@ -55,35 +55,29 @@ static const struct v4l2_ctrl_ops rkvdec_ctrl_ops = { ...@@ -55,35 +55,29 @@ static const struct v4l2_ctrl_ops rkvdec_ctrl_ops = {
static const struct rkvdec_ctrl_desc rkvdec_h264_ctrl_descs[] = { static const struct rkvdec_ctrl_desc rkvdec_h264_ctrl_descs[] = {
{ {
.per_request = true,
.mandatory = true, .mandatory = true,
.cfg.id = V4L2_CID_MPEG_VIDEO_H264_DECODE_PARAMS, .cfg.id = V4L2_CID_MPEG_VIDEO_H264_DECODE_PARAMS,
}, },
{ {
.per_request = true,
.mandatory = true, .mandatory = true,
.cfg.id = V4L2_CID_MPEG_VIDEO_H264_SPS, .cfg.id = V4L2_CID_MPEG_VIDEO_H264_SPS,
.cfg.ops = &rkvdec_ctrl_ops, .cfg.ops = &rkvdec_ctrl_ops,
}, },
{ {
.per_request = true,
.mandatory = true, .mandatory = true,
.cfg.id = V4L2_CID_MPEG_VIDEO_H264_PPS, .cfg.id = V4L2_CID_MPEG_VIDEO_H264_PPS,
}, },
{ {
.per_request = true,
.mandatory = true, .mandatory = true,
.cfg.id = V4L2_CID_MPEG_VIDEO_H264_SCALING_MATRIX, .cfg.id = V4L2_CID_MPEG_VIDEO_H264_SCALING_MATRIX,
}, },
{ {
.mandatory = true,
.cfg.id = V4L2_CID_MPEG_VIDEO_H264_DECODE_MODE, .cfg.id = V4L2_CID_MPEG_VIDEO_H264_DECODE_MODE,
.cfg.min = V4L2_MPEG_VIDEO_H264_DECODE_MODE_FRAME_BASED, .cfg.min = V4L2_MPEG_VIDEO_H264_DECODE_MODE_FRAME_BASED,
.cfg.max = V4L2_MPEG_VIDEO_H264_DECODE_MODE_FRAME_BASED, .cfg.max = V4L2_MPEG_VIDEO_H264_DECODE_MODE_FRAME_BASED,
.cfg.def = V4L2_MPEG_VIDEO_H264_DECODE_MODE_FRAME_BASED, .cfg.def = V4L2_MPEG_VIDEO_H264_DECODE_MODE_FRAME_BASED,
}, },
{ {
.mandatory = true,
.cfg.id = V4L2_CID_MPEG_VIDEO_H264_START_CODE, .cfg.id = V4L2_CID_MPEG_VIDEO_H264_START_CODE,
.cfg.min = V4L2_MPEG_VIDEO_H264_START_CODE_ANNEX_B, .cfg.min = V4L2_MPEG_VIDEO_H264_START_CODE_ANNEX_B,
.cfg.def = V4L2_MPEG_VIDEO_H264_START_CODE_ANNEX_B, .cfg.def = V4L2_MPEG_VIDEO_H264_START_CODE_ANNEX_B,
...@@ -615,7 +609,7 @@ static int rkvdec_request_validate(struct media_request *req) ...@@ -615,7 +609,7 @@ static int rkvdec_request_validate(struct media_request *req)
u32 id = ctrls->ctrls[i].cfg.id; u32 id = ctrls->ctrls[i].cfg.id;
struct v4l2_ctrl *ctrl; struct v4l2_ctrl *ctrl;
if (!ctrls->ctrls[i].per_request || !ctrls->ctrls[i].mandatory) if (!ctrls->ctrls[i].mandatory)
continue; continue;
ctrl = v4l2_ctrl_request_hdl_ctrl_find(hdl, id); ctrl = v4l2_ctrl_request_hdl_ctrl_find(hdl, id);
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
struct rkvdec_ctx; struct rkvdec_ctx;
struct rkvdec_ctrl_desc { struct rkvdec_ctrl_desc {
u32 per_request : 1;
u32 mandatory : 1; u32 mandatory : 1;
struct v4l2_ctrl_config cfg; struct v4l2_ctrl_config cfg;
}; };
......
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