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

Commit 6801723b authored by Fabien DESSENNE's avatar Fabien DESSENNE Committed by Vincent Abriou
Browse files

drm/sti: do not check hw scaling if mode is not set



Fix a division by 0 case : in some cases, when the HQVDP plane is being
disabled atomic_check() is called with "mode->clock = 0".
In that case, do not check for scaling capabilities.

Signed-off-by: default avatarFabien Dessenne <fabien.dessenne@st.com>
Acked-by: default avatarVincent Abriou <vincent.abriou@st.com>
parent c62052d1
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1037,7 +1037,7 @@ static int sti_hqvdp_atomic_check(struct drm_plane *drm_plane,
	src_w = state->src_w >> 16;
	src_h = state->src_h >> 16;

	if (!sti_hqvdp_check_hw_scaling(hqvdp, mode,
	if (mode->clock && !sti_hqvdp_check_hw_scaling(hqvdp, mode,
						       src_w, src_h,
						       dst_w, dst_h)) {
		DRM_ERROR("Scaling beyond HW capabilities\n");