Loading drivers/media/platform/msm/vidc/msm_venc.c +43 −0 Original line number Diff line number Diff line Loading @@ -954,6 +954,15 @@ static struct msm_vidc_ctrl msm_venc_ctrls[] = { .default_value = V4L2_MPEG_MSM_VIDC_DISABLE, .step = 1, }, { .id = V4L2_CID_MPEG_VIDC_VENC_BITRATE_SAVINGS, .name = "Enable/Disable bitrate savings", .type = V4L2_CTRL_TYPE_BOOLEAN, .minimum = V4L2_MPEG_MSM_VIDC_DISABLE, .maximum = V4L2_MPEG_MSM_VIDC_ENABLE, .default_value = V4L2_MPEG_MSM_VIDC_ENABLE, .step = 1, }, }; #define NUM_CTRLS ARRAY_SIZE(msm_venc_ctrls) Loading Loading @@ -2890,6 +2899,37 @@ int msm_venc_set_intra_refresh_mode(struct msm_vidc_inst *inst) return rc; } int msm_venc_set_bitrate_savings_mode(struct msm_vidc_inst *inst) { int rc = 0; struct hfi_device *hdev; struct v4l2_ctrl *ctrl = NULL; struct hfi_enable enable; if (!inst || !inst->core) { dprintk(VIDC_ERR, "%s: invalid params\n", __func__); return -EINVAL; } hdev = inst->core->device; ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_VENC_BITRATE_SAVINGS); enable.enable = !!ctrl->val; if (!ctrl->val && inst->rc_type != V4L2_MPEG_VIDEO_BITRATE_MODE_VBR) { dprintk(VIDC_DBG, "Can't disable bitrate savings for non-VBR_CFR\n"); enable.enable = 1; } dprintk(VIDC_DBG, "%s: %d\n", __func__, enable.enable); rc = call_hfi_op(hdev, session_set_property, inst->session, HFI_PROPERTY_PARAM_VENC_BITRATE_SAVINGS, &enable, sizeof(enable)); if (rc) dprintk(VIDC_ERR, "%s: set property failed\n", __func__); return rc; } int msm_venc_set_loop_filter_mode(struct msm_vidc_inst *inst) { int rc = 0; Loading Loading @@ -3818,6 +3858,9 @@ int msm_venc_set_properties(struct msm_vidc_inst *inst) if (rc) goto exit; rc = msm_venc_set_rate_control(inst); if (rc) goto exit; rc = msm_venc_set_bitrate_savings_mode(inst); if (rc) goto exit; rc = msm_venc_set_input_timestamp_rc(inst); Loading drivers/media/platform/msm/vidc/vidc_hfi_helper.h +2 −0 Original line number Diff line number Diff line Loading @@ -346,6 +346,8 @@ struct hfi_buffer_info { (HFI_PROPERTY_PARAM_VENC_COMMON_START + 0x036) #define HFI_PROPERTY_PARAM_VENC_ADAPTIVE_B \ (HFI_PROPERTY_PARAM_VENC_COMMON_START + 0x037) #define HFI_PROPERTY_PARAM_VENC_BITRATE_SAVINGS \ (HFI_PROPERTY_PARAM_VENC_COMMON_START + 0x038) #define HFI_PROPERTY_CONFIG_VENC_COMMON_START \ (HFI_DOMAIN_BASE_VENC + HFI_ARCH_COMMON_OFFSET + 0x6000) Loading include/uapi/linux/v4l2-controls.h +3 −0 Original line number Diff line number Diff line Loading @@ -962,6 +962,9 @@ enum v4l2_mpeg_vidc_video_vp9_level { #define V4L2_CID_MPEG_VIDC_VIDEO_FRAME_RATE \ (V4L2_CID_MPEG_MSM_VIDC_BASE + 119) #define V4L2_CID_MPEG_VIDC_VENC_BITRATE_SAVINGS \ (V4L2_CID_MPEG_MSM_VIDC_BASE + 131) #define V4L2_CID_MPEG_VIDC_VIDEO_HEVC_MAX_HIER_CODING_LAYER \ (V4L2_CID_MPEG_MSM_VIDC_BASE + 120) enum v4l2_mpeg_vidc_video_hevc_max_hier_coding_layer { Loading Loading
drivers/media/platform/msm/vidc/msm_venc.c +43 −0 Original line number Diff line number Diff line Loading @@ -954,6 +954,15 @@ static struct msm_vidc_ctrl msm_venc_ctrls[] = { .default_value = V4L2_MPEG_MSM_VIDC_DISABLE, .step = 1, }, { .id = V4L2_CID_MPEG_VIDC_VENC_BITRATE_SAVINGS, .name = "Enable/Disable bitrate savings", .type = V4L2_CTRL_TYPE_BOOLEAN, .minimum = V4L2_MPEG_MSM_VIDC_DISABLE, .maximum = V4L2_MPEG_MSM_VIDC_ENABLE, .default_value = V4L2_MPEG_MSM_VIDC_ENABLE, .step = 1, }, }; #define NUM_CTRLS ARRAY_SIZE(msm_venc_ctrls) Loading Loading @@ -2890,6 +2899,37 @@ int msm_venc_set_intra_refresh_mode(struct msm_vidc_inst *inst) return rc; } int msm_venc_set_bitrate_savings_mode(struct msm_vidc_inst *inst) { int rc = 0; struct hfi_device *hdev; struct v4l2_ctrl *ctrl = NULL; struct hfi_enable enable; if (!inst || !inst->core) { dprintk(VIDC_ERR, "%s: invalid params\n", __func__); return -EINVAL; } hdev = inst->core->device; ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_VENC_BITRATE_SAVINGS); enable.enable = !!ctrl->val; if (!ctrl->val && inst->rc_type != V4L2_MPEG_VIDEO_BITRATE_MODE_VBR) { dprintk(VIDC_DBG, "Can't disable bitrate savings for non-VBR_CFR\n"); enable.enable = 1; } dprintk(VIDC_DBG, "%s: %d\n", __func__, enable.enable); rc = call_hfi_op(hdev, session_set_property, inst->session, HFI_PROPERTY_PARAM_VENC_BITRATE_SAVINGS, &enable, sizeof(enable)); if (rc) dprintk(VIDC_ERR, "%s: set property failed\n", __func__); return rc; } int msm_venc_set_loop_filter_mode(struct msm_vidc_inst *inst) { int rc = 0; Loading Loading @@ -3818,6 +3858,9 @@ int msm_venc_set_properties(struct msm_vidc_inst *inst) if (rc) goto exit; rc = msm_venc_set_rate_control(inst); if (rc) goto exit; rc = msm_venc_set_bitrate_savings_mode(inst); if (rc) goto exit; rc = msm_venc_set_input_timestamp_rc(inst); Loading
drivers/media/platform/msm/vidc/vidc_hfi_helper.h +2 −0 Original line number Diff line number Diff line Loading @@ -346,6 +346,8 @@ struct hfi_buffer_info { (HFI_PROPERTY_PARAM_VENC_COMMON_START + 0x036) #define HFI_PROPERTY_PARAM_VENC_ADAPTIVE_B \ (HFI_PROPERTY_PARAM_VENC_COMMON_START + 0x037) #define HFI_PROPERTY_PARAM_VENC_BITRATE_SAVINGS \ (HFI_PROPERTY_PARAM_VENC_COMMON_START + 0x038) #define HFI_PROPERTY_CONFIG_VENC_COMMON_START \ (HFI_DOMAIN_BASE_VENC + HFI_ARCH_COMMON_OFFSET + 0x6000) Loading
include/uapi/linux/v4l2-controls.h +3 −0 Original line number Diff line number Diff line Loading @@ -962,6 +962,9 @@ enum v4l2_mpeg_vidc_video_vp9_level { #define V4L2_CID_MPEG_VIDC_VIDEO_FRAME_RATE \ (V4L2_CID_MPEG_MSM_VIDC_BASE + 119) #define V4L2_CID_MPEG_VIDC_VENC_BITRATE_SAVINGS \ (V4L2_CID_MPEG_MSM_VIDC_BASE + 131) #define V4L2_CID_MPEG_VIDC_VIDEO_HEVC_MAX_HIER_CODING_LAYER \ (V4L2_CID_MPEG_MSM_VIDC_BASE + 120) enum v4l2_mpeg_vidc_video_hevc_max_hier_coding_layer { Loading