VirtualBox

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

Last change on this file since 31756 was 30953, checked in by vboxsync, 15 years ago

wddm/2d: notify host on color fill FB update, bugfix

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.5 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_CLRFILL = 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 VBOXVDMAPIPE_CMD_DMACMD_CLRFILL
85{
86 VBOXVDMAPIPE_CMD_DR Hdr;
87 struct VBOXWDDM_CONTEXT *pContext;
88 struct VBOXWDDM_ALLOCATION *pAllocation;
89 UINT SubmissionFenceId;
90 D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId;
91 UINT Color;
92 VBOXWDDM_RECTS_INFO Rects;
93} VBOXVDMAPIPE_CMD_DMACMD_CLRFILL, *PVBOXVDMAPIPE_CMD_DMACMD_CLRFILL;
94
95typedef struct VBOXVDMAGG
96{
97 VBOXVDMAPIPE CmdPipe;
98 PKTHREAD pThread;
99} VBOXVDMAGG, *PVBOXVDMAGG;
100
101/* DMA commands are currently submitted over HGSMI */
102typedef struct VBOXVDMAINFO
103{
104 HGSMIHEAP CmdHeap;
105 UINT uLastCompletedPagingBufferCmdFenceId;
106 BOOL fEnabled;
107#if 0
108 VBOXVDMASUBMIT Submitter;
109#endif
110 /* dma-related commands list processed on the guest w/o host part involvement (guest-guest commands) */
111 VBOXVDMAGG DmaGg;
112} VBOXVDMAINFO, *PVBOXVDMAINFO;
113
114int vboxVdmaCreate (struct _DEVICE_EXTENSION* pDevExt, VBOXVDMAINFO *pInfo, ULONG offBuffer, ULONG cbBuffer
115#if 0
116 , PFNVBOXVDMASUBMIT pfnSubmit, PVOID pvContext
117#endif
118 );
119int vboxVdmaDisable (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo);
120int vboxVdmaEnable (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo);
121int vboxVdmaFlush (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo);
122int vboxVdmaDestroy (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo);
123int vboxVdmaCBufDrSubmit (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo, PVBOXVDMACBUF_DR pDr);
124struct VBOXVDMACBUF_DR* vboxVdmaCBufDrCreate (PVBOXVDMAINFO pInfo, uint32_t cbTrailingData);
125void vboxVdmaCBufDrFree (PVBOXVDMAINFO pInfo, struct VBOXVDMACBUF_DR* pDr);
126
127#define VBOXVDMACBUF_DR_DATA_OFFSET() (sizeof (VBOXVDMACBUF_DR))
128#define VBOXVDMACBUF_DR_SIZE(_cbData) (VBOXVDMACBUF_DR_DATA_OFFSET() + (_cbData))
129#define VBOXVDMACBUF_DR_DATA(_pDr) ( ((uint8_t*)(_pDr)) + VBOXVDMACBUF_DR_DATA_OFFSET() )
130
131NTSTATUS vboxVdmaGgCmdSubmit(PVBOXVDMAGG pVdma, PVBOXVDMAPIPE_CMD_DR pCmd);
132PVBOXVDMAPIPE_CMD_DR vboxVdmaGgCmdCreate(PVBOXVDMAGG pVdma, VBOXVDMAPIPE_CMD_TYPE enmType, uint32_t cbCmd);
133void vboxVdmaGgCmdDestroy(PVBOXVDMAPIPE_CMD_DR pDr);
134
135#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