disable HW pointer acceleration

This commit is contained in:
Vadim Rozenfeld 2014-08-18 23:08:42 +10:00
parent 7a701b755e
commit d2d1b4ddd5
2 changed files with 27 additions and 31 deletions

View File

@ -396,7 +396,7 @@ NTSTATUS QxlDod::QueryAdapterInfo(_In_ CONST DXGKARG_QUERYADAPTERINFO* pQueryAda
pDriverCaps->WDDMVersion = DXGKDDI_WDDMv1_2;
pDriverCaps->HighestAcceptableAddress.QuadPart = -1;
if (m_pHWDevice->GetType() == DEVICE_QXL) {
if (m_pHWDevice->EnablePointer()) {
pDriverCaps->MaxPointerWidth = POINTER_SIZE;
pDriverCaps->MaxPointerHeight = POINTER_SIZE;
pDriverCaps->PointerCaps.Monochrome = 1;
@ -4196,6 +4196,19 @@ NTSTATUS QxlDevice::HWClose(void)
NTSTATUS QxlDevice::SetPointerShape(_In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape)
{
DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s flag = %x\n", __FUNCTION__, pSetPointerShape->Flags.Value));
DbgPrint(TRACE_LEVEL_INFORMATION, ("<--> %s flag = %d pitch = %d, pixels = %p, id = %d, w = %d, h = %d, x = %d, y = %d\n", __FUNCTION__,
pSetPointerShape->Flags.Value,
pSetPointerShape->Pitch,
pSetPointerShape->pPixels,
pSetPointerShape->VidPnSourceId,
pSetPointerShape->Width,
pSetPointerShape->Height,
pSetPointerShape->XHot,
pSetPointerShape->YHot));
if (!EnablePointer() || (!pSetPointerShape->Flags.Monochrome && !pSetPointerShape->Flags.Color))
return STATUS_UNSUCCESSFUL;
QXLCursorCmd *cursor_cmd;
InternalCursor *internal;
QXLCursor *cursor;
@ -4208,18 +4221,6 @@ NTSTATUS QxlDevice::SetPointerShape(_In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPoi
UINT8 *end;
int line_size;
DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s flag = %x\n", __FUNCTION__, pSetPointerShape->Flags.Value));
DbgPrint(TRACE_LEVEL_INFORMATION, ("<--> %s flag = %d pitch = %d, pixels = %p, id = %d, w = %d, h = %d, x = %d, y = %d\n", __FUNCTION__,
pSetPointerShape->Flags.Value,
pSetPointerShape->Pitch,
pSetPointerShape->pPixels,
pSetPointerShape->VidPnSourceId,
pSetPointerShape->Width,
pSetPointerShape->Height,
pSetPointerShape->XHot,
pSetPointerShape->YHot));
if (!pSetPointerShape->Flags.Monochrome && !pSetPointerShape->Flags.Color)
return STATUS_UNSUCCESSFUL;
cursor_cmd = CursorCmd();
cursor_cmd->type = QXL_CURSOR_SET;
@ -4278,22 +4279,23 @@ NTSTATUS QxlDevice::SetPointerShape(_In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPoi
NTSTATUS QxlDevice::SetPointerPosition(_In_ CONST DXGKARG_SETPOINTERPOSITION* pSetPointerPosition)
{
QXLCursorCmd *cursor_cmd;
DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
DbgPrint(TRACE_LEVEL_INFORMATION, ("<--> %s flag = %d id = %d, x = %d, y = %d\n", __FUNCTION__,
pSetPointerPosition->Flags.Value,
pSetPointerPosition->VidPnSourceId,
pSetPointerPosition->X,
pSetPointerPosition->Y));
cursor_cmd = CursorCmd();
if (pSetPointerPosition->X < 0) {
cursor_cmd->type = QXL_CURSOR_HIDE;
} else {
cursor_cmd->type = QXL_CURSOR_MOVE;
cursor_cmd->u.position.x = (INT16)pSetPointerPosition->X;
cursor_cmd->u.position.y = (INT16)pSetPointerPosition->Y;
if (EnablePointer()) {
QXLCursorCmd *cursor_cmd = CursorCmd();
if (pSetPointerPosition->X < 0) {
cursor_cmd->type = QXL_CURSOR_HIDE;
} else {
cursor_cmd->type = QXL_CURSOR_MOVE;
cursor_cmd->u.position.x = (INT16)pSetPointerPosition->X;
cursor_cmd->u.position.y = (INT16)pSetPointerPosition->Y;
}
PushCursorCmd(cursor_cmd);
}
PushCursorCmd(cursor_cmd);
DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
return STATUS_SUCCESS;
}

View File

@ -209,12 +209,6 @@ typedef struct _CURRENT_BDD_MODE
class QxlDod;
enum DevType {
DEVICE_INTERFACE,
DEVICE_VGA,
DEVICE_QXL
};
class HwDeviceIntrface {
public:
virtual NTSTATUS QueryCurrentMode(PVIDEO_MODE RequestedMode) = 0;
@ -232,7 +226,7 @@ public:
USHORT GetModeNumber(USHORT idx) {return m_ModeNumbers[idx];}
USHORT GetCurrentModeIndex(void) {return m_CurrentMode;}
VOID SetCurrentModeIndex(USHORT idx) {m_CurrentMode = idx;}
DevType GetType(void) { return DEVICE_INTERFACE;}
virtual BOOLEAN EnablePointer(void) = 0;
virtual NTSTATUS ExecutePresentDisplayOnly(_In_ BYTE* DstAddr,
_In_ UINT DstBitPerPixel,
_In_ BYTE* SrcAddr,
@ -270,7 +264,7 @@ public:
NTSTATUS SetPowerState(DEVICE_POWER_STATE DevicePowerState, DXGK_DISPLAY_INFORMATION* pDispInfo);
NTSTATUS HWInit(PCM_RESOURCE_LIST pResList, DXGK_DISPLAY_INFORMATION* pDispInfo);
NTSTATUS HWClose(void);
DevType GetType(void) { return DEVICE_VGA;}
BOOLEAN EnablePointer(void) { return FALSE; }
NTSTATUS ExecutePresentDisplayOnly(_In_ BYTE* DstAddr,
_In_ UINT DstBitPerPixel,
_In_ BYTE* SrcAddr,
@ -423,7 +417,7 @@ public:
NTSTATUS SetPowerState(DEVICE_POWER_STATE DevicePowerState, DXGK_DISPLAY_INFORMATION* pDispInfo);
NTSTATUS HWInit(PCM_RESOURCE_LIST pResList, DXGK_DISPLAY_INFORMATION* pDispInfo);
NTSTATUS HWClose(void);
DevType GetType(void) { return DEVICE_QXL;}
BOOLEAN EnablePointer(void) { return FALSE; }
NTSTATUS ExecutePresentDisplayOnly(_In_ BYTE* DstAddr,
_In_ UINT DstBitPerPixel,
_In_ BYTE* SrcAddr,