aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/sti/sti_gdp.c
diff options
context:
space:
mode:
authorFabien Dessenne <fabien.dessenne@st.com>2016-09-06 09:42:53 +0200
committerVincent Abriou <vincent.abriou@st.com>2016-09-20 11:32:06 +0200
commitf766c6c810a6894a6049b5ee9406e098ac8cb611 (patch)
tree7722a43e80c26a17545c49ea3557a934ec888e13 /drivers/gpu/drm/sti/sti_gdp.c
parentdrm/sti: in crtc_atomic_flush, enable only planes of this crtc (diff)
downloadlinux-dev-f766c6c810a6894a6049b5ee9406e098ac8cb611.tar.xz
linux-dev-f766c6c810a6894a6049b5ee9406e098ac8cb611.zip
drm/sti: use valid video mode
In atomic mode the crtc_xxx (eg crtc_hdisplay) members of the mode structure may be unset before calling atomic_check/commit for planes. Instead of, use xxx members which are actually set. Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com> Acked-by: Vincent Abriou <vincent.abriou@st.com>
Diffstat (limited to 'drivers/gpu/drm/sti/sti_gdp.c')
-rw-r--r--drivers/gpu/drm/sti/sti_gdp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c
index 5ba470b1517b..81df3097b545 100644
--- a/drivers/gpu/drm/sti/sti_gdp.c
+++ b/drivers/gpu/drm/sti/sti_gdp.c
@@ -628,8 +628,8 @@ static int sti_gdp_atomic_check(struct drm_plane *drm_plane,
mode = &crtc_state->mode;
dst_x = state->crtc_x;
dst_y = state->crtc_y;
- dst_w = clamp_val(state->crtc_w, 0, mode->crtc_hdisplay - dst_x);
- dst_h = clamp_val(state->crtc_h, 0, mode->crtc_vdisplay - dst_y);
+ dst_w = clamp_val(state->crtc_w, 0, mode->hdisplay - dst_x);
+ dst_h = clamp_val(state->crtc_h, 0, mode->vdisplay - dst_y);
/* src_x are in 16.16 format */
src_x = state->src_x >> 16;
src_y = state->src_y >> 16;
@@ -727,8 +727,8 @@ static void sti_gdp_atomic_update(struct drm_plane *drm_plane,
mode = &crtc->mode;
dst_x = state->crtc_x;
dst_y = state->crtc_y;
- dst_w = clamp_val(state->crtc_w, 0, mode->crtc_hdisplay - dst_x);
- dst_h = clamp_val(state->crtc_h, 0, mode->crtc_vdisplay - dst_y);
+ dst_w = clamp_val(state->crtc_w, 0, mode->hdisplay - dst_x);
+ dst_h = clamp_val(state->crtc_h, 0, mode->vdisplay - dst_y);
/* src_x are in 16.16 format */
src_x = state->src_x >> 16;
src_y = state->src_y >> 16;