Skip to contentSkip to conversation

media: mediatek: vcodec: Only apply 4K frame sizes on decoder formats

PATCH In review Pin-yen Lin 3 participants 3 messages Apr 22, 2023 – Apr 25, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: mediatek: vcodec: Only apply 4K frame sizes on decoder formats

When VCODEC_CAPABILITY_4K_DISABLED is not set in dec_capability, skip formats that are not MTK_FMT_DEC so only decoder formats is updated in mtk_init_vdec_params.

Fixes e25528e1dbe5 ("media: mediatek: vcodec: Use 4K frame size when supported by stateful decoder")

---

 .../media/platform/mediatek/vcodec/mtk_vcodec_dec_stateful.c   | 3 +++
 1 file changed, 3 insertions(+)
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateful.c +3 -0
index 29991551cf61..0fbd030026c7 100644
@@ -584,6 +584,9 @@ static void mtk_init_vdec_params(struct mtk_vcodec_ctx *ctx)
 
 	if (!(ctx->dev->dec_capability & VCODEC_CAPABILITY_4K_DISABLED)) {
 		for (i = 0; i < num_supported_formats; i++) {
+			if (mtk_video_formats[i].type != MTK_FMT_DEC)
+				continue;
+
 			mtk_video_formats[i].frmsize.max_width =
 				VCODEC_DEC_4K_CODED_WIDTH;
 			mtk_video_formats[i].frmsize.max_height =
Signature · 1 line
2.40.0.634.g4ca3ef3211-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Pin-yen Lin

When VCODEC_CAPABILITY_4K_DISABLED is not set in dec_capability, skip formats that are not MTK_FMT_DEC so only decoder formats is updated in mtk_init_vdec_params.

Fixes e25528e1dbe5 ("media: mediatek: vcodec: Use 4K frame size when supported by stateful decoder")
Quoted 22 lines

---

 .../media/platform/mediatek/vcodec/mtk_vcodec_dec_stateful.c   | 3 +++
 1 file changed, 3 insertions(+)
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateful.c +3 -1
index 29991551cf61..0fbd030026c7 100644
@@ -584,6 +584,9 @@ static void mtk_init_vdec_params(struct mtk_vcodec_ctx *ctx)
 
        if (!(ctx->dev->dec_capability & VCODEC_CAPABILITY_4K_DISABLED)) {
                for (i = 0; i < num_supported_formats; i++) {
+                       if (mtk_video_formats[i].type != MTK_FMT_DEC)
+                               continue;
+
                        mtk_video_formats[i].frmsize.max_width =
                                VCODEC_DEC_4K_CODED_WIDTH;
                        mtk_video_formats[i].frmsize.max_height =
--

2.40.0.634.g4ca3ef3211-goog

maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Pin-yen Lin
Quoted 9 lines · Pin-yen Lin

External email : Please do not click links or open attachments until you have verified the sender or the content.

When VCODEC_CAPABILITY_4K_DISABLED is not set in dec_capability, skip formats that are not MTK_FMT_DEC so only decoder formats is updated in
mtk_init_vdec_params.

Quoted 5 lines
Fixes e25528e1dbe5 ("media: mediatek: vcodec: Use 4K frame size when

supported by stateful decoder")

---

Quoted 27 lines
 .../media/platform/mediatek/vcodec/mtk_vcodec_dec_stateful.c   | 3
+++
 1 file changed, 3 insertions(+)

diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateful.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateful.c index 29991551cf61..0fbd030026c7 100644
---
a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateful.c
+++
b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateful.c

drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateful.c +3 -0
@@ -584,6 +584,9 @@ static void mtk_init_vdec_params(struct
 mtk_vcodec_ctx *ctx)
 
        if (!(ctx->dev->dec_capability &
 VCODEC_CAPABILITY_4K_DISABLED)) {
                for (i = 0; i < num_supported_formats; i++) {
+                       if (mtk_video_formats[i].type != MTK_FMT_DEC)
+                               continue;
+
                        mtk_video_formats[i].frmsize.max_width =
                                VCODEC_DEC_4K_CODED_WIDTH;
                        mtk_video_formats[i].frmsize.max_height =

--
2.40.0.634.g4ca3ef3211-goog