1 | /*
|
---|
2 | * Copyright (C) 2010 Oracle Corporation
|
---|
3 | *
|
---|
4 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
5 | * available from http://www.virtualbox.org. This file is free software;
|
---|
6 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
7 | * General Public License (GPL) as published by the Free Software
|
---|
8 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
9 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
10 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
11 | */
|
---|
12 |
|
---|
13 | #ifndef ___VBoxVideoMisc_h__
|
---|
14 | #define ___VBoxVideoMisc_h__
|
---|
15 |
|
---|
16 | DECLINLINE(void) vboxVideoLeDetach(LIST_ENTRY *pList, LIST_ENTRY *pDstList)
|
---|
17 | {
|
---|
18 | if (IsListEmpty(pList))
|
---|
19 | {
|
---|
20 | InitializeListHead(pDstList);
|
---|
21 | }
|
---|
22 | else
|
---|
23 | {
|
---|
24 | *pDstList = *pList;
|
---|
25 | Assert(pDstList->Flink->Blink == pList);
|
---|
26 | Assert(pDstList->Blink->Flink == pList);
|
---|
27 | /* pDstList->Flink & pDstList->Blink point to the "real| entries, never to pList
|
---|
28 | * since we've checked IsListEmpty(pList) above */
|
---|
29 | pDstList->Flink->Blink = pDstList;
|
---|
30 | pDstList->Blink->Flink = pDstList;
|
---|
31 | InitializeListHead(pList);
|
---|
32 | }
|
---|
33 | }
|
---|
34 |
|
---|
35 | typedef struct _DEVICE_EXTENSION *PDEVICE_EXTENSION;
|
---|
36 | typedef struct VBOXWDDM_SWAPCHAIN *PVBOXWDDM_SWAPCHAIN;
|
---|
37 | typedef struct VBOXWDDM_CONTEXT *PVBOXWDDM_CONTEXT;
|
---|
38 | typedef struct VBOXWDDM_ALLOCATION *PVBOXWDDM_ALLOCATION;
|
---|
39 |
|
---|
40 | typedef uint32_t VBOXWDDM_HANDLE;
|
---|
41 | #define VBOXWDDM_HANDLE_INVALID 0UL
|
---|
42 |
|
---|
43 | typedef struct VBOXWDDM_HTABLE
|
---|
44 | {
|
---|
45 | uint32_t cData;
|
---|
46 | uint32_t iNext2Search;
|
---|
47 | uint32_t cSize;
|
---|
48 | PVOID *paData;
|
---|
49 | } VBOXWDDM_HTABLE, *PVBOXWDDM_HTABLE;
|
---|
50 |
|
---|
51 | typedef struct VBOXWDDM_HTABLE_ITERATOR
|
---|
52 | {
|
---|
53 | PVBOXWDDM_HTABLE pTbl;
|
---|
54 | uint32_t iCur;
|
---|
55 | uint32_t cLeft;
|
---|
56 | } VBOXWDDM_HTABLE_ITERATOR, *PVBOXWDDM_HTABLE_ITERATOR;
|
---|
57 |
|
---|
58 | VOID vboxWddmHTableIterInit(PVBOXWDDM_HTABLE pTbl, PVBOXWDDM_HTABLE_ITERATOR pIter);
|
---|
59 | PVOID vboxWddmHTableIterNext(PVBOXWDDM_HTABLE_ITERATOR pIter, VBOXWDDM_HANDLE *phHandle);
|
---|
60 | BOOL vboxWddmHTableIterHasNext(PVBOXWDDM_HTABLE_ITERATOR pIter);
|
---|
61 | PVOID vboxWddmHTableIterRemoveCur(PVBOXWDDM_HTABLE_ITERATOR pIter);
|
---|
62 | NTSTATUS vboxWddmHTableCreate(PVBOXWDDM_HTABLE pTbl, uint32_t cSize);
|
---|
63 | VOID vboxWddmHTableDestroy(PVBOXWDDM_HTABLE pTbl);
|
---|
64 | NTSTATUS vboxWddmHTableRealloc(PVBOXWDDM_HTABLE pTbl, uint32_t cNewSize);
|
---|
65 | VBOXWDDM_HANDLE vboxWddmHTablePut(PVBOXWDDM_HTABLE pTbl, PVOID pvData);
|
---|
66 | PVOID vboxWddmHTableRemove(PVBOXWDDM_HTABLE pTbl, VBOXWDDM_HANDLE hHandle);
|
---|
67 | PVOID vboxWddmHTableGet(PVBOXWDDM_HTABLE pTbl, VBOXWDDM_HANDLE hHandle);
|
---|
68 |
|
---|
69 |
|
---|
70 | PVBOXWDDM_SWAPCHAIN vboxWddmSwapchainCreate();
|
---|
71 | DECLINLINE(BOOLEAN) vboxWddmSwapchainRetain(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_SWAPCHAIN pSwapchain);
|
---|
72 | DECLINLINE(VOID) vboxWddmSwapchainRelease(PVBOXWDDM_SWAPCHAIN pSwapchain);
|
---|
73 | PVBOXWDDM_SWAPCHAIN vboxWddmSwapchainRetainByAlloc(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_ALLOCATION pAlloc);
|
---|
74 | VOID vboxWddmSwapchainAllocRemove(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_SWAPCHAIN pSwapchain, PVBOXWDDM_ALLOCATION pAlloc);
|
---|
75 | BOOLEAN vboxWddmSwapchainAllocAdd(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_SWAPCHAIN pSwapchain, PVBOXWDDM_ALLOCATION pAlloc);
|
---|
76 | VOID vboxWddmSwapchainAllocRemoveAll(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_SWAPCHAIN pSwapchain);
|
---|
77 | VOID vboxWddmSwapchainDestroy(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_SWAPCHAIN pSwapchain);
|
---|
78 | VOID vboxWddmSwapchainCtxDestroyAll(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_CONTEXT pContext);
|
---|
79 | NTSTATUS vboxWddmSwapchainCtxEscape(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_CONTEXT pContext, PVBOXDISPIFESCAPE_SWAPCHAININFO pSwapchainInfo, UINT cbSize);
|
---|
80 |
|
---|
81 |
|
---|
82 | NTSTATUS vboxWddmRegQueryDisplaySettingsKeyName(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId,
|
---|
83 | ULONG cbBuf, PWCHAR pBuf, PULONG pcbResult);
|
---|
84 | NTSTATUS vboxWddmRegOpenDisplaySettingsKey(IN PDEVICE_EXTENSION pDeviceExtension, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, OUT PHANDLE phKey);
|
---|
85 | NTSTATUS vboxWddmRegDisplaySettingsQueryRelX(HANDLE hKey, int * pResult);
|
---|
86 | NTSTATUS vboxWddmRegDisplaySettingsQueryRelY(HANDLE hKey, int * pResult);
|
---|
87 | NTSTATUS vboxWddmDisplaySettingsQueryPos(IN PDEVICE_EXTENSION pDeviceExtension, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, POINT * pPos);
|
---|
88 | NTSTATUS vboxWddmRegQueryVideoGuidString(ULONG cbBuf, PWCHAR pBuf, PULONG pcbResult);
|
---|
89 |
|
---|
90 | NTSTATUS vboxWddmRegQueryDrvKeyName(PDEVICE_EXTENSION pDevExt, ULONG cbBuf, PWCHAR pBuf, PULONG pcbResult);
|
---|
91 |
|
---|
92 | NTSTATUS vboxWddmRegOpenKey(OUT PHANDLE phKey, IN PWCHAR pName, IN ACCESS_MASK fAccess);
|
---|
93 | NTSTATUS vboxWddmRegQueryValueDword(IN HANDLE hKey, IN PWCHAR pName, OUT PDWORD pDword);
|
---|
94 | NTSTATUS vboxWddmRegSetValueDword(IN HANDLE hKey, IN PWCHAR pName, OUT DWORD val);
|
---|
95 | #endif /* #ifndef ___VBoxVideoMisc_h__ */
|
---|