media: mfc: fix prevent issue
authorJeonghee Kim <jhhhh.kim@samsung.com>
Fri, 23 Mar 2018 10:01:07 +0000 (19:01 +0900)
committerSunyoung Kang <sy0816.kang@samsung.com>
Tue, 29 May 2018 06:59:18 +0000 (15:59 +0900)
CID: 205513, 205513, 205435, 205436

Change-Id: I6e9434f60fae904d3dab0996dc75965f5616c650
Signed-off-by: Jeonghee Kim <jhhhh.kim@samsung.com>
drivers/media/platform/exynos/mfc/s5p_mfc_dec_ops.c
drivers/media/platform/exynos/mfc/s5p_mfc_qos.c

index 018eeade5be4281741d0c01af3aec6e5b8152fe7..0029d4956cae24372676324af44b4d35a3647d7f 100644 (file)
@@ -817,17 +817,7 @@ static int s5p_mfc_dec_get_buf_ctrls_val_nal_q_dec(struct s5p_mfc_ctx *ctx,
                        value = pOutStr->MasteringDisplayColourVolumeSei1;
                        break;
                case V4L2_CID_MPEG_VIDEO_FULL_RANGE_FLAG:
-                       if (IS_VP9_DEC(ctx)) {
-                               buf_ctrl->val = dec->color_range;
-                               buf_ctrl->has_new = 1;
-                               continue;
-                       }
                case V4L2_CID_MPEG_VIDEO_COLOUR_PRIMARIES:
-                       if (IS_VP9_DEC(ctx)) {
-                               buf_ctrl->val = dec->color_space;
-                               buf_ctrl->has_new = 1;
-                               continue;
-                       }
                case V4L2_CID_MPEG_VIDEO_FORMAT:
                case V4L2_CID_MPEG_VIDEO_TRANSFER_CHARACTERISTICS:
                case V4L2_CID_MPEG_VIDEO_MATRIX_COEFFICIENTS:
@@ -855,6 +845,13 @@ static int s5p_mfc_dec_get_buf_ctrls_val_nal_q_dec(struct s5p_mfc_ctx *ctx,
                buf_ctrl->val = value;
                buf_ctrl->has_new = 1;
 
+               if (IS_VP9_DEC(ctx)) {
+                       if (buf_ctrl->id == V4L2_CID_MPEG_VIDEO_FULL_RANGE_FLAG)
+                               buf_ctrl->val = dec->color_range;
+                       else if (buf_ctrl->id == V4L2_CID_MPEG_VIDEO_COLOUR_PRIMARIES)
+                               buf_ctrl->val = dec->color_space;
+               }
+
                mfc_debug(3, "NAL Q: dec_get_buf_ctrls, ctrl id: 0x%x, val: %d\n",
                                buf_ctrl->id, buf_ctrl->val);
        }
index 1e362618cb82f800c7714a94160ad69823913e6a..07fb2ef2858617d2206b9812752cb2d11661e2b7 100644 (file)
@@ -411,8 +411,8 @@ void s5p_mfc_qos_on(struct s5p_mfc_ctx *ctx)
        struct s5p_mfc_platdata *pdata = dev->pdata;
        struct s5p_mfc_qos *qos_table = pdata->qos_table;
        struct s5p_mfc_ctx *qos_ctx;
-       unsigned long hw_mb = 0, total_mb = 0;
-       unsigned int fw_time, sw_time, total_fps = 0;
+       unsigned long hw_mb = 0, total_mb = 0, total_fps = 0;
+       unsigned int fw_time, sw_time;
        int i, found = 0, enc_found = 0;
        int start_qos_step;
 #ifdef CONFIG_EXYNOS_BTS
@@ -457,7 +457,7 @@ void s5p_mfc_qos_on(struct s5p_mfc_ctx *ctx)
                total_mb = ((1000000 * hw_mb) / (1000000 - (total_fps * sw_time)));
 
                mfc_debug(4, "QoS table[%d] fw_time: %dus, hw_mb: %ld, "
-                               "sw_time: %d, total_fps: %d, total_mb: %ld\n",
+                               "sw_time: %d, total_fps: %ld, total_mb: %ld\n",
                                i, fw_time, hw_mb, sw_time, total_fps, total_mb);
 
                if ((total_mb > qos_table[i].threshold_mb) || (i == 0))
@@ -480,8 +480,8 @@ void s5p_mfc_qos_off(struct s5p_mfc_ctx *ctx)
        struct s5p_mfc_platdata *pdata = dev->pdata;
        struct s5p_mfc_qos *qos_table = pdata->qos_table;
        struct s5p_mfc_ctx *qos_ctx;
-       unsigned long hw_mb = 0, total_mb = 0;
-       unsigned int fw_time, sw_time, total_fps = 0;
+       unsigned long hw_mb = 0, total_mb = 0, total_fps = 0;
+       unsigned int fw_time, sw_time;
        int i, found = 0, enc_found = 0;
        int start_qos_step;
 #ifdef CONFIG_EXYNOS_BTS
@@ -531,7 +531,7 @@ void s5p_mfc_qos_off(struct s5p_mfc_ctx *ctx)
 
                total_mb = ((1000000 * hw_mb) / (1000000 - (total_fps * sw_time)));
                mfc_debug(4, "QoS table[%d] fw_time: %dus, hw_mb: %ld, "
-                               "sw_time: %d, total_fps: %d, total_mb: %ld\n",
+                               "sw_time: %d, total_fps: %ld, total_mb: %ld\n",
                                i, fw_time, hw_mb, sw_time, total_fps, total_mb);
 
                if ((total_mb > qos_table[i].threshold_mb) || (total_mb == 0) || (i == 0))