2002-12-02 21:00:22

by James Simmons

[permalink] [raw]
Subject: [STATUS] fbdev api.


Hi!

I have a new patch avaiable. It is against 2.5.50. The patch is at

http://phoenix.infradead.org/~jsimmons/fbdev.diff.gz

Have fun!!!!

Drivers ported are: (Give them a try)

ATI Mach 64
ATI 128
VESA
VGA16
HGA
NIVIDA
NEOMAGIC

The BIG changes are:

1) The seperation of the console code out of the fbdev drivers.

2) Total modularity of the frmaebuffer console system. Yes that is
right. You can build it has modules. Great for testing.

The following are results of the new changes which I have tested.

With my VIA laptop with my neomagic card I was able to build it with
vgacon and no fbcon. Then I insmod neofb and the soft accel (cfb*.c)
needed. It loading and did NOT change the video hardware state. At this
point I could run fbdev apps including a X server using /dev/fb solely.
On opening /dev/fb0 the graphics hardware state changed. In theory I could
exit X and get vgacon back. In order to do this I have to reset the
hardware back to vga text mode in the fb_release function. It can be done
but I haven't done it yet.
With the second experiment I was able to insmod the fonts and fbcon.o.
Then it switched from vgacon to fbcon. In theory I could again call the
release function and reset the hardware back to a text mode state. All
that is needed is the hardware specific code to do this.

Things to be done:

1) A few bugs in fbcon to hammer out.

2) Fbcon to support changing resolution via the console layer.

3) Move the logo code out of fbcon.c to fbmem.c. With pure fbdev
you need something to let you know things worked.

4) Software rotation.

The diffstat is:

