Loading drivers/media/platform/msm/vidc/msm_vdec.c +11 −9 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #define MIN_NUM_OUTPUT_BUFFERS 4 #define MAX_NUM_OUTPUT_BUFFERS VIDEO_MAX_FRAME #define DEFAULT_VIDEO_CONCEAL_COLOR_BLACK 0x8080 #define MB_SIZE_IN_PIXEL (16 * 16) #define TZ_DYNAMIC_BUFFER_FEATURE_ID 12 #define TZ_FEATURE_VERSION(major, minor, patch) \ Loading Loading @@ -497,9 +498,9 @@ static u32 get_frame_size_nv12(int plane, } static u32 get_frame_size_compressed(int plane, u32 height, u32 width) u32 max_mbs_per_frame, u32 size_per_mb) { return (width * height * 3/2)/2; return (max_mbs_per_frame * size_per_mb * 3/2)/2; } static int is_ctrl_valid_for_codec(struct msm_vidc_inst *inst, Loading Loading @@ -959,10 +960,12 @@ int msm_vdec_g_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f) if (plane_sizes[i] == 0) { f->fmt.pix_mp.plane_fmt[i].sizeimage = fmt->get_frame_size(i, inst->capability.height.max, inst->capability.width.max); inst->capability. mbs_per_frame.max, MB_SIZE_IN_PIXEL); plane_sizes[i] = f->fmt.pix_mp.plane_fmt[i].sizeimage; f->fmt.pix_mp.plane_fmt[i]. sizeimage; } else f->fmt.pix_mp.plane_fmt[i].sizeimage = plane_sizes[i]; Loading Loading @@ -1231,8 +1234,7 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f) msm_comm_try_set_prop(inst, HAL_PARAM_FRAME_SIZE, &frame_sz); max_input_size = fmt->get_frame_size(0, inst->capability.height.max, inst->capability.width.max); inst->capability.mbs_per_frame.max, MB_SIZE_IN_PIXEL); if (f->fmt.pix_mp.plane_fmt[0].sizeimage > max_input_size || f->fmt.pix_mp.plane_fmt[0].sizeimage == 0) { Loading Loading @@ -1333,8 +1335,8 @@ static int msm_vdec_queue_setup(struct vb2_queue *q, *num_buffers = MIN_NUM_OUTPUT_BUFFERS; for (i = 0; i < *num_planes; i++) { sizes[i] = inst->fmts[OUTPUT_PORT]->get_frame_size( i, inst->capability.height.max, inst->capability.width.max); i, inst->capability.mbs_per_frame.max, MB_SIZE_IN_PIXEL); } property_id = HAL_PARAM_BUFFER_COUNT_ACTUAL; new_buf_count.buffer_type = HAL_BUFFER_INPUT; Loading drivers/media/platform/msm/vidc/msm_vidc_common.c +2 −0 Original line number Diff line number Diff line Loading @@ -600,6 +600,8 @@ static void handle_session_init_done(enum command_response cmd, void *data) session_init_done->ltr_count; inst->capability.pixelprocess_capabilities = call_hfi_op(hdev, get_core_capabilities); inst->capability.mbs_per_frame = session_init_done->mbs_per_frame; inst->capability.capability_set = true; inst->capability.buffer_mode[CAPTURE_PORT] = session_init_done->alloc_mode_out; Loading drivers/media/platform/msm/vidc/msm_vidc_internal.h +1 −0 Original line number Diff line number Diff line Loading @@ -191,6 +191,7 @@ struct msm_vidc_core_capability { struct hal_capability_supported scale_y; struct hal_capability_supported hier_p; struct hal_capability_supported ltr_count; struct hal_capability_supported mbs_per_frame; u32 capability_set; enum buffer_mode_type buffer_mode[MAX_PORT_NUM]; }; Loading Loading
drivers/media/platform/msm/vidc/msm_vdec.c +11 −9 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #define MIN_NUM_OUTPUT_BUFFERS 4 #define MAX_NUM_OUTPUT_BUFFERS VIDEO_MAX_FRAME #define DEFAULT_VIDEO_CONCEAL_COLOR_BLACK 0x8080 #define MB_SIZE_IN_PIXEL (16 * 16) #define TZ_DYNAMIC_BUFFER_FEATURE_ID 12 #define TZ_FEATURE_VERSION(major, minor, patch) \ Loading Loading @@ -497,9 +498,9 @@ static u32 get_frame_size_nv12(int plane, } static u32 get_frame_size_compressed(int plane, u32 height, u32 width) u32 max_mbs_per_frame, u32 size_per_mb) { return (width * height * 3/2)/2; return (max_mbs_per_frame * size_per_mb * 3/2)/2; } static int is_ctrl_valid_for_codec(struct msm_vidc_inst *inst, Loading Loading @@ -959,10 +960,12 @@ int msm_vdec_g_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f) if (plane_sizes[i] == 0) { f->fmt.pix_mp.plane_fmt[i].sizeimage = fmt->get_frame_size(i, inst->capability.height.max, inst->capability.width.max); inst->capability. mbs_per_frame.max, MB_SIZE_IN_PIXEL); plane_sizes[i] = f->fmt.pix_mp.plane_fmt[i].sizeimage; f->fmt.pix_mp.plane_fmt[i]. sizeimage; } else f->fmt.pix_mp.plane_fmt[i].sizeimage = plane_sizes[i]; Loading Loading @@ -1231,8 +1234,7 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f) msm_comm_try_set_prop(inst, HAL_PARAM_FRAME_SIZE, &frame_sz); max_input_size = fmt->get_frame_size(0, inst->capability.height.max, inst->capability.width.max); inst->capability.mbs_per_frame.max, MB_SIZE_IN_PIXEL); if (f->fmt.pix_mp.plane_fmt[0].sizeimage > max_input_size || f->fmt.pix_mp.plane_fmt[0].sizeimage == 0) { Loading Loading @@ -1333,8 +1335,8 @@ static int msm_vdec_queue_setup(struct vb2_queue *q, *num_buffers = MIN_NUM_OUTPUT_BUFFERS; for (i = 0; i < *num_planes; i++) { sizes[i] = inst->fmts[OUTPUT_PORT]->get_frame_size( i, inst->capability.height.max, inst->capability.width.max); i, inst->capability.mbs_per_frame.max, MB_SIZE_IN_PIXEL); } property_id = HAL_PARAM_BUFFER_COUNT_ACTUAL; new_buf_count.buffer_type = HAL_BUFFER_INPUT; Loading
drivers/media/platform/msm/vidc/msm_vidc_common.c +2 −0 Original line number Diff line number Diff line Loading @@ -600,6 +600,8 @@ static void handle_session_init_done(enum command_response cmd, void *data) session_init_done->ltr_count; inst->capability.pixelprocess_capabilities = call_hfi_op(hdev, get_core_capabilities); inst->capability.mbs_per_frame = session_init_done->mbs_per_frame; inst->capability.capability_set = true; inst->capability.buffer_mode[CAPTURE_PORT] = session_init_done->alloc_mode_out; Loading
drivers/media/platform/msm/vidc/msm_vidc_internal.h +1 −0 Original line number Diff line number Diff line Loading @@ -191,6 +191,7 @@ struct msm_vidc_core_capability { struct hal_capability_supported scale_y; struct hal_capability_supported hier_p; struct hal_capability_supported ltr_count; struct hal_capability_supported mbs_per_frame; u32 capability_set; enum buffer_mode_type buffer_mode[MAX_PORT_NUM]; }; Loading