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

Commit 0f8d2ff1 authored by Amit Shekhar's avatar Amit Shekhar
Browse files

msm: vidc: Add RC timestamp disable control



Add and fix rate control timestamp disable control. WFD usecase
requires time delta calculation from input frame rate. Rest of
usecases calculate time delta based on buffer timestamp. Hence,
RC timestamp disable control is disabled by default.

Change-Id: I5652cdf96e0527968f6e0dabbc35df6a00817aa9
Signed-off-by: default avatarAmit Shekhar <ashekhar@codeaurora.org>
parent 00474817
Loading
Loading
Loading
Loading
+15 −4
Original line number Diff line number Diff line
@@ -880,6 +880,15 @@ static struct msm_vidc_ctrl msm_venc_ctrls[] = {
		.default_value = 0,
		.step = 1,
	},
	{
		.id = V4L2_CID_MPEG_VIDC_VENC_RC_TIMESTAMP_DISABLE,
		.name = "RC Timestamp disable",
		.type = V4L2_CTRL_TYPE_BOOLEAN,
		.minimum = V4L2_MPEG_MSM_VIDC_DISABLE,
		.maximum = V4L2_MPEG_MSM_VIDC_ENABLE,
		.default_value = V4L2_MPEG_MSM_VIDC_DISABLE,
		.step = 1,
	},
	{
		.id = V4L2_CID_MPEG_VIDC_VIDEO_VPE_CSC_CUSTOM_MATRIX,
		.name = "Enable/Disable CSC Custom Matrix",
@@ -1746,6 +1755,7 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
	case V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB:
	case V4L2_CID_MPEG_VIDC_VENC_CVP_DISABLE:
	case V4L2_CID_MPEG_VIDC_VENC_NATIVE_RECORDER:
	case V4L2_CID_MPEG_VIDC_VENC_RC_TIMESTAMP_DISABLE:
		dprintk(VIDC_DBG, "Control set: ID : %x Val : %d\n",
			ctrl->id, ctrl->val);
		break;
@@ -2363,11 +2373,12 @@ int msm_venc_set_input_timestamp_rc(struct msm_vidc_inst *inst)
	}
	hdev = inst->core->device;

	ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE);
	ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_VENC_RC_TIMESTAMP_DISABLE);
	/*
	 * 0 - rate control considers buffer timestamps
	 * 1 - rate control igonres buffer timestamp and
	 *     calculates timedelta based on frame rate
	 * HFI values:
	 * 0 - time delta is calculated based on buffer timestamp
	 * 1 - ignores buffer timestamp and fw derives time delta based
	 *     on input frame rate.
	 */
	enable.enable = !!ctrl->val;

+3 −0
Original line number Diff line number Diff line
@@ -979,6 +979,9 @@ enum v4l2_mpeg_vidc_video_hevc_max_hier_coding_layer {
#define V4L2_CID_MPEG_VIDC_VENC_NATIVE_RECORDER \
	(V4L2_CID_MPEG_MSM_VIDC_BASE + 122)

#define V4L2_CID_MPEG_VIDC_VENC_RC_TIMESTAMP_DISABLE \
	(V4L2_CID_MPEG_MSM_VIDC_BASE + 123)

/*  Camera class control IDs */

#define V4L2_CID_CAMERA_CLASS_BASE	(V4L2_CTRL_CLASS_CAMERA | 0x900)