mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
media: verisilicon: vp9: Allow to change resolution while streaming
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> Reviewed-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> CC: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> CC: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
parent
3eeaee737d
commit
bbd267daf4
1 changed files with 3 additions and 21 deletions
|
@ -514,25 +514,14 @@ static int hantro_set_fmt_out(struct hantro_ctx *ctx,
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (!ctx->is_encoder) {
|
if (!ctx->is_encoder) {
|
||||||
struct vb2_queue *peer_vq;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* In order to support dynamic resolution change,
|
* In order to support dynamic resolution change,
|
||||||
* the decoder admits a resolution change, as long
|
* the decoder admits a resolution change, as long
|
||||||
* as the pixelformat remains. Can't be done if streaming.
|
* as the pixelformat remains.
|
||||||
*/
|
*/
|
||||||
if (vb2_is_streaming(vq) || (vb2_is_busy(vq) &&
|
if (vb2_is_streaming(vq) && pix_mp->pixelformat != ctx->src_fmt.pixelformat) {
|
||||||
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.
|
|
||||||
*/
|
|
||||||
peer_vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx,
|
|
||||||
V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
|
|
||||||
if (vb2_is_busy(peer_vq))
|
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* The encoder doesn't admit a format change if
|
* 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,
|
static int hantro_set_fmt_cap(struct hantro_ctx *ctx,
|
||||||
struct v4l2_pix_format_mplane *pix_mp)
|
struct v4l2_pix_format_mplane *pix_mp)
|
||||||
{
|
{
|
||||||
struct vb2_queue *vq;
|
|
||||||
int ret;
|
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) {
|
if (ctx->is_encoder) {
|
||||||
struct vb2_queue *peer_vq;
|
struct vb2_queue *peer_vq;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue