Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2949779ima; Mon, 22 Oct 2018 20:08:40 -0700 (PDT) X-Google-Smtp-Source: ACcGV63onHuNc6NpBuBS/OycET8RKQ8lskYi9znjm+DD4PleUbOUIDpsx8hucyWXSV9/SQNu8yB3 X-Received: by 2002:a17:902:4c85:: with SMTP id b5-v6mr37296027ple.126.1540264120346; Mon, 22 Oct 2018 20:08:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540264120; cv=none; d=google.com; s=arc-20160816; b=s/TUtZ6/7mvFfp746RJ0wujAsOaZMwBy94XX3duCEwrWdw6PZJIhxGVkuqFb2iaC1E GZDfvgEx4JKqyB1qb7rluQFJCc/OF97ss5E/0icio+XGCa6EMLcQKxB875oW06c1Qus4 ufTOCv4XJxwZopp1i6tOPo6LUQJvjgVh55meTgoVz5t/K1gfmQW+kiLygm2712j2xTBw r0Js8jsqZGFOUcb2p6EJC1AG9zCRdRfI346vrK81As844O1MiXTROuQRCatRwtm739e7 pE1slsXTW0E3gF8jvs7S58KWEabzOkFjpNq7s/UUeQdHxzTZAuuZVVvK6hNoDGdeWXxP hbzw== 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=kKjvu4olbLqWohXxpdkfNrj4VYbsEOY3MSVH0PNlsVM=; b=MZz4PBB/7avxp9I+1Svis1JM509NHPAM2KS3cEcjCNd+89G2WcKpd3Kx+SgC2AoEsa zPiBUXI5hFTRK4bB1nnXWmUt2lXdOHkaVwz7T0If+Jm6vk0ZyGsA3iNL7zLUMh+fvJlI 4Ylz8SwkaBx2B29zW6Fqq70cx1nmjRO46MZvx9Z6WI6oYeVsNqh6fVjjLvKS4d0cl2M1 4n1hlfLSKAOwCo06OzwhLR8D097CbGkazc4Gw4VGCJ5uCloBn7kuNEYmM3vQfAQn3zaD PBJL6I0jwP18IKCaz01o+OhdAfTrvr8cdcScf9b7P+IyVr7llt6E0oSGDf7GI9eg51Xn rYxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lzO5cHwJ; 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 a11-v6si36460828pgd.400.2018.10.22.20.08.23; Mon, 22 Oct 2018 20:08:40 -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=lzO5cHwJ; 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 S1727226AbeJWL2l (ORCPT + 99 others); Tue, 23 Oct 2018 07:28:41 -0400 Received: from mail-yw1-f68.google.com ([209.85.161.68]:44884 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726837AbeJWL2k (ORCPT ); Tue, 23 Oct 2018 07:28:40 -0400 Received: by mail-yw1-f68.google.com with SMTP id t78-v6so2167941ywg.11 for ; Mon, 22 Oct 2018 20:07:19 -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=kKjvu4olbLqWohXxpdkfNrj4VYbsEOY3MSVH0PNlsVM=; b=lzO5cHwJd7G06aullgDOIcnKS3GFO1b1JMKdQVDz127Lb2Y9Uzc9DIO6PrswprE9UC edVZOFSkfIsMi/Mx9WMwonkpn0NnWgPICsrgHHgMxADRKiAKZMoKN/s0/ot3clN72BpJ S+/Qgq9vL5Cb9YdBKzZybD1wr5+ZuC4KRjaNM= 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=kKjvu4olbLqWohXxpdkfNrj4VYbsEOY3MSVH0PNlsVM=; b=IFOOSZQtRSq7xlv4pzmmV8WWBlRuRIGwsX2HwftAzf4DEcLm+1zkylPALhDF3gzUPc ZnTFESPrbm1oH1KoFtJ9IKY+sXmpT7rhbImv5F4tvdWY5v3oP6jhX27D9GaU2QR3vVqY O8VcWda39W+1Fe/EV4f3R9ML0eXnJ5IDWHU725EhjX8jrw8Wie+Qddqg++GFzNIMe9W0 JqhMMZLwkQFNu149CkDjDVxYMXaBi9ySrylWJ1G6A5ruYN889jhlhl+SdhS1bFFdTUvD Qp4b93fDW1A/kkn8kPjXqcz2LxAZicq2FZ/KIBvLBrjUewqs3dchqsDKWuy25HPqza2m Aq1Q== X-Gm-Message-State: ABuFfoiM634aeGMhutorAsQ5AjLy0DMIX6gZGSCiFj+3EN2e+8xOJgKf JtIj9/4kJBrSPtixkGhGbqbF9B7Lx56ZYw== X-Received: by 2002:a81:230a:: with SMTP id j10-v6mr33400699ywj.255.1540264038824; Mon, 22 Oct 2018 20:07:18 -0700 (PDT) Received: from mail-yw1-f43.google.com (mail-yw1-f43.google.com. [209.85.161.43]) by smtp.gmail.com with ESMTPSA id h68-v6sm2210826ywd.88.2018.10.22.20.07.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Oct 2018 20:07:17 -0700 (PDT) Received: by mail-yw1-f43.google.com with SMTP id j75-v6so16864084ywj.10 for ; Mon, 22 Oct 2018 20:07:17 -0700 (PDT) X-Received: by 2002:a81:350c:: with SMTP id c12-v6mr15064278ywa.342.1540264036794; Mon, 22 Oct 2018 20:07:16 -0700 (PDT) MIME-Version: 1.0 References: <1539071634-1644-1-git-send-email-mgottam@codeaurora.org> <40d15ea4-48e2-b2c7-1d70-68dcc1b08990@linaro.org> In-Reply-To: From: Tomasz Figa Date: Tue, 23 Oct 2018 12:07:05 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] media: venus: add support for key frame To: Alexandre Courbot Cc: Stanimir Varbanov , mgottam@codeaurora.org, Hans Verkuil , Mauro Carvalho Chehab , Linux Media Mailing List , Linux Kernel Mailing List , linux-arm-msm , 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 Mon, Oct 22, 2018 at 3:15 PM Alexandre Courbot wrote: > > On Fri, Oct 12, 2018 at 5:10 PM Stanimir Varbanov > wrote: > > > > > > > > On 10/12/2018 11:06 AM, Alexandre Courbot wrote: > > > On Fri, Oct 12, 2018 at 4:37 PM Stanimir Varbanov > > > wrote: > > >> > > >> Hi Alex, > > >> > > >> On 10/12/2018 08:26 AM, Alexandre Courbot wrote: > > >>> On Tue, Oct 9, 2018 at 4:54 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 | 13 +++++++++++++ > > >>>> 1 file changed, 13 insertions(+) > > >>>> > > >>>> diff --git a/drivers/media/platform/qcom/venus/venc_ctrls.c b/drivers/media/platform/qcom/venus/venc_ctrls.c > > >>>> index 45910172..f332c8e 100644 > > >>>> --- a/drivers/media/platform/qcom/venus/venc_ctrls.c > > >>>> +++ b/drivers/media/platform/qcom/venus/venc_ctrls.c > > >>>> @@ -81,6 +81,8 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl) > > >>>> struct venc_controls *ctr = &inst->controls.enc; > > >>>> u32 bframes; > > >>>> int ret; > > >>>> + void *ptr; > > >>>> + u32 ptype; > > >>>> > > >>>> switch (ctrl->id) { > > >>>> case V4L2_CID_MPEG_VIDEO_BITRATE_MODE: > > >>>> @@ -173,6 +175,14 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl) > > >>>> > > >>>> ctr->num_b_frames = bframes; > > >>>> break; > > >>>> + case V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME: > > >>>> + ptype = HFI_PROPERTY_CONFIG_VENC_REQUEST_SYNC_FRAME; > > >>>> + ret = hfi_session_set_property(inst, ptype, ptr); > > >>> > > >>> The test bot already said it, but ptr is passed to > > >>> hfi_session_set_property() uninitialized. And as can be expected the > > >>> call returns -EINVAL on my board. > > >>> > > >>> Looking at other uses of HFI_PROPERTY_CONFIG_VENC_REQUEST_SYNC_FRAME I > > >>> see that the packet sent to the firmware does not have room for an > > >>> argument, so I tried to pass NULL but got the same result. > > >> > > >> yes, because pdata cannot be NULL. I'd suggest to make a pointer to > > >> struct hfi_enable and pass it to the set_property function. > > > > > > FWIW I also tried doing this and got the same error, strange... > > > > > > > OK, when you calling the v4l control? It makes sense when you calling > > it, because set_property checks does the session is on START state (i.e. > > streamon on both queues). > > Do you mean that the property won't be actually applied unless both > queues are streaming? In that case maybe it would make sense for the > driver to save controls set before that and apply them when the > conditions allow them to be effective? Right. The driver cannot just drop a control setting on the floor if it's not ready to apply it. However, the V4L2 control framework already provides a tool to handle this: - the driver can ignore any .s_ctrl() calls when it can't apply the controls, - the driver must call v4l2_ctrl_handler_setup() when it initialized the hardware, so that all the control values are applied in one go. Best regards, Tomasz