VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Video/common/xpdm/VBoxVideoIOCTL.h

Last change on this file was 106061, checked in by vboxsync, 4 months ago

Copyright year updates by scm.

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

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