Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp870961imd; Thu, 1 Nov 2018 06:55:23 -0700 (PDT) X-Google-Smtp-Source: AJdET5fPY5hNQ+IeL2k9hhJw81UrH46w2imsxofSxUQp2DjynpcNVnbSIfo7PhyYvbuT2C9sf3Hx X-Received: by 2002:a17:902:5a09:: with SMTP id q9-v6mr7829579pli.186.1541080522963; Thu, 01 Nov 2018 06:55:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541080522; cv=none; d=google.com; s=arc-20160816; b=PpY0PmDEf585eQSXyZpgzb1OvvpTQGv8i3093ic4tbrtHDlMZrBm9aUjQzw/YTN+MA EbqixGVd2z+kzgS3V++yaYhBZUsQBxJuiNyJeheemycEVdl28PqIPNID3UKa5aFarq5X ssjLkkI4E2hPmbaK5PXnvIyEV8EHl+J7gCjRFjHFXyiode+fA6Iajc7NxW7i9E+76ik3 qI4U2os12RljtJfUGCsBcxp1K0Ainkzu5mGPAT5qH7eQXY5s07j5OWZLUvDDf189ut+D TOMeA09Ly1XWN7A7zZQvbQCsiYvJiYeVszdkurzTPAeef/YrjDPOOFn03AtREw8g11mi GwpA== 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=ETzPVJMUPu1nPGTn1124ZvpKmzdt7HVej18GLODBnkw=; b=V5hhlI1cX/sORYBbVZugIijJgSlsXbNsf4lfZs33SqrJy4uwgHR8GTIB3F2cGvVBPg i9K9YfneHf9ZpYw3wadZQOCAA67tt11c/QiHm/brfJxM19ohgXs5HszzMk/GWL8pkr3e 9b14mZm1Kd8bAUME9KwUOrEA9oOdwYjfrGoHhZKFmsoO4pEfgKqbX9GmZmtU4qK2y9hO lFBPW/wBAtHJ4ISJy2FRynrAumn4LHwsmghown+PxWJV8grfKd0iDnzd48KoUTX+AS5X EldaP/fEUJ+kgaLeGimSFyL6HRAaEqUHROmFsxq4p+aS7/eFQ/WbwetX86pt2fLRcJGH tb+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Nnc4iR5p; 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 k7si763626pgm.462.2018.11.01.06.55.08; Thu, 01 Nov 2018 06:55:22 -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=Nnc4iR5p; 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 S1728918AbeKAW5N (ORCPT + 99 others); Thu, 1 Nov 2018 18:57:13 -0400 Received: from mail-yw1-f66.google.com ([209.85.161.66]:33472 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728847AbeKAW5M (ORCPT ); Thu, 1 Nov 2018 18:57:12 -0400 Received: by mail-yw1-f66.google.com with SMTP id z72-v6so3642869ywa.0 for ; Thu, 01 Nov 2018 06:54:08 -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=ETzPVJMUPu1nPGTn1124ZvpKmzdt7HVej18GLODBnkw=; b=Nnc4iR5pKzPoEspUSoX8zD14K4ug/qAW9FYMwtcleLvPFaXAQjkE9IRH1YXUgk9Flx OFqX4fzItAIM03BqYcZ5Wruzl4CY7fL8pnqVpU5uHySM85Iv0Mqg00lP22pnugdlwXiQ xyBCbdZNjqH2fGiqxTE1CK4RtaT97vcLvknwA= 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=ETzPVJMUPu1nPGTn1124ZvpKmzdt7HVej18GLODBnkw=; b=aaL/phcAV2wFGFw5KYMW3QsVPvthZZYMK9FyJTHJkgfSh+MYi4Vr+pIVe0eyMVo/XC aUKe5XXcg0iZ6j3iMvICXLCnlA9hyRXgf9E0oJsz9b9QaKnGQgp7shg6pEcyFsicN7Bf GeMdNAmG9Ooe9AnHj6yQxT99Xk2RZThX49tAhE4axNF9/zHdHkVyNygNdbnKWb3gZVYr Ee5uDboHb/VTQmqul+zHbjlQTb0UskPiF+7hS3aI2g5HDQxvmTCrYZ2r3JlTMOJVn7RJ 4kwbbZw1lXKSviZWWFex/R3i5DVnX+oC8tmnB9SM6W5dE9zX1cRcOFLp7/IADAIVNQSP C5nQ== X-Gm-Message-State: AGRZ1gKnu/ktML9yTKl125qbfHH7JsptHlT/W0fQSnA9q75MSny5vqQW rlXn8UNJlbuV7HMJwkw7Qkdog7jYQ9w= X-Received: by 2002:a0d:ec55:: with SMTP id v82-v6mr7424882ywe.384.1541080447338; Thu, 01 Nov 2018 06:54:07 -0700 (PDT) Received: from mail-yw1-f41.google.com (mail-yw1-f41.google.com. [209.85.161.41]) by smtp.gmail.com with ESMTPSA id 207-v6sm9012798yww.21.2018.11.01.06.54.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Nov 2018 06:54:05 -0700 (PDT) Received: by mail-yw1-f41.google.com with SMTP id f192-v6so244843ywh.7 for ; Thu, 01 Nov 2018 06:54:05 -0700 (PDT) X-Received: by 2002:a0d:fd82:: with SMTP id n124-v6mr784510ywf.443.1541080445030; Thu, 01 Nov 2018 06:54:05 -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: <3364115421e89c7710725c06b820f8c6@codeaurora.org> From: Tomasz Figa Date: Thu, 1 Nov 2018 22:53:53 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] media: venus: dynamic handling of bitrate To: mgottam@codeaurora.org Cc: Stanimir Varbanov , Hans Verkuil , Mauro Carvalho Chehab , Linux Media Mailing List , Linux Kernel Mailing List , linux-arm-msm , Alexandre Courbot , vgarodia@codeaurora.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 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. Best regards, Tomasz