]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Include/IndustryStandard/VmwareSvga.h
Revert "OvmfPkg/QemuVideoDxe: Helper functions for unaligned port I/O."
[mirror_edk2.git] / OvmfPkg / Include / IndustryStandard / VmwareSvga.h
1 /** @file
2
3 Macro and enum definitions of a subset of port numbers, register identifiers
4 and values required for driving the VMWare SVGA virtual display adapter,
5 also implemented by Qemu.
6
7 This file's contents was extracted from file lib/vmware/svga_reg.h in commit
8 329dd537456f93a806841ec8a8213aed11395def of VMWare's vmware-svga repository:
9 git://git.code.sf.net/p/vmware-svga/git
10
11
12 Copyright 1998-2009 VMware, Inc. All rights reserved.
13 Portions Copyright 2017 Phil Dennis-Jordan <phil@philjordan.eu>
14
15 Permission is hereby granted, free of charge, to any person
16 obtaining a copy of this software and associated documentation
17 files (the "Software"), to deal in the Software without
18 restriction, including without limitation the rights to use, copy,
19 modify, merge, publish, distribute, sublicense, and/or sell copies
20 of the Software, and to permit persons to whom the Software is
21 furnished to do so, subject to the following conditions:
22
23 The above copyright notice and this permission notice shall be
24 included in all copies or substantial portions of the Software.
25
26 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
27 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
29 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
30 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
31 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
32 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33 SOFTWARE.
34
35 **/
36
37 #ifndef _VMWARE_SVGA_H_
38 #define _VMWARE_SVGA_H_
39
40 #include <Base.h>
41
42 //
43 // IDs for recognising the device
44 //
45 #define VMWARE_PCI_VENDOR_ID_VMWARE 0x15AD
46 #define VMWARE_PCI_DEVICE_ID_VMWARE_SVGA2 0x0405
47
48 //
49 // I/O port BAR offsets for register selection and read/write.
50 //
51 // The register index is written to the 32-bit index port, followed by a 32-bit
52 // read or write on the value port to read or set that register's contents.
53 //
54 #define VMWARE_SVGA_INDEX_PORT 0x0
55 #define VMWARE_SVGA_VALUE_PORT 0x1
56
57 //
58 // Some of the device's register indices for basic framebuffer functionality.
59 //
60 typedef enum {
61 VmwareSvgaRegId = 0,
62 VmwareSvgaRegEnable = 1,
63 VmwareSvgaRegWidth = 2,
64 VmwareSvgaRegHeight = 3,
65 VmwareSvgaRegMaxWidth = 4,
66 VmwareSvgaRegMaxHeight = 5,
67
68 VmwareSvgaRegBitsPerPixel = 7,
69
70 VmwareSvgaRegRedMask = 9,
71 VmwareSvgaRegGreenMask = 10,
72 VmwareSvgaRegBlueMask = 11,
73 VmwareSvgaRegBytesPerLine = 12,
74
75 VmwareSvgaRegFbOffset = 14,
76
77 VmwareSvgaRegFbSize = 16,
78 VmwareSvgaRegCapabilities = 17,
79
80 VmwareSvgaRegHostBitsPerPixel = 28,
81 } VMWARE_SVGA_REGISTER;
82
83 //
84 // Values used with VmwareSvgaRegId for sanity-checking the device and getting
85 // its version.
86 //
87 #define VMWARE_SVGA_MAGIC 0x900000U
88 #define VMWARE_SVGA_MAKE_ID(ver) (VMWARE_SVGA_MAGIC << 8 | (ver))
89
90 #define VMWARE_SVGA_VERSION_2 2
91 #define VMWARE_SVGA_ID_2 VMWARE_SVGA_MAKE_ID (VMWARE_SVGA_VERSION_2)
92
93 #define VMWARE_SVGA_VERSION_1 1
94 #define VMWARE_SVGA_ID_1 VMWARE_SVGA_MAKE_ID (VMWARE_SVGA_VERSION_1)
95
96 #define VMWARE_SVGA_VERSION_0 0
97 #define VMWARE_SVGA_ID_0 VMWARE_SVGA_MAKE_ID (VMWARE_SVGA_VERSION_0)
98
99 //
100 // One of the capability bits advertised by VmwareSvgaRegCapabilities.
101 //
102 #define VMWARE_SVGA_CAP_8BIT_EMULATION BIT8
103
104 #endif