From: Vikash Garodia <vgarodia@codeaurora.org>
To: stanimir.varbanov@linaro.org
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org, acourbot@chromium.org,
vgarodia@codeaurora.org
Subject: [PATCH] venus: venc: add support for ext controls
Date: Mon, 2 Jul 2018 16:56:23 +0530 [thread overview]
Message-ID: <1530530783-9480-1-git-send-email-vgarodia@codeaurora.org> (raw)
There is a requirement to add frame level rate control.
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
---
drivers/media/platform/qcom/venus/venc.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
index a2c6a4b..eaf2fa8 100644
--- a/drivers/media/platform/qcom/venus/venc.c
+++ b/drivers/media/platform/qcom/venus/venc.c
@@ -546,6 +546,33 @@ static int venc_g_parm(struct file *file, void *fh, struct v4l2_streamparm *a)
return 0;
}
+static int venc_s_ext_ctrls(struct file *file, void *fh,
+ struct v4l2_ext_controls *ctrl)
+{
+ struct venus_inst *inst = to_inst(file);
+ struct v4l2_ext_control *control;
+ u32 ptype, i, ret;
+ struct hfi_enable en = { .enable = 1 };
+ void *pdata = NULL;
+
+ control = ctrl->controls;
+ for (i = 0; i < ctrl->count; i++) {
+ switch (control[i].id) {
+ case V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE:
+ ptype = HFI_PROPERTY_PARAM_VENC_DISABLE_RC_TIMESTAMP;
+ en.enable = control[i].value;
+ pdata = &en;
+ break;
+ default:
+ return -EINVAL;
+ }
+ }
+ ret = hfi_session_set_property(inst, ptype, pdata);
+ if (ret)
+ return ret;
+ return 0;
+}
+
static int venc_enum_framesizes(struct file *file, void *fh,
struct v4l2_frmsizeenum *fsize)
{
@@ -638,6 +665,7 @@ static int venc_enum_frameintervals(struct file *file, void *fh,
.vidioc_streamoff = v4l2_m2m_ioctl_streamoff,
.vidioc_s_parm = venc_s_parm,
.vidioc_g_parm = venc_g_parm,
+ .vidioc_s_ext_ctrl = venc_s_ext_ctrls,
.vidioc_enum_framesizes = venc_enum_framesizes,
.vidioc_enum_frameintervals = venc_enum_frameintervals,
.vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
next reply other threads:[~2018-07-02 11:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-02 11:26 Vikash Garodia [this message]
2018-07-02 11:44 ` Hans Verkuil
2018-07-02 15:39 ` kbuild test robot
2018-07-02 17:00 ` kbuild test robot
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=1530530783-9480-1-git-send-email-vgarodia@codeaurora.org \
--to=vgarodia@codeaurora.org \
--cc=acourbot@chromium.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=stanimir.varbanov@linaro.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
all inboxes | Powered by JetHome®