aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/console
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2005-10-16 20:29:22 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-17 08:59:10 -0700
commit0aec4867dca149e2049e8439b76bd82ad9dac52c (patch)
treed55aacfbc10525d46f5b78c872039decf01e86e1 /drivers/video/console
parentb24d18aa743dad0c42918157c5d717686269d3a8 (diff)
downloadkernel_samsung_smdk4412-0aec4867dca149e2049e8439b76bd82ad9dac52c.zip
kernel_samsung_smdk4412-0aec4867dca149e2049e8439b76bd82ad9dac52c.tar.gz
kernel_samsung_smdk4412-0aec4867dca149e2049e8439b76bd82ad9dac52c.tar.bz2
[PATCH] SVGATextMode fix
Fix bug 5441. I didn't know about messy programs like svgatextmode... Couldn't this be integrated in some linux/drivers/video/console/svgacon.c ?... So because of the existence of the svgatextmode program, the kernel is not supposed to touch to CRT_OVERFLOW/SYNC_END/DISP/DISP_END/OFFSET ? Disabling the check in vgacon_resize() might help indeed, but I'm really not sure whether it will work for any chipset: in my patch, CRT registers are set at each console switch, since stty rows/cols apply to consoles separately... The attached solution is to keep the test, but if it fails, we assume that the caller knows what it does (i.e. it is svgatextmode) and then disable any further call to vgacon_doresize. Svgatextmode is usually used to _expand_ the display, not to shrink it. And it is harmless in the case of a too big stty rows/cols: the display will just be cropped. I tested it on my laptop, and it works fine with svgatextmode. A better solution would be that svgatextmode explicitely tells the kernel not to care about video timing, but for this an interface needs be defined and svgatextmode be patched. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video/console')
-rw-r--r--drivers/video/console/vgacon.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index 6ef6f77..809fee2 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -565,7 +565,11 @@ static int vgacon_switch(struct vc_data *c)
scr_memcpyw((u16 *) c->vc_origin, (u16 *) c->vc_screenbuf,
c->vc_screenbuf_size > vga_vram_size ?
vga_vram_size : c->vc_screenbuf_size);
- vgacon_doresize(c, c->vc_cols, c->vc_rows);
+ if (!(vga_video_num_columns % 2) &&
+ vga_video_num_columns <= ORIG_VIDEO_COLS &&
+ vga_video_num_lines <= (ORIG_VIDEO_LINES *
+ vga_default_font_height) / c->vc_font.height)
+ vgacon_doresize(c, c->vc_cols, c->vc_rows);
}
return 0; /* Redrawing not needed */
@@ -1023,7 +1027,8 @@ static int vgacon_resize(struct vc_data *c, unsigned int width,
if (width % 2 || width > ORIG_VIDEO_COLS ||
height > (ORIG_VIDEO_LINES * vga_default_font_height)/
c->vc_font.height)
- return -EINVAL;
+ /* let svgatextmode tinker with video timings */
+ return 0;
if (CON_IS_VISIBLE(c) && !vga_is_gfx) /* who knows */
vgacon_doresize(c, width, height);