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

Commit eba5d2fd authored by Karthikeyan Periasamy's avatar Karthikeyan Periasamy
Browse files

msm: vidc: Fix the HDR info setting



Bit shift and mask will retain the sign. Typecasting the variable
before bit shifting gets the right id.

CRs-Fixed: 2384822
Change-Id: I2ce01d85c525bd3e1feb6034b36e7af1867580f5
Signed-off-by: default avatarKarthikeyan Periasamy <kperiasa@codeaurora.org>
parent 6e9f8d30
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -1515,9 +1515,11 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
		inst->clk_data.low_latency_mode = !!ctrl->val;
		break;
	case V4L2_CID_MPEG_VIDC_VENC_HDR_INFO: {
		u32 info_type = (ctrl->val >> 28);
		u32 info_type = ((u32)ctrl->val >> 28) & 0xF;
		u32 val = (ctrl->val & 0xFFFFFFF);

		dprintk(VIDC_DBG, "Ctrl:%d, HDR Info with value %u (%#X)",
				info_type, val, ctrl->val);
		switch (info_type) {
		case MSM_VIDC_RGB_PRIMARY_00:
			mdisp_sei->nDisplayPrimariesX[0] = val;
@@ -1557,8 +1559,8 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
			break;
		default:
			dprintk(VIDC_ERR,
				"Unknown Ctrl:%d, not part of HDR Info",
					info_type);
				"Unknown Ctrl:%d, not part of HDR Info with value %u",
					info_type, val);
			}
		}
		break;