Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1867417ima; Sun, 21 Oct 2018 23:16:59 -0700 (PDT) X-Google-Smtp-Source: ACcGV63tOOaVBbO+VriSsAUQ6+M5W+CrO/Af7ptD7KnVDme2jjzbrCzFBmhnvC7sTbcMcbc/RAC+ X-Received: by 2002:a17:902:744a:: with SMTP id e10-v6mr10220972plt.61.1540189019394; Sun, 21 Oct 2018 23:16:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540189019; cv=none; d=google.com; s=arc-20160816; b=hzXHdBHSMZYj3DyWMa6TKFdxknyCktccZQc4V+avYlMSct8mMbkDrAEudmE2Dc+GW8 zuVZoBld/9oqcN4Z6Quo2+JAfgqkFG+dYqF4avBc3xilv4aihZc9h7ebnbnZWVYSHx2Z DLG1pJwNJH9DMmPxrSxil3771jdYENR5Bsh4nH3fu/LPpHXROZdCPQiI32YF96PncQOU HbiJeJJu6FUtOEZ6/81xsHzKIjWhxNBPgcEbshzjEDo7fNJ41oJmUT79yHHoc+zEADd1 elYYJVlKG+C83/jgLSC5KVf1UQNbTDlV+7DVjiz+NDWYxOe9gz/i4GJ3izFXf1o7yYWQ CjlQ== 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=Rr8ud3auYv7UA7pl8xEnAzbmFLmXE+t6cvdcTn8uo9A=; b=MQpR4rYf3IFNTftIKaf2TdKm786fhZ2NmLq0SUlAUV0UfMO5OCsDD7jDrZX9UGRu30 pqwW/rOOO4roPoEVpMHOQN4ammXD4NFUTFtuUGxB1976T73Po+UWg/O3izS8gkEaVxaM XAyLpfxNQNqIKvcdi2LR6d8KJPkmGdO7I9AEwkZVByMzHTD0HB2v2CiGmT0K8PbIANt0 UY1NlFGSBh8/VwxQSUUd/4K3osU4C/R2+7rOt25LK0dFjYr0EsaqU3tJwTRzJ8EHDbfa IjqNeeMDLNzv9cE7atjO4BPkHGkFwMAXdsDmyYAiBIlyKA4b82BvtmgMNfI6ntJ5VkD3 8bSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=BN306rLx; 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 g8-v6si31566124plt.434.2018.10.21.23.16.43; Sun, 21 Oct 2018 23:16:59 -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=BN306rLx; 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 S1727504AbeJVOcF (ORCPT + 99 others); Mon, 22 Oct 2018 10:32:05 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:37751 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727387AbeJVOcF (ORCPT ); Mon, 22 Oct 2018 10:32:05 -0400 Received: by mail-ot1-f66.google.com with SMTP id o14so38870959oth.4 for ; Sun, 21 Oct 2018 23:14:58 -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=Rr8ud3auYv7UA7pl8xEnAzbmFLmXE+t6cvdcTn8uo9A=; b=BN306rLxNh22XZfZ6n+z51i52Tbh9QnSP37iMdbBH0nlk2pXyWVFaJxTxgSGlurIAw Sdic7XM3V+Ypa1eo0XF7tIfv3pcs+5EJadaM73ZC+wxfFqlgG3SZJqhlaTzHZ48PEvVT ndEQvqpq0JymO8MZX5jZy/hBpJm2TMDXhUVYM= 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=Rr8ud3auYv7UA7pl8xEnAzbmFLmXE+t6cvdcTn8uo9A=; b=J19FzO80D6hg4zBCiVC8+Q0+osDKvL/TQIGOsm984jgPry84b9574Oc7s1AMjJ7r2Z tIdphd//my/WDLjV5j319kK190t0dWSIf92qNAicNkNuBFD2O+S5wtqP1J/FPsCfmnWi xDaUVW9AWA4+3xkIwRXrJdwI7Ve23dhTVw6e7vHZZdZ/QDpE9XhxsgQLxUmMRVernlHp yy8ykPljnbwylvT+sRcisE/iaR1skkgx1ciyJtLtz//mWj8sPLqeTucNGWKA+KmcuniL grt959OpFmubpCZQY6hf0arWFlSuljDGyKjE9O94Md9hbrSOrSluVhagR4DLK0tqB37L wRwA== X-Gm-Message-State: ABuFfoimrCNAjxrWj54f+6vCs+ykPStaThg608fadJsaq0lHHHPgpCxj JZNO8d+tQcGd9GTgAfkjxiK3VcvNBetOKI7a X-Received: by 2002:a9d:cd4:: with SMTP id o20mr29889985otd.207.1540188898073; Sun, 21 Oct 2018 23:14:58 -0700 (PDT) Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com. [209.85.210.52]) by smtp.gmail.com with ESMTPSA id z44sm11910689oti.38.2018.10.21.23.14.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Oct 2018 23:14:57 -0700 (PDT) Received: by mail-ot1-f52.google.com with SMTP id u22so38812322ota.12 for ; Sun, 21 Oct 2018 23:14:57 -0700 (PDT) X-Received: by 2002:a9d:2147:: with SMTP id l7mr29829412otd.302.1540188897212; Sun, 21 Oct 2018 23:14:57 -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: <40d15ea4-48e2-b2c7-1d70-68dcc1b08990@linaro.org> From: Alexandre Courbot Date: Mon, 22 Oct 2018 15:14:45 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] media: venus: add support for key frame To: Stanimir Varbanov Cc: mgottam@codeaurora.org, Hans Verkuil , Mauro Carvalho Chehab , Linux Media Mailing List , LKML , linux-arm-msm@vger.kernel.org, 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 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?