VirtualBox

source: vbox/trunk/src/VBox/Devices/Graphics/vmsvga_include/vbsvga3d_dx.h@ 105381

Last change on this file since 105381 was 102504, checked in by vboxsync, 12 months ago

Devices/Graphics: header update. bugref:10529

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 29.5 KB
Line 
1/*
2 * Copyright (C) 2023 Oracle and/or its affiliates.
3 *
4 * This file is part of VirtualBox base platform packages, as
5 * available from https://www.virtualbox.org.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, in version 3 of the
10 * License.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, see <https://www.gnu.org/licenses>.
19 *
20 * SPDX-License-Identifier: GPL-3.0-only
21 */
22
23#ifndef VBOX_INCLUDED_SRC_Graphics_vmsvga_include_vbsvga3d_dx_h
24#define VBOX_INCLUDED_SRC_Graphics_vmsvga_include_vbsvga3d_dx_h
25#ifndef RT_WITHOUT_PRAGMA_ONCE
26# pragma once
27#endif
28
29#include "svga3d_dx.h"
30
31/* Extended capabilities returned by SVGA3D_DEVCAP_3D if VBoxSVGA virtual device is enabled. */
32/* The original "3D support" capability. */
33#define VBSVGA3D_CAP_3D 0x00000001
34/* Video decoding/processing and ClearView commands. */
35#define VBSVGA3D_CAP_VIDEO 0x00000002
36
37/* Arbitrary limits. Allows to use constant size structures.
38 * NVIDIA supports 5 streams, AMD more, so 8 seems to be a good round number.
39 * Both support 1 rate conversion caps set.
40 * NVIDIA driver reports 6 custom rates.
41 */
42#define VBSVGA3D_MAX_VIDEO_STREAMS 8
43#define VBSVGA3D_MAX_VIDEO_RATE_CONVERSION_CAPS 1
44#define VBSVGA3D_MAX_VIDEO_CUSTOM_RATE_CAPS 8
45
46/* For 8-bit palettized formats. */
47#define VBSVGA3D_MAX_VIDEO_PALETTE_ENTRIES 256
48
49typedef uint32 VBSVGA3dVideoProcessorId;
50typedef uint32 VBSVGA3dVideoDecoderOutputViewId;
51typedef uint32 VBSVGA3dVideoDecoderId;
52typedef uint32 VBSVGA3dVideoProcessorInputViewId;
53typedef uint32 VBSVGA3dVideoProcessorOutputViewId;
54
55#define VBSVGA3D_VIDEO_FRAME_FORMAT_PROGRESSIVE 0
56#define VBSVGA3D_VIDEO_FRAME_FORMAT_INTERLACED_TOP_FIELD_FIRST 1
57#define VBSVGA3D_VIDEO_FRAME_FORMAT_INTERLACED_BOTTOM_FIELD_FIRST 2
58typedef uint32 VBSVGA3dVideoFrameFormat;
59
60#define VBSVGA3D_VIDEO_USAGE_PLAYBACK_NORMAL 0
61#define VBSVGA3D_VIDEO_USAGE_OPTIMAL_SPEED 1
62#define VBSVGA3D_VIDEO_USAGE_OPTIMAL_QUALITY 2
63typedef uint32 VBSVGA3dVideoUsage;
64
65#define VBSVGA3D_VP_OUTPUT_RATE_NORMAL 0
66#define VBSVGA3D_VP_OUTPUT_RATE_HALF 1
67#define VBSVGA3D_VP_OUTPUT_RATE_CUSTOM 2
68typedef uint32 VBSVGA3dVideoProcessorOutputRate;
69
70#define VBSVGA3D_VDOV_DIMENSION_UNKNOWN 0
71#define VBSVGA3D_VDOV_DIMENSION_TEXTURE2D 1
72typedef uint32 VBSVGA3dVDOVDimension;
73
74#define VBSVGA3D_VPIV_DIMENSION_UNKNOWN 0
75#define VBSVGA3D_VPIV_DIMENSION_TEXTURE2D 1
76typedef uint32 VBSVGA3dVPIVDimension;
77
78#define VBSVGA3D_VPOV_DIMENSION_UNKNOWN 0
79#define VBSVGA3D_VPOV_DIMENSION_TEXTURE2D 1
80#define VBSVGA3D_VPOV_DIMENSION_TEXTURE2DARRAY 2
81typedef uint32 VBSVGA3dVPOVDimension;
82
83#define VBSVGA3D_VD_BUFFER_PICTURE_PARAMETERS 0
84#define VBSVGA3D_VD_BUFFER_MACROBLOCK_CONTROL 1
85#define VBSVGA3D_VD_BUFFER_RESIDUAL_DIFFERENCE 2
86#define VBSVGA3D_VD_BUFFER_DEBLOCKING_CONTROL 3
87#define VBSVGA3D_VD_BUFFER_INVERSE_QUANTIZATION_MATRIX 4
88#define VBSVGA3D_VD_BUFFER_SLICE_CONTROL 5
89#define VBSVGA3D_VD_BUFFER_BITSTREAM 6
90#define VBSVGA3D_VD_BUFFER_MOTION_VECTOR 7
91#define VBSVGA3D_VD_BUFFER_FILM_GRAIN 8
92typedef uint32 VBSVGA3dVideoDecoderBufferType;
93
94#define VBSVGA3D_VP_ALPHA_FILL_MODE_OPAQUE 0
95#define VBSVGA3D_VP_ALPHA_FILL_MODE_BACKGROUND 1
96#define VBSVGA3D_VP_ALPHA_FILL_MODE_DESTINATION 2
97#define VBSVGA3D_VP_ALPHA_FILL_MODE_SOURCE_STREAM 3
98typedef uint32 VBSVGA3dVideoProcessorAlphaFillMode;
99
100#define VBSVGA3D_VP_STEREO_FORMAT_MONO 0
101#define VBSVGA3D_VP_STEREO_FORMAT_HORIZONTAL 1
102#define VBSVGA3D_VP_STEREO_FORMAT_VERTICAL 2
103#define VBSVGA3D_VP_STEREO_FORMAT_SEPARATE 3
104#define VBSVGA3D_VP_STEREO_FORMAT_MONO_OFFSET 4
105#define VBSVGA3D_VP_STEREO_FORMAT_ROW_INTERLEAVED 5
106#define VBSVGA3D_VP_STEREO_FORMAT_COLUMN_INTERLEAVED 6
107#define VBSVGA3D_VP_STEREO_FORMAT_CHECKERBOARD 7
108typedef uint32 VBSVGA3dVideoProcessorStereoFormat;
109
110#define VBSVGA3D_VP_STEREO_FLIP_NONE 0
111#define VBSVGA3D_VP_STEREO_FLIP_FRAME0 1
112#define VBSVGA3D_VP_STEREO_FLIP_FRAME1 2
113typedef uint32 VBSVGA3dVideoProcessorStereoFlipMode;
114
115#define VBSVGA3D_VP_FILTER_BRIGHTNESS 0
116#define VBSVGA3D_VP_FILTER_CONTRAST 1
117#define VBSVGA3D_VP_FILTER_HUE 2
118#define VBSVGA3D_VP_FILTER_SATURATION 3
119#define VBSVGA3D_VP_FILTER_NOISE_REDUCTION 4
120#define VBSVGA3D_VP_FILTER_EDGE_ENHANCEMENT 5
121#define VBSVGA3D_VP_FILTER_ANAMORPHIC_SCALING 6
122#define VBSVGA3D_VP_FILTER_STEREO_ADJUSTMENT 7
123#define VBSVGA3D_VP_MAX_FILTER_COUNT 8
124typedef uint32 VBSVGA3dVideoProcessorFilter;
125
126#define VBSVGA3D_VP_ROTATION_IDENTITY 0
127#define VBSVGA3D_VP_ROTATION_90 1
128#define VBSVGA3D_VP_ROTATION_180 2
129#define VBSVGA3D_VP_ROTATION_270 3
130typedef uint32 VBSVGA3dVideoProcessorRotation;
131
132#define VBSVGA3D_VP_FORMAT_SUPPORT_INPUT 0x1
133#define VBSVGA3D_VP_FORMAT_SUPPORT_OUTPUT 0x2
134typedef uint8 VBSVGA3dVideoProcessorFormatSupport;
135
136#define VBSVGA3D_VP_DEVICE_CAPS_LINEAR_SPACE 0x1
137#define VBSVGA3D_VP_DEVICE_CAPS_xvYCC 0x2
138#define VBSVGA3D_VP_DEVICE_CAPS_RGB_RANGE_CONVERSION 0x4
139#define VBSVGA3D_VP_DEVICE_CAPS_YCbCr_MATRIX_CONVERSION 0x8
140#define VBSVGA3D_VP_DEVICE_CAPS_NOMINAL_RANGE 0x10
141typedef uint32 VBSVGA3dVideoProcessorDeviceCaps;
142
143#define VBSVGA3D_VP_FEATURE_CAPS_ALPHA_FILL 0x1
144#define VBSVGA3D_VP_FEATURE_CAPS_CONSTRICTION 0x2
145#define VBSVGA3D_VP_FEATURE_CAPS_LUMA_KEY 0x4
146#define VBSVGA3D_VP_FEATURE_CAPS_ALPHA_PALETTE 0x8
147#define VBSVGA3D_VP_FEATURE_CAPS_LEGACY 0x10
148#define VBSVGA3D_VP_FEATURE_CAPS_STEREO 0x20
149#define VBSVGA3D_VP_FEATURE_CAPS_ROTATION 0x40
150#define VBSVGA3D_VP_FEATURE_CAPS_ALPHA_STREAM 0x80
151#define VBSVGA3D_VP_FEATURE_CAPS_PIXEL_ASPECT_RATIO 0x100
152#define VBSVGA3D_VP_FEATURE_CAPS_MIRROR 0x200
153#define VBSVGA3D_VP_FEATURE_CAPS_SHADER_USAGE 0x400
154#define VBSVGA3D_VP_FEATURE_CAPS_METADATA_HDR10 0x800
155typedef uint32 VBSVGA3dVideoProcessorFeatureCaps;
156
157#define VBSVGA3D_VP_FILTER_CAPS_BRIGHTNESS 0x1
158#define VBSVGA3D_VP_FILTER_CAPS_CONTRAST 0x2
159#define VBSVGA3D_VP_FILTER_CAPS_HUE 0x4
160#define VBSVGA3D_VP_FILTER_CAPS_SATURATION 0x8
161#define VBSVGA3D_VP_FILTER_CAPS_NOISE_REDUCTION 0x10
162#define VBSVGA3D_VP_FILTER_CAPS_EDGE_ENHANCEMENT 0x20
163#define VBSVGA3D_VP_FILTER_CAPS_ANAMORPHIC_SCALING 0x40
164#define VBSVGA3D_VP_FILTER_CAPS_STEREO_ADJUSTMENT 0x80
165typedef uint32 VBSVGA3dVideoProcessorFilterCaps;
166
167#define VBSVGA3D_VP_FORMAT_CAPS_RGB_INTERLACED 0x1
168#define VBSVGA3D_VP_FORMAT_CAPS_RGB_PROCAMP 0x2
169#define VBSVGA3D_VP_FORMAT_CAPS_RGB_LUMA_KEY 0x4
170#define VBSVGA3D_VP_FORMAT_CAPS_PALETTE_INTERLACED 0x8
171typedef uint32 VBSVGA3dVideoProcessorInputFormatCaps;
172
173#define VBSVGA3D_VP_AUTO_STREAM_CAPS_DENOISE 0x1
174#define VBSVGA3D_VP_AUTO_STREAM_CAPS_DERINGING 0x2
175#define VBSVGA3D_VP_AUTO_STREAM_CAPS_EDGE_ENHANCEMENT 0x4
176#define VBSVGA3D_VP_AUTO_STREAM_CAPS_COLOR_CORRECTION 0x8
177#define VBSVGA3D_VP_AUTO_STREAM_CAPS_FLESH_TONE_MAPPING 0x10
178#define VBSVGA3D_VP_AUTO_STREAM_CAPS_IMAGE_STABILIZATION 0x20
179#define VBSVGA3D_VP_AUTO_STREAM_CAPS_SUPER_RESOLUTION 0x40
180#define VBSVGA3D_VP_AUTO_STREAM_CAPS_ANAMORPHIC_SCALING 0x80
181typedef uint32 VBSVGA3dVideoProcessorAutoStreamCaps;
182
183#define VBSVGA3D_VP_STEREO_CAPS_MONO_OFFSET 0x1
184#define VBSVGA3D_VP_STEREO_CAPS_ROW_INTERLEAVED 0x2
185#define VBSVGA3D_VP_STEREO_CAPS_COLUMN_INTERLEAVED 0x4
186#define VBSVGA3D_VP_STEREO_CAPS_CHECKERBOARD 0x8
187#define VBSVGA3D_VP_STEREO_CAPS_FLIP_MODE 0x10
188typedef uint32 VBSVGA3dVideoProcessorStereoCaps;
189
190#define VBSVGA3D_VP_CAPS_DEINTERLACE_BLEND 0x1
191#define VBSVGA3D_VP_CAPS_DEINTERLACE_BOB 0x2
192#define VBSVGA3D_VP_CAPS_DEINTERLACE_ADAPTIVE 0x4
193#define VBSVGA3D_VP_CAPS_DEINTERLACE_MOTION_COMPENSATION 0x8
194#define VBSVGA3D_VP_CAPS_INVERSE_TELECINE 0x10
195#define VBSVGA3D_VP_CAPS_FRAME_RATE_CONVERSION 0x20
196typedef uint32 VBSVGA3dVideoRateConversionProcessorCaps;
197
198#define VBSVGA3D_VP_ITELECINE_CAPS_32 0x1
199#define VBSVGA3D_VP_ITELECINE_CAPS_22 0x2
200#define VBSVGA3D_VP_ITELECINE_CAPS_2224 0x4
201#define VBSVGA3D_VP_ITELECINE_CAPS_2332 0x8
202#define VBSVGA3D_VP_ITELECINE_CAPS_32322 0x10
203#define VBSVGA3D_VP_ITELECINE_CAPS_55 0x20
204#define VBSVGA3D_VP_ITELECINE_CAPS_64 0x40
205#define VBSVGA3D_VP_ITELECINE_CAPS_87 0x80
206#define VBSVGA3D_VP_ITELECINE_CAPS_222222222223 0x100
207#define VBSVGA3D_VP_ITELECINE_CAPS_OTHER 0x80000000
208typedef uint32 VBSVGA3dVideoRateConversionITelecineCaps;
209
210#define VBSVGA3D_VIDEO_CAPABILITY_DECODE_PROFILE 0
211#define VBSVGA3D_VIDEO_CAPABILITY_DECODE_CONFIG 1
212#define VBSVGA3D_VIDEO_CAPABILITY_PROCESSOR_ENUM 2
213typedef uint32 VBSVGA3dVideoCapability;
214
215typedef struct {
216 union {
217 float r;
218 float y;
219 };
220 union {
221 float g;
222 float cb;
223 };
224 union {
225 float b;
226 float cr;
227 };
228 float a;
229} VBSVGA3dVideoColor;
230
231typedef struct {
232 uint32 Usage : 1;
233 uint32 RGB_Range : 1;
234 uint32 YCbCr_Matrix : 1;
235 uint32 YCbCr_xvYCC : 1;
236 uint32 Nominal_Range : 2;
237 uint32 Reserved : 26;
238} VBSVGA3dVideoProcessorColorSpace;
239
240typedef struct {
241 VBSVGA3dVideoFrameFormat InputFrameFormat;
242 SVGA3dFraction64 InputFrameRate;
243 uint32 InputWidth;
244 uint32 InputHeight;
245 SVGA3dFraction64 OutputFrameRate;
246 uint32 OutputWidth;
247 uint32 OutputHeight;
248 VBSVGA3dVideoUsage Usage;
249} VBSVGA3dVideoProcessorDesc;
250
251#define VBSVGA3D_VP_SET_STREAM_FRAME_FORMAT 0x00000001
252#define VBSVGA3D_VP_SET_STREAM_COLOR_SPACE 0x00000002
253#define VBSVGA3D_VP_SET_STREAM_OUTPUT_RATE 0x00000004
254#define VBSVGA3D_VP_SET_STREAM_SOURCE_RECT 0x00000008
255#define VBSVGA3D_VP_SET_STREAM_DEST_RECT 0x00000010
256#define VBSVGA3D_VP_SET_STREAM_ALPHA 0x00000020
257#define VBSVGA3D_VP_SET_STREAM_PALETTE 0x00000040
258#define VBSVGA3D_VP_SET_STREAM_ASPECT_RATIO 0x00000080
259#define VBSVGA3D_VP_SET_STREAM_LUMA_KEY 0x00000100
260#define VBSVGA3D_VP_SET_STREAM_STEREO_FORMAT 0x00000200
261#define VBSVGA3D_VP_SET_STREAM_AUTO_PROCESSING_MODE 0x00000400
262#define VBSVGA3D_VP_SET_STREAM_FILTER 0x00000800
263#define VBSVGA3D_VP_SET_STREAM_ROTATION 0x00001000
264typedef uint32 VBSVGA3dVideoProcessorStreamSetMask;
265
266typedef struct
267{
268 VBSVGA3dVideoProcessorStreamSetMask SetMask;
269
270 union {
271 uint32 value;
272 struct {
273 uint32 SourceRectEnable : 1;
274 uint32 DestRectEnable : 1;
275 uint32 AlphaEnable : 1;
276 uint32 AspectRatioEnable : 1;
277 uint32 LumaKeyEnable : 1;
278 uint32 StereoFormatEnable : 1;
279 uint32 AutoProcessingModeEnable : 1;
280 uint32 RotationEnable : 1;
281 };
282 };
283
284 VBSVGA3dVideoFrameFormat FrameFormat;
285 VBSVGA3dVideoProcessorColorSpace ColorSpace;
286 VBSVGA3dVideoProcessorOutputRate OutputRate;
287 uint32 RepeatFrame;
288 SVGA3dFraction64 CustomRate;
289 SVGASignedRect SourceRect;
290 SVGASignedRect DestRect;
291 float Alpha;
292 uint32 PaletteCount;
293 uint32 aPalette[VBSVGA3D_MAX_VIDEO_PALETTE_ENTRIES];
294 SVGA3dFraction64 AspectSourceRatio;
295 SVGA3dFraction64 AspectDestRatio;
296 float LumaKeyLower;
297 float LumaKeyUpper;
298 VBSVGA3dVideoProcessorStereoFormat StereoFormat;
299 uint8 LeftViewFrame0;
300 uint8 BaseViewFrame0;
301 uint8 pad[2];
302 VBSVGA3dVideoProcessorStereoFlipMode FlipMode;
303 int32 MonoOffset;
304 uint32 FilterEnableMask;
305 struct {
306 int32 Level;
307 } aFilter[VBSVGA3D_VP_MAX_FILTER_COUNT];
308 VBSVGA3dVideoProcessorRotation Rotation;
309} VBSVGA3dVideoProcessorStreamState;
310
311#define VBSVGA3D_VP_SET_OUTPUT_TARGET_RECT 0x00000001
312#define VBSVGA3D_VP_SET_OUTPUT_BACKGROUND_COLOR 0x00000002
313#define VBSVGA3D_VP_SET_OUTPUT_COLOR_SPACE 0x00000004
314#define VBSVGA3D_VP_SET_OUTPUT_ALPHA_FILL_MODE 0x00000008
315#define VBSVGA3D_VP_SET_OUTPUT_CONSTRICTION 0x00000010
316#define VBSVGA3D_VP_SET_OUTPUT_STEREO_MODE 0x00000020
317typedef uint32 VBSVGA3dVideoProcessorOutputSetMask;
318
319typedef struct
320{
321 VBSVGA3dVideoProcessorOutputSetMask SetMask;
322
323 union {
324 uint32 value;
325 struct {
326 uint32 TargetRectEnable : 1;
327 uint32 BackgroundColorYCbCr : 1;
328 uint32 ConstrictionEnable : 1;
329 uint32 StereoModeEnable : 1;
330 };
331 };
332
333 SVGASignedRect TargetRect;
334 VBSVGA3dVideoColor BackgroundColor;
335 VBSVGA3dVideoProcessorColorSpace ColorSpace;
336 VBSVGA3dVideoProcessorAlphaFillMode AlphaFillMode;
337 uint32 AlphaFillStreamIndex;
338 uint32 ConstrictionWidth;
339 uint32 ConstrictionHeight;
340} VBSVGA3dVideoProcessorOutputState;
341
342typedef struct {
343 VBSVGA3dVideoProcessorDesc desc;
344
345 VBSVGA3dVideoProcessorOutputState output;
346
347 VBSVGA3dVideoProcessorStreamState aStreamState[VBSVGA3D_MAX_VIDEO_STREAMS];
348 uint32 pad[1719];
349} VBSVGACOTableDXVideoProcessorEntry;
350AssertCompile(sizeof(VBSVGACOTableDXVideoProcessorEntry) == 4096 * 4);
351
352typedef struct VBSVGA3dCmdDXDefineVideoProcessor {
353 VBSVGA3dVideoProcessorId videoProcessorId;
354
355 VBSVGA3dVideoProcessorDesc desc;
356} VBSVGA3dCmdDXDefineVideoProcessor;
357/* VBSVGA_3D_CMD_DX_DEFINE_VIDEO_PROCESSOR */
358
359typedef struct {
360 uint32 data1;
361 uint16 data2;
362 uint16 data3;
363 uint8 data4[8];
364} VBSVGA3dGuid;
365
366typedef struct {
367 VBSVGA3dGuid DecodeProfile;
368 VBSVGA3dVDOVDimension ViewDimension;
369 union {
370 struct {
371 uint32 ArraySlice;
372 } Texture2D;
373 uint32 pad[4];
374 };
375} VBSVGA3dVDOVDesc;
376
377typedef struct {
378 SVGA3dSurfaceId sid;
379 VBSVGA3dVDOVDesc desc;
380 uint32 pad[6];
381} VBSVGACOTableDXVideoDecoderOutputViewEntry;
382AssertCompile(sizeof(VBSVGACOTableDXVideoDecoderOutputViewEntry) == 16 * 4);
383
384typedef struct VBSVGA3dCmdDXDefineVideoDecoderOutputView {
385 VBSVGA3dVideoDecoderOutputViewId videoDecoderOutputViewId;
386
387 SVGA3dSurfaceId sid;
388
389 VBSVGA3dVDOVDesc desc;
390} VBSVGA3dCmdDXDefineVideoDecoderOutputView;
391/* VBSVGA_3D_CMD_DX_DEFINE_VIDEO_DECODER_OUTPUT_VIEW */
392
393typedef struct {
394 VBSVGA3dGuid DecodeProfile;
395 uint32 SampleWidth;
396 uint32 SampleHeight;
397 SVGA3dSurfaceFormat OutputFormat;
398} VBSVGA3dVideoDecoderDesc;
399
400typedef struct {
401 VBSVGA3dGuid guidConfigBitstreamEncryption;
402 VBSVGA3dGuid guidConfigMBcontrolEncryption;
403 VBSVGA3dGuid guidConfigResidDiffEncryption;
404 uint32 ConfigBitstreamRaw;
405 uint32 ConfigMBcontrolRasterOrder;
406 uint32 ConfigResidDiffHost;
407 uint32 ConfigSpatialResid8;
408 uint32 ConfigResid8Subtraction;
409 uint32 ConfigSpatialHost8or9Clipping;
410 uint32 ConfigSpatialResidInterleaved;
411 uint32 ConfigIntraResidUnsigned;
412 uint32 ConfigResidDiffAccelerator;
413 uint32 ConfigHostInverseScan;
414 uint32 ConfigSpecificIDCT;
415 uint32 Config4GroupedCoefs;
416 uint16 ConfigMinRenderTargetBuffCount;
417 uint16 ConfigDecoderSpecific;
418} VBSVGA3dVideoDecoderConfig;
419
420typedef struct {
421 VBSVGA3dVideoDecoderDesc desc;
422 VBSVGA3dVideoDecoderConfig config;
423 VBSVGA3dVideoDecoderOutputViewId vdovId;
424 uint32 pad[31];
425} VBSVGACOTableDXVideoDecoderEntry;
426AssertCompile(sizeof(VBSVGACOTableDXVideoDecoderEntry) == 64 * 4);
427
428typedef struct VBSVGA3dCmdDXDefineVideoDecoder {
429 VBSVGA3dVideoDecoderId videoDecoderId;
430
431 VBSVGA3dVideoDecoderDesc desc;
432 VBSVGA3dVideoDecoderConfig config;
433} VBSVGA3dCmdDXDefineVideoDecoder;
434/* VBSVGA_3D_CMD_DX_DEFINE_VIDEO_DECODER */
435
436typedef struct VBSVGA3dCmdDXVideoDecoderBeginFrame {
437 VBSVGA3dVideoDecoderId videoDecoderId;
438 VBSVGA3dVideoDecoderOutputViewId videoDecoderOutputViewId;
439} VBSVGA3dCmdDXVideoDecoderBeginFrame;
440/* VBSVGA_3D_CMD_DX_VIDEO_DECODER_BEGIN_FRAME */
441
442typedef struct {
443 SVGA3dSurfaceId sidBuffer;
444 VBSVGA3dVideoDecoderBufferType bufferType;
445 uint32 dataOffset;
446 uint32 dataSize;
447 uint32 firstMBaddress;
448 uint32 numMBsInBuffer;
449 /** @todo pIV, IVSize, PartialEncryption, EncryptedBlockInfo */
450} VBSVGA3dVideoDecoderBufferDesc;
451
452typedef struct VBSVGA3dCmdDXVideoDecoderSubmitBuffers {
453 VBSVGA3dVideoDecoderId videoDecoderId;
454 /* VBSVGA3dVideoDecoderBufferDesc[] */
455} VBSVGA3dCmdDXVideoDecoderSubmitBuffers;
456/* VBSVGA_3D_CMD_DX_VIDEO_DECODER_SUBMIT_BUFFERS */
457
458typedef struct VBSVGA3dCmdDXVideoDecoderEndFrame {
459 VBSVGA3dVideoDecoderId videoDecoderId;
460} VBSVGA3dCmdDXVideoDecoderEndFrame;
461/* VBSVGA_3D_CMD_DX_VIDEO_DECODER_END_FRAME */
462
463typedef struct {
464 uint32 FourCC;
465 VBSVGA3dVPIVDimension ViewDimension;
466 union {
467 struct {
468 uint32 MipSlice;
469 uint32 ArraySlice;
470 } Texture2D;
471 uint32 pad[4];
472 };
473} VBSVGA3dVPIVDesc;
474
475typedef struct {
476 SVGA3dSurfaceId sid;
477 VBSVGA3dVideoProcessorDesc contentDesc;
478 VBSVGA3dVPIVDesc desc;
479 uint32 pad[15];
480} VBSVGACOTableDXVideoProcessorInputViewEntry;
481AssertCompile(sizeof(VBSVGACOTableDXVideoProcessorInputViewEntry) == 32 * 4);
482
483typedef struct VBSVGA3dCmdDXDefineVideoProcessorInputView {
484 VBSVGA3dVideoProcessorInputViewId videoProcessorInputViewId;
485
486 SVGA3dSurfaceId sid;
487
488 VBSVGA3dVideoProcessorDesc contentDesc;
489 VBSVGA3dVPIVDesc desc;
490} VBSVGA3dCmdDXDefineVideoProcessorInputView;
491/* VBSVGA_3D_CMD_DX_DEFINE_VIDEO_PROCESSOR_INPUT_VIEW */
492
493typedef struct {
494 VBSVGA3dVPOVDimension ViewDimension;
495 union {
496 struct {
497 uint32 MipSlice;
498 } Texture2D;
499 struct {
500 uint32 MipSlice;
501 uint32 FirstArraySlice;
502 uint32 ArraySize;
503 } Texture2DArray;
504 uint32 pad[4];
505 };
506} VBSVGA3dVPOVDesc;
507
508typedef struct {
509 SVGA3dSurfaceId sid;
510 VBSVGA3dVideoProcessorDesc contentDesc;
511 VBSVGA3dVPOVDesc desc;
512 uint32 pad[15];
513} VBSVGACOTableDXVideoProcessorOutputViewEntry;
514AssertCompile(sizeof(VBSVGACOTableDXVideoProcessorInputViewEntry) == 32 * 4);
515
516typedef struct VBSVGA3dCmdDXDefineVideoProcessorOutputView {
517 VBSVGA3dVideoProcessorOutputViewId videoProcessorOutputViewId;
518
519 SVGA3dSurfaceId sid;
520
521 VBSVGA3dVideoProcessorDesc contentDesc;
522 VBSVGA3dVPOVDesc desc;
523} VBSVGA3dCmdDXDefineVideoProcessorOutputView;
524/* VBSVGA_3D_CMD_DX_DEFINE_VIDEO_PROCESSOR_OUTPUT_VIEW */
525
526typedef struct
527{
528 uint8 Enable;
529 uint8 StereoFormatSeparate;
530 uint16 pad;
531 uint32 OutputIndex;
532 uint32 InputFrameOrField;
533 uint32 PastFrames;
534 uint32 FutureFrames;
535 /* VBSVGA3dVideoProcessorInputViewId[PastFrames + 1 + FutureFrames]:
536 * [PastFrames]
537 * InputSurface
538 * [FutureFrames]
539 *
540 * If StereoFormatSeparate is 1 then more 'PastFrames + 1 + FutureFrames' ids follow:
541 * [PastFramesRight]
542 * InputSurfaceRight
543 * [FutureFramesRight]
544 */
545} VBSVGA3dVideoProcessorStream;
546
547typedef struct VBSVGA3dCmdDXVideoProcessorBlt {
548 VBSVGA3dVideoProcessorId videoProcessorId;
549 VBSVGA3dVideoProcessorOutputViewId videoProcessorOutputViewId;
550
551 uint32 outputFrame;
552 uint32 streamCount;
553 /* VBSVGA3dVideoProcessorStream data follow. */
554} VBSVGA3dCmdDXVideoProcessorBlt;
555/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_BLT */
556
557typedef struct VBSVGA3dCmdDXDestroyVideoDecoder {
558 VBSVGA3dVideoDecoderId videoDecoderId;
559} VBSVGA3dCmdDXDestroyVideoDecoder;
560/* VBSVGA_3D_CMD_DX_DESTROY_VIDEO_DECODER */
561
562typedef struct VBSVGA3dCmdDXDestroyVideoDecoderOutputView {
563 VBSVGA3dVideoDecoderOutputViewId videoDecoderOutputViewId;
564} VBSVGA3dCmdDXDestroyVideoDecoderOutputView;
565/* VBSVGA_3D_CMD_DX_DESTROY_VIDEO_DECODER_OUTPUT_VIEW */
566
567typedef struct VBSVGA3dCmdDXDestroyVideoProcessor {
568 VBSVGA3dVideoProcessorId videoProcessorId;
569} VBSVGA3dCmdDXDestroyVideoProcessor;
570/* VBSVGA_3D_CMD_DX_DESTROY_VIDEO_PROCESSOR */
571
572typedef struct VBSVGA3dCmdDXDestroyVideoProcessorInputView {
573 VBSVGA3dVideoProcessorInputViewId videoProcessorInputViewId;
574} VBSVGA3dCmdDXDestroyVideoProcessorInputView;
575/* VBSVGA_3D_CMD_DX_DESTROY_VIDEO_PROCESSOR_INPUT_VIEW */
576
577typedef struct VBSVGA3dCmdDXDestroyVideoProcessorOutputView {
578 VBSVGA3dVideoProcessorOutputViewId videoProcessorOutputViewId;
579} VBSVGA3dCmdDXDestroyVideoProcessorOutputView;
580/* VBSVGA_3D_CMD_DX_DESTROY_VIDEO_PROCESSOR_OUTPUT_VIEW */
581
582typedef struct VBSVGA3dCmdDXVideoProcessorSetOutputTargetRect {
583 VBSVGA3dVideoProcessorId videoProcessorId;
584 uint32 enable;
585 SVGASignedRect outputRect;
586} VBSVGA3dCmdDXVideoProcessorSetOutputTargetRect;
587/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_OUTPUT_TARGET_RECT */
588
589typedef struct VBSVGA3dCmdDXVideoProcessorSetOutputBackgroundColor {
590 VBSVGA3dVideoProcessorId videoProcessorId;
591 uint32 ycbcr;
592 VBSVGA3dVideoColor color;
593} VBSVGA3dCmdDXVideoProcessorSetOutputBackgroundColor;
594/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_OUTPUT_BACKGROUND_COLOR */
595
596typedef struct VBSVGA3dCmdDXVideoProcessorSetOutputColorSpace {
597 VBSVGA3dVideoProcessorId videoProcessorId;
598 VBSVGA3dVideoProcessorColorSpace colorSpace;
599} VBSVGA3dCmdDXVideoProcessorSetOutputColorSpace;
600/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_OUTPUT_COLOR_SPACE */
601
602typedef struct VBSVGA3dCmdDXVideoProcessorSetOutputAlphaFillMode {
603 VBSVGA3dVideoProcessorId videoProcessorId;
604 VBSVGA3dVideoProcessorAlphaFillMode fillMode;
605 uint32 streamIndex;
606} VBSVGA3dCmdDXVideoProcessorSetOutputAlphaFillMode;
607/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_OUTPUT_ALPHA_FILL_MODE */
608
609typedef struct VBSVGA3dCmdDXVideoProcessorSetOutputConstriction {
610 VBSVGA3dVideoProcessorId videoProcessorId;
611 uint32 enabled;
612 uint32 width;
613 uint32 height;
614} VBSVGA3dCmdDXVideoProcessorSetOutputConstriction;
615/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_OUTPUT_CONSTRICTION */
616
617typedef struct VBSVGA3dCmdDXVideoProcessorSetOutputStereoMode {
618 VBSVGA3dVideoProcessorId videoProcessorId;
619 uint32 enable;
620} VBSVGA3dCmdDXVideoProcessorSetOutputStereoMode;
621/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_OUTPUT_STEREO_MODE */
622
623typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamFrameFormat {
624 VBSVGA3dVideoProcessorId videoProcessorId;
625 uint32 streamIndex;
626 VBSVGA3dVideoFrameFormat format;
627} VBSVGA3dCmdDXVideoProcessorSetStreamFrameFormat;
628/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_FRAME_FORMAT */
629
630typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamColorSpace {
631 VBSVGA3dVideoProcessorId videoProcessorId;
632 uint32 streamIndex;
633 VBSVGA3dVideoProcessorColorSpace colorSpace;
634} VBSVGA3dCmdDXVideoProcessorSetStreamColorSpace;
635/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_COLOR_SPACE */
636
637typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamOutputRate {
638 VBSVGA3dVideoProcessorId videoProcessorId;
639 uint32 streamIndex;
640 VBSVGA3dVideoProcessorOutputRate outputRate;
641 uint32 repeatFrame;
642 SVGA3dFraction64 customRate;
643} VBSVGA3dCmdDXVideoProcessorSetStreamOutputRate;
644/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_OUTPUT_RATE */
645
646typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamSourceRect {
647 VBSVGA3dVideoProcessorId videoProcessorId;
648 uint32 streamIndex;
649 uint32 enable;
650 SVGASignedRect sourceRect;
651} VBSVGA3dCmdDXVideoProcessorSetStreamSourceRect;
652/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_SOURCE_RECT */
653
654typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamDestRect {
655 VBSVGA3dVideoProcessorId videoProcessorId;
656 uint32 streamIndex;
657 uint32 enable;
658 SVGASignedRect destRect;
659} VBSVGA3dCmdDXVideoProcessorSetStreamDestRect;
660/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_DEST_RECT */
661
662typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamAlpha {
663 VBSVGA3dVideoProcessorId videoProcessorId;
664 uint32 streamIndex;
665 uint32 enable;
666 float alpha;
667} VBSVGA3dCmdDXVideoProcessorSetStreamAlpha;
668/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_ALPHA */
669
670typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamPalette {
671 VBSVGA3dVideoProcessorId videoProcessorId;
672 uint32 streamIndex;
673 /* uint32 entries: B8G8R8A8 or AYUV format. */
674} VBSVGA3dCmdDXVideoProcessorSetStreamPalette;
675/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_PALETTE */
676
677typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamPixelAspectRatio {
678 VBSVGA3dVideoProcessorId videoProcessorId;
679 uint32 streamIndex;
680 uint32 enable;
681 SVGA3dFraction64 sourceRatio;
682 SVGA3dFraction64 destRatio;
683} VBSVGA3dCmdDXVideoProcessorSetStreamPixelAspectRatio;
684/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_PIXEL_ASPECT_RATIO */
685
686typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamLumaKey {
687 VBSVGA3dVideoProcessorId videoProcessorId;
688 uint32 streamIndex;
689 uint32 enable;
690 float lower;
691 float upper;
692} VBSVGA3dCmdDXVideoProcessorSetStreamLumaKey;
693/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_LUMA_KEY */
694
695typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamStereoFormat {
696 VBSVGA3dVideoProcessorId videoProcessorId;
697 uint32 streamIndex;
698 uint32 enable;
699 VBSVGA3dVideoProcessorStereoFormat stereoFormat;
700 uint8 leftViewFrame0;
701 uint8 baseViewFrame0;
702 uint8 pad[2];
703 VBSVGA3dVideoProcessorStereoFlipMode flipMode;
704 int32 monoOffset;
705} VBSVGA3dCmdDXVideoProcessorSetStreamStereoFormat;
706/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_STEREO_FORMAT */
707
708typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamAutoProcessingMode {
709 VBSVGA3dVideoProcessorId videoProcessorId;
710 uint32 streamIndex;
711 uint32 enable;
712} VBSVGA3dCmdDXVideoProcessorSetStreamAutoProcessingMode;
713/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_AUTO_PROCESSING_MODE */
714
715typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamFilter {
716 VBSVGA3dVideoProcessorId videoProcessorId;
717 uint32 streamIndex;
718 uint32 enable;
719 VBSVGA3dVideoProcessorFilter filter;
720 int32 level;
721} VBSVGA3dCmdDXVideoProcessorSetStreamFilter;
722/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_FILTER */
723
724typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamRotation {
725 VBSVGA3dVideoProcessorId videoProcessorId;
726 uint32 streamIndex;
727 uint32 enable;
728 VBSVGA3dVideoProcessorRotation rotation;
729} VBSVGA3dCmdDXVideoProcessorSetStreamRotation;
730/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_ROTATION */
731
732typedef struct { /* VBSVGA3D_VIDEO_CAPABILITY_DECODE_PROFILE */
733 VBSVGA3dGuid DecodeProfile;
734 /* SVGA video formats. */
735 uint8 fAYUV;
736 uint8 fNV12;
737 uint8 fYUY2;
738} VBSVGA3dDecodeProfileInfo;
739
740typedef struct { /* VBSVGA3D_VIDEO_CAPABILITY_DECODE_CONFIG */
741 VBSVGA3dVideoDecoderDesc desc; /* In */
742 VBSVGA3dVideoDecoderConfig aConfig[1]; /* [(cbDataOut - sizeof(desc)) / sizeof(aConfig[0])] */
743} VBSVGA3dDecodeConfigInfo;
744
745typedef struct {
746 VBSVGA3dVideoProcessorDeviceCaps DeviceCaps;
747 VBSVGA3dVideoProcessorFeatureCaps FeatureCaps;
748 VBSVGA3dVideoProcessorFilterCaps FilterCaps;
749 VBSVGA3dVideoProcessorInputFormatCaps InputFormatCaps;
750 VBSVGA3dVideoProcessorAutoStreamCaps AutoStreamCaps;
751 VBSVGA3dVideoProcessorStereoCaps StereoCaps;
752 uint32 RateConversionCapsCount;
753 uint32 MaxInputStreams;
754 uint32 MaxStreamStates;
755} VBSVGA3dVideoProcessorCaps;
756
757typedef struct {
758 uint32 PastFrames;
759 uint32 FutureFrames;
760 VBSVGA3dVideoRateConversionProcessorCaps ProcessorCaps;
761 VBSVGA3dVideoRateConversionITelecineCaps ITelecineCaps;
762 uint32 CustomRateCount;
763} VBSVGA3dVideoProcessorRateCaps;
764
765typedef struct {
766 SVGA3dFraction64 CustomRate;
767 uint32 OutputFrames;
768 uint8 InputInterlaced;
769 uint8 pad[3];
770 uint32 InputFramesOrFields;
771} VBSVGA3dVideoProcessorCustomRateCaps;
772
773typedef struct {
774 int32 Minimum;
775 int32 Maximum;
776 int32 Default;
777 float Multiplier;
778} VBSVGA3dVideoProcessorFilterRange;
779
780typedef struct {
781 /* SVGA video processor formats. */
782 VBSVGA3dVideoProcessorFormatSupport fR8_UNORM;
783 VBSVGA3dVideoProcessorFormatSupport fR16_UNORM;
784 VBSVGA3dVideoProcessorFormatSupport fNV12;
785 VBSVGA3dVideoProcessorFormatSupport fYUY2;
786 VBSVGA3dVideoProcessorFormatSupport fR16G16B16A16_FLOAT;
787 VBSVGA3dVideoProcessorFormatSupport fB8G8R8X8_UNORM;
788 VBSVGA3dVideoProcessorFormatSupport fB8G8R8A8_UNORM;
789 VBSVGA3dVideoProcessorFormatSupport fR8G8B8A8_UNORM;
790 VBSVGA3dVideoProcessorFormatSupport fR10G10B10A2_UNORM;
791 VBSVGA3dVideoProcessorFormatSupport fR10G10B10_XR_BIAS_A2_UNORM;
792 VBSVGA3dVideoProcessorFormatSupport fR8G8B8A8_UNORM_SRGB;
793 VBSVGA3dVideoProcessorFormatSupport fB8G8R8A8_UNORM_SRGB;
794
795 VBSVGA3dVideoProcessorCaps Caps;
796 VBSVGA3dVideoProcessorRateCaps RateCaps;
797 VBSVGA3dVideoProcessorCustomRateCaps aCustomRateCaps[VBSVGA3D_MAX_VIDEO_CUSTOM_RATE_CAPS];
798 VBSVGA3dVideoProcessorFilterRange aFilterRange[VBSVGA3D_VP_MAX_FILTER_COUNT];
799} VBSVGA3dVideoProcessorEnumInfo;
800
801typedef struct { /* VBSVGA3D_VIDEO_CAPABILITY_PROCESSOR_ENUM */
802 VBSVGA3dVideoProcessorDesc desc; /* In */
803 VBSVGA3dVideoProcessorEnumInfo info;
804} VBSVGA3dProcessorEnumInfo;
805
806/* Layout of memory object for VBSVGA3dCmdDXGetVideoCapability command. */
807typedef struct {
808 uint64 fenceValue; /* Host sets this to VBSVGA3dCmdDXGetVideoCapability::fenceValue after updating the data. */
809 uint32 cbDataOut; /* Size in bytes of data written by host excluding u64Fence and cbDataOut fields. */
810 union
811 {
812 VBSVGA3dDecodeProfileInfo aDecodeProfile[1]; /* [cbDataOut / sizeof(aDecodeProfile[0])] */
813 VBSVGA3dDecodeConfigInfo config;
814 VBSVGA3dProcessorEnumInfo processorEnum;
815 } data;
816} VBSVGA3dVideoCapabilityMobLayout;
817
818typedef struct VBSVGA3dCmdDXGetVideoCapability {
819 VBSVGA3dVideoCapability capability;
820 uint32 mobid;
821 uint32 offsetInBytes;
822 uint32 sizeInBytes;
823 uint64 fenceValue;
824} VBSVGA3dCmdDXGetVideoCapability;
825/* VBSVGA_3D_CMD_DX_GET_VIDEO_CAPABILITY */
826
827typedef struct VBSVGA3dCmdDXClearView
828{
829 uint32 viewId;
830 SVGA3dRGBAFloat color;
831 /* followed by SVGASignedRect array */
832} VBSVGA3dCmdDXClearView;
833/* VBSVGA_3D_CMD_DX_CLEAR_RTV
834 * VBSVGA_3D_CMD_DX_CLEAR_UAV
835 * VBSVGA_3D_CMD_DX_CLEAR_VDOV
836 * VBSVGA_3D_CMD_DX_CLEAR_VPIV
837 * VBSVGA_3D_CMD_DX_CLEAR_VPOV
838 */
839
840#endif /* !VBOX_INCLUDED_SRC_Graphics_vmsvga_include_vbsvga3d_dx_h */
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