Skip to content

Commit b861686

Browse files
committed
Merge tag 'vmwgfx-next-4.19-3' of git://people.freedesktop.org/~thomash/linux into drm-next
This introduces a header update and support for multisample surfaces. Signed-off-by: Dave Airlie <airlied@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/d020efb8-776d-5e8f-9d9f-122591e074d6@vmware.com
2 parents 8038d2a + 9b07b28 commit b861686

16 files changed

Lines changed: 2032 additions & 969 deletions

‎drivers/gpu/drm/vmwgfx/device_include/svga3d_cmd.h‎

Lines changed: 171 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@
4747
* the SVGA3D protocol and remain reserved; they should not be used in the
4848
* future.
4949
*
50-
* IDs between 1040 and 1999 (inclusive) are available for use by the
50+
* IDs between 1040 and 2999 (inclusive) are available for use by the
5151
* current SVGA3D protocol.
5252
*
53-
* FIFO clients other than SVGA3D should stay below 1000, or at 2000
53+
* FIFO clients other than SVGA3D should stay below 1000, or at 3000
5454
* and up.
5555
*/
5656

@@ -90,19 +90,19 @@ typedef enum {
9090
SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN = 1069,
9191
SVGA_3D_CMD_SURFACE_DEFINE_V2 = 1070,
9292
SVGA_3D_CMD_GENERATE_MIPMAPS = 1071,
93-
SVGA_3D_CMD_VIDEO_CREATE_DECODER = 1072,
94-
SVGA_3D_CMD_VIDEO_DESTROY_DECODER = 1073,
95-
SVGA_3D_CMD_VIDEO_CREATE_PROCESSOR = 1074,
96-
SVGA_3D_CMD_VIDEO_DESTROY_PROCESSOR = 1075,
97-
SVGA_3D_CMD_VIDEO_DECODE_START_FRAME = 1076,
98-
SVGA_3D_CMD_VIDEO_DECODE_RENDER = 1077,
99-
SVGA_3D_CMD_VIDEO_DECODE_END_FRAME = 1078,
100-
SVGA_3D_CMD_VIDEO_PROCESS_FRAME = 1079,
93+
SVGA_3D_CMD_DEAD4 = 1072,
94+
SVGA_3D_CMD_DEAD5 = 1073,
95+
SVGA_3D_CMD_DEAD6 = 1074,
96+
SVGA_3D_CMD_DEAD7 = 1075,
97+
SVGA_3D_CMD_DEAD8 = 1076,
98+
SVGA_3D_CMD_DEAD9 = 1077,
99+
SVGA_3D_CMD_DEAD10 = 1078,
100+
SVGA_3D_CMD_DEAD11 = 1079,
101101
SVGA_3D_CMD_ACTIVATE_SURFACE = 1080,
102102
SVGA_3D_CMD_DEACTIVATE_SURFACE = 1081,
103103
SVGA_3D_CMD_SCREEN_DMA = 1082,
104-
SVGA_3D_CMD_SET_UNITY_SURFACE_COOKIE = 1083,
105-
SVGA_3D_CMD_OPEN_CONTEXT_SURFACE = 1084,
104+
SVGA_3D_CMD_DEAD1 = 1083,
105+
SVGA_3D_CMD_DEAD2 = 1084,
106106

107107
SVGA_3D_CMD_LOGICOPS_BITBLT = 1085,
108108
SVGA_3D_CMD_LOGICOPS_TRANSBLT = 1086,
@@ -218,7 +218,7 @@ typedef enum {
218218
SVGA_3D_CMD_DX_CLEAR_DEPTHSTENCIL_VIEW = 1177,
219219
SVGA_3D_CMD_DX_PRED_COPY_REGION = 1178,
220220
SVGA_3D_CMD_DX_PRED_COPY = 1179,
221-
SVGA_3D_CMD_DX_STRETCHBLT = 1180,
221+
SVGA_3D_CMD_DX_PRESENTBLT = 1180,
222222
SVGA_3D_CMD_DX_GENMIPS = 1181,
223223
SVGA_3D_CMD_DX_UPDATE_SUBRESOURCE = 1182,
224224
SVGA_3D_CMD_DX_READBACK_SUBRESOURCE = 1183,
@@ -255,25 +255,55 @@ typedef enum {
255255
SVGA_3D_CMD_DX_READBACK_ALL_QUERY = 1214,
256256
SVGA_3D_CMD_DX_PRED_TRANSFER_FROM_BUFFER = 1215,
257257
SVGA_3D_CMD_DX_MOB_FENCE_64 = 1216,
258-
SVGA_3D_CMD_DX_BIND_SHADER_ON_CONTEXT = 1217,
258+
SVGA_3D_CMD_DX_BIND_ALL_SHADER = 1217,
259259
SVGA_3D_CMD_DX_HINT = 1218,
260260
SVGA_3D_CMD_DX_BUFFER_UPDATE = 1219,
261261
SVGA_3D_CMD_DX_SET_VS_CONSTANT_BUFFER_OFFSET = 1220,
262262
SVGA_3D_CMD_DX_SET_PS_CONSTANT_BUFFER_OFFSET = 1221,
263263
SVGA_3D_CMD_DX_SET_GS_CONSTANT_BUFFER_OFFSET = 1222,
264264

265265
/*
266-
* Reserve some IDs to be used for the DX11 shader types.
266+
* Reserve some IDs to be used for the SM5 shader types.
267267
*/
268268
SVGA_3D_CMD_DX_RESERVED1 = 1223,
269269
SVGA_3D_CMD_DX_RESERVED2 = 1224,
270270
SVGA_3D_CMD_DX_RESERVED3 = 1225,
271271

272-
SVGA_3D_CMD_DX_MAX = 1226,
273-
SVGA_3D_CMD_MAX = 1226,
272+
SVGA_3D_CMD_DX_COND_BIND_ALL_SHADER = 1226,
273+
SVGA_3D_CMD_DX_MAX = 1227,
274+
275+
SVGA_3D_CMD_SCREEN_COPY = 1227,
276+
277+
/*
278+
* Reserve some IDs to be used for video.
279+
*/
280+
SVGA_3D_CMD_VIDEO_RESERVED1 = 1228,
281+
SVGA_3D_CMD_VIDEO_RESERVED2 = 1229,
282+
SVGA_3D_CMD_VIDEO_RESERVED3 = 1230,
283+
SVGA_3D_CMD_VIDEO_RESERVED4 = 1231,
284+
SVGA_3D_CMD_VIDEO_RESERVED5 = 1232,
285+
SVGA_3D_CMD_VIDEO_RESERVED6 = 1233,
286+
SVGA_3D_CMD_VIDEO_RESERVED7 = 1234,
287+
SVGA_3D_CMD_VIDEO_RESERVED8 = 1235,
288+
289+
SVGA_3D_CMD_GROW_OTABLE = 1236,
290+
SVGA_3D_CMD_DX_GROW_COTABLE = 1237,
291+
SVGA_3D_CMD_INTRA_SURFACE_COPY = 1238,
292+
293+
SVGA_3D_CMD_DEFINE_GB_SURFACE_V3 = 1239,
294+
295+
SVGA_3D_CMD_DX_RESOLVE_COPY = 1240,
296+
SVGA_3D_CMD_DX_PRED_RESOLVE_COPY = 1241,
297+
SVGA_3D_CMD_DX_PRED_CONVERT_REGION = 1242,
298+
SVGA_3D_CMD_DX_PRED_CONVERT = 1243,
299+
SVGA_3D_CMD_WHOLE_SURFACE_COPY = 1244,
300+
301+
SVGA_3D_CMD_MAX = 1245,
274302
SVGA_3D_CMD_FUTURE_MAX = 3000
275303
} SVGAFifo3dCmdId;
276304

305+
#define SVGA_NUM_3D_CMD (SVGA_3D_CMD_MAX - SVGA_3D_CMD_BASE)
306+
277307
/*
278308
* FIFO command format definitions:
279309
*/
@@ -302,7 +332,7 @@ typedef
302332
#include "vmware_pack_begin.h"
303333
struct {
304334
uint32 sid;
305-
SVGA3dSurfaceFlags surfaceFlags;
335+
SVGA3dSurface1Flags surfaceFlags;
306336
SVGA3dSurfaceFormat format;
307337
/*
308338
* If surfaceFlags has SVGA3D_SURFACE_CUBEMAP bit set, all SVGA3dSurfaceFace
@@ -328,7 +358,7 @@ typedef
328358
#include "vmware_pack_begin.h"
329359
struct {
330360
uint32 sid;
331-
SVGA3dSurfaceFlags surfaceFlags;
361+
SVGA3dSurface1Flags surfaceFlags;
332362
SVGA3dSurfaceFormat format;
333363
/*
334364
* If surfaceFlags has SVGA3D_SURFACE_CUBEMAP bit set, all SVGA3dSurfaceFace
@@ -460,6 +490,28 @@ struct {
460490
#include "vmware_pack_end.h"
461491
SVGA3dCmdSurfaceCopy; /* SVGA_3D_CMD_SURFACE_COPY */
462492

493+
/*
494+
* Perform a surface copy within the same image.
495+
* The src/dest boxes are allowed to overlap.
496+
*/
497+
typedef
498+
#include "vmware_pack_begin.h"
499+
struct {
500+
SVGA3dSurfaceImageId surface;
501+
SVGA3dCopyBox box;
502+
}
503+
#include "vmware_pack_end.h"
504+
SVGA3dCmdIntraSurfaceCopy; /* SVGA_3D_CMD_INTRA_SURFACE_COPY */
505+
506+
typedef
507+
#include "vmware_pack_begin.h"
508+
struct {
509+
uint32 srcSid;
510+
uint32 destSid;
511+
}
512+
#include "vmware_pack_end.h"
513+
SVGA3dCmdWholeSurfaceCopy; /* SVGA_3D_CMD_WHOLE_SURFACE_COPY */
514+
463515
typedef
464516
#include "vmware_pack_begin.h"
465517
struct {
@@ -773,6 +825,17 @@ struct {
773825
#include "vmware_pack_end.h"
774826
SVGA3dVertexElement;
775827

828+
/*
829+
* Should the vertex element respect the stream value? The high bit of the
830+
* stream should be set to indicate that the stream should be respected. If
831+
* the high bit is not set, the stream will be ignored and replaced by the index
832+
* of the position of the currently considered vertex element.
833+
*
834+
* All guests should set this bit and correctly specify the stream going
835+
* forward.
836+
*/
837+
#define SVGA3D_VERTEX_ELEMENT_RESPECT_STREAM (1 << 7)
838+
776839
typedef
777840
#include "vmware_pack_begin.h"
778841
struct {
@@ -1103,8 +1166,6 @@ struct {
11031166
#include "vmware_pack_end.h"
11041167
SVGA3dCmdGenerateMipmaps; /* SVGA_3D_CMD_GENERATE_MIPMAPS */
11051168

1106-
1107-
11081169
typedef
11091170
#include "vmware_pack_begin.h"
11101171
struct {
@@ -1147,38 +1208,6 @@ struct SVGA3dCmdScreenDMA {
11471208
#include "vmware_pack_end.h"
11481209
SVGA3dCmdScreenDMA; /* SVGA_3D_CMD_SCREEN_DMA */
11491210

1150-
/*
1151-
* Set Unity Surface Cookie
1152-
*
1153-
* Associates the supplied cookie with the surface id for use with
1154-
* Unity. This cookie is a hint from guest to host, there is no way
1155-
* for the guest to readback the cookie and the host is free to drop
1156-
* the cookie association at will. The default value for the cookie
1157-
* on all surfaces is 0.
1158-
*/
1159-
1160-
typedef
1161-
#include "vmware_pack_begin.h"
1162-
struct SVGA3dCmdSetUnitySurfaceCookie {
1163-
uint32 sid;
1164-
uint64 cookie;
1165-
}
1166-
#include "vmware_pack_end.h"
1167-
SVGA3dCmdSetUnitySurfaceCookie; /* SVGA_3D_CMD_SET_UNITY_SURFACE_COOKIE */
1168-
1169-
/*
1170-
* Open a context-specific surface in a non-context-specific manner.
1171-
*/
1172-
1173-
typedef
1174-
#include "vmware_pack_begin.h"
1175-
struct SVGA3dCmdOpenContextSurface {
1176-
uint32 sid;
1177-
}
1178-
#include "vmware_pack_end.h"
1179-
SVGA3dCmdOpenContextSurface; /* SVGA_3D_CMD_OPEN_CONTEXT_SURFACE */
1180-
1181-
11821211
/*
11831212
* Logic ops
11841213
*/
@@ -1325,15 +1354,19 @@ typedef
13251354
#include "vmware_pack_begin.h"
13261355
struct {
13271356
SVGA3dSurfaceFormat format;
1328-
SVGA3dSurfaceFlags surfaceFlags;
1357+
SVGA3dSurface1Flags surface1Flags;
13291358
uint32 numMipLevels;
13301359
uint32 multisampleCount;
13311360
SVGA3dTextureFilter autogenFilter;
13321361
SVGA3dSize size;
13331362
SVGAMobId mobid;
13341363
uint32 arraySize;
13351364
uint32 mobPitch;
1336-
uint32 pad[5];
1365+
SVGA3dSurface2Flags surface2Flags;
1366+
uint8 multisamplePattern;
1367+
uint8 qualityLevel;
1368+
uint8 pad0[2];
1369+
uint32 pad1[3];
13371370
}
13381371
#include "vmware_pack_end.h"
13391372
SVGAOTableSurfaceEntry;
@@ -1361,7 +1394,8 @@ struct {
13611394
SVGAOTableShaderEntry;
13621395
#define SVGA3D_OTABLE_SHADER_ENTRY_SIZE (sizeof(SVGAOTableShaderEntry))
13631396

1364-
#define SVGA_STFLAG_PRIMARY (1 << 0)
1397+
#define SVGA_STFLAG_PRIMARY (1 << 0)
1398+
#define SVGA_STFLAG_RESERVED (1 << 1) /* Added with cap SVGA_CAP_HP_CMD_QUEUE */
13651399
typedef uint32 SVGAScreenTargetFlags;
13661400

13671401
typedef
@@ -1529,6 +1563,25 @@ struct {
15291563
#include "vmware_pack_end.h"
15301564
SVGA3dCmdSetOTableBase64; /* SVGA_3D_CMD_SET_OTABLE_BASE64 */
15311565

1566+
/*
1567+
* Guests using SVGA_3D_CMD_GROW_OTABLE are promising that
1568+
* the new OTable contains the same contents as the old one, except possibly
1569+
* for some new invalid entries at the end.
1570+
*
1571+
* (Otherwise, guests should use one of the SetOTableBase commands.)
1572+
*/
1573+
typedef
1574+
#include "vmware_pack_begin.h"
1575+
struct {
1576+
SVGAOTableType type;
1577+
PPN64 baseAddress;
1578+
uint32 sizeInBytes;
1579+
uint32 validSizeInBytes;
1580+
SVGAMobFormat ptDepth;
1581+
}
1582+
#include "vmware_pack_end.h"
1583+
SVGA3dCmdGrowOTable; /* SVGA_3D_CMD_GROW_OTABLE */
1584+
15321585
typedef
15331586
#include "vmware_pack_begin.h"
15341587
struct {
@@ -1616,7 +1669,7 @@ typedef
16161669
#include "vmware_pack_begin.h"
16171670
struct SVGA3dCmdDefineGBSurface {
16181671
uint32 sid;
1619-
SVGA3dSurfaceFlags surfaceFlags;
1672+
SVGA3dSurface1Flags surfaceFlags;
16201673
SVGA3dSurfaceFormat format;
16211674
uint32 numMipLevels;
16221675
uint32 multisampleCount;
@@ -1626,6 +1679,45 @@ struct SVGA3dCmdDefineGBSurface {
16261679
#include "vmware_pack_end.h"
16271680
SVGA3dCmdDefineGBSurface; /* SVGA_3D_CMD_DEFINE_GB_SURFACE */
16281681

1682+
/*
1683+
* Defines a guest-backed surface, adding the arraySize field.
1684+
*/
1685+
typedef
1686+
#include "vmware_pack_begin.h"
1687+
struct SVGA3dCmdDefineGBSurface_v2 {
1688+
uint32 sid;
1689+
SVGA3dSurface1Flags surfaceFlags;
1690+
SVGA3dSurfaceFormat format;
1691+
uint32 numMipLevels;
1692+
uint32 multisampleCount;
1693+
SVGA3dTextureFilter autogenFilter;
1694+
SVGA3dSize size;
1695+
uint32 arraySize;
1696+
uint32 pad;
1697+
}
1698+
#include "vmware_pack_end.h"
1699+
SVGA3dCmdDefineGBSurface_v2; /* SVGA_3D_CMD_DEFINE_GB_SURFACE_V2 */
1700+
1701+
/*
1702+
* Defines a guest-backed surface, adding the larger flags.
1703+
*/
1704+
typedef
1705+
#include "vmware_pack_begin.h"
1706+
struct SVGA3dCmdDefineGBSurface_v3 {
1707+
uint32 sid;
1708+
SVGA3dSurfaceAllFlags surfaceFlags;
1709+
SVGA3dSurfaceFormat format;
1710+
uint32 numMipLevels;
1711+
uint32 multisampleCount;
1712+
SVGA3dMSPattern multisamplePattern;
1713+
SVGA3dMSQualityLevel qualityLevel;
1714+
SVGA3dTextureFilter autogenFilter;
1715+
SVGA3dSize size;
1716+
uint32 arraySize;
1717+
}
1718+
#include "vmware_pack_end.h"
1719+
SVGA3dCmdDefineGBSurface_v3; /* SVGA_3D_CMD_DEFINE_GB_SURFACE_V3 */
1720+
16291721
/*
16301722
* Destroy a guest-backed surface.
16311723
*/
@@ -1673,7 +1765,7 @@ SVGA3dCmdBindGBSurfaceWithPitch; /* SVGA_3D_CMD_BIND_GB_SURFACE_WITH_PITCH */
16731765

16741766
typedef
16751767
#include "vmware_pack_begin.h"
1676-
struct{
1768+
struct SVGA3dCmdCondBindGBSurface {
16771769
uint32 sid;
16781770
SVGAMobId testMobid;
16791771
SVGAMobId mobid;
@@ -2067,6 +2159,26 @@ struct {
20672159
uint32 mobOffset;
20682160
}
20692161
#include "vmware_pack_end.h"
2070-
SVGA3dCmdGBMobFence; /* SVGA_3D_CMD_GB_MOB_FENCE*/
2162+
SVGA3dCmdGBMobFence; /* SVGA_3D_CMD_GB_MOB_FENCE */
2163+
2164+
typedef
2165+
#include "vmware_pack_begin.h"
2166+
struct {
2167+
uint32 stid;
2168+
SVGA3dSurfaceImageId dest;
2169+
2170+
uint32 statusMobId;
2171+
uint32 statusMobOffset;
2172+
2173+
/* Reserved fields */
2174+
uint32 mustBeInvalidId;
2175+
uint32 mustBeZero;
2176+
}
2177+
#include "vmware_pack_end.h"
2178+
SVGA3dCmdScreenCopy; /* SVGA_3D_CMD_SCREEN_COPY */
2179+
2180+
#define SVGA_SCREEN_COPY_STATUS_FAILURE 0x00
2181+
#define SVGA_SCREEN_COPY_STATUS_SUCCESS 0x01
2182+
#define SVGA_SCREEN_COPY_STATUS_INVALID 0xFFFFFFFF
20712183

20722184
#endif /* _SVGA3D_CMD_H_ */

0 commit comments

Comments
 (0)