VirtualBox

source: vbox/trunk/include/VBox/Graphics/HGSMIContext.h@ 93593

Last change on this file since 93593 was 93115, checked in by vboxsync, 3 years ago

scm --update-copyright-year

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.3 KB
Line 
1/* $Id: HGSMIContext.h 93115 2022-01-01 11:31:46Z vboxsync $ */
2/** @file
3 * VBox Host Guest Shared Memory Interface (HGSMI) - command contexts.
4 */
5
6/*
7 * Copyright (C) 2006-2022 Oracle Corporation
8 *
9 * Permission is hereby granted, free of charge, to any person
10 * obtaining a copy of this software and associated documentation
11 * files (the "Software"), to deal in the Software without
12 * restriction, including without limitation the rights to use,
13 * copy, modify, merge, publish, distribute, sublicense, and/or sell
14 * copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following
16 * conditions:
17 *
18 * The above copyright notice and this permission notice shall be
19 * included in all copies or substantial portions of the Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
23 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
26 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28 * OTHER DEALINGS IN THE SOFTWARE.
29 */
30
31#ifndef VBOX_INCLUDED_Graphics_HGSMIContext_h
32#define VBOX_INCLUDED_Graphics_HGSMIContext_h
33#ifndef RT_WITHOUT_PRAGMA_ONCE
34# pragma once
35#endif
36
37#include "HGSMI.h"
38#include "HGSMIChSetup.h"
39#include "VBoxVideoIPRT.h"
40
41#ifdef VBOX_WDDM_MINIPORT
42# include "wddm/VBoxMPShgsmi.h"
43 typedef VBOXSHGSMI HGSMIGUESTCMDHEAP;
44# define HGSMIGUESTCMDHEAP_GET(_p) (&(_p)->Heap)
45#else
46 typedef HGSMIHEAP HGSMIGUESTCMDHEAP;
47# define HGSMIGUESTCMDHEAP_GET(_p) (_p)
48#endif
49
50RT_C_DECLS_BEGIN
51
52/**
53 * Structure grouping the context needed for submitting commands to the host
54 * via HGSMI
55 */
56typedef struct HGSMIGUESTCOMMANDCONTEXT
57{
58 /** Information about the memory heap located in VRAM from which data
59 * structures to be sent to the host are allocated. */
60 HGSMIGUESTCMDHEAP heapCtx;
61 /** The I/O port used for submitting commands to the host by writing their
62 * offsets into the heap. */
63 RTIOPORT port;
64} HGSMIGUESTCOMMANDCONTEXT, *PHGSMIGUESTCOMMANDCONTEXT;
65
66
67/**
68 * Structure grouping the context needed for receiving commands from the host
69 * via HGSMI
70 */
71typedef struct HGSMIHOSTCOMMANDCONTEXT
72{
73 /** Information about the memory area located in VRAM in which the host
74 * places data structures to be read by the guest. */
75 HGSMIAREA areaCtx;
76 /** Convenience structure used for matching host commands to handlers. */
77 /** @todo handlers are registered individually in code rather than just
78 * passing a static structure in order to gain extra flexibility. There is
79 * currently no expected usage case for this though. Is the additional
80 * complexity really justified? */
81 HGSMICHANNELINFO channels;
82 /** Flag to indicate that one thread is currently processing the command
83 * queue. */
84 volatile bool fHostCmdProcessing;
85 /* Pointer to the VRAM location where the HGSMI host flags are kept. */
86 volatile HGSMIHOSTFLAGS *pfHostFlags;
87 /** The I/O port used for receiving commands from the host as offsets into
88 * the memory area and sending back confirmations (command completion,
89 * IRQ acknowlegement). */
90 RTIOPORT port;
91} HGSMIHOSTCOMMANDCONTEXT, *PHGSMIHOSTCOMMANDCONTEXT;
92
93/** @name HGSMI context initialisation APIs.
94 * @{ */
95
96/** @todo we should provide a cleanup function too as part of the API */
97DECLHIDDEN(int) VBoxHGSMISetupGuestContext(PHGSMIGUESTCOMMANDCONTEXT pCtx,
98 void *pvGuestHeapMemory,
99 uint32_t cbGuestHeapMemory,
100 uint32_t offVRAMGuestHeapMemory,
101 const HGSMIENV *pEnv);
102DECLHIDDEN(void) VBoxHGSMISetupHostContext(PHGSMIHOSTCOMMANDCONTEXT pCtx,
103 void *pvBaseMapping,
104 uint32_t offHostFlags,
105 void *pvHostAreaMapping,
106 uint32_t offVRAMHostArea,
107 uint32_t cbHostArea);
108
109/** @} */
110
111RT_C_DECLS_END
112
113#endif /* !VBOX_INCLUDED_Graphics_HGSMIContext_h */
114
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