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

Commit d9267919 authored by Deva Ramasubramanian's avatar Deva Ramasubramanian
Browse files

msm: vidc: Don't query the V4L2 ctrl framework for checking thumbnail mode



The V4L2 control framework is not re-entrant.  As a result if we attempt
to call g_ctrl() within the context of s_ctrl(), we end up deadlocking.
To prevent calling g_ctrl() store the state of thumbnail mode as a
instance flag.

Change-Id: I84dd024f4c23729f211646450a0dcf91eb6efa3e
Signed-off-by: default avatarDeva Ramasubramanian <dramasub@codeaurora.org>
parent d3b0eac5
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -1981,8 +1981,16 @@ static int try_set_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
		pdata = &hal_property;
		break;
	case V4L2_CID_MPEG_VIDC_VIDEO_SYNC_FRAME_DECODE:
		property_id =
			HAL_PARAM_VDEC_SYNC_FRAME_DECODE;
		switch (ctrl->val) {
		case V4L2_MPEG_VIDC_VIDEO_SYNC_FRAME_DECODE_DISABLE:
			inst->flags &= ~VIDC_THUMBNAIL;
			break;
		case V4L2_MPEG_VIDC_VIDEO_SYNC_FRAME_DECODE_ENABLE:
			inst->flags |= VIDC_THUMBNAIL;
			break;
		}

		property_id = HAL_PARAM_VDEC_SYNC_FRAME_DECODE;
		hal_property.enable = ctrl->val;
		pdata = &hal_property;
		break;
+1 −10
Original line number Diff line number Diff line
@@ -70,16 +70,7 @@ static inline bool is_turbo_session(struct msm_vidc_inst *inst)

static inline bool is_thumbnail_session(struct msm_vidc_inst *inst)
{
	if (inst->session_type == MSM_VIDC_DECODER) {
		int rc = 0;
		struct v4l2_control ctrl = {
			.id = V4L2_CID_MPEG_VIDC_VIDEO_SYNC_FRAME_DECODE
		};
		rc = v4l2_g_ctrl(&inst->ctrl_handler, &ctrl);
		if (!rc && ctrl.value)
			return true;
	}
	return false;
	return !!(inst->flags & VIDC_THUMBNAIL);
}

enum multi_stream msm_comm_get_stream_output_mode(struct msm_vidc_inst *inst)
+1 −0
Original line number Diff line number Diff line
@@ -231,6 +231,7 @@ struct msm_vidc_debug {
enum msm_vidc_modes {
	VIDC_SECURE = 1 << 0,
	VIDC_TURBO = 1 << 1,
	VIDC_THUMBNAIL = 1 << 2,
};

struct msm_vidc_core_capability {