fix pointer activation handler

This commit is contained in:
Vadim Rozenfeld 2014-06-30 21:46:52 +10:00
parent a64e05f525
commit 6a37c24fce
2 changed files with 21 additions and 9 deletions

View File

@ -290,7 +290,7 @@ NTSTATUS QxlDod::SetPowerState(_In_ ULONG HardwareUid,
m_AdapterPowerState = DevicePowerState; m_AdapterPowerState = DevicePowerState;
// There is nothing to do to specifically power up/down the display adapter // There is nothing to do to specifically power up/down the display adapter
return STATUS_SUCCESS; return m_pHWDevice->SetPowerState(DevicePowerState, &(m_CurrentModes[0].DispInfo));
} }
// TODO: This is where the specified monitor should be powered up/down // TODO: This is where the specified monitor should be powered up/down
m_pHWDevice->SetPowerState(ActionType); m_pHWDevice->SetPowerState(ActionType);
@ -396,11 +396,12 @@ 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;
pDriverCaps->MaxPointerWidth = 64; if (m_pHWDevice->GetType() == DEVICE_QXL) {
pDriverCaps->MaxPointerHeight = 64; pDriverCaps->MaxPointerWidth = POINTER_SIZE;
pDriverCaps->PointerCaps.Monochrome = 1; pDriverCaps->MaxPointerHeight = POINTER_SIZE;
pDriverCaps->PointerCaps.Color = 1; pDriverCaps->PointerCaps.Monochrome = 1;
pDriverCaps->PointerCaps.Color = 1;
}
DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s 1\n", __FUNCTION__)); DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s 1\n", __FUNCTION__));
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }

View File

@ -7,6 +7,8 @@
#define MAX_VIEWS 1 #define MAX_VIEWS 1
#define BITS_PER_BYTE 8 #define BITS_PER_BYTE 8
#define POINTER_SIZE 64
typedef struct _QXL_FLAGS typedef struct _QXL_FLAGS
{ {
UINT DriverStarted : 1; // ( 1) 1 after StartDevice and 0 after StopDevice UINT DriverStarted : 1; // ( 1) 1 after StartDevice and 0 after StopDevice
@ -206,9 +208,14 @@ typedef struct _CURRENT_BDD_MODE
} CURRENT_BDD_MODE; } CURRENT_BDD_MODE;
class QxlDod; class QxlDod;
class HwDeviceIntrface enum DevType {
{ DEVICE_INTERFACE,
DEVICE_VGA,
DEVICE_QXL
};
class HwDeviceIntrface {
public: public:
virtual NTSTATUS QueryCurrentMode(PVIDEO_MODE RequestedMode) = 0; virtual NTSTATUS QueryCurrentMode(PVIDEO_MODE RequestedMode) = 0;
virtual NTSTATUS SetCurrentMode(ULONG Mode) = 0; virtual NTSTATUS SetCurrentMode(ULONG Mode) = 0;
@ -225,6 +232,7 @@ 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;}
DevType GetType(void) { return DEVICE_INTERFACE;}
virtual NTSTATUS ExecutePresentDisplayOnly(_In_ BYTE* DstAddr, virtual NTSTATUS ExecutePresentDisplayOnly(_In_ BYTE* DstAddr,
_In_ UINT DstBitPerPixel, _In_ UINT DstBitPerPixel,
_In_ BYTE* SrcAddr, _In_ BYTE* SrcAddr,
@ -262,6 +270,7 @@ public:
NTSTATUS SetPowerState(POWER_ACTION ActionType); NTSTATUS SetPowerState(POWER_ACTION ActionType);
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);
DevType GetType(void) { return DEVICE_VGA;}
NTSTATUS ExecutePresentDisplayOnly(_In_ BYTE* DstAddr, NTSTATUS ExecutePresentDisplayOnly(_In_ BYTE* DstAddr,
_In_ UINT DstBitPerPixel, _In_ UINT DstBitPerPixel,
_In_ BYTE* SrcAddr, _In_ BYTE* SrcAddr,
@ -414,6 +423,7 @@ public:
NTSTATUS SetPowerState(POWER_ACTION ActionType); NTSTATUS SetPowerState(POWER_ACTION ActionType);
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);
DevType GetType(void) { return DEVICE_QXL;}
NTSTATUS ExecutePresentDisplayOnly(_In_ BYTE* DstAddr, NTSTATUS ExecutePresentDisplayOnly(_In_ BYTE* DstAddr,
_In_ UINT DstBitPerPixel, _In_ UINT DstBitPerPixel,
_In_ BYTE* SrcAddr, _In_ BYTE* SrcAddr,
@ -472,6 +482,7 @@ private:
void FreeMem(UINT32 mspace_type, void *ptr); void FreeMem(UINT32 mspace_type, void *ptr);
UINT64 ReleaseOutput(UINT64 output_id); UINT64 ReleaseOutput(UINT64 output_id);
void WaitForReleaseRing(void); void WaitForReleaseRing(void);
void EmptyReleaseRing(void);
BOOL SetClip(const RECT *clip, QXLDrawable *drawable); BOOL SetClip(const RECT *clip, QXLDrawable *drawable);
void AddRes(QXLOutput *output, Resource *res); void AddRes(QXLOutput *output, Resource *res);
void DrawableAddRes(QXLDrawable *drawable, Resource *res); void DrawableAddRes(QXLDrawable *drawable, Resource *res);