CREDITS | 10
Documentation/DocBook/kernel-api.tmpl | 4
Documentation/fb/README-sstfb.txt | 173
Documentation/fb/internals.txt | 5
Documentation/fb/sstfb.txt | 174
MAINTAINERS | 7
arch/alpha/Kconfig | 31
arch/arm/Kconfig | 21
arch/i386/Kconfig | 55
arch/i386/vmlinux.lds.s | 114
arch/ia64/Kconfig | 25
arch/m68k/Kconfig | 7
arch/m68knommu/Kconfig | 35
arch/mips/Kconfig | 62
arch/mips64/Kconfig | 23
arch/parisc/Kconfig | 30
arch/ppc/Kconfig | 22
arch/ppc64/Kconfig | 7
arch/sh/Kconfig | 55
arch/sparc/Kconfig | 16
arch/sparc64/Kconfig | 11
arch/v850/Kconfig | 35
arch/x86_64/Kconfig | 55
drivers/Makefile | 3
drivers/char/Makefile | 2
drivers/char/consolemap.c | 5
drivers/char/keyboard.c | 1
drivers/char/mem.c | 12
drivers/char/selection.c | 1
drivers/char/toshiba.c | 2
drivers/char/tty_io.c | 7
drivers/char/vc_screen.c | 1
drivers/char/vt.c | 200 -
drivers/char/vt_ioctl.c | 58
drivers/video/68328fb.c | 967 +----
drivers/video/Kconfig | 411 --
drivers/video/Makefile | 54
drivers/video/S3triofb.c | 2
drivers/video/amifb.c | 2
drivers/video/anakinfb.c | 62
drivers/video/atafb.c | 2
drivers/video/aty/atyfb.h | 18
drivers/video/aty/atyfb_base.c | 99
drivers/video/aty/mach64_ct.c | 2
drivers/video/aty/mach64_cursor.c | 157
drivers/video/aty/mach64_gx.c | 2
drivers/video/aty128fb.c | 3238 +++++++----------
drivers/video/cfbcopyarea.c | 511 +-
drivers/video/cfbfillrect.c | 536 ++
drivers/video/cfbimgblt.c | 360 +
drivers/video/chipsfb.c | 2
drivers/video/clps711xfb.c | 16
drivers/video/console/Kconfig | 221 +
drivers/video/console/Makefile | 61
drivers/video/console/dummycon.c | 73
drivers/video/console/fbcon-sti.c | 289 +
drivers/video/console/fbcon.c | 2725 ++++++++++++++
drivers/video/console/fbcon.h | 142
drivers/video/console/font.h | 53
drivers/video/console/font_6x11.c | 3351 +++++++++++++++++
drivers/video/console/font_8x16.c | 4631 ++++++++++++++++++++++++
drivers/video/console/font_8x8.c | 2583 +++++++++++++
drivers/video/console/font_acorn_8x8.c | 277 +
drivers/video/console/font_mini_4x6.c | 2158 +++++++++++
drivers/video/console/font_pearl_8x8.c | 2587 +++++++++++++
drivers/video/console/font_sun12x22.c | 6220 +++++++++++++++++++++++++++++++++
drivers/video/console/font_sun8x16.c | 275 +
drivers/video/console/fonts.c | 142
drivers/video/console/mdacon.c | 631 +++
drivers/video/console/newport_con.c | 745 +++
drivers/video/console/prom.uni | 11
drivers/video/console/promcon.c | 605 +++
drivers/video/console/sti.h | 289 +
drivers/video/console/sticon.c | 214 +
drivers/video/console/sticore.c | 601 +++
drivers/video/console/vgacon.c | 1066 +++++
drivers/video/controlfb.c | 499 --
drivers/video/cyberfb.c | 2
drivers/video/dnfb.c | 18
drivers/video/dummycon.c | 74
drivers/video/epson1355fb.c | 2
drivers/video/fbcmap.c | 92
drivers/video/fbcon-accel.c | 188
drivers/video/fbcon-accel.h | 34
drivers/video/fbcon-afb.c | 448 --
drivers/video/fbcon-cfb16.c | 319 -
drivers/video/fbcon-cfb2.c | 225 -
drivers/video/fbcon-cfb24.c | 333 -
drivers/video/fbcon-cfb32.c | 305 -
drivers/video/fbcon-cfb4.c | 229 -
drivers/video/fbcon-cfb8.c | 294 -
drivers/video/fbcon-hga.c | 253 -
drivers/video/fbcon-ilbm.c | 296 -
drivers/video/fbcon-iplan2p2.c | 476 --
drivers/video/fbcon-iplan2p4.c | 497 --
drivers/video/fbcon-iplan2p8.c | 534 --
drivers/video/fbcon-mfb.c | 217 -
drivers/video/fbcon-sti.c | 337 -
drivers/video/fbcon-vga-planes.c | 387 --
drivers/video/fbcon.c | 2509 -------------
drivers/video/fbgen.c | 286 -
drivers/video/fbmem.c | 233 -
drivers/video/fm2fb.c | 17
drivers/video/font_6x11.c | 3351 -----------------
drivers/video/font_8x16.c | 4631 ------------------------
drivers/video/font_8x8.c | 2583 -------------
drivers/video/font_acorn_8x8.c | 277 -
drivers/video/font_mini_4x6.c | 2158 -----------
drivers/video/font_pearl_8x8.c | 2587 -------------
drivers/video/font_sun12x22.c | 6220 ---------------------------------
drivers/video/font_sun8x16.c | 275 -
drivers/video/fonts.c | 135
drivers/video/g364fb.c | 74
drivers/video/hgafb.c | 424 --
drivers/video/hitfb.c | 17
drivers/video/hpfb.c | 16
drivers/video/igafb.c | 2
drivers/video/imsttfb.c | 41
drivers/video/macfb.c | 22
drivers/video/macmodes.c | 3
drivers/video/macmodes.h | 70
drivers/video/matrox/i2c-matroxfb.c | 2
drivers/video/matrox/matroxfb_base.c | 4
drivers/video/matrox/matroxfb_crtc2.c | 4
drivers/video/maxinefb.c | 48
drivers/video/mdacon.c | 632 ---
drivers/video/modedb.c | 7
drivers/video/neofb.c | 389 +-
drivers/video/newport_con.c | 746 ---
drivers/video/offb.c | 23
drivers/video/platinumfb.c | 451 --
drivers/video/pm2fb.c | 2
drivers/video/pm3fb.c | 2
drivers/video/pmag-ba-fb.c | 59
drivers/video/pmagb-b-fb.c | 53
drivers/video/prom.uni | 11
drivers/video/promcon.c | 606 ---
drivers/video/pvr2fb.c | 4
drivers/video/q40fb.c | 16
drivers/video/radeonfb.c | 3374 ++++++++++-------
drivers/video/retz3fb.c | 2
drivers/video/riva/Makefile | 2
drivers/video/riva/accel.c | 427 --
drivers/video/riva/fbdev.c | 2099 ++++-------
drivers/video/riva/riva_hw.h | 1
drivers/video/riva/rivafb.h | 48
drivers/video/sa1100fb.c | 2
drivers/video/sbusfb.c | 2
drivers/video/sgivwfb.c | 62
drivers/video/sis/Makefile | 2
drivers/video/sis/sis_accel.c | 495 ++
drivers/video/sis/sis_main.c | 2
drivers/video/skeletonfb.c | 28
drivers/video/softcursor.c | 62
drivers/video/sstfb.c | 2
drivers/video/sti-bmode.h | 287 -
drivers/video/sti.h | 289 -
drivers/video/sticon-bmode.c | 895 ----
drivers/video/sticon.c | 215 -
drivers/video/sticore.c | 601 ---
drivers/video/sticore.h | 407 ++
drivers/video/stifb.c | 1403 ++++++-
drivers/video/sun3fb.c | 2
drivers/video/tdfxfb.c | 531 +-
drivers/video/tgafb.c | 2
drivers/video/tridentfb.c | 2
drivers/video/tx3912fb.c | 19
drivers/video/valkyriefb.c | 27
drivers/video/vesafb.c | 24
drivers/video/vfb.c | 38
drivers/video/vga16fb.c | 1368 +++++--
drivers/video/vgacon.c | 1055 -----
drivers/video/virgefb.c | 2
include/linux/console.h | 1
include/linux/console_struct.h | 1
include/linux/fb.h | 207 -
include/linux/radeon.h | 766 ++++
include/linux/radeonfb.h | 15
include/linux/sisfb.h | 58
include/linux/vt_kern.h | 8
include/video/fbcon-afb.h | 32
include/video/fbcon-cfb16.h | 34
include/video/fbcon-cfb2.h | 32
include/video/fbcon-cfb24.h | 34
include/video/fbcon-cfb32.h | 34
include/video/fbcon-cfb4.h | 32
include/video/fbcon-cfb8.h | 34
include/video/fbcon-hga.h | 32
include/video/fbcon-ilbm.h | 32
include/video/fbcon-iplan2p2.h | 32
include/video/fbcon-iplan2p4.h | 32
include/video/fbcon-iplan2p8.h | 32
include/video/fbcon-mac.h | 32
include/video/fbcon-mfb.h | 32
include/video/fbcon-vga-planes.h | 37
include/video/fbcon-vga.h | 32
include/video/fbcon.h | 795 ----
include/video/font.h | 53
include/video/macmodes.h | 70
include/video/neomagic.h | 1
kernel/printk.c | 1
201 files changed, 41728 insertions(+), 47259 deletions(-)




