video: driver: dynamic control support
- Set dynamic flag in inst database to allow dynamic setting of necessary controls. - avoid enc qbuf call routed to dec. Change-Id: I66cfcc6be86bfbfe237191a11d533ab6c9455f32 Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
부모
622febc90c
커밋
b5ce6c94cc
@@ -181,19 +181,11 @@ static struct msm_platform_inst_capability instance_data_waipio[] = {
|
||||
|
||||
{FRAME_RATE, ENC, CODECS_ALL,
|
||||
(MINIMUM_FPS << 16), (MAXIMUM_FPS << 16),
|
||||
1, (DEFAULT_FPS << 16),
|
||||
0,
|
||||
HFI_PROP_FRAME_RATE,
|
||||
CAP_FLAG_ROOT | CAP_FLAG_OUTPUT_PORT,
|
||||
{0}, {0},
|
||||
NULL, msm_vidc_set_q16},
|
||||
1, (DEFAULT_FPS << 16)},
|
||||
|
||||
{FRAME_RATE, DEC, CODECS_ALL,
|
||||
(MINIMUM_FPS << 16), (MAXIMUM_FPS << 16),
|
||||
1, (DEFAULT_FPS << 16),
|
||||
0,
|
||||
HFI_PROP_FRAME_RATE,
|
||||
CAP_FLAG_ROOT | CAP_FLAG_OUTPUT_PORT},
|
||||
1, (DEFAULT_FPS << 16)},
|
||||
|
||||
{OPERATING_RATE, ENC|DEC, CODECS_ALL,
|
||||
1, INT_MAX, 1, (DEFAULT_FPS << 16)},
|
||||
@@ -287,7 +279,7 @@ static struct msm_platform_inst_capability instance_data_waipio[] = {
|
||||
0, 0, 0, 0,
|
||||
V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME,
|
||||
HFI_PROP_REQUEST_SYNC_FRAME,
|
||||
CAP_FLAG_ROOT | CAP_FLAG_OUTPUT_PORT},
|
||||
CAP_FLAG_ROOT | CAP_FLAG_OUTPUT_PORT | CAP_FLAG_DYNAMIC_ALLOWED},
|
||||
|
||||
/* Enc: Keeping CABAC and CAVLC as same bitrate.
|
||||
* Dec: there's no use of Bitrate cap
|
||||
@@ -353,7 +345,7 @@ static struct msm_platform_inst_capability instance_data_waipio[] = {
|
||||
1, MAX_CONSTANT_QUALITY, 1, 90,
|
||||
V4L2_CID_MPEG_VIDEO_CONSTANT_QUALITY,
|
||||
HFI_PROP_CONSTANT_QUALITY,
|
||||
CAP_FLAG_OUTPUT_PORT,
|
||||
CAP_FLAG_OUTPUT_PORT | CAP_FLAG_DYNAMIC_ALLOWED,
|
||||
{BITRATE_MODE}, {0},
|
||||
NULL, msm_vidc_set_constant_quality},
|
||||
|
||||
@@ -362,7 +354,7 @@ static struct msm_platform_inst_capability instance_data_waipio[] = {
|
||||
0, INT_MAX, 1, 2 * DEFAULT_FPS - 1,
|
||||
V4L2_CID_MPEG_VIDEO_GOP_SIZE,
|
||||
HFI_PROP_MAX_GOP_FRAMES,
|
||||
CAP_FLAG_ROOT | CAP_FLAG_OUTPUT_PORT,
|
||||
CAP_FLAG_ROOT | CAP_FLAG_OUTPUT_PORT | CAP_FLAG_DYNAMIC_ALLOWED,
|
||||
{0}, {0},
|
||||
NULL, msm_vidc_set_u32},
|
||||
|
||||
@@ -1045,6 +1037,13 @@ static struct msm_platform_inst_capability instance_data_waipio[] = {
|
||||
CAP_FLAG_INPUT_PORT,
|
||||
{THUMBNAIL_MODE}},
|
||||
|
||||
{SEQ_CHANGE_AT_SYNC_FRAME, DEC, CODECS_ALL,
|
||||
V4L2_MPEG_MSM_VIDC_DISABLE, V4L2_MPEG_MSM_VIDC_ENABLE,
|
||||
1, V4L2_MPEG_MSM_VIDC_ENABLE,
|
||||
0,
|
||||
HFI_PROP_SEQ_CHANGE_AT_SYNC_FRAME,
|
||||
CAP_FLAG_INPUT_PORT | CAP_FLAG_DYNAMIC_ALLOWED},
|
||||
|
||||
{META_LTR_MARK_USE, ENC, CODECS_ALL,
|
||||
V4L2_MPEG_MSM_VIDC_DISABLE, V4L2_MPEG_MSM_VIDC_ENABLE,
|
||||
1, V4L2_MPEG_MSM_VIDC_DISABLE,
|
||||
|
@@ -13,6 +13,7 @@ int msm_venc_streamoff_input(struct msm_vidc_inst *inst);
|
||||
int msm_venc_streamon_input(struct msm_vidc_inst *inst);
|
||||
int msm_venc_streamoff_output(struct msm_vidc_inst *inst);
|
||||
int msm_venc_streamon_output(struct msm_vidc_inst *inst);
|
||||
int msm_venc_qbuf(struct msm_vidc_inst *inst, struct vb2_buffer *vb2);
|
||||
int msm_venc_process_cmd(struct msm_vidc_inst *inst, u32 cmd);
|
||||
int msm_venc_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f);
|
||||
int msm_venc_g_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f);
|
||||
|
@@ -350,6 +350,7 @@ enum msm_vidc_inst_capability_type {
|
||||
THUMBNAIL_MODE,
|
||||
DEFAULT_HEADER,
|
||||
RAP_FRAME,
|
||||
SEQ_CHANGE_AT_SYNC_FRAME,
|
||||
META_LTR_MARK_USE,
|
||||
META_DPB_MISR,
|
||||
META_OPB_MISR,
|
||||
@@ -585,12 +586,6 @@ struct msm_vidc_rectangle {
|
||||
u32 height;
|
||||
};
|
||||
|
||||
struct msm_vidc_properties {
|
||||
u32 frame_rate;
|
||||
u32 operating_rate;
|
||||
u32 bitrate;
|
||||
};
|
||||
|
||||
struct msm_vidc_subscription_params {
|
||||
u32 bitstream_resolution;
|
||||
u64 crop_offsets;
|
||||
|
@@ -836,6 +836,17 @@ error:
|
||||
return rc;
|
||||
}
|
||||
|
||||
int msm_venc_qbuf(struct msm_vidc_inst *inst, struct vb2_buffer *vb2)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
rc = msm_vidc_queue_buffer(inst, vb2);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
int msm_venc_process_cmd(struct msm_vidc_inst *inst, u32 cmd)
|
||||
{
|
||||
int rc = 0;
|
||||
|
@@ -266,8 +266,8 @@ static int msm_vidc_add_capid_to_list(struct msm_vidc_inst *inst,
|
||||
if (type & FW_LIST) {
|
||||
list_for_each_entry(curr_node, &inst->firmware.list, list) {
|
||||
if (curr_node->cap_id == cap_id) {
|
||||
i_vpr_e(inst,
|
||||
"%s: cap %d cannot be the child of two parents\n",
|
||||
i_vpr_l(inst,
|
||||
"%s: cap %d already present in FW_LIST\n",
|
||||
__func__, cap_id);
|
||||
return 0;
|
||||
}
|
||||
|
@@ -606,6 +606,7 @@ bool msm_vidc_allow_s_ctrl(struct msm_vidc_inst *inst, u32 id)
|
||||
case V4L2_CID_MPEG_VIDC_MARKLTRFRAME:
|
||||
case V4L2_CID_MPEG_VIDC_VIDEO_BLUR_TYPES:
|
||||
case V4L2_CID_MPEG_VIDC_VIDEO_BLUR_RESOLUTION:
|
||||
case V4L2_CID_MPEG_VIDEO_CONSTANT_QUALITY:
|
||||
allow = true;
|
||||
break;
|
||||
default:
|
||||
|
@@ -289,7 +289,7 @@ void msm_vidc_buf_queue(struct vb2_buffer *vb2)
|
||||
if (is_decode_session(inst))
|
||||
rc = msm_vdec_qbuf(inst, vb2);
|
||||
else if (is_encode_session(inst))
|
||||
rc = msm_vdec_qbuf(inst, vb2);
|
||||
rc = msm_venc_qbuf(inst, vb2);
|
||||
else
|
||||
rc = -EINVAL;
|
||||
|
||||
|
Reference in New Issue
Block a user