linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanimir Varbanov <stanimir.varbanov@linaro.org>
To: Dikshita Agarwal <dikshita@codeaurora.org>,
	linux-media@vger.kernel.org, stanimir.varbanov@linaro.org
Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	vgarodia@codeaurora.org
Subject: Re: [PATCH v2] venus: venc: set inband mode property to FW.
Date: Tue, 22 Dec 2020 00:11:29 +0200	[thread overview]
Message-ID: <09c794e2-24a8-f545-dac4-39d425a1ddd3@linaro.org> (raw)
In-Reply-To: <1608101388-31810-1-git-send-email-dikshita@codeaurora.org>



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,
> 

-- 
regards,
Stan

      reply	other threads:[~2020-12-21 22:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-16  6:49 [PATCH v2] venus: venc: set inband mode property to FW Dikshita Agarwal
2020-12-21 22:11 ` Stanimir Varbanov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=09c794e2-24a8-f545-dac4-39d425a1ddd3@linaro.org \
    --to=stanimir.varbanov@linaro.org \
    --cc=dikshita@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=vgarodia@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).