Message ID | 1608101388-31810-1-git-send-email-dikshita@codeaurora.org (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | [v2] venus: venc: set inband mode property to FW. | expand |
On 12/16/20 8:49 AM, Dikshita Agarwal wrote: > set HFI_PROPERTY_CONFIG_VENC_SYNC_FRAME_SEQUENCE_HEADER to FW > to support inband sequence header mode. > > Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org> > > Changes since v1: > - added codec check > - fixed the mask while initializing the control > > --- > drivers/media/platform/qcom/venus/venc_ctrls.c | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/platform/qcom/venus/venc_ctrls.c b/drivers/media/platform/qcom/venus/venc_ctrls.c > index cf860e6..a94f5fd 100644 > --- a/drivers/media/platform/qcom/venus/venc_ctrls.c > +++ b/drivers/media/platform/qcom/venus/venc_ctrls.c > @@ -157,7 +157,17 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl) > ctr->h264_loop_filter_mode = ctrl->val; > break; > case V4L2_CID_MPEG_VIDEO_HEADER_MODE: > - ctr->header_mode = ctrl->val; > + if (inst->fmt_cap->pixfmt == V4L2_PIX_FMT_H264 || > + inst->fmt_cap->pixfmt == V4L2_PIX_FMT_HEVC) { > + if (ctrl->val == V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE) > + en.enable = 0; > + else > + en.enable = 1; > + ptype = HFI_PROPERTY_CONFIG_VENC_SYNC_FRAME_SEQUENCE_HEADER; > + ret = hfi_session_set_property(inst, ptype, &en); > + if (ret) > + return ret; > + } I see NULL pointer dereference in this code snippet. Please take as reference the implementation of V4L2_CID_MPEG_VIDEO_BITRATE from the same function (venc_op_s_ctrl). > break; > case V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB: > break; > @@ -289,7 +299,8 @@ int venc_ctrl_init(struct venus_inst *inst) > v4l2_ctrl_new_std_menu(&inst->ctrl_handler, &venc_ctrl_ops, > V4L2_CID_MPEG_VIDEO_HEADER_MODE, > V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME, > - 1 << V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME, > + ~((1 << V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE) | > + (1 << V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME)), > V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE); > > v4l2_ctrl_new_std_menu(&inst->ctrl_handler, &venc_ctrl_ops, >
diff --git a/drivers/media/platform/qcom/venus/venc_ctrls.c b/drivers/media/platform/qcom/venus/venc_ctrls.c index cf860e6..a94f5fd 100644 --- a/drivers/media/platform/qcom/venus/venc_ctrls.c +++ b/drivers/media/platform/qcom/venus/venc_ctrls.c @@ -157,7 +157,17 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl) ctr->h264_loop_filter_mode = ctrl->val; break; case V4L2_CID_MPEG_VIDEO_HEADER_MODE: - ctr->header_mode = ctrl->val; + if (inst->fmt_cap->pixfmt == V4L2_PIX_FMT_H264 || + inst->fmt_cap->pixfmt == V4L2_PIX_FMT_HEVC) { + if (ctrl->val == V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE) + en.enable = 0; + else + en.enable = 1; + ptype = HFI_PROPERTY_CONFIG_VENC_SYNC_FRAME_SEQUENCE_HEADER; + ret = hfi_session_set_property(inst, ptype, &en); + if (ret) + return ret; + } break; case V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB: break; @@ -289,7 +299,8 @@ int venc_ctrl_init(struct venus_inst *inst) v4l2_ctrl_new_std_menu(&inst->ctrl_handler, &venc_ctrl_ops, V4L2_CID_MPEG_VIDEO_HEADER_MODE, V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME, - 1 << V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME, + ~((1 << V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE) | + (1 << V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME)), V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE); v4l2_ctrl_new_std_menu(&inst->ctrl_handler, &venc_ctrl_ops,
set HFI_PROPERTY_CONFIG_VENC_SYNC_FRAME_SEQUENCE_HEADER to FW to support inband sequence header mode. Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org> Changes since v1: - added codec check - fixed the mask while initializing the control --- drivers/media/platform/qcom/venus/venc_ctrls.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)