From: Ayoung Sim Date: Tue, 20 Mar 2018 07:16:29 +0000 (+0900) Subject: media: mfc: change the format to right setting X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f20946fcd83e5591e2b31bca1fdb7d8cc11f0ce5;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git media: mfc: change the format to right setting 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 --- diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_dec.c b/drivers/media/platform/exynos/mfc/s5p_mfc_dec.c index fe035867795f..bd0f354f372f 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_dec.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_dec.c @@ -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)