Message ID | 20231017144756.34719-51-benjamin.gaignard@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4189418vqb; Tue, 17 Oct 2023 07:53:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGl8wF9jm68cOiRd5+znTwStQr/Hn6CHY1xjAVaLAroeV7PQLvySCA+JJ5yNz3QUGEAmdan X-Received: by 2002:a05:6a21:8cc5:b0:14e:2c56:7b02 with SMTP id ta5-20020a056a218cc500b0014e2c567b02mr2154108pzb.0.1697554405224; Tue, 17 Oct 2023 07:53:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697554405; cv=none; d=google.com; s=arc-20160816; b=w1BNAqHIOd/mHjssZgJwwO+M9WIR++JCrL9kOClnXDqOSu7ozHFzg/0lA+NJmq1AtC RnmXZjF9KFe14A0Js6TKE0OrktQQEDLCSExaibMURlxhWYVBB24qqtiihDY3E9FbucWY d7koqAd9HMHu/m7ui7p+MoHoGdYhBKAkVPoxsJBnoV3Vpn/GdjGaUfI7EmGmnU3euHB+ opGMWCznISugUsGUYcwbIo2Q96/5oVnQ9k5UWAX/CcH1vertM1O0wN3mkzDjG+nMzN+8 JYxo86YHjIORcnhLsS9L/r+03LxA0385p0/M0hD1wSY8DnCf0Z0SOK9rVxEYpEN997lm D6LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nr1KYax36VZZBnabbjIyUGPTkvQFXV8YfPxk2A654tA=; fh=ceA81l8d2hZW6pWH7VE5TwJxtgXUzAubfWIMcikPA1M=; b=M654uRrKMz+luyRfE4vVWfzZr6mUK6rlMRGYuVRMzCyQ7lKVFCwLSysYUvJchEvy2R L+e39yJViyTTPWgsejaqSGcr3yLip8UPiBHa3SC5BFSjq4ESPA+sFxRnBnOXAx5qCNKU I/nw1wYHm2xK95dMyY2QiQxzz5ZM43jjLN90EMLen+f1G7pgMszjFMSWCEdj/wF3JKu8 qybqBIc/SiUX7sEOfk9OxyUB81UXEgB1vyu9qZZZg4uFCIHU84N/NJ9xTBMW1PW/wol+ 89NrjgH0CYENZL6xAA2H5QQkjcefcxmgz5/e+Vks9HrYTTaiLTF7UzZEJ5F8stgkgwjc VgxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=AYUf7aod; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id l6-20020a170902f68600b001ca8e7953b3si2058928plg.538.2023.10.17.07.53.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 07:53:25 -0700 (PDT) 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; dkim=pass header.i=@collabora.com header.s=mail header.b=AYUf7aod; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 8B1F98095F60; Tue, 17 Oct 2023 07:53:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344658AbjJQOva (ORCPT <rfc822;hjfbswb@gmail.com> + 20 others); Tue, 17 Oct 2023 10:51:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344441AbjJQOtA (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 17 Oct 2023 10:49:00 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B778183; Tue, 17 Oct 2023 07:48:31 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:7205:da49:a7e8:59f8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: benjamin.gaignard) by madras.collabora.co.uk (Postfix) with ESMTPSA id A003A66073BE; Tue, 17 Oct 2023 15:48:29 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1697554110; bh=dg5TyqcXTbK8D5lR679m2t1zA3rG8sR+3z3V0ZimwSc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AYUf7aodyCaxPT8pTO2gysdeTe2MgfMO6+oWZtRFooi1iecWEgGe4JSHK822PTRgC 5JTPxT6ffpQkQLwQTzyEcEB9bISBoFv9Syau/oHT3RRvP8aA6QWr1LaLXyC0psUnQX zK/C0NdY6j7d/u1iI+33d+Nng1K3OccyX7ss+fFQfu2URCQGVtiu86KPyoGYLFio4o s8DyIIFA9DfpeRKyR+IZpIYMYfe2IIUBKBtt8tP0MnO5FmhfhBAsjkenaxRWvla0y/ //IVw/yodiYpKjrvrubJqJCufPsBPR+MjU9dqCCWWcS5lPpy83MCsvf5xraqjpVvv2 mfaoWzdoPqRVg== From: Benjamin Gaignard <benjamin.gaignard@collabora.com> To: mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, ming.qian@nxp.com, ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, gregkh@linuxfoundation.org, hverkuil-cisco@xs4all.nl, nicolas.dufresne@collabora.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard <benjamin.gaignard@collabora.com> Subject: [PATCH v12 50/56] media: verisilicon: vp9: Allow to change resolution while streaming Date: Tue, 17 Oct 2023 16:47:50 +0200 Message-Id: <20231017144756.34719-51-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231017144756.34719-1-benjamin.gaignard@collabora.com> References: <20231017144756.34719-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> 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, 17 Oct 2023 07:53:19 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780014807835532388 X-GMAIL-MSGID: 1780014807835532388 |
Series |
Add DELETE_BUF ioctl
|
|
Commit Message
Benjamin Gaignard
Oct. 17, 2023, 2:47 p.m. UTC
Remove all checks that prohibit to set a new format while streaming.
This allow to change dynamically the resolution if the pixel format
remains the same.
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
CC: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
CC: Philipp Zabel <p.zabel@pengutronix.de>
---
.../media/platform/verisilicon/hantro_v4l2.c | 24 +++----------------
1 file changed, 3 insertions(+), 21 deletions(-)
diff --git a/drivers/media/platform/verisilicon/hantro_v4l2.c b/drivers/media/platform/verisilicon/hantro_v4l2.c index f0d8b165abcd..27a1e77cca38 100644 --- a/drivers/media/platform/verisilicon/hantro_v4l2.c +++ b/drivers/media/platform/verisilicon/hantro_v4l2.c @@ -514,25 +514,14 @@ static int hantro_set_fmt_out(struct hantro_ctx *ctx, return ret; if (!ctx->is_encoder) { - struct vb2_queue *peer_vq; - /* * In order to support dynamic resolution change, * the decoder admits a resolution change, as long - * as the pixelformat remains. Can't be done if streaming. - */ - if (vb2_is_streaming(vq) || (vb2_is_busy(vq) && - pix_mp->pixelformat != ctx->src_fmt.pixelformat)) - return -EBUSY; - /* - * Since format change on the OUTPUT queue will reset - * the CAPTURE queue, we can't allow doing so - * when the CAPTURE queue has buffers allocated. + * as the pixelformat remains. */ - peer_vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, - V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); - if (vb2_is_busy(peer_vq)) + if (vb2_is_streaming(vq) && pix_mp->pixelformat != ctx->src_fmt.pixelformat) { return -EBUSY; + } } else { /* * The encoder doesn't admit a format change if @@ -577,15 +566,8 @@ static int hantro_set_fmt_out(struct hantro_ctx *ctx, static int hantro_set_fmt_cap(struct hantro_ctx *ctx, struct v4l2_pix_format_mplane *pix_mp) { - struct vb2_queue *vq; int ret; - /* Change not allowed if queue is busy. */ - vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, - V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); - if (vb2_is_busy(vq)) - return -EBUSY; - if (ctx->is_encoder) { struct vb2_queue *peer_vq;