VirtualBox

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

Last change on this file since 102406 was 102406, checked in by vboxsync, 18 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.3 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.215389.xyz.
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 uint32 SourceRectEnable : 1;
271 uint32 DestRectEnable : 1;
272 uint32 AlphaEnable : 1;
273 uint32 AspectRatioEnable : 1;
274 uint32 LumaKeyEnable : 1;
275 uint32 StereoFormatEnable : 1;
276 uint32 AutoProcessingModeEnable : 1;
277 uint32 RotationEnable : 1;
278
279 VBSVGA3dVideoFrameFormat FrameFormat;
280 VBSVGA3dVideoProcessorColorSpace ColorSpace;
281 VBSVGA3dVideoProcessorOutputRate OutputRate;
282 uint32 RepeatFrame;
283 SVGA3dFraction64 CustomRate;
284 SVGASignedRect SourceRect;
285 SVGASignedRect DestRect;
286 float Alpha;
287 uint32 PaletteCount;
288 uint32 aPalette[VBSVGA3D_MAX_VIDEO_PALETTE_ENTRIES];
289 SVGA3dFraction64 AspectSourceRatio;
290 SVGA3dFraction64 AspectDestRatio;
291 float LumaKeyLower;
292 float LumaKeyUpper;
293 VBSVGA3dVideoProcessorStereoFormat StereoFormat;
294 uint32 LeftViewFrame0 : 1;
295 uint32 BaseViewFrame0 : 1;
296 VBSVGA3dVideoProcessorStereoFlipMode FlipMode;
297 int32 MonoOffset;
298 uint32 FilterEnableMask;
299 struct {
300 int32 Level;
301 } aFilter[VBSVGA3D_VP_MAX_FILTER_COUNT];
302 VBSVGA3dVideoProcessorRotation Rotation;
303} VBSVGA3dVideoProcessorStreamState;
304
305#define VBSVGA3D_VP_SET_OUTPUT_TARGET_RECT 0x00000001
306#define VBSVGA3D_VP_SET_OUTPUT_BACKGROUND_COLOR 0x00000002
307#define VBSVGA3D_VP_SET_OUTPUT_COLOR_SPACE 0x00000004
308#define VBSVGA3D_VP_SET_OUTPUT_ALPHA_FILL_MODE 0x00000008
309#define VBSVGA3D_VP_SET_OUTPUT_CONSTRICTION 0x00000010
310#define VBSVGA3D_VP_SET_OUTPUT_STEREO_MODE 0x00000020
311typedef uint32 VBSVGA3dVideoProcessorOutputSetMask;
312
313typedef struct
314{
315 VBSVGA3dVideoProcessorOutputSetMask SetMask;
316
317 uint32 TargetRectEnable : 1;
318 uint32 BackgroundColorYCbCr : 1;
319 uint32 ConstrictionEnable : 1;
320 uint32 StereoModeEnable : 1;
321
322 SVGASignedRect TargetRect;
323 VBSVGA3dVideoColor BackgroundColor;
324 VBSVGA3dVideoProcessorColorSpace ColorSpace;
325 VBSVGA3dVideoProcessorAlphaFillMode AlphaFillMode;
326 uint32 AlphaFillStreamIndex;
327 uint32 ConstrictionWidth;
328 uint32 ConstrictionHeight;
329} VBSVGA3dVideoProcessorOutputState;
330
331typedef struct {
332 VBSVGA3dVideoProcessorDesc desc;
333
334 VBSVGA3dVideoProcessorOutputState output;
335
336 VBSVGA3dVideoProcessorStreamState aStreamState[VBSVGA3D_MAX_VIDEO_STREAMS];
337 uint32 pad[1719];
338} VBSVGACOTableDXVideoProcessorEntry;
339AssertCompile(sizeof(VBSVGACOTableDXVideoProcessorEntry) == 4096 * 4);
340
341typedef struct VBSVGA3dCmdDXDefineVideoProcessor {
342 VBSVGA3dVideoProcessorId videoProcessorId;
343
344 VBSVGA3dVideoProcessorDesc desc;
345} VBSVGA3dCmdDXDefineVideoProcessor;
346/* VBSVGA_3D_CMD_DX_DEFINE_VIDEO_PROCESSOR */
347
348typedef struct {
349 uint32 data1;
350 uint16 data2;
351 uint16 data3;
352 uint8 data4[8];
353} VBSVGA3dGuid;
354
355typedef struct {
356 VBSVGA3dGuid DecodeProfile;
357 VBSVGA3dVDOVDimension ViewDimension;
358 union {
359 struct {
360 uint32 ArraySlice;
361 } Texture2D;
362 uint32 pad[4];
363 };
364} VBSVGA3dVDOVDesc;
365
366typedef struct {
367 SVGA3dSurfaceId sid;
368 VBSVGA3dVDOVDesc desc;
369 uint32 pad[6];
370} VBSVGACOTableDXVideoDecoderOutputViewEntry;
371AssertCompile(sizeof(VBSVGACOTableDXVideoDecoderOutputViewEntry) == 16 * 4);
372
373typedef struct VBSVGA3dCmdDXDefineVideoDecoderOutputView {
374 VBSVGA3dVideoDecoderOutputViewId videoDecoderOutputViewId;
375
376 SVGA3dSurfaceId sid;
377
378 VBSVGA3dVDOVDesc desc;
379} VBSVGA3dCmdDXDefineVideoDecoderOutputView;
380/* VBSVGA_3D_CMD_DX_DEFINE_VIDEO_DECODER_OUTPUT_VIEW */
381
382typedef struct {
383 VBSVGA3dGuid DecodeProfile;
384 uint32 SampleWidth;
385 uint32 SampleHeight;
386 SVGA3dSurfaceFormat OutputFormat;
387} VBSVGA3dVideoDecoderDesc;
388
389typedef struct {
390 VBSVGA3dGuid guidConfigBitstreamEncryption;
391 VBSVGA3dGuid guidConfigMBcontrolEncryption;
392 VBSVGA3dGuid guidConfigResidDiffEncryption;
393 uint32 ConfigBitstreamRaw;
394 uint32 ConfigMBcontrolRasterOrder;
395 uint32 ConfigResidDiffHost;
396 uint32 ConfigSpatialResid8;
397 uint32 ConfigResid8Subtraction;
398 uint32 ConfigSpatialHost8or9Clipping;
399 uint32 ConfigSpatialResidInterleaved;
400 uint32 ConfigIntraResidUnsigned;
401 uint32 ConfigResidDiffAccelerator;
402 uint32 ConfigHostInverseScan;
403 uint32 ConfigSpecificIDCT;
404 uint32 Config4GroupedCoefs;
405 uint16 ConfigMinRenderTargetBuffCount;
406 uint16 ConfigDecoderSpecific;
407} VBSVGA3dVideoDecoderConfig;
408
409typedef struct {
410 VBSVGA3dVideoDecoderDesc desc;
411 VBSVGA3dVideoDecoderConfig config;
412 VBSVGA3dVideoDecoderOutputViewId vdovId;
413 uint32 pad[31];
414} VBSVGACOTableDXVideoDecoderEntry;
415AssertCompile(sizeof(VBSVGACOTableDXVideoDecoderEntry) == 64 * 4);
416
417typedef struct VBSVGA3dCmdDXDefineVideoDecoder {
418 VBSVGA3dVideoDecoderId videoDecoderId;
419
420 VBSVGA3dVideoDecoderDesc desc;
421 VBSVGA3dVideoDecoderConfig config;
422} VBSVGA3dCmdDXDefineVideoDecoder;
423/* VBSVGA_3D_CMD_DX_DEFINE_VIDEO_DECODER */
424
425typedef struct VBSVGA3dCmdDXVideoDecoderBeginFrame {
426 VBSVGA3dVideoDecoderId videoDecoderId;
427 VBSVGA3dVideoDecoderOutputViewId videoDecoderOutputViewId;
428} VBSVGA3dCmdDXVideoDecoderBeginFrame;
429/* VBSVGA_3D_CMD_DX_VIDEO_DECODER_BEGIN_FRAME */
430
431typedef struct {
432 SVGA3dSurfaceId sidBuffer;
433 VBSVGA3dVideoDecoderBufferType bufferType;
434 uint32 dataOffset;
435 uint32 dataSize;
436 uint32 firstMBaddress;
437 uint32 numMBsInBuffer;
438 /** @todo pIV, IVSize, PartialEncryption, EncryptedBlockInfo */
439} VBSVGA3dVideoDecoderBufferDesc;
440
441typedef struct VBSVGA3dCmdDXVideoDecoderSubmitBuffers {
442 VBSVGA3dVideoDecoderId videoDecoderId;
443 /* VBSVGA3dVideoDecoderBufferDesc[] */
444} VBSVGA3dCmdDXVideoDecoderSubmitBuffers;
445/* VBSVGA_3D_CMD_DX_VIDEO_DECODER_SUBMIT_BUFFERS */
446
447typedef struct VBSVGA3dCmdDXVideoDecoderEndFrame {
448 VBSVGA3dVideoDecoderId videoDecoderId;
449} VBSVGA3dCmdDXVideoDecoderEndFrame;
450/* VBSVGA_3D_CMD_DX_VIDEO_DECODER_END_FRAME */
451
452typedef struct {
453 uint32 FourCC;
454 VBSVGA3dVPIVDimension ViewDimension;
455 union {
456 struct {
457 uint32 MipSlice;
458 uint32 ArraySlice;
459 } Texture2D;
460 uint32 pad[4];
461 };
462} VBSVGA3dVPIVDesc;
463
464typedef struct {
465 SVGA3dSurfaceId sid;
466 VBSVGA3dVideoProcessorDesc contentDesc;
467 VBSVGA3dVPIVDesc desc;
468 uint32 pad[15];
469} VBSVGACOTableDXVideoProcessorInputViewEntry;
470AssertCompile(sizeof(VBSVGACOTableDXVideoProcessorInputViewEntry) == 32 * 4);
471
472typedef struct VBSVGA3dCmdDXDefineVideoProcessorInputView {
473 VBSVGA3dVideoProcessorInputViewId videoProcessorInputViewId;
474
475 SVGA3dSurfaceId sid;
476
477 VBSVGA3dVideoProcessorDesc contentDesc;
478 VBSVGA3dVPIVDesc desc;
479} VBSVGA3dCmdDXDefineVideoProcessorInputView;
480/* VBSVGA_3D_CMD_DX_DEFINE_VIDEO_PROCESSOR_INPUT_VIEW */
481
482typedef struct {
483 VBSVGA3dVPOVDimension ViewDimension;
484 union {
485 struct {
486 uint32 MipSlice;
487 } Texture2D;
488 struct {
489 uint32 MipSlice;
490 uint32 FirstArraySlice;
491 uint32 ArraySize;
492 } Texture2DArray;
493 uint32 pad[4];
494 };
495} VBSVGA3dVPOVDesc;
496
497typedef struct {
498 SVGA3dSurfaceId sid;
499 VBSVGA3dVideoProcessorDesc contentDesc;
500 VBSVGA3dVPOVDesc desc;
501 uint32 pad[15];
502} VBSVGACOTableDXVideoProcessorOutputViewEntry;
503AssertCompile(sizeof(VBSVGACOTableDXVideoProcessorInputViewEntry) == 32 * 4);
504
505typedef struct VBSVGA3dCmdDXDefineVideoProcessorOutputView {
506 VBSVGA3dVideoProcessorOutputViewId videoProcessorOutputViewId;
507
508 SVGA3dSurfaceId sid;
509
510 VBSVGA3dVideoProcessorDesc contentDesc;
511 VBSVGA3dVPOVDesc desc;
512} VBSVGA3dCmdDXDefineVideoProcessorOutputView;
513/* VBSVGA_3D_CMD_DX_DEFINE_VIDEO_PROCESSOR_OUTPUT_VIEW */
514
515typedef struct
516{
517 uint8 Enable;
518 uint8 StereoFormatSeparate;
519 uint16 pad;
520 uint32 OutputIndex;
521 uint32 InputFrameOrField;
522 uint32 PastFrames;
523 uint32 FutureFrames;
524 /* VBSVGA3dVideoProcessorInputViewId[PastFrames + 1 + FutureFrames]:
525 * [PastFrames]
526 * InputSurface
527 * [FutureFrames]
528 *
529 * If StereoFormatSeparate is 1 then more 'PastFrames + 1 + FutureFrames' ids follow:
530 * [PastFramesRight]
531 * InputSurfaceRight
532 * [FutureFramesRight]
533 */
534} VBSVGA3dVideoProcessorStream;
535
536typedef struct VBSVGA3dCmdDXVideoProcessorBlt {
537 VBSVGA3dVideoProcessorId videoProcessorId;
538 VBSVGA3dVideoProcessorOutputViewId videoProcessorOutputViewId;
539
540 uint32 outputFrame;
541 uint32 streamCount;
542 /* VBSVGA3dVideoProcessorStream data follow. */
543} VBSVGA3dCmdDXVideoProcessorBlt;
544/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_BLT */
545
546typedef struct VBSVGA3dCmdDXDestroyVideoDecoder {
547 VBSVGA3dVideoDecoderId videoDecoderId;
548} VBSVGA3dCmdDXDestroyVideoDecoder;
549/* VBSVGA_3D_CMD_DX_DESTROY_VIDEO_DECODER */
550
551typedef struct VBSVGA3dCmdDXDestroyVideoDecoderOutputView {
552 VBSVGA3dVideoDecoderOutputViewId videoDecoderOutputViewId;
553} VBSVGA3dCmdDXDestroyVideoDecoderOutputView;
554/* VBSVGA_3D_CMD_DX_DESTROY_VIDEO_DECODER_OUTPUT_VIEW */
555
556typedef struct VBSVGA3dCmdDXDestroyVideoProcessor {
557 VBSVGA3dVideoProcessorId videoProcessorId;
558} VBSVGA3dCmdDXDestroyVideoProcessor;
559/* VBSVGA_3D_CMD_DX_DESTROY_VIDEO_PROCESSOR */
560
561typedef struct VBSVGA3dCmdDXDestroyVideoProcessorInputView {
562 VBSVGA3dVideoProcessorInputViewId videoProcessorInputViewId;
563} VBSVGA3dCmdDXDestroyVideoProcessorInputView;
564/* VBSVGA_3D_CMD_DX_DESTROY_VIDEO_PROCESSOR_INPUT_VIEW */
565
566typedef struct VBSVGA3dCmdDXDestroyVideoProcessorOutputView {
567 VBSVGA3dVideoProcessorOutputViewId videoProcessorOutputViewId;
568} VBSVGA3dCmdDXDestroyVideoProcessorOutputView;
569/* VBSVGA_3D_CMD_DX_DESTROY_VIDEO_PROCESSOR_OUTPUT_VIEW */
570
571typedef struct VBSVGA3dCmdDXVideoProcessorSetOutputTargetRect {
572 VBSVGA3dVideoProcessorId videoProcessorId;
573 uint32 enable;
574 SVGASignedRect outputRect;
575} VBSVGA3dCmdDXVideoProcessorSetOutputTargetRect;
576/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_OUTPUT_TARGET_RECT */
577
578typedef struct VBSVGA3dCmdDXVideoProcessorSetOutputBackgroundColor {
579 VBSVGA3dVideoProcessorId videoProcessorId;
580 uint32 ycbcr;
581 VBSVGA3dVideoColor color;
582} VBSVGA3dCmdDXVideoProcessorSetOutputBackgroundColor;
583/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_OUTPUT_BACKGROUND_COLOR */
584
585typedef struct VBSVGA3dCmdDXVideoProcessorSetOutputColorSpace {
586 VBSVGA3dVideoProcessorId videoProcessorId;
587 VBSVGA3dVideoProcessorColorSpace colorSpace;
588} VBSVGA3dCmdDXVideoProcessorSetOutputColorSpace;
589/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_OUTPUT_COLOR_SPACE */
590
591typedef struct VBSVGA3dCmdDXVideoProcessorSetOutputAlphaFillMode {
592 VBSVGA3dVideoProcessorId videoProcessorId;
593 VBSVGA3dVideoProcessorAlphaFillMode fillMode;
594 uint32 streamIndex;
595} VBSVGA3dCmdDXVideoProcessorSetOutputAlphaFillMode;
596/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_OUTPUT_ALPHA_FILL_MODE */
597
598typedef struct VBSVGA3dCmdDXVideoProcessorSetOutputConstriction {
599 VBSVGA3dVideoProcessorId videoProcessorId;
600 uint32 enabled;
601 uint32 width;
602 uint32 height;
603} VBSVGA3dCmdDXVideoProcessorSetOutputConstriction;
604/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_OUTPUT_CONSTRICTION */
605
606typedef struct VBSVGA3dCmdDXVideoProcessorSetOutputStereoMode {
607 VBSVGA3dVideoProcessorId videoProcessorId;
608 uint32 enable;
609} VBSVGA3dCmdDXVideoProcessorSetOutputStereoMode;
610/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_OUTPUT_STEREO_MODE */
611
612typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamFrameFormat {
613 VBSVGA3dVideoProcessorId videoProcessorId;
614 uint32 streamIndex;
615 VBSVGA3dVideoFrameFormat format;
616} VBSVGA3dCmdDXVideoProcessorSetStreamFrameFormat;
617/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_FRAME_FORMAT */
618
619typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamColorSpace {
620 VBSVGA3dVideoProcessorId videoProcessorId;
621 uint32 streamIndex;
622 VBSVGA3dVideoProcessorColorSpace colorSpace;
623} VBSVGA3dCmdDXVideoProcessorSetStreamColorSpace;
624/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_COLOR_SPACE */
625
626typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamOutputRate {
627 VBSVGA3dVideoProcessorId videoProcessorId;
628 uint32 streamIndex;
629 VBSVGA3dVideoProcessorOutputRate outputRate;
630 uint32 repeatFrame;
631 SVGA3dFraction64 customRate;
632} VBSVGA3dCmdDXVideoProcessorSetStreamOutputRate;
633/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_OUTPUT_RATE */
634
635typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamSourceRect {
636 VBSVGA3dVideoProcessorId videoProcessorId;
637 uint32 streamIndex;
638 uint32 enable;
639 SVGASignedRect sourceRect;
640} VBSVGA3dCmdDXVideoProcessorSetStreamSourceRect;
641/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_SOURCE_RECT */
642
643typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamDestRect {
644 VBSVGA3dVideoProcessorId videoProcessorId;
645 uint32 streamIndex;
646 uint32 enable;
647 SVGASignedRect destRect;
648} VBSVGA3dCmdDXVideoProcessorSetStreamDestRect;
649/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_DEST_RECT */
650
651typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamAlpha {
652 VBSVGA3dVideoProcessorId videoProcessorId;
653 uint32 streamIndex;
654 uint32 enable;
655 float alpha;
656} VBSVGA3dCmdDXVideoProcessorSetStreamAlpha;
657/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_ALPHA */
658
659typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamPalette {
660 VBSVGA3dVideoProcessorId videoProcessorId;
661 uint32 streamIndex;
662 /* uint32 entries: B8G8R8A8 or AYUV format. */
663} VBSVGA3dCmdDXVideoProcessorSetStreamPalette;
664/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_PALETTE */
665
666typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamPixelAspectRatio {
667 VBSVGA3dVideoProcessorId videoProcessorId;
668 uint32 streamIndex;
669 uint32 enable;
670 SVGA3dFraction64 sourceRatio;
671 SVGA3dFraction64 destRatio;
672} VBSVGA3dCmdDXVideoProcessorSetStreamPixelAspectRatio;
673/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_PIXEL_ASPECT_RATIO */
674
675typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamLumaKey {
676 VBSVGA3dVideoProcessorId videoProcessorId;
677 uint32 streamIndex;
678 uint32 enable;
679 float lower;
680 float upper;
681} VBSVGA3dCmdDXVideoProcessorSetStreamLumaKey;
682/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_LUMA_KEY */
683
684typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamStereoFormat {
685 VBSVGA3dVideoProcessorId videoProcessorId;
686 uint32 streamIndex;
687 uint32 enable;
688 VBSVGA3dVideoProcessorStereoFormat stereoFormat;
689 uint8 leftViewFrame0;
690 uint8 baseViewFrame0;
691 uint8 pad[2];
692 VBSVGA3dVideoProcessorStereoFlipMode flipMode;
693 int32 monoOffset;
694} VBSVGA3dCmdDXVideoProcessorSetStreamStereoFormat;
695/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_STEREO_FORMAT */
696
697typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamAutoProcessingMode {
698 VBSVGA3dVideoProcessorId videoProcessorId;
699 uint32 streamIndex;
700 uint32 enable;
701} VBSVGA3dCmdDXVideoProcessorSetStreamAutoProcessingMode;
702/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_AUTO_PROCESSING_MODE */
703
704typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamFilter {
705 VBSVGA3dVideoProcessorId videoProcessorId;
706 uint32 streamIndex;
707 uint32 enable;
708 VBSVGA3dVideoProcessorFilter filter;
709 int32 level;
710} VBSVGA3dCmdDXVideoProcessorSetStreamFilter;
711/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_FILTER */
712
713typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamRotation {
714 VBSVGA3dVideoProcessorId videoProcessorId;
715 uint32 streamIndex;
716 uint32 enable;
717 VBSVGA3dVideoProcessorRotation rotation;
718} VBSVGA3dCmdDXVideoProcessorSetStreamRotation;
719/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_ROTATION */
720
721typedef struct { /* VBSVGA3D_VIDEO_CAPABILITY_DECODE_PROFILE */
722 VBSVGA3dGuid DecodeProfile;
723 /* SVGA video formats. */
724 uint8 fAYUV;
725 uint8 fNV12;
726 uint8 fYUY2;
727} VBSVGA3dDecodeProfileInfo;
728
729typedef struct { /* VBSVGA3D_VIDEO_CAPABILITY_DECODE_CONFIG */
730 VBSVGA3dVideoDecoderDesc desc; /* In */
731 VBSVGA3dVideoDecoderConfig aConfig[1]; /* [(cbDataOut - sizeof(desc)) / sizeof(aConfig[0])] */
732} VBSVGA3dDecodeConfigInfo;
733
734typedef struct {
735 VBSVGA3dVideoProcessorDeviceCaps DeviceCaps;
736 VBSVGA3dVideoProcessorFeatureCaps FeatureCaps;
737 VBSVGA3dVideoProcessorFilterCaps FilterCaps;
738 VBSVGA3dVideoProcessorInputFormatCaps InputFormatCaps;
739 VBSVGA3dVideoProcessorAutoStreamCaps AutoStreamCaps;
740 VBSVGA3dVideoProcessorStereoCaps StereoCaps;
741 uint32 RateConversionCapsCount;
742 uint32 MaxInputStreams;
743 uint32 MaxStreamStates;
744} VBSVGA3dVideoProcessorCaps;
745
746typedef struct {
747 uint32 PastFrames;
748 uint32 FutureFrames;
749 VBSVGA3dVideoRateConversionProcessorCaps ProcessorCaps;
750 VBSVGA3dVideoRateConversionITelecineCaps ITelecineCaps;
751 uint32 CustomRateCount;
752} VBSVGA3dVideoProcessorRateCaps;
753
754typedef struct {
755 SVGA3dFraction64 CustomRate;
756 uint32 OutputFrames;
757 uint8 InputInterlaced;
758 uint8 pad[3];
759 uint32 InputFramesOrFields;
760} VBSVGA3dVideoProcessorCustomRateCaps;
761
762typedef struct {
763 int32 Minimum;
764 int32 Maximum;
765 int32 Default;
766 float Multiplier;
767} VBSVGA3dVideoProcessorFilterRange;
768
769typedef struct {
770 /* SVGA video processor formats. */
771 VBSVGA3dVideoProcessorFormatSupport fR8_UNORM;
772 VBSVGA3dVideoProcessorFormatSupport fR16_UNORM;
773 VBSVGA3dVideoProcessorFormatSupport fNV12;
774 VBSVGA3dVideoProcessorFormatSupport fYUY2;
775 VBSVGA3dVideoProcessorFormatSupport fR16G16B16A16_FLOAT;
776 VBSVGA3dVideoProcessorFormatSupport fB8G8R8X8_UNORM;
777 VBSVGA3dVideoProcessorFormatSupport fB8G8R8A8_UNORM;
778 VBSVGA3dVideoProcessorFormatSupport fR8G8B8A8_UNORM;
779 VBSVGA3dVideoProcessorFormatSupport fR10G10B10A2_UNORM;
780 VBSVGA3dVideoProcessorFormatSupport fR10G10B10_XR_BIAS_A2_UNORM;
781 VBSVGA3dVideoProcessorFormatSupport fR8G8B8A8_UNORM_SRGB;
782 VBSVGA3dVideoProcessorFormatSupport fB8G8R8A8_UNORM_SRGB;
783
784 VBSVGA3dVideoProcessorCaps Caps;
785 VBSVGA3dVideoProcessorRateCaps RateCaps;
786 VBSVGA3dVideoProcessorCustomRateCaps aCustomRateCaps[VBSVGA3D_MAX_VIDEO_CUSTOM_RATE_CAPS];
787 VBSVGA3dVideoProcessorFilterRange aFilterRange[VBSVGA3D_VP_MAX_FILTER_COUNT];
788} VBSVGA3dVideoProcessorEnumInfo;
789
790typedef struct { /* VBSVGA3D_VIDEO_CAPABILITY_PROCESSOR_ENUM */
791 VBSVGA3dVideoProcessorDesc desc; /* In */
792 VBSVGA3dVideoProcessorEnumInfo info;
793} VBSVGA3dProcessorEnumInfo;
794
795/* Layout of memory object for VBSVGA3dCmdDXGetVideoCapability command. */
796typedef struct {
797 uint64 fenceValue; /* Host sets this to VBSVGA3dCmdDXGetVideoCapability::fenceValue after updating the data. */
798 uint32 cbDataOut; /* Size in bytes of data written by host excluding u64Fence and cbDataOut fields. */
799 union
800 {
801 VBSVGA3dDecodeProfileInfo aDecodeProfile[1]; /* [cbDataOut / sizeof(aDecodeProfile[0])] */
802 VBSVGA3dDecodeConfigInfo config;
803 VBSVGA3dProcessorEnumInfo processorEnum;
804 } data;
805} VBSVGA3dVideoCapabilityMobLayout;
806
807typedef struct VBSVGA3dCmdDXGetVideoCapability {
808 VBSVGA3dVideoCapability capability;
809 uint32 mobid;
810 uint32 offsetInBytes;
811 uint32 sizeInBytes;
812 uint64 fenceValue;
813} VBSVGA3dCmdDXGetVideoCapability;
814/* VBSVGA_3D_CMD_DX_GET_VIDEO_CAPABILITY */
815
816typedef struct VBSVGA3dCmdDXClearView
817{
818 uint32 viewId;
819 SVGA3dRGBAFloat color;
820 /* followed by SVGASignedRect array */
821} VBSVGA3dCmdDXClearView;
822/* VBSVGA_3D_CMD_DX_CLEAR_RTV
823 * VBSVGA_3D_CMD_DX_CLEAR_UAV
824 * VBSVGA_3D_CMD_DX_CLEAR_VDOV
825 * VBSVGA_3D_CMD_DX_CLEAR_VPIV
826 * VBSVGA_3D_CMD_DX_CLEAR_VPOV
827 */
828
829#endif /* !VBOX_INCLUDED_SRC_Graphics_vmsvga_include_vbsvga3d_dx_h */
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette