summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Srb <msrb@suse.com>2012-05-03 17:55:24 +0200
committerZack Rusin <zackr@vmware.com>2012-05-03 13:11:42 -0400
commit840dcbf947dd9d1383777c3cd811ff680cef5f16 (patch)
treefb20d755c4e4f796e4646e12c911fb36d6882e13
parente925b2e6e9d548db5a6646a76d513fb6881f69b4 (diff)
Enable hardware access during vmmouse preinit.
Vmmouse driver uses outl calls but never requests hardware access. In case there are no other drivers that requests it, vmmouse initialization will fail. (Found on KVM virtual machine with fbdev graphics driver and vmmouse input driver.) Request hardware access in same way xf86-input-keyboard does. Signed-off-by: Zack Rusin <zackr@vmware.com>
-rw-r--r--src/vmmouse.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/vmmouse.c b/src/vmmouse.c
index 285ba26..7778923 100644
--- a/src/vmmouse.c
+++ b/src/vmmouse.c
@@ -65,6 +65,7 @@
#include "xf86Xinput.h"
#include "xf86_OSproc.h"
#include "xf86OSmouse.h"
+#include "xf86Priv.h"
#include "compiler.h"
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
@@ -339,6 +340,16 @@ VMMousePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
#endif
/*
+ * enable hardware access
+ */
+ if (!xorgHWAccess) {
+ if (xf86EnableIO())
+ xorgHWAccess = TRUE;
+ else
+ return NULL;
+ }
+
+ /*
* try to enable vmmouse here
*/
if (!VMMouseClient_Enable()) {
@@ -399,6 +410,16 @@ VMMousePreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
VMMousePrivPtr mPriv = NULL;
int rc = Success;
+ /* Enable hardware access. */
+ if (!xorgHWAccess) {
+ if (xf86EnableIO())
+ xorgHWAccess = TRUE;
+ else {
+ rc = BadValue;
+ goto error;
+ }
+ }
+
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
/* For ABI < 12, we need to return the wrapped driver's pInfo (see
* above). ABI 12, we call NIDR and are done */