2003-05-09 11:21:28

by Damian Kołkowski

[permalink] [raw]
Subject: [BUG] 2.5.69 - no setfont and loadkeys on tty > 1

Hi,

I'am wondering why setfont and loadkeys in setting only on first tty.
It works (setting font map on all six tty) in 2.{2,4}.x.

I'am using _radeonfb_ with rv250if, could it be the reason?

Take care.

P.S. Do I need to attaah the config file?

--
# Damian *dEiMoS* Ko?kowski # http://deimos.one.pl/ #


2003-05-11 17:27:57

by Pavel Machek

[permalink] [raw]
Subject: Re: [BUG] 2.5.69 - no setfont and loadkeys on tty > 1

Hi!

> I'am wondering why setfont and loadkeys in setting only on first tty.
> It works (setting font map on all six tty) in 2.{2,4}.x.
>
> I'am using _radeonfb_ with rv250if, could it be the reason?

FYI, its same as vesafb here.
Pavel
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

2003-05-12 21:13:31

by James Simmons

[permalink] [raw]
Subject: Re: [BUG] 2.5.69 - no setfont and loadkeys on tty > 1


> Hi!
>
> > I'am wondering why setfont and loadkeys in setting only on first tty.
> > It works (setting font map on all six tty) in 2.{2,4}.x.
> >
> > I'am using _radeonfb_ with rv250if, could it be the reason?
>
> FYI, its same as vesafb here.
> Pavel

Try this patch. If it works I will pass it on to linus. thank you.


# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.1077 -> 1.1078
# drivers/char/vt_ioctl.c 1.22 -> 1.23
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/05/12 [email protected] 1.1078
# [CONSOLE] This patch fixes the problem of not being able to set the fonts on VCs other than the first one. This also was the bug that was casuing dual head (vga and mda) to lock up.
# --------------------------------------------
#
diff -Nru a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
--- a/drivers/char/vt_ioctl.c Mon May 12 14:12:47 2003
+++ b/drivers/char/vt_ioctl.c Mon May 12 14:12:47 2003
@@ -869,13 +869,13 @@
if (clin > 32)
return -EINVAL;

- if (vlin)
- vc->vc_scan_lines = vlin;
- if (clin)
- vc->vc_font.height = clin;
-
- for (i = 0; i < MAX_NR_CONSOLES; i++)
+ for (i = 0; i < MAX_NR_CONSOLES; i++) {
+ if (vlin)
+ vc_cons[i].d->vc_scan_lines = vlin;
+ if (clin)
+ vc_cons[i].d->vc_font.height = clin;
vc_resize(i, cc, ll);
+ }
return 0;
}


2003-05-13 12:54:26

by Damian Kołkowski

[permalink] [raw]
Subject: Re: [BUG] 2.5.69 - no setfont and loadkeys on tty > 1

On Mon, May 12, 2003 at 10:25:50PM +0100, James Simmons wrote:
> Try this patch. If it works I will pass it on to linus. thank you.

It dose't work for me on 2.5.69-bk8.

--
# Damian *dEiMoS* Ko?kowski # http://deimos.one.pl/ #

2003-05-14 15:14:22

by Pavel Machek

[permalink] [raw]
Subject: Re: [BUG] 2.5.69 - no setfont and loadkeys on tty > 1

Hi!

> > > I'am wondering why setfont and loadkeys in setting only on first tty.
> > > It works (setting font map on all six tty) in 2.{2,4}.x.
> > >
> > > I'am using _radeonfb_ with rv250if, could it be the reason?
> >
> > FYI, its same as vesafb here.
>
> Try this patch. If it works I will pass it on to linus. thank you.

Does not work. Setfont still only changes tty it is run on.

There are more problems. Emacs changes cursor to "more visible" one,
this somehow leaks between ttys.

Last but not least: Try this on your tty:

echo -e "\33[10;5000]\33[11;50]\33[?18;0;136c\33[?102m"

