* [PATCH] Revert "media: mediatek: vcodec: Fix bitstream crop information error"
@ 2023-04-18 21:50 Nícolas F. R. A. Prado
2023-04-19 4:11 ` AngeloGioacchino Del Regno
0 siblings, 1 reply; 2+ messages in thread
From: Nícolas F. R. A. Prado @ 2023-04-18 21:50 UTC (permalink / raw)
To: Hans Verkuil
Cc: kernel, AngeloGioacchino Del Regno, Nícolas F. R. A. Prado,
Andrew-CT Chen, Matthias Brugger, Mauro Carvalho Chehab,
Tiffany Lin, Yunfei Dong, linux-arm-kernel, linux-kernel,
linux-media, linux-mediatek
This reverts commit cd61f3c6794bea2b717fe6083ca2ad189db75418. That
commit's purpose was to prevent the padding from being decoded when
userspace didn't set a selection, relying on the default one.
However, as described in the Step 6 of the Initialization procedure for
the Memory-to-Memory Stateful Video Encoder Interface [1]:
"Set the visible resolution for the stream metadata via
VIDIOC_S_SELECTION() on the OUTPUT queue if it is desired to be
different than the full OUTPUT resolution."
And from the Note:
"To avoid encoding the padding, the client needs to explicitly configure
this selection target"
Hence the behavior in the original commit doesn't follow the interface
and needs to be reverted.
This fixes the following v4l2-compliance failure observed on
mt8192-asurada-spherion:
fail: v4l2-test-formats.cpp(924): sel.r.width != fmt.g_width()
test VIDIOC_S_FMT: FAIL
[1] https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/dev-encoder.html#initialization
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
---
Hi,
With this patch applied, there's only one failure left on
mt8192-asurada-spherion:
fail: v4l2-test-controls.cpp(1167): node->codec_mask & STATEFUL_ENCODER
test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL
But from the documentation I see that the V4L2_EVENT_EOS for stateful
encoder is deprecated behavior, so should the v4l2-compliance test be
the one changed to not require this?
We're enabling running v4l2-compliance with this driver in KernelCI [2],
so after we fix these two remaining issues it should be easy to notice
if any failures are introduced.
Thanks,
Nícolas
[2] https://github.com/kernelci/kernelci-core/pull/1889
drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c
index db65e77bd373..9ff439a50f53 100644
--- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c
+++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c
@@ -505,13 +505,13 @@ static int vidioc_venc_s_fmt_out(struct file *file, void *priv,
f->fmt.pix.pixelformat = fmt->fourcc;
}
- q_data->visible_width = f->fmt.pix_mp.width;
- q_data->visible_height = f->fmt.pix_mp.height;
- q_data->fmt = fmt;
- ret = vidioc_try_fmt_out(ctx, f, q_data->fmt);
+ ret = vidioc_try_fmt_out(ctx, f, fmt);
if (ret)
return ret;
+ q_data->fmt = fmt;
+ q_data->visible_width = f->fmt.pix_mp.width;
+ q_data->visible_height = f->fmt.pix_mp.height;
q_data->coded_width = f->fmt.pix_mp.width;
q_data->coded_height = f->fmt.pix_mp.height;
--
2.40.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Revert "media: mediatek: vcodec: Fix bitstream crop information error"
2023-04-18 21:50 [PATCH] Revert "media: mediatek: vcodec: Fix bitstream crop information error" Nícolas F. R. A. Prado
@ 2023-04-19 4:11 ` AngeloGioacchino Del Regno
0 siblings, 0 replies; 2+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-04-19 4:11 UTC (permalink / raw)
To: Nícolas F. R. A. Prado, Hans Verkuil
Cc: kernel, Andrew-CT Chen, Matthias Brugger, Mauro Carvalho Chehab,
Tiffany Lin, Yunfei Dong, linux-arm-kernel, linux-kernel,
linux-media, linux-mediatek
Il 18/04/23 23:50, Nícolas F. R. A. Prado ha scritto:
> This reverts commit cd61f3c6794bea2b717fe6083ca2ad189db75418. That
> commit's purpose was to prevent the padding from being decoded when
> userspace didn't set a selection, relying on the default one.
>
> However, as described in the Step 6 of the Initialization procedure for
> the Memory-to-Memory Stateful Video Encoder Interface [1]:
>
> "Set the visible resolution for the stream metadata via
> VIDIOC_S_SELECTION() on the OUTPUT queue if it is desired to be
> different than the full OUTPUT resolution."
>
> And from the Note:
>
> "To avoid encoding the padding, the client needs to explicitly configure
> this selection target"
>
> Hence the behavior in the original commit doesn't follow the interface
> and needs to be reverted.
>
> This fixes the following v4l2-compliance failure observed on
> mt8192-asurada-spherion:
>
> fail: v4l2-test-formats.cpp(924): sel.r.width != fmt.g_width()
> test VIDIOC_S_FMT: FAIL
>
> [1] https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/dev-encoder.html#initialization
>
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
On MT8192 Asurada Spherion and MT8195 Cherry Tomato:
Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-04-19 4:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-18 21:50 [PATCH] Revert "media: mediatek: vcodec: Fix bitstream crop information error" Nícolas F. R. A. Prado
2023-04-19 4:11 ` AngeloGioacchino Del Regno
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox