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

Commit 3a396301 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: Update QP control values"

parents c3689583 31035d02
Loading
Loading
Loading
Loading
+62 −13
Original line number Diff line number Diff line
@@ -3509,6 +3509,48 @@ static int try_set_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
		frameqp = ctrl->val;
		pdata = &frameqp;
		break;
	case V4L2_CID_MPEG_VIDC_VIDEO_INITIAL_I_FRAME_QP:
	{
		rc = msm_venc_validate_qp_value(inst, ctrl);
		if (rc) {
			dprintk(VIDC_ERR, "Invalid Initial I QP\n");
			break;
		}
		/*
		 * Defer sending property from here, set_ext_ctrl
		 * will send it based on the rc value.
		 */
		property_id = 0;
		break;
	}
	case V4L2_CID_MPEG_VIDC_VIDEO_INITIAL_B_FRAME_QP:
	{
		rc = msm_venc_validate_qp_value(inst, ctrl);
		if (rc) {
			dprintk(VIDC_ERR, "Invalid Initial B QP\n");
			break;
		}
		/*
		 * Defer sending property from here, set_ext_ctrl
		 * will send it based on the rc value.
		 */
		property_id = 0;
		break;
	}
	case V4L2_CID_MPEG_VIDC_VIDEO_INITIAL_P_FRAME_QP:
	{
		rc = msm_venc_validate_qp_value(inst, ctrl);
		if (rc) {
			dprintk(VIDC_ERR, "Invalid Initial P QP\n");
			break;
		}
		/*
		 * Defer sending property from here, set_ext_ctrl
		 * will send it based on the rc value.
		 */
		property_id = 0;
		break;
	}
	case V4L2_CID_MPEG_VIDC_VIDEO_VQZIP_SEI:
		property_id = HAL_PARAM_VENC_VQZIP_SEI;
		enable.enable = ctrl->val;
@@ -3674,7 +3716,7 @@ static int try_set_ext_ctrl(struct msm_vidc_inst *inst,
	struct hal_aspect_ratio sar;
	struct hal_bitrate bitrate;
	struct hal_frame_size blur_res;
	struct v4l2_ctrl *temp_ctrl;
	struct v4l2_control temp_ctrl;

	if (!inst || !inst->core || !inst->core->device || !ctrl) {
		dprintk(VIDC_ERR, "%s invalid parameters\n", __func__);
@@ -3741,12 +3783,15 @@ static int try_set_ext_ctrl(struct msm_vidc_inst *inst,
			/* Sanity check for the QP boundaries as we are using
			 * same control to set Initial QP for all the codecs
			 */
			temp_ctrl->id =
			temp_ctrl.id =
				V4L2_CID_MPEG_VIDC_VIDEO_INITIAL_I_FRAME_QP;
			temp_ctrl->val = control[i].value;
			rc = msm_venc_validate_qp_value(inst, temp_ctrl);
			temp_ctrl.value = control[i].value;

			rc = msm_comm_s_ctrl(inst, &temp_ctrl);
			if (rc) {
				dprintk(VIDC_ERR, "Invalid Initial I QP\n");
				dprintk(VIDC_ERR,
					"%s Failed setting Initial I Frame QP : %d\n",
					__func__, rc);
				break;
			}
			quant.qpi = control[i].value;
@@ -3754,12 +3799,14 @@ static int try_set_ext_ctrl(struct msm_vidc_inst *inst,
			pdata = &quant;
			break;
		case V4L2_CID_MPEG_VIDC_VIDEO_INITIAL_P_FRAME_QP:
			temp_ctrl->id =
			temp_ctrl.id =
				V4L2_CID_MPEG_VIDC_VIDEO_INITIAL_P_FRAME_QP;
			temp_ctrl->val = control[i].value;
			rc = msm_venc_validate_qp_value(inst, temp_ctrl);
			temp_ctrl.value = control[i].value;
			rc = msm_comm_s_ctrl(inst, &temp_ctrl);
			if (rc) {
				dprintk(VIDC_ERR, "Invalid Initial P QP\n");
				dprintk(VIDC_ERR,
					"%s Failed setting Initial P Frame QP : %d\n",
					__func__, rc);
				break;
			}
			quant.qpp = control[i].value;
@@ -3767,12 +3814,14 @@ static int try_set_ext_ctrl(struct msm_vidc_inst *inst,
			pdata = &quant;
			break;
		case V4L2_CID_MPEG_VIDC_VIDEO_INITIAL_B_FRAME_QP:
			temp_ctrl->id =
			temp_ctrl.id =
				V4L2_CID_MPEG_VIDC_VIDEO_INITIAL_B_FRAME_QP;
			temp_ctrl->val = control[i].value;
			rc = msm_venc_validate_qp_value(inst, temp_ctrl);
			temp_ctrl.value = control[i].value;
			rc = msm_comm_s_ctrl(inst, &temp_ctrl);
			if (rc) {
				dprintk(VIDC_ERR, "Invalid Initial B QP\n");
				dprintk(VIDC_ERR,
					"%s Failed setting Initial B Frame QP : %d\n",
					__func__, rc);
				break;
			}
			quant.qpb = control[i].value;
+3 −3
Original line number Diff line number Diff line
@@ -1210,11 +1210,11 @@ enum v4l2_mpeg_vidc_video_venc_iframesize_type {
};

#define V4L2_CID_MPEG_VIDC_VIDEO_I_FRAME_QP \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 99)
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 101)
#define V4L2_CID_MPEG_VIDC_VIDEO_P_FRAME_QP \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 100)
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 102)
#define V4L2_CID_MPEG_VIDC_VIDEO_B_FRAME_QP \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 101)
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 103)


/*  Camera class control IDs */