Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2321873imu; Thu, 29 Nov 2018 03:11:36 -0800 (PST) X-Google-Smtp-Source: AFSGD/VAH9TLbiQi3XyiMQHE48hE6Bl2pz0EpHgfwYME1kkWQiF5GXa1iJDFqWo/+LjyxQL9PJwG X-Received: by 2002:a63:6506:: with SMTP id z6mr860389pgb.334.1543489896827; Thu, 29 Nov 2018 03:11:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543489896; cv=none; d=google.com; s=arc-20160816; b=0YwIbe4AcQdNt/oeclsi9mxjye/UI+rZnHFCafA4Uonux1FWheBmJzcvaSED3LSbSY 3s3sQ1JZ1Ig0m+rBMEq+JcEfMA2wC4UWRpZwqCAsJErE+M0up/9b5XJkrFj76KgKSJUi JF2rpE+a5blRO+vExCh8+NhzYkJs8hNAip6YGVEsGHYEVCZ8Rrp29g6hIMsbYrxU/wVo DXBavd5iduvdHuxWKyWi6U1GCnz4GEe9D/hXpKkY28AGgpJ5H/b5W74+ZHsIuh+d2IhB txHgukHmtx6tN2CsU2bzdBo4UK0w6Y1wNlOOOeiP8NQerMxYXDybkIaPNSBQj5FwiiTN IdgQ== 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=O6BfYZIdoYANpV4M3lmoJs7Eq7lsXlOOlfTa0YnTHdk=; b=xqVQlaEdUh5Y0zWpXo/w/9FLilX1nsxtblWFcBeG8itLY7PpZ6ZbgQG8EpyBe1dGSv yl8ULUaQsz05cW0dkG536QpzltYJaRlG7M9v9vsdH1LEcBL087Mvdm47hnGdnjxjJNqY Tp4jS3OA/G7rBxeWyLmKAO9qgogzNVyTvn25uMYTA8a64q8HL7HDR2z2ES5zxmKl66G0 FNWifHirkhWREUiBSbhzHX4I+ve8cUNl5BBBlvoOXUANzNyvN5ipvuL32cYM0waOsOJp PgoQtnekhM+i/ukiFdyJW0J4ghpGqL7ibQhgybvNrX+7k8LueKrcASDsO/IQQ+EeGCFf OCWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=VbSrIVfG; dkim=pass header.i=@codeaurora.org header.s=default header.b=DZdQmYDs; 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 v8si1851783ply.126.2018.11.29.03.11.20; Thu, 29 Nov 2018 03:11:36 -0800 (PST) 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=VbSrIVfG; dkim=pass header.i=@codeaurora.org header.s=default header.b=DZdQmYDs; 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 S1728016AbeK2WPm (ORCPT + 99 others); Thu, 29 Nov 2018 17:15:42 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:53748 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727262AbeK2WPm (ORCPT ); Thu, 29 Nov 2018 17:15:42 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 0EC2B6130B; Thu, 29 Nov 2018 11:10:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1543489841; bh=t45rxi35F0hkWa+QTei+RUEf69X09ASWRlL+LGfFHBo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=VbSrIVfGsFxnmw2YR9aVC9cc8f723VL7ELoFUzMYeS4+MQEZ1VRAwaAtYlHE1VyC3 AeyMf6evLSGI4aAYXmbXlQhTgoZmc2s33QmFA8KzjDT5aum77+ly4AyUFOTSkGw4Uv 0ETDGN9tlXTOpMtt99ZGMTyIb4TKlzHNUC/7cWlE= 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 DAD9E6143E; Thu, 29 Nov 2018 11:10:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1543489837; bh=t45rxi35F0hkWa+QTei+RUEf69X09ASWRlL+LGfFHBo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=DZdQmYDsPAGBGrkoFczi9C3PCpDl04EtdJZ5v8Rvo93LXdzCwwZQ/Ssj84qaQRJeQ XnU40JFeOWMsll3qDGum7AJAiRJt8CEdvjwEZwc8W7IUznp5UrzL9EbrVPNsyq1WQj hcRbT3ccHJD2gAxsPqv4uVqOT2Jh4h7jfibK+PAs= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 29 Nov 2018 16:40:36 +0530 From: mgottam@codeaurora.org To: Stanimir Varbanov Cc: Tomasz Figa , Hans Verkuil , Mauro Carvalho Chehab , Linux Media Mailing List , Linux Kernel Mailing List , linux-arm-msm , Alexandre Courbot , vgarodia@codeaurora.org Subject: Re: [PATCH v3] media: venus: add support for key frame In-Reply-To: <4767b56f-420b-dc0c-0ae9-44dbf6dcd0b1@linaro.org> References: <1541163476-23249-1-git-send-email-mgottam@codeaurora.org> <4767b56f-420b-dc0c-0ae9-44dbf6dcd0b1@linaro.org> Message-ID: <6d765e0d7d6b873e087a3db823cb1b29@codeaurora.org> X-Sender: mgottam@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 Hi Stan, On 2018-11-29 16:01, Stanimir Varbanov wrote: > Hi Tomasz, > > On 11/3/18 5:01 AM, Tomasz Figa wrote: >> Hi Malathi, >> >> On Fri, Nov 2, 2018 at 9:58 PM Malathi Gottam >> wrote: >>> >>> When client requests for a keyframe, set the property >>> to hardware to generate the sync frame. >>> >>> Signed-off-by: Malathi Gottam >>> --- >>> drivers/media/platform/qcom/venus/venc_ctrls.c | 20 >>> +++++++++++++++++++- >>> 1 file changed, 19 insertions(+), 1 deletion(-) >>> >>> diff --git a/drivers/media/platform/qcom/venus/venc_ctrls.c >>> b/drivers/media/platform/qcom/venus/venc_ctrls.c >>> index 45910172..59fe7fc 100644 >>> --- a/drivers/media/platform/qcom/venus/venc_ctrls.c >>> +++ b/drivers/media/platform/qcom/venus/venc_ctrls.c >>> @@ -79,8 +79,10 @@ 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_enable en = { .enable = 1 }; >>> u32 bframes; >>> int ret; >>> + u32 ptype; >>> >>> switch (ctrl->id) { >>> case V4L2_CID_MPEG_VIDEO_BITRATE_MODE: >>> @@ -173,6 +175,19 @@ static int venc_op_s_ctrl(struct v4l2_ctrl >>> *ctrl) >>> >>> ctr->num_b_frames = bframes; >>> break; >>> + case V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME: >>> + mutex_lock(&inst->lock); >>> + if (inst->streamon_out && inst->streamon_cap) { >> >> We had a discussion on this in v2. I don't remember seeing any >> conclusion. >> >> Obviously the hardware should generate a keyframe naturally when the >> CAPTURE streaming starts, which is where the encoding starts, but the >> state of the OUTPUT queue should not affect this. >> >> The application is free to stop and start streaming on the OUTPUT >> queue as it goes and it shouldn't imply any side effects in the >> encoded bitstream (e.g. a keyframe inserted). So: >> - a sequence of STREAMOFF(OUTPUT), >> S_CTRL(V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME), STREAMON(OUTPUT) should >> explicitly generate a keyframe, > > I agree with you, but presently we don't follow strictly the stateful > encoder spec. In this spirit I think proposed patch is applicable to > the > current state of the encoder driver, and your comment should be > addressed in the follow-up patches where we have to re-factor a bit > start/stop_streaming according to the encoder documentation. > > But until then we have to get that patch. So I can see that this patch is good implementation of forcing sync frame under current encoder state. Can you please ack the same. Thanks, Malathi. > >> - a sequence of STREAMOFF(OUTPUT), STREAMON(OUTPUT) should _not_ >> explicitly generate a keyframe (the hardware may generate one, if the >> periodic keyframe counter is active or a scene detection algorithm >> decides so). >> >> Please refer to the specification (v2 is the latest for the time being >> -> https://lore.kernel.org/patchwork/patch/1002476/) for further >> details and feel free to leave any comment for it. >> >> Best regards, >> Tomasz >>