Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp916680imd; Thu, 1 Nov 2018 07:33:15 -0700 (PDT) X-Google-Smtp-Source: AJdET5cF8a/V7vRkZeQaCKOvH+mrqLfzmkNpGk0NvuP2Ld0OL7YQ2xlYg6cDZhHNwalMmnd7Ymit X-Received: by 2002:a62:83c2:: with SMTP id h185-v6mr7906412pfe.187.1541082795889; Thu, 01 Nov 2018 07:33:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541082795; cv=none; d=google.com; s=arc-20160816; b=sltPm54UTDg5xp1yPZMzv1cGuFwbKc+QDdF6z2Ndd+X/sZ+RBuFpoUnL198GAFt6q2 livS6xqIBPPVHyYq+jtM2fEMI3eL4oRVb+xgkgdjcQmYHK6zdV1xlTRgPdS0vZ4D+wGq Gamj7CfBLsKznrf8FZ5Fap8f74+l6VFD9GBIJ+TT2hry7mHlCO3uteBAMZm0bqW4BIvJ fIpjqvSw3TgJiFqsNl88xdaC2QfZrrFdRGWWvzx5eOahXpyEmripj0/Pf6/LnWNkybrt 8UE3T9EXX8XItuK083joblOt5Fr0BIFZkPXF69vWgMJ79eWK1Tb6jN0XUARcqF7cZkL2 mEAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Mt/1G68mUgUFqNWUpBHL3CxO8gcc9613By/+y7nYDwY=; b=EHlot/XoqJ2fKW/lHMARHyUega5qucPjOXjaGxFgtFyyeNmn7oiVOtHOWJwp+ihxxo oY7w1LbXNn1994iBZaffCYBswe0H9GW4jGiRI/MI3ScHDkbsUtvvaqx1+u2XC//HGMiY HHUm5B8TIcg/4YyfZOeJS/HI2nYK+v1XyUZ7ZldjIsD4nzvqoRcLfMfVkpEZYn7Q7qgP MPAMZB3YZ9Ltr9ke/FPlmnFnS3DjBnkG0Kpyiy5azX1ZfM9yivmjeAzZvJ/kfvrYzXru AyFJ5vxxc6nob4ZoqKFCADu3XeCCTpe3E2V8lkr274VftWBfXz9wWh4dx0SdVXKxnvEp vj3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YM3Dljt1; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k71si17754117pgd.351.2018.11.01.07.32.59; Thu, 01 Nov 2018 07:33:15 -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=@chromium.org header.s=google header.b=YM3Dljt1; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728758AbeKAXf0 (ORCPT + 99 others); Thu, 1 Nov 2018 19:35:26 -0400 Received: from mail-yw1-f68.google.com ([209.85.161.68]:34316 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728626AbeKAXf0 (ORCPT ); Thu, 1 Nov 2018 19:35:26 -0400 Received: by mail-yw1-f68.google.com with SMTP id v199-v6so7979428ywg.1 for ; Thu, 01 Nov 2018 07:32:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Mt/1G68mUgUFqNWUpBHL3CxO8gcc9613By/+y7nYDwY=; b=YM3Dljt1Zch4O6HF0kE5WjrJE6x4J+L4HfIyeufpC+xAoApc6zS0uwRinYbPtnUmpw pRNqad3nrouZU0y7pj2P7KyqZ3lpEt3WhbMoWhWD6aeN4/rt3L4eL+7iWFu1LLTlwQ4E cMtd2fo8lxk35H6AWgkSl+OVyJlhW1T6ToC+U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Mt/1G68mUgUFqNWUpBHL3CxO8gcc9613By/+y7nYDwY=; b=C7draCwwnKs3x+g7lO7hFKpzF0iQTT7j+CDm4ISt318Y2XDb0v5pWiGaA3fuJqITlE tQFkwkNiY2aER4pwHr5/xW+2ZBMOiRxSY/uU6t5ukB+8AzgJICJnG28zR8GvbDRxpYHX xusG+VLH4y4ObXWCA5eoJ7fwBTJBRtgaauIjVAUVHnQBkT+0QXuvKzemnu5Canr20hCC 8PpBzmD6l1l895bl+RmyfM0wRCbifQfXPtuSfBekHk5w6rSE8nmCfKFpxD87yBI8tc4l T5qYafzii4CZPiZ4y5GLL3wylhDjpElFTTm6nmNikakkyu7i9DEuBTGxjhovjtUCCD/Y 5nRA== X-Gm-Message-State: AGRZ1gLzgrMlRe6ibOdnSCZ63Ffm/PavNPaGMovaDquj9VkdPxID3DeD LrLRYIpEoEfP5rnCchXfX8tbMizgzws= X-Received: by 2002:a0d:ff46:: with SMTP id p67-v6mr7751700ywf.338.1541082732105; Thu, 01 Nov 2018 07:32:12 -0700 (PDT) Received: from mail-yb1-f174.google.com (mail-yb1-f174.google.com. [209.85.219.174]) by smtp.gmail.com with ESMTPSA id k85-v6sm7644720ywa.76.2018.11.01.07.32.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Nov 2018 07:32:11 -0700 (PDT) Received: by mail-yb1-f174.google.com with SMTP id g9-v6so8179698ybh.7 for ; Thu, 01 Nov 2018 07:32:10 -0700 (PDT) X-Received: by 2002:a25:f626:: with SMTP id t38-v6mr7863016ybd.285.1541082729784; Thu, 01 Nov 2018 07:32:09 -0700 (PDT) MIME-Version: 1.0 References: <1540971728-26789-1-git-send-email-mgottam@codeaurora.org> <3ff2c3dd-434d-960b-6806-f4bb8ec0d954@linaro.org> <3364115421e89c7710725c06b820f8c6@codeaurora.org> In-Reply-To: From: Tomasz Figa Date: Thu, 1 Nov 2018 23:31:57 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] media: venus: dynamic handling of bitrate To: vgarodia@codeaurora.org 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 1, 2018 at 11:23 PM Vikash Garodia wrote: > > 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. That's good, thanks for clarifying. I guess I misunderstood Malathi's comment. Best regards, Tomasz