From 040e0b96c7d404217c30e41fd08c2a7679fa56c4 Mon Sep 17 00:00:00 2001 From: Shi Zhongbo Date: Tue, 20 Aug 2019 15:51:26 +0800 Subject: [PATCH] msm_vidc: vdec: add codec check for reconfig event Add codec check for bit depth or color space only reconfig event. VP9 and HEVC have bit depth reconfig event while only HEVC has color space reconfig event. Change-Id: Ia6732e31a15957dc7116535131203a69fe19c987 Signed-off-by: Shi Zhongbo --- msm/vidc/msm_vidc_common.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/msm/vidc/msm_vidc_common.c b/msm/vidc/msm_vidc_common.c index f6b984f2dcc4..040d548ac853 100644 --- a/msm/vidc/msm_vidc_common.c +++ b/msm/vidc/msm_vidc_common.c @@ -1645,6 +1645,7 @@ static void handle_event_change(enum hal_command_response cmd, void *data) goto err_bad_event; } hdev = inst->core->device; + codec = get_v4l2_codec(inst); switch (event_notify->hal_event_type) { case HAL_EVENT_SEQ_CHANGED_SUFFICIENT_RESOURCES: @@ -1661,13 +1662,15 @@ static void handle_event_change(enum hal_command_response cmd, void *data) "event_notify->height = %d event_notify->width = %d\n", event_notify->height, event_notify->width); - event_fields_changed |= (inst->bit_depth != - event_notify->bit_depth); + if (codec == V4L2_PIX_FMT_HEVC || codec == V4L2_PIX_FMT_VP9) + event_fields_changed |= (inst->bit_depth != + event_notify->bit_depth); /* Check for change from hdr->non-hdr and vice versa */ - if ((event_notify->colour_space == MSM_VIDC_BT2020 && - inst->colour_space != MSM_VIDC_BT2020) || + if (codec == V4L2_PIX_FMT_HEVC && + ((event_notify->colour_space == MSM_VIDC_BT2020 && + inst->colour_space != MSM_VIDC_BT2020) || (event_notify->colour_space != MSM_VIDC_BT2020 && - inst->colour_space == MSM_VIDC_BT2020)) + inst->colour_space == MSM_VIDC_BT2020))) event_fields_changed = true; f = &inst->fmts[OUTPUT_PORT].v4l2_fmt; @@ -1769,7 +1772,6 @@ static void handle_event_change(enum hal_command_response cmd, void *data) ptr[6] = event_notify->crop_data.left; ptr[7] = event_notify->crop_data.height; ptr[8] = event_notify->crop_data.width; - codec = get_v4l2_codec(inst); ptr[9] = msm_comm_get_v4l2_profile(codec, event_notify->profile); ptr[10] = msm_comm_get_v4l2_level(codec,