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

Commit eb84e265 authored by Yiming Cao's avatar Yiming Cao Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: Support interlaced clips playback



Add a new event to configure if allow to trigger
port reconfig event for scan type change for
UBWC interlaced video playback

Change-Id: Ie20d6a006a82511b18ea0a6fe8de0cf43d6a0582
Signed-off-by: default avatarYiming Cao <cyiming@codeaurora.org>
parent b1b50653
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -600,6 +600,16 @@ static struct msm_vidc_ctrl msm_vdec_ctrls[] = {
		.default_value = 0,
		.step = OPERATING_FRAME_RATE_STEP,
	},
	{
		.id = V4L2_CID_MPEG_VIDC_VIDEO_ALLOW_UBWC_LINEAR_EVENT,
		.name = "Allow ubwc linear event",
		.type = V4L2_CTRL_TYPE_BOOLEAN,
		.minimum = V4L2_MPEG_VIDC_VIDEO_ALLOW_UBWC_LINEAR_EVENT_DISABLE,
		.maximum = V4L2_MPEG_VIDC_VIDEO_ALLOW_UBWC_LINEAR_EVENT_ENABLE,
		.default_value =
			V4L2_MPEG_VIDC_VIDEO_ALLOW_UBWC_LINEAR_EVENT_DISABLE,
		.step = 1,
	}
};

#define NUM_CTRLS ARRAY_SIZE(msm_vdec_ctrls)
@@ -2081,6 +2091,7 @@ int msm_vdec_inst_init(struct msm_vidc_inst *inst)
	inst->buffer_mode_set[CAPTURE_PORT] = HAL_BUFFER_MODE_STATIC;
	inst->prop.fps = DEFAULT_FPS;
	inst->operating_rate = 0;
	inst->allow_ubwc_linear_event = 0;
	return rc;
}

@@ -2707,6 +2718,22 @@ static int try_set_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
			inst, inst->operating_rate >> 16, ctrl->val >> 16);
		inst->operating_rate = ctrl->val;
		break;
	case V4L2_CID_MPEG_VIDC_VIDEO_ALLOW_UBWC_LINEAR_EVENT:
		switch (ctrl->val) {
		case V4L2_MPEG_VIDC_VIDEO_ALLOW_UBWC_LINEAR_EVENT_ENABLE:
			inst->allow_ubwc_linear_event = 1;
			break;
		case V4L2_MPEG_VIDC_VIDEO_ALLOW_UBWC_LINEAR_EVENT_DISABLE:
			inst->allow_ubwc_linear_event = 0;
			break;
		default:
			dprintk(VIDC_ERR,
				"Invalid allow ubwc linear event control value %d\n",
				ctrl->val);
			rc = -ENOTSUPP;
			break;
		}
		break;
	default:
		break;
	}
+14 −0
Original line number Diff line number Diff line
@@ -1210,6 +1210,20 @@ static void handle_event_change(enum hal_command_response cmd, void *data)
		break;
	}

	/*
	 * Force output to linear format if it's interlaced UBWC format
	 * to support interlaced clips playback
	 */
	if ((inst->allow_ubwc_linear_event) &&
		(event_notify->pic_struct ==
			MSM_VIDC_PIC_STRUCT_MAYBE_INTERLACED)) {
		u32 fmt_fourcc = inst->fmts[CAPTURE_PORT].fourcc;

		if ((fmt_fourcc == V4L2_PIX_FMT_NV12_TP10_UBWC) ||
			(fmt_fourcc == V4L2_PIX_FMT_NV12_UBWC))
			inst->fmts[CAPTURE_PORT].fourcc = V4L2_PIX_FMT_NV12;
	}

	/* Bit depth and pic struct changed event are combined into a single
	 * event (insufficient event) for the userspace. Currently bitdepth
	 * changes is only for HEVC and interlaced support is for all
+1 −0
Original line number Diff line number Diff line
@@ -300,6 +300,7 @@ struct msm_vidc_inst {
	u32 pic_struct;
	u32 colour_space;
	u32 operating_rate;
	bool allow_ubwc_linear_event;
};

extern struct msm_vidc_drv *vidc_driver;
+6 −0
Original line number Diff line number Diff line
@@ -1232,6 +1232,12 @@ enum v4l2_mpeg_vidc_video_venc_send_skipped_frame {
	V4L2_MPEG_VIDC_VIDEO_SEND_SKIPPED_FRAME_ENABLE = 1
};

#define V4L2_CID_MPEG_VIDC_VIDEO_ALLOW_UBWC_LINEAR_EVENT \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 104)
enum v4l2_mpeg_vidc_video_allow_ubwc_linear_event {
	V4L2_MPEG_VIDC_VIDEO_ALLOW_UBWC_LINEAR_EVENT_DISABLE = 0,
	V4L2_MPEG_VIDC_VIDEO_ALLOW_UBWC_LINEAR_EVENT_ENABLE = 1
};

/*  Camera class control IDs */