[idd] implemented core shared memory functionallity and LGMP setup

This commit is contained in:
Geoffrey McRae
2023-04-10 14:02:47 +10:00
parent 77ddcfe489
commit 3c85957b99
15 changed files with 608 additions and 37 deletions

View File

@@ -3,8 +3,17 @@
#include <Windows.h>
#include <wdf.h>
#include <IddCx.h>
#include "CIVSHMEM.h"
extern "C" {
#include "lgmp/host.h"
}
#include "common/KVMFR.h"
#define MAX_POINTER_SIZE (sizeof(KVMFRCursor) + (512 * 512 * 4))
#define POINTER_SHAPE_BUFFERS 3
class CIndirectDeviceContext
{
private:
@@ -12,11 +21,27 @@ private:
IDDCX_ADAPTER m_adapter = nullptr;
CIVSHMEM m_ivshmem;
PLGMPHost m_lgmp = nullptr;
PLGMPHostQueue m_frameQueue = nullptr;
PLGMPHostQueue m_pointerQueue = nullptr;
PLGMPMemory m_pointerMemory [LGMP_Q_POINTER_LEN ] = {};
PLGMPMemory m_pointerShapeMemory[POINTER_SHAPE_BUFFERS] = {};
size_t m_maxFrameSize = 0;
PLGMPMemory m_frameMemory[LGMP_Q_FRAME_LEN] = {};
bool SetupLGMP();
void LGMPTimer();
WDFTIMER m_lgmpTimer = nullptr;
public:
CIndirectDeviceContext(_In_ WDFDEVICE wdfDevice) :
m_wdfDevice(wdfDevice) {};
virtual ~CIndirectDeviceContext() {};
virtual ~CIndirectDeviceContext();
void InitAdapter();