2002-12-02 21:51:47

by Tobias Rittweiler

[permalink] [raw]
Subject: Re: [STATUS] fbdev api.

Hello James,

Monday, December 2, 2002, 10:07:33 PM, you wrote:


JS> Hi!

JS> I have a new patch avaiable. It is against 2.5.50. The patch is at
JS> http://phoenix.infradead.org/~jsimmons/fbdev.diff.gz

JS> [...]
JS> The diffstat is:

JS> CREDITS | 10

Hunk #1 succeeded at 2836 (offset -6 lines).

JS> [...]
JS> arch/i386/vmlinux.lds.s | 114
^^^^^^^^^^^^^^
really intended?

JS> [...]
JS> drivers/char/tty_io.c | 7

Hunk #1 succeeded at 1503 (offset -6 lines).

JS> [...]
JS> drivers/video/Kconfig | 411 --

Hunk #19 succeeded at 864 with fuzz 1 (offset -7 lines).

(of course against 2.5.50 vanilla)
--
cheers,
Tobias

2002-12-02 22:11:56

by James Simmons

[permalink] [raw]
Subject: Re: [STATUS] fbdev api.


> JS> I have a new patch avaiable. It is against 2.5.50. The patch is at
> JS> http://phoenix.infradead.org/~jsimmons/fbdev.diff.gz
>
> JS> [...]
> JS> The diffstat is:
>
> JS> CREDITS | 10
>
> Hunk #1 succeeded at 2836 (offset -6 lines).
>
> JS> [...]
> JS> arch/i386/vmlinux.lds.s | 114
> ^^^^^^^^^^^^^^
> really intended?
>
> JS> [...]
> JS> drivers/char/tty_io.c | 7
>
> Hunk #1 succeeded at 1503 (offset -6 lines).
>
> JS> [...]
> JS> drivers/video/Kconfig | 411 --
>
> Hunk #19 succeeded at 864 with fuzz 1 (offset -7 lines).

It does work but I made the patch against Linus tree with a few extra
fixes due to the pci/quirks bug. I will post a exact patch.



2002-12-03 09:23:15

by Antonino A. Daplas

[permalink] [raw]
Subject: Re: [STATUS] fbdev api.

