}
return;
}
-static void buf_spec_init(struct vdec_h264_hw_s *hw)
+static void buf_spec_init(struct vdec_h264_hw_s *hw, bool buffer_reset_flag)
{
int i;
unsigned long flags;
vf->index = -1;
}
}
-
- for (i = 0; i < BUFSPEC_POOL_SIZE; i++) {
- hw->buffer_spec[i].used = -1;
- hw->buffer_spec[i].canvas_pos = -1;
+ if (buffer_reset_flag) {
+ for (i = 0; i < BUFSPEC_POOL_SIZE; i++) {
+ if (hw->buffer_spec[i].used != -1)
+ hw->buffer_spec[i].used = 0;
+ }
+ } else {
+ for (i = 0; i < BUFSPEC_POOL_SIZE; i++) {
+ hw->buffer_spec[i].used = -1;
+ hw->buffer_spec[i].canvas_pos = -1;
+ }
}
if (dpb_is_debug(DECODE_ID(hw),
}
static int vh264_set_params(struct vdec_h264_hw_s *hw,
- u32 param1, u32 param2, u32 param3, u32 param4)
+ u32 param1, u32 param2, u32 param3, u32 param4, bool buffer_reset_flag)
{
int i, j;
int mb_width, mb_total;
mutex_lock(&vmh264_mutex);
if (!hw->mmu_enable) {
- config_buf_specs(vdec);
+ if (!buffer_reset_flag)
+ config_buf_specs(vdec);
i = get_buf_spec_by_canvas_pos(hw, 0);
if (hw->is_used_v4l) {
}
else {
if (vh264_set_params(hw, param1,
- param2, param3, param4) < 0)
+ param2, param3, param4, false) < 0)
dpb_print(DECODE_ID(hw), 0, "set parameters error\n");
WRITE_VREG(AV_SCRATCH_0, (hw->max_reference_size<<24) |
}
} else {
if (vh264_set_params(hw, param1,
- param2, param3, param4) < 0)
+ param2, param3, param4, false) < 0)
dpb_print(DECODE_ID(hw), 0, "set parameters error\n");
WRITE_VREG(AV_SCRATCH_0, (hw->max_reference_size<<24) |
schedule();
}
- buf_spec_init(hw);
+ buf_spec_init(hw, true);
vh264_local_init(hw, true);
/*hw->decode_pic_count = 0;
hw->cfg_param1,
hw->cfg_param2,
hw->cfg_param3,
- hw->cfg_param4) < 0)
+ hw->cfg_param4, true) < 0)
hw->stat |= DECODER_FATAL_ERROR_SIZE_OVERFLOW;
/*drop 3 frames after reset bufmgr if bit0 is set 1 */
platform_set_drvdata(pdev, pdata);
- buf_spec_init(hw);
+ buf_spec_init(hw, false);
hw->platform_dev = pdev;