Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3743674rdh; Tue, 28 Nov 2023 02:39:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IExz/01anXQsiFc3iG3TBuOkFn+3i1vQjld7Yu4Gx0ae7hlEIwpXibUFSmGsbvFxdzvZC0F X-Received: by 2002:a17:90a:187:b0:285:25ab:258e with SMTP id 7-20020a17090a018700b0028525ab258emr13674577pjc.34.1701167976716; Tue, 28 Nov 2023 02:39:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701167976; cv=none; d=google.com; s=arc-20160816; b=Y1uHfqvJUMQQJbUHt4mmbFnYm3ALT+J5UKVuf6ZzNHuMNo2p4x60e8Ljh5MkNQdzox z023HaqVZIzxSE1KzPV8GjF92v4a7ygINjWqCrNkyHhx5jBPvGvGIwhICFF9IpbHdo7r wlHKlA8c2YlaUn/BOEUYH9mD4O2WLgV1EUHS24T+cz+yftjPQNREfWIcoru/9Y2Q3Q8x 6ZNt+giY6fPL2y3AzixOx6xDsmBX7D+NeGkR+j1AoPKEgSkRA5FS/OILVzp5DXBZDQi1 c8TEiAlhNrMExUbQ1VokbiiI477YIm8c/eFRbfW5tvrombTIeKY8YolPWPycGGpT8b/h LpEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id; bh=+weL2wB2p7elRp4mZ63LQsZAcZwadDYOWgCK5s0vGaA=; fh=KFN+hg638GLUyvfgHcFgvxgmkZRqp8N3EHdyYLckFik=; b=EIrGLwYKWufBJBlDizjj92k9UfInFyj/OvXaF9KXWf8pPQlpzgkIOtxcRVCApjpnpS BbKDDqM15fttetltJ0sJ6p7YsNZxRsysFs/UApK5JlrEviUS8DqVWGD/RSkgzutuIvNK SJZRrshrEggaygBngxYwHpYel3pRaXlyU1sRTO/rgHLWD1nxyRFpYoZOUCwhI8ueGXmY fl+8Z0cWGaGK3qJBRArGEcgEMYXo+W4guNBORgvLOfMcltqI88iP0y/a+vOydw0R+W0W 3r0wdg4OZ9rmES0L1oDIwYGLyVVz9KoXsegZD+m09HAE/t47ULAMGWQ5x8U8x4mPvtcR PE6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id il15-20020a17090b164f00b00285a20806aesi8488792pjb.166.2023.11.28.02.39.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 02:39:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 18DAA807C85D; Tue, 28 Nov 2023 02:39:34 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344284AbjK1KjT (ORCPT + 99 others); Tue, 28 Nov 2023 05:39:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234946AbjK1KjA (ORCPT ); Tue, 28 Nov 2023 05:39:00 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42C2E3268 for ; Tue, 28 Nov 2023 02:26:28 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25D24C433C8; Tue, 28 Nov 2023 10:26:24 +0000 (UTC) Message-ID: Date: Tue, 28 Nov 2023 11:26:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 16/55] media: qcom: venus: Stop abusing of min_buffers_needed field Content-Language: en-US, nl To: Benjamin Gaignard , mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Andy Gross , Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org References: <20231127165454.166373-1-benjamin.gaignard@collabora.com> <20231127165454.166373-17-benjamin.gaignard@collabora.com> From: Hans Verkuil Autocrypt: addr=hverkuil@xs4all.nl; keydata= xsFNBFQ84W0BEAC7EF1iL4s3tY8cRTVkJT/297h0Hz0ypA+ByVM4CdU9sN6ua/YoFlr9k0K4 BFUlg7JzJoUuRbKxkYb8mmqOe722j7N3HO8+ofnio5cAP5W0WwDpM0kM84BeHU0aPSTsWiGR yw55SOK2JBSq7hueotWLfJLobMWhQii0Zd83hGT9SIt9uHaHjgwmtTH7MSTIiaY6N14nw2Ud C6Uykc1va0Wqqc2ov5ihgk/2k2SKa02ookQI3e79laOrbZl5BOXNKR9LguuOZdX4XYR3Zi6/ BsJ7pVCK9xkiVf8svlEl94IHb+sa1KrlgGv3fn5xgzDw8Z222TfFceDL/2EzUyTdWc4GaPMC E/c1B4UOle6ZHg02+I8tZicjzj5+yffv1lB5A1btG+AmoZrgf0X2O1B96fqgHx8w9PIpVERN YsmkfxvhfP3MO3oHh8UY1OLKdlKamMneCLk2up1Zlli347KMjHAV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gR1+ZFvQrAV36SvLFfuMhyCAxV6WBlQc85ArOiQZB Wm7L0repwr7zEJFEkdy8C81WRhMdPvHkAIh3RoY1SGcdB7rB3wCzfYkAuCBqaF7Zgfw8xkad KEiQTexRbM1sc/I8ACpla3N26SfQwrfg6V7TIoweP0RwDrcf5PVvwSWsRQp2LxFCkwnCXOra gYmkrmv0duG1FStpY+IIQn1TOkuXrciTVfZY1cZD0aVxwlxXBnUNZZNslldvXFtndxR0SFat sflovhDxKyhFwXOP0Rv8H378/+14TaykknRBIKEc0+lcr+EMOSUR5eg4aURb8Gc3Uc7fgQ6q UssTXzHPyj1hAyDpfu8DzAwlh4kKFTodxSsKAjI45SLjadSc94/5Gy8645Y1KgBzBPTH7Q== In-Reply-To: <20231127165454.166373-17-benjamin.gaignard@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 28 Nov 2023 02:39:34 -0800 (PST) On 27/11/2023 17:54, Benjamin Gaignard wrote: > 'min_buffers_needed' is suppose to be used to indicate the number > of buffers needed by DMA engine to start streaming. > venus driver doesn't use DMA engine and just want to specify > the minimum number of buffers to allocate when calling VIDIOC_REQBUFS. > That 'min_reqbufs_allocation' field purpose so use it. > > Signed-off-by: Benjamin Gaignard > CC: Stanimir Varbanov (maintainer:QUALCOMM VENUS VIDEO ACCELERATOR DRIVER) > CC: Vikash Garodia (maintainer:QUALCOMM VENUS VIDEO ACCELERATOR DRIVER) > CC: "Bryan O'Donoghue" (reviewer:QUALCOMM VENUS VIDEO ACCELERATOR DRIVER) > CC: Andy Gross (maintainer:ARM/QUALCOMM SUPPORT) > CC: Bjorn Andersson (maintainer:ARM/QUALCOMM SUPPORT) > CC: Konrad Dybcio (maintainer:ARM/QUALCOMM SUPPORT) > CC: linux-arm-msm@vger.kernel.org > --- > drivers/media/platform/qcom/venus/vdec.c | 4 ++-- > drivers/media/platform/qcom/venus/venc.c | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c > index dbf305cec120..16b8d0dde10d 100644 > --- a/drivers/media/platform/qcom/venus/vdec.c > +++ b/drivers/media/platform/qcom/venus/vdec.c > @@ -1641,7 +1641,7 @@ static int m2m_queue_init(void *priv, struct vb2_queue *src_vq, > src_vq->drv_priv = inst; > src_vq->buf_struct_size = sizeof(struct venus_buffer); > src_vq->allow_zero_bytesused = 1; > - src_vq->min_buffers_needed = 0; > + src_vq->min_reqbufs_allocation = 0; Just drop this. > src_vq->dev = inst->core->dev; > src_vq->lock = &inst->ctx_q_lock; > ret = vb2_queue_init(src_vq); > @@ -1656,7 +1656,7 @@ static int m2m_queue_init(void *priv, struct vb2_queue *src_vq, > dst_vq->drv_priv = inst; > dst_vq->buf_struct_size = sizeof(struct venus_buffer); > dst_vq->allow_zero_bytesused = 1; > - dst_vq->min_buffers_needed = 0; > + dst_vq->min_reqbufs_allocation = 0; > dst_vq->dev = inst->core->dev; > dst_vq->lock = &inst->ctx_q_lock; > return vb2_queue_init(dst_vq); > diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c > index 44b13696cf82..e399d01c208c 100644 > --- a/drivers/media/platform/qcom/venus/venc.c > +++ b/drivers/media/platform/qcom/venus/venc.c > @@ -1398,7 +1398,7 @@ static int m2m_queue_init(void *priv, struct vb2_queue *src_vq, > src_vq->drv_priv = inst; > src_vq->buf_struct_size = sizeof(struct venus_buffer); > src_vq->allow_zero_bytesused = 1; > - src_vq->min_buffers_needed = 1; > + src_vq->min_reqbufs_allocation = 1; So for platform drivers like this it is going to be more difficult to determine which meaning min_buffers_needed had: is at least one queued buffer needed before you can start streaming, or is this for a minimum buffer allocation? In the case of m2m devices using the v4l2-mem2mem framework it is almost certainly the minimum buffer allocation since the m2m framework already checks that there are input and output buffers queued (__v4l2_m2m_try_queue). So just delete the src_vq->min_buffers_needed = 1; line, and there is no need to set min_reqbufs_allocation. > src_vq->dev = inst->core->dev; > src_vq->lock = &inst->ctx_q_lock; > if (inst->core->res->hfi_version == HFI_VERSION_1XX) > @@ -1415,7 +1415,7 @@ static int m2m_queue_init(void *priv, struct vb2_queue *src_vq, > dst_vq->drv_priv = inst; > dst_vq->buf_struct_size = sizeof(struct venus_buffer); > dst_vq->allow_zero_bytesused = 1; > - dst_vq->min_buffers_needed = 1; > + dst_vq->min_reqbufs_allocation = 1; > dst_vq->dev = inst->core->dev; > dst_vq->lock = &inst->ctx_q_lock; > return vb2_queue_init(dst_vq); Ditto. Regards, Hans