X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_module%2Fiface-graphics-console.c;h=6744cfd5bcc04b279bebb89374758433873ae496;hb=8cd246c3830733c2850cef049a7ad153daf0dd13;hp=ec965fdaefa2adbd0d8b2d15bed4e775fcb2abb7;hpb=552fecf4926019f08e3b20f66e53917527c40e04;p=palacios.git diff --git a/linux_module/iface-graphics-console.c b/linux_module/iface-graphics-console.c index ec965fd..6744cfd 100644 --- a/linux_module/iface-graphics-console.c +++ b/linux_module/iface-graphics-console.c @@ -22,7 +22,6 @@ #include "linux-exts.h" #include "vm.h" -#include /* @@ -107,7 +106,7 @@ static v3_graphics_console_t g_open(void * priv_data, DEBUG("palacios: allocating %u bytes for %u by %u by %u buffer\n", mem, desired_spec->width, desired_spec->height, desired_spec->bytes_per_pixel); - gc->data = vmalloc(mem); + gc->data = palacios_valloc(mem); if (!(gc->data)) { ERROR("palacios: unable to allocate memory for frame buffer\n"); @@ -149,7 +148,7 @@ static void g_close(v3_graphics_console_t cons) return; } if (gc->data) { - vfree(gc->data); + palacios_vfree(gc->data); gc->data=0; } } @@ -254,7 +253,7 @@ static int palacios_graphics_console_key(struct v3_guest * guest, struct palacios_graphics_console *cons, uint8_t scancode) { - struct v3_keyboard_event e; + struct v3_keyboard_event e; e.status = 0; e.scan_code = scancode; @@ -269,15 +268,20 @@ static int palacios_graphics_console_key(struct v3_guest * guest, static int palacios_graphics_console_mouse(struct v3_guest * guest, struct palacios_graphics_console *cons, - uint8_t x, uint8_t y, uint8_t buttons) + uint8_t sx, uint8_t dx, + uint8_t sy, uint8_t dy, + uint8_t buttons) { + struct v3_mouse_event e; - e.data[0]=x; - e.data[1]=y; - e.data[2]=buttons; // These three are completely wrong, of course - ignoring mouse for now - // mouse delivery is broken, so don't do it. - // v3_deliver_mouse_event(guest->v3_ctx,&e); + e.sx=sx; + e.dx=dx; + e.sy=sy; + e.dy=dy; + e.buttons=buttons; + + v3_deliver_mouse_event(guest->v3_ctx,&e); return 0; } @@ -316,7 +320,7 @@ static int graphics_console_deinit( void ) { list_del(&(gc->gcons_node)); if (gc->data) - vfree(gc->data); + palacios_vfree(gc->data); palacios_free(gc); } @@ -431,8 +435,7 @@ static int fb_input(struct v3_guest * guest, } if ((inp.data_type == V3_FB_MOUSE) || (inp.data_type == V3_FB_BOTH)) { - rc |= palacios_graphics_console_mouse(guest, cons, inp.mouse_data[0], - inp.mouse_data[1], inp.mouse_data[2]); + rc |= palacios_graphics_console_mouse(guest, cons, inp.sx, inp.dx, inp.sy, inp.dy, inp.buttons); //DEBUG("palacios: mouse delivered to palacios\n"); } @@ -472,10 +475,14 @@ static int graphics_console_guest_deinit(struct v3_guest * guest, void * vm_data list_del(&(graphics_cons->gcons_node)); + remove_guest_ctrl(guest, V3_VM_FB_INPUT); + remove_guest_ctrl(guest, V3_VM_FB_QUERY); + if (graphics_cons->data) { - vfree(graphics_cons->data); + palacios_vfree(graphics_cons->data); } + palacios_free(graphics_cons); return 0;