]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - ubuntu/vbox/vboxvideo/hgsmi_ch_setup.h
UBUNTU: ubuntu: vbox -- update to 5.2.2-dfsg-2
[mirror_ubuntu-bionic-kernel.git] / ubuntu / vbox / vboxvideo / hgsmi_ch_setup.h
1 /*
2 * Copyright (C) 2006-2017 Oracle Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation
6 * files (the "Software"), to deal in the Software without
7 * restriction, including without limitation the rights to use,
8 * copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following
11 * conditions:
12 *
13 * The above copyright notice and this permission notice shall be
14 * included in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
24 */
25
26 #ifndef __HGSMI_CH_SETUP_H__
27 #define __HGSMI_CH_SETUP_H__
28
29 #include "hgsmi_defs.h"
30
31 /* HGSMI setup and configuration channel commands and data structures. */
32 /*
33 * Tell the host the location of hgsmi_host_flags structure, where the host
34 * can write information about pending buffers, etc, and which can be quickly
35 * polled by the guest without a need to port IO.
36 */
37 #define HGSMI_CC_HOST_FLAGS_LOCATION 0
38
39 struct hgsmi_buffer_location {
40 u32 location;
41 u32 buf_len;
42 };
43 assert_compile_size(struct hgsmi_buffer_location, 8);
44
45 /* HGSMI setup and configuration data structures. */
46 /* host->guest commands pending, should be accessed under FIFO lock only */
47 #define HGSMIHOSTFLAGS_COMMANDS_PENDING 0x01u
48 /* IRQ is fired, should be accessed under VGAState::lock only */
49 #define HGSMIHOSTFLAGS_IRQ 0x02u
50 #ifdef VBOX_WITH_WDDM
51 /* one or more guest commands is completed, should be accessed under FIFO lock only */
52 # define HGSMIHOSTFLAGS_GCOMMAND_COMPLETED 0x04u
53 /* watchdog timer interrupt flag (used for debugging), should be accessed under VGAState::lock only */
54 # define HGSMIHOSTFLAGS_WATCHDOG 0x08u
55 #endif
56 /* vsync interrupt flag, should be accessed under VGAState::lock only */
57 #define HGSMIHOSTFLAGS_VSYNC 0x10u
58 /** monitor hotplug flag, should be accessed under VGAState::lock only */
59 #define HGSMIHOSTFLAGS_HOTPLUG 0x20u
60 /**
61 * Cursor capability state change flag, should be accessed under
62 * VGAState::lock only. @see struct vbva_conf32.
63 */
64 #define HGSMIHOSTFLAGS_CURSOR_CAPABILITIES 0x40u
65
66 struct hgsmi_host_flags {
67 /*
68 * Host flags can be accessed and modified in multiple threads
69 * concurrently, e.g. CrOpenGL HGCM and GUI threads when completing
70 * HGSMI 3D and Video Accel respectively, EMT thread when dealing with
71 * HGSMI command processing, etc.
72 * Besides settings/cleaning flags atomically, some flags have their
73 * own special sync restrictions, see comments for flags above.
74 */
75 volatile u32 host_flags;
76 u32 reserved[3];
77 };
78 assert_compile_size(struct hgsmi_host_flags, 16);
79
80 #endif