On Tue, 2002-12-03 at 02:07, James Simmons wrote:
>
> Hi!
>
> I have a new patch avaiable. It is against 2.5.50. The patch is at
>
> http://phoenix.infradead.org/~jsimmons/fbdev.diff.gz
>
> Have fun!!!!
>
> Drivers ported are: (Give them a try)
>
> ATI Mach 64
> ATI 128
> VESA
> VGA16
> HGA
> NIVIDA
> NEOMAGIC
>
> The BIG changes are:
>
> 1) The seperation of the console code out of the fbdev drivers.
>
> 2) Total modularity of the frmaebuffer console system. Yes that is
> right. You can build it has modules. Great for testing.
>
> The following are results of the new changes which I have tested.
>
> With my VIA laptop with my neomagic card I was able to build it with
> vgacon and no fbcon. Then I insmod neofb and the soft accel (cfb*.c)
> needed. It loading and did NOT change the video hardware state. At this
> point I could run fbdev apps including a X server using /dev/fb solely.
> On opening /dev/fb0 the graphics hardware state changed. In theory I could
> exit X and get vgacon back. In order to do this I have to reset the
> hardware back to vga text mode in the fb_release function. It can be done
> but I haven't done it yet.
> With the second experiment I was able to insmod the fonts and fbcon.o.
> Then it switched from vgacon to fbcon. In theory I could again call the
> release function and reset the hardware back to a text mode state. All
> that is needed is the hardware specific code to do this.
>
> Things to be done:
>
> 1) A few bugs in fbcon to hammer out.
>
> 2) Fbcon to support changing resolution via the console layer.
>
> 3) Move the logo code out of fbcon.c to fbmem.c. With pure fbdev
> you need something to let you know things worked.
>
> 4) Software rotation.
>

Attached is a patch against linux-2.5.50 + your fbdev.diff.

a. changed __MOD_INC_USE_COUNT and __MOD_DEC_USE_COUNT to
try_module_get() and module_put() respectively. This will allow modules
to be safely unloaded.

b. Another rewrite of fbcon_show_logo() so it's more understandable
(hopefully). I also added support for the rest of the visuals, but
untested yet.

Tested with different hardware (little endian):
truecolor, directcolor, pseudocolor, vga 4-bit pseudocolor.

Not tested:
static psuedocolor, mono01, and mono10.

c. prevent fbcon module from loading if no fbdev is registered. Also
made fbcon module unsafe to unload (for now). This is optional, of course.


Attachments:
fbcon.diff (11.93 kB)

2002-12-03 21:19:22

by James Simmons

[permalink] [raw]
Subject: Re: [STATUS] fbdev api.


> Attached is a patch against linux-2.5.50 + your fbdev.diff.

Applied :-)

> b. Another rewrite of fbcon_show_logo() so it's more understandable
> (hopefully). I also added support for the rest of the visuals, but
> untested yet.
> Not tested:
> static psuedocolor, mono01, and mono10.

I have a mono hga card.

> c. prevent fbcon module from loading if no fbdev is registered. Also
> made fbcon module unsafe to unload (for now). This is optional, of course.

It is a good idea until we have the ability to switch back to text mode.


2002-12-04 00:33:35

by Antonino A. Daplas

[permalink] [raw]
Subject: Re: [STATUS] fbdev api.

On Wed, 2002-12-04 at 03:18, James Simmons wrote:
>
> > Attached is a patch against linux-2.5.50 + your fbdev.diff.
>
> Applied :-)
>
> > b. Another rewrite of fbcon_show_logo() so it's more understandable
> > (hopefully). I also added support for the rest of the visuals, but
> > untested yet.
> > Not tested:
> > static psuedocolor, mono01, and mono10.
>
> I have a mono hga card.
>
Can you apply the following patch to include logo drawing support for all formats :-)?

