Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4165244pxu; Mon, 30 Nov 2020 20:12:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJyzC6E1Yzy2x/xZ6GxWwksR31+qgdD1LHtPSsE1TI5QITtPlK/0JBlnP3w+vi9UrvYWTNs8 X-Received: by 2002:a17:906:edb2:: with SMTP id sa18mr1169509ejb.264.1606795945849; Mon, 30 Nov 2020 20:12:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606795945; cv=none; d=google.com; s=arc-20160816; b=CbnrSxWjRCf0G3c3liMo1eBCBal/YVOG4Q9Q8YVVufnRPVec3oedwCMYs8PxYYAFNf ZNsOWvNqILcjko9Nzk9D1zPC125ULJmJOQ0pS7RwZkJN+5LANPqEJre+2l8KGD9+ZHJC hzG7FtvaXkUyKQaVoYWk79ap+5sMwizpxsOPr+OsxH1vdPEgWSixxjavOr4rGOvn9cdl NHW4qcFZFleRVJR2Jr/rCUTMe0t2yioklv1x2g0+gHrV0ZMnCC+g7HOQbyT+lBZVSULv +UF6Zpt2jWG+XJl01qCZRj8Cl6jPUBfI6aq3FHrEpcik65AD+9TjhhEfPFeurXViOh96 anCw== 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=uCRmzVN+2UNsW5awjaPA+4a7ykSzhUHE9ny8s/eIifE=; b=cQV2pq588oZr1cI7ePDYIlJFev7z54uHBbouCB+Eqc2pTs2N1aaNftQCQGeWSe4XO/ fT4A76ptxwpD37TYDZLa7iOF1V1zZ1JJEitwa6MZxZHG3PFc45bcrHt6P8oqYpVFywJb EpXhygLSjNZM7QNsQr0G7sUJA0/3shtCAkcrcyICVQIHNk4/ggkucxmGFqAWAgW6IbCJ anUaPTFNR7ga6bmGa9Bs4X7I90Z5s/e1TIw6Ot6fb8t3LAxx6gvWmLeqC+4nDZVrlpJX qRzRg7t3FsPMKJ+7WOgEXsdiE3asUa93un557BSVUpe8X3xXOq5uQlWGZu+qikN1v7ka EGmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Fzk9WgLM; 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 n20si367292edw.72.2020.11.30.20.12.03; Mon, 30 Nov 2020 20:12:25 -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=Fzk9WgLM; 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 S1727997AbgLAEHn (ORCPT + 99 others); Mon, 30 Nov 2020 23:07:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727971AbgLAEHn (ORCPT ); Mon, 30 Nov 2020 23:07:43 -0500 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CD10C0613D2 for ; Mon, 30 Nov 2020 20:07:02 -0800 (PST) Received: by mail-ej1-x643.google.com with SMTP id f23so1185388ejk.2 for ; Mon, 30 Nov 2020 20:07:02 -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=uCRmzVN+2UNsW5awjaPA+4a7ykSzhUHE9ny8s/eIifE=; b=Fzk9WgLMwkrhL6Y4Liy59sv29piioGuWzjiVlNTpFoTCFI0MOt9tkTKryfA8ZGwp2n LLX7PovUTxI4WKK8DB6Zx90IKh6+A0rrrUzUEXv4qeCIhH7H1/4zX2Rt1sJ80zx90zBV 5yJ5eSU+8VasR9FNC2bZxeuI4WoOTA0gJLOK0= 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=uCRmzVN+2UNsW5awjaPA+4a7ykSzhUHE9ny8s/eIifE=; b=GtQ6EQi7EbPIOWf0JDeyj62jnL5mtNtgQshex8yk+fF3PxJhTFJ3jxQMLF4rFD5Lb1 SfCLM7xahXlub4lL1UPeJwzpxfH0NsILj8+BQo07fe3sSymbT4mui/TDwK5uvujJlXO1 prCqwQfdn8qqLq58NHfvoJDsYlMYT8iIcyY9zKczijKIqGHXzZPCQIHVVV4mrBPeOXMJ NK1kW/02H5g4KEGTbS6z+EPpWyB3wLY9KFbSWF6R+ofJ/7xRhUOaAahftvO8m2YUmkJK iPh++dVnKKQawZVO47EBYK6ioQqomjOX99OJ6Zsuohtux00GloBI/Jd9d+Y4krPhwh3c fhMQ== X-Gm-Message-State: AOAM531Nvj/3IY1d56PfBAjBWVLC9aVpwyXiZmzuip/TmHT0vemXDhLb ooMQyI1HeOv94TJ//X6IC7kPu3iCd5d9lQ== X-Received: by 2002:a17:906:2708:: with SMTP id z8mr1142689ejc.428.1606795620976; Mon, 30 Nov 2020 20:07:00 -0800 (PST) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com. [209.85.128.41]) by smtp.gmail.com with ESMTPSA id h23sm201745ejg.37.2020.11.30.20.07.00 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Nov 2020 20:07:00 -0800 (PST) Received: by mail-wm1-f41.google.com with SMTP id h21so1564455wmb.2 for ; Mon, 30 Nov 2020 20:07:00 -0800 (PST) X-Received: by 2002:a1c:9e53:: with SMTP id h80mr605360wme.50.1606795619636; Mon, 30 Nov 2020 20:06:59 -0800 (PST) MIME-Version: 1.0 References: <20201129060517.2029659-1-frkoenig@chromium.org> In-Reply-To: From: Fritz Koenig Date: Mon, 30 Nov 2020 20:06:47 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] venus: venc: Add VIDIOC_TRY_ENCODER_CMD support To: Alexandre Courbot Cc: Fritz Koenig , 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 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.) > > 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/