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>
This commit is contained in:
Michal Srb
2012-05-03 17:55:24 +02:00
committed by Zack Rusin
parent e925b2e6e9
commit 840dcbf947

View File

@@ -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
@@ -338,6 +339,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
*/
@@ -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 */