From patchwork Mon Jul 2 11:26:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vikash Garodia X-Patchwork-Id: 10501157 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 800A16035E for ; Mon, 2 Jul 2018 11:26:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71D1028390 for ; Mon, 2 Jul 2018 11:26:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 666F8283B2; Mon, 2 Jul 2018 11:26:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B1C428346 for ; Mon, 2 Jul 2018 11:26:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965491AbeGBL0g (ORCPT ); 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 ); 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= 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 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: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There is a requirement to add frame level rate control. Signed-off-by: Vikash Garodia Nacked-by: Hans Verkuil --- 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,