* [PATCH 1/4] media: vicodec: Disable (TRY_)DECODER_CMD for the stateless case
@ 2023-11-09 20:16 Paul Kocialkowski
2023-11-09 20:16 ` [PATCH 2/4] media: visl: Hook the (TRY_)DECODER_CMD stateless ioctls Paul Kocialkowski
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: Paul Kocialkowski @ 2023-11-09 20:16 UTC (permalink / raw)
To: linux-media, linux-rockchip, linux-kernel, linux-staging
Cc: Ezequiel Garcia, Philipp Zabel, Mauro Carvalho Chehab,
Hans Verkuil, Daniel Almeida, Greg Kroah-Hartman,
Nicolas Dufresne, Sebastian Fricke, Thomas Petazzoni,
Paul Kocialkowski
The (TRY_)DECODER_CMD ioctls are only useful for stateful decoders and for
stateless decoders that support holding capture buffers (which is not the case
for this driver).
Disable them when registering the stateless decoder.
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
---
.../media/test-drivers/vicodec/vicodec-core.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/drivers/media/test-drivers/vicodec/vicodec-core.c b/drivers/media/test-drivers/vicodec/vicodec-core.c
index 6f0e20df74e9..8f7a2b153ee9 100644
--- a/drivers/media/test-drivers/vicodec/vicodec-core.c
+++ b/drivers/media/test-drivers/vicodec/vicodec-core.c
@@ -1240,6 +1240,12 @@ static int vicodec_decoder_cmd(struct file *file, void *fh,
struct vicodec_ctx *ctx = file2ctx(file);
int ret;
+ /*
+ * This ioctl should not be used with a stateless codec that doesn't
+ * support holding buffers and the associated flush command.
+ */
+ WARN_ON(ctx->is_stateless);
+
ret = v4l2_m2m_ioctl_try_decoder_cmd(file, fh, dc);
if (ret < 0)
return ret;
@@ -2025,7 +2031,7 @@ static const struct v4l2_m2m_ops m2m_ops = {
static int register_instance(struct vicodec_dev *dev,
struct vicodec_dev_instance *dev_instance,
- const char *name, bool is_enc)
+ const char *name, bool is_enc, bool is_stateless)
{
struct video_device *vfd;
int ret;
@@ -2045,10 +2051,11 @@ static int register_instance(struct vicodec_dev *dev,
strscpy(vfd->name, name, sizeof(vfd->name));
vfd->device_caps = V4L2_CAP_STREAMING |
(multiplanar ? V4L2_CAP_VIDEO_M2M_MPLANE : V4L2_CAP_VIDEO_M2M);
- if (is_enc) {
+ if (is_enc || is_stateless) {
v4l2_disable_ioctl(vfd, VIDIOC_DECODER_CMD);
v4l2_disable_ioctl(vfd, VIDIOC_TRY_DECODER_CMD);
- } else {
+ }
+ if (!is_enc) {
v4l2_disable_ioctl(vfd, VIDIOC_ENCODER_CMD);
v4l2_disable_ioctl(vfd, VIDIOC_TRY_ENCODER_CMD);
}
@@ -2107,17 +2114,17 @@ static int vicodec_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, dev);
ret = register_instance(dev, &dev->stateful_enc, "stateful-encoder",
- true);
+ true, false);
if (ret)
goto unreg_dev;
ret = register_instance(dev, &dev->stateful_dec, "stateful-decoder",
- false);
+ false, false);
if (ret)
goto unreg_sf_enc;
ret = register_instance(dev, &dev->stateless_dec, "stateless-decoder",
- false);
+ false, true);
if (ret)
goto unreg_sf_dec;
--
2.42.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/4] media: visl: Hook the (TRY_)DECODER_CMD stateless ioctls
2023-11-09 20:16 [PATCH 1/4] media: vicodec: Disable (TRY_)DECODER_CMD for the stateless case Paul Kocialkowski
@ 2023-11-09 20:16 ` Paul Kocialkowski
2023-11-10 21:06 ` Daniel Almeida
2023-11-09 20:16 ` [PATCH 3/4] media: verisilicon: " Paul Kocialkowski
` (2 subsequent siblings)
3 siblings, 1 reply; 10+ messages in thread
From: Paul Kocialkowski @ 2023-11-09 20:16 UTC (permalink / raw)
To: linux-media, linux-rockchip, linux-kernel, linux-staging
Cc: Ezequiel Garcia, Philipp Zabel, Mauro Carvalho Chehab,
Hans Verkuil, Daniel Almeida, Greg Kroah-Hartman,
Nicolas Dufresne, Sebastian Fricke, Thomas Petazzoni,
Paul Kocialkowski
The (TRY_)DECODER_CMD ioctls are used to support flushing when holding capture
buffers is supported. This is the case of this driver but the ioctls were never
hooked to the ioctl ops.
Add them to correctly support flushing.
Fixes: 0c078e310b6d ("media: visl: add virtual stateless decoder driver")
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
---
drivers/media/test-drivers/visl/visl-video.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/test-drivers/visl/visl-video.c b/drivers/media/test-drivers/visl/visl-video.c
index 7cac6a6456eb..9303a3e118d7 100644
--- a/drivers/media/test-drivers/visl/visl-video.c
+++ b/drivers/media/test-drivers/visl/visl-video.c
@@ -525,6 +525,9 @@ const struct v4l2_ioctl_ops visl_ioctl_ops = {
.vidioc_streamon = v4l2_m2m_ioctl_streamon,
.vidioc_streamoff = v4l2_m2m_ioctl_streamoff,
+ .vidioc_decoder_cmd = v4l2_m2m_ioctl_stateless_decoder_cmd,
+ .vidioc_try_decoder_cmd = v4l2_m2m_ioctl_stateless_try_decoder_cmd,
+
.vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
.vidioc_unsubscribe_event = v4l2_event_unsubscribe,
};
--
2.42.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/4] media: verisilicon: Hook the (TRY_)DECODER_CMD stateless ioctls
2023-11-09 20:16 [PATCH 1/4] media: vicodec: Disable (TRY_)DECODER_CMD for the stateless case Paul Kocialkowski
2023-11-09 20:16 ` [PATCH 2/4] media: visl: Hook the (TRY_)DECODER_CMD stateless ioctls Paul Kocialkowski
@ 2023-11-09 20:16 ` Paul Kocialkowski
2023-11-09 21:38 ` Nicolas Dufresne
2023-11-10 21:07 ` Daniel Almeida
2023-11-09 20:16 ` [PATCH 4/4] media: rkvdec: " Paul Kocialkowski
2023-11-10 21:06 ` [PATCH 1/4] media: vicodec: Disable (TRY_)DECODER_CMD for the stateless case Daniel Almeida
3 siblings, 2 replies; 10+ messages in thread
From: Paul Kocialkowski @ 2023-11-09 20:16 UTC (permalink / raw)
To: linux-media, linux-rockchip, linux-kernel, linux-staging
Cc: Ezequiel Garcia, Philipp Zabel, Mauro Carvalho Chehab,
Hans Verkuil, Daniel Almeida, Greg Kroah-Hartman,
Nicolas Dufresne, Sebastian Fricke, Thomas Petazzoni,
Paul Kocialkowski
The (TRY_)DECODER_CMD ioctls are used to support flushing when holding capture
buffers is supported. This is the case of this driver but the ioctls were never
hooked to the ioctl ops.
Add them to correctly support flushing.
Fixes: 340ce50f75a6 ("media: hantro: Enable HOLD_CAPTURE_BUF for H.264")
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
---
drivers/media/platform/verisilicon/hantro_drv.c | 2 ++
drivers/media/platform/verisilicon/hantro_v4l2.c | 3 +++
2 files changed, 5 insertions(+)
diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
index a9fa05ac56a9..3a2a0f28cbfe 100644
--- a/drivers/media/platform/verisilicon/hantro_drv.c
+++ b/drivers/media/platform/verisilicon/hantro_drv.c
@@ -905,6 +905,8 @@ static int hantro_add_func(struct hantro_dev *vpu, unsigned int funcid)
if (funcid == MEDIA_ENT_F_PROC_VIDEO_ENCODER) {
vpu->encoder = func;
+ v4l2_disable_ioctl(vfd, VIDIOC_TRY_DECODER_CMD);
+ v4l2_disable_ioctl(vfd, VIDIOC_DECODER_CMD);
} else {
vpu->decoder = func;
v4l2_disable_ioctl(vfd, VIDIOC_TRY_ENCODER_CMD);
diff --git a/drivers/media/platform/verisilicon/hantro_v4l2.c b/drivers/media/platform/verisilicon/hantro_v4l2.c
index b3ae037a50f6..db145519fc5d 100644
--- a/drivers/media/platform/verisilicon/hantro_v4l2.c
+++ b/drivers/media/platform/verisilicon/hantro_v4l2.c
@@ -785,6 +785,9 @@ const struct v4l2_ioctl_ops hantro_ioctl_ops = {
.vidioc_g_selection = vidioc_g_selection,
.vidioc_s_selection = vidioc_s_selection,
+ .vidioc_decoder_cmd = v4l2_m2m_ioctl_stateless_decoder_cmd,
+ .vidioc_try_decoder_cmd = v4l2_m2m_ioctl_stateless_try_decoder_cmd,
+
.vidioc_try_encoder_cmd = v4l2_m2m_ioctl_try_encoder_cmd,
.vidioc_encoder_cmd = vidioc_encoder_cmd,
};
--
2.42.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/4] media: rkvdec: Hook the (TRY_)DECODER_CMD stateless ioctls
2023-11-09 20:16 [PATCH 1/4] media: vicodec: Disable (TRY_)DECODER_CMD for the stateless case Paul Kocialkowski
2023-11-09 20:16 ` [PATCH 2/4] media: visl: Hook the (TRY_)DECODER_CMD stateless ioctls Paul Kocialkowski
2023-11-09 20:16 ` [PATCH 3/4] media: verisilicon: " Paul Kocialkowski
@ 2023-11-09 20:16 ` Paul Kocialkowski
2023-11-10 21:08 ` Daniel Almeida
2023-11-10 21:06 ` [PATCH 1/4] media: vicodec: Disable (TRY_)DECODER_CMD for the stateless case Daniel Almeida
3 siblings, 1 reply; 10+ messages in thread
From: Paul Kocialkowski @ 2023-11-09 20:16 UTC (permalink / raw)
To: linux-media, linux-rockchip, linux-kernel, linux-staging
Cc: Ezequiel Garcia, Philipp Zabel, Mauro Carvalho Chehab,
Hans Verkuil, Daniel Almeida, Greg Kroah-Hartman,
Nicolas Dufresne, Sebastian Fricke, Thomas Petazzoni,
Paul Kocialkowski
The (TRY_)DECODER_CMD ioctls are used to support flushing when holding capture
buffers is supported. This is the case of this driver but the ioctls were never
hooked to the ioctl ops.
Add them to correctly support flushing.
Fixes: ed7bb87d3d03 ("media: rkvdec: Enable capture buffer holding for H264")
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
---
drivers/staging/media/rkvdec/rkvdec.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
index 84a41792cb4b..ac398b5a9736 100644
--- a/drivers/staging/media/rkvdec/rkvdec.c
+++ b/drivers/staging/media/rkvdec/rkvdec.c
@@ -461,6 +461,9 @@ static const struct v4l2_ioctl_ops rkvdec_ioctl_ops = {
.vidioc_streamon = v4l2_m2m_ioctl_streamon,
.vidioc_streamoff = v4l2_m2m_ioctl_streamoff,
+
+ .vidioc_decoder_cmd = v4l2_m2m_ioctl_stateless_decoder_cmd,
+ .vidioc_try_decoder_cmd = v4l2_m2m_ioctl_stateless_try_decoder_cmd,
};
static int rkvdec_queue_setup(struct vb2_queue *vq, unsigned int *num_buffers,
--
2.42.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 3/4] media: verisilicon: Hook the (TRY_)DECODER_CMD stateless ioctls
2023-11-09 20:16 ` [PATCH 3/4] media: verisilicon: " Paul Kocialkowski
@ 2023-11-09 21:38 ` Nicolas Dufresne
2023-11-10 8:33 ` Paul Kocialkowski
2023-11-10 21:07 ` Daniel Almeida
1 sibling, 1 reply; 10+ messages in thread
From: Nicolas Dufresne @ 2023-11-09 21:38 UTC (permalink / raw)
To: Paul Kocialkowski, linux-media, linux-rockchip, linux-kernel,
linux-staging
Cc: Ezequiel Garcia, Philipp Zabel, Mauro Carvalho Chehab,
Hans Verkuil, Daniel Almeida, Greg Kroah-Hartman,
Sebastian Fricke, Thomas Petazzoni
Hi Paul,
Le jeudi 09 novembre 2023 à 21:16 +0100, Paul Kocialkowski a écrit :
> The (TRY_)DECODER_CMD ioctls are used to support flushing when holding capture
> buffers is supported. This is the case of this driver but the ioctls were never
> hooked to the ioctl ops.
>
> Add them to correctly support flushing.
While this CMD looks useful on paper, we have had no use for it in any
open source user space. So with this in mind, shall we really enable it
? How can we be sure that its actually working as intended ?
Nicolas
>
> Fixes: 340ce50f75a6 ("media: hantro: Enable HOLD_CAPTURE_BUF for H.264")
> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> ---
> drivers/media/platform/verisilicon/hantro_drv.c | 2 ++
> drivers/media/platform/verisilicon/hantro_v4l2.c | 3 +++
> 2 files changed, 5 insertions(+)
>
> diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
> index a9fa05ac56a9..3a2a0f28cbfe 100644
> --- a/drivers/media/platform/verisilicon/hantro_drv.c
> +++ b/drivers/media/platform/verisilicon/hantro_drv.c
> @@ -905,6 +905,8 @@ static int hantro_add_func(struct hantro_dev *vpu, unsigned int funcid)
>
> if (funcid == MEDIA_ENT_F_PROC_VIDEO_ENCODER) {
> vpu->encoder = func;
> + v4l2_disable_ioctl(vfd, VIDIOC_TRY_DECODER_CMD);
> + v4l2_disable_ioctl(vfd, VIDIOC_DECODER_CMD);
> } else {
> vpu->decoder = func;
> v4l2_disable_ioctl(vfd, VIDIOC_TRY_ENCODER_CMD);
> diff --git a/drivers/media/platform/verisilicon/hantro_v4l2.c b/drivers/media/platform/verisilicon/hantro_v4l2.c
> index b3ae037a50f6..db145519fc5d 100644
> --- a/drivers/media/platform/verisilicon/hantro_v4l2.c
> +++ b/drivers/media/platform/verisilicon/hantro_v4l2.c
> @@ -785,6 +785,9 @@ const struct v4l2_ioctl_ops hantro_ioctl_ops = {
> .vidioc_g_selection = vidioc_g_selection,
> .vidioc_s_selection = vidioc_s_selection,
>
> + .vidioc_decoder_cmd = v4l2_m2m_ioctl_stateless_decoder_cmd,
> + .vidioc_try_decoder_cmd = v4l2_m2m_ioctl_stateless_try_decoder_cmd,
> +
> .vidioc_try_encoder_cmd = v4l2_m2m_ioctl_try_encoder_cmd,
> .vidioc_encoder_cmd = vidioc_encoder_cmd,
> };
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 3/4] media: verisilicon: Hook the (TRY_)DECODER_CMD stateless ioctls
2023-11-09 21:38 ` Nicolas Dufresne
@ 2023-11-10 8:33 ` Paul Kocialkowski
0 siblings, 0 replies; 10+ messages in thread
From: Paul Kocialkowski @ 2023-11-10 8:33 UTC (permalink / raw)
To: Nicolas Dufresne
Cc: linux-media, linux-rockchip, linux-kernel, linux-staging,
Ezequiel Garcia, Philipp Zabel, Mauro Carvalho Chehab,
Hans Verkuil, Daniel Almeida, Greg Kroah-Hartman,
Sebastian Fricke, Thomas Petazzoni
[-- Attachment #1: Type: text/plain, Size: 2709 bytes --]
Hi Nicolas,
On Thu 09 Nov 23, 16:38, Nicolas Dufresne wrote:
> Le jeudi 09 novembre 2023 à 21:16 +0100, Paul Kocialkowski a écrit :
> > The (TRY_)DECODER_CMD ioctls are used to support flushing when holding capture
> > buffers is supported. This is the case of this driver but the ioctls were never
> > hooked to the ioctl ops.
> >
> > Add them to correctly support flushing.
>
> While this CMD looks useful on paper, we have had no use for it in any
> open source user space. So with this in mind, shall we really enable it
> ? How can we be sure that its actually working as intended ?
Well I think it's part of the spec that it needs to be supportd.
I must admit I have never used it in a real use case either, but it can be fixed
later (without changing the uAPI) if the implementation turns out to be
malfunctioning.
Cheers,
Paul
> > Fixes: 340ce50f75a6 ("media: hantro: Enable HOLD_CAPTURE_BUF for H.264")
> > Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> > ---
> > drivers/media/platform/verisilicon/hantro_drv.c | 2 ++
> > drivers/media/platform/verisilicon/hantro_v4l2.c | 3 +++
> > 2 files changed, 5 insertions(+)
> >
> > diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
> > index a9fa05ac56a9..3a2a0f28cbfe 100644
> > --- a/drivers/media/platform/verisilicon/hantro_drv.c
> > +++ b/drivers/media/platform/verisilicon/hantro_drv.c
> > @@ -905,6 +905,8 @@ static int hantro_add_func(struct hantro_dev *vpu, unsigned int funcid)
> >
> > if (funcid == MEDIA_ENT_F_PROC_VIDEO_ENCODER) {
> > vpu->encoder = func;
> > + v4l2_disable_ioctl(vfd, VIDIOC_TRY_DECODER_CMD);
> > + v4l2_disable_ioctl(vfd, VIDIOC_DECODER_CMD);
> > } else {
> > vpu->decoder = func;
> > v4l2_disable_ioctl(vfd, VIDIOC_TRY_ENCODER_CMD);
> > diff --git a/drivers/media/platform/verisilicon/hantro_v4l2.c b/drivers/media/platform/verisilicon/hantro_v4l2.c
> > index b3ae037a50f6..db145519fc5d 100644
> > --- a/drivers/media/platform/verisilicon/hantro_v4l2.c
> > +++ b/drivers/media/platform/verisilicon/hantro_v4l2.c
> > @@ -785,6 +785,9 @@ const struct v4l2_ioctl_ops hantro_ioctl_ops = {
> > .vidioc_g_selection = vidioc_g_selection,
> > .vidioc_s_selection = vidioc_s_selection,
> >
> > + .vidioc_decoder_cmd = v4l2_m2m_ioctl_stateless_decoder_cmd,
> > + .vidioc_try_decoder_cmd = v4l2_m2m_ioctl_stateless_try_decoder_cmd,
> > +
> > .vidioc_try_encoder_cmd = v4l2_m2m_ioctl_try_encoder_cmd,
> > .vidioc_encoder_cmd = vidioc_encoder_cmd,
> > };
>
--
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/4] media: vicodec: Disable (TRY_)DECODER_CMD for the stateless case
2023-11-09 20:16 [PATCH 1/4] media: vicodec: Disable (TRY_)DECODER_CMD for the stateless case Paul Kocialkowski
` (2 preceding siblings ...)
2023-11-09 20:16 ` [PATCH 4/4] media: rkvdec: " Paul Kocialkowski
@ 2023-11-10 21:06 ` Daniel Almeida
3 siblings, 0 replies; 10+ messages in thread
From: Daniel Almeida @ 2023-11-10 21:06 UTC (permalink / raw)
To: Paul Kocialkowski
Cc: linux-media, linux-rockchip, linux-kernel, linux-staging,
Ezequiel Garcia, Philipp Zabel, Mauro Carvalho Chehab,
Hans Verkuil, Greg Kroah-Hartman, Nicolas Dufresne,
Sebastian Fricke, Thomas Petazzoni
Hi Paul,
On Thursday, November 09, 2023 17:16 -03, Paul Kocialkowski <paul.kocialkowski@bootlin.com> wrote:
> The (TRY_)DECODER_CMD ioctls are only useful for stateful decoders and for
> stateless decoders that support holding capture buffers (which is not the case
> for this driver).
>
> Disable them when registering the stateless decoder.
>
> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> ---
> .../media/test-drivers/vicodec/vicodec-core.c | 19 +++++++++++++------
> 1 file changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/media/test-drivers/vicodec/vicodec-core.c b/drivers/media/test-drivers/vicodec/vicodec-core.c
> index 6f0e20df74e9..8f7a2b153ee9 100644
> --- a/drivers/media/test-drivers/vicodec/vicodec-core.c
> +++ b/drivers/media/test-drivers/vicodec/vicodec-core.c
> @@ -1240,6 +1240,12 @@ static int vicodec_decoder_cmd(struct file *file, void *fh,
> struct vicodec_ctx *ctx = file2ctx(file);
> int ret;
>
> + /*
> + * This ioctl should not be used with a stateless codec that doesn't
> + * support holding buffers and the associated flush command.
> + */
> + WARN_ON(ctx->is_stateless);
> +
> ret = v4l2_m2m_ioctl_try_decoder_cmd(file, fh, dc);
> if (ret < 0)
> return ret;
> @@ -2025,7 +2031,7 @@ static const struct v4l2_m2m_ops m2m_ops = {
>
> static int register_instance(struct vicodec_dev *dev,
> struct vicodec_dev_instance *dev_instance,
> - const char *name, bool is_enc)
> + const char *name, bool is_enc, bool is_stateless)
> {
> struct video_device *vfd;
> int ret;
> @@ -2045,10 +2051,11 @@ static int register_instance(struct vicodec_dev *dev,
> strscpy(vfd->name, name, sizeof(vfd->name));
> vfd->device_caps = V4L2_CAP_STREAMING |
> (multiplanar ? V4L2_CAP_VIDEO_M2M_MPLANE : V4L2_CAP_VIDEO_M2M);
> - if (is_enc) {
> + if (is_enc || is_stateless) {
> v4l2_disable_ioctl(vfd, VIDIOC_DECODER_CMD);
> v4l2_disable_ioctl(vfd, VIDIOC_TRY_DECODER_CMD);
> - } else {
> + }
> + if (!is_enc) {
> v4l2_disable_ioctl(vfd, VIDIOC_ENCODER_CMD);
> v4l2_disable_ioctl(vfd, VIDIOC_TRY_ENCODER_CMD);
> }
> @@ -2107,17 +2114,17 @@ static int vicodec_probe(struct platform_device *pdev)
> platform_set_drvdata(pdev, dev);
>
> ret = register_instance(dev, &dev->stateful_enc, "stateful-encoder",
> - true);
> + true, false);
> if (ret)
> goto unreg_dev;
>
> ret = register_instance(dev, &dev->stateful_dec, "stateful-decoder",
> - false);
> + false, false);
> if (ret)
> goto unreg_sf_enc;
>
> ret = register_instance(dev, &dev->stateless_dec, "stateless-decoder",
> - false);
> + false, true);
> if (ret)
> goto unreg_sf_dec;
>
> --
> 2.42.1
>
>
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/4] media: visl: Hook the (TRY_)DECODER_CMD stateless ioctls
2023-11-09 20:16 ` [PATCH 2/4] media: visl: Hook the (TRY_)DECODER_CMD stateless ioctls Paul Kocialkowski
@ 2023-11-10 21:06 ` Daniel Almeida
0 siblings, 0 replies; 10+ messages in thread
From: Daniel Almeida @ 2023-11-10 21:06 UTC (permalink / raw)
To: Paul Kocialkowski
Cc: linux-media, linux-rockchip, linux-kernel, linux-staging,
Ezequiel Garcia, Philipp Zabel, Mauro Carvalho Chehab,
Hans Verkuil, Greg Kroah-Hartman, Nicolas Dufresne,
Sebastian Fricke, Thomas Petazzoni
Hi Paul,
On Thursday, November 09, 2023 17:16 -03, Paul Kocialkowski <paul.kocialkowski@bootlin.com> wrote:
> The (TRY_)DECODER_CMD ioctls are used to support flushing when holding capture
> buffers is supported. This is the case of this driver but the ioctls were never
> hooked to the ioctl ops.
>
> Add them to correctly support flushing.
>
> Fixes: 0c078e310b6d ("media: visl: add virtual stateless decoder driver")
> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> ---
> drivers/media/test-drivers/visl/visl-video.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/media/test-drivers/visl/visl-video.c b/drivers/media/test-drivers/visl/visl-video.c
> index 7cac6a6456eb..9303a3e118d7 100644
> --- a/drivers/media/test-drivers/visl/visl-video.c
> +++ b/drivers/media/test-drivers/visl/visl-video.c
> @@ -525,6 +525,9 @@ const struct v4l2_ioctl_ops visl_ioctl_ops = {
> .vidioc_streamon = v4l2_m2m_ioctl_streamon,
> .vidioc_streamoff = v4l2_m2m_ioctl_streamoff,
>
> + .vidioc_decoder_cmd = v4l2_m2m_ioctl_stateless_decoder_cmd,
> + .vidioc_try_decoder_cmd = v4l2_m2m_ioctl_stateless_try_decoder_cmd,
> +
> .vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
> .vidioc_unsubscribe_event = v4l2_event_unsubscribe,
> };
> --
> 2.42.1
>
>
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 3/4] media: verisilicon: Hook the (TRY_)DECODER_CMD stateless ioctls
2023-11-09 20:16 ` [PATCH 3/4] media: verisilicon: " Paul Kocialkowski
2023-11-09 21:38 ` Nicolas Dufresne
@ 2023-11-10 21:07 ` Daniel Almeida
1 sibling, 0 replies; 10+ messages in thread
From: Daniel Almeida @ 2023-11-10 21:07 UTC (permalink / raw)
To: Paul Kocialkowski
Cc: linux-media, linux-rockchip, linux-kernel, linux-staging,
Ezequiel Garcia, Philipp Zabel, Mauro Carvalho Chehab,
Hans Verkuil, Greg Kroah-Hartman, Nicolas Dufresne,
Sebastian Fricke, Thomas Petazzoni
On Thursday, November 09, 2023 17:16 -03, Paul Kocialkowski <paul.kocialkowski@bootlin.com> wrote:
> The (TRY_)DECODER_CMD ioctls are used to support flushing when holding capture
> buffers is supported. This is the case of this driver but the ioctls were never
> hooked to the ioctl ops.
>
> Add them to correctly support flushing.
>
> Fixes: 340ce50f75a6 ("media: hantro: Enable HOLD_CAPTURE_BUF for H.264")
> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> ---
> drivers/media/platform/verisilicon/hantro_drv.c | 2 ++
> drivers/media/platform/verisilicon/hantro_v4l2.c | 3 +++
> 2 files changed, 5 insertions(+)
>
> diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
> index a9fa05ac56a9..3a2a0f28cbfe 100644
> --- a/drivers/media/platform/verisilicon/hantro_drv.c
> +++ b/drivers/media/platform/verisilicon/hantro_drv.c
> @@ -905,6 +905,8 @@ static int hantro_add_func(struct hantro_dev *vpu, unsigned int funcid)
>
> if (funcid == MEDIA_ENT_F_PROC_VIDEO_ENCODER) {
> vpu->encoder = func;
> + v4l2_disable_ioctl(vfd, VIDIOC_TRY_DECODER_CMD);
> + v4l2_disable_ioctl(vfd, VIDIOC_DECODER_CMD);
> } else {
> vpu->decoder = func;
> v4l2_disable_ioctl(vfd, VIDIOC_TRY_ENCODER_CMD);
> diff --git a/drivers/media/platform/verisilicon/hantro_v4l2.c b/drivers/media/platform/verisilicon/hantro_v4l2.c
> index b3ae037a50f6..db145519fc5d 100644
> --- a/drivers/media/platform/verisilicon/hantro_v4l2.c
> +++ b/drivers/media/platform/verisilicon/hantro_v4l2.c
> @@ -785,6 +785,9 @@ const struct v4l2_ioctl_ops hantro_ioctl_ops = {
> .vidioc_g_selection = vidioc_g_selection,
> .vidioc_s_selection = vidioc_s_selection,
>
> + .vidioc_decoder_cmd = v4l2_m2m_ioctl_stateless_decoder_cmd,
> + .vidioc_try_decoder_cmd = v4l2_m2m_ioctl_stateless_try_decoder_cmd,
> +
> .vidioc_try_encoder_cmd = v4l2_m2m_ioctl_try_encoder_cmd,
> .vidioc_encoder_cmd = vidioc_encoder_cmd,
> };
> --
> 2.42.1
>
>
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 4/4] media: rkvdec: Hook the (TRY_)DECODER_CMD stateless ioctls
2023-11-09 20:16 ` [PATCH 4/4] media: rkvdec: " Paul Kocialkowski
@ 2023-11-10 21:08 ` Daniel Almeida
0 siblings, 0 replies; 10+ messages in thread
From: Daniel Almeida @ 2023-11-10 21:08 UTC (permalink / raw)
To: Paul Kocialkowski
Cc: linux-media, linux-rockchip, linux-kernel, linux-staging,
Ezequiel Garcia, Philipp Zabel, Mauro Carvalho Chehab,
Hans Verkuil, Greg Kroah-Hartman, Nicolas Dufresne,
Sebastian Fricke, Thomas Petazzoni
On Thursday, November 09, 2023 17:16 -03, Paul Kocialkowski <paul.kocialkowski@bootlin.com> wrote:
> The (TRY_)DECODER_CMD ioctls are used to support flushing when holding capture
> buffers is supported. This is the case of this driver but the ioctls were never
> hooked to the ioctl ops.
>
> Add them to correctly support flushing.
>
> Fixes: ed7bb87d3d03 ("media: rkvdec: Enable capture buffer holding for H264")
> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> ---
> drivers/staging/media/rkvdec/rkvdec.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
> index 84a41792cb4b..ac398b5a9736 100644
> --- a/drivers/staging/media/rkvdec/rkvdec.c
> +++ b/drivers/staging/media/rkvdec/rkvdec.c
> @@ -461,6 +461,9 @@ static const struct v4l2_ioctl_ops rkvdec_ioctl_ops = {
>
> .vidioc_streamon = v4l2_m2m_ioctl_streamon,
> .vidioc_streamoff = v4l2_m2m_ioctl_streamoff,
> +
> + .vidioc_decoder_cmd = v4l2_m2m_ioctl_stateless_decoder_cmd,
> + .vidioc_try_decoder_cmd = v4l2_m2m_ioctl_stateless_try_decoder_cmd,
> };
>
> static int rkvdec_queue_setup(struct vb2_queue *vq, unsigned int *num_buffers,
> --
> 2.42.1
>
>
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2023-11-10 21:08 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-09 20:16 [PATCH 1/4] media: vicodec: Disable (TRY_)DECODER_CMD for the stateless case Paul Kocialkowski
2023-11-09 20:16 ` [PATCH 2/4] media: visl: Hook the (TRY_)DECODER_CMD stateless ioctls Paul Kocialkowski
2023-11-10 21:06 ` Daniel Almeida
2023-11-09 20:16 ` [PATCH 3/4] media: verisilicon: " Paul Kocialkowski
2023-11-09 21:38 ` Nicolas Dufresne
2023-11-10 8:33 ` Paul Kocialkowski
2023-11-10 21:07 ` Daniel Almeida
2023-11-09 20:16 ` [PATCH 4/4] media: rkvdec: " Paul Kocialkowski
2023-11-10 21:08 ` Daniel Almeida
2023-11-10 21:06 ` [PATCH 1/4] media: vicodec: Disable (TRY_)DECODER_CMD for the stateless case Daniel Almeida
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox