diff --git a/msm/vidc/msm_vdec.c b/msm/vidc/msm_vdec.c index aad7adcba35a..e1733c13cf7c 100644 --- a/msm/vidc/msm_vdec.c +++ b/msm/vidc/msm_vdec.c @@ -375,7 +375,7 @@ static struct msm_vidc_ctrl msm_vdec_ctrls[] = { .type = V4L2_CTRL_TYPE_BOOLEAN, .minimum = V4L2_MPEG_MSM_VIDC_DISABLE, .maximum = V4L2_MPEG_MSM_VIDC_ENABLE, - .default_value = V4L2_MPEG_MSM_VIDC_DISABLE, + .default_value = V4L2_MPEG_MSM_VIDC_ENABLE, .step = 1, }, { @@ -902,9 +902,6 @@ int msm_vdec_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl) inst->buffer_size_limit = ctrl->val; break; case V4L2_CID_MPEG_VIDC_VIDEO_PRIORITY: - inst->flags &= ~VIDC_REALTIME; - if (ctrl->val) - inst->flags |= VIDC_REALTIME; break; case V4L2_CID_MPEG_VIDC_VIDEO_OPERATING_RATE: inst->clk_data.operating_rate = ctrl->val; @@ -1269,7 +1266,6 @@ int msm_vdec_set_priority(struct msm_vidc_inst *inst) { int rc = 0; struct hfi_device *hdev; - struct v4l2_ctrl *ctrl; struct hfi_enable hfi_property; if (!inst || !inst->core) { @@ -1278,8 +1274,7 @@ int msm_vdec_set_priority(struct msm_vidc_inst *inst) } hdev = inst->core->device; - ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_VIDEO_PRIORITY); - hfi_property.enable = (bool)ctrl->val; + hfi_property.enable = is_realtime_session(inst); dprintk(VIDC_HIGH, "%s: %#x\n", __func__, hfi_property.enable); rc = call_hfi_op(hdev, session_set_property, inst->session, diff --git a/msm/vidc/msm_venc.c b/msm/vidc/msm_venc.c index c5c9cd4adc86..e26cd93431ad 100644 --- a/msm/vidc/msm_venc.c +++ b/msm/vidc/msm_venc.c @@ -755,7 +755,7 @@ static struct msm_vidc_ctrl msm_venc_ctrls[] = { .type = V4L2_CTRL_TYPE_BOOLEAN, .minimum = V4L2_MPEG_MSM_VIDC_DISABLE, .maximum = V4L2_MPEG_MSM_VIDC_ENABLE, - .default_value = V4L2_MPEG_MSM_VIDC_DISABLE, + .default_value = V4L2_MPEG_MSM_VIDC_ENABLE, .step = 1, }, { @@ -2016,7 +2016,6 @@ int msm_venc_set_priority(struct msm_vidc_inst *inst) { int rc = 0; struct hfi_device *hdev; - struct v4l2_ctrl *ctrl; struct hfi_enable enable; if (!inst || !inst->core) { @@ -2025,8 +2024,7 @@ int msm_venc_set_priority(struct msm_vidc_inst *inst) } hdev = inst->core->device; - ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_VIDEO_PRIORITY); - enable.enable = !!ctrl->val; + enable.enable = is_realtime_session(inst); dprintk(VIDC_HIGH, "%s: %d\n", __func__, enable.enable); rc = call_hfi_op(hdev, session_set_property, inst->session, diff --git a/msm/vidc/msm_vidc_clocks.c b/msm/vidc/msm_vidc_clocks.c index 062116a1e039..100e5fbfd7d4 100644 --- a/msm/vidc/msm_vidc_clocks.c +++ b/msm/vidc/msm_vidc_clocks.c @@ -1628,7 +1628,7 @@ static u32 get_core_load(struct msm_vidc_core *core, list_for_each_entry(inst, &core->instances, list) { u32 cycles, lp_cycles; - real_time_mode = inst->flags & VIDC_REALTIME ? true : false; + real_time_mode = is_realtime_session(inst); if (!(inst->clk_data.core_id & core_id)) continue; if (real_time_mode != real_time) @@ -1792,7 +1792,7 @@ void msm_print_core_status(struct msm_vidc_core *core, u32 core_id) "WORK_MODE_1" : "WORK_MODE_2", inst->clk_data.work_route, inst->flags & VIDC_LOW_POWER ? "LP" : "HQ", - inst->flags & VIDC_REALTIME ? "RealTime" : "NonRTime", + is_realtime_session(inst) ? "RealTime" : "NonRTime", inst->clk_data.min_freq); } mutex_unlock(&core->lock); diff --git a/msm/vidc/msm_vidc_common.h b/msm/vidc/msm_vidc_common.h index f9c4b4a910b5..fa7c31fcafbd 100644 --- a/msm/vidc/msm_vidc_common.h +++ b/msm/vidc/msm_vidc_common.h @@ -97,7 +97,9 @@ static inline bool is_image_session(struct msm_vidc_inst *inst) static inline bool is_realtime_session(struct msm_vidc_inst *inst) { - return !!(inst->flags & VIDC_REALTIME); + struct v4l2_ctrl *ctrl; + ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_VIDEO_PRIORITY); + return !!ctrl->val; } static inline bool is_secure_session(struct msm_vidc_inst *inst) diff --git a/msm/vidc/msm_vidc_internal.h b/msm/vidc/msm_vidc_internal.h index d36af351b747..d27a7f54c05a 100644 --- a/msm/vidc/msm_vidc_internal.h +++ b/msm/vidc/msm_vidc_internal.h @@ -432,7 +432,6 @@ enum msm_vidc_modes { VIDC_TURBO = BIT(1), VIDC_THUMBNAIL = BIT(2), VIDC_LOW_POWER = BIT(3), - VIDC_REALTIME = BIT(4), }; struct msm_vidc_core_ops {