mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-28 15:20:41 +00:00
media: mediatek: vcodec: Use 4K frame size when supported by stateful decoder
After commitb018be06f3
("media: mediatek: vcodec: Read max resolution from dec_capability"), the stateful video decoder driver never really sets its output frame size to 4K. Parse the decoder capability reported by the firmware, and update the output frame size in mtk_init_vdec_params to enable 4K frame size when available. Fixes:b018be06f3
("media: mediatek: vcodec: Read max resolution from dec_capability") Signed-off-by: Pin-yen Lin <treapking@chromium.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
parent
cdc1068ab6
commit
e25528e1db
1 changed files with 11 additions and 1 deletions
|
@ -11,7 +11,7 @@
|
||||||
#include "mtk_vcodec_dec_pm.h"
|
#include "mtk_vcodec_dec_pm.h"
|
||||||
#include "vdec_drv_if.h"
|
#include "vdec_drv_if.h"
|
||||||
|
|
||||||
static const struct mtk_video_fmt mtk_video_formats[] = {
|
static struct mtk_video_fmt mtk_video_formats[] = {
|
||||||
{
|
{
|
||||||
.fourcc = V4L2_PIX_FMT_H264,
|
.fourcc = V4L2_PIX_FMT_H264,
|
||||||
.type = MTK_FMT_DEC,
|
.type = MTK_FMT_DEC,
|
||||||
|
@ -580,6 +580,16 @@ static int mtk_vcodec_dec_ctrls_setup(struct mtk_vcodec_ctx *ctx)
|
||||||
|
|
||||||
static void mtk_init_vdec_params(struct mtk_vcodec_ctx *ctx)
|
static void mtk_init_vdec_params(struct mtk_vcodec_ctx *ctx)
|
||||||
{
|
{
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
|
if (!(ctx->dev->dec_capability & VCODEC_CAPABILITY_4K_DISABLED)) {
|
||||||
|
for (i = 0; i < num_supported_formats; i++) {
|
||||||
|
mtk_video_formats[i].frmsize.max_width =
|
||||||
|
VCODEC_DEC_4K_CODED_WIDTH;
|
||||||
|
mtk_video_formats[i].frmsize.max_height =
|
||||||
|
VCODEC_DEC_4K_CODED_HEIGHT;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct vb2_ops mtk_vdec_frame_vb2_ops = {
|
static struct vb2_ops mtk_vdec_frame_vb2_ops = {
|
||||||
|
|
Loading…
Reference in a new issue