Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 747b4a8b authored by Vasantha Balla's avatar Vasantha Balla
Browse files

vidc_3x: Query Entropy property only for H264 format



V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE is valid for h264
format only. No need to call get_prop of this for other formats.

Change-Id: I620ca1a799479c42399e683d9cc6f187ff7c3626
Signed-off-by: default avatarVasantha Balla <vballa@codeaurora.org>
parent 497e1f66
Loading
Loading
Loading
Loading
+22 −17
Original line number Original line Diff line number Diff line
/*
/*
 * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * 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
 * it under the terms of the GNU General Public License version 2 and
@@ -2023,24 +2023,29 @@ static int try_get_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
		ctrl->val = inst->capability.secure_output2_threshold.max;
		ctrl->val = inst->capability.secure_output2_threshold.max;
		break;
		break;
	case V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE:
	case V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE:
		if (inst->fmts[OUTPUT_PORT].fourcc == V4L2_PIX_FMT_H264) {
			rc = msm_comm_try_get_prop(inst,
			rc = msm_comm_try_get_prop(inst,
					HAL_CONFIG_VDEC_ENTROPY, &hprop);
					HAL_CONFIG_VDEC_ENTROPY, &hprop);
			if (rc) {
			if (rc) {
			dprintk(VIDC_ERR, "%s: Failed getting entropy type: %d",
				dprintk(VIDC_ERR,
					"%s: Failed getting entropy type: %d",
					__func__, rc);
					__func__, rc);
				break;
				break;
			}
			}
			switch (hprop.h264_entropy) {
			switch (hprop.h264_entropy) {
			case HAL_H264_ENTROPY_CAVLC:
			case HAL_H264_ENTROPY_CAVLC:
			ctrl->val = V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC;
				ctrl->val =
				 V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC;
				break;
				break;
			case HAL_H264_ENTROPY_CABAC:
			case HAL_H264_ENTROPY_CABAC:
			ctrl->val = V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC;
				ctrl->val =
				 V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC;
				break;
				break;
			case HAL_UNUSED_ENTROPY:
			case HAL_UNUSED_ENTROPY:
				rc = -ENOTSUPP;
				rc = -ENOTSUPP;
				break;
				break;
			}
			}
		}
		break;
		break;
	default:
	default:
		/* Other controls aren't really volatile, shouldn't need to
		/* Other controls aren't really volatile, shouldn't need to