qxl-wddm-dod: Enable hardware pointer acceleration

Windows disables hw pointer acceleration and draws the cursor
in frame buffer if the driver does not report pointer capabilities
in QueryAdapterInfo. In this mode OS usually does not send pointer
commands to the driver or does it with pointer set to invisible
state. This mode of operation consumes CPU time and device-to-host
traffic. Now we enable pointer hardware acceleration.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
Yuri Benditovich 2016-11-18 15:49:56 +02:00 committed by Frediano Ziglio
parent 3fe5c540f7
commit da0680c8d5
2 changed files with 13 additions and 20 deletions

View File

@ -406,12 +406,10 @@ NTSTATUS QxlDod::QueryAdapterInfo(_In_ CONST DXGKARG_QUERYADAPTERINFO* pQueryAda
pDriverCaps->WDDMVersion = DXGKDDI_WDDMv1_2; pDriverCaps->WDDMVersion = DXGKDDI_WDDMv1_2;
pDriverCaps->HighestAcceptableAddress.QuadPart = -1; pDriverCaps->HighestAcceptableAddress.QuadPart = -1;
if (m_pHWDevice->EnablePointer()) { pDriverCaps->MaxPointerWidth = POINTER_SIZE;
pDriverCaps->MaxPointerWidth = POINTER_SIZE; pDriverCaps->MaxPointerHeight = POINTER_SIZE;
pDriverCaps->MaxPointerHeight = POINTER_SIZE; pDriverCaps->PointerCaps.Monochrome = 1;
pDriverCaps->PointerCaps.Monochrome = 1; pDriverCaps->PointerCaps.Color = 1;
pDriverCaps->PointerCaps.Color = 1;
}
pDriverCaps->SupportNonVGA = TRUE; pDriverCaps->SupportNonVGA = TRUE;
@ -4428,7 +4426,7 @@ NTSTATUS QxlDevice::SetPointerShape(_In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPoi
pSetPointerShape->Height, pSetPointerShape->Height,
pSetPointerShape->XHot, pSetPointerShape->XHot,
pSetPointerShape->YHot)); pSetPointerShape->YHot));
if (!EnablePointer() || (!pSetPointerShape->Flags.Monochrome && !pSetPointerShape->Flags.Color)) if (!pSetPointerShape->Flags.Monochrome && !pSetPointerShape->Flags.Color)
return STATUS_UNSUCCESSFUL; return STATUS_UNSUCCESSFUL;
QXLCursorCmd *cursor_cmd; QXLCursorCmd *cursor_cmd;
@ -4508,17 +4506,15 @@ NTSTATUS QxlDevice::SetPointerPosition(_In_ CONST DXGKARG_SETPOINTERPOSITION* pS
pSetPointerPosition->VidPnSourceId, pSetPointerPosition->VidPnSourceId,
pSetPointerPosition->X, pSetPointerPosition->X,
pSetPointerPosition->Y)); pSetPointerPosition->Y));
if (EnablePointer()) { QXLCursorCmd *cursor_cmd = CursorCmd();
QXLCursorCmd *cursor_cmd = CursorCmd(); if (pSetPointerPosition->X < 0) {
if (pSetPointerPosition->X < 0) { cursor_cmd->type = QXL_CURSOR_HIDE;
cursor_cmd->type = QXL_CURSOR_HIDE; } else {
} else { cursor_cmd->type = QXL_CURSOR_MOVE;
cursor_cmd->type = QXL_CURSOR_MOVE; cursor_cmd->u.position.x = (INT16)pSetPointerPosition->X;
cursor_cmd->u.position.x = (INT16)pSetPointerPosition->X; cursor_cmd->u.position.y = (INT16)pSetPointerPosition->Y;
cursor_cmd->u.position.y = (INT16)pSetPointerPosition->Y;
}
PushCursorCmd(cursor_cmd);
} }
PushCursorCmd(cursor_cmd);
DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__)); DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }

View File

@ -245,7 +245,6 @@ public:
USHORT GetModeNumber(USHORT idx) {return m_ModeNumbers[idx];} USHORT GetModeNumber(USHORT idx) {return m_ModeNumbers[idx];}
USHORT GetCurrentModeIndex(void) {return m_CurrentMode;} USHORT GetCurrentModeIndex(void) {return m_CurrentMode;}
VOID SetCurrentModeIndex(USHORT idx) {m_CurrentMode = idx;} VOID SetCurrentModeIndex(USHORT idx) {m_CurrentMode = idx;}
virtual BOOLEAN EnablePointer(void) = 0;
virtual NTSTATUS ExecutePresentDisplayOnly(_In_ BYTE* DstAddr, virtual NTSTATUS ExecutePresentDisplayOnly(_In_ BYTE* DstAddr,
_In_ UINT DstBitPerPixel, _In_ UINT DstBitPerPixel,
_In_ BYTE* SrcAddr, _In_ BYTE* SrcAddr,
@ -289,7 +288,6 @@ public:
NTSTATUS SetPowerState(DEVICE_POWER_STATE DevicePowerState, DXGK_DISPLAY_INFORMATION* pDispInfo); NTSTATUS SetPowerState(DEVICE_POWER_STATE DevicePowerState, DXGK_DISPLAY_INFORMATION* pDispInfo);
NTSTATUS HWInit(PCM_RESOURCE_LIST pResList, DXGK_DISPLAY_INFORMATION* pDispInfo); NTSTATUS HWInit(PCM_RESOURCE_LIST pResList, DXGK_DISPLAY_INFORMATION* pDispInfo);
NTSTATUS HWClose(void); NTSTATUS HWClose(void);
BOOLEAN EnablePointer(void) { return TRUE; }
NTSTATUS ExecutePresentDisplayOnly(_In_ BYTE* DstAddr, NTSTATUS ExecutePresentDisplayOnly(_In_ BYTE* DstAddr,
_In_ UINT DstBitPerPixel, _In_ UINT DstBitPerPixel,
_In_ BYTE* SrcAddr, _In_ BYTE* SrcAddr,
@ -464,7 +462,6 @@ public:
NTSTATUS SetPowerState(DEVICE_POWER_STATE DevicePowerState, DXGK_DISPLAY_INFORMATION* pDispInfo); NTSTATUS SetPowerState(DEVICE_POWER_STATE DevicePowerState, DXGK_DISPLAY_INFORMATION* pDispInfo);
NTSTATUS HWInit(PCM_RESOURCE_LIST pResList, DXGK_DISPLAY_INFORMATION* pDispInfo); NTSTATUS HWInit(PCM_RESOURCE_LIST pResList, DXGK_DISPLAY_INFORMATION* pDispInfo);
NTSTATUS HWClose(void); NTSTATUS HWClose(void);
BOOLEAN EnablePointer(void) { return FALSE; }
NTSTATUS ExecutePresentDisplayOnly(_In_ BYTE* DstAddr, NTSTATUS ExecutePresentDisplayOnly(_In_ BYTE* DstAddr,
_In_ UINT DstBitPerPixel, _In_ UINT DstBitPerPixel,
_In_ BYTE* SrcAddr, _In_ BYTE* SrcAddr,