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 v5 08/10] media: verisilicon: vp9: Allow to change resolution while streaming
Date: Thu, 24 Aug 2023 11:21:31 +0200 [thread overview]
Message-ID: <20230824092133.39510-9-benjamin.gaignard@collabora.com> (raw)
In-Reply-To: <20230824092133.39510-1-benjamin.gaignard@collabora.com>
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>
---
.../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;
--
2.39.2
next prev parent reply other threads:[~2023-08-24 9:22 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-24 9:21 [PATCH v5 00/10] Add DELETE_BUF ioctl Benjamin Gaignard
2023-08-24 9:21 ` [PATCH v5 01/10] media: videobuf2: Rework offset 'cookie' encoding pattern Benjamin Gaignard
2023-08-30 12:25 ` Hans Verkuil
2023-08-30 12:51 ` Benjamin Gaignard
2023-08-24 9:21 ` [PATCH v5 02/10] media: videobuf2: Access vb2_queue bufs array through helper functions Benjamin Gaignard
2023-08-30 13:23 ` Hans Verkuil
2023-08-30 16:24 ` Benjamin Gaignard
2023-08-30 16:36 ` Hans Verkuil
2023-08-31 7:54 ` Benjamin Gaignard
2023-08-31 10:22 ` Hans Verkuil
2023-08-31 12:06 ` Benjamin Gaignard
2023-09-01 12:29 ` Benjamin Gaignard
2023-08-24 9:21 ` [PATCH v5 03/10] media: videobuf2: Be more flexible on the number of queue stored buffers Benjamin Gaignard
2023-08-30 13:27 ` Hans Verkuil
2023-08-24 9:21 ` [PATCH v5 04/10] media: verisilicon: Refactor postprocessor to store more buffers Benjamin Gaignard
2023-08-24 9:21 ` [PATCH v5 05/10] media: verisilicon: Store chroma and motion vectors offset Benjamin Gaignard
2023-08-24 9:21 ` [PATCH v5 06/10] media: verisilicon: vp9: Use destination buffer height to compute chroma offset Benjamin Gaignard
2023-08-24 9:21 ` [PATCH v5 07/10] media: verisilicon: postproc: Fix down scale test Benjamin Gaignard
2023-08-24 9:21 ` Benjamin Gaignard [this message]
2023-08-24 9:21 ` [PATCH v5 09/10] media: v4l2: Add DELETE_BUFS ioctl Benjamin Gaignard
2023-08-30 13:45 ` Hans Verkuil
2023-08-30 13:51 ` Hans Verkuil
2023-08-24 9:21 ` [PATCH v5 10/10] media: v4l2: Add mem2mem helpers for " Benjamin Gaignard
2023-08-25 10:29 ` kernel test robot
2023-08-25 15:34 ` Benjamin Gaignard
2023-08-25 12:26 ` kernel test robot
2023-08-30 13:53 ` Hans Verkuil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230824092133.39510-9-benjamin.gaignard@collabora.com \
--to=benjamin.gaignard@collabora.com \
--cc=ezequiel@vanguardiasur.com.ar \
--cc=gregkh@linuxfoundation.org \
--cc=hverkuil-cisco@xs4all.nl \
--cc=kernel@collabora.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=linux-staging@lists.linux.dev \
--cc=m.szyprowski@samsung.com \
--cc=mchehab@kernel.org \
--cc=ming.qian@nxp.com \
--cc=nicolas.dufresne@collabora.com \
--cc=p.zabel@pengutronix.de \
--cc=tfiga@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®