1 | /* $Id: VBoxVideoIOCTL.h 93115 2022-01-01 11:31:46Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Miniport IOCTL related header
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2011-2022 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef GA_INCLUDED_SRC_WINNT_Graphics_Video_common_xpdm_VBoxVideoIOCTL_h
|
---|
19 | #define GA_INCLUDED_SRC_WINNT_Graphics_Video_common_xpdm_VBoxVideoIOCTL_h
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | #include <VBox/VMMDev.h> /* VBVAMEMORY */
|
---|
25 | #include <HGSMI.h>
|
---|
26 |
|
---|
27 | /* ==================== VirtualBox specific VRP's ==================== */
|
---|
28 |
|
---|
29 | /* Called by the display driver when it is ready to
|
---|
30 | * switch to VBVA operation mode.
|
---|
31 | * Successful return means that VBVA can be used and
|
---|
32 | * output buffer contains VBVAENABLERESULT data.
|
---|
33 | * An error means that VBVA can not be used
|
---|
34 | * (disabled or not supported by the host).
|
---|
35 | */
|
---|
36 | #define IOCTL_VIDEO_VBVA_ENABLE \
|
---|
37 | CTL_CODE(FILE_DEVICE_VIDEO, 0x400, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
---|
38 |
|
---|
39 | /* Called to get video port api function pointers */
|
---|
40 | #define IOCTL_VIDEO_HGSMI_QUERY_PORTPROCS \
|
---|
41 | CTL_CODE(FILE_DEVICE_VIDEO, 0x434, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
---|
42 |
|
---|
43 | /* Called to get HGSMI related callbacks */
|
---|
44 | #define IOCTL_VIDEO_HGSMI_QUERY_CALLBACKS \
|
---|
45 | CTL_CODE(FILE_DEVICE_VIDEO, 0x431, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
---|
46 |
|
---|
47 | /* Called to get adapter's HGSMI information */
|
---|
48 | #define IOCTL_VIDEO_QUERY_HGSMI_INFO \
|
---|
49 | CTL_CODE(FILE_DEVICE_VIDEO, 0x430, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
---|
50 |
|
---|
51 | /* Called to enable HGSMI miniport channel */
|
---|
52 | #define IOCTL_VIDEO_HGSMI_HANDLER_ENABLE \
|
---|
53 | CTL_CODE(FILE_DEVICE_VIDEO, 0x432, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
---|
54 |
|
---|
55 | /* Called to disable HGSMI miniport channel */
|
---|
56 | #define IOCTL_VIDEO_HGSMI_HANDLER_DISABLE \
|
---|
57 | CTL_CODE(FILE_DEVICE_VIDEO, 0x433, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
---|
58 |
|
---|
59 | /* Called to get framebuffer offset */
|
---|
60 | #define IOCTL_VIDEO_VHWA_QUERY_INFO \
|
---|
61 | CTL_CODE(FILE_DEVICE_VIDEO, 0x435, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
---|
62 |
|
---|
63 | /* Called to get adapter's generic information */
|
---|
64 | #define IOCTL_VIDEO_QUERY_VBOXVIDEO_INFO \
|
---|
65 | CTL_CODE(FILE_DEVICE_VIDEO, 0x436, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
---|
66 |
|
---|
67 | /* ==================== Data structures used by VirtualBox VRPS's ==================== */
|
---|
68 | typedef void* HVBOXVIDEOHGSMI;
|
---|
69 |
|
---|
70 | /** Complete host commands addressed to the display */
|
---|
71 | typedef DECLCALLBACKTYPE(void, FNVBOXVIDEOHGSMICOMPLETION,(HVBOXVIDEOHGSMI hHGSMI,
|
---|
72 | struct VBVAHOSTCMD RT_UNTRUSTED_VOLATILE_HOST * pCmd));
|
---|
73 | typedef FNVBOXVIDEOHGSMICOMPLETION *PFNVBOXVIDEOHGSMICOMPLETION;
|
---|
74 |
|
---|
75 | /** request the host commands addressed to the display */
|
---|
76 | typedef DECLCALLBACKTYPE(int, FNVBOXVIDEOHGSMICOMMANDS,(HVBOXVIDEOHGSMI hHGSMI, uint8_t u8Channel, uint32_t iDevice,
|
---|
77 | struct VBVAHOSTCMD RT_UNTRUSTED_VOLATILE_HOST ** ppCmd));
|
---|
78 | typedef FNVBOXVIDEOHGSMICOMMANDS *PFNVBOXVIDEOHGSMICOMMANDS;
|
---|
79 |
|
---|
80 | /** post guest command (offset) to the host */
|
---|
81 | typedef DECLCALLBACKTYPE(void, FNVBOXVIDEOHGSMIPOSTCOMMAND,(HVBOXVIDEOHGSMI hHGSMI, HGSMIOFFSET offCmd));
|
---|
82 | typedef FNVBOXVIDEOHGSMIPOSTCOMMAND *PFNVBOXVIDEOHGSMIPOSTCOMMAND;
|
---|
83 |
|
---|
84 | #pragma pack(1)
|
---|
85 | /* Data returned by IOCTL_VIDEO_VBVA_ENABLE. */
|
---|
86 | typedef struct _VBVAENABLERESULT
|
---|
87 | {
|
---|
88 | /* Pointer to VBVAMemory part of VMMDev memory region. */
|
---|
89 | VBVAMEMORY *pVbvaMemory;
|
---|
90 |
|
---|
91 | /* Called to force the host to process VBVA memory,
|
---|
92 | * when there is no more free space in VBVA memory.
|
---|
93 | * Normally this never happens.
|
---|
94 | *
|
---|
95 | * The other purpose is to perform a synchronous command.
|
---|
96 | * But the goal is to have no such commands at all.
|
---|
97 | */
|
---|
98 | DECLR0CALLBACKMEMBER(void, pfnFlush, (void *pvFlush));
|
---|
99 |
|
---|
100 | /* Pointer required by the pfnFlush callback. */
|
---|
101 | void *pvFlush;
|
---|
102 |
|
---|
103 | } VBVAENABLERESULT;
|
---|
104 |
|
---|
105 | /* Data returned by IOCTL_VIDEO_HGSMI_QUERY_PORTPROCS. */
|
---|
106 | typedef struct _HGSMIQUERYCPORTPROCS
|
---|
107 | {
|
---|
108 | PVOID pContext;
|
---|
109 | VBOXVIDEOPORTPROCS VideoPortProcs;
|
---|
110 | } HGSMIQUERYCPORTPROCS;
|
---|
111 |
|
---|
112 | /** Data returned by IOCTL_VIDEO_HGSMI_QUERY_CALLBACKS. */
|
---|
113 | typedef struct _HGSMIQUERYCALLBACKS
|
---|
114 | {
|
---|
115 | HVBOXVIDEOHGSMI hContext;
|
---|
116 | PFNVBOXVIDEOHGSMICOMPLETION pfnCompletionHandler;
|
---|
117 | PFNVBOXVIDEOHGSMICOMMANDS pfnRequestCommandsHandler;
|
---|
118 | } HGSMIQUERYCALLBACKS;
|
---|
119 |
|
---|
120 | /* Data returned by IOCTL_VIDEO_QUERY_HGSMI_INFO. */
|
---|
121 | typedef struct _QUERYHGSMIRESULT
|
---|
122 | {
|
---|
123 | /* Device index (0 for primary) */
|
---|
124 | ULONG iDevice;
|
---|
125 |
|
---|
126 | /* Flags. Currently none are defined and the field must be initialized to 0. */
|
---|
127 | ULONG ulFlags;
|
---|
128 |
|
---|
129 | /* Describes VRAM chunk for this display device. */
|
---|
130 | HGSMIAREA areaDisplay;
|
---|
131 |
|
---|
132 | /* Size of the display information area. */
|
---|
133 | uint32_t u32DisplayInfoSize;
|
---|
134 |
|
---|
135 | /* Minimum size of the VBVA buffer. */
|
---|
136 | uint32_t u32MinVBVABufferSize;
|
---|
137 |
|
---|
138 | /* IO port to submit guest HGSMI commands. */
|
---|
139 | RTIOPORT IOPortGuestCommand;
|
---|
140 | } QUERYHGSMIRESULT;
|
---|
141 |
|
---|
142 | /* Data passed to IOCTL_VIDEO_HGSMI_HANDLER_ENABLE. */
|
---|
143 | typedef struct _HGSMIHANDLERENABLE
|
---|
144 | {
|
---|
145 | uint8_t u8Channel;
|
---|
146 | } HGSMIHANDLERENABLE;
|
---|
147 |
|
---|
148 | #ifdef VBOX_WITH_VIDEOHWACCEL
|
---|
149 | /* Data returned by IOCTL_VIDEO_VHWA_QUERY_INFO. */
|
---|
150 | typedef struct _VHWAQUERYINFO
|
---|
151 | {
|
---|
152 | ULONG_PTR offVramBase;
|
---|
153 | } VHWAQUERYINFO;
|
---|
154 | #endif
|
---|
155 | #pragma pack()
|
---|
156 |
|
---|
157 | /* IOCTL_VIDEO_QUERY_INFO */
|
---|
158 | #define VBOXVIDEO_INFO_LEVEL_REGISTRY_FLAGS 1
|
---|
159 |
|
---|
160 | #define VBOXVIDEO_REGISTRY_FLAGS_DISABLE_BITMAP_CACHE 0x00000001
|
---|
161 |
|
---|
162 | #endif /* !GA_INCLUDED_SRC_WINNT_Graphics_Video_common_xpdm_VBoxVideoIOCTL_h */
|
---|