VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.h@ 30926

Last change on this file since 30926 was 30484, checked in by vboxsync, 15 years ago

wddm/3d: visible regions bugfixes fixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.2 KB
Line 
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#ifndef ___VBoxVideoVdma_h___
13#define ___VBoxVideoVdma_h___
14
15#include <iprt/cdefs.h>
16#include <VBox/VBoxVideo.h>
17#include "../VBoxVideo.h"
18
19#if 0
20typedef DECLCALLBACK(int) FNVBOXVDMASUBMIT(struct _DEVICE_EXTENSION* pDevExt, struct VBOXVDMAINFO * pInfo, HGSMIOFFSET offDr, PVOID pvContext);
21typedef FNVBOXVDMASUBMIT *PFNVBOXVDMASUBMIT;
22
23typedef struct VBOXVDMASUBMIT
24{
25 PFNVBOXVDMASUBMIT pfnSubmit;
26 PVOID pvContext;
27} VBOXVDMASUBMIT, *PVBOXVDMASUBMIT;
28#endif
29
30/* start */
31typedef enum
32{
33 VBOXVDMAPIPE_STATE_CLOSED = 0,
34 VBOXVDMAPIPE_STATE_CREATED = 1,
35 VBOXVDMAPIPE_STATE_OPENNED = 2,
36 VBOXVDMAPIPE_STATE_CLOSING = 3
37} VBOXVDMAPIPE_STATE;
38
39typedef struct VBOXVDMAPIPE
40{
41 KSPIN_LOCK SinchLock;
42 KEVENT Event;
43 LIST_ENTRY CmdListHead;
44 VBOXVDMAPIPE_STATE enmState;
45 /* true iff the other end needs Event notification */
46 bool bNeedNotify;
47} VBOXVDMAPIPE, *PVBOXVDMAPIPE;
48
49typedef struct VBOXVDMAPIPE_CMD_HDR
50{
51 LIST_ENTRY ListEntry;
52} VBOXVDMAPIPE_CMD_HDR, *PVBOXVDMAPIPE_CMD_HDR;
53
54#define VBOXVDMAPIPE_CMD_HDR_FROM_ENTRY(_pE) ( (PVBOXVDMAPIPE_CMD_HDR)((uint8_t *)(_pE) - RT_OFFSETOF(VBOXVDMAPIPE_CMD_HDR, ListEntry)) )
55
56typedef enum
57{
58 VBOXVDMAPIPE_CMD_TYPE_UNDEFINED = 0,
59 VBOXVDMAPIPE_CMD_TYPE_RECTSINFO = 1,
60 VBOXVDMAPIPE_CMD_TYPE_DMACMD = 2
61} VBOXVDMAPIPE_CMD_TYPE;
62
63typedef struct VBOXVDMAPIPE_CMD_DR
64{
65 VBOXVDMAPIPE_CMD_HDR PipeHdr;
66 VBOXVDMAPIPE_CMD_TYPE enmType;
67} VBOXVDMAPIPE_CMD_DR, *PVBOXVDMAPIPE_CMD_DR;
68
69#define VBOXVDMAPIPE_CMD_DR_FROM_ENTRY(_pE) ( (PVBOXVDMAPIPE_CMD_DR)VBOXVDMAPIPE_CMD_HDR_FROM_ENTRY(_pE) )
70
71typedef struct VBOXVDMAPIPE_RECTS
72{
73 RECT ContextRect;
74 VBOXWDDM_RECTS_INFO UpdateRects;
75} VBOXVDMAPIPE_RECTS, *PVBOXVDMAPIPE_RECTS;
76
77typedef struct VBOXVDMAPIPE_CMD_RECTSINFO
78{
79 VBOXVDMAPIPE_CMD_DR Hdr;
80 struct VBOXWDDM_CONTEXT *pContext;
81 VBOXVDMAPIPE_RECTS ContextsRects;
82} VBOXVDMAPIPE_CMD_RECTSINFO, *PVBOXVDMAPIPE_CMD_RECTSINFO;
83
84typedef struct VBOXVDMAGG
85{
86 VBOXVDMAPIPE CmdPipe;
87 PKTHREAD pThread;
88} VBOXVDMAGG, *PVBOXVDMAGG;
89
90/* DMA commands are currently submitted over HGSMI */
91typedef struct VBOXVDMAINFO
92{
93 HGSMIHEAP CmdHeap;
94 UINT uLastCompletedPagingBufferCmdFenceId;
95 BOOL fEnabled;
96#if 0
97 VBOXVDMASUBMIT Submitter;
98#endif
99 /* dma-related commands list processed on the guest w/o host part involvement (guest-guest commands) */
100 VBOXVDMAGG DmaGg;
101} VBOXVDMAINFO, *PVBOXVDMAINFO;
102
103int vboxVdmaCreate (struct _DEVICE_EXTENSION* pDevExt, VBOXVDMAINFO *pInfo, ULONG offBuffer, ULONG cbBuffer
104#if 0
105 , PFNVBOXVDMASUBMIT pfnSubmit, PVOID pvContext
106#endif
107 );
108int vboxVdmaDisable (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo);
109int vboxVdmaEnable (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo);
110int vboxVdmaFlush (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo);
111int vboxVdmaDestroy (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo);
112int vboxVdmaCBufDrSubmit (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo, PVBOXVDMACBUF_DR pDr);
113struct VBOXVDMACBUF_DR* vboxVdmaCBufDrCreate (PVBOXVDMAINFO pInfo, uint32_t cbTrailingData);
114void vboxVdmaCBufDrFree (PVBOXVDMAINFO pInfo, struct VBOXVDMACBUF_DR* pDr);
115
116#define VBOXVDMACBUF_DR_DATA_OFFSET() (sizeof (VBOXVDMACBUF_DR))
117#define VBOXVDMACBUF_DR_SIZE(_cbData) (VBOXVDMACBUF_DR_DATA_OFFSET() + (_cbData))
118#define VBOXVDMACBUF_DR_DATA(_pDr) ( ((uint8_t*)(_pDr)) + VBOXVDMACBUF_DR_DATA_OFFSET() )
119
120NTSTATUS vboxVdmaGgCmdSubmit(PVBOXVDMAGG pVdma, PVBOXVDMAPIPE_CMD_DR pCmd);
121PVBOXVDMAPIPE_CMD_DR vboxVdmaGgCmdCreate(PVBOXVDMAGG pVdma, VBOXVDMAPIPE_CMD_TYPE enmType, uint32_t cbCmd);
122void vboxVdmaGgCmdDestroy(PVBOXVDMAPIPE_CMD_DR pDr);
123
124#endif /* #ifndef ___VBoxVideoVdma_h___ */
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette