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

Commit 449c082b authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: support ROI map type query"

parents e3ee3c49 c74488f9
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -157,6 +157,12 @@ static const char *const mpeg_video_stream_format[] = {
	NULL
};

static const char *const roi_map_type[] = {
	"None",
	"2-bit",
	"2-byte"
};

static struct msm_vidc_ctrl msm_venc_ctrls[] = {
	{
		.id = V4L2_CID_MPEG_VIDC_VIDEO_IDR_PERIOD,
@@ -1163,6 +1169,20 @@ static struct msm_vidc_ctrl msm_venc_ctrls[] = {
		.default_value = V4L2_MPEG_MSM_VIDC_ENABLE,
		.step = 1,
	},
	{
		.id = V4L2_CID_MPEG_VIDC_VIDEO_ROI_TYPE,
		.name = "ROI Type",
		.type = V4L2_CTRL_TYPE_MENU,
		.minimum = V4L2_CID_MPEG_VIDC_VIDEO_ROI_TYPE_NONE,
		.maximum = V4L2_CID_MPEG_VIDC_VIDEO_ROI_TYPE_2BYTE,
		.default_value = V4L2_CID_MPEG_VIDC_VIDEO_ROI_TYPE_NONE,
		.menu_skip_mask = ~(
		(1 << V4L2_CID_MPEG_VIDC_VIDEO_ROI_TYPE_NONE) |
		(1 << V4L2_CID_MPEG_VIDC_VIDEO_ROI_TYPE_2BIT) |
		(1 << V4L2_CID_MPEG_VIDC_VIDEO_ROI_TYPE_2BYTE)
		),
		.qmenu = roi_map_type,
	},
};

#define NUM_CTRLS ARRAY_SIZE(msm_venc_ctrls)
+9 −0
Original line number Diff line number Diff line
@@ -1751,6 +1751,15 @@ static int try_get_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
		ctrl->val =
		inst->capability.nal_stream_format.nal_stream_format_supported;
		break;
	case V4L2_CID_MPEG_VIDC_VIDEO_ROI_TYPE:
		if (!inst->core || !inst->core->platform_data)
			return -EINVAL;

		ctrl->val = (inst->core->platform_data->vpu_ver ==
				VPU_VERSION_4) ?
			V4L2_CID_MPEG_VIDC_VIDEO_ROI_TYPE_2BIT :
			V4L2_CID_MPEG_VIDC_VIDEO_ROI_TYPE_2BYTE;
		break;
	default:
		/*
		 * Other controls aren't really volatile, shouldn't need to
+8 −0
Original line number Diff line number Diff line
@@ -1055,6 +1055,14 @@ enum v4l2_mpeg_vidc_video_flip {
	(V4L2_CID_MPEG_MSM_VIDC_BASE + 130)
#define V4L2_CID_MPEG_VIDC_VENC_BITRATE_SAVINGS \
	(V4L2_CID_MPEG_MSM_VIDC_BASE + 131)
#define V4L2_CID_MPEG_VIDC_VIDEO_ROI_TYPE \
	(V4L2_CID_MPEG_MSM_VIDC_BASE + 132)
enum v4l2_mpeg_vidc_video_roi_type {
	V4L2_CID_MPEG_VIDC_VIDEO_ROI_TYPE_NONE = 0,
	V4L2_CID_MPEG_VIDC_VIDEO_ROI_TYPE_2BIT = 1,
	V4L2_CID_MPEG_VIDC_VIDEO_ROI_TYPE_2BYTE = 2,
};


/*  Camera class control IDs */