From 9b3568c5030e78c87fa8dabdf40ef6fd25c58911 Mon Sep 17 00:00:00 2001 From: Jeonghee Kim Date: Fri, 23 Mar 2018 19:01:07 +0900 Subject: [PATCH] media: mfc: fix prevent issue CID: 205513, 205513, 205435, 205436 Change-Id: I6e9434f60fae904d3dab0996dc75965f5616c650 Signed-off-by: Jeonghee Kim --- .../media/platform/exynos/mfc/s5p_mfc_dec_ops.c | 17 +++++++---------- drivers/media/platform/exynos/mfc/s5p_mfc_qos.c | 12 ++++++------ 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_dec_ops.c b/drivers/media/platform/exynos/mfc/s5p_mfc_dec_ops.c index 018eeade5be4..0029d4956cae 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_dec_ops.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_dec_ops.c @@ -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); } diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_qos.c b/drivers/media/platform/exynos/mfc/s5p_mfc_qos.c index 1e362618cb82..07fb2ef28586 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_qos.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_qos.c @@ -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)) -- 2.20.1