media: mfc: change the format to right setting
authorAyoung Sim <a.sim@samsung.com>
Tue, 20 Mar 2018 07:16:29 +0000 (16:16 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:22:22 +0000 (20:22 +0300)
When user set the 10bit or 422 format even if stream is 420 8bit,
driver changes the format to YUV420 8bit format.

Change-Id: Ifeb3fe541776dad89f6fbb51286bff33d5c6d555
Signed-off-by: Ayoung Sim <a.sim@samsung.com>
drivers/media/platform/exynos/mfc/s5p_mfc_dec.c

index fe035867795f399f9627881041bf7a9712bce7e4..bd0f354f372faf125b86c5741a17023614f31a76 100644 (file)
@@ -152,6 +152,7 @@ static void mfc_dec_change_format(struct s5p_mfc_ctx *ctx)
                case V4L2_PIX_FMT_NV61M_S10B:
                case V4L2_PIX_FMT_NV16M_P210:
                case V4L2_PIX_FMT_NV61M_P210:
+                       /* It is right format */
                        break;
                case V4L2_PIX_FMT_NV12M:
                case V4L2_PIX_FMT_NV16M:
@@ -180,6 +181,7 @@ static void mfc_dec_change_format(struct s5p_mfc_ctx *ctx)
                        case V4L2_PIX_FMT_NV21M_S10B:
                        case V4L2_PIX_FMT_NV12M_P010:
                        case V4L2_PIX_FMT_NV21M_P010:
+                               /* It is right format */
                                break;
                        case V4L2_PIX_FMT_NV12M:
                        case V4L2_PIX_FMT_NV16M:
@@ -203,6 +205,7 @@ static void mfc_dec_change_format(struct s5p_mfc_ctx *ctx)
                switch (org_fmt) {
                case V4L2_PIX_FMT_NV16M:
                case V4L2_PIX_FMT_NV61M:
+                       /* It is right format */
                        break;
                case V4L2_PIX_FMT_NV12M:
                case V4L2_PIX_FMT_NV12M_S10B:
@@ -223,6 +226,27 @@ static void mfc_dec_change_format(struct s5p_mfc_ctx *ctx)
                        break;
                }
                ctx->raw_buf.num_planes = 2;
+       } else {
+               /* YUV420 8bit */
+               switch (org_fmt) {
+               case V4L2_PIX_FMT_NV16M:
+               case V4L2_PIX_FMT_NV12M_S10B:
+               case V4L2_PIX_FMT_NV16M_S10B:
+               case V4L2_PIX_FMT_NV12M_P010:
+               case V4L2_PIX_FMT_NV16M_P210:
+                       ctx->dst_fmt = (struct s5p_mfc_fmt *)&dec_formats[5];
+                       break;
+               case V4L2_PIX_FMT_NV61M:
+               case V4L2_PIX_FMT_NV21M_S10B:
+               case V4L2_PIX_FMT_NV61M_S10B:
+               case V4L2_PIX_FMT_NV21M_P010:
+               case V4L2_PIX_FMT_NV61M_P210:
+                       ctx->dst_fmt = (struct s5p_mfc_fmt *)&dec_formats[10];
+                       break;
+               default:
+                       /* It is right format */
+                       break;
+               }
        }
 
        if (org_fmt != ctx->dst_fmt->fourcc)