linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* fbcon has a empty unimap after boot
@ 2003-09-12 11:07 Mario Lang
  2003-09-12 18:09 ` James Simmons
  0 siblings, 1 reply; 2+ messages in thread
From: Mario Lang @ 2003-09-12 11:07 UTC (permalink / raw)
  To: linux-fbdev-devel; +Cc: jsimmons, geert

Hi.

I noticed that with 2.6.0 kernels, when using fbcon
(with the sisfb driver in my case, using a Sis630 card), the
ioctl GIO_UNIMAP returns a empty unimap.
This results in problems for BRLTTY[1], which relies
on a valid unimap to back-translate the font-positions of
/dev/vcsa to the actual characters used.

Further digging showed that this problems has probably gone
unnoticed because there is a special case in
drivers/char/consolemap.c:conv_uni_to_pc which returns -3 when
there is no unimap available.  This -3 return value
is caught in drivers/char/vt.c:do_con_write like this:

                        tc = conv_uni_to_pc(vc_cons[currcons].d, tc);
                        ...
                        } else if ( tc == -3 ) {
                                /* Bad hash table -- hope for the best */
                                tc = c;
                        }

This is why I think the uninitialized unimap did go
unnoticed, since this code will make things work for
standard iso-8859 type of charsets.

However, user space apps which rely on GIO_UNIMAP do not
work correctly, and in general, I think I18N should be broken
on fbcon currently.

I have a very crude patch which works for me here, but I
am not sure if this is the right way to fix this.
Anyway, it is attached.  Note that I am very new to
kernel hacking, so my analysis of the problem might be
bogus, but I do think I am on the right track...

--- linux-2.6.0-test4/drivers/video/console/fbcon.c.orig        2003-09-03 15:32:42.000000000 +0200
+++ linux-2.6.0-test4/drivers/video/console/fbcon.c     2003-09-03 15:27:09.000000000 +0200
@@ -695,6 +695,7 @@
                fb_display[unit].scrollmode = SCROLL_YNOMOVE;
        else
                fb_display[unit].scrollmode = SCROLL_YREDRAW;
+       con_set_default_unimap(unit);
        fbcon_set_display(vc, init, !init);
 }


[1] http://mielke.cc/brltty/

-- 
CYa,
  Mario | Debian Developer <URL:http://debian.org/>
        | Get my public key via finger mlang@db.debian.org
        | 1024D/7FC1A0854909BCCDBE6C102DDFFC022A6B113E44


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: fbcon has a empty unimap after boot
  2003-09-12 11:07 fbcon has a empty unimap after boot Mario Lang
@ 2003-09-12 18:09 ` James Simmons
  0 siblings, 0 replies; 2+ messages in thread
From: James Simmons @ 2003-09-12 18:09 UTC (permalink / raw)
  To: Mario Lang; +Cc: linux-fbdev-devel, geert


Thanks. Applying.


On Fri, 12 Sep 2003, Mario Lang wrote:

> Hi.
> 
> I noticed that with 2.6.0 kernels, when using fbcon
> (with the sisfb driver in my case, using a Sis630 card), the
> ioctl GIO_UNIMAP returns a empty unimap.
> This results in problems for BRLTTY[1], which relies
> on a valid unimap to back-translate the font-positions of
> /dev/vcsa to the actual characters used.
> 
> Further digging showed that this problems has probably gone
> unnoticed because there is a special case in
> drivers/char/consolemap.c:conv_uni_to_pc which returns -3 when
> there is no unimap available.  This -3 return value
> is caught in drivers/char/vt.c:do_con_write like this:
> 
>                         tc = conv_uni_to_pc(vc_cons[currcons].d, tc);
>                         ...
>                         } else if ( tc == -3 ) {
>                                 /* Bad hash table -- hope for the best */
>                                 tc = c;
>                         }
> 
> This is why I think the uninitialized unimap did go
> unnoticed, since this code will make things work for
> standard iso-8859 type of charsets.
> 
> However, user space apps which rely on GIO_UNIMAP do not
> work correctly, and in general, I think I18N should be broken
> on fbcon currently.
> 
> I have a very crude patch which works for me here, but I
> am not sure if this is the right way to fix this.
> Anyway, it is attached.  Note that I am very new to
> kernel hacking, so my analysis of the problem might be
> bogus, but I do think I am on the right track...
> 
> --- linux-2.6.0-test4/drivers/video/console/fbcon.c.orig        2003-09-03 15:32:42.000000000 +0200
> +++ linux-2.6.0-test4/drivers/video/console/fbcon.c     2003-09-03 15:27:09.000000000 +0200
> @@ -695,6 +695,7 @@
>                 fb_display[unit].scrollmode = SCROLL_YNOMOVE;
>         else
>                 fb_display[unit].scrollmode = SCROLL_YREDRAW;
> +       con_set_default_unimap(unit);
>         fbcon_set_display(vc, init, !init);
>  }
> 
> 
> [1] http://mielke.cc/brltty/
> 
> 



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-09-12 18:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-12 11:07 fbcon has a empty unimap after boot Mario Lang
2003-09-12 18:09 ` James Simmons

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).