From: Nigel Cunningham <ncunningham@users.sourceforge.net>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: PATCH: Fix support for wide consoles in vt.c and include/linux/selection.h
Date: Fri, 09 Jan 2004 17:19:48 +1300 [thread overview]
Message-ID: <1073621988.2003.40.camel@laptop-linux> (raw)
[-- Attachment #1: Type: text/plain, Size: 3990 bytes --]
Hi.
In implementing a 'nice' display for Software Suspend, some users with
wide VTs reported problems with distortion. These changes from signed to
unsigned int/char fixed the issue and have been tested for around a year
(guesstimate).
The only other user of getconsxy is vc_screen.c. It might benefit from
matching changes, although the users who reported the problem to me said
nothing about other issues with their displays, so far as I recall.
To actually use the functions from Suspend, the functions also had to be
made non-static. Of course I could make this into 2 patches if desired.
Regards,
Nigel
diff -ruN linux-2.6.1-rc3/drivers/char/vt.c software-suspend-linux-2.6.1-rc3/drivers/char/vt.c
--- linux-2.6.1-rc3/drivers/char/vt.c 2004-01-09 14:24:45.000000000 +1300
+++ software-suspend-linux-2.6.1-rc3/drivers/char/vt.c 2004-01-09 14:41:54.000000000 +1300
@@ -149,13 +149,13 @@
static void vc_init(unsigned int console, unsigned int rows,
unsigned int cols, int do_clear);
static void blank_screen(unsigned long dummy);
-static void gotoxy(int currcons, int new_x, int new_y);
+void gotoxy(int currcons, unsigned int new_x, unsigned int new_y);
static void save_cur(int currcons);
-static void reset_terminal(int currcons, int do_clear);
+void reset_terminal(int currcons, int do_clear);
static void con_flush_chars(struct tty_struct *tty);
static void set_vesa_blanking(unsigned long arg);
static void set_cursor(int currcons);
-static void hide_cursor(int currcons);
+void hide_cursor(int currcons);
static void unblank_screen_t(unsigned long dummy);
static void console_callback(void *ignored);
@@ -530,7 +530,7 @@
sw->con_putc(vc_cons[currcons].d, i, y, x);
}
-static void hide_cursor(int currcons)
+void hide_cursor(int currcons)
{
if (currcons == sel_cons)
clear_selection();
@@ -859,9 +859,9 @@
* might also be negative. If the given position is out of
* bounds, the cursor is placed at the nearest margin.
*/
-static void gotoxy(int currcons, int new_x, int new_y)
+void gotoxy(int currcons, unsigned int new_x, unsigned int new_y)
{
- int min_y, max_y;
+ unsigned int min_y, max_y;
if (new_x < 0)
x = 0;
@@ -888,7 +888,7 @@
}
/* for absolute user moves, when decom is set */
-static void gotoxay(int currcons, int new_x, int new_y)
+static void gotoxay(int currcons, unsigned int new_x, unsigned int new_y)
{
gotoxy(currcons, new_x, decom ? (top+new_y) : new_y);
}
@@ -1403,7 +1403,7 @@
ESpalette };
/* console_sem is held (except via vc_init()) */
-static void reset_terminal(int currcons, int do_clear)
+void reset_terminal(int currcons, int do_clear)
{
top = 0;
bottom = video_num_lines;
@@ -2996,13 +2996,13 @@
return screenpos(currcons, 2 * w_offset, viewed);
}
-void getconsxy(int currcons, char *p)
+void getconsxy(int currcons, unsigned char *p)
{
p[0] = x;
p[1] = y;
}
-void putconsxy(int currcons, char *p)
+void putconsxy(int currcons, unsigned char *p)
{
gotoxy(currcons, p[0], p[1]);
set_cursor(currcons);
diff -ruN linux-2.6.1-rc3/include/linux/selection.h software-suspend-linux-2.6.1-rc3/include/linux/selection.h
--- linux-2.6.1-rc3/include/linux/selection.h 2004-01-09 14:22:25.000000000 +1300
+++ software-suspend-linux-2.6.1-rc3/include/linux/selection.h 2004-01-09 14:41:54.000000000 +1300
@@ -36,8 +36,8 @@
extern void complement_pos(int currcons, int offset);
extern void invert_screen(int currcons, int offset, int count, int shift);
-extern void getconsxy(int currcons, char *p);
-extern void putconsxy(int currcons, char *p);
+extern void getconsxy(int currcons, unsigned char *p);
+extern void putconsxy(int currcons, unsigned char *p);
extern u16 vcs_scr_readw(int currcons, const u16 *org);
extern void vcs_scr_writew(int currcons, u16 val, u16 *org);
--
My work on Software Suspend is graciously brought to you by
LinuxFund.org.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next reply other threads:[~2004-01-09 4:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-09 4:19 Nigel Cunningham [this message]
2004-01-09 5:29 ` PATCH: Fix support for wide consoles in vt.c and include/linux/selection.h Benjamin Herrenschmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1073621988.2003.40.camel@laptop-linux \
--to=ncunningham@users.sourceforge.net \
--cc=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.