msm:vidc: Add support for MP2 sequence end code

ISDB-T client requires end of sequence notification
in the flags of the output buffer when sequence end
code is queued to the video core. Add support by reading
from video core shared memory and update the output buffer
flags for MPEG-2 codec.

Change-Id: Idd88fc6a5cdccb41fa61ba902a0014ec8359739a
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
This commit is contained in:
Rajeshwar Kurapaty 2013-01-15 17:12:31 +05:30 committed by Stephen Boyd
parent 393baf6efa
commit d204ac68eb
4 changed files with 35 additions and 8 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
/* Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -1188,6 +1188,7 @@ static u32 ddl_decoder_output_done_callback(
enum vidc_1080p_decode_frame frame_type = 0;
u32 vcd_status, free_luma_dpb = 0, disp_pict = 0, is_interlaced;
u32 idr_frame = 0, coded_frame = 0;
u32 seq_end_code_present = 0;
get_dec_op_done_data(dec_disp_info, decoder->output_order,
&output_vcd_frm->physical, &is_interlaced);
decoder->progressive_only = !(is_interlaced);
@ -1261,6 +1262,15 @@ static u32 ddl_decoder_output_done_callback(
if (decoder->codec.codec != VCD_CODEC_H264 &&
decoder->codec.codec != VCD_CODEC_MPEG2)
output_vcd_frm->flags &= ~VCD_FRAME_FLAG_DATACORRUPT;
if (decoder->codec.codec == VCD_CODEC_MPEG2) {
vidc_sm_get_mp2common_status(&ddl->shared_mem
[ddl->command_channel],
&seq_end_code_present);
if (seq_end_code_present)
output_vcd_frm->flags |= VCD_FRAME_FLAG_EOSEQ;
else
output_vcd_frm->flags &= ~VCD_FRAME_FLAG_EOSEQ;
}
output_vcd_frm->ip_frm_tag = dec_disp_info->tag_top;
vidc_sm_get_picture_times(&ddl->shared_mem
[ddl->command_channel],

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
/* Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -307,7 +307,9 @@
#define VIDC_SM_MP2_DATA_DUMP_BUFFER_ADDR 0x01a4
#define VIDC_SM_MP2_DATA_DUMP_BUFFER_SIZE_ADDR 0x01a8
#define VIDC_SM_MP2_COMMON_STATUS_DEC_ORDER_ADDR 0x01b0
#define VIDC_SM_MP2_SEQ_END_CODE_BMSK 0x00000002
#define VIDC_SM_MP2_SEQ_END_CODE_SHIFT 1
#define VIDC_SM_ENC_EXT_CTRL_CLOSED_GOP_ENABLE_BMSK 0x40
#define VIDC_SM_ENC_EXT_CTRL_CLOSED_GOP_ENABLE_SHFT 6
@ -1187,3 +1189,14 @@ void vidc_sm_set_h264_encoder_timing_info(struct ddl_buf_addr *shared_mem,
VIDC_SM_ENC_TIME_SCALE_ADDR,
time_scale);
}
void vidc_sm_get_mp2common_status(struct ddl_buf_addr *shared_mem,
u32 *seq_end_code_present)
{
u32 status;
status = DDL_MEM_READ_32(shared_mem,
VIDC_SM_MP2_COMMON_STATUS_DEC_ORDER_ADDR);
*seq_end_code_present = (u32) VIDC_GETFIELD(status,
VIDC_SM_MP2_SEQ_END_CODE_BMSK,
VIDC_SM_MP2_SEQ_END_CODE_SHIFT);
}

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
/* Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -201,5 +201,7 @@ void vidc_sm_set_mp2datadumpbuffer(struct ddl_buf_addr *shared_mem,
u32 mp2datadumpaddr, u32 mp2datadumpsize);
void vidc_sm_set_h264_encoder_timing_info(struct ddl_buf_addr *shared_mem,
u32 num_units_in_tick, u32 time_scale);
void vidc_sm_get_mp2common_status(struct ddl_buf_addr *shared_mem,
u32 *seq_end_code_present);
#endif

View file

@ -2308,10 +2308,12 @@ u32 vcd_handle_frame_done(
op_frm->vcd_frm.time_stamp = transc->time_stamp;
op_frm->vcd_frm.ip_frm_tag = transc->ip_frm_tag;
if (!(op_frm->vcd_frm.flags & VCD_FRAME_FLAG_EOSEQ)) {
if (transc->flags & VCD_FRAME_FLAG_EOSEQ)
op_frm->vcd_frm.flags |= VCD_FRAME_FLAG_EOSEQ;
else
op_frm->vcd_frm.flags &= ~VCD_FRAME_FLAG_EOSEQ;
}
if (cctxt->decoding)
op_frm->vcd_frm.frame = transc->frame;