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->HighestAcceptableAddress.QuadPart = -1;
if (m_pHWDevice->EnablePointer()) {
pDriverCaps->MaxPointerWidth = POINTER_SIZE;
pDriverCaps->MaxPointerHeight = POINTER_SIZE;
pDriverCaps->PointerCaps.Monochrome = 1;
pDriverCaps->PointerCaps.Color = 1;
}
pDriverCaps->SupportNonVGA = TRUE;
@ -4428,7 +4426,7 @@ NTSTATUS QxlDevice::SetPointerShape(_In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPoi
pSetPointerShape->Height,
pSetPointerShape->XHot,
pSetPointerShape->YHot));
if (!EnablePointer() || (!pSetPointerShape->Flags.Monochrome && !pSetPointerShape->Flags.Color))
if (!pSetPointerShape->Flags.Monochrome && !pSetPointerShape->Flags.Color)
return STATUS_UNSUCCESSFUL;
QXLCursorCmd *cursor_cmd;
@ -4508,7 +4506,6 @@ NTSTATUS QxlDevice::SetPointerPosition(_In_ CONST DXGKARG_SETPOINTERPOSITION* pS
pSetPointerPosition->VidPnSourceId,
pSetPointerPosition->X,
pSetPointerPosition->Y));
if (EnablePointer()) {
QXLCursorCmd *cursor_cmd = CursorCmd();
if (pSetPointerPosition->X < 0) {
cursor_cmd->type = QXL_CURSOR_HIDE;
@ -4518,7 +4515,6 @@ NTSTATUS QxlDevice::SetPointerPosition(_In_ CONST DXGKARG_SETPOINTERPOSITION* pS
cursor_cmd->u.position.y = (INT16)pSetPointerPosition->Y;
}
PushCursorCmd(cursor_cmd);
}
DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
return STATUS_SUCCESS;
}

View File

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