265
274
VBOXVHWACMD_TYPE_SURF_FLIP,
266
275
VBOXVHWACMD_TYPE_SURF_OVERLAY_UPDATE,
267
276
VBOXVHWACMD_TYPE_SURF_OVERLAY_SETPOSITION,
277
VBOXVHWACMD_TYPE_SURF_COLORKEY_SET,
268
278
VBOXVHWACMD_TYPE_QUERY_INFO1,
269
279
VBOXVHWACMD_TYPE_QUERY_INFO2,
270
280
VBOXVHWACMD_TYPE_ENABLE,
271
VBOXVHWACMD_TYPE_DISABLE
281
VBOXVHWACMD_TYPE_DISABLE,
282
VBOXVHWACMD_TYPE_HH_CONSTRUCT,
283
VBOXVHWACMD_TYPE_HH_RESET
272
284
} VBOXVHWACMD_TYPE;
274
286
/* the command processing was asynch, set by the host to indicate asynch command completion
275
287
* must not be cleared once set, the command completion is performed by issuing a host->guest completion command
276
288
* while keeping this flag unchanged */
277
#define VBOXVHWACMD_FLAG_ASYNCH 0x00000001
289
#define VBOXVHWACMD_FLAG_HG_ASYNCH 0x00010000
278
290
/* asynch completion is performed by issuing the event */
279
#define VBOXVHWACMD_FLAG_ASYNCH_EVENT 0x00000002
291
#define VBOXVHWACMD_FLAG_GH_ASYNCH_EVENT 0x00000001
292
/* issue interrupt on asynch completion */
293
#define VBOXVHWACMD_FLAG_GH_ASYNCH_IRQ 0x00000002
294
/* guest does not do any op on completion of this command, the host may copy the command and indicate that it does not need the command anymore
295
* by setting the VBOXVHWACMD_FLAG_HG_ASYNCH_RETURNED flag */
296
#define VBOXVHWACMD_FLAG_GH_ASYNCH_NOCOMPLETION 0x00000004
297
/* the host has copied the VBOXVHWACMD_FLAG_GH_ASYNCH_NOCOMPLETION command and returned it to the guest */
298
#define VBOXVHWACMD_FLAG_HG_ASYNCH_RETURNED 0x00020000
299
/* this is the host->host cmd, i.e. a configuration command posted by the host to the framebuffer */
300
#define VBOXVHWACMD_FLAG_HH_CMD 0x10000000
281
302
typedef struct _VBOXVHWACMD
298
321
#define VBOXVHWACMD_HEADSIZE() (RT_OFFSETOF(VBOXVHWACMD, body))
299
#define VBOXVHWACMD_SIZE(_tCmd) (VBOXVHWACMD_HEADSIZE() + sizeof(_tCmd))
322
#define VBOXVHWACMD_SIZE_FROMBODYSIZE(_s) (VBOXVHWACMD_HEADSIZE() + (_s))
323
#define VBOXVHWACMD_SIZE(_tCmd) (VBOXVHWACMD_SIZE_FROMBODYSIZE(sizeof(_tCmd)))
300
324
typedef unsigned int VBOXVHWACMD_LENGTH;
301
325
typedef uint64_t VBOXVHWA_SURFHANDLE;
302
#define VBOXVHWACMD_SURFHANDLE_INVALID 0
326
#define VBOXVHWA_SURFHANDLE_INVALID 0
303
327
#define VBOXVHWACMD_BODY(_p, _t) ((_t*)(_p)->body)
304
328
#define VBOXVHWACMD_HEAD(_pb) ((VBOXVHWACMD*)((uint8_t *)(_pb) - RT_OFFSETOF(VBOXVHWACMD, body)))
306
330
typedef struct _VBOXVHWA_RECTL
312
336
} VBOXVHWA_RECTL;
314
338
typedef struct _VBOXVHWA_COLORKEY
381
416
uint32_t Reserved1;
383
418
uint32_t Reserved2;
384
419
VBOXVHWA_COLORKEY DstCK;
385
420
VBOXVHWA_COLORKEY SrcCK;
386
421
} VBOXVHWA_OVERLAYFX;
388
#define VBOXVHWA_CAPS_BLT 0x00000001
389
#define VBOXVHWA_CAPS_BLTCOLORFILL 0x00000002
390
#define VBOXVHWA_CAPS_BLTFOURCC 0x00000004
391
#define VBOXVHWA_CAPS_BLTSTRETCH 0x00000008
392
#define VBOXVHWA_CAPS_BLTQUEUE 0x00000010
394
#define VBOXVHWA_CAPS_OVERLAY 0x00000100
395
#define VBOXVHWA_CAPS_OVERLAYFOURCC 0x00000200
396
#define VBOXVHWA_CAPS_OVERLAYSTRETCH 0x00000400
398
#define VBOXVHWA_CAPS_COLORKEY 0x00010000
399
#define VBOXVHWA_CAPS_COLORKEYHWASSIST 0x00020000
402
#define VBOXVHWA_CAPS2_COPYFOURCC 0x00000001
404
#define VBOXVHWA_SCAPS_FLIP 0x00000001
405
#define VBOXVHWA_SCAPS_PRIMARYSURFACE 0x00000002
406
#define VBOXVHWA_SCAPS_OFFSCREENPLAIN 0x00000004
407
#define VBOXVHWA_SCAPS_OVERLAY 0x00000008
408
#define VBOXVHWA_SCAPS_VISIBLE 0x00000010
409
#define VBOXVHWA_SCAPS_VIDEOMEMORY 0x00000020
410
#define VBOXVHWA_SCAPS_LOCALVIDMEM 0x00000040
413
#define VBOXVHWA_PF_RGB 0x00000001
414
#define VBOXVHWA_PF_RGBTOYUV 0x00000002
415
#define VBOXVHWA_PF_YUV 0x00000008
416
#define VBOXVHWA_PF_FOURCC 0x00000010
418
#define VBOXVHWA_LOCK_DISCARDCONTENTS 0x00000001
423
#define VBOXVHWA_CAPS_BLT 0x00000040
424
#define VBOXVHWA_CAPS_BLTCOLORFILL 0x04000000
425
#define VBOXVHWA_CAPS_BLTFOURCC 0x00000100
426
#define VBOXVHWA_CAPS_BLTSTRETCH 0x00000200
427
#define VBOXVHWA_CAPS_BLTQUEUE 0x00000080
429
#define VBOXVHWA_CAPS_OVERLAY 0x00000800
430
#define VBOXVHWA_CAPS_OVERLAYFOURCC 0x00002000
431
#define VBOXVHWA_CAPS_OVERLAYSTRETCH 0x00004000
432
#define VBOXVHWA_CAPS_OVERLAYCANTCLIP 0x00001000
434
#define VBOXVHWA_CAPS_COLORKEY 0x00400000
435
#define VBOXVHWA_CAPS_COLORKEYHWASSIST 0x01000000
437
#define VBOXVHWA_SCAPS_BACKBUFFER 0x00000004
438
#define VBOXVHWA_SCAPS_COMPLEX 0x00000008
439
#define VBOXVHWA_SCAPS_FLIP 0x00000010
440
#define VBOXVHWA_SCAPS_FRONTBUFFER 0x00000020
441
#define VBOXVHWA_SCAPS_OFFSCREENPLAIN 0x00000040
442
#define VBOXVHWA_SCAPS_OVERLAY 0x00000080
443
#define VBOXVHWA_SCAPS_PRIMARYSURFACE 0x00000200
444
#define VBOXVHWA_SCAPS_SYSTEMMEMORY 0x00000800
445
#define VBOXVHWA_SCAPS_VIDEOMEMORY 0x00004000
446
#define VBOXVHWA_SCAPS_VISIBLE 0x00008000
447
#define VBOXVHWA_SCAPS_LOCALVIDMEM 0x10000000
449
#define VBOXVHWA_PF_RGB 0x00000040
450
#define VBOXVHWA_PF_RGBTOYUV 0x00000100
451
#define VBOXVHWA_PF_YUV 0x00000200
452
#define VBOXVHWA_PF_FOURCC 0x00000004
454
#define VBOXVHWA_LOCK_DISCARDCONTENTS 0x00002000
420
456
#define VBOXVHWA_CFG_ENABLED 0x00000001
422
#define VBOXVHWA_SD_BACKBUFFERCOUNT 0x00000001
423
#define VBOXVHWA_SD_CAPS 0x00000002
424
#define VBOXVHWA_SD_CKDESTBLT 0x00000004
425
#define VBOXVHWA_SD_CKDESTOVERLAY 0x00000008
426
#define VBOXVHWA_SD_CKSRCBLT 0x00000010
427
#define VBOXVHWA_SD_CKSRCOVERLAY 0x00000020
428
#define VBOXVHWA_SD_HEIGHT 0x00000040
429
#define VBOXVHWA_SD_PITCH 0x00000080
430
#define VBOXVHWA_SD_PIXELFORMAT 0x00000100
431
//#define VBOXVHWA_SD_REFRESHRATE 0x00000200
432
#define VBOXVHWA_SD_WIDTH 0x00000400
458
#define VBOXVHWA_SD_BACKBUFFERCOUNT 0x00000020
459
#define VBOXVHWA_SD_CAPS 0x00000001
460
#define VBOXVHWA_SD_CKDESTBLT 0x00004000
461
#define VBOXVHWA_SD_CKDESTOVERLAY 0x00002000
462
#define VBOXVHWA_SD_CKSRCBLT 0x00010000
463
#define VBOXVHWA_SD_CKSRCOVERLAY 0x00008000
464
#define VBOXVHWA_SD_HEIGHT 0x00000002
465
#define VBOXVHWA_SD_PITCH 0x00000008
466
#define VBOXVHWA_SD_PIXELFORMAT 0x00001000
467
//#define VBOXVHWA_SD_REFRESHRATE 0x00040000
468
#define VBOXVHWA_SD_WIDTH 0x00000004
434
470
#define VBOXVHWA_CKEYCAPS_DESTBLT 0x00000001
435
471
#define VBOXVHWA_CKEYCAPS_DESTBLTCLRSPACE 0x00000002
440
476
#define VBOXVHWA_CKEYCAPS_DESTOVERLAYCLRSPACEYUV 0x00000040
441
477
#define VBOXVHWA_CKEYCAPS_DESTOVERLAYONEACTIVE 0x00000080
442
478
#define VBOXVHWA_CKEYCAPS_DESTOVERLAYYUV 0x00000100
443
#define VBOXVHWA_CKEYCAPS_NOCOSTOVERLAY 0x00000200
444
#define VBOXVHWA_CKEYCAPS_SRCBLT 0x00000400
445
#define VBOXVHWA_CKEYCAPS_SRCBLTCLRSPACE 0x00000800
446
#define VBOXVHWA_CKEYCAPS_SRCBLTCLRSPACEYUV 0x00001000
447
#define VBOXVHWA_CKEYCAPS_SRCBLTYUV 0x00002000
448
#define VBOXVHWA_CKEYCAPS_SRCOVERLAY 0x00004000
449
#define VBOXVHWA_CKEYCAPS_SRCOVERLAYCLRSPACE 0x00008000
450
#define VBOXVHWA_CKEYCAPS_SRCOVERLAYCLRSPACEYUV 0x00010000
451
#define VBOXVHWA_CKEYCAPS_SRCOVERLAYONEACTIVE 0x00020000
452
#define VBOXVHWA_CKEYCAPS_SRCOVERLAYYUV 0x00040000
479
#define VBOXVHWA_CKEYCAPS_SRCBLT 0x00000200
480
#define VBOXVHWA_CKEYCAPS_SRCBLTCLRSPACE 0x00000400
481
#define VBOXVHWA_CKEYCAPS_SRCBLTCLRSPACEYUV 0x00000800
482
#define VBOXVHWA_CKEYCAPS_SRCBLTYUV 0x00001000
483
#define VBOXVHWA_CKEYCAPS_SRCOVERLAY 0x00002000
484
#define VBOXVHWA_CKEYCAPS_SRCOVERLAYCLRSPACE 0x00004000
485
#define VBOXVHWA_CKEYCAPS_SRCOVERLAYCLRSPACEYUV 0x00008000
486
#define VBOXVHWA_CKEYCAPS_SRCOVERLAYONEACTIVE 0x00010000
487
#define VBOXVHWA_CKEYCAPS_SRCOVERLAYYUV 0x00020000
488
#define VBOXVHWA_CKEYCAPS_NOCOSTOVERLAY 0x00040000
455
490
#define VBOXVHWA_BLT_COLORFILL 0x00000400
456
491
#define VBOXVHWA_BLT_DDFX 0x00000800
464
499
#define VBOXVHWA_BLT_ROP 0x00020000
469
#define VBOXVHWA_OFFSET64_VOID (~0L)
502
#define VBOXVHWA_OVER_DDFX 0x00080000
503
#define VBOXVHWA_OVER_HIDE 0x00000200
504
#define VBOXVHWA_OVER_KEYDEST 0x00000400
505
#define VBOXVHWA_OVER_KEYDESTOVERRIDE 0x00000800
506
#define VBOXVHWA_OVER_KEYSRC 0x00001000
507
#define VBOXVHWA_OVER_KEYSRCOVERRIDE 0x00002000
508
#define VBOXVHWA_OVER_SHOW 0x00004000
510
#define VBOXVHWA_CKEY_COLORSPACE 0x00000001
511
#define VBOXVHWA_CKEY_DESTBLT 0x00000002
512
#define VBOXVHWA_CKEY_DESTOVERLAY 0x00000004
513
#define VBOXVHWA_CKEY_SRCBLT 0x00000008
514
#define VBOXVHWA_CKEY_SRCOVERLAY 0x00000010
516
#define VBOXVHWA_BLT_ARITHSTRETCHY 0x00000001
517
#define VBOXVHWA_BLT_MIRRORLEFTRIGHT 0x00000002
518
#define VBOXVHWA_BLT_MIRRORUPDOWN 0x00000004
520
#define VBOXVHWA_OVERFX_ARITHSTRETCHY 0x00000001
521
#define VBOXVHWA_OVERFX_MIRRORLEFTRIGHT 0x00000002
522
#define VBOXVHWA_OVERFX_MIRRORUPDOWN 0x00000004
524
#define VBOXVHWA_CAPS2_CANRENDERWINDOWED 0x00080000
525
#define VBOXVHWA_CAPS2_WIDESURFACES 0x00001000
526
#define VBOXVHWA_CAPS2_COPYFOURCC 0x00008000
527
//#define VBOXVHWA_CAPS2_FLIPINTERVAL 0x00200000
528
//#define VBOXVHWA_CAPS2_FLIPNOVSYNC 0x00400000
531
#define VBOXVHWA_OFFSET64_VOID (UINT64_MAX)
533
typedef struct _VBOXVHWA_VERSION
471
541
typedef struct _VBOXVHWACMD_QUERYINFO1
475
uint32_t colorKeyCaps;
476
uint32_t stretchCaps;
477
uint32_t surfaceCaps;
478
uint32_t numOverlays;
547
VBOXVHWA_VERSION guestVersion;
556
uint32_t colorKeyCaps;
558
uint32_t stretchCaps;
559
uint32_t surfaceCaps;
561
uint32_t numOverlays;
562
uint32_t curOverlays;
481
568
} VBOXVHWACMD_QUERYINFO1;
483
570
typedef struct _VBOXVHWACMD_QUERYINFO2
486
573
uint32_t FourCC[1];
487
574
} VBOXVHWACMD_QUERYINFO2;
489
#define VBOXVHWAINFO2_SIZE(_cFourCC) RT_OFFSETOF(VBOXVHWAINFO2, FourCC[_cFourCC])
576
#define VBOXVHWAINFO2_SIZE(_cFourCC) RT_OFFSETOF(VBOXVHWACMD_QUERYINFO2, FourCC[_cFourCC])
491
578
typedef struct _VBOXVHWACMD_SURF_CANCREATE
580
VBOXVHWA_SURFACEDESC SurfInfo;
497
VBOXVHWA_SURFACEDESC SurfInfo;
498
585
uint32_t bIsDifferentPixelFormat;
499
586
uint32_t Reserved;
507
594
} VBOXVHWACMD_SURF_CANCREATE;
509
596
typedef struct _VBOXVHWACMD_SURF_CREATE
515
VBOXVHWA_SURFACEDESC SurfInfo;
521
VBOXVHWA_SURFHANDLE hSurf;
598
VBOXVHWA_SURFACEDESC SurfInfo;
524
599
} VBOXVHWACMD_SURF_CREATE;
526
601
typedef struct _VBOXVHWACMD_SURF_DESTROY
575
653
uint64_t offSrcSurface;
576
654
VBOXVHWA_RECTL srcRect;
656
uint32_t xUpdatedSrcMemValid;
579
657
VBOXVHWA_BLTFX desc;
658
VBOXVHWA_RECTL xUpdatedSrcMemRect;
582
661
} VBOXVHWACMD_SURF_BLT;
663
typedef struct _VBOXVHWACMD_SURF_FLIP
665
uint64_t TargGuestSurfInfo;
666
uint64_t CurrGuestSurfInfo;
671
VBOXVHWA_SURFHANDLE hTargSurf;
672
uint64_t offTargSurface;
673
VBOXVHWA_SURFHANDLE hCurrSurf;
674
uint64_t offCurrSurface;
676
uint32_t xUpdatedTargMemValid;
677
VBOXVHWA_RECTL xUpdatedTargMemRect;
680
} VBOXVHWACMD_SURF_FLIP;
682
typedef struct _VBOXVHWACMD_SURF_COLORKEY_SET
688
VBOXVHWA_SURFHANDLE hSurf;
690
VBOXVHWA_COLORKEY CKey;
695
} VBOXVHWACMD_SURF_COLORKEY_SET;
584
697
typedef struct _VBOXVHWACMD_SURF_OVERLAY_UPDATE
619
733
} VBOXVHWACMD_SURF_OVERLAY_SETPOSITION;
735
typedef struct _VBOXVHWACMD_HH_CONSTRUCT
738
} VBOXVHWACMD_HH_CONSTRUCT;
740
typedef DECLCALLBACK(void) FNVBOXVHWA_HH_CALLBACK(void*);
741
typedef FNVBOXVHWA_HH_CALLBACK *PFNVBOXVHWA_HH_CALLBACK;
743
#define VBOXVHWA_HH_CALLBACK_SET(_pCmd, _pfn, _parg) \
745
(_pCmd)->GuestVBVAReserved1 = (uint64_t)(_pfn); \
746
(_pCmd)->GuestVBVAReserved2 = (uint64_t)(_parg); \
749
#define VBOXVHWA_HH_CALLBACK_GET(_pCmd) ((PFNVBOXVHWA_HH_CALLBACK)(_pCmd)->GuestVBVAReserved1)
750
#define VBOXVHWA_HH_CALLBACK_GET_ARG(_pCmd) ((void*)(_pCmd)->GuestVBVAReserved2)
622
753
# endif /* #ifdef VBOX_WITH_VIDEOHWACCEL */