aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Bornecrantz <jakob@vmware.com>2011-10-04 14:13:12 -0400
committerDave Airlie <airlied@redhat.com>2011-10-05 05:17:08 -0400
commit8d3713ea9ef305ec89b265633dcfb977885adf66 (patch)
tree9f3f74818b9c81b3f341abf19e27604da2e7a81d
parent4d798937889706629ceb2019a844cf81e598312b (diff)
vmwgfx: Update register files to latest from vmware-sdk
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/vmwgfx/svga3d_reg.h259
-rw-r--r--drivers/gpu/drm/vmwgfx/svga_escape.h2
-rw-r--r--drivers/gpu/drm/vmwgfx/svga_overlay.h22
-rw-r--r--drivers/gpu/drm/vmwgfx/svga_reg.h220
4 files changed, 359 insertions, 144 deletions
diff --git a/drivers/gpu/drm/vmwgfx/svga3d_reg.h b/drivers/gpu/drm/vmwgfx/svga3d_reg.h
index 77cb45331000..d0e085ee8249 100644
--- a/drivers/gpu/drm/vmwgfx/svga3d_reg.h
+++ b/drivers/gpu/drm/vmwgfx/svga3d_reg.h
@@ -57,7 +57,8 @@ typedef enum {
57 SVGA3D_HWVERSION_WS6_B1 = SVGA3D_MAKE_HWVERSION(1, 1), 57 SVGA3D_HWVERSION_WS6_B1 = SVGA3D_MAKE_HWVERSION(1, 1),
58 SVGA3D_HWVERSION_FUSION_11 = SVGA3D_MAKE_HWVERSION(1, 4), 58 SVGA3D_HWVERSION_FUSION_11 = SVGA3D_MAKE_HWVERSION(1, 4),
59 SVGA3D_HWVERSION_WS65_B1 = SVGA3D_MAKE_HWVERSION(2, 0), 59 SVGA3D_HWVERSION_WS65_B1 = SVGA3D_MAKE_HWVERSION(2, 0),
60 SVGA3D_HWVERSION_CURRENT = SVGA3D_HWVERSION_WS65_B1, 60 SVGA3D_HWVERSION_WS8_B1 = SVGA3D_MAKE_HWVERSION(2, 1),
61 SVGA3D_HWVERSION_CURRENT = SVGA3D_HWVERSION_WS8_B1,
61} SVGA3dHardwareVersion; 62} SVGA3dHardwareVersion;
62 63
63/* 64/*
@@ -67,7 +68,8 @@ typedef enum {
67typedef uint32 SVGA3dBool; /* 32-bit Bool definition */ 68typedef uint32 SVGA3dBool; /* 32-bit Bool definition */
68#define SVGA3D_NUM_CLIPPLANES 6 69#define SVGA3D_NUM_CLIPPLANES 6
69#define SVGA3D_MAX_SIMULTANEOUS_RENDER_TARGETS 8 70#define SVGA3D_MAX_SIMULTANEOUS_RENDER_TARGETS 8
70 71#define SVGA3D_MAX_CONTEXT_IDS 256
72#define SVGA3D_MAX_SURFACE_IDS (32 * 1024)
71 73
72/* 74/*
73 * Surface formats. 75 * Surface formats.
@@ -79,76 +81,91 @@ typedef uint32 SVGA3dBool; /* 32-bit Bool definition */
79 */ 81 */
80 82
81typedef enum SVGA3dSurfaceFormat { 83typedef enum SVGA3dSurfaceFormat {
82 SVGA3D_FORMAT_INVALID = 0, 84 SVGA3D_FORMAT_INVALID = 0,
83 85
84 SVGA3D_X8R8G8B8 = 1, 86 SVGA3D_X8R8G8B8 = 1,
85 SVGA3D_A8R8G8B8 = 2, 87 SVGA3D_A8R8G8B8 = 2,
86 88
87 SVGA3D_R5G6B5 = 3, 89 SVGA3D_R5G6B5 = 3,
88 SVGA3D_X1R5G5B5 = 4, 90 SVGA3D_X1R5G5B5 = 4,
89 SVGA3D_A1R5G5B5 = 5, 91 SVGA3D_A1R5G5B5 = 5,
90 SVGA3D_A4R4G4B4 = 6, 92 SVGA3D_A4R4G4B4 = 6,
91 93
92 SVGA3D_Z_D32 = 7, 94 SVGA3D_Z_D32 = 7,
93 SVGA3D_Z_D16 = 8, 95 SVGA3D_Z_D16 = 8,
94 SVGA3D_Z_D24S8 = 9, 96 SVGA3D_Z_D24S8 = 9,
95 SVGA3D_Z_D15S1 = 10, 97 SVGA3D_Z_D15S1 = 10,
96 98
97 SVGA3D_LUMINANCE8 = 11, 99 SVGA3D_LUMINANCE8 = 11,
98 SVGA3D_LUMINANCE4_ALPHA4 = 12, 100 SVGA3D_LUMINANCE4_ALPHA4 = 12,
99 SVGA3D_LUMINANCE16 = 13, 101 SVGA3D_LUMINANCE16 = 13,
100 SVGA3D_LUMINANCE8_ALPHA8 = 14, 102 SVGA3D_LUMINANCE8_ALPHA8 = 14,
101 103
102 SVGA3D_DXT1 = 15, 104 SVGA3D_DXT1 = 15,
103 SVGA3D_DXT2 = 16, 105 SVGA3D_DXT2 = 16,
104 SVGA3D_DXT3 = 17, 106 SVGA3D_DXT3 = 17,
105 SVGA3D_DXT4 = 18, 107 SVGA3D_DXT4 = 18,
106 SVGA3D_DXT5 = 19, 108 SVGA3D_DXT5 = 19,
107 109
108 SVGA3D_BUMPU8V8 = 20, 110 SVGA3D_BUMPU8V8 = 20,
109 SVGA3D_BUMPL6V5U5 = 21, 111 SVGA3D_BUMPL6V5U5 = 21,
110 SVGA3D_BUMPX8L8V8U8 = 22, 112 SVGA3D_BUMPX8L8V8U8 = 22,
111 SVGA3D_BUMPL8V8U8 = 23, 113 SVGA3D_BUMPL8V8U8 = 23,
112 114
113 SVGA3D_ARGB_S10E5 = 24, /* 16-bit floating-point ARGB */ 115 SVGA3D_ARGB_S10E5 = 24, /* 16-bit floating-point ARGB */
114 SVGA3D_ARGB_S23E8 = 25, /* 32-bit floating-point ARGB */ 116 SVGA3D_ARGB_S23E8 = 25, /* 32-bit floating-point ARGB */
115 117
116 SVGA3D_A2R10G10B10 = 26, 118 SVGA3D_A2R10G10B10 = 26,
117 119
118 /* signed formats */ 120 /* signed formats */
119 SVGA3D_V8U8 = 27, 121 SVGA3D_V8U8 = 27,
120 SVGA3D_Q8W8V8U8 = 28, 122 SVGA3D_Q8W8V8U8 = 28,
121 SVGA3D_CxV8U8 = 29, 123 SVGA3D_CxV8U8 = 29,
122 124
123 /* mixed formats */ 125 /* mixed formats */
124 SVGA3D_X8L8V8U8 = 30, 126 SVGA3D_X8L8V8U8 = 30,
125 SVGA3D_A2W10V10U10 = 31, 127 SVGA3D_A2W10V10U10 = 31,
126 128
127 SVGA3D_ALPHA8 = 32, 129 SVGA3D_ALPHA8 = 32,
128 130
129 /* Single- and dual-component floating point formats */ 131 /* Single- and dual-component floating point formats */
130 SVGA3D_R_S10E5 = 33, 132 SVGA3D_R_S10E5 = 33,
131 SVGA3D_R_S23E8 = 34, 133 SVGA3D_R_S23E8 = 34,
132 SVGA3D_RG_S10E5 = 35, 134 SVGA3D_RG_S10E5 = 35,
133 SVGA3D_RG_S23E8 = 36, 135 SVGA3D_RG_S23E8 = 36,
134 136
135 /* 137 /*
136 * Any surface can be used as a buffer object, but SVGA3D_BUFFER is 138 * Any surface can be used as a buffer object, but SVGA3D_BUFFER is
137 * the most efficient format to use when creating new surfaces 139 * the most efficient format to use when creating new surfaces
138 * expressly for index or vertex data. 140 * expressly for index or vertex data.
139 */ 141 */
140 SVGA3D_BUFFER = 37,
141 142
142 SVGA3D_Z_D24X8 = 38, 143 SVGA3D_BUFFER = 37,
144
145 SVGA3D_Z_D24X8 = 38,
143 146
144 SVGA3D_V16U16 = 39, 147 SVGA3D_V16U16 = 39,
145 148
146 SVGA3D_G16R16 = 40, 149 SVGA3D_G16R16 = 40,
147 SVGA3D_A16B16G16R16 = 41, 150 SVGA3D_A16B16G16R16 = 41,
148 151
149 /* Packed Video formats */ 152 /* Packed Video formats */
150 SVGA3D_UYVY = 42, 153 SVGA3D_UYVY = 42,
151 SVGA3D_YUY2 = 43, 154 SVGA3D_YUY2 = 43,
155
156 /* Planar video formats */
157 SVGA3D_NV12 = 44,
158
159 /* Video format with alpha */
160 SVGA3D_AYUV = 45,
161
162 SVGA3D_BC4_UNORM = 108,
163 SVGA3D_BC5_UNORM = 111,
164
165 /* Advanced D3D9 depth formats. */
166 SVGA3D_Z_DF16 = 118,
167 SVGA3D_Z_DF24 = 119,
168 SVGA3D_Z_D24S8_INT = 120,
152 169
153 SVGA3D_FORMAT_MAX 170 SVGA3D_FORMAT_MAX
154} SVGA3dSurfaceFormat; 171} SVGA3dSurfaceFormat;
@@ -414,10 +431,20 @@ typedef enum {
414 SVGA3D_RS_SRCBLENDALPHA = 94, /* SVGA3dBlendOp */ 431 SVGA3D_RS_SRCBLENDALPHA = 94, /* SVGA3dBlendOp */
415 SVGA3D_RS_DSTBLENDALPHA = 95, /* SVGA3dBlendOp */ 432 SVGA3D_RS_DSTBLENDALPHA = 95, /* SVGA3dBlendOp */
416 SVGA3D_RS_BLENDEQUATIONALPHA = 96, /* SVGA3dBlendEquation */ 433 SVGA3D_RS_BLENDEQUATIONALPHA = 96, /* SVGA3dBlendEquation */
434 SVGA3D_RS_TRANSPARENCYANTIALIAS = 97, /* SVGA3dTransparencyAntialiasType */
435 SVGA3D_RS_LINEAA = 98, /* SVGA3dBool */
436 SVGA3D_RS_LINEWIDTH = 99, /* float */
417 SVGA3D_RS_MAX 437 SVGA3D_RS_MAX
418} SVGA3dRenderStateName; 438} SVGA3dRenderStateName;
419 439
420typedef enum { 440typedef enum {
441 SVGA3D_TRANSPARENCYANTIALIAS_NORMAL = 0,
442 SVGA3D_TRANSPARENCYANTIALIAS_ALPHATOCOVERAGE = 1,
443 SVGA3D_TRANSPARENCYANTIALIAS_SUPERSAMPLE = 2,
444 SVGA3D_TRANSPARENCYANTIALIAS_MAX
445} SVGA3dTransparencyAntialiasType;
446
447typedef enum {
421 SVGA3D_VERTEXMATERIAL_NONE = 0, /* Use the value in the current material */ 448 SVGA3D_VERTEXMATERIAL_NONE = 0, /* Use the value in the current material */
422 SVGA3D_VERTEXMATERIAL_DIFFUSE = 1, /* Use the value in the diffuse component */ 449 SVGA3D_VERTEXMATERIAL_DIFFUSE = 1, /* Use the value in the diffuse component */
423 SVGA3D_VERTEXMATERIAL_SPECULAR = 2, /* Use the value in the specular component */ 450 SVGA3D_VERTEXMATERIAL_SPECULAR = 2, /* Use the value in the specular component */
@@ -728,10 +755,10 @@ typedef enum {
728 SVGA3D_TEX_FILTER_NEAREST = 1, 755 SVGA3D_TEX_FILTER_NEAREST = 1,
729 SVGA3D_TEX_FILTER_LINEAR = 2, 756 SVGA3D_TEX_FILTER_LINEAR = 2,
730 SVGA3D_TEX_FILTER_ANISOTROPIC = 3, 757 SVGA3D_TEX_FILTER_ANISOTROPIC = 3,
731 SVGA3D_TEX_FILTER_FLATCUBIC = 4, // Deprecated, not implemented 758 SVGA3D_TEX_FILTER_FLATCUBIC = 4, /* Deprecated, not implemented */
732 SVGA3D_TEX_FILTER_GAUSSIANCUBIC = 5, // Deprecated, not implemented 759 SVGA3D_TEX_FILTER_GAUSSIANCUBIC = 5, /* Deprecated, not implemented */
733 SVGA3D_TEX_FILTER_PYRAMIDALQUAD = 6, // Not currently implemented 760 SVGA3D_TEX_FILTER_PYRAMIDALQUAD = 6, /* Not currently implemented */
734 SVGA3D_TEX_FILTER_GAUSSIANQUAD = 7, // Not currently implemented 761 SVGA3D_TEX_FILTER_GAUSSIANQUAD = 7, /* Not currently implemented */
735 SVGA3D_TEX_FILTER_MAX 762 SVGA3D_TEX_FILTER_MAX
736} SVGA3dTextureFilter; 763} SVGA3dTextureFilter;
737 764
@@ -799,19 +826,19 @@ typedef enum {
799 826
800typedef enum { 827typedef enum {
801 SVGA3D_DECLUSAGE_POSITION = 0, 828 SVGA3D_DECLUSAGE_POSITION = 0,
802 SVGA3D_DECLUSAGE_BLENDWEIGHT, // 1 829 SVGA3D_DECLUSAGE_BLENDWEIGHT, /* 1 */
803 SVGA3D_DECLUSAGE_BLENDINDICES, // 2 830 SVGA3D_DECLUSAGE_BLENDINDICES, /* 2 */
804 SVGA3D_DECLUSAGE_NORMAL, // 3 831 SVGA3D_DECLUSAGE_NORMAL, /* 3 */
805 SVGA3D_DECLUSAGE_PSIZE, // 4 832 SVGA3D_DECLUSAGE_PSIZE, /* 4 */
806 SVGA3D_DECLUSAGE_TEXCOORD, // 5 833 SVGA3D_DECLUSAGE_TEXCOORD, /* 5 */
807 SVGA3D_DECLUSAGE_TANGENT, // 6 834 SVGA3D_DECLUSAGE_TANGENT, /* 6 */
808 SVGA3D_DECLUSAGE_BINORMAL, // 7 835 SVGA3D_DECLUSAGE_BINORMAL, /* 7 */
809 SVGA3D_DECLUSAGE_TESSFACTOR, // 8 836 SVGA3D_DECLUSAGE_TESSFACTOR, /* 8 */
810 SVGA3D_DECLUSAGE_POSITIONT, // 9 837 SVGA3D_DECLUSAGE_POSITIONT, /* 9 */
811 SVGA3D_DECLUSAGE_COLOR, // 10 838 SVGA3D_DECLUSAGE_COLOR, /* 10 */
812 SVGA3D_DECLUSAGE_FOG, // 11 839 SVGA3D_DECLUSAGE_FOG, /* 11 */
813 SVGA3D_DECLUSAGE_DEPTH, // 12 840 SVGA3D_DECLUSAGE_DEPTH, /* 12 */
814 SVGA3D_DECLUSAGE_SAMPLE, // 13 841 SVGA3D_DECLUSAGE_SAMPLE, /* 13 */
815 SVGA3D_DECLUSAGE_MAX 842 SVGA3D_DECLUSAGE_MAX
816} SVGA3dDeclUsage; 843} SVGA3dDeclUsage;
817 844
@@ -819,10 +846,10 @@ typedef enum {
819 SVGA3D_DECLMETHOD_DEFAULT = 0, 846 SVGA3D_DECLMETHOD_DEFAULT = 0,
820 SVGA3D_DECLMETHOD_PARTIALU, 847 SVGA3D_DECLMETHOD_PARTIALU,
821 SVGA3D_DECLMETHOD_PARTIALV, 848 SVGA3D_DECLMETHOD_PARTIALV,
822 SVGA3D_DECLMETHOD_CROSSUV, // Normal 849 SVGA3D_DECLMETHOD_CROSSUV, /* Normal */
823 SVGA3D_DECLMETHOD_UV, 850 SVGA3D_DECLMETHOD_UV,
824 SVGA3D_DECLMETHOD_LOOKUP, // Lookup a displacement map 851 SVGA3D_DECLMETHOD_LOOKUP, /* Lookup a displacement map */
825 SVGA3D_DECLMETHOD_LOOKUPPRESAMPLED, // Lookup a pre-sampled displacement map 852 SVGA3D_DECLMETHOD_LOOKUPPRESAMPLED, /* Lookup a pre-sampled displacement map */
826} SVGA3dDeclMethod; 853} SVGA3dDeclMethod;
827 854
828typedef enum { 855typedef enum {
@@ -930,7 +957,6 @@ typedef enum {
930} SVGA3dCubeFace; 957} SVGA3dCubeFace;
931 958
932typedef enum { 959typedef enum {
933 SVGA3D_SHADERTYPE_COMPILED_DX8 = 0,
934 SVGA3D_SHADERTYPE_VS = 1, 960 SVGA3D_SHADERTYPE_VS = 1,
935 SVGA3D_SHADERTYPE_PS = 2, 961 SVGA3D_SHADERTYPE_PS = 2,
936 SVGA3D_SHADERTYPE_MAX 962 SVGA3D_SHADERTYPE_MAX
@@ -968,12 +994,18 @@ typedef enum {
968} SVGA3dTransferType; 994} SVGA3dTransferType;
969 995
970/* 996/*
971 * The maximum number vertex arrays we're guaranteed to support in 997 * The maximum number of vertex arrays we're guaranteed to support in
972 * SVGA_3D_CMD_DRAWPRIMITIVES. 998 * SVGA_3D_CMD_DRAWPRIMITIVES.
973 */ 999 */
974#define SVGA3D_MAX_VERTEX_ARRAYS 32 1000#define SVGA3D_MAX_VERTEX_ARRAYS 32
975 1001
976/* 1002/*
1003 * The maximum number of primitive ranges we're guaranteed to support
1004 * in SVGA_3D_CMD_DRAWPRIMITIVES.
1005 */
1006#define SVGA3D_MAX_DRAW_PRIMITIVE_RANGES 32
1007
1008/*
977 * Identifiers for commands in the command FIFO. 1009 * Identifiers for commands in the command FIFO.
978 * 1010 *
979 * IDs between 1000 and 1039 (inclusive) were used by obsolete versions of 1011 * IDs between 1000 and 1039 (inclusive) were used by obsolete versions of
@@ -990,7 +1022,7 @@ typedef enum {
990#define SVGA_3D_CMD_LEGACY_BASE 1000 1022#define SVGA_3D_CMD_LEGACY_BASE 1000
991#define SVGA_3D_CMD_BASE 1040 1023#define SVGA_3D_CMD_BASE 1040
992 1024
993#define SVGA_3D_CMD_SURFACE_DEFINE SVGA_3D_CMD_BASE + 0 1025#define SVGA_3D_CMD_SURFACE_DEFINE SVGA_3D_CMD_BASE + 0 /* Deprecated */
994#define SVGA_3D_CMD_SURFACE_DESTROY SVGA_3D_CMD_BASE + 1 1026#define SVGA_3D_CMD_SURFACE_DESTROY SVGA_3D_CMD_BASE + 1
995#define SVGA_3D_CMD_SURFACE_COPY SVGA_3D_CMD_BASE + 2 1027#define SVGA_3D_CMD_SURFACE_COPY SVGA_3D_CMD_BASE + 2
996#define SVGA_3D_CMD_SURFACE_STRETCHBLT SVGA_3D_CMD_BASE + 3 1028#define SVGA_3D_CMD_SURFACE_STRETCHBLT SVGA_3D_CMD_BASE + 3
@@ -1008,7 +1040,7 @@ typedef enum {
1008#define SVGA_3D_CMD_SETVIEWPORT SVGA_3D_CMD_BASE + 15 1040#define SVGA_3D_CMD_SETVIEWPORT SVGA_3D_CMD_BASE + 15
1009#define SVGA_3D_CMD_SETCLIPPLANE SVGA_3D_CMD_BASE + 16 1041#define SVGA_3D_CMD_SETCLIPPLANE SVGA_3D_CMD_BASE + 16
1010#define SVGA_3D_CMD_CLEAR SVGA_3D_CMD_BASE + 17 1042#define SVGA_3D_CMD_CLEAR SVGA_3D_CMD_BASE + 17
1011#define SVGA_3D_CMD_PRESENT SVGA_3D_CMD_BASE + 18 // Deprecated 1043#define SVGA_3D_CMD_PRESENT SVGA_3D_CMD_BASE + 18 /* Deprecated */
1012#define SVGA_3D_CMD_SHADER_DEFINE SVGA_3D_CMD_BASE + 19 1044#define SVGA_3D_CMD_SHADER_DEFINE SVGA_3D_CMD_BASE + 19
1013#define SVGA_3D_CMD_SHADER_DESTROY SVGA_3D_CMD_BASE + 20 1045#define SVGA_3D_CMD_SHADER_DESTROY SVGA_3D_CMD_BASE + 20
1014#define SVGA_3D_CMD_SET_SHADER SVGA_3D_CMD_BASE + 21 1046#define SVGA_3D_CMD_SET_SHADER SVGA_3D_CMD_BASE + 21
@@ -1018,9 +1050,13 @@ typedef enum {
1018#define SVGA_3D_CMD_BEGIN_QUERY SVGA_3D_CMD_BASE + 25 1050#define SVGA_3D_CMD_BEGIN_QUERY SVGA_3D_CMD_BASE + 25
1019#define SVGA_3D_CMD_END_QUERY SVGA_3D_CMD_BASE + 26 1051#define SVGA_3D_CMD_END_QUERY SVGA_3D_CMD_BASE + 26
1020#define SVGA_3D_CMD_WAIT_FOR_QUERY SVGA_3D_CMD_BASE + 27 1052#define SVGA_3D_CMD_WAIT_FOR_QUERY SVGA_3D_CMD_BASE + 27
1021#define SVGA_3D_CMD_PRESENT_READBACK SVGA_3D_CMD_BASE + 28 // Deprecated 1053#define SVGA_3D_CMD_PRESENT_READBACK SVGA_3D_CMD_BASE + 28 /* Deprecated */
1022#define SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN SVGA_3D_CMD_BASE + 29 1054#define SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN SVGA_3D_CMD_BASE + 29
1023#define SVGA_3D_CMD_MAX SVGA_3D_CMD_BASE + 30 1055#define SVGA_3D_CMD_SURFACE_DEFINE_V2 SVGA_3D_CMD_BASE + 30
1056#define SVGA_3D_CMD_GENERATE_MIPMAPS SVGA_3D_CMD_BASE + 31
1057#define SVGA_3D_CMD_ACTIVATE_SURFACE SVGA_3D_CMD_BASE + 40
1058#define SVGA_3D_CMD_DEACTIVATE_SURFACE SVGA_3D_CMD_BASE + 41
1059#define SVGA_3D_CMD_MAX SVGA_3D_CMD_BASE + 42
1024 1060
1025#define SVGA_3D_CMD_FUTURE_MAX 2000 1061#define SVGA_3D_CMD_FUTURE_MAX 2000
1026 1062
@@ -1031,9 +1067,9 @@ typedef enum {
1031typedef struct { 1067typedef struct {
1032 union { 1068 union {
1033 struct { 1069 struct {
1034 uint16 function; // SVGA3dFogFunction 1070 uint16 function; /* SVGA3dFogFunction */
1035 uint8 type; // SVGA3dFogType 1071 uint8 type; /* SVGA3dFogType */
1036 uint8 base; // SVGA3dFogBase 1072 uint8 base; /* SVGA3dFogBase */
1037 }; 1073 };
1038 uint32 uintValue; 1074 uint32 uintValue;
1039 }; 1075 };
@@ -1109,6 +1145,8 @@ typedef enum {
1109 SVGA3D_SURFACE_HINT_RENDERTARGET = (1 << 6), 1145 SVGA3D_SURFACE_HINT_RENDERTARGET = (1 << 6),
1110 SVGA3D_SURFACE_HINT_DEPTHSTENCIL = (1 << 7), 1146 SVGA3D_SURFACE_HINT_DEPTHSTENCIL = (1 << 7),
1111 SVGA3D_SURFACE_HINT_WRITEONLY = (1 << 8), 1147 SVGA3D_SURFACE_HINT_WRITEONLY = (1 << 8),
1148 SVGA3D_SURFACE_MASKABLE_ANTIALIAS = (1 << 9),
1149 SVGA3D_SURFACE_AUTOGENMIPMAPS = (1 << 10),
1112} SVGA3dSurfaceFlags; 1150} SVGA3dSurfaceFlags;
1113 1151
1114typedef 1152typedef
@@ -1121,6 +1159,12 @@ struct {
1121 uint32 sid; 1159 uint32 sid;
1122 SVGA3dSurfaceFlags surfaceFlags; 1160 SVGA3dSurfaceFlags surfaceFlags;
1123 SVGA3dSurfaceFormat format; 1161 SVGA3dSurfaceFormat format;
1162 /*
1163 * If surfaceFlags has SVGA3D_SURFACE_CUBEMAP bit set, all SVGA3dSurfaceFace
1164 * structures must have the same value of numMipLevels field.
1165 * Otherwise, all but the first SVGA3dSurfaceFace structures must have the
1166 * numMipLevels set to 0.
1167 */
1124 SVGA3dSurfaceFace face[SVGA3D_MAX_SURFACE_FACES]; 1168 SVGA3dSurfaceFace face[SVGA3D_MAX_SURFACE_FACES];
1125 /* 1169 /*
1126 * Followed by an SVGA3dSize structure for each mip level in each face. 1170 * Followed by an SVGA3dSize structure for each mip level in each face.
@@ -1135,6 +1179,31 @@ struct {
1135 1179
1136typedef 1180typedef
1137struct { 1181struct {
1182 uint32 sid;
1183 SVGA3dSurfaceFlags surfaceFlags;
1184 SVGA3dSurfaceFormat format;
1185 /*
1186 * If surfaceFlags has SVGA3D_SURFACE_CUBEMAP bit set, all SVGA3dSurfaceFace
1187 * structures must have the same value of numMipLevels field.
1188 * Otherwise, all but the first SVGA3dSurfaceFace structures must have the
1189 * numMipLevels set to 0.
1190 */
1191 SVGA3dSurfaceFace face[SVGA3D_MAX_SURFACE_FACES];
1192 uint32 multisampleCount;
1193 SVGA3dTextureFilter autogenFilter;
1194 /*
1195 * Followed by an SVGA3dSize structure for each mip level in each face.
1196 *
1197 * A note on surface sizes: Sizes are always specified in pixels,
1198 * even if the true surface size is not a multiple of the minimum
1199 * block size of the surface's format. For example, a 3x3x1 DXT1
1200 * compressed texture would actually be stored as a 4x4x1 image in
1201 * memory.
1202 */
1203} SVGA3dCmdDefineSurface_v2; /* SVGA_3D_CMD_SURFACE_DEFINE_V2 */
1204
1205typedef
1206struct {
1138 uint32 sid; 1207 uint32 sid;
1139} SVGA3dCmdDestroySurface; /* SVGA_3D_CMD_SURFACE_DESTROY */ 1208} SVGA3dCmdDestroySurface; /* SVGA_3D_CMD_SURFACE_DESTROY */
1140 1209
@@ -1474,10 +1543,12 @@ struct {
1474 * SVGA3dCmdDrawPrimitives structure. In order, 1543 * SVGA3dCmdDrawPrimitives structure. In order,
1475 * they are: 1544 * they are:
1476 * 1545 *
1477 * 1. SVGA3dVertexDecl, quantity 'numVertexDecls' 1546 * 1. SVGA3dVertexDecl, quantity 'numVertexDecls', but no more than
1478 * 2. SVGA3dPrimitiveRange, quantity 'numRanges' 1547 * SVGA3D_MAX_VERTEX_ARRAYS;
1548 * 2. SVGA3dPrimitiveRange, quantity 'numRanges', but no more than
1549 * SVGA3D_MAX_DRAW_PRIMITIVE_RANGES;
1479 * 3. Optionally, SVGA3dVertexDivisor, quantity 'numVertexDecls' (contains 1550 * 3. Optionally, SVGA3dVertexDivisor, quantity 'numVertexDecls' (contains
1480 * the frequency divisor for this the corresponding vertex decl) 1551 * the frequency divisor for the corresponding vertex decl).
1481 */ 1552 */
1482} SVGA3dCmdDrawPrimitives; /* SVGA_3D_CMD_DRAWPRIMITIVES */ 1553} SVGA3dCmdDrawPrimitives; /* SVGA_3D_CMD_DRAWPRIMITIVES */
1483 1554
@@ -1671,6 +1742,12 @@ struct {
1671 /* Clipping: zero or more SVGASignedRects follow */ 1742 /* Clipping: zero or more SVGASignedRects follow */
1672} SVGA3dCmdBlitSurfaceToScreen; /* SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN */ 1743} SVGA3dCmdBlitSurfaceToScreen; /* SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN */
1673 1744
1745typedef
1746struct {
1747 uint32 sid;
1748 SVGA3dTextureFilter filter;
1749} SVGA3dCmdGenerateMipmaps; /* SVGA_3D_CMD_GENERATE_MIPMAPS */
1750
1674 1751
1675/* 1752/*
1676 * Capability query index. 1753 * Capability query index.
@@ -1774,6 +1851,32 @@ typedef enum {
1774 SVGA3D_DEVCAP_SURFACEFMT_A16B16G16R16 = 67, 1851 SVGA3D_DEVCAP_SURFACEFMT_A16B16G16R16 = 67,
1775 SVGA3D_DEVCAP_SURFACEFMT_UYVY = 68, 1852 SVGA3D_DEVCAP_SURFACEFMT_UYVY = 68,
1776 SVGA3D_DEVCAP_SURFACEFMT_YUY2 = 69, 1853 SVGA3D_DEVCAP_SURFACEFMT_YUY2 = 69,
1854 SVGA3D_DEVCAP_MULTISAMPLE_NONMASKABLESAMPLES = 70,
1855 SVGA3D_DEVCAP_MULTISAMPLE_MASKABLESAMPLES = 71,
1856 SVGA3D_DEVCAP_ALPHATOCOVERAGE = 72,
1857 SVGA3D_DEVCAP_SUPERSAMPLE = 73,
1858 SVGA3D_DEVCAP_AUTOGENMIPMAPS = 74,
1859 SVGA3D_DEVCAP_SURFACEFMT_NV12 = 75,
1860 SVGA3D_DEVCAP_SURFACEFMT_AYUV = 76,
1861
1862 /*
1863 * This is the maximum number of SVGA context IDs that the guest
1864 * can define using SVGA_3D_CMD_CONTEXT_DEFINE.
1865 */
1866 SVGA3D_DEVCAP_MAX_CONTEXT_IDS = 77,
1867
1868 /*
1869 * This is the maximum number of SVGA surface IDs that the guest
1870 * can define using SVGA_3D_CMD_SURFACE_DEFINE*.
1871 */
1872 SVGA3D_DEVCAP_MAX_SURFACE_IDS = 78,
1873
1874 SVGA3D_DEVCAP_SURFACEFMT_Z_DF16 = 79,
1875 SVGA3D_DEVCAP_SURFACEFMT_Z_DF24 = 80,
1876 SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8_INT = 81,
1877
1878 SVGA3D_DEVCAP_SURFACEFMT_BC4_UNORM = 82,
1879 SVGA3D_DEVCAP_SURFACEFMT_BC5_UNORM = 83,
1777 1880
1778 /* 1881 /*
1779 * Don't add new caps into the previous section; the values in this 1882 * Don't add new caps into the previous section; the values in this
diff --git a/drivers/gpu/drm/vmwgfx/svga_escape.h b/drivers/gpu/drm/vmwgfx/svga_escape.h
index 7b85e9b8c854..8e8d9682e018 100644
--- a/drivers/gpu/drm/vmwgfx/svga_escape.h
+++ b/drivers/gpu/drm/vmwgfx/svga_escape.h
@@ -75,7 +75,7 @@
75 */ 75 */
76 76
77#define SVGA_ESCAPE_VMWARE_HINT 0x00030000 77#define SVGA_ESCAPE_VMWARE_HINT 0x00030000
78#define SVGA_ESCAPE_VMWARE_HINT_FULLSCREEN 0x00030001 // Deprecated 78#define SVGA_ESCAPE_VMWARE_HINT_FULLSCREEN 0x00030001 /* Deprecated */
79 79
80typedef 80typedef
81struct { 81struct {
diff --git a/drivers/gpu/drm/vmwgfx/svga_overlay.h b/drivers/gpu/drm/vmwgfx/svga_overlay.h
index f753d73c14b4..f38416fcb046 100644
--- a/drivers/gpu/drm/vmwgfx/svga_overlay.h
+++ b/drivers/gpu/drm/vmwgfx/svga_overlay.h
@@ -38,9 +38,9 @@
38 * Video formats we support 38 * Video formats we support
39 */ 39 */
40 40
41#define VMWARE_FOURCC_YV12 0x32315659 // 'Y' 'V' '1' '2' 41#define VMWARE_FOURCC_YV12 0x32315659 /* 'Y' 'V' '1' '2' */
42#define VMWARE_FOURCC_YUY2 0x32595559 // 'Y' 'U' 'Y' '2' 42#define VMWARE_FOURCC_YUY2 0x32595559 /* 'Y' 'U' 'Y' '2' */
43#define VMWARE_FOURCC_UYVY 0x59565955 // 'U' 'Y' 'V' 'Y' 43#define VMWARE_FOURCC_UYVY 0x59565955 /* 'U' 'Y' 'V' 'Y' */
44 44
45typedef enum { 45typedef enum {
46 SVGA_OVERLAY_FORMAT_INVALID = 0, 46 SVGA_OVERLAY_FORMAT_INVALID = 0,
@@ -68,7 +68,7 @@ struct SVGAEscapeVideoSetRegs {
68 uint32 streamId; 68 uint32 streamId;
69 } header; 69 } header;
70 70
71 // May include zero or more items. 71 /* May include zero or more items. */
72 struct { 72 struct {
73 uint32 registerId; 73 uint32 registerId;
74 uint32 value; 74 uint32 value;
@@ -134,12 +134,12 @@ struct {
134 */ 134 */
135 135
136static inline bool 136static inline bool
137VMwareVideoGetAttributes(const SVGAOverlayFormat format, // IN 137VMwareVideoGetAttributes(const SVGAOverlayFormat format, /* IN */
138 uint32 *width, // IN / OUT 138 uint32 *width, /* IN / OUT */
139 uint32 *height, // IN / OUT 139 uint32 *height, /* IN / OUT */
140 uint32 *size, // OUT 140 uint32 *size, /* OUT */
141 uint32 *pitches, // OUT (optional) 141 uint32 *pitches, /* OUT (optional) */
142 uint32 *offsets) // OUT (optional) 142 uint32 *offsets) /* OUT (optional) */
143{ 143{
144 int tmp; 144 int tmp;
145 145
@@ -198,4 +198,4 @@ VMwareVideoGetAttributes(const SVGAOverlayFormat format, // IN
198 return true; 198 return true;
199} 199}
200 200
201#endif // _SVGA_OVERLAY_H_ 201#endif /* _SVGA_OVERLAY_H_ */
diff --git a/drivers/gpu/drm/vmwgfx/svga_reg.h b/drivers/gpu/drm/vmwgfx/svga_reg.h
index ec5aad9b6ed3..01f63cb49678 100644
--- a/drivers/gpu/drm/vmwgfx/svga_reg.h
+++ b/drivers/gpu/drm/vmwgfx/svga_reg.h
@@ -276,7 +276,7 @@ enum {
276 * possible. 276 * possible.
277 */ 277 */
278#define SVGA_GMR_NULL ((uint32) -1) 278#define SVGA_GMR_NULL ((uint32) -1)
279#define SVGA_GMR_FRAMEBUFFER ((uint32) -2) // Guest Framebuffer (GFB) 279#define SVGA_GMR_FRAMEBUFFER ((uint32) -2) /* Guest Framebuffer (GFB) */
280 280
281typedef 281typedef
282struct SVGAGuestMemDescriptor { 282struct SVGAGuestMemDescriptor {
@@ -317,13 +317,35 @@ struct SVGAGMRImageFormat {
317 struct { 317 struct {
318 uint32 bitsPerPixel : 8; 318 uint32 bitsPerPixel : 8;
319 uint32 colorDepth : 8; 319 uint32 colorDepth : 8;
320 uint32 reserved : 16; // Must be zero 320 uint32 reserved : 16; /* Must be zero */
321 }; 321 };
322 322
323 uint32 value; 323 uint32 value;
324 }; 324 };
325} SVGAGMRImageFormat; 325} SVGAGMRImageFormat;
326 326
327typedef
328struct SVGAGuestImage {
329 SVGAGuestPtr ptr;
330
331 /*
332 * A note on interpretation of pitch: This value of pitch is the
333 * number of bytes between vertically adjacent image
334 * blocks. Normally this is the number of bytes between the first
335 * pixel of two adjacent scanlines. With compressed textures,
336 * however, this may represent the number of bytes between
337 * compression blocks rather than between rows of pixels.
338 *
339 * XXX: Compressed textures currently must be tightly packed in guest memory.
340 *
341 * If the image is 1-dimensional, pitch is ignored.
342 *
343 * If 'pitch' is zero, the SVGA3D device calculates a pitch value
344 * assuming each row of blocks is tightly packed.
345 */
346 uint32 pitch;
347} SVGAGuestImage;
348
327/* 349/*
328 * SVGAColorBGRX -- 350 * SVGAColorBGRX --
329 * 351 *
@@ -339,7 +361,7 @@ struct SVGAColorBGRX {
339 uint32 b : 8; 361 uint32 b : 8;
340 uint32 g : 8; 362 uint32 g : 8;
341 uint32 r : 8; 363 uint32 r : 8;
342 uint32 x : 8; // Unused 364 uint32 x : 8; /* Unused */
343 }; 365 };
344 366
345 uint32 value; 367 uint32 value;
@@ -395,16 +417,16 @@ struct SVGASignedPoint {
395#define SVGA_CAP_NONE 0x00000000 417#define SVGA_CAP_NONE 0x00000000
396#define SVGA_CAP_RECT_COPY 0x00000002 418#define SVGA_CAP_RECT_COPY 0x00000002
397#define SVGA_CAP_CURSOR 0x00000020 419#define SVGA_CAP_CURSOR 0x00000020
398#define SVGA_CAP_CURSOR_BYPASS 0x00000040 // Legacy (Use Cursor Bypass 3 instead) 420#define SVGA_CAP_CURSOR_BYPASS 0x00000040 /* Legacy (Use Cursor Bypass 3 instead) */
399#define SVGA_CAP_CURSOR_BYPASS_2 0x00000080 // Legacy (Use Cursor Bypass 3 instead) 421#define SVGA_CAP_CURSOR_BYPASS_2 0x00000080 /* Legacy (Use Cursor Bypass 3 instead) */
400#define SVGA_CAP_8BIT_EMULATION 0x00000100 422#define SVGA_CAP_8BIT_EMULATION 0x00000100
401#define SVGA_CAP_ALPHA_CURSOR 0x00000200 423#define SVGA_CAP_ALPHA_CURSOR 0x00000200
402#define SVGA_CAP_3D 0x00004000 424#define SVGA_CAP_3D 0x00004000
403#define SVGA_CAP_EXTENDED_FIFO 0x00008000 425#define SVGA_CAP_EXTENDED_FIFO 0x00008000
404#define SVGA_CAP_MULTIMON 0x00010000 // Legacy multi-monitor support 426#define SVGA_CAP_MULTIMON 0x00010000 /* Legacy multi-monitor support */
405#define SVGA_CAP_PITCHLOCK 0x00020000 427#define SVGA_CAP_PITCHLOCK 0x00020000
406#define SVGA_CAP_IRQMASK 0x00040000 428#define SVGA_CAP_IRQMASK 0x00040000
407#define SVGA_CAP_DISPLAY_TOPOLOGY 0x00080000 // Legacy multi-monitor support 429#define SVGA_CAP_DISPLAY_TOPOLOGY 0x00080000 /* Legacy multi-monitor support */
408#define SVGA_CAP_GMR 0x00100000 430#define SVGA_CAP_GMR 0x00100000
409#define SVGA_CAP_TRACES 0x00200000 431#define SVGA_CAP_TRACES 0x00200000
410#define SVGA_CAP_GMR2 0x00400000 432#define SVGA_CAP_GMR2 0x00400000
@@ -453,7 +475,7 @@ enum {
453 475
454 SVGA_FIFO_CAPABILITIES = 4, 476 SVGA_FIFO_CAPABILITIES = 4,
455 SVGA_FIFO_FLAGS, 477 SVGA_FIFO_FLAGS,
456 // Valid with SVGA_FIFO_CAP_FENCE: 478 /* Valid with SVGA_FIFO_CAP_FENCE: */
457 SVGA_FIFO_FENCE, 479 SVGA_FIFO_FENCE,
458 480
459 /* 481 /*
@@ -466,33 +488,47 @@ enum {
466 * extended FIFO. 488 * extended FIFO.
467 */ 489 */
468 490
469 // Valid if exists (i.e. if extended FIFO enabled): 491 /* Valid if exists (i.e. if extended FIFO enabled): */
470 SVGA_FIFO_3D_HWVERSION, /* See SVGA3dHardwareVersion in svga3d_reg.h */ 492 SVGA_FIFO_3D_HWVERSION, /* See SVGA3dHardwareVersion in svga3d_reg.h */
471 // Valid with SVGA_FIFO_CAP_PITCHLOCK: 493 /* Valid with SVGA_FIFO_CAP_PITCHLOCK: */
472 SVGA_FIFO_PITCHLOCK, 494 SVGA_FIFO_PITCHLOCK,
473 495
474 // Valid with SVGA_FIFO_CAP_CURSOR_BYPASS_3: 496 /* Valid with SVGA_FIFO_CAP_CURSOR_BYPASS_3: */
475 SVGA_FIFO_CURSOR_ON, /* Cursor bypass 3 show/hide register */ 497 SVGA_FIFO_CURSOR_ON, /* Cursor bypass 3 show/hide register */
476 SVGA_FIFO_CURSOR_X, /* Cursor bypass 3 x register */ 498 SVGA_FIFO_CURSOR_X, /* Cursor bypass 3 x register */
477 SVGA_FIFO_CURSOR_Y, /* Cursor bypass 3 y register */ 499 SVGA_FIFO_CURSOR_Y, /* Cursor bypass 3 y register */
478 SVGA_FIFO_CURSOR_COUNT, /* Incremented when any of the other 3 change */ 500 SVGA_FIFO_CURSOR_COUNT, /* Incremented when any of the other 3 change */
479 SVGA_FIFO_CURSOR_LAST_UPDATED,/* Last time the host updated the cursor */ 501 SVGA_FIFO_CURSOR_LAST_UPDATED,/* Last time the host updated the cursor */
480 502
481 // Valid with SVGA_FIFO_CAP_RESERVE: 503 /* Valid with SVGA_FIFO_CAP_RESERVE: */
482 SVGA_FIFO_RESERVED, /* Bytes past NEXT_CMD with real contents */ 504 SVGA_FIFO_RESERVED, /* Bytes past NEXT_CMD with real contents */
483 505
484 /* 506 /*
485 * Valid with SVGA_FIFO_CAP_SCREEN_OBJECT: 507 * Valid with SVGA_FIFO_CAP_SCREEN_OBJECT or SVGA_FIFO_CAP_SCREEN_OBJECT_2:
486 * 508 *
487 * By default this is SVGA_ID_INVALID, to indicate that the cursor 509 * By default this is SVGA_ID_INVALID, to indicate that the cursor
488 * coordinates are specified relative to the virtual root. If this 510 * coordinates are specified relative to the virtual root. If this
489 * is set to a specific screen ID, cursor position is reinterpreted 511 * is set to a specific screen ID, cursor position is reinterpreted
490 * as a signed offset relative to that screen's origin. This is the 512 * as a signed offset relative to that screen's origin.
491 * only way to place the cursor on a non-rooted screen.
492 */ 513 */
493 SVGA_FIFO_CURSOR_SCREEN_ID, 514 SVGA_FIFO_CURSOR_SCREEN_ID,
494 515
495 /* 516 /*
517 * Valid with SVGA_FIFO_CAP_DEAD
518 *
519 * An arbitrary value written by the host, drivers should not use it.
520 */
521 SVGA_FIFO_DEAD,
522
523 /*
524 * Valid with SVGA_FIFO_CAP_3D_HWVERSION_REVISED:
525 *
526 * Contains 3D HWVERSION (see SVGA3dHardwareVersion in svga3d_reg.h)
527 * on platforms that can enforce graphics resource limits.
528 */
529 SVGA_FIFO_3D_HWVERSION_REVISED,
530
531 /*
496 * XXX: The gap here, up until SVGA_FIFO_3D_CAPS, can be used for new 532 * XXX: The gap here, up until SVGA_FIFO_3D_CAPS, can be used for new
497 * registers, but this must be done carefully and with judicious use of 533 * registers, but this must be done carefully and with judicious use of
498 * capability bits, since comparisons based on SVGA_FIFO_MIN aren't 534 * capability bits, since comparisons based on SVGA_FIFO_MIN aren't
@@ -530,7 +566,7 @@ enum {
530 * sets SVGA_FIFO_MIN high enough to leave room for them. 566 * sets SVGA_FIFO_MIN high enough to leave room for them.
531 */ 567 */
532 568
533 // Valid if register exists: 569 /* Valid if register exists: */
534 SVGA_FIFO_GUEST_3D_HWVERSION, /* Guest driver's 3D version */ 570 SVGA_FIFO_GUEST_3D_HWVERSION, /* Guest driver's 3D version */
535 SVGA_FIFO_FENCE_GOAL, /* Matching target for SVGA_IRQFLAG_FENCE_GOAL */ 571 SVGA_FIFO_FENCE_GOAL, /* Matching target for SVGA_IRQFLAG_FENCE_GOAL */
536 SVGA_FIFO_BUSY, /* See "FIFO Synchronization Registers" */ 572 SVGA_FIFO_BUSY, /* See "FIFO Synchronization Registers" */
@@ -731,6 +767,37 @@ enum {
731 * 767 *
732 * - When a screen is resized, either using Screen Object commands or 768 * - When a screen is resized, either using Screen Object commands or
733 * legacy multimon registers, its contents are preserved. 769 * legacy multimon registers, its contents are preserved.
770 *
771 * SVGA_FIFO_CAP_GMR2 --
772 *
773 * Provides new commands to define and remap guest memory regions (GMR).
774 *
775 * New 2D commands:
776 * DEFINE_GMR2, REMAP_GMR2.
777 *
778 * SVGA_FIFO_CAP_3D_HWVERSION_REVISED --
779 *
780 * Indicates new register SVGA_FIFO_3D_HWVERSION_REVISED exists.
781 * This register may replace SVGA_FIFO_3D_HWVERSION on platforms
782 * that enforce graphics resource limits. This allows the platform
783 * to clear SVGA_FIFO_3D_HWVERSION and disable 3D in legacy guest
784 * drivers that do not limit their resources.
785 *
786 * Note this is an alias to SVGA_FIFO_CAP_GMR2 because these indicators
787 * are codependent (and thus we use a single capability bit).
788 *
789 * SVGA_FIFO_CAP_SCREEN_OBJECT_2 --
790 *
791 * Modifies the DEFINE_SCREEN command to include a guest provided
792 * backing store in GMR memory and the bytesPerLine for the backing
793 * store. This capability requires the use of a backing store when
794 * creating screen objects. However if SVGA_FIFO_CAP_SCREEN_OBJECT
795 * is present then backing stores are optional.
796 *
797 * SVGA_FIFO_CAP_DEAD --
798 *
799 * Drivers should not use this cap bit. This cap bit can not be
800 * reused since some hosts already expose it.
734 */ 801 */
735 802
736#define SVGA_FIFO_CAP_NONE 0 803#define SVGA_FIFO_CAP_NONE 0
@@ -742,6 +809,10 @@ enum {
742#define SVGA_FIFO_CAP_ESCAPE (1<<5) 809#define SVGA_FIFO_CAP_ESCAPE (1<<5)
743#define SVGA_FIFO_CAP_RESERVE (1<<6) 810#define SVGA_FIFO_CAP_RESERVE (1<<6)
744#define SVGA_FIFO_CAP_SCREEN_OBJECT (1<<7) 811#define SVGA_FIFO_CAP_SCREEN_OBJECT (1<<7)
812#define SVGA_FIFO_CAP_GMR2 (1<<8)
813#define SVGA_FIFO_CAP_3D_HWVERSION_REVISED SVGA_FIFO_CAP_GMR2
814#define SVGA_FIFO_CAP_SCREEN_OBJECT_2 (1<<9)
815#define SVGA_FIFO_CAP_DEAD (1<<10)
745 816
746 817
747/* 818/*
@@ -752,7 +823,7 @@ enum {
752 823
753#define SVGA_FIFO_FLAG_NONE 0 824#define SVGA_FIFO_FLAG_NONE 0
754#define SVGA_FIFO_FLAG_ACCELFRONT (1<<0) 825#define SVGA_FIFO_FLAG_ACCELFRONT (1<<0)
755#define SVGA_FIFO_FLAG_RESERVED (1<<31) // Internal use only 826#define SVGA_FIFO_FLAG_RESERVED (1<<31) /* Internal use only */
756 827
757/* 828/*
758 * FIFO reservation sentinel value 829 * FIFO reservation sentinel value
@@ -785,22 +856,22 @@ enum {
785 SVGA_VIDEO_DATA_OFFSET, 856 SVGA_VIDEO_DATA_OFFSET,
786 SVGA_VIDEO_FORMAT, 857 SVGA_VIDEO_FORMAT,
787 SVGA_VIDEO_COLORKEY, 858 SVGA_VIDEO_COLORKEY,
788 SVGA_VIDEO_SIZE, // Deprecated 859 SVGA_VIDEO_SIZE, /* Deprecated */
789 SVGA_VIDEO_WIDTH, 860 SVGA_VIDEO_WIDTH,
790 SVGA_VIDEO_HEIGHT, 861 SVGA_VIDEO_HEIGHT,
791 SVGA_VIDEO_SRC_X, 862 SVGA_VIDEO_SRC_X,
792 SVGA_VIDEO_SRC_Y, 863 SVGA_VIDEO_SRC_Y,
793 SVGA_VIDEO_SRC_WIDTH, 864 SVGA_VIDEO_SRC_WIDTH,
794 SVGA_VIDEO_SRC_HEIGHT, 865 SVGA_VIDEO_SRC_HEIGHT,
795 SVGA_VIDEO_DST_X, // Signed int32 866 SVGA_VIDEO_DST_X, /* Signed int32 */
796 SVGA_VIDEO_DST_Y, // Signed int32 867 SVGA_VIDEO_DST_Y, /* Signed int32 */
797 SVGA_VIDEO_DST_WIDTH, 868 SVGA_VIDEO_DST_WIDTH,
798 SVGA_VIDEO_DST_HEIGHT, 869 SVGA_VIDEO_DST_HEIGHT,
799 SVGA_VIDEO_PITCH_1, 870 SVGA_VIDEO_PITCH_1,
800 SVGA_VIDEO_PITCH_2, 871 SVGA_VIDEO_PITCH_2,
801 SVGA_VIDEO_PITCH_3, 872 SVGA_VIDEO_PITCH_3,
802 SVGA_VIDEO_DATA_GMRID, // Optional, defaults to SVGA_GMR_FRAMEBUFFER 873 SVGA_VIDEO_DATA_GMRID, /* Optional, defaults to SVGA_GMR_FRAMEBUFFER */
803 SVGA_VIDEO_DST_SCREEN_ID, // Optional, defaults to virtual coords (SVGA_ID_INVALID) 874 SVGA_VIDEO_DST_SCREEN_ID, /* Optional, defaults to virtual coords (SVGA_ID_INVALID) */
804 SVGA_VIDEO_NUM_REGS 875 SVGA_VIDEO_NUM_REGS
805}; 876};
806 877
@@ -851,15 +922,51 @@ typedef struct SVGAOverlayUnit {
851 * compatibility. New flags can be added, and the struct may grow, 922 * compatibility. New flags can be added, and the struct may grow,
852 * but existing fields must retain their meaning. 923 * but existing fields must retain their meaning.
853 * 924 *
925 * Added with SVGA_FIFO_CAP_SCREEN_OBJECT_2 are required fields of
926 * a SVGAGuestPtr that is used to back the screen contents. This
927 * memory must come from the GFB. The guest is not allowed to
928 * access the memory and doing so will have undefined results. The
929 * backing store is required to be page aligned and the size is
930 * padded to the next page boundry. The number of pages is:
931 * (bytesPerLine * size.width * 4 + PAGE_SIZE - 1) / PAGE_SIZE
932 *
933 * The pitch in the backingStore is required to be at least large
934 * enough to hold a 32bbp scanline. It is recommended that the
935 * driver pad bytesPerLine for a potential performance win.
936 *
937 * The cloneCount field is treated as a hint from the guest that
938 * the user wants this display to be cloned, countCount times. A
939 * value of zero means no cloning should happen.
854 */ 940 */
855 941
856#define SVGA_SCREEN_HAS_ROOT (1 << 0) // Screen is present in the virtual coord space 942#define SVGA_SCREEN_MUST_BE_SET (1 << 0) /* Must be set or results undefined */
857#define SVGA_SCREEN_IS_PRIMARY (1 << 1) // Guest considers this screen to be 'primary' 943#define SVGA_SCREEN_HAS_ROOT SVGA_SCREEN_MUST_BE_SET /* Deprecated */
858#define SVGA_SCREEN_FULLSCREEN_HINT (1 << 2) // Guest is running a fullscreen app here 944#define SVGA_SCREEN_IS_PRIMARY (1 << 1) /* Guest considers this screen to be 'primary' */
945#define SVGA_SCREEN_FULLSCREEN_HINT (1 << 2) /* Guest is running a fullscreen app here */
946
947/*
948 * Added with SVGA_FIFO_CAP_SCREEN_OBJECT_2. When the screen is
949 * deactivated the base layer is defined to lose all contents and
950 * become black. When a screen is deactivated the backing store is
951 * optional. When set backingPtr and bytesPerLine will be ignored.
952 */
953#define SVGA_SCREEN_DEACTIVATE (1 << 3)
954
955/*
956 * Added with SVGA_FIFO_CAP_SCREEN_OBJECT_2. When this flag is set
957 * the screen contents will be outputted as all black to the user
958 * though the base layer contents is preserved. The screen base layer
959 * can still be read and written to like normal though the no visible
960 * effect will be seen by the user. When the flag is changed the
961 * screen will be blanked or redrawn to the current contents as needed
962 * without any extra commands from the driver. This flag only has an
963 * effect when the screen is not deactivated.
964 */
965#define SVGA_SCREEN_BLANKING (1 << 4)
859 966
860typedef 967typedef
861struct SVGAScreenObject { 968struct SVGAScreenObject {
862 uint32 structSize; // sizeof(SVGAScreenObject) 969 uint32 structSize; /* sizeof(SVGAScreenObject) */
863 uint32 id; 970 uint32 id;
864 uint32 flags; 971 uint32 flags;
865 struct { 972 struct {
@@ -869,7 +976,14 @@ struct SVGAScreenObject {
869 struct { 976 struct {
870 int32 x; 977 int32 x;
871 int32 y; 978 int32 y;
872 } root; // Only used if SVGA_SCREEN_HAS_ROOT is set. 979 } root;
980
981 /*
982 * Added and required by SVGA_FIFO_CAP_SCREEN_OBJECT_2, optional
983 * with SVGA_FIFO_CAP_SCREEN_OBJECT.
984 */
985 SVGAGuestImage backingStore;
986 uint32 cloneCount;
873} SVGAScreenObject; 987} SVGAScreenObject;
874 988
875 989
@@ -944,7 +1058,7 @@ typedef enum {
944 */ 1058 */
945 1059
946typedef 1060typedef
947struct { 1061struct SVGAFifoCmdUpdate {
948 uint32 x; 1062 uint32 x;
949 uint32 y; 1063 uint32 y;
950 uint32 width; 1064 uint32 width;
@@ -963,7 +1077,7 @@ struct {
963 */ 1077 */
964 1078
965typedef 1079typedef
966struct { 1080struct SVGAFifoCmdRectCopy {
967 uint32 srcX; 1081 uint32 srcX;
968 uint32 srcY; 1082 uint32 srcY;
969 uint32 destX; 1083 uint32 destX;
@@ -987,14 +1101,14 @@ struct {
987 */ 1101 */
988 1102
989typedef 1103typedef
990struct { 1104struct SVGAFifoCmdDefineCursor {
991 uint32 id; // Reserved, must be zero. 1105 uint32 id; /* Reserved, must be zero. */
992 uint32 hotspotX; 1106 uint32 hotspotX;
993 uint32 hotspotY; 1107 uint32 hotspotY;
994 uint32 width; 1108 uint32 width;
995 uint32 height; 1109 uint32 height;
996 uint32 andMaskDepth; // Value must be 1 or equal to BITS_PER_PIXEL 1110 uint32 andMaskDepth; /* Value must be 1 or equal to BITS_PER_PIXEL */
997 uint32 xorMaskDepth; // Value must be 1 or equal to BITS_PER_PIXEL 1111 uint32 xorMaskDepth; /* Value must be 1 or equal to BITS_PER_PIXEL */
998 /* 1112 /*
999 * Followed by scanline data for AND mask, then XOR mask. 1113 * Followed by scanline data for AND mask, then XOR mask.
1000 * Each scanline is padded to a 32-bit boundary. 1114 * Each scanline is padded to a 32-bit boundary.
@@ -1016,8 +1130,8 @@ struct {
1016 */ 1130 */
1017 1131
1018typedef 1132typedef
1019struct { 1133struct SVGAFifoCmdDefineAlphaCursor {
1020 uint32 id; // Reserved, must be zero. 1134 uint32 id; /* Reserved, must be zero. */
1021 uint32 hotspotX; 1135 uint32 hotspotX;
1022 uint32 hotspotY; 1136 uint32 hotspotY;
1023 uint32 width; 1137 uint32 width;
@@ -1039,7 +1153,7 @@ struct {
1039 */ 1153 */
1040 1154
1041typedef 1155typedef
1042struct { 1156struct SVGAFifoCmdUpdateVerbose {
1043 uint32 x; 1157 uint32 x;
1044 uint32 y; 1158 uint32 y;
1045 uint32 width; 1159 uint32 width;
@@ -1064,13 +1178,13 @@ struct {
1064#define SVGA_ROP_COPY 0x03 1178#define SVGA_ROP_COPY 0x03
1065 1179
1066typedef 1180typedef
1067struct { 1181struct SVGAFifoCmdFrontRopFill {
1068 uint32 color; // In the same format as the GFB 1182 uint32 color; /* In the same format as the GFB */
1069 uint32 x; 1183 uint32 x;
1070 uint32 y; 1184 uint32 y;
1071 uint32 width; 1185 uint32 width;
1072 uint32 height; 1186 uint32 height;
1073 uint32 rop; // Must be SVGA_ROP_COPY 1187 uint32 rop; /* Must be SVGA_ROP_COPY */
1074} SVGAFifoCmdFrontRopFill; 1188} SVGAFifoCmdFrontRopFill;
1075 1189
1076 1190
@@ -1107,7 +1221,7 @@ struct {
1107 */ 1221 */
1108 1222
1109typedef 1223typedef
1110struct { 1224struct SVGAFifoCmdEscape {
1111 uint32 nsid; 1225 uint32 nsid;
1112 uint32 size; 1226 uint32 size;
1113 /* followed by 'size' bytes of data */ 1227 /* followed by 'size' bytes of data */
@@ -1137,12 +1251,12 @@ struct {
1137 * registers (SVGA_REG_NUM_GUEST_DISPLAYS, SVGA_REG_DISPLAY_*). 1251 * registers (SVGA_REG_NUM_GUEST_DISPLAYS, SVGA_REG_DISPLAY_*).
1138 * 1252 *
1139 * Availability: 1253 * Availability:
1140 * SVGA_FIFO_CAP_SCREEN_OBJECT 1254 * SVGA_FIFO_CAP_SCREEN_OBJECT or SVGA_FIFO_CAP_SCREEN_OBJECT_2
1141 */ 1255 */
1142 1256
1143typedef 1257typedef
1144struct { 1258struct {
1145 SVGAScreenObject screen; // Variable-length according to version 1259 SVGAScreenObject screen; /* Variable-length according to version */
1146} SVGAFifoCmdDefineScreen; 1260} SVGAFifoCmdDefineScreen;
1147 1261
1148 1262
@@ -1153,7 +1267,7 @@ struct {
1153 * re-use. 1267 * re-use.
1154 * 1268 *
1155 * Availability: 1269 * Availability:
1156 * SVGA_FIFO_CAP_SCREEN_OBJECT 1270 * SVGA_FIFO_CAP_SCREEN_OBJECT or SVGA_FIFO_CAP_SCREEN_OBJECT_2
1157 */ 1271 */
1158 1272
1159typedef 1273typedef
@@ -1206,7 +1320,7 @@ struct {
1206 * GMRFB. 1320 * GMRFB.
1207 * 1321 *
1208 * Availability: 1322 * Availability:
1209 * SVGA_FIFO_CAP_SCREEN_OBJECT 1323 * SVGA_FIFO_CAP_SCREEN_OBJECT or SVGA_FIFO_CAP_SCREEN_OBJECT_2
1210 */ 1324 */
1211 1325
1212typedef 1326typedef
@@ -1243,7 +1357,7 @@ struct {
1243 * SVGA_CMD_ANNOTATION_* commands for details. 1357 * SVGA_CMD_ANNOTATION_* commands for details.
1244 * 1358 *
1245 * Availability: 1359 * Availability:
1246 * SVGA_FIFO_CAP_SCREEN_OBJECT 1360 * SVGA_FIFO_CAP_SCREEN_OBJECT or SVGA_FIFO_CAP_SCREEN_OBJECT_2
1247 */ 1361 */
1248 1362
1249typedef 1363typedef
@@ -1291,7 +1405,7 @@ struct {
1291 * the time any subsequent FENCE commands are reached. 1405 * the time any subsequent FENCE commands are reached.
1292 * 1406 *
1293 * Availability: 1407 * Availability:
1294 * SVGA_FIFO_CAP_SCREEN_OBJECT 1408 * SVGA_FIFO_CAP_SCREEN_OBJECT or SVGA_FIFO_CAP_SCREEN_OBJECT_2
1295 */ 1409 */
1296 1410
1297typedef 1411typedef
@@ -1326,7 +1440,7 @@ struct {
1326 * user's display is being remoted over a network connection. 1440 * user's display is being remoted over a network connection.
1327 * 1441 *
1328 * Availability: 1442 * Availability:
1329 * SVGA_FIFO_CAP_SCREEN_OBJECT 1443 * SVGA_FIFO_CAP_SCREEN_OBJECT or SVGA_FIFO_CAP_SCREEN_OBJECT_2
1330 */ 1444 */
1331 1445
1332typedef 1446typedef
@@ -1358,7 +1472,7 @@ struct {
1358 * undefined. 1472 * undefined.
1359 * 1473 *
1360 * Availability: 1474 * Availability:
1361 * SVGA_FIFO_CAP_SCREEN_OBJECT 1475 * SVGA_FIFO_CAP_SCREEN_OBJECT or SVGA_FIFO_CAP_SCREEN_OBJECT_2
1362 */ 1476 */
1363 1477
1364typedef 1478typedef
@@ -1381,8 +1495,7 @@ typedef
1381struct { 1495struct {
1382 uint32 gmrId; 1496 uint32 gmrId;
1383 uint32 numPages; 1497 uint32 numPages;
1384} 1498} SVGAFifoCmdDefineGMR2;
1385SVGAFifoCmdDefineGMR2;
1386 1499
1387 1500
1388/* 1501/*
@@ -1424,8 +1537,8 @@ typedef
1424struct { 1537struct {
1425 uint32 gmrId; 1538 uint32 gmrId;
1426 SVGARemapGMR2Flags flags; 1539 SVGARemapGMR2Flags flags;
1427 uint32 offsetPages; /* offset in pages to begin remap */ 1540 uint32 offsetPages; /* offset in pages to begin remap */
1428 uint32 numPages; /* number of pages to remap */ 1541 uint32 numPages; /* number of pages to remap */
1429 /* 1542 /*
1430 * Followed by additional data depending on SVGARemapGMR2Flags. 1543 * Followed by additional data depending on SVGARemapGMR2Flags.
1431 * 1544 *
@@ -1434,7 +1547,6 @@ struct {
1434 * (according to flag SVGA_REMAP_GMR2_PPN64) follows. If flag 1547 * (according to flag SVGA_REMAP_GMR2_PPN64) follows. If flag
1435 * SVGA_REMAP_GMR2_SINGLE_PPN is set, array contains a single entry. 1548 * SVGA_REMAP_GMR2_SINGLE_PPN is set, array contains a single entry.
1436 */ 1549 */
1437} 1550} SVGAFifoCmdRemapGMR2;
1438SVGAFifoCmdRemapGMR2;
1439 1551
1440#endif 1552#endif