Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp908835imd; Thu, 1 Nov 2018 07:26:26 -0700 (PDT) X-Google-Smtp-Source: AJdET5f2wYzk3qYiK1ExKjNHqB8TudHlvpA5SdAQHiDOc2cdHmUCkQ6ezEeZxo24OBCq51n7Rh4J X-Received: by 2002:a63:1765:: with SMTP id 37-v6mr7433815pgx.131.1541082386886; Thu, 01 Nov 2018 07:26:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541082386; cv=none; d=google.com; s=arc-20160816; b=KjRC2p7bAvpx4dKTavBak+w6r+DlYUqxn2Em+ekV8E0S8aQqdCNZaDVQX9sTw2fduY Eew5gCQjAg8y0zLAc8v9grJRgtq6WRBrxD5WpkARvsXHaYaQKLM5yeoXYzUOV2mnehIY 2otV4nJnh755Z/0d5w1w7UQP4DA/P+zaU1DOz1INWPAdhZP/T1IMugnvqoaLHtw0fzmR dyeTPKq8q+FlFHimVosqAQpe2pN0TM8lhKZIOfzQvi8DGSmvC+JvGUifVBjWrKarKzl0 Avmvjaar1R8pWSWtkSwtBdQG7OV3IsEqYy0RNJ9Y1823MJmd1DeAEoOdU2kfE5I4ZKTY Dw0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature; bh=9SspBPIkuo4F4kbDCqW0gclKEYK2WV0yu9yUECAkxd0=; b=WHzeblGmTBA1IhRWbwYIPk92URSDi3KcgDUjGwByZuXha/azi6HOnjpV+MWrLLCWi6 ss/mCj+8z8ueU4i9q6Kntfez/2ptgLr8/53hCwR/E6pEVXQlYsoi0HQfJYnyqWpWaUll xI2N+WPOzgLUqc/Ign7uu6uKUzwMDv4BcFeDNcK8rbR/hEA9GbIf30Givdnl552wWp7g B4qMvmFk4w2c2u2VKSDns713IsguWBXD8BOCLd9Xth46k0qGiVT/YexK5lNMbJcgUgB2 MFo6S2EyNnu/XGXuPveTCpLyKVLbZ5MCLoLNDRl1Z3YwbVtdqeY22cynRwgIBSg+jYjt nG2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=ktrjL4jw; dkim=pass header.i=@codeaurora.org header.s=default header.b=FyDe5ybf; 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 h3-v6si31947023pfd.228.2018.11.01.07.26.11; Thu, 01 Nov 2018 07:26:26 -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=@codeaurora.org header.s=default header.b=ktrjL4jw; dkim=pass header.i=@codeaurora.org header.s=default header.b=FyDe5ybf; 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 S1728723AbeKAX0m (ORCPT + 99 others); Thu, 1 Nov 2018 19:26:42 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:55964 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727950AbeKAX0l (ORCPT ); Thu, 1 Nov 2018 19:26:41 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8B9BB60214; Thu, 1 Nov 2018 14:23:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1541082209; bh=OvlDM/QSxP/Nzwn9QMzni2KfgMM8f9ZIGJZ01i35fb4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ktrjL4jwBgDp+prMPFX1pmiDUrptfA6mcX3OJAkCBJ9909jPWxoTxtmMAG5RGUmaS Rdj2ZMnSemy70fBXHSEMN55DB1SF0OmjTdOO9qVfTDSYFgDZwAl3GDHNOb7TVKXsX4 arRLjF3n80e/EstfizsQ67DvZXo0Rn9Ptk8XPDRo= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id D7E6360590; Thu, 1 Nov 2018 14:23:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1541082208; bh=OvlDM/QSxP/Nzwn9QMzni2KfgMM8f9ZIGJZ01i35fb4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=FyDe5ybfGmgAX1OIxvKW5tzgPKUk5i99wjJ0EmWAfOYTud7K8WF2yI1NgU525hH+O hQ8Cod4tqE1wcvsH2KBPETRgkvQeFlJ4CBV6fXDh2r/D7LJSuRkahe1CCqW4W83QwG bALMSbZLzbMmQYE350EBL3rlkOLbw7vaZQozu82s= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 01 Nov 2018 19:53:27 +0530 From: Vikash Garodia To: Tomasz Figa Cc: mgottam@codeaurora.org, Stanimir Varbanov , Hans Verkuil , Mauro Carvalho Chehab , Linux Media Mailing List , Linux Kernel Mailing List , linux-arm-msm , Alexandre Courbot , linux-media-owner@vger.kernel.org Subject: Re: [PATCH] media: venus: dynamic handling of bitrate In-Reply-To: References: <1540971728-26789-1-git-send-email-mgottam@codeaurora.org> <3ff2c3dd-434d-960b-6806-f4bb8ec0d954@linaro.org> <3364115421e89c7710725c06b820f8c6@codeaurora.org> Message-ID: X-Sender: vgarodia@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-11-01 19:23, Tomasz Figa wrote: > On Thu, Nov 1, 2018 at 10:01 PM wrote: >> >> On 2018-11-01 17:48, Stanimir Varbanov wrote: >> > 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. >> >> Yes Stan, "hfi_session_set_property" this property check the instance >> state, >> but returns EINVAL if this is set at UNINIT instance state. >> >> Controls initialization happens much earlier than session init and >> instance init. >> So the instance is still in UNINIT state which causes failure while >> setting. >> >> Through this patch we try to meet the client request of changing >> bitrate >> only >> when both planes are streamed on. > > Where does this requirement come from? It should be possible to set > the control at any time and it should apply to any encoding happening > after the control is set. > With the patch, now video driver will set the control whenever client sets and will apply to encoder. Thanks, Vikash