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

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

Merge "msm: mdss: Validate CSC ioctl for black screen in mdp3"

parents 5b18fda6 72ec4dcb
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1376,10 +1376,17 @@ int mdp3_validate_scale_config(struct mdp_bl_scale_data *data)
int mdp3_validate_csc_data(struct mdp_csc_cfg_data *data)
{
	int i;
	bool mv_valid = false;
	for (i = 0; i < 9; i++) {
		if (data->csc_data.csc_mv[i] >=
				MDP_HISTOGRAM_CSC_MATRIX_MAX)
			return -EINVAL;
		if ((!mv_valid) && (data->csc_data.csc_mv[i] != 0))
			mv_valid = true;
	}
	if (!mv_valid) {
		pr_err("%s: black screen data! csc_mv is all 0s\n", __func__);
		return -EINVAL;
	}
	for (i = 0; i < 3; i++) {
		if (data->csc_data.csc_pre_bv[i] >=