video: driver: handle enc internal buffers returned from fw
- destroy enc internal buffers when firmware returns these buffers after its usage. - fix some incorrect log masks that result in false error logs. Change-Id: I4707e915b725769bbbaa0a2c4c4e0d9cd10805a4 Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
This commit is contained in:
@@ -32,7 +32,6 @@ extern int msm_vidc_clock_voting;
|
||||
|
||||
enum vidc_msg_prio {
|
||||
VIDC_ERR = 0x00000001,
|
||||
VIDC_INFO = 0x00000001,
|
||||
VIDC_HIGH = 0x00000002,
|
||||
VIDC_LOW = 0x00000004,
|
||||
VIDC_PERF = 0x00000008,
|
||||
|
@@ -208,6 +208,8 @@ int msm_vidc_create_internal_buffers(struct msm_vidc_inst *inst,
|
||||
enum msm_vidc_buffer_type buffer_type);
|
||||
int msm_vidc_queue_internal_buffers(struct msm_vidc_inst *inst,
|
||||
enum msm_vidc_buffer_type buffer_type);
|
||||
int msm_vidc_alloc_and_queue_session_internal_buffers(struct msm_vidc_inst *inst,
|
||||
enum msm_vidc_buffer_type buffer_type);
|
||||
int msm_vidc_release_internal_buffers(struct msm_vidc_inst *inst,
|
||||
enum msm_vidc_buffer_type buffer_type);
|
||||
int msm_vidc_vb2_buffer_done(struct msm_vidc_inst *inst,
|
||||
|
@@ -70,6 +70,7 @@ u32 get_hfi_port_from_buffer_type(struct msm_vidc_inst *inst,
|
||||
hfi_port = HFI_PORT_BITSTREAM;
|
||||
break;
|
||||
case MSM_VIDC_BUF_PERSIST:
|
||||
/* TODO: change to HFI_PORT_NONE */
|
||||
hfi_port = HFI_PORT_BITSTREAM | HFI_PORT_RAW;
|
||||
break;
|
||||
case MSM_VIDC_BUF_OUTPUT:
|
||||
@@ -85,21 +86,21 @@ u32 get_hfi_port_from_buffer_type(struct msm_vidc_inst *inst,
|
||||
switch (buffer_type) {
|
||||
case MSM_VIDC_BUF_INPUT:
|
||||
case MSM_VIDC_BUF_INPUT_META:
|
||||
case MSM_VIDC_BUF_VPSS:
|
||||
hfi_port = HFI_PORT_RAW;
|
||||
break;
|
||||
case MSM_VIDC_BUF_OUTPUT:
|
||||
case MSM_VIDC_BUF_OUTPUT_META:
|
||||
case MSM_VIDC_BUF_BIN:
|
||||
case MSM_VIDC_BUF_ARP:
|
||||
case MSM_VIDC_BUF_COMV:
|
||||
case MSM_VIDC_BUF_NON_COMV:
|
||||
case MSM_VIDC_BUF_LINE:
|
||||
case MSM_VIDC_BUF_DPB:
|
||||
hfi_port = HFI_PORT_RAW;
|
||||
break;
|
||||
case MSM_VIDC_BUF_PERSIST:
|
||||
hfi_port = HFI_PORT_BITSTREAM | HFI_PORT_RAW;
|
||||
break;
|
||||
case MSM_VIDC_BUF_OUTPUT:
|
||||
case MSM_VIDC_BUF_OUTPUT_META:
|
||||
hfi_port = HFI_PORT_BITSTREAM;
|
||||
break;
|
||||
case MSM_VIDC_BUF_ARP:
|
||||
hfi_port = HFI_PORT_NONE;
|
||||
break;
|
||||
default:
|
||||
s_vpr_e(inst->sid, "%s: invalid buffer type %d\n",
|
||||
__func__, buffer_type);
|
||||
|
@@ -1623,7 +1623,7 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
|
||||
if (f->type == INPUT_MPLANE) {
|
||||
if (inst->fmts[INPUT_PORT].fmt.pix_mp.pixelformat !=
|
||||
f->fmt.pix_mp.pixelformat) {
|
||||
s_vpr_e(inst->sid,
|
||||
s_vpr_h(inst->sid,
|
||||
"%s: codec changed from %#x to %#x\n", __func__,
|
||||
inst->fmts[INPUT_PORT].fmt.pix_mp.pixelformat,
|
||||
f->fmt.pix_mp.pixelformat);
|
||||
|
@@ -452,6 +452,7 @@ static int msm_venc_set_internal_properties(struct msm_vidc_inst *inst)
|
||||
static int msm_venc_get_input_internal_buffers(struct msm_vidc_inst *inst)
|
||||
{
|
||||
int rc = 0;
|
||||
/* TODO: VPSS
|
||||
struct msm_vidc_core *core;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
@@ -460,44 +461,87 @@ static int msm_venc_get_input_internal_buffers(struct msm_vidc_inst *inst)
|
||||
}
|
||||
core = inst->core;
|
||||
|
||||
inst->buffers.arp.size = call_session_op(core, buffer_size,
|
||||
inst, MSM_VIDC_BUF_ARP) + 100000000;
|
||||
inst->buffers.bin.size = call_session_op(core, buffer_size,
|
||||
inst, MSM_VIDC_BUF_BIN) + 100000000;
|
||||
inst->buffers.comv.size = call_session_op(core, buffer_size,
|
||||
inst, MSM_VIDC_BUF_COMV) + 100000000;
|
||||
inst->buffers.non_comv.size = call_session_op(core, buffer_size,
|
||||
inst, MSM_VIDC_BUF_NON_COMV) + 100000000;
|
||||
inst->buffers.line.size = call_session_op(core, buffer_size,
|
||||
inst, MSM_VIDC_BUF_LINE) + 100000000;
|
||||
inst->buffers.dpb.size = call_session_op(core, buffer_size,
|
||||
inst, MSM_VIDC_BUF_DPB) + 100000000;
|
||||
//inst->buffers.vpss.size = call_session_op(core, buffer_size,
|
||||
//inst, MSM_VIDC_BUF_VPSS) + 100000000;
|
||||
//vpss is req - 100 mb
|
||||
inst->buffers.vpss.size = call_session_op(core, buffer_size,
|
||||
inst, MSM_VIDC_BUF_VPSS) + 100000000;
|
||||
|
||||
/* inst->buffers.persist.size = call_session_op(core, buffer_size,
|
||||
inst, MSM_VIDC_BUF_PERSIST); */
|
||||
|
||||
inst->buffers.arp.min_count = call_session_op(core, min_count,
|
||||
inst, MSM_VIDC_BUF_ARP);
|
||||
inst->buffers.bin.min_count = call_session_op(core, min_count,
|
||||
inst, MSM_VIDC_BUF_BIN);
|
||||
inst->buffers.comv.min_count = call_session_op(core, min_count,
|
||||
inst, MSM_VIDC_BUF_COMV);
|
||||
inst->buffers.non_comv.min_count = call_session_op(core, min_count,
|
||||
inst, MSM_VIDC_BUF_NON_COMV);
|
||||
inst->buffers.line.min_count = call_session_op(core, min_count,
|
||||
inst, MSM_VIDC_BUF_LINE);
|
||||
inst->buffers.dpb.min_count = call_session_op(core, min_count,
|
||||
inst, MSM_VIDC_BUF_DPB);
|
||||
/* inst->buffers.persist.min_count = call_session_op(core, min_count,
|
||||
inst, MSM_VIDC_BUF_PERSIST); */
|
||||
inst, MSM_VIDC_BUF_VPSS);
|
||||
|
||||
s_vpr_h(inst->sid, "%s: internal buffer: min size\n", __func__);
|
||||
s_vpr_h(inst->sid, "vpss buffer: %d %d\n",
|
||||
inst->buffers.vpss.min_count,
|
||||
inst->buffers.vpss.size);
|
||||
*/
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int msm_venc_create_input_internal_buffers(struct msm_vidc_inst *inst)
|
||||
{
|
||||
int rc = 0;
|
||||
/* TODO: VPSS
|
||||
d_vpr_h("%s()\n", __func__);
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rc = msm_vidc_create_internal_buffers(inst, MSM_VIDC_BUF_VPSS);
|
||||
if (rc)
|
||||
return rc;
|
||||
*/
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int msm_venc_queue_input_internal_buffers(struct msm_vidc_inst *inst)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
/* TODO: VPSS
|
||||
d_vpr_h("%s()\n", __func__);
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rc = msm_vidc_queue_internal_buffers(inst, MSM_VIDC_BUF_VPSS);
|
||||
if (rc)
|
||||
return rc;
|
||||
*/
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int msm_venc_get_output_internal_buffers(struct msm_vidc_inst *inst)
|
||||
{
|
||||
int rc = 0;
|
||||
struct msm_vidc_core *core;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
core = inst->core;
|
||||
|
||||
rc = msm_vidc_get_internal_buffers(inst, MSM_VIDC_BUF_BIN);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
rc = msm_vidc_get_internal_buffers(inst, MSM_VIDC_BUF_COMV);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
rc = msm_vidc_get_internal_buffers(inst, MSM_VIDC_BUF_NON_COMV);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
rc = msm_vidc_get_internal_buffers(inst, MSM_VIDC_BUF_LINE);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
rc = msm_vidc_get_internal_buffers(inst, MSM_VIDC_BUF_DPB);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
s_vpr_h(inst->sid, "internal buffer: min size\n");
|
||||
s_vpr_h(inst->sid, "arp buffer: %d %d\n",
|
||||
inst->buffers.arp.min_count,
|
||||
inst->buffers.arp.size);
|
||||
s_vpr_h(inst->sid, "bin buffer: %d %d\n",
|
||||
inst->buffers.bin.min_count,
|
||||
inst->buffers.bin.size);
|
||||
@@ -513,14 +557,11 @@ static int msm_venc_get_input_internal_buffers(struct msm_vidc_inst *inst)
|
||||
s_vpr_h(inst->sid, "dpb buffer: %d %d\n",
|
||||
inst->buffers.dpb.min_count,
|
||||
inst->buffers.dpb.size);
|
||||
/* s_vpr_h(inst->sid, "persist buffer: %d %d\n",
|
||||
inst->buffers.persist.min_count,
|
||||
inst->buffers.persist.size); */
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int msm_venc_create_input_internal_buffers(struct msm_vidc_inst *inst)
|
||||
static int msm_venc_create_output_internal_buffers(struct msm_vidc_inst *inst)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
@@ -530,9 +571,6 @@ static int msm_venc_create_input_internal_buffers(struct msm_vidc_inst *inst)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rc = msm_vidc_create_internal_buffers(inst, MSM_VIDC_BUF_ARP);
|
||||
if (rc)
|
||||
return rc;
|
||||
rc = msm_vidc_create_internal_buffers(inst, MSM_VIDC_BUF_BIN);
|
||||
if (rc)
|
||||
return rc;
|
||||
@@ -548,14 +586,11 @@ static int msm_venc_create_input_internal_buffers(struct msm_vidc_inst *inst)
|
||||
rc = msm_vidc_create_internal_buffers(inst, MSM_VIDC_BUF_DPB);
|
||||
if (rc)
|
||||
return rc;
|
||||
/* rc = msm_vidc_create_internal_buffers(inst, MSM_VIDC_BUF_PERSIST);
|
||||
if (rc)
|
||||
return rc; */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int msm_venc_queue_input_internal_buffers(struct msm_vidc_inst *inst)
|
||||
static int msm_venc_queue_output_internal_buffers(struct msm_vidc_inst *inst)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
@@ -565,9 +600,6 @@ static int msm_venc_queue_input_internal_buffers(struct msm_vidc_inst *inst)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rc = msm_vidc_queue_internal_buffers(inst, MSM_VIDC_BUF_ARP);
|
||||
if (rc)
|
||||
return rc;
|
||||
rc = msm_vidc_queue_internal_buffers(inst, MSM_VIDC_BUF_BIN);
|
||||
if (rc)
|
||||
return rc;
|
||||
@@ -581,10 +613,6 @@ static int msm_venc_queue_input_internal_buffers(struct msm_vidc_inst *inst)
|
||||
if (rc)
|
||||
return rc;
|
||||
rc = msm_vidc_queue_internal_buffers(inst, MSM_VIDC_BUF_DPB);
|
||||
if (rc)
|
||||
return rc;
|
||||
// TODO: fw is not accepting persist buffer and returning session error.
|
||||
//rc = msm_vidc_queue_internal_buffers(inst, MSM_VIDC_BUF_PERSIST);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
@@ -777,21 +805,12 @@ int msm_venc_streamon_input(struct msm_vidc_inst *inst)
|
||||
rc = msm_venc_get_input_internal_buffers(inst);
|
||||
if (rc)
|
||||
goto error;
|
||||
/* check for memory after all buffers calculation */
|
||||
//rc = msm_vidc_check_memory_supported(inst);
|
||||
if (rc)
|
||||
goto error;
|
||||
|
||||
//msm_vidc_update_dcvs(inst);
|
||||
//msm_vidc_update_batching(inst);
|
||||
//msm_vidc_scale_power(inst);
|
||||
|
||||
rc = msm_venc_create_input_internal_buffers(inst);
|
||||
rc = 0; // TODO
|
||||
if (rc)
|
||||
goto error;
|
||||
|
||||
rc = msm_venc_queue_input_internal_buffers(inst);
|
||||
rc = 0; // TODO
|
||||
if (rc)
|
||||
goto error;
|
||||
|
||||
@@ -896,6 +915,18 @@ int msm_venc_streamon_output(struct msm_vidc_inst *inst)
|
||||
if (rc)
|
||||
goto error;
|
||||
|
||||
rc = msm_venc_get_output_internal_buffers(inst);
|
||||
if (rc)
|
||||
goto error;
|
||||
|
||||
rc = msm_venc_create_output_internal_buffers(inst);
|
||||
if (rc)
|
||||
goto error;
|
||||
|
||||
rc = msm_venc_queue_output_internal_buffers(inst);
|
||||
if (rc)
|
||||
goto error;
|
||||
|
||||
rc = msm_vidc_adjust_v4l2_properties(inst);
|
||||
if (rc)
|
||||
goto error;
|
||||
@@ -1044,7 +1075,7 @@ int msm_venc_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
|
||||
} else if (f->type == OUTPUT_MPLANE) {
|
||||
fmt = &inst->fmts[OUTPUT_PORT];
|
||||
if (fmt->fmt.pix_mp.pixelformat != f->fmt.pix_mp.pixelformat) {
|
||||
s_vpr_e(inst->sid,
|
||||
s_vpr_h(inst->sid,
|
||||
"%s: codec changed from %#x to %#x\n", __func__,
|
||||
fmt->fmt.pix_mp.pixelformat, f->fmt.pix_mp.pixelformat);
|
||||
rc = msm_venc_codec_change(inst, f->fmt.pix_mp.pixelformat);
|
||||
|
@@ -718,7 +718,7 @@ void *msm_vidc_open(void *vidc_core, u32 session_type)
|
||||
d_vpr_e("%s: failed to get session id\n", __func__);
|
||||
goto error;
|
||||
}
|
||||
s_vpr_i(inst->sid, "Opening video instance: %d\n", session_type);
|
||||
s_vpr_e(inst->sid, "Opening video instance: %d\n", session_type);
|
||||
|
||||
inst->response_workq = create_singlethread_workqueue("response_workq");
|
||||
if (!inst->response_workq) {
|
||||
|
@@ -1574,6 +1574,10 @@ int msm_vidc_get_internal_buffers(struct msm_vidc_inst *inst,
|
||||
buf_size = call_session_op(core, buffer_size,
|
||||
inst, buffer_type);
|
||||
|
||||
/* TODO: remove below hack to increase enc inter buf size by 100MB */
|
||||
if (is_encode_session(inst))
|
||||
buf_size += 100000000;
|
||||
|
||||
buf_count = call_session_op(core, min_count,
|
||||
inst, buffer_type);
|
||||
|
||||
@@ -1755,6 +1759,40 @@ int msm_vidc_queue_internal_buffers(struct msm_vidc_inst *inst,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int msm_vidc_alloc_and_queue_session_internal_buffers(struct msm_vidc_inst *inst,
|
||||
enum msm_vidc_buffer_type buffer_type)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (buffer_type != MSM_VIDC_BUF_ARP &&
|
||||
buffer_type != MSM_VIDC_BUF_PERSIST) {
|
||||
s_vpr_e(inst->sid, "%s: invalid buffer type: %d\n",
|
||||
__func__, buffer_type);
|
||||
rc = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
rc = msm_vidc_get_internal_buffers(inst, buffer_type);
|
||||
if (rc)
|
||||
goto exit;
|
||||
|
||||
rc = msm_vidc_create_internal_buffers(inst, buffer_type);
|
||||
if (rc)
|
||||
goto exit;
|
||||
|
||||
rc = msm_vidc_queue_internal_buffers(inst, buffer_type);
|
||||
if (rc)
|
||||
goto exit;
|
||||
|
||||
exit:
|
||||
return rc;
|
||||
}
|
||||
|
||||
int msm_vidc_release_internal_buffers(struct msm_vidc_inst *inst,
|
||||
enum msm_vidc_buffer_type buffer_type)
|
||||
{
|
||||
|
@@ -170,6 +170,26 @@ int msm_vidc_start_streaming(struct vb2_queue *q, unsigned int count)
|
||||
rc = msm_vidc_session_set_codec(inst);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
if (is_encode_session(inst)) {
|
||||
rc = msm_vidc_alloc_and_queue_session_internal_buffers(inst,
|
||||
MSM_VIDC_BUF_ARP);
|
||||
if (rc)
|
||||
goto error;
|
||||
s_vpr_h(inst->sid, "arp buffer: %d %d\n",
|
||||
inst->buffers.arp.min_count,
|
||||
inst->buffers.arp.size);
|
||||
} else if(is_decode_session(inst)) {
|
||||
/* TODO: move persist buf from msm_vdec_streamon_input to here
|
||||
rc = msm_vidc_alloc_and_queue_session_internal_buffers(inst,
|
||||
MSM_VIDC_BUF_PERSIST);
|
||||
if (rc)
|
||||
goto error;
|
||||
s_vpr_h(inst->sid, "persist buffer: %d %d\n",
|
||||
inst->buffers.persist.min_count,
|
||||
inst->buffers.persist.size);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
if (q->type == INPUT_MPLANE) {
|
||||
|
@@ -2453,6 +2453,7 @@ static int __response_handler(struct msm_vidc_core *core)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
memset(core->response_packet, 0, core->packet_size);
|
||||
while (!__iface_msgq_read(core, core->response_packet)) {
|
||||
rc = handle_response(core, core->response_packet);
|
||||
if (rc)
|
||||
@@ -2460,6 +2461,7 @@ static int __response_handler(struct msm_vidc_core *core)
|
||||
/* check for system error */
|
||||
if (core->state != MSM_VIDC_CORE_INIT)
|
||||
break;
|
||||
memset(core->response_packet, 0, core->packet_size);
|
||||
}
|
||||
|
||||
__schedule_power_collapse_work(core);
|
||||
|
@@ -68,18 +68,27 @@ u32 vidc_port_from_hfi(struct msm_vidc_inst *inst,
|
||||
}
|
||||
|
||||
bool is_valid_hfi_port(struct msm_vidc_inst *inst, u32 port,
|
||||
const char *func)
|
||||
u32 buffer_type, const char *func)
|
||||
{
|
||||
if (!inst) {
|
||||
s_vpr_e(inst->sid, "%s: invalid params\n", func);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (port != HFI_PORT_BITSTREAM && port != HFI_PORT_RAW) {
|
||||
s_vpr_e(inst->sid, "%s: invalid port %#x\n", func, port);
|
||||
return false;
|
||||
}
|
||||
if (port == HFI_PORT_NONE &&
|
||||
buffer_type != HFI_BUFFER_ARP &&
|
||||
buffer_type != HFI_BUFFER_PERSIST)
|
||||
goto invalid;
|
||||
|
||||
if (port != HFI_PORT_BITSTREAM && port != HFI_PORT_RAW)
|
||||
goto invalid;
|
||||
|
||||
return true;
|
||||
|
||||
invalid:
|
||||
s_vpr_e(inst->sid, "%s: invalid port %#x buffer_type %u\n",
|
||||
func, port, buffer_type);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool is_valid_hfi_buffer_type(struct msm_vidc_inst *inst,
|
||||
@@ -731,6 +740,35 @@ static int handle_bin_buffer(struct msm_vidc_inst *inst,
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int handle_arp_buffer(struct msm_vidc_inst *inst,
|
||||
struct hfi_buffer *buffer)
|
||||
{
|
||||
int rc = 0;
|
||||
struct msm_vidc_buffers *buffers;
|
||||
struct msm_vidc_buffer *buf;
|
||||
bool found;
|
||||
|
||||
buffers = msm_vidc_get_buffers(inst, MSM_VIDC_BUF_ARP, __func__);
|
||||
if (!buffers)
|
||||
return -EINVAL;
|
||||
|
||||
found = false;
|
||||
list_for_each_entry(buf, &buffers->list, list) {
|
||||
if (buf->device_addr == buffer->base_address) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found) {
|
||||
rc = msm_vidc_destroy_internal_buffer(inst, buf);
|
||||
} else {
|
||||
s_vpr_e(inst->sid, "%s: invalid idx %d daddr %#x\n",
|
||||
__func__, buffer->index, buffer->base_address);
|
||||
return -EINVAL;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int handle_session_buffer(struct msm_vidc_inst *inst,
|
||||
struct hfi_packet *pkt)
|
||||
{
|
||||
@@ -745,10 +783,6 @@ static int handle_session_buffer(struct msm_vidc_inst *inst,
|
||||
}
|
||||
|
||||
port_type = pkt->port;
|
||||
if (!is_valid_hfi_port(inst, port_type, __func__)) {
|
||||
msm_vidc_change_inst_state(inst, MSM_VIDC_ERROR, __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
buffer = (struct hfi_buffer *)((u8 *)pkt + sizeof(struct hfi_packet));
|
||||
buf_type = buffer->type;
|
||||
@@ -757,12 +791,29 @@ static int handle_session_buffer(struct msm_vidc_inst *inst,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!is_valid_hfi_port(inst, port_type, buf_type, __func__)) {
|
||||
msm_vidc_change_inst_state(inst, MSM_VIDC_ERROR, __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (is_encode_session(inst)) {
|
||||
if (port_type == HFI_PORT_BITSTREAM) {
|
||||
if (buf_type == HFI_BUFFER_METADATA)
|
||||
rc = handle_output_metadata_buffer(inst, buffer);
|
||||
else if (buf_type == HFI_BUFFER_BITSTREAM)
|
||||
rc = handle_output_buffer(inst, buffer);
|
||||
else if (buf_type == HFI_BUFFER_BIN)
|
||||
rc = handle_bin_buffer(inst, buffer);
|
||||
else if (buf_type == HFI_BUFFER_COMV)
|
||||
rc = handle_comv_buffer(inst, buffer);
|
||||
else if (buf_type == HFI_BUFFER_NON_COMV)
|
||||
rc = handle_non_comv_buffer(inst, buffer);
|
||||
else if (buf_type == HFI_BUFFER_LINE)
|
||||
rc = handle_line_buffer(inst, buffer);
|
||||
else if (buf_type == HFI_BUFFER_ARP)
|
||||
rc = handle_arp_buffer(inst, buffer);
|
||||
else if (buf_type == HFI_BUFFER_DPB)
|
||||
rc = handle_dpb_buffer(inst, buffer);
|
||||
else
|
||||
s_vpr_e(inst->sid, "%s: unknown bitstream port buffer type %#x\n",
|
||||
__func__, buf_type);
|
||||
|
Reference in New Issue
Block a user