It is supposed to start "softcursor". Unfortunately, with 2.5.68+
softcursor is not cleared properly. Try typing foo^H^H^H in bash
:-(. [Or try most /some/file].

Pavel
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

2003-05-14 22:07:13

by James Simmons

[permalink] [raw]
Subject: Re: [BUG] 2.5.69 - no setfont and loadkeys on tty > 1


> > > > I'am wondering why setfont and loadkeys in setting only on first tty.
> > > > It works (setting font map on all six tty) in 2.{2,4}.x.
> > > >
> > > > I'am using _radeonfb_ with rv250if, could it be the reason?
> > >
> > > FYI, its same as vesafb here.
> >
> > Try this patch. If it works I will pass it on to linus. thank you.
>
> Does not work. Setfont still only changes tty it is run on.

This is because I nuked a few global variables. Video_font_height and
video_scan_line where global variables. When you changed fonts it affected
every terminal. Now you might think this is correct behavior but what
about systems with more than one graphics card. Say for example vgacon and
fbcon. Now for vgacon you can't change the width of your fonts but for
fbcon you can. So changing this global variable caused havoc for the VGA
text mode display.

> There are more problems. Emacs changes cursor to "more visible" one,
> this somehow leaks between ttys.

Hm. I can't seem to reproduce this problem.

> Last but not least: Try this on your tty:
>
> echo -e "\33[10;5000]\33[11;50]\33[?18;0;136c\33[?102m"
>
> It is supposed to start "softcursor". Unfortunately, with 2.5.68+
> softcursor is not cleared properly. Try typing foo^H^H^H in bash
> :-(. [Or try most /some/file].

I see. Only moving the cursor to the left cause this problem. Moving right
is okay. Also hitting enter shows this problem. This is strange. It
appears the flashing is the issue. I will see if a hardware cursor also has
this same issue. Thanks for pointing it out. Softcursor has another
problem I also discover also so I can include it in my next set of fixes.

P.S
KDGKBDTYPE. (Wow, I can't believe we still have this. It should die)



2003-05-14 22:31:34

by Pavel Machek

[permalink] [raw]
Subject: Re: [BUG] 2.5.69 - no setfont and loadkeys on tty > 1

Hi!

> > > > > I'am wondering why setfont and loadkeys in setting only on first tty.
> > > > > It works (setting font map on all six tty) in 2.{2,4}.x.
> > > > >
> > > > > I'am using _radeonfb_ with rv250if, could it be the reason?
> > > >
> > > > FYI, its same as vesafb here.
> > >
> > > Try this patch. If it works I will pass it on to linus. thank you.
> >
> > Does not work. Setfont still only changes tty it is run on.
>
> This is because I nuked a few global variables. Video_font_height and
> video_scan_line where global variables. When you changed fonts it affected
> every terminal. Now you might think this is correct behavior but what
> about systems with more than one graphics card. Say for example vgacon and
> fbcon. Now for vgacon you can't change the width of your fonts but for
> fbcon you can. So changing this global variable caused havoc for the VGA
> text mode display.

Well, it would be nice to set the default for newly created consoles.

Perhaps you need to make old ioctls 2.4.X compatible and introduce new
ioctl that sets only "this" console?

> > There are more problems. Emacs changes cursor to "more visible" one,
> > this somehow leaks between ttys.
>
> Hm. I can't seem to reproduce this problem.

Do this:

pavel@amd:~$ echo -e '\e[?8c'

Notice cursor changes to block. Switch to another console. Oops, block
cursor, too.

> > Last but not least: Try this on your tty:
> >
> > echo -e "\33[10;5000]\33[11;50]\33[?18;0;136c\33[?102m"
> >
> > It is supposed to start "softcursor". Unfortunately, with 2.5.68+
> > softcursor is not cleared properly. Try typing foo^H^H^H in bash
> > :-(. [Or try most /some/file].
>
> I see. Only moving the cursor to the left cause this problem. Moving right
> is okay. Also hitting enter shows this problem. This is strange. It

Its not. Its software generated cursor, and it is only drawn, not
properly hidden. Thats why it behaves like that.

> appears the flashing is the issue. I will see if a hardware cursor
> also has

Don't let flashing confuse you. Set it to the red block and you'll see
problem better.

> KDGKBDTYPE. (Wow, I can't believe we still have this. It should die)

What is that? I can not see it in 2.5.X.
Pavel
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

2003-05-14 22:35:04

by Pavel Machek

[permalink] [raw]
Subject: Re: [BUG] 2.5.69 - no setfont and loadkeys on tty > 1

Hi!

> > There are more problems. Emacs changes cursor to "more visible" one,
> > this somehow leaks between ttys.
>
> Hm. I can't seem to reproduce this problem.

Also play a bit with gpm's selection. Sometimes cursor gets
corrupted. Like its no longer underline or block, it is something
strange.
Pavel
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

2003-05-14 23:03:41

by James Simmons

[permalink] [raw]
Subject: Re: [BUG] 2.5.69 - no setfont and loadkeys on tty > 1


> Well, it would be nice to set the default font for newly created fonts

> Perhaps you need to make old ioctls 2.4.X compatible and introduce new
> ioctl that sets only "this" console?

PIO_FONTRESET ioctl which is old and the flag KD_FONT_OP_SET_DEFAULT.
I have to look at the setfont code to see if it sets this flag. I bet
it doesn't. I don't see a flag to tell setfont to use this font as the
default font for all terminals :-( The good news is you can tell which tty
to change the fonts on (-c /dev/ttyX). So setfont has the idea of setting
a single tty but due to a bug in the console layer it set all terminals.
I guess we need to update setfont for setting all terminals.

> Do this:
>
> pavel@amd:~$ echo -e '\e[?8c'
>
> Notice cursor changes to block. Switch to another console. Oops, block
> cursor, too.

Ug!!!! I have cursor_shape in struct display for this reason. Will have to
trace to find the problem.

> > appears the flashing is the issue. I will see if a hardware cursor
> > also has

Your right. I realize my logic error. I was literally thinking too black
and white. In the case of a cursor that is a white thin line at the bottom
and a grey background. That is whole cursor image!! The mask should be
the font image to be drawn.
You can think of it as the cursor being a big grey cookie with white
frosting decoration on the bottom. Then I come with my font shape cookie
cutter and cut it out.

> > KDGKBDTYPE. (Wow, I can't believe we still have this. It should die)
>
> What is that? I can not see it in 2.5.X.

Line 420 in vt_ioctl.c.


2003-05-14 23:59:56

by Pavel Machek

[permalink] [raw]
Subject: Re: [BUG] 2.5.69 - no setfont and loadkeys on tty > 1

Hi!

> > > appears the flashing is the issue. I will see if a hardware cursor
> > > also has
>
> Your right. I realize my logic error. I was literally thinking too black
> and white. In the case of a cursor that is a white thin line at the bottom
> and a grey background. That is whole cursor image!! The mask should be
> the font image to be drawn.
> You can think of it as the cursor being a big grey cookie with white
> frosting decoration on the bottom. Then I come with my font shape cookie
> cutter and cut it out.

I'm not sure I follow you.

What I do in that echo is set softcursor. It was software cursor even
on plain vga. Boot into 2.4 to see how it should look like. It works
even in vga text modes. It is different from softcursor later
introduced by fbcon. Documentation/VGA-softcursor.txt describes it.

Pavel
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

2003-05-15 02:31:30

by Andries Brouwer

[permalink] [raw]
Subject: Re: [BUG] 2.5.69 - no setfont and loadkeys on tty > 1

On Wed, May 14, 2003 at 11:19:59PM +0100, James Simmons wrote:

> P.S
> KDGKBDTYPE. (Wow, I can't believe we still have this. It should die)

It is rather useless for determining keyboard proterties, yes.
On the other hand, quite a few utilities use it in code like

static int
is_a_console(int fd) {
char arg;

arg = 0;
return (ioctl(fd, KDGKBTYPE, &arg) == 0
&& ((arg == KB_101) || (arg == KB_84)));
}

Andries