From patchwork Tue Oct 9 07:51:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malathi Gottam X-Patchwork-Id: 10632093 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 78BC6933 for ; Tue, 9 Oct 2018 07:57:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D6E828B40 for ; Tue, 9 Oct 2018 07:57:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5FD1228B45; Tue, 9 Oct 2018 07:57:51 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham 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 0138228B40 for ; Tue, 9 Oct 2018 07:57:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725965AbeJIPN3 (ORCPT ); Tue, 9 Oct 2018 11:13:29 -0400 Received: from alexa-out-blr-01.qualcomm.com ([103.229.18.197]:36315 "EHLO alexa-out-blr-01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725855AbeJIPN3 (ORCPT ); Tue, 9 Oct 2018 11:13:29 -0400 X-Greylist: delayed 380 seconds by postgrey-1.27 at vger.kernel.org; Tue, 09 Oct 2018 11:13:27 EDT X-IronPort-AV: E=Sophos;i="5.54,359,1534789800"; d="scan'208";a="240321" Received: from ironmsg03-blr.qualcomm.com ([10.86.208.132]) by alexa-out-blr-01.qualcomm.com with ESMTP/TLS/AES256-SHA; 09 Oct 2018 13:21:28 +0530 X-IronPort-AV: E=McAfee;i="5900,7806,9040"; a="1605172" Received: from mgottam-linux.qualcomm.com ([10.204.66.66]) by ironmsg03-blr.qualcomm.com with ESMTP; 09 Oct 2018 13:21:26 +0530 Received: by mgottam-linux.qualcomm.com (Postfix, from userid 2305155) id A540D2E3B; Tue, 9 Oct 2018 13:21:25 +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: handle peak bitrate set property Date: Tue, 9 Oct 2018 13:21:23 +0530 Message-Id: <1539071483-1371-1-git-send-email-mgottam@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Max bitrate property is not supported for venus version 4xx. Add a version check for the same. Signed-off-by: Malathi Gottam --- drivers/media/platform/qcom/venus/venc.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index ef11495..3f50cd0 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -757,18 +757,20 @@ static int venc_set_properties(struct venus_inst *inst) if (ret) return ret; - if (!ctr->bitrate_peak) - bitrate *= 2; - else - bitrate = ctr->bitrate_peak; + if (!IS_V4(inst->core)) { + if (!ctr->bitrate_peak) + bitrate *= 2; + else + bitrate = ctr->bitrate_peak; - ptype = HFI_PROPERTY_CONFIG_VENC_MAX_BITRATE; - brate.bitrate = bitrate; - brate.layer_id = 0; + ptype = HFI_PROPERTY_CONFIG_VENC_MAX_BITRATE; + brate.bitrate = bitrate; + brate.layer_id = 0; - ret = hfi_session_set_property(inst, ptype, &brate); - if (ret) - return ret; + ret = hfi_session_set_property(inst, ptype, &brate); + if (ret) + return ret; + } if (inst->fmt_cap->pixfmt == V4L2_PIX_FMT_H264) { profile = venc_v4l2_to_hfi(V4L2_CID_MPEG_VIDEO_H264_PROFILE,