summaryrefslogtreecommitdiffstats
path: root/drivers/char/vc_screen.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-06-03 09:23:20 +0000
committerRalf Baechle <ralf@linux-mips.org>1997-06-03 09:23:20 +0000
commitac5ff8f4a72f7b4e66f73c3c6cb9fe7758cf6f12 (patch)
tree9fc7f8ce32e0d9a4aa055b2a58a05a5d727b333c /drivers/char/vc_screen.c
parent52662ff3e66770fd7e4fc508c91056d29c08bff0 (diff)
Sync with Linux 2.1.42.
Diffstat (limited to 'drivers/char/vc_screen.c')
-rw-r--r--drivers/char/vc_screen.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/char/vc_screen.c b/drivers/char/vc_screen.c
index 71f4e2f84..cb91431dc 100644
--- a/drivers/char/vc_screen.c
+++ b/drivers/char/vc_screen.c
@@ -61,7 +61,19 @@ vcs_size(struct inode *inode)
/* Multimon patch */
if (!vc_cons[currcons].d) return 0;
#endif
- size= video_num_lines * video_num_columns;
+#ifdef CONFIG_FB_CONSOLE
+ int cons = MINOR(inode->i_rdev) & 127;
+
+ if (cons == 0)
+ cons = fg_console;
+ else
+ cons--;
+ if (!vc_cons_allocated(cons))
+ return -ENXIO;
+#endif
+
+ size = get_video_num_lines(cons) * get_video_num_columns(cons);
+
if (MINOR(inode->i_rdev) & 128)
size = 2*size + HEADER_SIZE;
return size;
@@ -128,8 +140,8 @@ vcs_read(struct inode *inode, struct file *file, char *buf, unsigned long count)
} else {
if (p < HEADER_SIZE) {
char header[HEADER_SIZE];
- header[0] = (char) video_num_lines;
- header[1] = (char) video_num_columns;
+ header[0] = (char) get_video_num_lines(currcons);
+ header[1] = (char) get_video_num_columns(currcons);
getconsxy(currcons, header+2);
while (p < HEADER_SIZE && count > 0)
{ count--; put_user(header[p++], buf++); }