Loading drivers/media/platform/msm/vidc/hfi_response_handler.c +37 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,8 @@ static int hfi_process_sess_evt_seq_changed(u32 device_id, struct hfi_profile_level *profile_level; struct hfi_bit_depth *pixel_depth; struct hfi_pic_struct *pic_struct; struct hfi_buffer_requirements *buf_req; struct hfi_index_extradata_input_crop_payload *crop_info; u32 entropy_mode = 0; u8 *data_ptr; int prop_id; Loading Loading @@ -231,6 +233,41 @@ static int hfi_process_sess_evt_seq_changed(u32 device_id, data_ptr += sizeof(u32); break; case HFI_PROPERTY_CONFIG_BUFFER_REQUIREMENTS: data_ptr = data_ptr + sizeof(u32); buf_req = (struct hfi_buffer_requirements *) data_ptr; event_notify.capture_buf_count = buf_req->buffer_count_min; dprintk(VIDC_DBG, "Capture Count : 0x%x\n", event_notify.capture_buf_count); data_ptr += sizeof(struct hfi_buffer_requirements); break; case HFI_INDEX_EXTRADATA_INPUT_CROP: data_ptr = data_ptr + sizeof(u32); crop_info = (struct hfi_index_extradata_input_crop_payload *) data_ptr; event_notify.crop_data.left = crop_info->left; event_notify.crop_data.top = crop_info->top; event_notify.crop_data.width = crop_info->width; event_notify.crop_data.height = crop_info->height; dprintk(VIDC_DBG, "CROP info : Left = %d Top = %d\n", crop_info->left, crop_info->top); dprintk(VIDC_DBG, "CROP info : Width = %d Height = %d\n", crop_info->width, crop_info->height); data_ptr += sizeof(struct hfi_index_extradata_input_crop_payload); break; default: dprintk(VIDC_ERR, "%s cmd: %#x not supported\n", Loading drivers/media/platform/msm/vidc/msm_v4l2_vidc.c +9 −0 Original line number Diff line number Diff line Loading @@ -225,6 +225,14 @@ static int msm_v4l2_g_parm(struct file *file, void *fh, return 0; } static int msm_v4l2_g_crop(struct file *file, void *fh, struct v4l2_crop *a) { struct msm_vidc_inst *vidc_inst = get_vidc_inst(file, fh); return msm_vidc_g_crop(vidc_inst, a); } static int msm_v4l2_enum_framesizes(struct file *file, void *fh, struct v4l2_frmsizeenum *fsize) { Loading Loading @@ -265,6 +273,7 @@ static const struct v4l2_ioctl_ops msm_v4l2_ioctl_ops = { .vidioc_encoder_cmd = msm_v4l2_encoder_cmd, .vidioc_s_parm = msm_v4l2_s_parm, .vidioc_g_parm = msm_v4l2_g_parm, .vidioc_g_crop = msm_v4l2_g_crop, .vidioc_enum_framesizes = msm_v4l2_enum_framesizes, }; Loading drivers/media/platform/msm/vidc/msm_vidc.c +23 −0 Original line number Diff line number Diff line Loading @@ -265,6 +265,29 @@ int msm_vidc_s_ctrl(void *instance, struct v4l2_control *control) } EXPORT_SYMBOL(msm_vidc_s_ctrl); int msm_vidc_g_crop(void *instance, struct v4l2_crop *crop) { struct msm_vidc_inst *inst = instance; if (!inst || !crop) return -EINVAL; if (inst->session_type == MSM_VIDC_ENCODER) { dprintk(VIDC_ERR, "Session = %pK : Encoder Crop is not implemented yet\n", inst); return -EPERM; } crop->c.left = inst->prop.crop_info.left; crop->c.top = inst->prop.crop_info.top; crop->c.width = inst->prop.crop_info.width; crop->c.height = inst->prop.crop_info.height; return 0; } EXPORT_SYMBOL(msm_vidc_g_crop); int msm_vidc_g_ctrl(void *instance, struct v4l2_control *control) { struct msm_vidc_inst *inst = instance; Loading drivers/media/platform/msm/vidc/msm_vidc_common.c +19 −0 Original line number Diff line number Diff line Loading @@ -1554,6 +1554,14 @@ static void handle_event_change(enum hal_command_response cmd, void *data) inst->entropy_mode = event_notify->entropy_mode; inst->profile = event_notify->profile; inst->level = event_notify->level; inst->prop.crop_info.left = event_notify->crop_data.left; inst->prop.crop_info.top = event_notify->crop_data.top; inst->prop.crop_info.height = event_notify->crop_data.height; inst->prop.crop_info.width = event_notify->crop_data.width; ptr = (u32 *)seq_changed_event.u.data; ptr[0] = event_notify->height; Loading @@ -1561,6 +1569,10 @@ static void handle_event_change(enum hal_command_response cmd, void *data) ptr[2] = event_notify->bit_depth; ptr[3] = event_notify->pic_struct; ptr[4] = event_notify->colour_space; ptr[5] = event_notify->crop_data.top; ptr[6] = event_notify->crop_data.left; ptr[7] = event_notify->crop_data.height; ptr[8] = event_notify->crop_data.width; dprintk(VIDC_DBG, "Event payload: height = %d width = %d\n", Loading @@ -1571,6 +1583,13 @@ static void handle_event_change(enum hal_command_response cmd, void *data) event_notify->bit_depth, event_notify->pic_struct, event_notify->colour_space); dprintk(VIDC_DBG, "Event payload: CROP top = %d left = %d Height = %d Width = %d\n", event_notify->crop_data.top, event_notify->crop_data.left, event_notify->crop_data.height, event_notify->crop_data.width); mutex_lock(&inst->lock); inst->in_reconfig = true; inst->reconfig_height = event_notify->height; Loading drivers/media/platform/msm/vidc/msm_vidc_internal.h +8 −0 Original line number Diff line number Diff line Loading @@ -175,9 +175,17 @@ struct msm_video_device { struct video_device vdev; }; struct session_crop { u32 left; u32 top; u32 width; u32 height; }; struct session_prop { u32 width[MAX_PORT_NUM]; u32 height[MAX_PORT_NUM]; struct session_crop crop_info; u32 fps; u32 bitrate; }; Loading Loading
drivers/media/platform/msm/vidc/hfi_response_handler.c +37 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,8 @@ static int hfi_process_sess_evt_seq_changed(u32 device_id, struct hfi_profile_level *profile_level; struct hfi_bit_depth *pixel_depth; struct hfi_pic_struct *pic_struct; struct hfi_buffer_requirements *buf_req; struct hfi_index_extradata_input_crop_payload *crop_info; u32 entropy_mode = 0; u8 *data_ptr; int prop_id; Loading Loading @@ -231,6 +233,41 @@ static int hfi_process_sess_evt_seq_changed(u32 device_id, data_ptr += sizeof(u32); break; case HFI_PROPERTY_CONFIG_BUFFER_REQUIREMENTS: data_ptr = data_ptr + sizeof(u32); buf_req = (struct hfi_buffer_requirements *) data_ptr; event_notify.capture_buf_count = buf_req->buffer_count_min; dprintk(VIDC_DBG, "Capture Count : 0x%x\n", event_notify.capture_buf_count); data_ptr += sizeof(struct hfi_buffer_requirements); break; case HFI_INDEX_EXTRADATA_INPUT_CROP: data_ptr = data_ptr + sizeof(u32); crop_info = (struct hfi_index_extradata_input_crop_payload *) data_ptr; event_notify.crop_data.left = crop_info->left; event_notify.crop_data.top = crop_info->top; event_notify.crop_data.width = crop_info->width; event_notify.crop_data.height = crop_info->height; dprintk(VIDC_DBG, "CROP info : Left = %d Top = %d\n", crop_info->left, crop_info->top); dprintk(VIDC_DBG, "CROP info : Width = %d Height = %d\n", crop_info->width, crop_info->height); data_ptr += sizeof(struct hfi_index_extradata_input_crop_payload); break; default: dprintk(VIDC_ERR, "%s cmd: %#x not supported\n", Loading
drivers/media/platform/msm/vidc/msm_v4l2_vidc.c +9 −0 Original line number Diff line number Diff line Loading @@ -225,6 +225,14 @@ static int msm_v4l2_g_parm(struct file *file, void *fh, return 0; } static int msm_v4l2_g_crop(struct file *file, void *fh, struct v4l2_crop *a) { struct msm_vidc_inst *vidc_inst = get_vidc_inst(file, fh); return msm_vidc_g_crop(vidc_inst, a); } static int msm_v4l2_enum_framesizes(struct file *file, void *fh, struct v4l2_frmsizeenum *fsize) { Loading Loading @@ -265,6 +273,7 @@ static const struct v4l2_ioctl_ops msm_v4l2_ioctl_ops = { .vidioc_encoder_cmd = msm_v4l2_encoder_cmd, .vidioc_s_parm = msm_v4l2_s_parm, .vidioc_g_parm = msm_v4l2_g_parm, .vidioc_g_crop = msm_v4l2_g_crop, .vidioc_enum_framesizes = msm_v4l2_enum_framesizes, }; Loading
drivers/media/platform/msm/vidc/msm_vidc.c +23 −0 Original line number Diff line number Diff line Loading @@ -265,6 +265,29 @@ int msm_vidc_s_ctrl(void *instance, struct v4l2_control *control) } EXPORT_SYMBOL(msm_vidc_s_ctrl); int msm_vidc_g_crop(void *instance, struct v4l2_crop *crop) { struct msm_vidc_inst *inst = instance; if (!inst || !crop) return -EINVAL; if (inst->session_type == MSM_VIDC_ENCODER) { dprintk(VIDC_ERR, "Session = %pK : Encoder Crop is not implemented yet\n", inst); return -EPERM; } crop->c.left = inst->prop.crop_info.left; crop->c.top = inst->prop.crop_info.top; crop->c.width = inst->prop.crop_info.width; crop->c.height = inst->prop.crop_info.height; return 0; } EXPORT_SYMBOL(msm_vidc_g_crop); int msm_vidc_g_ctrl(void *instance, struct v4l2_control *control) { struct msm_vidc_inst *inst = instance; Loading
drivers/media/platform/msm/vidc/msm_vidc_common.c +19 −0 Original line number Diff line number Diff line Loading @@ -1554,6 +1554,14 @@ static void handle_event_change(enum hal_command_response cmd, void *data) inst->entropy_mode = event_notify->entropy_mode; inst->profile = event_notify->profile; inst->level = event_notify->level; inst->prop.crop_info.left = event_notify->crop_data.left; inst->prop.crop_info.top = event_notify->crop_data.top; inst->prop.crop_info.height = event_notify->crop_data.height; inst->prop.crop_info.width = event_notify->crop_data.width; ptr = (u32 *)seq_changed_event.u.data; ptr[0] = event_notify->height; Loading @@ -1561,6 +1569,10 @@ static void handle_event_change(enum hal_command_response cmd, void *data) ptr[2] = event_notify->bit_depth; ptr[3] = event_notify->pic_struct; ptr[4] = event_notify->colour_space; ptr[5] = event_notify->crop_data.top; ptr[6] = event_notify->crop_data.left; ptr[7] = event_notify->crop_data.height; ptr[8] = event_notify->crop_data.width; dprintk(VIDC_DBG, "Event payload: height = %d width = %d\n", Loading @@ -1571,6 +1583,13 @@ static void handle_event_change(enum hal_command_response cmd, void *data) event_notify->bit_depth, event_notify->pic_struct, event_notify->colour_space); dprintk(VIDC_DBG, "Event payload: CROP top = %d left = %d Height = %d Width = %d\n", event_notify->crop_data.top, event_notify->crop_data.left, event_notify->crop_data.height, event_notify->crop_data.width); mutex_lock(&inst->lock); inst->in_reconfig = true; inst->reconfig_height = event_notify->height; Loading
drivers/media/platform/msm/vidc/msm_vidc_internal.h +8 −0 Original line number Diff line number Diff line Loading @@ -175,9 +175,17 @@ struct msm_video_device { struct video_device vdev; }; struct session_crop { u32 left; u32 top; u32 width; u32 height; }; struct session_prop { u32 width[MAX_PORT_NUM]; u32 height[MAX_PORT_NUM]; struct session_crop crop_info; u32 fps; u32 bitrate; }; Loading