Thread (37 messages) 37 messages, 7 authors, 2021-11-17

Re: [PATCH v7 07/11] media: rkvdec: Add the VP9 backend

From: Chen-Yu Tsai <wenst@chromium.org>
Date: 2021-10-08 10:30:46
Also in: linux-media, linux-rockchip, linux-staging, lkml

Hi,

On Thu, Sep 30, 2021 at 12:07 AM Andrzej Pietrasiewicz
[off-list ref] wrote:
From: Boris Brezillon <boris.brezillon@collabora.com>

The Rockchip VDEC supports VP9 profile 0 up to 4096x2304@30fps. Add
a backend for this new format.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Ezequiel Garcia <redacted>
Signed-off-by: Adrian Ratiu <redacted>
Co-developed-by: Andrzej Pietrasiewicz <redacted>
Signed-off-by: Andrzej Pietrasiewicz <redacted>
---
 drivers/staging/media/rkvdec/Kconfig      |    1 +
 drivers/staging/media/rkvdec/Makefile     |    2 +-
 drivers/staging/media/rkvdec/rkvdec-vp9.c | 1078 +++++++++++++++++++++
 drivers/staging/media/rkvdec/rkvdec.c     |   52 +-
 drivers/staging/media/rkvdec/rkvdec.h     |   12 +-
 5 files changed, 1137 insertions(+), 8 deletions(-)
 create mode 100644 drivers/staging/media/rkvdec/rkvdec-vp9.c
[...]
quoted hunk ↗ jump to hunk
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
index 7131156c1f2c..6aa8aca66547 100644
--- a/drivers/staging/media/rkvdec/rkvdec.c
+++ b/drivers/staging/media/rkvdec/rkvdec.c
[...]
quoted hunk ↗ jump to hunk
@@ -319,7 +354,7 @@ static int rkvdec_s_output_fmt(struct file *file, void *priv,
        struct v4l2_m2m_ctx *m2m_ctx = ctx->fh.m2m_ctx;
        const struct rkvdec_coded_fmt_desc *desc;
        struct v4l2_format *cap_fmt;
-       struct vb2_queue *peer_vq;
+       struct vb2_queue *peer_vq, *vq;
        int ret;

        /*
@@ -331,6 +366,15 @@ static int rkvdec_s_output_fmt(struct file *file, void *priv,
        if (vb2_is_busy(peer_vq))
                return -EBUSY;

+       /*
+        * Some codecs like VP9 can contain dynamic resolution changes which
+        * are currently not supported by the V4L2 API or driver, so return
+        * an error if userspace tries to reconfigure the output format.
+        */
+       vq = v4l2_m2m_get_vq(m2m_ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
+       if (vb2_is_busy(vq))
+               return -EINVAL;
This check is already done in rkvdec_s_fmt(), though it returns -EBUSY
instead. And I don't see similar changes to Hantro, so maybe this isn't
an API limitation as described in the comment? My recent patch [1] also
loosens the restrictions on this.

ChenYu

[1] https://lore.kernel.org/linux-media/20211008100423.739462-3-wenst@chromium.org/ (local)
+
        ret = rkvdec_s_fmt(file, priv, f, rkvdec_try_output_fmt);
        if (ret)
                return ret;
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help