Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4168712pxu; Mon, 30 Nov 2020 20:20:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJw2Mw8rEzTMdmSqb9MiBZ0cgJGGKFDqmzb63TPABAA54XZ3gmCgubna6u+AYMJdByjjmyxt X-Received: by 2002:a17:906:5fd9:: with SMTP id k25mr1159232ejv.539.1606796417619; Mon, 30 Nov 2020 20:20:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606796417; cv=none; d=google.com; s=arc-20160816; b=tEAHukRGgnemIPbEXxmGhICq32Io86hs+aHHMZVp+Xc17nVWUtA0J+D2v2R388gevQ xq8eLINC0mGfHMkPO1fyPtUc/k1PnZZF96a8/sV80cD0AJ7s6ti7iHl0UHGaOwtAQREF +x/z0XX3USp6fjp+X8POWo8wPZ/WyIhPSHNSasFyUIUxU+lylnVQnIrch5QsIf+djYby nMbuY2PkVaxIA3oSBW/Or4FRd7/5w1iRlq5r5IjFPv2NB+5d6aPOfGwcprzQQrrE/9dO TL2ho59hald26+By+Kk1vGzX5tZjpMtgXAqKosN7zB+1ZcSGhvZJHC+f+4l4Eh5kkdWo Gl2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=WpC1M4YbFxEU0qcfNjt8XtI70ux/NgpyKgBiGPj7CHw=; b=wkakZ4jyiyfH9U2px3ZPD9Ht2iS4yXaYp+Mo5QFjGuWCgE7URVqZsPsY/Tx0573Mzt oz/olKhknt0VuWDLLb1f54AaE9S+dqPPrIwSsR9vLZlqzd9X5IpSZPxYdkntrcX+L2LL HQ9AkPFN9dedfTb0HSnltGwSDMRabI5kcyv3MVVyCu6w5jCLFW61F9xcOBdHiOlLNSR4 PDW5B9jlraoURb4dZAqSlGQa973d72Mnc9Kpt8tkNYIPOhUEJbhsGNT9mezm8zD/XITY wEerSHusa+7Xs8vTaYlGUOPNcgcHRjzmLzyVkPD8sknxmXFIEHALLsgVi1w77/0uc0iH 9x0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="hxam5/3a"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id k12si388696eds.191.2020.11.30.20.19.54; Mon, 30 Nov 2020 20:20:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="hxam5/3a"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728118AbgLAER7 (ORCPT + 99 others); Mon, 30 Nov 2020 23:17:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727973AbgLAER7 (ORCPT ); Mon, 30 Nov 2020 23:17:59 -0500 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E43DC0613D3 for ; Mon, 30 Nov 2020 20:17:18 -0800 (PST) Received: by mail-lf1-x143.google.com with SMTP id s27so1308091lfp.5 for ; Mon, 30 Nov 2020 20:17:18 -0800 (PST) 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=WpC1M4YbFxEU0qcfNjt8XtI70ux/NgpyKgBiGPj7CHw=; b=hxam5/3a/ox2onWPgbCP5KHp2k+3vN3YKm2u7WtZDqGN2VeQG4i0IKiHlAt9HdNW28 LY0CuFXXSe9a0Zc05ixo7TwKrDQhRDtZk7LelMIGFUrZ6RFzzqWdhS9oFiw2FqfamFb9 igZapYdi0SW+tGy5ug3VD3zoARszUEDiQONkE= 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=WpC1M4YbFxEU0qcfNjt8XtI70ux/NgpyKgBiGPj7CHw=; b=FRe8SUuOI9W5WHbFukis5iAIkWCxfJoQhx+MTM/JPYNJfGKGuXYhU2EpwFWyR1O7RV o5Y+DKxEbrqJCYZ9bATWQeyms5nztnVTPZlR3mhIJh+xTAWX0yGvmuKATRH3UMVh7giD sJzHI34IQsCSlmp4rCgQNKzKcaoBPc3b4dceyReDuui3tdF0ScRfEIpaqR0MXQsQUK89 scC/3jBz/+52O5cKovj/qDPgVuaPf9aOg4ZvrZk34xgLVb/Wts4BTRXjcrJvUtySfw8E 1z6GMidFa5Zw5ngFbnqouDqniQRCSK4mAI6AQZmdlltmE3ZUv0Eme2JouPLB05nXh1jT xWcQ== X-Gm-Message-State: AOAM530NRjm05bZTecNNZzr6h3cQTUJlUcf50a1BVJLJZE42vZUJyX3/ c4J8YCxl/nTOf6kmh55J8hqj8OcxtFRJ5OJc X-Received: by 2002:ac2:4433:: with SMTP id w19mr341703lfl.230.1606796235888; Mon, 30 Nov 2020 20:17:15 -0800 (PST) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com. [209.85.167.46]) by smtp.gmail.com with ESMTPSA id a22sm66042lfl.11.2020.11.30.20.17.14 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Nov 2020 20:17:15 -0800 (PST) Received: by mail-lf1-f46.google.com with SMTP id j205so1301016lfj.6 for ; Mon, 30 Nov 2020 20:17:14 -0800 (PST) X-Received: by 2002:a19:3817:: with SMTP id f23mr346974lfa.587.1606796234247; Mon, 30 Nov 2020 20:17:14 -0800 (PST) MIME-Version: 1.0 References: <20201129060517.2029659-1-frkoenig@chromium.org> In-Reply-To: From: Alexandre Courbot Date: Tue, 1 Dec 2020 13:17:03 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] venus: venc: Add VIDIOC_TRY_ENCODER_CMD support To: Fritz Koenig Cc: Linux Media Mailing List , linux-arm-msm@vger.kernel.org, LKML , Stanimir Varbanov , Vikash Garodia , Dikshita Agarwal Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 1, 2020 at 1:07 PM Fritz Koenig wrote: > > On Mon, Nov 30, 2020 at 7:24 PM Alexandre Courbot wrote: > > > > On Sun, Nov 29, 2020 at 3:05 PM Fritz Koenig wrote: > > > > > > V4L2_ENC_CMD_STOP and V4L2_ENC_CMD_START are already > > > supported. Add a way to query for support. > > > > I think your Signed-off-by is missing (checkpatch.pl should warn you > > about such problems). > > > > > > > > --- > > > drivers/media/platform/qcom/venus/venc.c | 26 ++++++++++++++++++++++++ > > > 1 file changed, 26 insertions(+) > > > > > > diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c > > > index 2ddfeddf98514..e05db3c4bfb24 100644 > > > --- a/drivers/media/platform/qcom/venus/venc.c > > > +++ b/drivers/media/platform/qcom/venus/venc.c > > > @@ -507,6 +507,27 @@ static int venc_enum_frameintervals(struct file *file, void *fh, > > > return 0; > > > } > > > > > > +static int > > > +venc_try_encoder_cmd(struct file *file, void *fh, struct v4l2_encoder_cmd *cmd) > > > +{ > > > + struct venus_inst *inst = to_inst(file); > > > + struct device *dev = inst->core->dev_dec; > > > + > > > + switch (cmd->cmd) { > > > + case V4L2_ENC_CMD_STOP: > > > + case V4L2_ENC_CMD_START: > > > + if (cmd->flags != 0) { > > > + dev_dbg(dev, "flags=%u are not supported", cmd->flags); > > > + return -EINVAL; > > > + } > > > + break; > > > + default: > > > + return -EINVAL; > > > + } > > > + > > > + return 0; > > > +} > > > + > > > static int > > > venc_encoder_cmd(struct file *file, void *fh, struct v4l2_encoder_cmd *cmd) > > > > I am not seeing venc_encoder_cmd() in the media tree, does this patch > > depend on others that are not yet merged? If so they should be > > submitted together as a series. > > > > Sorry, I'm still a little unsure of procedures here. There is another > patch set[1] posted > and I thought it was missing this part. It turns out I had not > applied the whole set to > my tree. > > > > { > > > @@ -514,6 +535,10 @@ venc_encoder_cmd(struct file *file, void *fh, struct v4l2_encoder_cmd *cmd) > > > struct hfi_frame_data fdata = {0}; > > > int ret = 0; > > > > > > + ret = venc_try_encoder_cmd(file, fh, cmd); > > > + if (ret < 0) > > > + return ret; > > > + > > > > v4l2_m2m_ioctl_try_encoder_cmd() is called right below, and AFAICT > > does the same thing as the newly-defined venc_try_encoder_cmd(). So > > IIUC this patch can be turned into a one-liner that does just the > > following: > > > > @@ -575,6 +600,7 @@ static const struct v4l2_ioctl_ops venc_ioctl_ops = { > > .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, > > .vidioc_unsubscribe_event = v4l2_event_unsubscribe, > > .vidioc_encoder_cmd = venc_encoder_cmd, > > + .vidioc_try_encoder_cmd = v4l2_m2m_ioctl_try_encoder_cmd, > > }; > > > Yes, that's how it is in the current patch[2], which is why I may have > missed it. > (I'm embarrassed because I reviewed that patch and then posted mine.) Ah, ack - no worries, I am also far from being on top of everything and missed the connection with that patchset. :) I guess we can drop this one then. > > > > ret = v4l2_m2m_ioctl_try_encoder_cmd(file, fh, cmd); > > > if (ret) > > > return ret; > > > @@ -575,6 +600,7 @@ static const struct v4l2_ioctl_ops venc_ioctl_ops = { > > > .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, > > > .vidioc_unsubscribe_event = v4l2_event_unsubscribe, > > > .vidioc_encoder_cmd = venc_encoder_cmd, > > > + .vidioc_try_encoder_cmd = venc_try_encoder_cmd, > > > }; > > > > > > static int venc_set_properties(struct venus_inst *inst) > > > -- > > > 2.29.2.454.gaff20da3a2-goog > > > > > [1] : https://patchwork.kernel.org/project/linux-media/list/?series=382113 > [2]: https://patchwork.kernel.org/project/linux-media/patch/20201111143755.24541-7-stanimir.varbanov@linaro.org/