disp: msm: sde: fix error return in plane atomic_check
In plane atomic_check function, the error code from one of the checks is overwritten by the return-value of subsequent check. This leads to wrong return-value propagation resulting in undefined behavior. Fix it to return the appropriate error code on any failure. Change-Id: I53b427d1b69c3ebfaa6709814bd9095676ff942d Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
This commit is contained in:
@@ -2536,8 +2536,7 @@ static int sde_plane_sspp_atomic_check(struct drm_plane *plane,
|
|||||||
|
|
||||||
if (!psde->pipe_sblk) {
|
if (!psde->pipe_sblk) {
|
||||||
SDE_ERROR_PLANE(psde, "invalid catalog\n");
|
SDE_ERROR_PLANE(psde, "invalid catalog\n");
|
||||||
ret = -EINVAL;
|
return -EINVAL;
|
||||||
goto exit;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* src values are in Q16 fixed point, convert to integer */
|
/* src values are in Q16 fixed point, convert to integer */
|
||||||
@@ -2605,6 +2604,9 @@ static int sde_plane_sspp_atomic_check(struct drm_plane *plane,
|
|||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
ret = _sde_atomic_check_decimation_scaler(state, psde, fmt, pstate,
|
ret = _sde_atomic_check_decimation_scaler(state, psde, fmt, pstate,
|
||||||
&src, &dst, width, height);
|
&src, &dst, width, height);
|
||||||
|
|
||||||
@@ -2626,7 +2628,6 @@ modeset_update:
|
|||||||
if (!ret)
|
if (!ret)
|
||||||
_sde_plane_sspp_atomic_check_mode_changed(psde,
|
_sde_plane_sspp_atomic_check_mode_changed(psde,
|
||||||
state, plane->state);
|
state, plane->state);
|
||||||
exit:
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user