diff -Naur linux-2.5.50-js/drivers/video/cfbimgblt.c linux/drivers/video/cfbimgblt.c
--- linux-2.5.50-js/drivers/video/cfbimgblt.c 2002-12-04 03:14:19.000000000 +0000
+++ linux/drivers/video/cfbimgblt.c 2002-12-04 03:13:57.000000000 +0000
@@ -123,11 +123,11 @@
shift = start_index;
}
while (n--) {
- if (p->fix.visual == FB_VISUAL_PSEUDOCOLOR)
- color = *src & bitmask;
if (p->fix.visual == FB_VISUAL_TRUECOLOR ||
p->fix.visual == FB_VISUAL_DIRECTCOLOR )
color = palette[*src] & bitmask;
+ else
+ color = *src & bitmask;
val |= SHIFT_HIGH(color, shift);
if (shift >= null_bits) {
FB_WRITEL(val, dst++);

> > c. prevent fbcon module from loading if no fbdev is registered. Also
> > made fbcon module unsafe to unload (for now). This is optional, of course.
>
> It is a good idea until we have the ability to switch back to text mode.
>
It's not the switch back to text mode, that's very doable (see my other
reply). It's during give_up_console() at fbcon module exit. At this
point, the console suddenly disappears and freezes the system. Maybe we
can save the global "conswitchp" during fbcon module init, then
something like this at fbcon module exit:

void __exit fb_console_exit(void)
{
give_up_console(&fbcon);
take_over_console(saved_conswitchp, ...);
}

Is this feasible?

Tony

2002-12-04 22:01:18

by James Simmons

[permalink] [raw]
Subject: Re: [STATUS] fbdev api.


> Can you apply the following patch to include logo drawing support for all formats :-)?

Applied :-)

> It's not the switch back to text mode, that's very doable (see my other
> reply). It's during give_up_console() at fbcon module exit. At this
> point, the console suddenly disappears and freezes the system. Maybe we
> can save the global "conswitchp" during fbcon module init, then
> something like this at fbcon module exit:
>
> void __exit fb_console_exit(void)
> {
> give_up_console(&fbcon);
> take_over_console(saved_conswitchp, ...);
> }
>
> Is this feasible?

I thought about it but the solution is not easy. Consider that we have
vgacon and mdacon. Then I load in hgafb. Here the goal is to take over
mdacon. So we have to prevent taking over vgacon. Since there is only on
conswitchp we are in trouble.

2002-12-06 19:36:23

by Tobias Rittweiler

[permalink] [raw]
Subject: Re: [STATUS] fbdev api.

Hello James,

Monday, December 2, 2002, 10:07:33 PM, you wrote:

JS> Hi!

JS> I have a new patch avaiable. It is against 2.5.50. The patch is at
JS> http://phoenix.infradead.org/~jsimmons/fbdev.diff.gz

Besides the hunks posted recently, I encountered three problems/bugs:

a) Although your patch fixes the FB oddness for me, it makes booting
without using framebuffer fail, IOW the kernel hangs:

Video mode to be used for restore is f00
BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 00000000000a0000 (usable)

b) After returning from blanking mode (via APM) to normal mode, no
character is drawn. Let's assume I'm using VIM when that happens:
After putting any character to return from blank mode, the screen stays
blanked apart from the cursor that _is_ shown. Now I'm able to move
the cursor, and when the cursor encounters a character, this char
is drawn (and keeps drawn). Though when I press Ctrl-L or when I go one line
above to the current top-line (i.e. by forcing a redrawn), the
whole screen is drawn properly.

c) instruction: | produces:
======================|==================
1. typing abc def | $ abc def
| ^ (<- cursor)
2. going three chars | $ abc def
ro the left | ^
3. pressing backspace | $ abcddef
| ^
4. pressing enter | -bash: abcdef: command not found
|

HTH.
--
cheers,
Tobias

2002-12-06 19:42:32

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [STATUS] fbdev api.

On Mon, Dec 02, 2002 at 09:07:33PM +0000, James Simmons wrote:
>
> Hi!
>
> I have a new patch avaiable. It is against 2.5.50. The patch is at

Any chance you could sync with linus again? fb in mainline is pretty
rotten..

2002-12-06 20:55:44

by Antonino A. Daplas

[permalink] [raw]
Subject: Re: [STATUS] fbdev api.

On Sat, 2002-12-07 at 00:42, Tobias Rittweiler wrote:
> Hello James,
>
> Monday, December 2, 2002, 10:07:33 PM, you wrote:
>
> JS> Hi!
>
> JS> I have a new patch avaiable. It is against 2.5.50. The patch is at
> JS> http://phoenix.infradead.org/~jsimmons/fbdev.diff.gz
>
> Besides the hunks posted recently, I encountered three problems/bugs:
>
> a) Although your patch fixes the FB oddness for me, it makes booting
> without using framebuffer fail, IOW the kernel hangs:
>
> Video mode to be used for restore is f00
> BIOS-provided physical RAM map:
> BIOS-e820: 0000000000000000 - 00000000000a0000 (usable)
>
Do you have framebuffer console enabled but with no framebuffer device
enabled at boot time? This will always fail with James' current patch.

The diff I submitted in one of my replies in this thread (fbcon.diff)
might fix that (not sure).

> b) After returning from blanking mode (via APM) to normal mode, no
> character is drawn. Let's assume I'm using VIM when that happens:
> After putting any character to return from blank mode, the screen stays
> blanked apart from the cursor that _is_ shown. Now I'm able to move
> the cursor, and when the cursor encounters a character, this char
> is drawn (and keeps drawn). Though when I press Ctrl-L or when I go one line
> above to the current top-line (i.e. by forcing a redrawn), the
> whole screen is drawn properly.
>
Can you try this?

diff -Naur linux-2.5.50-js/drivers/video/console/fbcon.c linux/drivers/video/console/fbcon.c
--- linux-2.5.50-js/drivers/video/console/fbcon.c 2002-12-06 23:33:56.000000000 +0000
+++ linux/drivers/video/console/fbcon.c 2002-12-06 23:33:18.000000000 +0000
@@ -1986,6 +1986,8 @@
vc->vc_cols);
vc->vc_video_erase_char = oldc;
}
+ else
+ update_screen(vc->vc_num);
return 0;
} else {
/* Tell console.c that it has to restore the screen itself */

> c) instruction: | produces:
> ======================|==================
> 1. typing abc def | $ abc def
> | ^ (<- cursor)
> 2. going three chars | $ abc def
> ro the left | ^
> 3. pressing backspace | $ abcddef
> | ^
> 4. pressing enter | -bash: abcdef: command not found
> |

I get this also. Seems to occur only with colored terms. When I do

set TERM=vt100

the problem disappears, so I thought this was an isolated case with my
setup :-). Similar glitches happen also in emacs with syntax
highlighting turned on.

Tony



2002-12-06 21:14:20

by James Simmons

[permalink] [raw]
Subject: Re: [STATUS] fbdev api.


> > Hi!
> >
> > I have a new patch avaiable. It is against 2.5.50. The patch is at
>
> Any chance you could sync with linus again? fb in mainline is pretty
> rotten..

I think the time has come. Alot of improvmenents have happened :-) The
final api for the low level drivers is done. Any further changes will be
in fbmem.c and fbcon. I just synced up the latest work.



2002-12-06 22:53:59

by Tobias Rittweiler

[permalink] [raw]
Subject: Re[2]: [STATUS] fbdev api.

Hello Antonino,

Saturday, December 7, 2002, 12:55:34 AM, you wrote:

>> a) Although your patch fixes the FB oddness for me, it makes booting
>> without using framebuffer fail, IOW the kernel hangs:
>>
>> Video mode to be used for restore is f00
>> BIOS-provided physical RAM map:
>> BIOS-e820: 0000000000000000 - 00000000000a0000 (usable)
>>
AD> Do you have framebuffer console enabled but with no framebuffer device
AD> enabled at boot time? This will always fail with James' current patch.

AD> The diff I submitted in one of my replies in this thread (fbcon.diff)
AD> might fix that (not sure).

Thanks, that patches fixes it.


>> b) After returning from blanking mode (via APM) to normal mode, no
>> character is drawn. Let's assume I'm using VIM when that happens:
>> After putting any character to return from blank mode, the screen stays
>> blanked apart from the cursor that _is_ shown. Now I'm able to move
>> the cursor, and when the cursor encounters a character, this char
>> is drawn (and keeps drawn). Though when I press Ctrl-L or when I go one line
>> above to the current top-line (i.e. by forcing a redrawn), the
>> whole screen is drawn properly.
>>
AD> Can you try this?
AD> [..diff..]

Yes, it fixes the problem, thanks.


>> c) instruction: | produces:
>> ======================|==================
>> 1. typing abc def | $ abc def
>> | ^ (<- cursor)
>> 2. going three chars | $ abc def
>> ro the left | ^
>> 3. pressing backspace | $ abcddef
>> | ^
>> 4. pressing enter | -bash: abcdef: command not found
>> |

AD> I get this also. Seems to occur only with colored terms. When I do

AD> set TERM=vt100

AD> the problem disappears, so I thought this was an isolated case with my
AD> setup :-). Similar glitches happen also in emacs with syntax
AD> highlighting turned on.

Still there.


AD> Tony
--
cheers,
Tobias

2002-12-06 23:43:36

by James Simmons

[permalink] [raw]
Subject: Re[2]: [STATUS] fbdev api.


> AD> Do you have framebuffer console enabled but with no framebuffer device
> AD> enabled at boot time? This will always fail with James' current patch.
>
> AD> The diff I submitted in one of my replies in this thread (fbcon.diff)
> AD> might fix that (not sure).
>
> Thanks, that patches fixes it.

The fix is in the latest BK tree as well so Linus will get the fix :-)

> >> b) After returning from blanking mode (via APM) to normal mode, no
> >> character is drawn. Let's assume I'm using VIM when that happens:
> >> After putting any character to return from blank mode, the screen stays
> >> blanked apart from the cursor that _is_ shown. Now I'm able to move
> >> the cursor, and when the cursor encounters a character, this char
> >> is drawn (and keeps drawn). Though when I press Ctrl-L or when I go one line
> >> above to the current top-line (i.e. by forcing a redrawn), the
> >> whole screen is drawn properly.
> >>
> AD> Can you try this?
> AD> [..diff..]
>
> Yes, it fixes the problem, thanks.

Will apply.

> AD> the problem disappears, so I thought this was an isolated case with my
> AD> setup :-). Similar glitches happen also in emacs with syntax
> AD> highlighting turned on.
>
> Still there.

????


2002-12-07 00:41:25

by James Simmons

[permalink] [raw]
Subject: Re: [STATUS] fbdev api.


> diff -Naur linux-2.5.50-js/drivers/video/console/fbcon.c linux/drivers/video/console/fbcon.c
> --- linux-2.5.50-js/drivers/video/console/fbcon.c 2002-12-06 23:33:56.000000000 +0000
> +++ linux/drivers/video/console/fbcon.c 2002-12-06 23:33:18.000000000 +0000
> @@ -1986,6 +1986,8 @@
> vc->vc_cols);
> vc->vc_video_erase_char = oldc;
> }
> + else
> + update_screen(vc->vc_num);
> return 0;
> } else {
> /* Tell console.c that it has to restore the screen itself */

Applied :-)



2002-12-07 07:22:05

by Antonino A. Daplas

[permalink] [raw]
Subject: Re: Re[2]: [STATUS] fbdev api.

On Sat, 2002-12-07 at 03:59, Tobias Rittweiler wrote:
[...]
> >> c) instruction: | produces:
> >> ======================|==================
> >> 1. typing abc def | $ abc def
> >> | ^ (<- cursor)
> >> 2. going three chars | $ abc def
> >> ro the left | ^
> >> 3. pressing backspace | $ abcddef
> >> | ^
> >> 4. pressing enter | -bash: abcdef: command not found
> >> |
>
> AD> I get this also. Seems to occur only with colored terms. When I do
>
> AD> set TERM=vt100
>
> AD> the problem disappears, so I thought this was an isolated case with my
> AD> setup :-). Similar glitches happen also in emacs with syntax
> AD> highlighting turned on.
>
> Still there.
>
Can you try this? It should fix the problem you mentioned as well as the
emacs glitch. Also, a quick fix for character map generation failures
(KDFONTOP ioctl), ie when selecting console fonts. Finally, if fbdev
supports blanking, let's use that.

diff -Naur linux-2.5.50-js/drivers/video/console/fbcon.c linux/drivers/video/console/fbcon.c
--- linux-2.5.50-js/drivers/video/console/fbcon.c 2002-12-07 10:10:40.000000000 +0000
+++ linux/drivers/video/console/fbcon.c 2002-12-07 10:12:11.000000000 +0000
@@ -357,7 +357,7 @@
area.dx = dx * vc->vc_font.width;
area.dy = dy * vc->vc_font.height;
area.height = height * vc->vc_font.height;
- area.width = width * vc->vc_font.height;
+ area.width = width * vc->vc_font.width;

info->fbops->fb_copyarea(info, &area);
}
@@ -910,6 +910,12 @@

info->var.xoffset = info->var.yoffset = p->yscroll = 0; /* reset wrap/pan */

+ /*
+ * FIXME: need to set this in order for KDFONTOP ioctl
+ * to work
+ */
+ p->fontwidthmask = FONTWIDTHRANGE(1,16);
+
for (i = 0; i < MAX_NR_CONSOLES; i++)
if (i != con && fb_display[i].fb_info == info &&
fb_display[i].conp && fb_display[i].fontdata)
@@ -1987,12 +1993,9 @@
else
update_screen(vc->vc_num);
return 0;
- } else {
- /* Tell console.c that it has to restore the screen itself */
- return 1;
- }
- fb_blank(blank, info);
- return 0;
+ }
+ else
+ return info->fbops->fb_blank(blank, info);
}

static void fbcon_free_font(struct display *p)

Tony

PS: James, can you also apply the following riva cleanup patch. It
fixes compile failures as well as removal of unused defines and
declarations.

Thanks.



Attachments:
rivafb.diff (2.83 kB)

2002-12-07 10:09:49

by Tobias Rittweiler

[permalink] [raw]
Subject: Re[4]: [STATUS] fbdev api.

Hello Antonino,

Saturday, December 7, 2002, 11:22:07 AM, you wrote:

>> >> c) instruction: | produces:
>> >> ======================|==================
>> >> 1. typing abc def | $ abc def
>> >> | ^ (<- cursor)
>> >> 2. going three chars | $ abc def
>> >> ro the left | ^
>> >> 3. pressing backspace | $ abcddef
>> >> | ^
>> >> 4. pressing enter | -bash: abcdef: command not found
>> >> |

AD> Can you try this? It should fix the problem you mentioned as well as the
AD> emacs glitch. Also, a quick fix for character map generation failures
AD> (KDFONTOP ioctl), ie when selecting console fonts. Finally, if fbdev
AD> supports blanking, let's use that.
AD> [..patch..]

Ah, good job! Now working at the shell prompt is usable again. Many
thanks for your time exposure.

AD> Tony
--
cheers,
Tobias

2002-12-07 18:04:49

by James Simmons

[permalink] [raw]
Subject: Re: Re[2]: [STATUS] fbdev api.


> diff -Naur linux-2.5.50-js/drivers/video/console/fbcon.c linux/drivers/video/console/fbcon.c
> --- linux-2.5.50-js/drivers/video/console/fbcon.c 2002-12-07 10:10:40.000000000 +0000
> +++ linux/drivers/video/console/fbcon.c 2002-12-07 10:12:11.000000000 +0000
> @@ -357,7 +357,7 @@
> area.dx = dx * vc->vc_font.width;
> area.dy = dy * vc->vc_font.height;
> area.height = height * vc->vc_font.height;
> - area.width = width * vc->vc_font.height;
> + area.width = width * vc->vc_font.width;
>
> info->fbops->fb_copyarea(info, &area);
> }

Ug!!! A nasty typo. Thanks.

> @@ -1987,12 +1993,9 @@
> else
> update_screen(vc->vc_num);
> return 0;
> - } else {
> - /* Tell console.c that it has to restore the screen itself */
> - return 1;
> - }
> - fb_blank(blank, info);
> - return 0;
> + }
> + else
> + return info->fbops->fb_blank(blank, info);
> }

Hm. I have something similiar. That code needs to be cleaned up.

> Tony
>
> PS: James, can you also apply the following riva cleanup patch. It
> fixes compile failures as well as removal of unused defines and
> declarations.

Most of those fixes I already have in BK. I think yres_virtual being
set to -1 is wrong. Also do we really need to call check var? The default
mode is "trusted". Also fb_find_mode when we use it calls check_var.
default_var already has the correct virtual res info. We do need to set
fix tho :-) Thanks for the fixes.

@@ -1566,6 +1540,16 @@
fb_find_mode(&info->var, info, mode_option,
NULL, 0, NULL, 8);
#endif
+
+ info->var.yres_virtual = -1;
+ info->var.xres_virtual = info->var.xres;
+ if (rivafb_check_var(&info->var, info))
+ return 1;
+
+ info->fix.line_length = (info->var.xres_virtual * (info->var.bits_per_pi
+ info->fix.visual = (info->var.bits_per_pixel == 8) ?
+ FB_VISUAL_PSEUDOCOLOR :
FB_VISUAL_DIRECTCOLOR;
+
return 0;


MS: (n) 1. A debilitating and surprisingly widespread affliction that
renders the sufferer barely able to perform the simplest task. 2. A disease.

James Simmons [[email protected]] ____/|
fbdev/console/gfx developer \ o.O|
http://www.linux-fbdev.org =(_)=
http://linuxgfx.sourceforge.net U
http://linuxconsole.sourceforge.net


2002-12-07 18:43:09

by Antonino A. Daplas

[permalink] [raw]
Subject: Re: Re[2]: [STATUS] fbdev api.

On Sun, 2002-12-08 at 00:05, James Simmons wrote:
[...]
> Most of those fixes I already have in BK. I think yres_virtual being
> set to -1 is wrong. Also do we really need to call check var? The default
> mode is "trusted". Also fb_find_mode when we use it calls check_var.
> default_var already has the correct virtual res info. We do need to set
> fix tho :-) Thanks for the fixes.
>
That's okay James, the code that calls check_var() during init is a
"temporary" code. Rivafb happens to have a do_maximize() function that
computes for the highest yres_virtual when it's -1. Currently, since
using fbset is broken, I do that to enable ypanning. But it's not
important.

Tony