Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp5728819imd; Wed, 31 Oct 2018 00:45:28 -0700 (PDT) X-Google-Smtp-Source: AJdET5co9TJxYJ14mKD9YLhWx1Qun2p96rL6fnU4Jd6b12KPQVI83Ssf74VJG1mg0mjfhTbRG5EZ X-Received: by 2002:a65:6295:: with SMTP id f21-v6mr2078857pgv.167.1540971928618; Wed, 31 Oct 2018 00:45:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540971928; cv=none; d=google.com; s=arc-20160816; b=Elf7LTEthEWDFdicqs1VsBiIZzlfIqFblkpsdsBu21CDnPy/VO1DBGSEwhHtWZDmYE 7Y3glcJpETHPlvDQHoaZhlCR9f2YWO6TaWRrzaKOqAKmyR39gswhSGr+FBHTjlHwJEZh WDj3vliHXeXDakzTxayrq3Xo7/Xv654mXcsLI/f1CH+oGt/rm5o0qK3tqSwEYJmSnnLn w58fQ0276GkAzzN/h7kBw8A45x8PiP63239I8i6VqdORWtjdNQHHS2dipez2tkQB2Arz 0mIZQQFAi7yVJFSi5qlpzxSCCL5xPSuv22yhzCmbZFyM0gheZCHhD8mtp3MbtNd8Y4vz DUSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=DdZlIQJXDsqv2Dd9LNMkx23tSiXQLuzm2lBM51OecaA=; b=QbwbLK+iyOuGmWNpvbToC79an+psOzhM4JJTXWyDCokIAlukft1aGQ1lPKSDDdFYri c1qHCNQYe407rAwaJDpf/DqG2YkWPendJl+p03G5LODpBeZMxOsnQQ+MZrBtrD6K3MKw lMUIkNJtEbpTUtLhemgDRtC/fMSfyVTn/Jtd+M1YtIV9j6PIexuVXhEOd816Za4yhXWe 8KzwQP3PXXuE+bUP8t3n6mHGUodT31C7OcRlLIWhCBizk+2QRRuc0tkDJPoKYrNj3IDe I+TD6mcrwtO+SqCnAS5hLOyPAK86XsZ7ByoKu+Q2j9ihX4OJr9hinN/d7pLIWtL98RdB DPlw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g13-v6si26375402pgk.21.2018.10.31.00.45.13; Wed, 31 Oct 2018 00:45:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727518AbeJaQlI (ORCPT + 99 others); Wed, 31 Oct 2018 12:41:08 -0400 Received: from alexa-out-blr-02.qualcomm.com ([103.229.18.198]:15030 "EHLO alexa-out-blr.qualcomm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725955AbeJaQlH (ORCPT ); Wed, 31 Oct 2018 12:41:07 -0400 X-IronPort-AV: E=Sophos;i="5.54,447,1534789800"; d="scan'208";a="224103" Received: from ironmsg03-blr.qualcomm.com ([10.86.208.132]) by alexa-out-blr.qualcomm.com with ESMTP/TLS/AES256-SHA; 31 Oct 2018 13:12:11 +0530 X-IronPort-AV: E=McAfee;i="5900,7806,9062"; a="1888160" Received: from mgottam-linux.qualcomm.com ([10.204.65.20]) by ironmsg03-blr.qualcomm.com with ESMTP; 31 Oct 2018 13:12:11 +0530 Received: by mgottam-linux.qualcomm.com (Postfix, from userid 2305155) id 529433019; Wed, 31 Oct 2018 13:12:10 +0530 (IST) From: Malathi Gottam To: stanimir.varbanov@linaro.org, hverkuil@xs4all.nl, mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, acourbot@chromium.org, vgarodia@codeaurora.org, mgottam@codeaurora.org Subject: [PATCH] media: venus: dynamic handling of bitrate Date: Wed, 31 Oct 2018 13:12:08 +0530 Message-Id: <1540971728-26789-1-git-send-email-mgottam@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Any request for a change in bitrate after both planes are streamed on is handled by setting the target bitrate property to hardware. Signed-off-by: Malathi Gottam --- drivers/media/platform/qcom/venus/venc_ctrls.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/media/platform/qcom/venus/venc_ctrls.c b/drivers/media/platform/qcom/venus/venc_ctrls.c index 45910172..54f310c 100644 --- a/drivers/media/platform/qcom/venus/venc_ctrls.c +++ b/drivers/media/platform/qcom/venus/venc_ctrls.c @@ -79,7 +79,9 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl) { struct venus_inst *inst = ctrl_to_inst(ctrl); struct venc_controls *ctr = &inst->controls.enc; + struct hfi_bitrate brate; u32 bframes; + u32 ptype; int ret; switch (ctrl->id) { @@ -88,6 +90,15 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl) break; case V4L2_CID_MPEG_VIDEO_BITRATE: ctr->bitrate = ctrl->val; + if (inst->streamon_out && inst->streamon_cap) { + ptype = HFI_PROPERTY_CONFIG_VENC_TARGET_BITRATE; + brate.bitrate = ctr->bitrate; + brate.layer_id = 0; + + ret = hfi_session_set_property(inst, ptype, &brate); + if (ret) + return ret; + } break; case V4L2_CID_MPEG_VIDEO_BITRATE_PEAK: ctr->bitrate_peak = ctrl->val; -- 1.9.1