From: "Kasai Takanori" Subject: [Patch] Fix keymap support for PVFB. Date: Mon, 2 Jul 2007 19:51:36 +0900 Message-ID: <06bd01c7bc96$f8a38210$dab2220a@VF03007L> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_06BA_01C7BCE2.661CE930" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. ------=_NextPart_000_06BA_01C7BCE2.661CE930 Content-Type: text/plain; format=flowed; charset="iso-2022-jp"; reply-type=original Content-Transfer-Encoding: 7bit Hi All, We had added the patch to support the keymap with PVFB before. When the keymap is specified with vncfb, it converts it as a keyboard of the setting. When the keymap is not specified, it is converted as en-us. Configuration file : keymap="ja" It converts to keycode from keysym on the BackEnd side. The converted keycode is transmitted to the FrontEnd side. Next, the keycode is received on the FrontEnd side of PVFB, and it passes to GuestOS. It is not correctly converted because there is not the conversion processing of keyboard driver for the GuestOS. Therefore, the conversion processing by the keyboard driver is done on the BackEnd side now. However, I think that it should do this with xenkbd who is originally the driver on the FrontEnd side. It will be problem if the HVM domain is working on PVFB in the future. For HVM domain, The keycode that the keyboard driver on guest OS received from qemu-dm is converted. It will convert further in the HVM domain when converting it with PVFB beforehand, and a correct key cannot be input. This patch transplanted the conversion processing of the keyboard driver on the GuestOS side to xenkbd. We are not supporting the keymap for sdl because we do not understand sdl in detail. Signed-off-by: Takanori Kasai Signed-off-by: Junko Ichino Best Regards, -- Takanori Kasai ------=_NextPart_000_06BA_01C7BCE2.661CE930 Content-Type: application/octet-stream; name="fix-fbfront-xenkbd-driver.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="fix-fbfront-xenkbd-driver.patch" # HG changeset patch=0A= # User kasai.takanori@jp.fujitsu.com=0A= # Date 1183365791 -32400=0A= # Node ID 287d57be6345ec0ed9dd8e110078d4870e8301bc=0A= # Parent 0be610b725fae4cd6de8f0b111660a186f93b86d=0A= Fix keymap support for PVFB.=0A= - Keyboard driver's conversion processing is added. (atkbd.c)=0A= =0A= Signed-off-by: Takanori Kasai =0A= Signed-off-by: Junko Ichino =0A= =0A= diff -r 0be610b725fa -r 287d57be6345 drivers/xen/fbfront/xenkbd.c=0A= --- a/drivers/xen/fbfront/xenkbd.c Wed Jun 27 16:31:36 2007 +0100=0A= +++ b/drivers/xen/fbfront/xenkbd.c Mon Jul 02 17:43:11 2007 +0900=0A= @@ -36,6 +36,43 @@ struct xenkbd_info=0A= struct xenbus_device *xbdev;=0A= char phys[32];=0A= };=0A= +=0A= +static unsigned char atkbd_set2_keycode[512] =3D {=0A= +=0A= + 0, 67, 65, 63, 61, 59, 60, 88, 0, 68, 66, 64, 62, 15, 41,117,=0A= + 0, 56, 42, 93, 29, 16, 2, 0, 0, 0, 44, 31, 30, 17, 3, 0,=0A= + 0, 46, 45, 32, 18, 5, 4, 95, 0, 57, 47, 33, 20, 19, 6,183,=0A= + 0, 49, 48, 35, 34, 21, 7,184, 0, 0, 50, 36, 22, 8, 9,185,=0A= + 0, 51, 37, 23, 24, 11, 10, 0, 0, 52, 53, 38, 39, 25, 12, 0,=0A= + 0, 89, 40, 0, 26, 13, 0, 0, 58, 54, 28, 27, 0, 43, 0, 85,=0A= + 0, 86, 91, 90, 92, 0, 14, 94, 0, 79,124, 75, 71,121, 0, 0,=0A= + 82, 83, 80, 76, 77, 72, 1, 69, 87, 78, 81, 74, 55, 73, 70, 99,=0A= +=0A= + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,=0A= + 217,100,255, 0, 97,165, 0, 0,156, 0, 0, 0, 0, 0, 0,125,=0A= + 173,114, 0,113, 0, 0, 0,126,128, 0, 0,140, 0, 0, 0,127,=0A= + 159, 0,115, 0,164, 0, 0,116,158, 0,150,166, 0, 0, 0,142,=0A= + 157, 0, 0, 0, 0, 0, 0, 0,155, 0, 98, 0, 0,163, 0, 0,=0A= + 226, 0, 0, 0, 0, 0, 0, 0, 0,255, 96, 0, 0, 0,143, 0,=0A= + 0, 0, 0, 0, 0, 0, 0, 0, 0,107, 0,105,102, 0, 0,112,=0A= + 110,111,108,112,106,103, 0,119, 0,118,109, 0, 99,104,119, 0,=0A= +=0A= +};=0A= +=0A= +static unsigned char atkbd_unxlate_table[128] =3D {=0A= +=0A= + 0,118, 22, 30, 38, 37, 46, 54, 61, 62, 70, 69, 78, 85,102, 13,=0A= + 21, 29, 36, 45, 44, 53, 60, 67, 68, 77, 84, 91, 90, 20, 28, 27,=0A= + 35, 43, 52, 51, 59, 66, 75, 76, 82, 14, 18, 93, 26, 34, 33, 42,=0A= + 50, 49, 58, 65, 73, 74, 89,124, 17, 41, 88, 5, 6, 4, 12, 3,=0A= + 11, 2, 10, 1, 9,119,126,108,117,125,123,107,115,116,121,105,=0A= + 114,122,112,113,127, 96, 97,120, 7, 15, 23, 31, 39, 47, 55, 63,=0A= + 71, 79, 86, 94, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 87,111,=0A= + 19, 25, 57, 81, 83, 92, 95, 98, 99,100,101,103,104,106,109,110=0A= +=0A= +};=0A= +=0A= +unsigned char keycode_table[512];=0A= =0A= static int xenkbd_remove(struct xenbus_device *);=0A= static int xenkbd_connect_backend(struct xenbus_device *, struct = xenkbd_info *);=0A= @@ -74,7 +111,7 @@ static irqreturn_t input_handler(int rq,=0A= if (test_bit(event->key.keycode, info->ptr->keybit))=0A= dev =3D info->ptr;=0A= if (dev)=0A= - input_report_key(dev, event->key.keycode,=0A= + input_report_key(dev, keycode_table[event->key.keycode],=0A= event->key.pressed);=0A= else=0A= printk("xenkbd: unhandled keycode 0x%x\n",=0A= @@ -139,6 +176,12 @@ int __devinit xenkbd_probe(struct xenbus=0A= goto error;=0A= }=0A= info->kbd =3D kbd;=0A= +=0A= + for (i =3D 0; i < 128; i++) {=0A= + keycode_table[i] =3D atkbd_set2_keycode[atkbd_unxlate_table[i]];=0A= + keycode_table[i | 0x80] =3D=0A= + atkbd_set2_keycode[atkbd_unxlate_table[i] | 0x80];=0A= + }=0A= =0A= /* pointing device */=0A= ptr =3D input_allocate_device();=0A= ------=_NextPart_000_06BA_01C7BCE2.661CE930 Content-Type: application/octet-stream; name="fix-tools-vncfb-keymap.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="fix-tools-vncfb-keymap.patch" # HG changeset patch=0A= # User kasai.takanori@jp.fujitsu.com=0A= # Date 1183365586 -32400=0A= # Node ID f58b42f513ff9665bba107dfff9ae4000342befd=0A= # Parent ba0c7d3800ead37bd06171421e0254078de3cb53=0A= Fix keymap support for PVFB.=0A= - Keyboard driver's conversion processing is deleted.=0A= It is added to xenkbd driver on FrontEnd. =0A= =0A= Signed-off-by: Takanori Kasai =0A= Signed-off-by: Junko Ichino =0A= =0A= diff -r ba0c7d3800ea -r f58b42f513ff tools/xenfb/vncfb.c=0A= --- a/tools/xenfb/vncfb.c Mon Jul 02 14:20:54 2007 +0900=0A= +++ b/tools/xenfb/vncfb.c Mon Jul 02 17:39:46 2007 +0900=0A= @@ -17,43 +17,6 @@ static const char *bios_dir =3D "/usr/shar=0A= #include "vnc_keysym.h"=0A= #include "keymaps.c"=0A= =0A= -static unsigned char atkbd_set2_keycode[512] =3D {=0A= -=0A= - 0, 67, 65, 63, 61, 59, 60, 88, 0, 68, 66, 64, 62, 15, 41,117,=0A= - 0, 56, 42, 93, 29, 16, 2, 0, 0, 0, 44, 31, 30, 17, 3, 0,=0A= - 0, 46, 45, 32, 18, 5, 4, 95, 0, 57, 47, 33, 20, 19, 6,183,=0A= - 0, 49, 48, 35, 34, 21, 7,184, 0, 0, 50, 36, 22, 8, 9,185,=0A= - 0, 51, 37, 23, 24, 11, 10, 0, 0, 52, 53, 38, 39, 25, 12, 0,=0A= - 0, 89, 40, 0, 26, 13, 0, 0, 58, 54, 28, 27, 0, 43, 0, 85,=0A= - 0, 86, 91, 90, 92, 0, 14, 94, 0, 79,124, 75, 71,121, 0, 0,=0A= - 82, 83, 80, 76, 77, 72, 1, 69, 87, 78, 81, 74, 55, 73, 70, 99,=0A= -=0A= - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,=0A= - 217,100,255, 0, 97,165, 0, 0,156, 0, 0, 0, 0, 0, 0,125,=0A= - 173,114, 0,113, 0, 0, 0,126,128, 0, 0,140, 0, 0, 0,127,=0A= - 159, 0,115, 0,164, 0, 0,116,158, 0,150,166, 0, 0, 0,142,=0A= - 157, 0, 0, 0, 0, 0, 0, 0,155, 0, 98, 0, 0,163, 0, 0,=0A= - 226, 0, 0, 0, 0, 0, 0, 0, 0,255, 96, 0, 0, 0,143, 0,=0A= - 0, 0, 0, 0, 0, 0, 0, 0, 0,107, 0,105,102, 0, 0,112,=0A= - 110,111,108,112,106,103, 0,119, 0,118,109, 0, 99,104,119, 0,=0A= -=0A= -};=0A= -=0A= -static unsigned char atkbd_unxlate_table[128] =3D {=0A= -=0A= - 0,118, 22, 30, 38, 37, 46, 54, 61, 62, 70, 69, 78, 85,102, 13,=0A= - 21, 29, 36, 45, 44, 53, 60, 67, 68, 77, 84, 91, 90, 20, 28, 27,=0A= - 35, 43, 52, 51, 59, 66, 75, 76, 82, 14, 18, 93, 26, 34, 33, 42,=0A= - 50, 49, 58, 65, 73, 74, 89,124, 17, 41, 88, 5, 6, 4, 12, 3,=0A= - 11, 2, 10, 1, 9,119,126,108,117,125,123,107,115,116,121,105,=0A= - 114,122,112,113,127, 96, 97,120, 7, 15, 23, 31, 39, 47, 55, 63,=0A= - 71, 79, 86, 94, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 87,111,=0A= - 19, 25, 57, 81, 83, 92, 95, 98, 99,100,101,103,104,106,109,110=0A= -=0A= -};=0A= -=0A= -unsigned char keycode_table[512];=0A= -=0A= static void *kbd_layout;=0A= =0A= static int btnmap[] =3D {=0A= @@ -79,7 +42,7 @@ static void on_kbd_event(rfbBool down, r=0A= if (keycode >=3D 'A' && keycode <=3D 'Z')=0A= keycode +=3D 'a' - 'A';=0A= =0A= - scancode =3D keycode_table[keysym2scancode(kbd_layout, keycode)];=0A= + scancode =3D keysym2scancode(kbd_layout, keycode);=0A= if (scancode =3D=3D 0)=0A= return;=0A= if (xenfb_send_key(xenfb, down, scancode) < 0)=0A= @@ -308,12 +271,6 @@ int main(int argc, char **argv)=0A= exit(1);=0A= }=0A= =0A= - for (i =3D 0; i < 128; i++) {=0A= - keycode_table[i] =3D atkbd_set2_keycode[atkbd_unxlate_table[i]];=0A= - keycode_table[i | 0x80] =3D =0A= - atkbd_set2_keycode[atkbd_unxlate_table[i] | 0x80];=0A= - }=0A= -=0A= fake_argv[2] =3D portstr;=0A= =0A= if (title !=3D NULL)=0A= ------=_NextPart_000_06BA_01C7BCE2.661CE930 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel ------=_NextPart_000_06BA_01C7BCE2.661CE930--