diff --git a/drivers/video/msm/vidc/1080p/ddl/vcd_ddl.h b/drivers/video/msm/vidc/1080p/ddl/vcd_ddl.h index 58a932990d30b26d9cbeba210c1467161700937c..b13b92afd807c02bfb0e8da61479ce391e3c357a 100644 --- a/drivers/video/msm/vidc/1080p/ddl/vcd_ddl.h +++ b/drivers/video/msm/vidc/1080p/ddl/vcd_ddl.h @@ -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; diff --git a/drivers/video/msm/vidc/1080p/ddl/vcd_ddl_helper.c b/drivers/video/msm/vidc/1080p/ddl/vcd_ddl_helper.c index 20fdf4069a34051721e5112d81610969a6c9f342..e9765f1bd6acc79520b393e0cebe922c11b762fe 100644 --- a/drivers/video/msm/vidc/1080p/ddl/vcd_ddl_helper.c +++ b/drivers/video/msm/vidc/1080p/ddl/vcd_ddl_helper.c @@ -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( diff --git a/drivers/video/msm/vidc/1080p/ddl/vcd_ddl_properties.c b/drivers/video/msm/vidc/1080p/ddl/vcd_ddl_properties.c index 7705734bb6f0b80631dc861cdbac610d34e0f153..32ecda3ed00e6b015557847dd97ed79d1e5ee8de 100644 --- a/drivers/video/msm/vidc/1080p/ddl/vcd_ddl_properties.c +++ b/drivers/video/msm/vidc/1080p/ddl/vcd_ddl_properties.c @@ -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);