* Multiple monitors
@ 2001-09-03 18:44 Simon Hay
2001-09-03 19:48 ` Jakob Østergaard
` (4 more replies)
0 siblings, 5 replies; 15+ messages in thread
From: Simon Hay @ 2001-09-03 18:44 UTC (permalink / raw)
To: linux-kernel
Hi all,
Apologies in advance if this is a question that's already been answered
somewhere... I'm looking for a way to install multiple (or rather, two)
PCI/AGP cards in a machine and connect a monitor to each one, and use
them both *in console mode* - preferably with some nice way to say
'assign virtual console 2 to the first screen, and 5 to the second' -
that way you could have one tailing log files, showing 'top', whatever.
A quick search of the web/newsgroups turned up various patches that
looked ideal, but a closer inspection revealed that they either relied
on you having a Hercules mono card, or only applied against kernel
<0.99, or both... I was just wondering if anyone's thought
about/written a similar patch for more recent hardware/versions? I was
using a console Linux machine running BB (ASCII art demo -
http://aa-project.sourceforge.net/) just to attract attention to our
stand today and was thinking it would be really neat to have one machine
driving several screens...
Simon
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Multiple monitors
2001-09-03 18:44 Multiple monitors Simon Hay
@ 2001-09-03 19:48 ` Jakob Østergaard
2001-09-03 20:11 ` Simon Hay
2001-09-03 20:57 ` Matan Ziv-Av
` (3 subsequent siblings)
4 siblings, 1 reply; 15+ messages in thread
From: Jakob Østergaard @ 2001-09-03 19:48 UTC (permalink / raw)
To: Simon Hay; +Cc: linux-kernel
On Mon, Sep 03, 2001 at 07:44:33PM +0100, Simon Hay wrote:
> Hi all,
>
> Apologies in advance if this is a question that's already been answered
> somewhere... I'm looking for a way to install multiple (or rather, two)
> PCI/AGP cards in a machine and connect a monitor to each one, and use
> them both *in console mode* - preferably with some nice way to say
> 'assign virtual console 2 to the first screen, and 5 to the second' -
> that way you could have one tailing log files, showing 'top', whatever.
> A quick search of the web/newsgroups turned up various patches that
> looked ideal, but a closer inspection revealed that they either relied
> on you having a Hercules mono card, or only applied against kernel
> <0.99, or both... I was just wondering if anyone's thought
> about/written a similar patch for more recent hardware/versions? I was
> using a console Linux machine running BB (ASCII art demo -
> http://aa-project.sourceforge.net/) just to attract attention to our
> stand today and was thinking it would be really neat to have one machine
> driving several screens...
XFree86 has pretty good support for multiple heads.
If you tie an xterm to the root window, I guess you would get something
pretty close to what you're looking for. Or, configure some window manager
properly to do exactly what you want.
--
................................................................
: jakob@unthought.net : And I see the elder races, :
:.........................: putrid forms of man :
: Jakob Østergaard : See him rise and claim the earth, :
: OZ9ABN : his downfall is at hand. :
:.........................:............{Konkhra}...............:
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Multiple monitors
2001-09-03 19:48 ` Jakob Østergaard
@ 2001-09-03 20:11 ` Simon Hay
2001-09-03 20:49 ` Wakko Warner
2001-09-07 0:55 ` Jamie Lokier
0 siblings, 2 replies; 15+ messages in thread
From: Simon Hay @ 2001-09-03 20:11 UTC (permalink / raw)
To: linux-kernel
On Mon, 3 Sep 2001, Jakob Østergaard wrote:
> XFree86 has pretty good support for multiple heads.
>
> If you tie an xterm to the root window, I guess you would get something
> pretty close to what you're looking for. Or, configure some window manager
> properly to do exactly what you want.
>
I had considered doing that - I believe that some of the framebuffer
code supports multiple heads as well(?) - but in this particular case it
wasn't appropriate - the whole point was to demonstrate what could be
achieved using only a command line ;-) Also, though, on dedicated servers
etc. I'd rather not be running X if I didn't have to. Would this be a
particularly difficult thing to implement as a kernel patch? I'd like to
try to get involved in kernel development at some point and am looking for
something to ease myself in slowly - preferably something useful but
unimportant ;-) Are there any show stoppers involved here - or does
anyone have any other ideas?
Thanks in advance,
Simon
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Multiple monitors
2001-09-03 20:49 ` Wakko Warner
@ 2001-09-03 20:42 ` Simon Hay
2001-09-03 20:52 ` Jan Kasprzak
2001-09-04 16:52 ` James Simmons
2 siblings, 0 replies; 15+ messages in thread
From: Simon Hay @ 2001-09-03 20:42 UTC (permalink / raw)
To: linux-kernel
On Mon, 3 Sep 2001, Wakko Warner wrote:
> I thought of doing something like this but using a matrox g400 or g450 dual
> head card. primary would be for X, secondary would be a console. Not sure
> if that's more difficult or not. Something I'd like to have, however.
>
I don't know how the Matrox cards work so I couldn't comment, although
presumably having code to support multiple monitors on multiple cards
would at least make it _easier_ to support dual head video adaptors.
Also, presumably if you could assign virtual consoles to either monitor
and they both behaved like the standard primary console there'd be no
particular reason why X shouldn't run on one or both as normal...
Simon
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Multiple monitors
2001-09-03 20:11 ` Simon Hay
@ 2001-09-03 20:49 ` Wakko Warner
2001-09-03 20:42 ` Simon Hay
` (2 more replies)
2001-09-07 0:55 ` Jamie Lokier
1 sibling, 3 replies; 15+ messages in thread
From: Wakko Warner @ 2001-09-03 20:49 UTC (permalink / raw)
To: Simon Hay; +Cc: linux-kernel
> > XFree86 has pretty good support for multiple heads.
> >
> > If you tie an xterm to the root window, I guess you would get something
> > pretty close to what you're looking for. Or, configure some window manager
> > properly to do exactly what you want.
> >
>
> I had considered doing that - I believe that some of the framebuffer
> code supports multiple heads as well(?) - but in this particular case it
> wasn't appropriate - the whole point was to demonstrate what could be
> achieved using only a command line ;-) Also, though, on dedicated servers
> etc. I'd rather not be running X if I didn't have to. Would this be a
> particularly difficult thing to implement as a kernel patch? I'd like to
> try to get involved in kernel development at some point and am looking for
> something to ease myself in slowly - preferably something useful but
> unimportant ;-) Are there any show stoppers involved here - or does
> anyone have any other ideas?
I thought of doing something like this but using a matrox g400 or g450 dual
head card. primary would be for X, secondary would be a console. Not sure
if that's more difficult or not. Something I'd like to have, however.
--
Lab tests show that use of micro$oft causes cancer in lab animals
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Multiple monitors
2001-09-03 20:49 ` Wakko Warner
2001-09-03 20:42 ` Simon Hay
@ 2001-09-03 20:52 ` Jan Kasprzak
2001-09-04 16:52 ` James Simmons
2 siblings, 0 replies; 15+ messages in thread
From: Jan Kasprzak @ 2001-09-03 20:52 UTC (permalink / raw)
To: Wakko Warner; +Cc: Simon Hay, linux-kernel
Wakko Warner wrote:
: I thought of doing something like this but using a matrox g400 or g450 dual
: head card. primary would be for X, secondary would be a console. Not sure
: if that's more difficult or not. Something I'd like to have, however.
:
FWIW, I was able to run my computer in dual-head setup with two
keyboards and two mice (the second kbd and mouse on USB). I have Matrox
G450 as one head, and S3 ViRGE/VX as the second one. I dont use it as a text
console, though. I use it through a gdm login in X. I've followed the
steps at http://139.82.28.40/multiuser/index.html with some minor tweaks.
-Yenya
--
\ Jan "Yenya" Kasprzak <kas at fi.muni.cz> http://www.fi.muni.cz/~kas/
\\ PGP: finger kas at aisa.fi.muni.cz 0D99A7FB206605D7 8B35FCDE05B18A5E //
\\\ Czech Linux Homepage: http://www.linux.cz/ ///
And quite frankly, if your disk can push 50MB/s through a 1kB non-contiguous
filesystem, then my name is Bugs Bunny. --Linus Torvalds
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Multiple monitors
2001-09-03 18:44 Multiple monitors Simon Hay
2001-09-03 19:48 ` Jakob Østergaard
@ 2001-09-03 20:57 ` Matan Ziv-Av
2001-09-04 7:56 ` Ghozlane Toumi
` (2 subsequent siblings)
4 siblings, 0 replies; 15+ messages in thread
From: Matan Ziv-Av @ 2001-09-03 20:57 UTC (permalink / raw)
To: Simon Hay; +Cc: linux-kernel
On Mon, 3 Sep 2001, Simon Hay wrote:
> Hi all,
>
> Apologies in advance if this is a question that's already been answered
> somewhere...I'm looking for a way to install multiple (or rather, two)
> PCI/AGP cards in a machine and connect a monitor to each one, and use
> them both *in console mode* - preferably with some nice way to say
> 'assign virtual console 2 to the first screen, and 5 to the second' -
> that way you could have one tailing log files, showing 'top', whatever.
> A quick search of the web/newsgroups turned up various patches that
> looked ideal, but a closer inspection revealed that they either relied
> on you having a Hercules mono card, or only applied against kernel
> <0.99, or both...I was just wondering if anyone's thought
> about/written a similar patch for more recent hardware/versions?I was
> using a console Linux machine running BB (ASCII art demo -
> http://aa-project.sourceforge.net/) just to attract attention to our
> stand today and was thinking it would be really neat to have one machine
> driving several screens...
If you want only textmode, look at nvvgacon
http://www.arava.co.il/matan/misc/
this module enables text console on secondary nvidia cards. I think it
only works on riva128 now, but it should be easy to add support for tnt
and later. If you also want to use a second keyboard, There is also
ps2key, usb2key, to emulate a second console (from user space) with a
keyboard connected to usb or to ps/2 mouse port.
--
Matan Ziv-Av. matan@svgalib.org
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Multiple monitors
2001-09-03 18:44 Multiple monitors Simon Hay
2001-09-03 19:48 ` Jakob Østergaard
2001-09-03 20:57 ` Matan Ziv-Av
@ 2001-09-04 7:56 ` Ghozlane Toumi
2001-09-04 16:44 ` James Simmons
2001-09-05 18:01 ` sacx
4 siblings, 0 replies; 15+ messages in thread
From: Ghozlane Toumi @ 2001-09-04 7:56 UTC (permalink / raw)
To: Simon Hay, linux-kernel
"Simon Hay" Said:
> Apologies in advance if this is a question that's already been answered
> somewhere... I'm looking for a way to install multiple (or rather, two)
> PCI/AGP cards in a machine and connect a monitor to each one, and use
> them both *in console mode* -
this already exist in the current kernels, as long as you use video boards
that can be initialised independently
from the bios .
the 1st head can be whatever you want, but the next heads have to be
carefully chosen (matrox boards comes to mind)
then disable software scrollback as there are issues with multihead .
(append="video:scrollback:0")
> preferably with some nice way to say
> 'assign virtual console 2 to the first screen, and 5 to the second' -
> that way you could have one tailing log files, showing 'top', whatever.
this is "con2fb":
to assign 2nd Virtual console to 2nd head :
con2fb /dev/fb1 /dev/tty2
ghoz
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Multiple monitors
2001-09-03 18:44 Multiple monitors Simon Hay
` (2 preceding siblings ...)
2001-09-04 7:56 ` Ghozlane Toumi
@ 2001-09-04 16:44 ` James Simmons
2001-09-05 18:01 ` sacx
4 siblings, 0 replies; 15+ messages in thread
From: James Simmons @ 2001-09-04 16:44 UTC (permalink / raw)
To: Simon Hay; +Cc: linux-kernel
> Apologies in advance if this is a question that's already been answered
> somewhere... I'm looking for a way to install multiple (or rather, two)
> PCI/AGP cards in a machine and connect a monitor to each one, and use
> them both *in console mode* - preferably with some nice way to say
> 'assign virtual console 2 to the first screen, and 5 to the second' -
> that way you could have one tailing log files, showing 'top', whatever.
> A quick search of the web/newsgroups turned up various patches that
> looked ideal, but a closer inspection revealed that they either relied
> on you having a Hercules mono card, or only applied against kernel
> <0.99, or both... I was just wondering if anyone's thought
> about/written a similar patch for more recent hardware/versions? I was
> using a console Linux machine running BB (ASCII art demo -
> http://aa-project.sourceforge.net/) just to attract attention to our
> stand today and was thinking it would be really neat to have one machine
> driving several screens...
Hi!
Tkae a look at the linux console project.
http://www.sf.net/projects/linuxconsole.
I pretty much have rewritten the console system. I have been running a
multidesktop system for some time now. It needs some more work but the
core of it is their.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Multiple monitors
2001-09-03 20:49 ` Wakko Warner
2001-09-03 20:42 ` Simon Hay
2001-09-03 20:52 ` Jan Kasprzak
@ 2001-09-04 16:52 ` James Simmons
2 siblings, 0 replies; 15+ messages in thread
From: James Simmons @ 2001-09-04 16:52 UTC (permalink / raw)
To: Wakko Warner; +Cc: Simon Hay, linux-kernel
> I thought of doing something like this but using a matrox g400 or g450 dual
> head card. primary would be for X, secondary would be a console. Not sure
> if that's more difficult or not. Something I'd like to have, however.
I have a setup at work like this. I have X running on ATI rage 128 card
and a G400 as a console. I myself sometime ago got 2 independent X servers
running on a multidesktop system (2 monitors, 2 keybaords and 2 mice). In
this case you need to make sure you start the second X server with the -vt
option.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Multiple monitors
2001-09-03 18:44 Multiple monitors Simon Hay
` (3 preceding siblings ...)
2001-09-04 16:44 ` James Simmons
@ 2001-09-05 18:01 ` sacx
2001-09-05 18:13 ` sacx
4 siblings, 1 reply; 15+ messages in thread
From: sacx @ 2001-09-05 18:01 UTC (permalink / raw)
To: Simon Hay; +Cc: linux-kernel
Check the http://ylabs.igreconline.com ... Is a mingetty patch for
framebuffer .
Adrian Stanila
On Mon, 3 Sep 2001, Simon Hay wrote:
> Hi all,
>
> Apologies in advance if this is a question that's already been answered
> somewhere... I'm looking for a way to install multiple (or rather, two)
> PCI/AGP cards in a machine and connect a monitor to each one, and use
> them both *in console mode* - preferably with some nice way to say
> 'assign virtual console 2 to the first screen, and 5 to the second' -
> that way you could have one tailing log files, showing 'top', whatever.
> A quick search of the web/newsgroups turned up various patches that
> looked ideal, but a closer inspection revealed that they either relied
> on you having a Hercules mono card, or only applied against kernel
> <0.99, or both... I was just wondering if anyone's thought
> about/written a similar patch for more recent hardware/versions? I was
> using a console Linux machine running BB (ASCII art demo -
> http://aa-project.sourceforge.net/) just to attract attention to our
> stand today and was thinking it would be really neat to have one machine
> driving several screens...
>
> Simon
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Multiple monitors
2001-09-05 18:01 ` sacx
@ 2001-09-05 18:13 ` sacx
0 siblings, 0 replies; 15+ messages in thread
From: sacx @ 2001-09-05 18:13 UTC (permalink / raw)
To: Simon Hay; +Cc: linux-kernel
Hi,
Only now I read the whole tread about 'Multiple monitors' :))
For console mode you can try my patch for mingetty (see
http://ylabs.igreconline.com is working very well.. for example at my home
I run a fbtv on another monitor and in another monitor I work) or you can
try fbgetty . And for X use xinerama .
Adrian Stanila
P.S. is working for all combination of video cards. :))
On Wed, 5 Sep 2001 sacx@zebra.sibnet.ro wrote:
>
> Check the http://ylabs.igreconline.com ... Is a mingetty patch for
> framebuffer .
>
> Adrian Stanila
>
> On Mon, 3 Sep 2001, Simon Hay wrote:
>
> > Hi all,
> >
> > Apologies in advance if this is a question that's already been answered
> > somewhere... I'm looking for a way to install multiple (or rather, two)
> > PCI/AGP cards in a machine and connect a monitor to each one, and use
> > them both *in console mode* - preferably with some nice way to say
> > 'assign virtual console 2 to the first screen, and 5 to the second' -
> > that way you could have one tailing log files, showing 'top', whatever.
> > A quick search of the web/newsgroups turned up various patches that
> > looked ideal, but a closer inspection revealed that they either relied
> > on you having a Hercules mono card, or only applied against kernel
> > <0.99, or both... I was just wondering if anyone's thought
> > about/written a similar patch for more recent hardware/versions? I was
> > using a console Linux machine running BB (ASCII art demo -
> > http://aa-project.sourceforge.net/) just to attract attention to our
> > stand today and was thinking it would be really neat to have one machine
> > driving several screens...
> >
> > Simon
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at http://www.tux.org/lkml/
> >
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Multiple monitors
2001-09-03 20:11 ` Simon Hay
2001-09-03 20:49 ` Wakko Warner
@ 2001-09-07 0:55 ` Jamie Lokier
2001-09-10 22:58 ` Pavel Machek
1 sibling, 1 reply; 15+ messages in thread
From: Jamie Lokier @ 2001-09-07 0:55 UTC (permalink / raw)
To: Simon Hay; +Cc: linux-kernel
Simon Hay wrote:
> Also, though, on dedicated servers etc. I'd rather not be running X if
> I didn't have to.
You may find that a full screen xterm, with no window manager, actually
runs much faster than the console and looks identical. It is certainly
the case on several of my machines.
This is most pronounced if X can do hardware acceleration on your video
card, although it is true even without acceleration because of xterm's
nice jump scroll capability. (Btw, I prefer gnome-terminal because of
the Linux-console colour emulation :-).
On one 686 class machine, I saw text mode take nearly two seconds to
scroll the screen, when all but one line of the screen was being
scrolled (so it had to copy everything). This was in pure text mode,
not even a framebuffer! In X it was invisibly fast.
Also you may get a better refresh rate and higher resolution fonts out
of X, which is nice on a big display.
-- Jamie
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Multiple monitors
2001-09-07 0:55 ` Jamie Lokier
@ 2001-09-10 22:58 ` Pavel Machek
2001-09-13 12:51 ` Jamie Lokier
0 siblings, 1 reply; 15+ messages in thread
From: Pavel Machek @ 2001-09-10 22:58 UTC (permalink / raw)
To: Jamie Lokier, Simon Hay; +Cc: linux-kernel
Hi!
> > Also, though, on dedicated servers etc. I'd rather not be running X if
> > I didn't have to.
>
> You may find that a full screen xterm, with no window manager, actually
> runs much faster than the console and looks identical. It is certainly
> the case on several of my machines.
>
> This is most pronounced if X can do hardware acceleration on your video
> card, although it is true even without acceleration because of xterm's
> nice jump scroll capability. (Btw, I prefer gnome-terminal because of
> the Linux-console colour emulation :-).
>
> On one 686 class machine, I saw text mode take nearly two seconds to
> scroll the screen, when all but one line of the screen was being
> scrolled (so it had to copy everything). This was in pure text mode,
> not even a framebuffer! In X it was invisibly fast.
2 seconds on vga console is way too much. It could happen with
framebuffer + usb hogging PCI...
Pavel
--
I'm pavel@ucw.cz. "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents at discuss@linmodems.org
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Multiple monitors
2001-09-10 22:58 ` Pavel Machek
@ 2001-09-13 12:51 ` Jamie Lokier
0 siblings, 0 replies; 15+ messages in thread
From: Jamie Lokier @ 2001-09-13 12:51 UTC (permalink / raw)
To: Pavel Machek; +Cc: Simon Hay, linux-kernel
Pavel Machek wrote:
> > On one 686 class machine, I saw text mode take nearly two seconds to
> > scroll the screen, when all but one line of the screen was being
> > scrolled (so it had to copy everything). This was in pure text mode,
> > not even a framebuffer! In X it was invisibly fast.
>
> 2 seconds on vga console is way too much. It could happen with
> framebuffer + usb hogging PCI...
No, this was in 1996 on a Pentium Pro machine, with no USB or x86
framebuffer drivers even written then :-) It was plain 80x50 text mode,
really.
I still have the patch I wrote in March 1997 (attached for reference),
and this patch made a _huge_ difference to text mode Emacs on those
machines. An equivalent fix seems to have been incorporated in
console.c by now.
enjoy,
-- Jamie
--- linux/drivers/char/console.c.dist Tue Jan 14 22:01:17 1997
+++ linux/drivers/char/console.c Tue Feb 25 03:40:26 1997
@@ -592,15 +592,22 @@
__set_origin(__real_origin);
}
-void scrup(int currcons, unsigned int t, unsigned int b)
+static void scrup(int currcons, unsigned int t, unsigned int b, unsigned int nr)
{
int hardscroll = hardscroll_enabled;
- if (b > video_num_lines || t >= b)
+ if (b > video_num_lines || t >= b || nr == 0)
return;
+ if (nr > b - t)
+ nr = b - t;
if (t || b != video_num_lines)
hardscroll = 0;
if (hardscroll) {
+ if (nr != 1) {
+ while (nr--)
+ scrup (currcons, t, b, 1);
+ return;
+ }
origin += video_size_row;
pos += video_size_row;
scr_end += video_size_row;
@@ -639,14 +646,14 @@
set_origin(currcons);
} else {
unsigned short * d = (unsigned short *) (origin+video_size_row*t);
- unsigned short * s = (unsigned short *) (origin+video_size_row*(t+1));
- unsigned int count = (b-t-1) * video_num_columns;
+ unsigned short * s = (unsigned short *) (origin+video_size_row*(t+nr));
+ unsigned int count = (b-t-nr) * video_num_columns;
while (count) {
count--;
scr_writew(scr_readw(s++), d++);
}
- count = video_num_columns;
+ count = nr*video_num_columns;
while (count) {
count--;
scr_writew(video_erase_char, d++);
@@ -654,27 +661,28 @@
}
}
-void
-scrdown(int currcons, unsigned int t, unsigned int b)
+static void
+scrdown(int currcons, unsigned int t, unsigned int b, unsigned int nr)
{
unsigned short *d, *s;
unsigned int count;
- if (b > video_num_lines || t >= b)
+ if (b > video_num_lines || t >= b || nr == 0)
return;
+ if (nr > b - t)
+ nr = b - t;
d = (unsigned short *) (origin+video_size_row*b);
- s = (unsigned short *) (origin+video_size_row*(b-1));
- count = (b-t-1)*video_num_columns;
+ s = (unsigned short *) (origin+video_size_row*(b-nr));
+ count = (b-t-nr)*video_num_columns;
while (count) {
count--;
scr_writew(scr_readw(--s), --d);
}
- count = video_num_columns;
+ count = nr*video_num_columns;
while (count) {
count--;
scr_writew(video_erase_char, --d);
}
- has_scrolled = 1;
}
static void lf(int currcons)
@@ -683,7 +691,7 @@
* if below scrolling region
*/
if (y+1 == bottom)
- scrup(currcons,top,bottom);
+ scrup(currcons,top,bottom,1);
else if (y < video_num_lines-1) {
y++;
pos += video_size_row;
@@ -697,7 +705,7 @@
* if above scrolling region
*/
if (y == top)
- scrdown(currcons,top,bottom);
+ scrdown(currcons,top,bottom,1);
else if (y > 0) {
y--;
pos -= video_size_row;
@@ -1171,84 +1179,61 @@
}
}
-static void insert_char(int currcons)
+static void insert_chars(int currcons, unsigned int nr)
{
- unsigned int i = x;
- unsigned short tmp, old = video_erase_char;
+ unsigned int count;
unsigned short * p = (unsigned short *) pos;
- while (i++ < video_num_columns) {
- tmp = scr_readw(p);
- scr_writew(old, p);
- old = tmp;
- p++;
+ if (nr >= video_num_columns - x)
+ nr = video_num_columns - x;
+ if (nr == 0)
+ return;
+
+ p += video_num_columns - x;
+ count = video_num_columns - x - nr;
+ while (count--) {
+ p--;
+ scr_writew(scr_readw(p-nr), p);
}
+ count = nr;
+ while (count--)
+ scr_writew(video_erase_char, --p);
+
need_wrap = 0;
}
-static void insert_line(int currcons)
+static inline void insert_lines(int currcons, unsigned int nr)
{
- scrdown(currcons,y,bottom);
+ scrdown(currcons,y,bottom,nr);
need_wrap = 0;
}
-static void delete_char(int currcons)
+static void delete_chars(int currcons, unsigned int nr)
{
- unsigned int i = x;
+ unsigned int count;
unsigned short * p = (unsigned short *) pos;
- while (++i < video_num_columns) {
- scr_writew(scr_readw(p+1), p);
+ if (nr >= video_num_columns - x)
+ nr = video_num_columns - x;
+ if (nr == 0)
+ return;
+
+ count = video_num_columns - x - nr;
+ while (count--) {
+ scr_writew(scr_readw(p+nr), p);
p++;
}
- scr_writew(video_erase_char, p);
- need_wrap = 0;
-}
+ count = nr;
+ while (count--)
+ scr_writew(video_erase_char, p++);
-static void delete_line(int currcons)
-{
- scrup(currcons,y,bottom);
need_wrap = 0;
}
-static void csi_at(int currcons, unsigned int nr)
-{
- if (nr > video_num_columns)
- nr = video_num_columns;
- else if (!nr)
- nr = 1;
- while (nr--)
- insert_char(currcons);
-}
-
-static void csi_L(int currcons, unsigned int nr)
-{
- if (nr > video_num_lines)
- nr = video_num_lines;
- else if (!nr)
- nr = 1;
- while (nr--)
- insert_line(currcons);
-}
-
-static void csi_P(int currcons, unsigned int nr)
-{
- if (nr > video_num_columns)
- nr = video_num_columns;
- else if (!nr)
- nr = 1;
- while (nr--)
- delete_char(currcons);
-}
-
-static void csi_M(int currcons, unsigned int nr)
+static inline void delete_lines(int currcons, unsigned int nr)
{
- if (nr > video_num_lines)
- nr = video_num_lines;
- else if (!nr)
- nr=1;
- while (nr--)
- delete_line(currcons);
+ scrup(currcons,y,bottom,nr);
+ need_wrap = 0;
}
static void save_cur(int currcons)
@@ -1468,7 +1453,7 @@
lf(currcons);
}
if (decim)
- insert_char(currcons);
+ insert_chars(currcons, 1);
scr_writew( video_mode_512ch ?
((attr & 0xf7) << 8) + ((tc & 0x100) << 3) +
(tc & 0x0ff) : (attr << 8) + tc,
@@ -1707,13 +1692,13 @@
csi_K(currcons,par[0]);
continue;
case 'L':
- csi_L(currcons,par[0]);
+ insert_lines(currcons,(par[0] ? par[0] : 1));
continue;
case 'M':
- csi_M(currcons,par[0]);
+ delete_lines(currcons,(par[0] ? par[0] : 1));
continue;
case 'P':
- csi_P(currcons,par[0]);
+ delete_chars(currcons,(par[0] ? par[0] : 1));
continue;
case 'c':
if (!par[0])
@@ -1762,7 +1747,7 @@
csi_X(currcons, par[0]);
continue;
case '@':
- csi_at(currcons,par[0]);
+ insert_chars(currcons,(par[0] ? par[0] : 1));
continue;
case ']': /* setterm functions */
setterm_command(currcons);
--- linux/drivers/char/vt.c.dist Wed Feb 5 20:04:38 1997
+++ linux/drivers/char/vt.c Tue Feb 25 03:42:23 1997
@@ -28,6 +28,7 @@
#include "vt_kern.h"
#include "diacr.h"
#include "selection.h"
+#include "console_struct.h" /* for `vc_has_scrolled' */
extern char vt_dont_switch;
extern struct tty_driver console_driver;
@@ -299,9 +300,10 @@
/*
* explicitly blank/unblank the screen if switching modes
*/
- if (arg == KD_TEXT)
+ if (arg == KD_TEXT) {
+ vc_cons[console].d->vc_has_scrolled = 1;
do_unblank_screen();
- else
+ } else
do_blank_screen(1);
return 0;
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2001-09-13 12:52 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-09-03 18:44 Multiple monitors Simon Hay
2001-09-03 19:48 ` Jakob Østergaard
2001-09-03 20:11 ` Simon Hay
2001-09-03 20:49 ` Wakko Warner
2001-09-03 20:42 ` Simon Hay
2001-09-03 20:52 ` Jan Kasprzak
2001-09-04 16:52 ` James Simmons
2001-09-07 0:55 ` Jamie Lokier
2001-09-10 22:58 ` Pavel Machek
2001-09-13 12:51 ` Jamie Lokier
2001-09-03 20:57 ` Matan Ziv-Av
2001-09-04 7:56 ` Ghozlane Toumi
2001-09-04 16:44 ` James Simmons
2001-09-05 18:01 ` sacx
2001-09-05 18:13 ` sacx
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox