video: driver: move state to ERROR instead of just returning -EINVAL
move driver state to ERROR if any session pkt processing failed. Change-Id: Id9c653eb01a0845d6d25cf16383f34707d76ba96 Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
Этот коммит содержится в:
@@ -683,6 +683,8 @@ static int msm_venc_property_subscription(struct msm_vidc_inst *inst,
|
||||
HFI_PAYLOAD_U32_ARRAY,
|
||||
&payload[0],
|
||||
payload_size);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -719,11 +721,7 @@ static int msm_venc_metadata_delivery(struct msm_vidc_inst *inst,
|
||||
capability->cap[metadata_list[i]].hfi_id;
|
||||
count++;
|
||||
}
|
||||
};
|
||||
|
||||
// TODO: remove below check later
|
||||
if (!count)
|
||||
return 0;
|
||||
}
|
||||
|
||||
rc = venus_hfi_session_command(inst,
|
||||
HFI_CMD_DELIVERY_MODE,
|
||||
@@ -731,6 +729,8 @@ static int msm_venc_metadata_delivery(struct msm_vidc_inst *inst,
|
||||
HFI_PAYLOAD_U32_ARRAY,
|
||||
&payload[0],
|
||||
(count + 1) * sizeof(u32));
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -767,11 +767,7 @@ static int msm_venc_metadata_subscription(struct msm_vidc_inst *inst,
|
||||
capability->cap[metadata_list[i]].hfi_id;
|
||||
count++;
|
||||
}
|
||||
};
|
||||
|
||||
// TODO: remove below check later
|
||||
if (!count)
|
||||
return 0;
|
||||
}
|
||||
|
||||
rc = venus_hfi_session_command(inst,
|
||||
HFI_CMD_SUBSCRIBE_MODE,
|
||||
@@ -779,6 +775,8 @@ static int msm_venc_metadata_subscription(struct msm_vidc_inst *inst,
|
||||
HFI_PAYLOAD_U32_ARRAY,
|
||||
&payload[0],
|
||||
(count + 1) * sizeof(u32));
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
@@ -1059,6 +1059,7 @@ static int handle_session_buffer(struct msm_vidc_inst *inst,
|
||||
static const struct msm_vidc_hfi_buffer_handle enc_input_hfi_handle[] = {
|
||||
{HFI_BUFFER_METADATA, handle_input_metadata_buffer },
|
||||
{HFI_BUFFER_RAW, handle_input_buffer },
|
||||
{HFI_BUFFER_VPSS, handle_release_internal_buffer },
|
||||
};
|
||||
static const struct msm_vidc_hfi_buffer_handle enc_output_hfi_handle[] = {
|
||||
{HFI_BUFFER_METADATA, handle_output_metadata_buffer },
|
||||
@@ -1069,7 +1070,6 @@ static int handle_session_buffer(struct msm_vidc_inst *inst,
|
||||
{HFI_BUFFER_LINE, handle_release_internal_buffer },
|
||||
{HFI_BUFFER_ARP, handle_release_internal_buffer },
|
||||
{HFI_BUFFER_DPB, handle_release_internal_buffer },
|
||||
{HFI_BUFFER_VPSS, handle_release_internal_buffer },
|
||||
};
|
||||
static const struct msm_vidc_hfi_buffer_handle dec_input_hfi_handle[] = {
|
||||
{HFI_BUFFER_METADATA, handle_input_metadata_buffer },
|
||||
@@ -1146,9 +1146,11 @@ static int handle_session_buffer(struct msm_vidc_inst *inst,
|
||||
}
|
||||
|
||||
/* handle unknown buffer type */
|
||||
if (i == hfi_handle_size)
|
||||
if (i == hfi_handle_size) {
|
||||
i_vpr_e(inst, "%s: port %u, unknown buffer type %#x\n", __func__,
|
||||
pkt->port, buffer->type);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -1505,20 +1507,18 @@ static int __handle_session_response(struct msm_vidc_inst *inst,
|
||||
if (packet->flags & HFI_FW_FLAGS_SESSION_ERROR) {
|
||||
i_vpr_e(inst, "%s: received session error %#x\n",
|
||||
__func__, packet->type);
|
||||
rc = handle_session_error(inst, packet);
|
||||
if (rc)
|
||||
goto exit;
|
||||
handle_session_error(inst, packet);
|
||||
}
|
||||
if (in_range(be[i], packet->type)) {
|
||||
dequeue |= (packet->type == HFI_CMD_BUFFER);
|
||||
rc = be[i].handle(inst, packet);
|
||||
if (rc)
|
||||
goto exit;
|
||||
msm_vidc_change_inst_state(inst, MSM_VIDC_ERROR, __func__);
|
||||
}
|
||||
pkt += packet->size;
|
||||
}
|
||||
}
|
||||
exit:
|
||||
|
||||
memset(&inst->hfi_frame_info, 0, sizeof(struct msm_vidc_hfi_frame_info));
|
||||
if (dequeue) {
|
||||
rc = handle_dequeue_buffers(inst);
|
||||
|
Ссылка в новой задаче
Block a user