summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/sti/sti_vid.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_vid.c
parent3bc6b01de30538f836632a1a701c0061e711b38c (diff)
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_vid.c')
-rw-r--r--drivers/gpu/drm/sti/sti_vid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/sti/sti_vid.c b/drivers/gpu/drm/sti/sti_vid.c
index 47634a0251fc..2ad59892b57e 100644
--- a/drivers/gpu/drm/sti/sti_vid.c
+++ b/drivers/gpu/drm/sti/sti_vid.c
@@ -142,8 +142,8 @@ void sti_vid_commit(struct sti_vid *vid,
struct drm_display_mode *mode = &crtc->mode;
int dst_x = state->crtc_x;
int dst_y = state->crtc_y;
- int dst_w = clamp_val(state->crtc_w, 0, mode->crtc_hdisplay - dst_x);
- int dst_h = clamp_val(state->crtc_h, 0, mode->crtc_vdisplay - dst_y);
+ int dst_w = clamp_val(state->crtc_w, 0, mode->hdisplay - dst_x);
+ int dst_h = clamp_val(state->crtc_h, 0, mode->vdisplay - dst_y);
int src_h = state->src_h >> 16;
u32 val, ydo, xdo, yds, xds;