summaryrefslogtreecommitdiff
authorshihong.zheng <shihong.zheng@amlogic.com>2019-11-13 08:35:34 (GMT)
committer Zhi Zhou <zhi.zhou@amlogic.com>2019-11-27 05:42:37 (GMT)
commitb0d2d512bdef6279acef5ecf52a18b84c12b82f7 (patch)
treeaa7f5e8ffb8175e88f0fc5ba4a170b2f2c432723
parentfebdc420bb344bb8c9f436fe03f68d32447360af (diff)
downloadmedia_modules-b0d2d512bdef6279acef5ecf52a18b84c12b82f7.zip
media_modules-b0d2d512bdef6279acef5ecf52a18b84c12b82f7.tar.gz
media_modules-b0d2d512bdef6279acef5ecf52a18b84c12b82f7.tar.bz2
decoder: fix mpeg4 display green screen. [1/1]
PD#IPTV-5117 Problem: mpeg4 start decode when first frame not ready. Solution: add set start_dec_buf_level for ready to run. same with mpeg2 mjpeg mpeg4. Verify: S905L2A Change-Id: I046fbfd4dfee97238eaf0982375a3a1e1759a12e Signed-off-by: shihong.zheng <shihong.zheng@amlogic.com>
Diffstat
-rw-r--r--drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c8
-rw-r--r--drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c20
-rw-r--r--drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c10
3 files changed, 31 insertions, 7 deletions
diff --git a/drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c b/drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c
index 5ec3824..5ebb6be 100644
--- a/drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c
+++ b/drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c
@@ -94,6 +94,7 @@ static int vmjpeg_vf_states(struct vframe_states *states, void *);
static int vmjpeg_event_cb(int type, void *data, void *private_data);
static void vmjpeg_work(struct work_struct *work);
static int pre_decode_buf_level = 0x800;
+static int start_decode_buf_level = 0x2000;
static u32 without_display_mode;
#undef pr_info
#define pr_info printk
@@ -1396,8 +1397,6 @@ static int ammvdec_mjpeg_probe(struct platform_device *pdev)
return -EFAULT;
}
- hw = (struct vdec_mjpeg_hw_s *)devm_kzalloc(&pdev->dev,
- sizeof(struct vdec_mjpeg_hw_s), GFP_KERNEL);
hw = vzalloc(sizeof(struct vdec_mjpeg_hw_s));
if (hw == NULL) {
pr_info("\nammvdec_mjpeg device data allocation failed\n");
@@ -1455,6 +1454,8 @@ static int ammvdec_mjpeg_probe(struct platform_device *pdev)
pdata->dec_status = NULL;
return -ENODEV;
}
+ vdec_set_prepare_level(pdata, start_decode_buf_level);
+
if (pdata->parallel_dec == 1)
vdec_core_request(pdata, CORE_MASK_VDEC_1);
else {
@@ -1563,6 +1564,9 @@ module_param_array(max_process_time, uint, &max_decode_instance_num, 0664);
module_param(radr, uint, 0664);
MODULE_PARM_DESC(radr, "\nradr\n");
+module_param(start_decode_buf_level, uint, 0664);
+MODULE_PARM_DESC(start_decode_buf_level, "\nstart_decode_buf_level\n");
+
module_param(rval, uint, 0664);
MODULE_PARM_DESC(rval, "\nrval\n");
diff --git a/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c b/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c
index bdeb04e..7033fa6 100644
--- a/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c
+++ b/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c
@@ -106,9 +106,9 @@
#define DEFAULT_MEM_SIZE (32*SZ_1M)
static u32 buf_size = 32 * 1024 * 1024;
static int pre_decode_buf_level = 0x800;
+static int start_decode_buf_level = 0x4000;
static u32 dec_control;
static u32 error_frame_skip_level = 2;
-static u32 stat;
static u32 udebug_flag;
static unsigned int radr;
static unsigned int rval;
@@ -118,7 +118,7 @@ static u32 without_display_mode;
#define VMPEG12_DEV_NUM 9
static unsigned int max_decode_instance_num = VMPEG12_DEV_NUM;
static unsigned int max_process_time[VMPEG12_DEV_NUM];
-static unsigned int decode_timeout_val = 100;
+static unsigned int decode_timeout_val = 200;
#define INCPTR(p) ptr_atomic_wrap_inc(&p)
#define DEC_CONTROL_FLAG_FORCE_2500_720_576_INTERLACE 0x0002
@@ -2849,6 +2849,8 @@ static int ammvdec_mpeg12_probe(struct platform_device *pdev)
pdata->dec_status = NULL;
return -ENODEV;
}
+ vdec_set_prepare_level(pdata, start_decode_buf_level);
+
if (pdata->parallel_dec == 1)
vdec_core_request(pdata, CORE_MASK_VDEC_1);
else {
@@ -2978,12 +2980,19 @@ static struct codec_profile_t ammvdec_mpeg12_profile = {
};
static struct mconfig mmpeg12_configs[] = {
- MC_PU32("stat", &stat),
MC_PU32("radr", &radr),
MC_PU32("rval", &rval),
MC_PU32("dec_control", &dec_control),
MC_PU32("error_frame_skip_level", &error_frame_skip_level),
MC_PU32("decode_timeout_val", &decode_timeout_val),
+ MC_PU32("start_decode_buf_level", &start_decode_buf_level),
+ MC_PU32("pre_decode_buf_level", &pre_decode_buf_level),
+ MC_PU32("debug_enable", &debug_enable),
+ MC_PU32("udebug_flag", &udebug_flag),
+ MC_PU32("without_display_mode", &without_display_mode),
+#ifdef AGAIN_HAS_THRESHOLD
+ MC_PU32("again_threshold", &again_threshold),
+#endif
};
static struct mconfig_node mmpeg12_node;
@@ -3026,6 +3035,11 @@ MODULE_PARM_DESC(debug_enable,
module_param(pre_decode_buf_level, int, 0664);
MODULE_PARM_DESC(pre_decode_buf_level,
"\n ammvdec_mpeg12 pre_decode_buf_level\n");
+
+module_param(start_decode_buf_level, int, 0664);
+MODULE_PARM_DESC(start_decode_buf_level,
+ "\n ammvdec_mpeg12 start_decode_buf_level\n");
+
module_param(decode_timeout_val, uint, 0664);
MODULE_PARM_DESC(decode_timeout_val, "\n ammvdec_mpeg12 decode_timeout_val\n");
diff --git a/drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c b/drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c
index d920436..50b10c6 100644
--- a/drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c
+++ b/drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c
@@ -135,6 +135,7 @@ static void vmpeg_vf_put(struct vframe_s *, void *);
static int vmpeg_vf_states(struct vframe_states *states, void *);
static int vmpeg_event_cb(int type, void *data, void *private_data);
static int pre_decode_buf_level = 0x800;
+static int start_decode_buf_level = 0x4000;
static int debug_enable;
static unsigned int radr;
static unsigned int rval;
@@ -144,7 +145,7 @@ static unsigned int frmbase_cont_bitlevel = 0x40;
#define VMPEG4_DEV_NUM 9
static unsigned int max_decode_instance_num = VMPEG4_DEV_NUM;
static unsigned int max_process_time[VMPEG4_DEV_NUM];
-static unsigned int decode_timeout_val = 100;
+static unsigned int decode_timeout_val = 200;
static u32 without_display_mode;
@@ -2312,6 +2313,7 @@ static int ammvdec_mpeg4_probe(struct platform_device *pdev)
pdata->dec_status = NULL;
return -ENODEV;
}
+ vdec_set_prepare_level(pdata, start_decode_buf_level);
if (pdata->parallel_dec == 1)
vdec_core_request(pdata, CORE_MASK_VDEC_1);
@@ -2441,7 +2443,11 @@ module_param_array(max_process_time, uint, &max_decode_instance_num, 0664);
module_param(pre_decode_buf_level, int, 0664);
MODULE_PARM_DESC(pre_decode_buf_level,
- "\n ammvdec_ mpeg4 pre_decode_buf_level\n");
+ "\n ammvdec_mpeg4 pre_decode_buf_level\n");
+
+module_param(start_decode_buf_level, int, 0664);
+MODULE_PARM_DESC(start_decode_buf_level,
+ "\n ammvdec_mpeg4 start_decode_buf_level\n");
module_param(udebug_flag, uint, 0664);
MODULE_PARM_DESC(udebug_flag, "\n ammvdec_mpeg4 udebug_flag\n");