msm_vidc: Fix for DRC in Adative Mode

Add mechanism to store Adaptive width and height
values in start and check while resolution_decreased_event
with new resolution (width/height). In new resolution,
if any width/height is greater than adaptive values,
Send PORT_RECONFIG_EVENT

BUG:20895249
Change-Id: I03ccc7d13a767240b962e7c6f4aa25566f3c5a7e
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
Signed-off-by: Shivaprasad Hongal <shongal@codeaurora.org>
This commit is contained in:
Shivaprasad Hongal 2015-07-06 17:21:45 -07:00
parent 14de53c477
commit f06badf4d4
3 changed files with 27 additions and 2 deletions

View file

@ -343,6 +343,8 @@ struct ddl_decoder_data {
struct ddl_mp2_datadumpenabletype mp2_datadump_enable;
u32 mp2_datadump_status;
u32 extn_user_data_enable;
u32 adaptive_width;
u32 adaptive_height;
};
union ddl_codec_data{
struct ddl_codec_data_hdr hdr;

View file

@ -1021,6 +1021,8 @@ u32 ddl_check_reconfig(struct ddl_client_context *ddl)
if (decoder->cont_mode) {
if ((decoder->actual_output_buf_req.sz <=
decoder->client_output_buf_req.sz) &&
decoder->frame_size.width <= decoder->adaptive_width &&
decoder->frame_size.height <= decoder->adaptive_height &&
(decoder->actual_output_buf_req.actual_count <=
decoder->client_output_buf_req.actual_count)) {
need_reconfig = false;
@ -1060,8 +1062,23 @@ u32 ddl_check_reconfig(struct ddl_client_context *ddl)
void ddl_handle_reconfig(u32 res_change, struct ddl_client_context *ddl)
{
struct ddl_decoder_data *decoder = &ddl->codec_data.decoder;
struct vidc_1080p_dec_disp_info *dec_disp_info =
&(decoder->dec_disp_info);
u32 width = 0;
u32 height = 0;
u32 adaptive_width = 0;
u32 adaptive_height = 0;
width = DDL_ALIGN(dec_disp_info->img_size_x, DDL_TILE_ALIGN_WIDTH);
height = DDL_ALIGN(dec_disp_info->img_size_y, DDL_TILE_ALIGN_HEIGHT);
adaptive_width = DDL_ALIGN(decoder->adaptive_width, DDL_TILE_ALIGN_WIDTH);
adaptive_height = DDL_ALIGN(decoder->adaptive_height, DDL_TILE_ALIGN_HEIGHT);
if ((decoder->cont_mode) &&
(res_change == DDL_RESL_CHANGE_DECREASED)) {
(res_change == DDL_RESL_CHANGE_DECREASED) &&
width <= adaptive_width && height <= adaptive_height) {
DDL_MSG_LOW("%s Resolution decreased, continue decoding\n",
__func__);
vidc_sm_get_min_yc_dpb_sizes(

View file

@ -288,7 +288,11 @@ static u32 ddl_set_dec_property(struct ddl_client_context *ddl,
ddl_set_default_decoder_buffer_req(decoder,
true);
}
DDL_MSG_LOW("set VCD_I_FRAME_SIZE width = %d"
if (decoder->cont_mode) {
decoder->adaptive_width = decoder->client_frame_size.width;
decoder->adaptive_height = decoder->client_frame_size.height;
}
DDL_MSG_LOW("set VCD_I_FRAME_SIZE width = %d"
" height = %d\n",
frame_size->width, frame_size->height);
vcd_status = VCD_S_SUCCESS;
@ -1792,6 +1796,8 @@ void ddl_set_default_dec_property(struct ddl_client_context *ddl)
decoder->output_order = VCD_DEC_ORDER_DISPLAY;
decoder->field_needed_for_prev_ip = 0;
decoder->cont_mode = 0;
decoder->adaptive_width = 0;
decoder->adaptive_height = 0;
decoder->reconfig_detected = false;
decoder->dmx_disable = false;
ddl_set_default_metadata_flag(ddl);