diff options
author | Adam Jackson <ajax@redhat.com> | 2015-06-15 16:16:15 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-06-29 12:08:34 -0700 |
commit | 97d905e8568ff57c36c3e89b23b1c0f9f5146f96 (patch) | |
tree | d51f70e0a7b885a1ee57a70869c06a891370831f | |
parent | 63dec3118397e4a94b92d2c395b4310ecb449581 (diff) | |
download | lwn-97d905e8568ff57c36c3e89b23b1c0f9f5146f96.tar.gz lwn-97d905e8568ff57c36c3e89b23b1c0f9f5146f96.zip |
drm/mgag200: Reject non-character-cell-aligned mode widths
commit 25161084b1c1b0c29948f6f77266a35f302196b7 upstream.
Turns out 1366x768 does not in fact work on this hardware.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/gpu/drm/mgag200/mgag200_mode.c | 5 |
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 f6341e8622ee..7bd2acce9f81 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c @@ -1487,6 +1487,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 || |