Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4543122imm; Tue, 9 Oct 2018 00:58:27 -0700 (PDT) X-Google-Smtp-Source: ACcGV60IX7Hf5D2fqQuaxg5fF5QtAx93h1jH/OU37E74JcngAWKGsNdk+sAEXBhdoCa1fm6/8Cwy X-Received: by 2002:a17:902:6686:: with SMTP id e6-v6mr26983999plk.94.1539071907162; Tue, 09 Oct 2018 00:58:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539071907; cv=none; d=google.com; s=arc-20160816; b=BsAmZBkNhkCYzrSZGswwmsrz4pFCiJ1pYIRnUwv1v6CjNr6mHZcmRBkTXr2K+usHHa ZsXpRT+ULC5Bwoq8cHPi1WeOyzS8/c8SRZlL22slXE8ROdnQNtdlSimzRXDglCRddgWT uT+bjzeq7NMwYH1n9cJZnbaY63Q2lNchT/iAzd9MH2GT8IXNCAMvsRfbsu/K6p92vbTv nsL8CQe7a8QcrtmTJbZw8Mbx99xynJAh/iX+bYG0XvIdMIlnUXrLpAQPmhoQvWmV6PDZ vVseXMun/snhuXvxqCT5/MSBfNeyq1XKraDWarKPItdU4Iybo8nPfTqN0U80qDmAiNhI +lug== 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=ql+J3uvmy9dl+3x+6WBPYHLUEBxwfNcs6/AHJC/Q4xo=; b=06HE1FmQ/s+pYqUS3+N3zx0bZqDgXH9hW9cpyVFPvb3XoI6x+NoZ/GEA+yzddbJr57 0wIbBy6iTc/Tg20ek8ZH0AGTJCnj/cRv6/lHqdXies2RT2E9VdVPm/J4pq63cp3Ka1ac SxrVpH3h7oJslEqe8jpemKh01vDGYg/R+KJKXcuc8jRhINRG5SSxpF74n2ZGxQgZukYK x8SRy0ZKEtkPS6/dAqTbAql6waLuBvyECfSzkYkl9zIamy6h+mJQ07bmDMRHvtjig3tV G1qbv44Ihjbu2Ud+Qm4PuTeJOdhaU/eQFYWb4tPyQg6cMbA5dnyQxLNLFpYefKGnDCrM 5ofw== 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 a3-v6si19093201pld.351.2018.10.09.00.58.12; Tue, 09 Oct 2018 00:58:27 -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 S1726613AbeJIPN3 (ORCPT + 99 others); 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, -- 1.9.1