Merge "msm: vidc: Fix sequence change event properly"
This commit is contained in:
commit
10dc161b22
1 changed files with 29 additions and 30 deletions
|
@ -1133,38 +1133,13 @@ static void handle_event_change(enum hal_command_response cmd, void *data)
|
|||
|
||||
switch (event_notify->hal_event_type) {
|
||||
case HAL_EVENT_SEQ_CHANGED_SUFFICIENT_RESOURCES:
|
||||
event = V4L2_EVENT_SEQ_CHANGED_INSUFFICIENT;
|
||||
|
||||
rc = msm_comm_g_ctrl_for_id(inst,
|
||||
V4L2_CID_MPEG_VIDC_VIDEO_CONTINUE_DATA_TRANSFER);
|
||||
|
||||
if (!IS_ERR_VALUE(rc) && rc == true) {
|
||||
if (!is_thumbnail_session(inst) &&
|
||||
(IS_ERR_VALUE(rc) || rc == false))
|
||||
event = V4L2_EVENT_SEQ_CHANGED_INSUFFICIENT;
|
||||
else
|
||||
event = V4L2_EVENT_SEQ_CHANGED_SUFFICIENT;
|
||||
|
||||
if (msm_comm_get_stream_output_mode(inst) ==
|
||||
HAL_VIDEO_DECODER_SECONDARY) {
|
||||
struct hal_frame_size frame_sz;
|
||||
|
||||
frame_sz.buffer_type = HAL_BUFFER_OUTPUT2;
|
||||
frame_sz.width = event_notify->width;
|
||||
frame_sz.height = event_notify->height;
|
||||
dprintk(VIDC_DBG,
|
||||
"Update OPB dimensions to firmware if buffer requirements are sufficient\n");
|
||||
rc = msm_comm_try_set_prop(inst,
|
||||
HAL_PARAM_FRAME_SIZE, &frame_sz);
|
||||
}
|
||||
|
||||
dprintk(VIDC_DBG,
|
||||
"send session_continue after sufficient event\n");
|
||||
rc = call_hfi_op(hdev, session_continue,
|
||||
(void *) inst->session);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s - failed to send session_continue\n",
|
||||
__func__);
|
||||
goto err_bad_event;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case HAL_EVENT_SEQ_CHANGED_INSUFFICIENT_RESOURCES:
|
||||
event = V4L2_EVENT_SEQ_CHANGED_INSUFFICIENT;
|
||||
|
@ -1267,7 +1242,7 @@ static void handle_event_change(enum hal_command_response cmd, void *data)
|
|||
"V4L2_EVENT_SEQ_CHANGED_INSUFFICIENT due to bit-depth change\n");
|
||||
}
|
||||
|
||||
if (inst->fmts[CAPTURE_PORT].fourcc == V4L2_PIX_FMT_NV12 &&
|
||||
if ((inst->fmts[CAPTURE_PORT].fourcc == V4L2_PIX_FMT_NV12) &&
|
||||
inst->pic_struct != event_notify->pic_struct) {
|
||||
inst->pic_struct = event_notify->pic_struct;
|
||||
event = V4L2_EVENT_SEQ_CHANGED_INSUFFICIENT;
|
||||
|
@ -1317,6 +1292,30 @@ static void handle_event_change(enum hal_command_response cmd, void *data)
|
|||
ptr = (u32 *)seq_changed_event.u.data;
|
||||
ptr[0] = event_notify->height;
|
||||
ptr[1] = event_notify->width;
|
||||
} else {
|
||||
if (msm_comm_get_stream_output_mode(inst) ==
|
||||
HAL_VIDEO_DECODER_SECONDARY) {
|
||||
struct hal_frame_size frame_sz;
|
||||
|
||||
frame_sz.buffer_type = HAL_BUFFER_OUTPUT2;
|
||||
frame_sz.width = event_notify->width;
|
||||
frame_sz.height = event_notify->height;
|
||||
dprintk(VIDC_DBG,
|
||||
"Update OPB dimensions to firmware if buffer requirements are sufficient\n");
|
||||
rc = msm_comm_try_set_prop(inst,
|
||||
HAL_PARAM_FRAME_SIZE, &frame_sz);
|
||||
}
|
||||
|
||||
dprintk(VIDC_DBG,
|
||||
"send session_continue after sufficient event\n");
|
||||
rc = call_hfi_op(hdev, session_continue,
|
||||
(void *) inst->session);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s - failed to send session_continue\n",
|
||||
__func__);
|
||||
goto err_bad_event;
|
||||
}
|
||||
}
|
||||
v4l2_event_queue_fh(&inst->event_handler, &seq_changed_event);
|
||||
} else if (rc == -ENOTSUPP) {
|
||||
|
|
Loading…
Add table
Reference in a new issue