Commit 8b8be51b authored by Thomas Hellstrom's avatar Thomas Hellstrom Committed by Dmitry Torokhov

Input: add vmmouse driver

VMMouse enables low-latency mouse-cursor-movements for VMWare and QEMU
guests.  By removing the guest cursor and using the host as a guest cursor
the cursor movement appears instant although in reality there is some lag.
To be able to do this, the host's view of the cursor position must exactly
match the guest's view and an absolute pointer device is needed. Enter the
VMMouse. While the VMMouse driver has historically been an Xorg user-space
driver, implementing it as a kernel imput driver enables rootless Xorg and
new compositing display servers for VMware guests.
Signed-off-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent b9bced0e
...@@ -10530,6 +10530,14 @@ L: linux-kernel@vger.kernel.org ...@@ -10530,6 +10530,14 @@ L: linux-kernel@vger.kernel.org
S: Maintained S: Maintained
F: drivers/misc/vmw_balloon.c F: drivers/misc/vmw_balloon.c
VMWARE VMMOUSE SUBDRIVER
M: "VMware Graphics" <linux-graphics-maintainer@vmware.com>
M: "VMware, Inc." <pv-drivers@vmware.com>
L: linux-input@vger.kernel.org
S: Maintained
F: drivers/input/mouse/vmmouse.c
F: drivers/input/mouse/vmmouse.h
VMWARE VMXNET3 ETHERNET DRIVER VMWARE VMXNET3 ETHERNET DRIVER
M: Shreyas Bhatewara <sbhatewara@vmware.com> M: Shreyas Bhatewara <sbhatewara@vmware.com>
M: "VMware, Inc." <pv-drivers@vmware.com> M: "VMware, Inc." <pv-drivers@vmware.com>
......
...@@ -149,6 +149,18 @@ config MOUSE_PS2_FOCALTECH ...@@ -149,6 +149,18 @@ config MOUSE_PS2_FOCALTECH
If unsure, say Y. If unsure, say Y.
config MOUSE_PS2_VMMOUSE
bool "Virtual mouse (vmmouse)"
depends on MOUSE_PS2 && X86 && HYPERVISOR_GUEST
help
Say Y here if you are running under control of VMware hypervisor
(ESXi, Workstation or Fusion). Also make sure that when you enable
this option, you remove the xf86-input-vmmouse user-space driver
or upgrade it to at least xf86-input-vmmouse 13.0.1, which doesn't
load in the presence of an in-kernel vmmouse driver.
If unsure, say N.
config MOUSE_SERIAL config MOUSE_SERIAL
tristate "Serial mouse" tristate "Serial mouse"
select SERIO select SERIO
......
...@@ -36,6 +36,7 @@ psmouse-$(CONFIG_MOUSE_PS2_SENTELIC) += sentelic.o ...@@ -36,6 +36,7 @@ psmouse-$(CONFIG_MOUSE_PS2_SENTELIC) += sentelic.o
psmouse-$(CONFIG_MOUSE_PS2_TRACKPOINT) += trackpoint.o psmouse-$(CONFIG_MOUSE_PS2_TRACKPOINT) += trackpoint.o
psmouse-$(CONFIG_MOUSE_PS2_TOUCHKIT) += touchkit_ps2.o psmouse-$(CONFIG_MOUSE_PS2_TOUCHKIT) += touchkit_ps2.o
psmouse-$(CONFIG_MOUSE_PS2_CYPRESS) += cypress_ps2.o psmouse-$(CONFIG_MOUSE_PS2_CYPRESS) += cypress_ps2.o
psmouse-$(CONFIG_MOUSE_PS2_VMMOUSE) += vmmouse.o
elan_i2c-objs := elan_i2c_core.o elan_i2c-objs := elan_i2c_core.o
elan_i2c-$(CONFIG_MOUSE_ELAN_I2C_I2C) += elan_i2c_i2c.o elan_i2c-$(CONFIG_MOUSE_ELAN_I2C_I2C) += elan_i2c_i2c.o
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "sentelic.h" #include "sentelic.h"
#include "cypress_ps2.h" #include "cypress_ps2.h"
#include "focaltech.h" #include "focaltech.h"
#include "vmmouse.h"
#define DRIVER_DESC "PS/2 mouse driver" #define DRIVER_DESC "PS/2 mouse driver"
...@@ -790,6 +791,13 @@ static int psmouse_extensions(struct psmouse *psmouse, ...@@ -790,6 +791,13 @@ static int psmouse_extensions(struct psmouse *psmouse,
} }
} }
if (psmouse_do_detect(vmmouse_detect, psmouse, set_properties) == 0) {
if (max_proto > PSMOUSE_IMEX) {
if (!set_properties || vmmouse_init(psmouse) == 0)
return PSMOUSE_VMMOUSE;
}
}
/* /*
* Try Kensington ThinkingMouse (we try first, because synaptics probe * Try Kensington ThinkingMouse (we try first, because synaptics probe
* upsets the thinkingmouse). * upsets the thinkingmouse).
...@@ -1112,6 +1120,15 @@ static const struct psmouse_protocol psmouse_protocols[] = { ...@@ -1112,6 +1120,15 @@ static const struct psmouse_protocol psmouse_protocols[] = {
.detect = focaltech_detect, .detect = focaltech_detect,
.init = focaltech_init, .init = focaltech_init,
}, },
#endif
#ifdef CONFIG_MOUSE_PS2_VMMOUSE
{
.type = PSMOUSE_VMMOUSE,
.name = VMMOUSE_PSNAME,
.alias = "vmmouse",
.detect = vmmouse_detect,
.init = vmmouse_init,
},
#endif #endif
{ {
.type = PSMOUSE_AUTO, .type = PSMOUSE_AUTO,
......
...@@ -103,6 +103,7 @@ enum psmouse_type { ...@@ -103,6 +103,7 @@ enum psmouse_type {
PSMOUSE_SYNAPTICS_RELATIVE, PSMOUSE_SYNAPTICS_RELATIVE,
PSMOUSE_CYPRESS, PSMOUSE_CYPRESS,
PSMOUSE_FOCALTECH, PSMOUSE_FOCALTECH,
PSMOUSE_VMMOUSE,
PSMOUSE_AUTO /* This one should always be last */ PSMOUSE_AUTO /* This one should always be last */
}; };
......
This diff is collapsed.
/*
* Driver for Virtual PS/2 Mouse on VMware and QEMU hypervisors.
*
* Copyright (C) 2014, VMware, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*/
#ifndef _VMMOUSE_H
#define _VMMOUSE_H
#ifdef CONFIG_MOUSE_PS2_VMMOUSE
#define VMMOUSE_PSNAME "VirtualPS/2"
int vmmouse_detect(struct psmouse *psmouse, bool set_properties);
int vmmouse_init(struct psmouse *psmouse);
#else
static inline int vmmouse_detect(struct psmouse *psmouse, bool set_properties)
{
return -ENOSYS;
}
static inline int vmmouse_init(struct psmouse *psmouse)
{
return -ENOSYS;
}
#endif
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment