summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2015-06-15 16:16:15 -0400
committerSasha Levin <sasha.levin@oracle.com>2015-07-01 22:07:25 -0400
commitc73e05a513216291a0d0183110dfee347e6188ff (patch)
treefb88114dd8da22e14ca78a3ce845e476489676e3 /drivers/gpu
parentfc9a24b42d2da53dfc4c08d7de126bef53204fa8 (diff)
downloadlwn-c73e05a513216291a0d0183110dfee347e6188ff.tar.gz
lwn-c73e05a513216291a0d0183110dfee347e6188ff.zip
drm/mgag200: Reject non-character-cell-aligned mode widths
[ Upstream commit 25161084b1c1b0c29948f6f77266a35f302196b7 ] Turns out 1366x768 does not in fact work on this hardware. Signed-off-by: Adam Jackson <ajax@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_mode.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index 83485ab81ce8..d8e693d1f6d4 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -1525,6 +1525,11 @@ static int mga_vga_mode_valid(struct drm_connector *connector,
return MODE_BANDWIDTH;
}
+ if ((mode->hdisplay % 8) != 0 || (mode->hsync_start % 8) != 0 ||
+ (mode->hsync_end % 8) != 0 || (mode->htotal % 8) != 0) {
+ return MODE_H_ILLEGAL;
+ }
+
if (mode->crtc_hdisplay > 2048 || mode->crtc_hsync_start > 4096 ||
mode->crtc_hsync_end > 4096 || mode->crtc_htotal > 4096 ||
mode->crtc_vdisplay > 2048 || mode->crtc_vsync_start > 4096 ||