return NULL;
}
- spin_lock_init(&nal_q_handle->nal_q_in_handle->lock);
+ spin_lock_init(&nal_q_handle->lock);
nal_q_handle->nal_q_out_handle = mfc_nal_q_create_out_q(dev, nal_q_handle);
if (!nal_q_handle->nal_q_out_handle) {
DecoderOutputStr *pOutStr)
{
struct s5p_mfc_dec *dec = ctx->dec_priv;
+ struct s5p_mfc_dev *dev = ctx->dev;
struct s5p_mfc_buf *src_mb;
unsigned int index;
int deleted = 0;
dec->remained_size = src_mb->vb.vb2_buf.planes[0].bytesused
- dec->consumed;
dec->has_multiframe = 1;
+
+ MFC_TRACE_CTX("** consumed:%ld, remained:%ld, addr:0x%08llx\n",
+ dec->consumed, dec->remained_size, dec->y_addr_for_pb);
/* Do not move src buffer to done_list */
return;
}
return -EINVAL;
}
- spin_lock_irqsave(&nal_q_in_handle->lock, flags);
+ spin_lock_irqsave(&nal_q_in_handle->nal_q_handle->lock, flags);
input_count = s5p_mfc_get_nal_q_input_count();
input_exe_count = s5p_mfc_get_nal_q_input_exe_count();
if ((input_diff < 0) || (input_diff >= NAL_Q_IN_QUEUE_SIZE)) {
mfc_err_dev("NAL Q: No available input slot(%d)\n", input_diff);
- spin_unlock_irqrestore(&nal_q_in_handle->lock, flags);
+ spin_unlock_irqrestore(&nal_q_in_handle->nal_q_handle->lock, flags);
return -EINVAL;
}
if (ret != 0) {
mfc_debug(2, "NAL Q: Failed to set input queue\n");
- spin_unlock_irqrestore(&nal_q_in_handle->lock, flags);
+ spin_unlock_irqrestore(&nal_q_in_handle->nal_q_handle->lock, flags);
return ret;
}
if (input_diff == 0)
s5p_mfc_watchdog_start_tick(dev);
- spin_unlock_irqrestore(&nal_q_in_handle->lock, flags);
+ spin_unlock_irqrestore(&nal_q_in_handle->nal_q_handle->lock, flags);
MFC_TRACE_CTX("NAL %s in: diff %d count %d exe %d\n",
ctx->type == MFCINST_ENCODER ? "ENC" : "DEC",
return pStr;
}
- spin_lock_irqsave(&nal_q_out_handle->nal_q_handle->nal_q_in_handle->lock, flags);
+ spin_lock_irqsave(&nal_q_out_handle->nal_q_handle->lock, flags);
output_count = s5p_mfc_get_nal_q_output_count();
output_exe_count = nal_q_out_handle->out_exe_count;
mfc_debug(2, "NAL Q: output_diff = %d(out: %d, exe: %d)\n",
output_diff, output_count, output_exe_count);
if ((output_diff <= 0) || (output_diff > NAL_Q_OUT_QUEUE_SIZE)) {
- spin_unlock_irqrestore(&nal_q_out_handle->nal_q_handle->nal_q_in_handle->lock, flags);
+ spin_unlock_irqrestore(&nal_q_out_handle->nal_q_handle->lock, flags);
mfc_debug(2, "NAL Q: No available output slot(%d)\n", output_diff);
return pStr;
}
s5p_mfc_watchdog_reset_tick(dev);
}
- spin_unlock_irqrestore(&nal_q_out_handle->nal_q_handle->nal_q_in_handle->lock, flags);
+ spin_unlock_irqrestore(&nal_q_out_handle->nal_q_handle->lock, flags);
MFC_TRACE_CTX("NAL %s out: diff %d count %d exe %d\n",
ctx->type == MFCINST_ENCODER ? "ENC" : "DEC",
static void mfc_display_state(struct s5p_mfc_dev *dev)
{
+ nal_queue_handle *nal_q_handle = dev->nal_q_handle;
int i;
pr_err("-----------dumping MFC device info-----------\n");
dev->hwlock.bits, dev->hwlock.dev,
dev->curr_ctx, dev->curr_ctx_is_drm,
dev->preempt_ctx, s5p_mfc_get_bits(&dev->work_bits));
+ pr_err("NAL-Q state:%d, exception:%d, in_exe_cnt: %d, out_exe_cnt: %d\n",
+ nal_q_handle->nal_q_state, nal_q_handle->nal_q_exception,
+ nal_q_handle->nal_q_in_handle->in_exe_count,
+ nal_q_handle->nal_q_out_handle->out_exe_count);
for (i = 0; i < MFC_NUM_CONTEXTS; i++)
if (dev->ctx[i])
- pr_err("MFC ctx[%d] %s(%d) state:%d, queue_cnt(src:%d, dst:%d),"
- " interrupt(cond:%d, type:%d, err:%d)\n",
+ pr_err("MFC ctx[%d] %s(%d) state:%d, queue_cnt(src:%d, dst:%d, ref:%d, qsrc:%d, qdst:%d)\n"
+ " interrupt(cond:%d, type:%d, err:%d)\n",
dev->ctx[i]->num,
dev->ctx[i]->type == MFCINST_DECODER ? "DEC" : "ENC",
dev->ctx[i]->codec_mode, dev->ctx[i]->state,
s5p_mfc_get_queue_count(&dev->ctx[i]->buf_queue_lock, &dev->ctx[i]->src_buf_queue),
s5p_mfc_get_queue_count(&dev->ctx[i]->buf_queue_lock, &dev->ctx[i]->dst_buf_queue),
+ s5p_mfc_get_queue_count(&dev->ctx[i]->buf_queue_lock, &dev->ctx[i]->ref_buf_queue),
+ s5p_mfc_get_queue_count(&dev->ctx[i]->buf_queue_lock, &dev->ctx[i]->src_buf_nal_queue),
+ s5p_mfc_get_queue_count(&dev->ctx[i]->buf_queue_lock, &dev->ctx[i]->dst_buf_nal_queue),
dev->ctx[i]->int_condition, dev->ctx[i]->int_reason,
dev->ctx[i]->int_err);
}