[PATCH v2 07/14] media: mediatek: vcodec: define MT8196 vcodec levels.

Yunfei Dong posted 14 patches 5 months, 4 weeks ago
[PATCH v2 07/14] media: mediatek: vcodec: define MT8196 vcodec levels.
Posted by Yunfei Dong 5 months, 4 weeks ago
The supported level and profile are not the same for different
codecs and architecture. Select the correct one.

Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
---
 .../mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c      | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c
index d873159b9b30..c1cef78471a9 100644
--- a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c
+++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c
@@ -555,6 +555,7 @@ static void mtk_vcodec_dec_fill_h264_level(struct v4l2_ctrl_config *cfg,
 		cfg->max = V4L2_MPEG_VIDEO_H264_LEVEL_5_2;
 		break;
 	case MTK_VDEC_MT8195:
+	case MTK_VDEC_MT8196:
 		cfg->max = V4L2_MPEG_VIDEO_H264_LEVEL_6_0;
 		break;
 	case MTK_VDEC_MT8183:
@@ -573,6 +574,7 @@ static void mtk_vcodec_dec_fill_h264_profile(struct v4l2_ctrl_config *cfg,
 	switch (ctx->dev->chip_name) {
 	case MTK_VDEC_MT8188:
 	case MTK_VDEC_MT8195:
+	case MTK_VDEC_MT8196:
 		cfg->max = V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10;
 		break;
 	default:
@@ -589,6 +591,7 @@ static void mtk_vcodec_dec_fill_h265_level(struct v4l2_ctrl_config *cfg,
 		cfg->max = V4L2_MPEG_VIDEO_HEVC_LEVEL_5_1;
 		break;
 	case MTK_VDEC_MT8195:
+	case MTK_VDEC_MT8196:
 		cfg->max = V4L2_MPEG_VIDEO_HEVC_LEVEL_5_2;
 		break;
 	default:
@@ -603,6 +606,7 @@ static void mtk_vcodec_dec_fill_h265_profile(struct v4l2_ctrl_config *cfg,
 	switch (ctx->dev->chip_name) {
 	case MTK_VDEC_MT8188:
 	case MTK_VDEC_MT8195:
+	case MTK_VDEC_MT8196:
 		cfg->max = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10;
 		break;
 	default:
@@ -620,6 +624,7 @@ static void mtk_vcodec_dec_fill_vp9_level(struct v4l2_ctrl_config *cfg,
 		cfg->max = V4L2_MPEG_VIDEO_VP9_LEVEL_5_1;
 		break;
 	case MTK_VDEC_MT8195:
+	case MTK_VDEC_MT8196:
 		cfg->max = V4L2_MPEG_VIDEO_VP9_LEVEL_5_2;
 		break;
 	case MTK_VDEC_MT8186:
@@ -637,6 +642,7 @@ static void mtk_vcodec_dec_fill_vp9_profile(struct v4l2_ctrl_config *cfg,
 	switch (ctx->dev->chip_name) {
 	case MTK_VDEC_MT8188:
 	case MTK_VDEC_MT8195:
+	case MTK_VDEC_MT8196:
 		cfg->max = V4L2_MPEG_VIDEO_VP9_PROFILE_2;
 		break;
 	default:
-- 
2.45.2
Re: [PATCH v2 07/14] media: mediatek: vcodec: define MT8196 vcodec levels.
Posted by Nicolas Dufresne 2 months, 1 week ago
Le vendredi 15 août 2025 à 16:52 +0800, Yunfei Dong a écrit :
> The supported level and profile are not the same for different
> codecs and architecture. Select the correct one.
> 
> Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>

Would be nicer inside the match data. Though, its a cheap switch here (not sure
why it was strcmp in previous patch. That one is at least acceptable, but we can
do better.

Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>

Nicolas

> ---
>  .../mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c      | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c
> index d873159b9b30..c1cef78471a9 100644
> --- a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c
> +++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c
> @@ -555,6 +555,7 @@ static void mtk_vcodec_dec_fill_h264_level(struct v4l2_ctrl_config *cfg,
>  		cfg->max = V4L2_MPEG_VIDEO_H264_LEVEL_5_2;
>  		break;
>  	case MTK_VDEC_MT8195:
> +	case MTK_VDEC_MT8196:
>  		cfg->max = V4L2_MPEG_VIDEO_H264_LEVEL_6_0;
>  		break;
>  	case MTK_VDEC_MT8183:
> @@ -573,6 +574,7 @@ static void mtk_vcodec_dec_fill_h264_profile(struct v4l2_ctrl_config *cfg,
>  	switch (ctx->dev->chip_name) {
>  	case MTK_VDEC_MT8188:
>  	case MTK_VDEC_MT8195:
> +	case MTK_VDEC_MT8196:
>  		cfg->max = V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10;
>  		break;
>  	default:
> @@ -589,6 +591,7 @@ static void mtk_vcodec_dec_fill_h265_level(struct v4l2_ctrl_config *cfg,
>  		cfg->max = V4L2_MPEG_VIDEO_HEVC_LEVEL_5_1;
>  		break;
>  	case MTK_VDEC_MT8195:
> +	case MTK_VDEC_MT8196:
>  		cfg->max = V4L2_MPEG_VIDEO_HEVC_LEVEL_5_2;
>  		break;
>  	default:
> @@ -603,6 +606,7 @@ static void mtk_vcodec_dec_fill_h265_profile(struct v4l2_ctrl_config *cfg,
>  	switch (ctx->dev->chip_name) {
>  	case MTK_VDEC_MT8188:
>  	case MTK_VDEC_MT8195:
> +	case MTK_VDEC_MT8196:
>  		cfg->max = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10;
>  		break;
>  	default:
> @@ -620,6 +624,7 @@ static void mtk_vcodec_dec_fill_vp9_level(struct v4l2_ctrl_config *cfg,
>  		cfg->max = V4L2_MPEG_VIDEO_VP9_LEVEL_5_1;
>  		break;
>  	case MTK_VDEC_MT8195:
> +	case MTK_VDEC_MT8196:
>  		cfg->max = V4L2_MPEG_VIDEO_VP9_LEVEL_5_2;
>  		break;
>  	case MTK_VDEC_MT8186:
> @@ -637,6 +642,7 @@ static void mtk_vcodec_dec_fill_vp9_profile(struct v4l2_ctrl_config *cfg,
>  	switch (ctx->dev->chip_name) {
>  	case MTK_VDEC_MT8188:
>  	case MTK_VDEC_MT8195:
> +	case MTK_VDEC_MT8196:
>  		cfg->max = V4L2_MPEG_VIDEO_VP9_PROFILE_2;
>  		break;
>  	default: