mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 16:46:15 -04:00
msm: vidc: amend reconfiguration buffer requirements
Do not reset buffer counts while session is running and modify in case of insufficient event processing. Change-Id: I5425e54702339e768f3c3a6182fa62dd7a8b484a Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
This commit is contained in:
parent
82b121236b
commit
eb66c84844
2 changed files with 18 additions and 9 deletions
|
|
@ -606,6 +606,10 @@ int msm_vidc_calculate_input_buffer_count(struct msm_vidc_inst *inst)
|
|||
if (!is_decode_session(inst) && !is_encode_session(inst))
|
||||
return 0;
|
||||
|
||||
/* do not change buffer count while session is running */
|
||||
if (inst->state == MSM_VIDC_START_DONE)
|
||||
return 0;
|
||||
|
||||
if (is_thumbnail_session(inst)) {
|
||||
fmt->count_min = fmt->count_min_host = fmt->count_actual =
|
||||
MIN_NUM_THUMBNAIL_MODE_INPUT_BUFFERS;
|
||||
|
|
@ -650,6 +654,10 @@ int msm_vidc_calculate_output_buffer_count(struct msm_vidc_inst *inst)
|
|||
if (!is_decode_session(inst) && !is_encode_session(inst))
|
||||
return 0;
|
||||
|
||||
/* do not change buffer count while session is running */
|
||||
if (inst->state == MSM_VIDC_START_DONE)
|
||||
return 0;
|
||||
|
||||
if (is_thumbnail_session(inst)) {
|
||||
if (codec == V4L2_PIX_FMT_VP9) {
|
||||
fmt->count_min =
|
||||
|
|
|
|||
|
|
@ -1765,15 +1765,6 @@ static void handle_event_change(enum hal_command_response cmd, void *data)
|
|||
fmt = &inst->fmts[OUTPUT_PORT];
|
||||
fmt->v4l2_fmt.fmt.pix_mp.height = event_notify->height;
|
||||
fmt->v4l2_fmt.fmt.pix_mp.width = event_notify->width;
|
||||
extra_buff_count = msm_vidc_get_extra_buff_count(inst,
|
||||
HAL_BUFFER_OUTPUT);
|
||||
fmt->count_min = event_notify->capture_buf_count;
|
||||
fmt->count_min_host = fmt->count_min + extra_buff_count;
|
||||
|
||||
dprintk(VIDC_HIGH, "%s: buffer[%d] count: min %d min_host %d\n",
|
||||
__func__, HAL_BUFFER_OUTPUT, fmt->count_min,
|
||||
fmt->count_min_host);
|
||||
|
||||
mutex_unlock(&inst->lock);
|
||||
|
||||
if (event == V4L2_EVENT_SEQ_CHANGED_INSUFFICIENT) {
|
||||
|
|
@ -1785,6 +1776,16 @@ static void handle_event_change(enum hal_command_response cmd, void *data)
|
|||
dprintk(VIDC_HIGH, "%s: %x : batching %s\n",
|
||||
__func__, hash32_ptr(inst->session),
|
||||
inst->batch.enable ? "enabled" : "disabled");
|
||||
|
||||
extra_buff_count = msm_vidc_get_extra_buff_count(inst,
|
||||
HAL_BUFFER_OUTPUT);
|
||||
fmt->count_min = event_notify->capture_buf_count;
|
||||
fmt->count_min_host = fmt->count_min + extra_buff_count;
|
||||
dprintk(VIDC_HIGH,
|
||||
"%s: %x : hal buffer[%d] count: min %d min_host %d\n",
|
||||
__func__, hash32_ptr(inst->session),
|
||||
HAL_BUFFER_OUTPUT, fmt->count_min,
|
||||
fmt->count_min_host);
|
||||
}
|
||||
|
||||
rc = msm_vidc_check_session_supported(inst);
|
||||
|
|
|
|||
Loading…
Reference in a new issue