Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp762774imd; Thu, 1 Nov 2018 05:20:03 -0700 (PDT) X-Google-Smtp-Source: AJdET5edbny1nt6ylq4PL79fO1ppGFP0raEKYLvOZndzbCwcCVq+mmg+rZfTY4Af/RcxJKqJ0Vsf X-Received: by 2002:a62:5bc4:: with SMTP id p187-v6mr7546735pfb.94.1541074803321; Thu, 01 Nov 2018 05:20:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541074803; cv=none; d=google.com; s=arc-20160816; b=gIqMZB0US6yNaRyfTJ4dYL/mmfumY19glui4GNid8dxfbRomG1NfDihP4ocSOr3jpH n7CbSIfvYcBs3/hZb61UWSHCxdFuLblPK/NEF6f03axFQi7aVcPRxKz1aOZGaC25qEX2 U3c7jxZ46YhMCnuOg9FLG5jUj8/EHqNUWaah6/eBqG3SU9h+wnoQGL5EuLoHDvoWGp0P N0QBicNWHEAPFVeyQOvmx63qej2cRyeQ01WNDokAiG4Nwp8EmFDoW5wCSSTkyrSfThb/ W3MJD0g2ayHOcEKvYSFI9z9PgkqR13kshTQA9ZoAf+QSRXAd+jcIt0Pi/KmHVhJwoUfp H5DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=jFXrcmt0Hbu6VokRy7WOH99xBVt1l+L+FdYa6O5+ooI=; b=NBZDXZxObiDs7WC5SLsP9snM5MKBjFfjnE3DzfZ9c+PqXORvOBn3Zla/Jah8LOCVgx EglFf+NYFGCeWvtGwJalMa5gTlzoRi4xnCVWIdjajIqxM7Kika9YOhfTmxQTPgjDpqZp qF5q2jbfGKW9MHrjBB4pFv9iaXPHS+zyxF1HTiRypaQPlB43bfG5F07D14OKE22vPcfx 59G6rOps6+CxYldsTL8aG/GSso78Vv+LASSjGPbQJouxS18HmXritRFDRuq9Rw0qLBAx HQUfoZAKNs6uuidpkHeomUctnEHa1ZPxi3GWnuQc/jdXvBFhGuBscfRByV6MhF3qzkQd TeMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=endyHtCq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 188-v6si5574744pfd.19.2018.11.01.05.19.45; Thu, 01 Nov 2018 05:20:03 -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; dkim=pass header.i=@linaro.org header.s=google header.b=endyHtCq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728560AbeKAVVd (ORCPT + 99 others); Thu, 1 Nov 2018 17:21:33 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:40918 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728481AbeKAVVc (ORCPT ); Thu, 1 Nov 2018 17:21:32 -0400 Received: by mail-wm1-f65.google.com with SMTP id b203-v6so1163217wme.5 for ; Thu, 01 Nov 2018 05:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=jFXrcmt0Hbu6VokRy7WOH99xBVt1l+L+FdYa6O5+ooI=; b=endyHtCqGte9Yv+jPpo3wj4hEYa0at0+b9Y6q1/F8RJwF+xFz1L35hsD7A5mh5YkEs 628xT1zIJBcMRu3HLBdeFQ+hmTSIEG3JLKbbJs1RxrCyFK9Rb+XZl4SuOlaiCTeSITji yrtnI0mBTt67v5/CtElA33JpuljzMxV9JlJK4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=jFXrcmt0Hbu6VokRy7WOH99xBVt1l+L+FdYa6O5+ooI=; b=o1q16hvlN8X0rbVLY1MbaXmPvXHocyLVouAmNos53eUJCIpsYJRiGLz3tIxi7SZXAb F3CEozR66NhXSaKktoSuFKtXGgSAP2cLVgZZqqLow5sGEwwnZ25G3KuYZ1YdOyCYYFrw x4Mn7waQErW8U1Flkmz0NmruEHMe3aw62MiN97yRdKEor5uPKNHG7LgCXjHyXbda+5hR Kcpz7KkwjN+lwqcIGWUXJcndIqomEpL4N5h7SsbBMR1vfzW/cH9pNEjNTD5+PCpkxvGD TKBLPURti7k4TEtArtb6qKM2UgD1JeB/6duV5Z0ecFb6ErgQMNBTr8HkBz1BsQCviS1P tZqw== X-Gm-Message-State: AGRZ1gJfJoJzk8lif66tFEPAO/GOQyrq8NVyJjg91FaWNs4L/MsmZG6L oTXhjSoDOepVx9K3tNsRW7MolQ== X-Received: by 2002:a1c:154a:: with SMTP id 71-v6mr5065940wmv.83.1541074726852; Thu, 01 Nov 2018 05:18:46 -0700 (PDT) Received: from [192.168.27.209] ([37.157.136.206]) by smtp.googlemail.com with ESMTPSA id o188-v6sm2725741wmg.9.2018.11.01.05.18.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Nov 2018 05:18:45 -0700 (PDT) Subject: Re: [PATCH] media: venus: dynamic handling of bitrate To: Malathi Gottam , 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 References: <1540971728-26789-1-git-send-email-mgottam@codeaurora.org> From: Stanimir Varbanov Message-ID: <3ff2c3dd-434d-960b-6806-f4bb8ec0d954@linaro.org> Date: Thu, 1 Nov 2018 14:18:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <1540971728-26789-1-git-send-email-mgottam@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Malathi, Thanks for the patch! On 10/31/18 9:42 AM, Malathi Gottam wrote: > 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) { Hmm, hfi_session_set_property already checks the instance state so I don't think those checks are needed. Another thing is that we need to take the instance mutex to check the instance state. > + 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; > -- regards, Stan