[RAMEN9610-10029][COMMON] media: mfc: set the 10bit memtype when INIT_BUF also
authorAyoung Sim <a.sim@samsung.com>
Thu, 29 Nov 2018 07:04:08 +0000 (16:04 +0900)
committerhskang <hs1218.kang@samsung.com>
Fri, 28 Dec 2018 09:54:27 +0000 (18:54 +0900)
10bit format can be changed after SEQ_DONE from P010(P210) to 8+2 type.
However, original F/W couldn't get the memtype setting when INIT_BUF.
It was valid when only SEQ_START.
Because new F/W supports this when only SEQ_START but also INIT_BUF,
driver set the 10bit memtype when INIT_BUF time also.

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

index 9e1ddd2d1944217b1ddc96e80b0857a8cb48b245..b2e62bd740c513927b9ad65c78f0b54a099730de 100644 (file)
@@ -284,46 +284,9 @@ int mfc_cmd_enc_seq_header(struct mfc_ctx *ctx)
 int mfc_cmd_dec_init_buffers(struct mfc_ctx *ctx)
 {
        struct mfc_dev *dev = ctx->dev;
-       unsigned int reg = 0, pix_val;
        int ret;
 
-       switch (ctx->dst_fmt->fourcc) {
-       case V4L2_PIX_FMT_NV12M:
-       case V4L2_PIX_FMT_NV12N:
-       case V4L2_PIX_FMT_NV12MT_16X16:
-       case V4L2_PIX_FMT_NV16M:
-       case V4L2_PIX_FMT_NV12N_10B:
-       case V4L2_PIX_FMT_NV12M_S10B:
-       case V4L2_PIX_FMT_NV16M_S10B:
-       case V4L2_PIX_FMT_NV12M_P010:
-       case V4L2_PIX_FMT_NV16M_P210:
-               pix_val = 0;
-               break;
-       case V4L2_PIX_FMT_NV21M:
-       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:
-               pix_val = 1;
-               break;
-       case V4L2_PIX_FMT_YVU420M:
-               pix_val = 2;
-               break;
-       case V4L2_PIX_FMT_YUV420M:
-       case V4L2_PIX_FMT_YUV420N:
-               pix_val = 3;
-               break;
-       default:
-               pix_val = 0;
-               break;
-       }
-       reg = MFC_READL(MFC_REG_PIXEL_FORMAT);
-       reg &= ~(0xF);
-       reg |= pix_val & 0xF;
-       MFC_WRITEL(reg, MFC_REG_PIXEL_FORMAT);
-       mfc_debug(2, "[FRAME] pixel format: %d, mem_type_10bit should be fixed on SEQ_START(reg: %#x)\n",
-                       pix_val, reg);
+       mfc_set_pixel_format(ctx, ctx->dst_fmt->fourcc);
 
        mfc_clean_ctx_int_flags(ctx);
        ret = mfc_set_dec_codec_buffers(ctx);