Loading drivers/media/platform/msm/vidc/msm_vdec.c +6 −3 Original line number Original line Diff line number Diff line Loading @@ -760,6 +760,7 @@ int msm_vdec_inst_init(struct msm_vidc_inst *inst) inst->prop.width[CAPTURE_PORT] = DEFAULT_WIDTH; inst->prop.width[CAPTURE_PORT] = DEFAULT_WIDTH; inst->prop.height[OUTPUT_PORT] = DEFAULT_HEIGHT; inst->prop.height[OUTPUT_PORT] = DEFAULT_HEIGHT; inst->prop.width[OUTPUT_PORT] = DEFAULT_WIDTH; inst->prop.width[OUTPUT_PORT] = DEFAULT_WIDTH; inst->prop.extradata_ctrls = EXTRADATA_DEFAULT; inst->buffer_mode_set[OUTPUT_PORT] = HAL_BUFFER_MODE_STATIC; inst->buffer_mode_set[OUTPUT_PORT] = HAL_BUFFER_MODE_STATIC; inst->buffer_mode_set[CAPTURE_PORT] = HAL_BUFFER_MODE_DYNAMIC; inst->buffer_mode_set[CAPTURE_PORT] = HAL_BUFFER_MODE_DYNAMIC; inst->stream_output_mode = HAL_VIDEO_DECODER_PRIMARY; inst->stream_output_mode = HAL_VIDEO_DECODER_PRIMARY; Loading Loading @@ -884,6 +885,10 @@ int msm_vdec_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl) inst->clk_data.frame_rate = ctrl->val; inst->clk_data.frame_rate = ctrl->val; break; break; case V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA: case V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA: if (ctrl->val == EXTRADATA_NONE) inst->prop.extradata_ctrls = 0; else inst->prop.extradata_ctrls |= ctrl->val; /* /* * nothing to do here as inst->bufq[CAPTURE_PORT].num_planes * nothing to do here as inst->bufq[CAPTURE_PORT].num_planes * and inst->bufq[CAPTURE_PORT].plane_sizes[1] are already * and inst->bufq[CAPTURE_PORT].plane_sizes[1] are already Loading Loading @@ -1376,11 +1381,9 @@ int msm_vdec_set_conceal_color(struct msm_vidc_inst *inst) int msm_vdec_set_extradata(struct msm_vidc_inst *inst) int msm_vdec_set_extradata(struct msm_vidc_inst *inst) { { uint32_t display_info = HFI_PROPERTY_PARAM_VUI_DISPLAY_INFO_EXTRADATA; uint32_t display_info = HFI_PROPERTY_PARAM_VUI_DISPLAY_INFO_EXTRADATA; struct v4l2_ctrl *ctrl; u32 value = 0x0; u32 value = 0x0; u32 hdr10_hist = 0x0; u32 hdr10_hist = 0x0; ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA); switch (inst->fmts[OUTPUT_PORT].fourcc) { switch (inst->fmts[OUTPUT_PORT].fourcc) { case V4L2_PIX_FMT_H264: case V4L2_PIX_FMT_H264: case V4L2_PIX_FMT_HEVC: case V4L2_PIX_FMT_HEVC: Loading Loading @@ -1419,7 +1422,7 @@ int msm_vdec_set_extradata(struct msm_vidc_inst *inst) } } /* Enable / Disable Advanced Extradata */ /* Enable / Disable Advanced Extradata */ if (ctrl->val == EXTRADATA_ADVANCED) if (inst->prop.extradata_ctrls & EXTRADATA_ADVANCED) value = 0x1; value = 0x1; msm_comm_set_extradata(inst, msm_comm_set_extradata(inst, HFI_PROPERTY_PARAM_VDEC_STREAM_USERDATA_EXTRADATA, value); HFI_PROPERTY_PARAM_VDEC_STREAM_USERDATA_EXTRADATA, value); Loading drivers/media/platform/msm/vidc/msm_venc.c +18 −19 Original line number Original line Diff line number Diff line Loading @@ -1075,6 +1075,7 @@ int msm_venc_inst_init(struct msm_vidc_inst *inst) inst->prop.height[OUTPUT_PORT] = DEFAULT_HEIGHT; inst->prop.height[OUTPUT_PORT] = DEFAULT_HEIGHT; inst->prop.width[OUTPUT_PORT] = DEFAULT_WIDTH; inst->prop.width[OUTPUT_PORT] = DEFAULT_WIDTH; inst->prop.bframe_changed = false; inst->prop.bframe_changed = false; inst->prop.extradata_ctrls = EXTRADATA_DEFAULT; inst->buffer_mode_set[OUTPUT_PORT] = HAL_BUFFER_MODE_DYNAMIC; inst->buffer_mode_set[OUTPUT_PORT] = HAL_BUFFER_MODE_DYNAMIC; inst->buffer_mode_set[CAPTURE_PORT] = HAL_BUFFER_MODE_STATIC; inst->buffer_mode_set[CAPTURE_PORT] = HAL_BUFFER_MODE_STATIC; inst->clk_data.frame_rate = (DEFAULT_FPS << 16); inst->clk_data.frame_rate = (DEFAULT_FPS << 16); Loading Loading @@ -1116,7 +1117,7 @@ int msm_venc_inst_init(struct msm_vidc_inst *inst) } } buff_req_buffer->buffer_size = buff_req_buffer->buffer_size = msm_vidc_calculate_enc_input_extra_size(inst, 0); msm_vidc_calculate_enc_input_extra_size(inst); inst->bufq[OUTPUT_PORT].plane_sizes[1] = inst->bufq[OUTPUT_PORT].plane_sizes[1] = buff_req_buffer->buffer_size; buff_req_buffer->buffer_size; Loading Loading @@ -1232,7 +1233,6 @@ int msm_venc_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f) int rc = 0; int rc = 0; int i = 0; int i = 0; struct msm_vidc_format *fmt = NULL; struct msm_vidc_format *fmt = NULL; struct v4l2_ctrl *extradata_ctrl; if (!inst || !f) { if (!inst || !f) { dprintk(VIDC_ERR, dprintk(VIDC_ERR, Loading Loading @@ -1315,11 +1315,8 @@ int msm_venc_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f) */ */ inst->bufq[fmt->type].plane_sizes[0] = inst->bufq[fmt->type].plane_sizes[0] = msm_vidc_calculate_enc_input_frame_size(inst); msm_vidc_calculate_enc_input_frame_size(inst); extradata_ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA); inst->bufq[fmt->type].plane_sizes[1] = inst->bufq[fmt->type].plane_sizes[1] = msm_vidc_calculate_enc_input_extra_size(inst, msm_vidc_calculate_enc_input_extra_size(inst); extradata_ctrl->val); f->fmt.pix_mp.num_planes = inst->bufq[fmt->type].num_planes; f->fmt.pix_mp.num_planes = inst->bufq[fmt->type].num_planes; for (i = 0; i < inst->bufq[fmt->type].num_planes; i++) { for (i = 0; i < inst->bufq[fmt->type].num_planes; i++) { f->fmt.pix_mp.plane_fmt[i].sizeimage = f->fmt.pix_mp.plane_fmt[i].sizeimage = Loading Loading @@ -1565,8 +1562,13 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl) } } break; break; case V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA: case V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA: if ((ctrl->val & EXTRADATA_ENC_INPUT_ROI) || if (ctrl->val == EXTRADATA_NONE) (ctrl->val & EXTRADATA_ENC_INPUT_HDR10PLUS)) { inst->prop.extradata_ctrls = 0; else inst->prop.extradata_ctrls |= ctrl->val; if ((inst->prop.extradata_ctrls & EXTRADATA_ENC_INPUT_ROI) || (inst->prop.extradata_ctrls & EXTRADATA_ENC_INPUT_HDR10PLUS)) { buff_req_buffer = get_buff_req_buffer(inst, buff_req_buffer = get_buff_req_buffer(inst, HAL_BUFFER_EXTRADATA_INPUT); HAL_BUFFER_EXTRADATA_INPUT); if (!buff_req_buffer) { if (!buff_req_buffer) { Loading @@ -1577,13 +1579,12 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl) } } buff_req_buffer->buffer_size = buff_req_buffer->buffer_size = msm_vidc_calculate_enc_input_extra_size(inst, msm_vidc_calculate_enc_input_extra_size(inst); ctrl->val); inst->bufq[OUTPUT_PORT].plane_sizes[1] = inst->bufq[OUTPUT_PORT].plane_sizes[1] = buff_req_buffer->buffer_size; buff_req_buffer->buffer_size; } } if (ctrl->val & EXTRADATA_ADVANCED) { if (inst->prop.extradata_ctrls & EXTRADATA_ADVANCED) { inst->bufq[CAPTURE_PORT].num_planes = 2; inst->bufq[CAPTURE_PORT].num_planes = 2; buff_req_buffer = get_buff_req_buffer(inst, buff_req_buffer = get_buff_req_buffer(inst, Loading Loading @@ -3722,12 +3723,10 @@ int msm_venc_set_hdr_info(struct msm_vidc_inst *inst) int msm_venc_set_extradata(struct msm_vidc_inst *inst) int msm_venc_set_extradata(struct msm_vidc_inst *inst) { { int rc = 0; int rc = 0; struct v4l2_ctrl *ctrl; struct v4l2_ctrl *cvp_ctrl; struct v4l2_ctrl *cvp_ctrl; u32 value = 0x0; u32 value = 0x0; ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA); if (inst->prop.extradata_ctrls == EXTRADATA_NONE) { if (ctrl->val == EXTRADATA_NONE) { // Disable all Extradata // Disable all Extradata msm_comm_set_index_extradata(inst, msm_comm_set_index_extradata(inst, MSM_VIDC_EXTRADATA_ASPECT_RATIO, 0x0); MSM_VIDC_EXTRADATA_ASPECT_RATIO, 0x0); Loading @@ -3742,17 +3741,17 @@ int msm_venc_set_extradata(struct msm_vidc_inst *inst) } } } } if (ctrl->val & EXTRADATA_ADVANCED) if (inst->prop.extradata_ctrls & EXTRADATA_ADVANCED) // Enable Advanced Extradata - LTR Info // Enable Advanced Extradata - LTR Info msm_comm_set_extradata(inst, msm_comm_set_extradata(inst, HFI_PROPERTY_PARAM_VENC_LTR_INFO, 0x1); HFI_PROPERTY_PARAM_VENC_LTR_INFO, 0x1); if (ctrl->val & EXTRADATA_ENC_INPUT_ROI) if (inst->prop.extradata_ctrls & EXTRADATA_ENC_INPUT_ROI) // Enable ROIQP Extradata // Enable ROIQP Extradata msm_comm_set_extradata(inst, msm_comm_set_extradata(inst, HFI_PROPERTY_PARAM_VENC_ROI_QP_EXTRADATA, 0x1); HFI_PROPERTY_PARAM_VENC_ROI_QP_EXTRADATA, 0x1); if (ctrl->val & EXTRADATA_ENC_INPUT_HDR10PLUS) { if (inst->prop.extradata_ctrls & EXTRADATA_ENC_INPUT_HDR10PLUS) { // Enable HDR10+ Extradata // Enable HDR10+ Extradata if (inst->fmts[CAPTURE_PORT].fourcc == V4L2_PIX_FMT_HEVC) { if (inst->fmts[CAPTURE_PORT].fourcc == V4L2_PIX_FMT_HEVC) { msm_comm_set_extradata(inst, msm_comm_set_extradata(inst, Loading @@ -3763,7 +3762,7 @@ int msm_venc_set_extradata(struct msm_vidc_inst *inst) cvp_ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_VENC_CVP_DISABLE); cvp_ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_VENC_CVP_DISABLE); if (cvp_ctrl->val == V4L2_MPEG_MSM_VIDC_ENABLE) { if (cvp_ctrl->val == V4L2_MPEG_MSM_VIDC_ENABLE) { if (ctrl->val & EXTRADATA_ENC_INPUT_CVP) { if (inst->prop.extradata_ctrls & EXTRADATA_ENC_INPUT_CVP) { dprintk(VIDC_ERR, dprintk(VIDC_ERR, "%s: invalid params\n", __func__); "%s: invalid params\n", __func__); return -EINVAL; return -EINVAL; Loading @@ -3774,7 +3773,7 @@ int msm_venc_set_extradata(struct msm_vidc_inst *inst) * Once the kernel-mode CVP metadata implementation * Once the kernel-mode CVP metadata implementation * is completed, this condition should be removed. * is completed, this condition should be removed. */ */ if (ctrl->val & EXTRADATA_ENC_INPUT_CVP) if (inst->prop.extradata_ctrls & EXTRADATA_ENC_INPUT_CVP) value = 0x1; value = 0x1; } } Loading drivers/media/platform/msm/vidc/msm_vidc.c +3 −0 Original line number Original line Diff line number Diff line Loading @@ -1412,6 +1412,9 @@ static int try_get_ctrl_for_instance(struct msm_vidc_inst *inst, dprintk(VIDC_DBG, "g_min: %x : hal_buffer %d min buffers %d\n", dprintk(VIDC_DBG, "g_min: %x : hal_buffer %d min buffers %d\n", hash32_ptr(inst->session), HAL_BUFFER_INPUT, ctrl->val); hash32_ptr(inst->session), HAL_BUFFER_INPUT, ctrl->val); break; break; case V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA: ctrl->val = inst->prop.extradata_ctrls; break; default: default: /* /* * Other controls aren't really volatile, shouldn't need to * Other controls aren't really volatile, shouldn't need to Loading drivers/media/platform/msm/vidc/msm_vidc_buffer_calculations.c +4 −10 Original line number Original line Diff line number Diff line Loading @@ -861,8 +861,7 @@ static inline u32 ROI_EXTRADATA_SIZE( return (((lcu_width + 7) >> 3) << 3) * lcu_height * 2; return (((lcu_width + 7) >> 3) << 3) * lcu_height * 2; } } u32 msm_vidc_calculate_enc_input_extra_size(struct msm_vidc_inst *inst, u32 msm_vidc_calculate_enc_input_extra_size(struct msm_vidc_inst *inst) u32 extra_types) { { u32 size = 0; u32 size = 0; u32 width = inst->prop.width[OUTPUT_PORT]; u32 width = inst->prop.width[OUTPUT_PORT]; Loading @@ -873,7 +872,7 @@ u32 msm_vidc_calculate_enc_input_extra_size(struct msm_vidc_inst *inst, size += sizeof(struct msm_vidc_enc_cvp_metadata_payload); size += sizeof(struct msm_vidc_enc_cvp_metadata_payload); extradata_count++; extradata_count++; if (extra_types & EXTRADATA_ENC_INPUT_ROI) { if (inst->prop.extradata_ctrls & EXTRADATA_ENC_INPUT_ROI) { u32 lcu_size = 16; u32 lcu_size = 16; if (inst->fmts[CAPTURE_PORT].fourcc == V4L2_PIX_FMT_HEVC) if (inst->fmts[CAPTURE_PORT].fourcc == V4L2_PIX_FMT_HEVC) Loading @@ -883,7 +882,7 @@ u32 msm_vidc_calculate_enc_input_extra_size(struct msm_vidc_inst *inst, extradata_count++; extradata_count++; } } if (extra_types & EXTRADATA_ENC_INPUT_HDR10PLUS) { if (inst->prop.extradata_ctrls & EXTRADATA_ENC_INPUT_HDR10PLUS) { size += HDR10PLUS_PAYLOAD_SIZE; size += HDR10PLUS_PAYLOAD_SIZE; extradata_count++; extradata_count++; } } Loading @@ -899,13 +898,8 @@ u32 msm_vidc_calculate_enc_input_extra_size(struct msm_vidc_inst *inst, u32 msm_vidc_calculate_enc_output_extra_size(struct msm_vidc_inst *inst) u32 msm_vidc_calculate_enc_output_extra_size(struct msm_vidc_inst *inst) { { u32 size = 0; u32 size = 0; u32 extra_types; struct v4l2_ctrl *extradata_ctrl; extradata_ctrl = get_ctrl(inst, if (inst->prop.extradata_ctrls & EXTRADATA_ADVANCED) V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA); extra_types = extradata_ctrl->val; if (extra_types & EXTRADATA_ADVANCED) size += sizeof(struct msm_vidc_metadata_ltr_payload); size += sizeof(struct msm_vidc_metadata_ltr_payload); /* Add size for extradata none */ /* Add size for extradata none */ Loading drivers/media/platform/msm/vidc/msm_vidc_buffer_calculations.h +1 −2 Original line number Original line Diff line number Diff line Loading @@ -34,8 +34,7 @@ u32 msm_vidc_calculate_dec_output_frame_size(struct msm_vidc_inst *inst); u32 msm_vidc_calculate_dec_output_extra_size(struct msm_vidc_inst *inst); u32 msm_vidc_calculate_dec_output_extra_size(struct msm_vidc_inst *inst); u32 msm_vidc_calculate_enc_input_frame_size(struct msm_vidc_inst *inst); u32 msm_vidc_calculate_enc_input_frame_size(struct msm_vidc_inst *inst); u32 msm_vidc_calculate_enc_output_frame_size(struct msm_vidc_inst *inst); u32 msm_vidc_calculate_enc_output_frame_size(struct msm_vidc_inst *inst); u32 msm_vidc_calculate_enc_input_extra_size(struct msm_vidc_inst *inst, u32 msm_vidc_calculate_enc_input_extra_size(struct msm_vidc_inst *inst); u32 extra_types); u32 msm_vidc_calculate_enc_output_extra_size(struct msm_vidc_inst *inst); u32 msm_vidc_calculate_enc_output_extra_size(struct msm_vidc_inst *inst); u32 msm_vidc_set_buffer_count_for_thumbnail(struct msm_vidc_inst *inst); u32 msm_vidc_set_buffer_count_for_thumbnail(struct msm_vidc_inst *inst); Loading Loading
drivers/media/platform/msm/vidc/msm_vdec.c +6 −3 Original line number Original line Diff line number Diff line Loading @@ -760,6 +760,7 @@ int msm_vdec_inst_init(struct msm_vidc_inst *inst) inst->prop.width[CAPTURE_PORT] = DEFAULT_WIDTH; inst->prop.width[CAPTURE_PORT] = DEFAULT_WIDTH; inst->prop.height[OUTPUT_PORT] = DEFAULT_HEIGHT; inst->prop.height[OUTPUT_PORT] = DEFAULT_HEIGHT; inst->prop.width[OUTPUT_PORT] = DEFAULT_WIDTH; inst->prop.width[OUTPUT_PORT] = DEFAULT_WIDTH; inst->prop.extradata_ctrls = EXTRADATA_DEFAULT; inst->buffer_mode_set[OUTPUT_PORT] = HAL_BUFFER_MODE_STATIC; inst->buffer_mode_set[OUTPUT_PORT] = HAL_BUFFER_MODE_STATIC; inst->buffer_mode_set[CAPTURE_PORT] = HAL_BUFFER_MODE_DYNAMIC; inst->buffer_mode_set[CAPTURE_PORT] = HAL_BUFFER_MODE_DYNAMIC; inst->stream_output_mode = HAL_VIDEO_DECODER_PRIMARY; inst->stream_output_mode = HAL_VIDEO_DECODER_PRIMARY; Loading Loading @@ -884,6 +885,10 @@ int msm_vdec_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl) inst->clk_data.frame_rate = ctrl->val; inst->clk_data.frame_rate = ctrl->val; break; break; case V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA: case V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA: if (ctrl->val == EXTRADATA_NONE) inst->prop.extradata_ctrls = 0; else inst->prop.extradata_ctrls |= ctrl->val; /* /* * nothing to do here as inst->bufq[CAPTURE_PORT].num_planes * nothing to do here as inst->bufq[CAPTURE_PORT].num_planes * and inst->bufq[CAPTURE_PORT].plane_sizes[1] are already * and inst->bufq[CAPTURE_PORT].plane_sizes[1] are already Loading Loading @@ -1376,11 +1381,9 @@ int msm_vdec_set_conceal_color(struct msm_vidc_inst *inst) int msm_vdec_set_extradata(struct msm_vidc_inst *inst) int msm_vdec_set_extradata(struct msm_vidc_inst *inst) { { uint32_t display_info = HFI_PROPERTY_PARAM_VUI_DISPLAY_INFO_EXTRADATA; uint32_t display_info = HFI_PROPERTY_PARAM_VUI_DISPLAY_INFO_EXTRADATA; struct v4l2_ctrl *ctrl; u32 value = 0x0; u32 value = 0x0; u32 hdr10_hist = 0x0; u32 hdr10_hist = 0x0; ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA); switch (inst->fmts[OUTPUT_PORT].fourcc) { switch (inst->fmts[OUTPUT_PORT].fourcc) { case V4L2_PIX_FMT_H264: case V4L2_PIX_FMT_H264: case V4L2_PIX_FMT_HEVC: case V4L2_PIX_FMT_HEVC: Loading Loading @@ -1419,7 +1422,7 @@ int msm_vdec_set_extradata(struct msm_vidc_inst *inst) } } /* Enable / Disable Advanced Extradata */ /* Enable / Disable Advanced Extradata */ if (ctrl->val == EXTRADATA_ADVANCED) if (inst->prop.extradata_ctrls & EXTRADATA_ADVANCED) value = 0x1; value = 0x1; msm_comm_set_extradata(inst, msm_comm_set_extradata(inst, HFI_PROPERTY_PARAM_VDEC_STREAM_USERDATA_EXTRADATA, value); HFI_PROPERTY_PARAM_VDEC_STREAM_USERDATA_EXTRADATA, value); Loading
drivers/media/platform/msm/vidc/msm_venc.c +18 −19 Original line number Original line Diff line number Diff line Loading @@ -1075,6 +1075,7 @@ int msm_venc_inst_init(struct msm_vidc_inst *inst) inst->prop.height[OUTPUT_PORT] = DEFAULT_HEIGHT; inst->prop.height[OUTPUT_PORT] = DEFAULT_HEIGHT; inst->prop.width[OUTPUT_PORT] = DEFAULT_WIDTH; inst->prop.width[OUTPUT_PORT] = DEFAULT_WIDTH; inst->prop.bframe_changed = false; inst->prop.bframe_changed = false; inst->prop.extradata_ctrls = EXTRADATA_DEFAULT; inst->buffer_mode_set[OUTPUT_PORT] = HAL_BUFFER_MODE_DYNAMIC; inst->buffer_mode_set[OUTPUT_PORT] = HAL_BUFFER_MODE_DYNAMIC; inst->buffer_mode_set[CAPTURE_PORT] = HAL_BUFFER_MODE_STATIC; inst->buffer_mode_set[CAPTURE_PORT] = HAL_BUFFER_MODE_STATIC; inst->clk_data.frame_rate = (DEFAULT_FPS << 16); inst->clk_data.frame_rate = (DEFAULT_FPS << 16); Loading Loading @@ -1116,7 +1117,7 @@ int msm_venc_inst_init(struct msm_vidc_inst *inst) } } buff_req_buffer->buffer_size = buff_req_buffer->buffer_size = msm_vidc_calculate_enc_input_extra_size(inst, 0); msm_vidc_calculate_enc_input_extra_size(inst); inst->bufq[OUTPUT_PORT].plane_sizes[1] = inst->bufq[OUTPUT_PORT].plane_sizes[1] = buff_req_buffer->buffer_size; buff_req_buffer->buffer_size; Loading Loading @@ -1232,7 +1233,6 @@ int msm_venc_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f) int rc = 0; int rc = 0; int i = 0; int i = 0; struct msm_vidc_format *fmt = NULL; struct msm_vidc_format *fmt = NULL; struct v4l2_ctrl *extradata_ctrl; if (!inst || !f) { if (!inst || !f) { dprintk(VIDC_ERR, dprintk(VIDC_ERR, Loading Loading @@ -1315,11 +1315,8 @@ int msm_venc_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f) */ */ inst->bufq[fmt->type].plane_sizes[0] = inst->bufq[fmt->type].plane_sizes[0] = msm_vidc_calculate_enc_input_frame_size(inst); msm_vidc_calculate_enc_input_frame_size(inst); extradata_ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA); inst->bufq[fmt->type].plane_sizes[1] = inst->bufq[fmt->type].plane_sizes[1] = msm_vidc_calculate_enc_input_extra_size(inst, msm_vidc_calculate_enc_input_extra_size(inst); extradata_ctrl->val); f->fmt.pix_mp.num_planes = inst->bufq[fmt->type].num_planes; f->fmt.pix_mp.num_planes = inst->bufq[fmt->type].num_planes; for (i = 0; i < inst->bufq[fmt->type].num_planes; i++) { for (i = 0; i < inst->bufq[fmt->type].num_planes; i++) { f->fmt.pix_mp.plane_fmt[i].sizeimage = f->fmt.pix_mp.plane_fmt[i].sizeimage = Loading Loading @@ -1565,8 +1562,13 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl) } } break; break; case V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA: case V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA: if ((ctrl->val & EXTRADATA_ENC_INPUT_ROI) || if (ctrl->val == EXTRADATA_NONE) (ctrl->val & EXTRADATA_ENC_INPUT_HDR10PLUS)) { inst->prop.extradata_ctrls = 0; else inst->prop.extradata_ctrls |= ctrl->val; if ((inst->prop.extradata_ctrls & EXTRADATA_ENC_INPUT_ROI) || (inst->prop.extradata_ctrls & EXTRADATA_ENC_INPUT_HDR10PLUS)) { buff_req_buffer = get_buff_req_buffer(inst, buff_req_buffer = get_buff_req_buffer(inst, HAL_BUFFER_EXTRADATA_INPUT); HAL_BUFFER_EXTRADATA_INPUT); if (!buff_req_buffer) { if (!buff_req_buffer) { Loading @@ -1577,13 +1579,12 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl) } } buff_req_buffer->buffer_size = buff_req_buffer->buffer_size = msm_vidc_calculate_enc_input_extra_size(inst, msm_vidc_calculate_enc_input_extra_size(inst); ctrl->val); inst->bufq[OUTPUT_PORT].plane_sizes[1] = inst->bufq[OUTPUT_PORT].plane_sizes[1] = buff_req_buffer->buffer_size; buff_req_buffer->buffer_size; } } if (ctrl->val & EXTRADATA_ADVANCED) { if (inst->prop.extradata_ctrls & EXTRADATA_ADVANCED) { inst->bufq[CAPTURE_PORT].num_planes = 2; inst->bufq[CAPTURE_PORT].num_planes = 2; buff_req_buffer = get_buff_req_buffer(inst, buff_req_buffer = get_buff_req_buffer(inst, Loading Loading @@ -3722,12 +3723,10 @@ int msm_venc_set_hdr_info(struct msm_vidc_inst *inst) int msm_venc_set_extradata(struct msm_vidc_inst *inst) int msm_venc_set_extradata(struct msm_vidc_inst *inst) { { int rc = 0; int rc = 0; struct v4l2_ctrl *ctrl; struct v4l2_ctrl *cvp_ctrl; struct v4l2_ctrl *cvp_ctrl; u32 value = 0x0; u32 value = 0x0; ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA); if (inst->prop.extradata_ctrls == EXTRADATA_NONE) { if (ctrl->val == EXTRADATA_NONE) { // Disable all Extradata // Disable all Extradata msm_comm_set_index_extradata(inst, msm_comm_set_index_extradata(inst, MSM_VIDC_EXTRADATA_ASPECT_RATIO, 0x0); MSM_VIDC_EXTRADATA_ASPECT_RATIO, 0x0); Loading @@ -3742,17 +3741,17 @@ int msm_venc_set_extradata(struct msm_vidc_inst *inst) } } } } if (ctrl->val & EXTRADATA_ADVANCED) if (inst->prop.extradata_ctrls & EXTRADATA_ADVANCED) // Enable Advanced Extradata - LTR Info // Enable Advanced Extradata - LTR Info msm_comm_set_extradata(inst, msm_comm_set_extradata(inst, HFI_PROPERTY_PARAM_VENC_LTR_INFO, 0x1); HFI_PROPERTY_PARAM_VENC_LTR_INFO, 0x1); if (ctrl->val & EXTRADATA_ENC_INPUT_ROI) if (inst->prop.extradata_ctrls & EXTRADATA_ENC_INPUT_ROI) // Enable ROIQP Extradata // Enable ROIQP Extradata msm_comm_set_extradata(inst, msm_comm_set_extradata(inst, HFI_PROPERTY_PARAM_VENC_ROI_QP_EXTRADATA, 0x1); HFI_PROPERTY_PARAM_VENC_ROI_QP_EXTRADATA, 0x1); if (ctrl->val & EXTRADATA_ENC_INPUT_HDR10PLUS) { if (inst->prop.extradata_ctrls & EXTRADATA_ENC_INPUT_HDR10PLUS) { // Enable HDR10+ Extradata // Enable HDR10+ Extradata if (inst->fmts[CAPTURE_PORT].fourcc == V4L2_PIX_FMT_HEVC) { if (inst->fmts[CAPTURE_PORT].fourcc == V4L2_PIX_FMT_HEVC) { msm_comm_set_extradata(inst, msm_comm_set_extradata(inst, Loading @@ -3763,7 +3762,7 @@ int msm_venc_set_extradata(struct msm_vidc_inst *inst) cvp_ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_VENC_CVP_DISABLE); cvp_ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_VENC_CVP_DISABLE); if (cvp_ctrl->val == V4L2_MPEG_MSM_VIDC_ENABLE) { if (cvp_ctrl->val == V4L2_MPEG_MSM_VIDC_ENABLE) { if (ctrl->val & EXTRADATA_ENC_INPUT_CVP) { if (inst->prop.extradata_ctrls & EXTRADATA_ENC_INPUT_CVP) { dprintk(VIDC_ERR, dprintk(VIDC_ERR, "%s: invalid params\n", __func__); "%s: invalid params\n", __func__); return -EINVAL; return -EINVAL; Loading @@ -3774,7 +3773,7 @@ int msm_venc_set_extradata(struct msm_vidc_inst *inst) * Once the kernel-mode CVP metadata implementation * Once the kernel-mode CVP metadata implementation * is completed, this condition should be removed. * is completed, this condition should be removed. */ */ if (ctrl->val & EXTRADATA_ENC_INPUT_CVP) if (inst->prop.extradata_ctrls & EXTRADATA_ENC_INPUT_CVP) value = 0x1; value = 0x1; } } Loading
drivers/media/platform/msm/vidc/msm_vidc.c +3 −0 Original line number Original line Diff line number Diff line Loading @@ -1412,6 +1412,9 @@ static int try_get_ctrl_for_instance(struct msm_vidc_inst *inst, dprintk(VIDC_DBG, "g_min: %x : hal_buffer %d min buffers %d\n", dprintk(VIDC_DBG, "g_min: %x : hal_buffer %d min buffers %d\n", hash32_ptr(inst->session), HAL_BUFFER_INPUT, ctrl->val); hash32_ptr(inst->session), HAL_BUFFER_INPUT, ctrl->val); break; break; case V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA: ctrl->val = inst->prop.extradata_ctrls; break; default: default: /* /* * Other controls aren't really volatile, shouldn't need to * Other controls aren't really volatile, shouldn't need to Loading
drivers/media/platform/msm/vidc/msm_vidc_buffer_calculations.c +4 −10 Original line number Original line Diff line number Diff line Loading @@ -861,8 +861,7 @@ static inline u32 ROI_EXTRADATA_SIZE( return (((lcu_width + 7) >> 3) << 3) * lcu_height * 2; return (((lcu_width + 7) >> 3) << 3) * lcu_height * 2; } } u32 msm_vidc_calculate_enc_input_extra_size(struct msm_vidc_inst *inst, u32 msm_vidc_calculate_enc_input_extra_size(struct msm_vidc_inst *inst) u32 extra_types) { { u32 size = 0; u32 size = 0; u32 width = inst->prop.width[OUTPUT_PORT]; u32 width = inst->prop.width[OUTPUT_PORT]; Loading @@ -873,7 +872,7 @@ u32 msm_vidc_calculate_enc_input_extra_size(struct msm_vidc_inst *inst, size += sizeof(struct msm_vidc_enc_cvp_metadata_payload); size += sizeof(struct msm_vidc_enc_cvp_metadata_payload); extradata_count++; extradata_count++; if (extra_types & EXTRADATA_ENC_INPUT_ROI) { if (inst->prop.extradata_ctrls & EXTRADATA_ENC_INPUT_ROI) { u32 lcu_size = 16; u32 lcu_size = 16; if (inst->fmts[CAPTURE_PORT].fourcc == V4L2_PIX_FMT_HEVC) if (inst->fmts[CAPTURE_PORT].fourcc == V4L2_PIX_FMT_HEVC) Loading @@ -883,7 +882,7 @@ u32 msm_vidc_calculate_enc_input_extra_size(struct msm_vidc_inst *inst, extradata_count++; extradata_count++; } } if (extra_types & EXTRADATA_ENC_INPUT_HDR10PLUS) { if (inst->prop.extradata_ctrls & EXTRADATA_ENC_INPUT_HDR10PLUS) { size += HDR10PLUS_PAYLOAD_SIZE; size += HDR10PLUS_PAYLOAD_SIZE; extradata_count++; extradata_count++; } } Loading @@ -899,13 +898,8 @@ u32 msm_vidc_calculate_enc_input_extra_size(struct msm_vidc_inst *inst, u32 msm_vidc_calculate_enc_output_extra_size(struct msm_vidc_inst *inst) u32 msm_vidc_calculate_enc_output_extra_size(struct msm_vidc_inst *inst) { { u32 size = 0; u32 size = 0; u32 extra_types; struct v4l2_ctrl *extradata_ctrl; extradata_ctrl = get_ctrl(inst, if (inst->prop.extradata_ctrls & EXTRADATA_ADVANCED) V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA); extra_types = extradata_ctrl->val; if (extra_types & EXTRADATA_ADVANCED) size += sizeof(struct msm_vidc_metadata_ltr_payload); size += sizeof(struct msm_vidc_metadata_ltr_payload); /* Add size for extradata none */ /* Add size for extradata none */ Loading
drivers/media/platform/msm/vidc/msm_vidc_buffer_calculations.h +1 −2 Original line number Original line Diff line number Diff line Loading @@ -34,8 +34,7 @@ u32 msm_vidc_calculate_dec_output_frame_size(struct msm_vidc_inst *inst); u32 msm_vidc_calculate_dec_output_extra_size(struct msm_vidc_inst *inst); u32 msm_vidc_calculate_dec_output_extra_size(struct msm_vidc_inst *inst); u32 msm_vidc_calculate_enc_input_frame_size(struct msm_vidc_inst *inst); u32 msm_vidc_calculate_enc_input_frame_size(struct msm_vidc_inst *inst); u32 msm_vidc_calculate_enc_output_frame_size(struct msm_vidc_inst *inst); u32 msm_vidc_calculate_enc_output_frame_size(struct msm_vidc_inst *inst); u32 msm_vidc_calculate_enc_input_extra_size(struct msm_vidc_inst *inst, u32 msm_vidc_calculate_enc_input_extra_size(struct msm_vidc_inst *inst); u32 extra_types); u32 msm_vidc_calculate_enc_output_extra_size(struct msm_vidc_inst *inst); u32 msm_vidc_calculate_enc_output_extra_size(struct msm_vidc_inst *inst); u32 msm_vidc_set_buffer_count_for_thumbnail(struct msm_vidc_inst *inst); u32 msm_vidc_set_buffer_count_for_thumbnail(struct msm_vidc_inst *inst); Loading