summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuang Chaofan <chaofan.huang@nxp.com>2018-11-28 17:12:34 +0800
committerBryan O'Donoghue <bryan.odonoghue@linaro.org>2019-05-01 17:43:27 +0100
commit9981c6877f8ae7f75f388950add00fc4a3ea3d76 (patch)
tree1ffd9d183268687ab0a4954a85d7a102348c1510
parentda5168eaebd125fc9c272f8247f569bb066f4558 (diff)
MLK-20484 VPU: Remove debug log when boot and adjust some other codes
1. Remove debug log when boot 2. Add 8 for the vp8 frame length 3. correct some codes Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com> (cherry picked from commit 1cbc438fade80f4d91851f1495852e43d2807f9d)
-rw-r--r--drivers/mxc/vpu-decoder-b0/insert_startcode.c4
-rw-r--r--drivers/mxc/vpu-decoder-b0/vpu_b0.c15
-rw-r--r--drivers/mxc/vpu-decoder-b0/vpu_b0.h2
-rw-r--r--drivers/mxc/vpu-decoder-b0/vpu_debug_log.c4
4 files changed, 17 insertions, 8 deletions
diff --git a/drivers/mxc/vpu-decoder-b0/insert_startcode.c b/drivers/mxc/vpu-decoder-b0/insert_startcode.c
index dc2825b63e09..dbd8a893ad6c 100644
--- a/drivers/mxc/vpu-decoder-b0/insert_startcode.c
+++ b/drivers/mxc/vpu-decoder-b0/insert_startcode.c
@@ -453,7 +453,7 @@ u_int32 insert_scode_4_seq(struct vpu_ctx *ctx, u_int8 *src, u_int8 *dst, u_int3
vp8_ivf_sequence_header(seq_header, q_data->width, q_data->height);
memcpy(dst+length, seq_header, 32);
length += 32;
- vp8_scd_frame_header(dst + length, q_data->width, q_data->height, uPayloadSize);
+ vp8_scd_frame_header(dst + length, q_data->width, q_data->height, uPayloadSize + 8);
length += 16;
vp8_ivf_frame_header(frame_header, uPayloadSize);
memcpy(dst+length, frame_header, 8);
@@ -517,7 +517,7 @@ u_int32 insert_scode_4_pic(struct vpu_ctx *ctx, u_int8 *dst, u_int8 *src, u_int3
case VPU_VIDEO_VP8: {
u_int8 frame_header[8];
- vp8_scd_frame_header(dst, q_data->width, q_data->height, uPayloadSize);
+ vp8_scd_frame_header(dst, q_data->width, q_data->height, uPayloadSize + 8);
length = 16;
vp8_ivf_frame_header(frame_header, uPayloadSize);
memcpy(dst+length, frame_header, 8);
diff --git a/drivers/mxc/vpu-decoder-b0/vpu_b0.c b/drivers/mxc/vpu-decoder-b0/vpu_b0.c
index b4275155358c..c515b39325e1 100644
--- a/drivers/mxc/vpu-decoder-b0/vpu_b0.c
+++ b/drivers/mxc/vpu-decoder-b0/vpu_b0.c
@@ -194,6 +194,9 @@ static void vpu_log_buffer_state(struct vpu_ctx *ctx)
struct vb2_data_req *p_data_req;
int i;
+ if (!ctx)
+ return;
+
for (i = 0; i < VPU_MAX_BUFFER; i++) {
p_data_req = &ctx->q_data[V4L2_DST].vb2_reqs[i];
if (p_data_req->vb2_buf != NULL)
@@ -235,6 +238,9 @@ static int find_buffer_id(struct vpu_ctx *ctx, u_int32 addr)
u_int32 *pphy_address;
u_int32 i;
+ if (!ctx)
+ return -1;
+
for (i = 0; i < VPU_MAX_BUFFER; i++) {
p_data_req = &ctx->q_data[V4L2_DST].vb2_reqs[i];
if (p_data_req->vb2_buf != NULL) {
@@ -3024,6 +3030,7 @@ static int v4l2_open(struct file *filp)
ctx->pSeqinfo = kzalloc(sizeof(MediaIPFW_Video_SeqInfo), GFP_KERNEL);
if (!ctx->pSeqinfo) {
vpu_dbg(LVL_ERR, "error: pSeqinfo alloc fail\n");
+ ret = -ENOMEM;
goto err_alloc_seq;
}
init_queue_data(ctx);
@@ -3050,7 +3057,8 @@ static int v4l2_open(struct file *filp)
mutex_unlock(&dev->dev_mutex);
create_instance_file(ctx);
rpc_set_stream_cfg_value(dev->shared_mem.pSharedInterface, ctx->str_index);
- if (alloc_vpu_buffer(ctx))
+ ret = alloc_vpu_buffer(ctx);
+ if (ret)
goto err_alloc_buffer;
return 0;
@@ -3099,9 +3107,8 @@ static int v4l2_release(struct file *filp)
ctx->hang_status = true;
vpu_dbg(LVL_ERR, "the path id:%d firmware hang after send VID_API_CMD_STOP\n", ctx->str_index);
}
- } else {
- vpu_dbg(LVL_WARN, "v4l2_release() - stopped(%d): skip VID_API_CMD_STOP\n", ctx->firmware_stopped);
- }
+ } else
+ vpu_dbg(LVL_INFO, "v4l2_release() - stopped(%d): skip VID_API_CMD_STOP\n", ctx->firmware_stopped);
release_queue_data(ctx);
ctrls_delete_decoder(ctx);
diff --git a/drivers/mxc/vpu-decoder-b0/vpu_b0.h b/drivers/mxc/vpu-decoder-b0/vpu_b0.h
index fedc49a496a8..b6c66b35c370 100644
--- a/drivers/mxc/vpu-decoder-b0/vpu_b0.h
+++ b/drivers/mxc/vpu-decoder-b0/vpu_b0.h
@@ -305,7 +305,7 @@ struct vpu_ctx {
#define vpu_dbg(level, fmt, arg...) \
do { \
if (vpu_dbg_level_decoder >= (level)) \
- printk("[DEBUG]\t " fmt, ## arg); \
+ printk("[VPU Decoder]\t " fmt, ## arg); \
} while (0)
#endif
diff --git a/drivers/mxc/vpu-decoder-b0/vpu_debug_log.c b/drivers/mxc/vpu-decoder-b0/vpu_debug_log.c
index 47653439385e..d26562fa4ba3 100644
--- a/drivers/mxc/vpu-decoder-b0/vpu_debug_log.c
+++ b/drivers/mxc/vpu-decoder-b0/vpu_debug_log.c
@@ -64,8 +64,10 @@ int destroy_log_info_queue(struct vpu_ctx *ctx)
goto exit;
}
list_for_each_entry_safe(vpu_info, temp_info, &ctx->log_q, list)
- if (!vpu_info)
+ if (!vpu_info) {
list_del_init(&vpu_info->list);
+ kfree(vpu_info);
+ }
exit:
mutex_unlock(&ctx->instance_mutex);