Loading drivers/media/platform/msm/vidc_3x/msm_vdec.c +26 −0 Original line number Diff line number Diff line Loading @@ -1943,6 +1943,7 @@ int msm_vdec_inst_init(struct msm_vidc_inst *inst) inst->buffer_mode_set[OUTPUT_PORT] = HAL_BUFFER_MODE_STATIC; inst->buffer_mode_set[CAPTURE_PORT] = HAL_BUFFER_MODE_STATIC; inst->prop.fps = DEFAULT_FPS; inst->prop.operating_rate = 0; memcpy(&inst->fmts[OUTPUT_PORT], &vdec_formats[2], sizeof(struct msm_vidc_format)); memcpy(&inst->fmts[CAPTURE_PORT], &vdec_formats[0], Loading Loading @@ -2551,8 +2552,33 @@ static int try_set_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl) */ hal_property.enable = !(ctrl->val); pdata = &hal_property; switch (ctrl->val) { case V4L2_MPEG_VIDC_VIDEO_PRIORITY_REALTIME_DISABLE: inst->flags &= ~VIDC_REALTIME; break; case V4L2_MPEG_VIDC_VIDEO_PRIORITY_REALTIME_ENABLE: inst->flags |= VIDC_REALTIME; break; default: dprintk(VIDC_WARN, "inst(%pK) invalid priority ctrl value %#x\n", inst, ctrl->val); break; } break; case V4L2_CID_MPEG_VIDC_VIDEO_OPERATING_RATE: if ((ctrl->val >> 16) < inst->capability.frame_rate.min || (ctrl->val >> 16) > inst->capability.frame_rate.max) { dprintk(VIDC_ERR, "Invalid operating rate %u\n", (ctrl->val >> 16)); rc = -ENOTSUPP; } else { dprintk(VIDC_DBG, "inst(%pK) operating rate changed from %d to %d\n", inst, inst->prop.operating_rate >> 16, ctrl->val >> 16); inst->prop.operating_rate = ctrl->val; } break; default: break; Loading drivers/media/platform/msm/vidc_3x/msm_venc.c +26 −0 Original line number Diff line number Diff line Loading @@ -3625,8 +3625,33 @@ static int try_set_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl) */ enable.enable = !(ctrl->val); pdata = &enable; switch (ctrl->val) { case V4L2_MPEG_VIDC_VIDEO_PRIORITY_REALTIME_DISABLE: inst->flags &= ~VIDC_REALTIME; break; case V4L2_MPEG_VIDC_VIDEO_PRIORITY_REALTIME_ENABLE: inst->flags |= VIDC_REALTIME; break; default: dprintk(VIDC_WARN, "inst(%pK) invalid priority ctrl value %#x\n", inst, ctrl->val); break; } break; case V4L2_CID_MPEG_VIDC_VIDEO_OPERATING_RATE: if ((ctrl->val >> 16) < inst->capability.frame_rate.min || (ctrl->val >> 16) > inst->capability.frame_rate.max) { dprintk(VIDC_ERR, "Invalid operating rate %u\n", (ctrl->val >> 16)); rc = -ENOTSUPP; } else { dprintk(VIDC_DBG, "inst(%pK) operating rate changed from %d to %d\n", inst, inst->prop.operating_rate >> 16, ctrl->val >> 16); inst->prop.operating_rate = ctrl->val; } break; case V4L2_CID_MPEG_VIDC_VIDEO_VENC_BITRATE_TYPE: { Loading Loading @@ -4067,6 +4092,7 @@ int msm_venc_inst_init(struct msm_vidc_inst *inst) inst->buffer_mode_set[OUTPUT_PORT] = HAL_BUFFER_MODE_STATIC; inst->buffer_mode_set[CAPTURE_PORT] = HAL_BUFFER_MODE_STATIC; inst->prop.fps = DEFAULT_FPS; inst->prop.operating_rate = 0; inst->capability.pixelprocess_capabilities = 0; memcpy(&inst->fmts[CAPTURE_PORT], &venc_formats[4], sizeof(struct msm_vidc_format)); Loading drivers/media/platform/msm/vidc_3x/msm_vidc_common.c +13 −20 Original line number Diff line number Diff line Loading @@ -258,14 +258,9 @@ int msm_comm_ctrl_deinit(struct msm_vidc_inst *inst) return 0; } static inline bool is_non_realtime_session(struct msm_vidc_inst *inst) static inline bool is_realtime_session(struct msm_vidc_inst *inst) { int rc = 0; struct v4l2_control ctrl = { .id = V4L2_CID_MPEG_VIDC_VIDEO_PRIORITY }; rc = msm_comm_g_ctrl(inst, &ctrl); return (!rc && ctrl.value); return !!(inst->flags & VIDC_REALTIME); } enum multi_stream msm_comm_get_stream_output_mode(struct msm_vidc_inst *inst) Loading Loading @@ -297,17 +292,15 @@ static int msm_comm_get_mbs_per_frame(struct msm_vidc_inst *inst) static int msm_comm_get_mbs_per_sec(struct msm_vidc_inst *inst) { int rc; u32 fps; struct v4l2_control ctrl; int mb_per_frame; u32 oper_rate; mb_per_frame = msm_comm_get_mbs_per_frame(inst); oper_rate = inst->prop.operating_rate; ctrl.id = V4L2_CID_MPEG_VIDC_VIDEO_OPERATING_RATE; rc = msm_comm_g_ctrl(inst, &ctrl); if (!rc && ctrl.value) { fps = (ctrl.value >> 16) ? ctrl.value >> 16 : 1; if (oper_rate) { fps = (oper_rate >> 16) ? oper_rate >> 16 : 1; /* * Check if operating rate is less than fps. * If Yes, then use fps to scale the clocks Loading Loading @@ -354,7 +347,7 @@ int msm_comm_get_inst_load(struct msm_vidc_inst *inst, * ----------------|----------------------|------------------------| */ if (is_non_realtime_session(inst) && if (is_realtime_session(inst) && (quirks & LOAD_CALC_IGNORE_NON_REALTIME_LOAD)) { if (!inst->prop.fps) { dprintk(VIDC_INFO, "instance:%pK fps = 0\n", inst); Loading Loading @@ -535,7 +528,7 @@ static int msm_comm_vote_bus(struct msm_vidc_core *core) list_for_each_entry(inst, &core->instances, list) { int codec = 0, yuv = 0; struct v4l2_control ctrl; u32 oper_rate; codec = inst->session_type == MSM_VIDC_DECODER ? inst->fmts[OUTPUT_PORT].fourcc : Loading @@ -552,11 +545,11 @@ static int msm_comm_vote_bus(struct msm_vidc_core *core) vote_data[i].height = max(inst->prop.height[CAPTURE_PORT], inst->prop.height[OUTPUT_PORT]); ctrl.id = V4L2_CID_MPEG_VIDC_VIDEO_OPERATING_RATE; rc = msm_comm_g_ctrl(inst, &ctrl); if (!rc && ctrl.value) vote_data[i].fps = (ctrl.value >> 16) ? ctrl.value >> 16 : 1; oper_rate = inst->prop.operating_rate; if (oper_rate) vote_data[i].fps = (oper_rate >> 16) ? oper_rate >> 16 : 1; else vote_data[i].fps = inst->prop.fps; Loading drivers/media/platform/msm/vidc_3x/msm_vidc_internal.h +2 −0 Original line number Diff line number Diff line Loading @@ -173,6 +173,7 @@ struct session_prop { u32 height[MAX_PORT_NUM]; u32 fps; u32 bitrate; u32 operating_rate; }; struct buf_queue { Loading Loading @@ -239,6 +240,7 @@ 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 { Loading Loading
drivers/media/platform/msm/vidc_3x/msm_vdec.c +26 −0 Original line number Diff line number Diff line Loading @@ -1943,6 +1943,7 @@ int msm_vdec_inst_init(struct msm_vidc_inst *inst) inst->buffer_mode_set[OUTPUT_PORT] = HAL_BUFFER_MODE_STATIC; inst->buffer_mode_set[CAPTURE_PORT] = HAL_BUFFER_MODE_STATIC; inst->prop.fps = DEFAULT_FPS; inst->prop.operating_rate = 0; memcpy(&inst->fmts[OUTPUT_PORT], &vdec_formats[2], sizeof(struct msm_vidc_format)); memcpy(&inst->fmts[CAPTURE_PORT], &vdec_formats[0], Loading Loading @@ -2551,8 +2552,33 @@ static int try_set_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl) */ hal_property.enable = !(ctrl->val); pdata = &hal_property; switch (ctrl->val) { case V4L2_MPEG_VIDC_VIDEO_PRIORITY_REALTIME_DISABLE: inst->flags &= ~VIDC_REALTIME; break; case V4L2_MPEG_VIDC_VIDEO_PRIORITY_REALTIME_ENABLE: inst->flags |= VIDC_REALTIME; break; default: dprintk(VIDC_WARN, "inst(%pK) invalid priority ctrl value %#x\n", inst, ctrl->val); break; } break; case V4L2_CID_MPEG_VIDC_VIDEO_OPERATING_RATE: if ((ctrl->val >> 16) < inst->capability.frame_rate.min || (ctrl->val >> 16) > inst->capability.frame_rate.max) { dprintk(VIDC_ERR, "Invalid operating rate %u\n", (ctrl->val >> 16)); rc = -ENOTSUPP; } else { dprintk(VIDC_DBG, "inst(%pK) operating rate changed from %d to %d\n", inst, inst->prop.operating_rate >> 16, ctrl->val >> 16); inst->prop.operating_rate = ctrl->val; } break; default: break; Loading
drivers/media/platform/msm/vidc_3x/msm_venc.c +26 −0 Original line number Diff line number Diff line Loading @@ -3625,8 +3625,33 @@ static int try_set_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl) */ enable.enable = !(ctrl->val); pdata = &enable; switch (ctrl->val) { case V4L2_MPEG_VIDC_VIDEO_PRIORITY_REALTIME_DISABLE: inst->flags &= ~VIDC_REALTIME; break; case V4L2_MPEG_VIDC_VIDEO_PRIORITY_REALTIME_ENABLE: inst->flags |= VIDC_REALTIME; break; default: dprintk(VIDC_WARN, "inst(%pK) invalid priority ctrl value %#x\n", inst, ctrl->val); break; } break; case V4L2_CID_MPEG_VIDC_VIDEO_OPERATING_RATE: if ((ctrl->val >> 16) < inst->capability.frame_rate.min || (ctrl->val >> 16) > inst->capability.frame_rate.max) { dprintk(VIDC_ERR, "Invalid operating rate %u\n", (ctrl->val >> 16)); rc = -ENOTSUPP; } else { dprintk(VIDC_DBG, "inst(%pK) operating rate changed from %d to %d\n", inst, inst->prop.operating_rate >> 16, ctrl->val >> 16); inst->prop.operating_rate = ctrl->val; } break; case V4L2_CID_MPEG_VIDC_VIDEO_VENC_BITRATE_TYPE: { Loading Loading @@ -4067,6 +4092,7 @@ int msm_venc_inst_init(struct msm_vidc_inst *inst) inst->buffer_mode_set[OUTPUT_PORT] = HAL_BUFFER_MODE_STATIC; inst->buffer_mode_set[CAPTURE_PORT] = HAL_BUFFER_MODE_STATIC; inst->prop.fps = DEFAULT_FPS; inst->prop.operating_rate = 0; inst->capability.pixelprocess_capabilities = 0; memcpy(&inst->fmts[CAPTURE_PORT], &venc_formats[4], sizeof(struct msm_vidc_format)); Loading
drivers/media/platform/msm/vidc_3x/msm_vidc_common.c +13 −20 Original line number Diff line number Diff line Loading @@ -258,14 +258,9 @@ int msm_comm_ctrl_deinit(struct msm_vidc_inst *inst) return 0; } static inline bool is_non_realtime_session(struct msm_vidc_inst *inst) static inline bool is_realtime_session(struct msm_vidc_inst *inst) { int rc = 0; struct v4l2_control ctrl = { .id = V4L2_CID_MPEG_VIDC_VIDEO_PRIORITY }; rc = msm_comm_g_ctrl(inst, &ctrl); return (!rc && ctrl.value); return !!(inst->flags & VIDC_REALTIME); } enum multi_stream msm_comm_get_stream_output_mode(struct msm_vidc_inst *inst) Loading Loading @@ -297,17 +292,15 @@ static int msm_comm_get_mbs_per_frame(struct msm_vidc_inst *inst) static int msm_comm_get_mbs_per_sec(struct msm_vidc_inst *inst) { int rc; u32 fps; struct v4l2_control ctrl; int mb_per_frame; u32 oper_rate; mb_per_frame = msm_comm_get_mbs_per_frame(inst); oper_rate = inst->prop.operating_rate; ctrl.id = V4L2_CID_MPEG_VIDC_VIDEO_OPERATING_RATE; rc = msm_comm_g_ctrl(inst, &ctrl); if (!rc && ctrl.value) { fps = (ctrl.value >> 16) ? ctrl.value >> 16 : 1; if (oper_rate) { fps = (oper_rate >> 16) ? oper_rate >> 16 : 1; /* * Check if operating rate is less than fps. * If Yes, then use fps to scale the clocks Loading Loading @@ -354,7 +347,7 @@ int msm_comm_get_inst_load(struct msm_vidc_inst *inst, * ----------------|----------------------|------------------------| */ if (is_non_realtime_session(inst) && if (is_realtime_session(inst) && (quirks & LOAD_CALC_IGNORE_NON_REALTIME_LOAD)) { if (!inst->prop.fps) { dprintk(VIDC_INFO, "instance:%pK fps = 0\n", inst); Loading Loading @@ -535,7 +528,7 @@ static int msm_comm_vote_bus(struct msm_vidc_core *core) list_for_each_entry(inst, &core->instances, list) { int codec = 0, yuv = 0; struct v4l2_control ctrl; u32 oper_rate; codec = inst->session_type == MSM_VIDC_DECODER ? inst->fmts[OUTPUT_PORT].fourcc : Loading @@ -552,11 +545,11 @@ static int msm_comm_vote_bus(struct msm_vidc_core *core) vote_data[i].height = max(inst->prop.height[CAPTURE_PORT], inst->prop.height[OUTPUT_PORT]); ctrl.id = V4L2_CID_MPEG_VIDC_VIDEO_OPERATING_RATE; rc = msm_comm_g_ctrl(inst, &ctrl); if (!rc && ctrl.value) vote_data[i].fps = (ctrl.value >> 16) ? ctrl.value >> 16 : 1; oper_rate = inst->prop.operating_rate; if (oper_rate) vote_data[i].fps = (oper_rate >> 16) ? oper_rate >> 16 : 1; else vote_data[i].fps = inst->prop.fps; Loading
drivers/media/platform/msm/vidc_3x/msm_vidc_internal.h +2 −0 Original line number Diff line number Diff line Loading @@ -173,6 +173,7 @@ struct session_prop { u32 height[MAX_PORT_NUM]; u32 fps; u32 bitrate; u32 operating_rate; }; struct buf_queue { Loading Loading @@ -239,6 +240,7 @@ 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 { Loading