Message ID | 1530530783-9480-1-git-send-email-vgarodia@codeaurora.org (mailing list archive) |
---|---|
State | Rejected, archived |
Headers |
Received: from vger.kernel.org ([209.132.180.67]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from <linux-media-owner@vger.kernel.org>) id 1fZwyn-0003FD-Mw; Mon, 02 Jul 2018 11:26:50 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965491AbeGBL0g (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Mon, 2 Jul 2018 07:26:36 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:58960 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965489AbeGBL0f (ORCPT <rfc822; linux-media@vger.kernel.org>); Mon, 2 Jul 2018 07:26:35 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8A30C607DC; Mon, 2 Jul 2018 11:26:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1530530794; bh=P0fr4zYFEgin6y0TpVeJrWqZmmx1EoMIGFbF+yv0lnQ=; h=From:To:Cc:Subject:Date:From; b=GkCwuAPEOnTgIHHMfG3i3l2cqy+gXd9yJQX6NP7eUqqihTp8VpCbr3SADpVNiuj+l 0p7Jf9PuLTjQ7MCAZShXUwqAPWb8OYPQNWYrcDAT8tO/1THyTYMA3qzoS/OvzJ0gpl cnwTZ0J1BvKXL+lF5WCLJtFpNZvQ5NiOiGasjhX0= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from vgarodia-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: vgarodia@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 26F3D605A4; Mon, 2 Jul 2018 11:26:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1530530794; bh=P0fr4zYFEgin6y0TpVeJrWqZmmx1EoMIGFbF+yv0lnQ=; h=From:To:Cc:Subject:Date:From; b=GkCwuAPEOnTgIHHMfG3i3l2cqy+gXd9yJQX6NP7eUqqihTp8VpCbr3SADpVNiuj+l 0p7Jf9PuLTjQ7MCAZShXUwqAPWb8OYPQNWYrcDAT8tO/1THyTYMA3qzoS/OvzJ0gpl cnwTZ0J1BvKXL+lF5WCLJtFpNZvQ5NiOiGasjhX0= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 26F3D605A4 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=vgarodia@codeaurora.org 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 Message-Id: <1530530783-9480-1-git-send-email-vgarodia@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org |
Commit Message
Vikash Garodia
July 2, 2018, 11:26 a.m. UTC
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(+)
Comments
On 02/07/18 13:26, Vikash Garodia wrote: > 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, No, that's not how you do this. See venc_ctrls.c on how to handle controls. Nacked-by: Hans Verkuil <hans.verkuil@cisco.com> Regards, Hans > .vidioc_enum_framesizes = venc_enum_framesizes, > .vidioc_enum_frameintervals = venc_enum_frameintervals, > .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, >
Hi Vikash, Thank you for the patch! Yet something to improve: [auto build test ERROR on linuxtv-media/master] [also build test ERROR on v4.18-rc3 next-20180702] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Vikash-Garodia/venus-venc-add-support-for-ext-controls/20180702-213140 base: git://linuxtv.org/media_tree.git master config: i386-allmodconfig (attached as .config) compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=i386 All errors (new ones prefixed by >>): >> drivers/media/platform/qcom/venus/venc.c:653:3: error: 'const struct v4l2_ioctl_ops' has no member named 'vidioc_s_ext_ctrl'; did you mean 'vidioc_s_ext_ctrls'? .vidioc_s_ext_ctrl = venc_s_ext_ctrls, ^~~~~~~~~~~~~~~~~ vidioc_s_ext_ctrls >> drivers/media/platform/qcom/venus/venc.c:653:23: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init] .vidioc_s_ext_ctrl = venc_s_ext_ctrls, ^~~~~~~~~~~~~~~~ drivers/media/platform/qcom/venus/venc.c:653:23: note: (near initialization for 'venc_ioctl_ops') >> drivers/media/platform/qcom/venus/venc.c:653:23: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types] drivers/media/platform/qcom/venus/venc.c:653:23: note: (near initialization for 'venc_ioctl_ops.vidioc_try_fmt_vid_out_mplane') cc1: some warnings being treated as errors vim +653 drivers/media/platform/qcom/venus/venc.c 629 630 static const struct v4l2_ioctl_ops venc_ioctl_ops = { 631 .vidioc_querycap = venc_querycap, 632 .vidioc_enum_fmt_vid_cap_mplane = venc_enum_fmt, 633 .vidioc_enum_fmt_vid_out_mplane = venc_enum_fmt, 634 .vidioc_s_fmt_vid_cap_mplane = venc_s_fmt, 635 .vidioc_s_fmt_vid_out_mplane = venc_s_fmt, 636 .vidioc_g_fmt_vid_cap_mplane = venc_g_fmt, 637 .vidioc_g_fmt_vid_out_mplane = venc_g_fmt, 638 .vidioc_try_fmt_vid_cap_mplane = venc_try_fmt, 639 .vidioc_try_fmt_vid_out_mplane = venc_try_fmt, 640 .vidioc_g_selection = venc_g_selection, 641 .vidioc_s_selection = venc_s_selection, 642 .vidioc_reqbufs = v4l2_m2m_ioctl_reqbufs, 643 .vidioc_querybuf = v4l2_m2m_ioctl_querybuf, 644 .vidioc_create_bufs = v4l2_m2m_ioctl_create_bufs, 645 .vidioc_prepare_buf = v4l2_m2m_ioctl_prepare_buf, 646 .vidioc_qbuf = v4l2_m2m_ioctl_qbuf, 647 .vidioc_expbuf = v4l2_m2m_ioctl_expbuf, 648 .vidioc_dqbuf = v4l2_m2m_ioctl_dqbuf, 649 .vidioc_streamon = v4l2_m2m_ioctl_streamon, 650 .vidioc_streamoff = v4l2_m2m_ioctl_streamoff, 651 .vidioc_s_parm = venc_s_parm, 652 .vidioc_g_parm = venc_g_parm, > 653 .vidioc_s_ext_ctrl = venc_s_ext_ctrls, 654 .vidioc_enum_framesizes = venc_enum_framesizes, 655 .vidioc_enum_frameintervals = venc_enum_frameintervals, 656 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, 657 .vidioc_unsubscribe_event = v4l2_event_unsubscribe, 658 }; 659 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Hi Vikash, Thank you for the patch! Yet something to improve: [auto build test ERROR on linuxtv-media/master] [also build test ERROR on v4.18-rc3 next-20180702] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Vikash-Garodia/venus-venc-add-support-for-ext-controls/20180702-213140 base: git://linuxtv.org/media_tree.git master config: ia64-allmodconfig (attached as .config) compiler: ia64-linux-gcc (GCC) 8.1.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree GCC_VERSION=8.1.0 make.cross ARCH=ia64 All errors (new ones prefixed by >>): drivers/media/platform/qcom/venus/venc.c:653:3: error: 'const struct v4l2_ioctl_ops' has no member named 'vidioc_s_ext_ctrl'; did you mean 'vidioc_s_ext_ctrls'? .vidioc_s_ext_ctrl = venc_s_ext_ctrls, ^~~~~~~~~~~~~~~~~ vidioc_s_ext_ctrls >> drivers/media/platform/qcom/venus/venc.c:653:23: error: initialization of 'int (*)(struct file *, void *, struct v4l2_streamparm *)' from incompatible pointer type 'int (*)(struct file *, void *, struct v4l2_ext_controls *)' [-Werror=incompatible-pointer-types] .vidioc_s_ext_ctrl = venc_s_ext_ctrls, ^~~~~~~~~~~~~~~~ drivers/media/platform/qcom/venus/venc.c:653:23: note: (near initialization for 'venc_ioctl_ops.vidioc_s_parm') cc1: some warnings being treated as errors vim +653 drivers/media/platform/qcom/venus/venc.c 629 630 static const struct v4l2_ioctl_ops venc_ioctl_ops = { 631 .vidioc_querycap = venc_querycap, 632 .vidioc_enum_fmt_vid_cap_mplane = venc_enum_fmt, 633 .vidioc_enum_fmt_vid_out_mplane = venc_enum_fmt, 634 .vidioc_s_fmt_vid_cap_mplane = venc_s_fmt, 635 .vidioc_s_fmt_vid_out_mplane = venc_s_fmt, 636 .vidioc_g_fmt_vid_cap_mplane = venc_g_fmt, 637 .vidioc_g_fmt_vid_out_mplane = venc_g_fmt, 638 .vidioc_try_fmt_vid_cap_mplane = venc_try_fmt, 639 .vidioc_try_fmt_vid_out_mplane = venc_try_fmt, 640 .vidioc_g_selection = venc_g_selection, 641 .vidioc_s_selection = venc_s_selection, 642 .vidioc_reqbufs = v4l2_m2m_ioctl_reqbufs, 643 .vidioc_querybuf = v4l2_m2m_ioctl_querybuf, 644 .vidioc_create_bufs = v4l2_m2m_ioctl_create_bufs, 645 .vidioc_prepare_buf = v4l2_m2m_ioctl_prepare_buf, 646 .vidioc_qbuf = v4l2_m2m_ioctl_qbuf, 647 .vidioc_expbuf = v4l2_m2m_ioctl_expbuf, 648 .vidioc_dqbuf = v4l2_m2m_ioctl_dqbuf, 649 .vidioc_streamon = v4l2_m2m_ioctl_streamon, 650 .vidioc_streamoff = v4l2_m2m_ioctl_streamoff, 651 .vidioc_s_parm = venc_s_parm, 652 .vidioc_g_parm = venc_g_parm, > 653 .vidioc_s_ext_ctrl = venc_s_ext_ctrls, 654 .vidioc_enum_framesizes = venc_enum_framesizes, 655 .vidioc_enum_frameintervals = venc_enum_frameintervals, 656 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, 657 .vidioc_unsubscribe_event = v4l2_event_unsubscribe, 658 }; 659 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
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,